vendor.js 627 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!*********************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  6. \*********************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.default = void 0;
  14. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  15. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  16. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  17. return this;
  18. }();
  19. var key = ['w', 'x'].join('');
  20. var oldWx = target[key];
  21. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  22. function isWxKey(key) {
  23. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  24. return false;
  25. }
  26. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  27. }
  28. function initWx() {
  29. var newWx = {};
  30. for (var _key in oldWx) {
  31. if (isWxKey(_key)) {
  32. // TODO wrapper function
  33. newWx[_key] = oldWx[_key];
  34. }
  35. }
  36. return newWx;
  37. }
  38. target[key] = initWx();
  39. var _default = target[key];
  40. exports.default = _default;
  41. /***/ }),
  42. /* 2 */
  43. /*!************************************************************!*\
  44. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  45. \************************************************************/
  46. /*! no static exports found */
  47. /***/ (function(module, exports, __webpack_require__) {
  48. "use strict";
  49. /* WEBPACK VAR INJECTION */(function(wx, global) {
  50. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  51. Object.defineProperty(exports, "__esModule", {
  52. value: true
  53. });
  54. exports.createApp = createApp;
  55. exports.createComponent = createComponent;
  56. exports.createPage = createPage;
  57. exports.createPlugin = createPlugin;
  58. exports.createSubpackageApp = createSubpackageApp;
  59. exports.default = void 0;
  60. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  61. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  62. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  63. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  64. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  65. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  66. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  67. 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; }
  68. 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; }
  69. var realAtob;
  70. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  71. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  72. if (typeof atob !== 'function') {
  73. realAtob = function realAtob(str) {
  74. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  75. if (!b64re.test(str)) {
  76. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  77. }
  78. // Adding the padding if missing, for semplicity
  79. str += '=='.slice(2 - (str.length & 3));
  80. var bitmap;
  81. var result = '';
  82. var r1;
  83. var r2;
  84. var i = 0;
  85. for (; i < str.length;) {
  86. 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++)));
  87. 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);
  88. }
  89. return result;
  90. };
  91. } else {
  92. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  93. realAtob = atob;
  94. }
  95. function b64DecodeUnicode(str) {
  96. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  97. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  98. }).join(''));
  99. }
  100. function getCurrentUserInfo() {
  101. var token = wx.getStorageSync('uni_id_token') || '';
  102. var tokenArr = token.split('.');
  103. if (!token || tokenArr.length !== 3) {
  104. return {
  105. uid: null,
  106. role: [],
  107. permission: [],
  108. tokenExpired: 0
  109. };
  110. }
  111. var userInfo;
  112. try {
  113. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  114. } catch (error) {
  115. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  116. }
  117. userInfo.tokenExpired = userInfo.exp * 1000;
  118. delete userInfo.exp;
  119. delete userInfo.iat;
  120. return userInfo;
  121. }
  122. function uniIdMixin(Vue) {
  123. Vue.prototype.uniIDHasRole = function (roleId) {
  124. var _getCurrentUserInfo = getCurrentUserInfo(),
  125. role = _getCurrentUserInfo.role;
  126. return role.indexOf(roleId) > -1;
  127. };
  128. Vue.prototype.uniIDHasPermission = function (permissionId) {
  129. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  130. permission = _getCurrentUserInfo2.permission;
  131. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  132. };
  133. Vue.prototype.uniIDTokenValid = function () {
  134. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  135. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  136. return tokenExpired > Date.now();
  137. };
  138. }
  139. var _toString = Object.prototype.toString;
  140. var hasOwnProperty = Object.prototype.hasOwnProperty;
  141. function isFn(fn) {
  142. return typeof fn === 'function';
  143. }
  144. function isStr(str) {
  145. return typeof str === 'string';
  146. }
  147. function isObject(obj) {
  148. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  149. }
  150. function isPlainObject(obj) {
  151. return _toString.call(obj) === '[object Object]';
  152. }
  153. function hasOwn(obj, key) {
  154. return hasOwnProperty.call(obj, key);
  155. }
  156. function noop() {}
  157. /**
  158. * Create a cached version of a pure function.
  159. */
  160. function cached(fn) {
  161. var cache = Object.create(null);
  162. return function cachedFn(str) {
  163. var hit = cache[str];
  164. return hit || (cache[str] = fn(str));
  165. };
  166. }
  167. /**
  168. * Camelize a hyphen-delimited string.
  169. */
  170. var camelizeRE = /-(\w)/g;
  171. var camelize = cached(function (str) {
  172. return str.replace(camelizeRE, function (_, c) {
  173. return c ? c.toUpperCase() : '';
  174. });
  175. });
  176. function sortObject(obj) {
  177. var sortObj = {};
  178. if (isPlainObject(obj)) {
  179. Object.keys(obj).sort().forEach(function (key) {
  180. sortObj[key] = obj[key];
  181. });
  182. }
  183. return !Object.keys(sortObj) ? obj : sortObj;
  184. }
  185. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  186. var globalInterceptors = {};
  187. var scopedInterceptors = {};
  188. function mergeHook(parentVal, childVal) {
  189. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  190. return res ? dedupeHooks(res) : res;
  191. }
  192. function dedupeHooks(hooks) {
  193. var res = [];
  194. for (var i = 0; i < hooks.length; i++) {
  195. if (res.indexOf(hooks[i]) === -1) {
  196. res.push(hooks[i]);
  197. }
  198. }
  199. return res;
  200. }
  201. function removeHook(hooks, hook) {
  202. var index = hooks.indexOf(hook);
  203. if (index !== -1) {
  204. hooks.splice(index, 1);
  205. }
  206. }
  207. function mergeInterceptorHook(interceptor, option) {
  208. Object.keys(option).forEach(function (hook) {
  209. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  210. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  211. }
  212. });
  213. }
  214. function removeInterceptorHook(interceptor, option) {
  215. if (!interceptor || !option) {
  216. return;
  217. }
  218. Object.keys(option).forEach(function (hook) {
  219. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  220. removeHook(interceptor[hook], option[hook]);
  221. }
  222. });
  223. }
  224. function addInterceptor(method, option) {
  225. if (typeof method === 'string' && isPlainObject(option)) {
  226. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  227. } else if (isPlainObject(method)) {
  228. mergeInterceptorHook(globalInterceptors, method);
  229. }
  230. }
  231. function removeInterceptor(method, option) {
  232. if (typeof method === 'string') {
  233. if (isPlainObject(option)) {
  234. removeInterceptorHook(scopedInterceptors[method], option);
  235. } else {
  236. delete scopedInterceptors[method];
  237. }
  238. } else if (isPlainObject(method)) {
  239. removeInterceptorHook(globalInterceptors, method);
  240. }
  241. }
  242. function wrapperHook(hook) {
  243. return function (data) {
  244. return hook(data) || data;
  245. };
  246. }
  247. function isPromise(obj) {
  248. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  249. }
  250. function queue(hooks, data) {
  251. var promise = false;
  252. for (var i = 0; i < hooks.length; i++) {
  253. var hook = hooks[i];
  254. if (promise) {
  255. promise = Promise.resolve(wrapperHook(hook));
  256. } else {
  257. var res = hook(data);
  258. if (isPromise(res)) {
  259. promise = Promise.resolve(res);
  260. }
  261. if (res === false) {
  262. return {
  263. then: function then() {}
  264. };
  265. }
  266. }
  267. }
  268. return promise || {
  269. then: function then(callback) {
  270. return callback(data);
  271. }
  272. };
  273. }
  274. function wrapperOptions(interceptor) {
  275. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  276. ['success', 'fail', 'complete'].forEach(function (name) {
  277. if (Array.isArray(interceptor[name])) {
  278. var oldCallback = options[name];
  279. options[name] = function callbackInterceptor(res) {
  280. queue(interceptor[name], res).then(function (res) {
  281. /* eslint-disable no-mixed-operators */
  282. return isFn(oldCallback) && oldCallback(res) || res;
  283. });
  284. };
  285. }
  286. });
  287. return options;
  288. }
  289. function wrapperReturnValue(method, returnValue) {
  290. var returnValueHooks = [];
  291. if (Array.isArray(globalInterceptors.returnValue)) {
  292. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  293. }
  294. var interceptor = scopedInterceptors[method];
  295. if (interceptor && Array.isArray(interceptor.returnValue)) {
  296. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  297. }
  298. returnValueHooks.forEach(function (hook) {
  299. returnValue = hook(returnValue) || returnValue;
  300. });
  301. return returnValue;
  302. }
  303. function getApiInterceptorHooks(method) {
  304. var interceptor = Object.create(null);
  305. Object.keys(globalInterceptors).forEach(function (hook) {
  306. if (hook !== 'returnValue') {
  307. interceptor[hook] = globalInterceptors[hook].slice();
  308. }
  309. });
  310. var scopedInterceptor = scopedInterceptors[method];
  311. if (scopedInterceptor) {
  312. Object.keys(scopedInterceptor).forEach(function (hook) {
  313. if (hook !== 'returnValue') {
  314. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  315. }
  316. });
  317. }
  318. return interceptor;
  319. }
  320. function invokeApi(method, api, options) {
  321. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  322. params[_key - 3] = arguments[_key];
  323. }
  324. var interceptor = getApiInterceptorHooks(method);
  325. if (interceptor && Object.keys(interceptor).length) {
  326. if (Array.isArray(interceptor.invoke)) {
  327. var res = queue(interceptor.invoke, options);
  328. return res.then(function (options) {
  329. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  330. });
  331. } else {
  332. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  333. }
  334. }
  335. return api.apply(void 0, [options].concat(params));
  336. }
  337. var promiseInterceptor = {
  338. returnValue: function returnValue(res) {
  339. if (!isPromise(res)) {
  340. return res;
  341. }
  342. return new Promise(function (resolve, reject) {
  343. res.then(function (res) {
  344. if (res[0]) {
  345. reject(res[0]);
  346. } else {
  347. resolve(res[1]);
  348. }
  349. });
  350. });
  351. }
  352. };
  353. 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/;
  354. var CONTEXT_API_RE = /^create|Manager$/;
  355. // Context例外情况
  356. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  357. // 同步例外情况
  358. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  359. var CALLBACK_API_RE = /^on|^off/;
  360. function isContextApi(name) {
  361. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  362. }
  363. function isSyncApi(name) {
  364. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  365. }
  366. function isCallbackApi(name) {
  367. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  368. }
  369. function handlePromise(promise) {
  370. return promise.then(function (data) {
  371. return [null, data];
  372. }).catch(function (err) {
  373. return [err];
  374. });
  375. }
  376. function shouldPromise(name) {
  377. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  378. return false;
  379. }
  380. return true;
  381. }
  382. /* eslint-disable no-extend-native */
  383. if (!Promise.prototype.finally) {
  384. Promise.prototype.finally = function (callback) {
  385. var promise = this.constructor;
  386. return this.then(function (value) {
  387. return promise.resolve(callback()).then(function () {
  388. return value;
  389. });
  390. }, function (reason) {
  391. return promise.resolve(callback()).then(function () {
  392. throw reason;
  393. });
  394. });
  395. };
  396. }
  397. function promisify(name, api) {
  398. if (!shouldPromise(name) || !isFn(api)) {
  399. return api;
  400. }
  401. return function promiseApi() {
  402. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  403. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  404. params[_key2 - 1] = arguments[_key2];
  405. }
  406. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  407. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  408. }
  409. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  410. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  411. success: resolve,
  412. fail: reject
  413. })].concat(params));
  414. })));
  415. };
  416. }
  417. var EPS = 1e-4;
  418. var BASE_DEVICE_WIDTH = 750;
  419. var isIOS = false;
  420. var deviceWidth = 0;
  421. var deviceDPR = 0;
  422. function checkDeviceWidth() {
  423. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  424. platform = _wx$getSystemInfoSync.platform,
  425. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  426. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  427. deviceWidth = windowWidth;
  428. deviceDPR = pixelRatio;
  429. isIOS = platform === 'ios';
  430. }
  431. function upx2px(number, newDeviceWidth) {
  432. if (deviceWidth === 0) {
  433. checkDeviceWidth();
  434. }
  435. number = Number(number);
  436. if (number === 0) {
  437. return 0;
  438. }
  439. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  440. if (result < 0) {
  441. result = -result;
  442. }
  443. result = Math.floor(result + EPS);
  444. if (result === 0) {
  445. if (deviceDPR === 1 || !isIOS) {
  446. result = 1;
  447. } else {
  448. result = 0.5;
  449. }
  450. }
  451. return number < 0 ? -result : result;
  452. }
  453. var LOCALE_ZH_HANS = 'zh-Hans';
  454. var LOCALE_ZH_HANT = 'zh-Hant';
  455. var LOCALE_EN = 'en';
  456. var LOCALE_FR = 'fr';
  457. var LOCALE_ES = 'es';
  458. var messages = {};
  459. var locale;
  460. {
  461. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  462. }
  463. function initI18nMessages() {
  464. if (!isEnableLocale()) {
  465. return;
  466. }
  467. var localeKeys = Object.keys(__uniConfig.locales);
  468. if (localeKeys.length) {
  469. localeKeys.forEach(function (locale) {
  470. var curMessages = messages[locale];
  471. var userMessages = __uniConfig.locales[locale];
  472. if (curMessages) {
  473. Object.assign(curMessages, userMessages);
  474. } else {
  475. messages[locale] = userMessages;
  476. }
  477. });
  478. }
  479. }
  480. initI18nMessages();
  481. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  482. var t = i18n.t;
  483. var i18nMixin = i18n.mixin = {
  484. beforeCreate: function beforeCreate() {
  485. var _this = this;
  486. var unwatch = i18n.i18n.watchLocale(function () {
  487. _this.$forceUpdate();
  488. });
  489. this.$once('hook:beforeDestroy', function () {
  490. unwatch();
  491. });
  492. },
  493. methods: {
  494. $$t: function $$t(key, values) {
  495. return t(key, values);
  496. }
  497. }
  498. };
  499. var setLocale = i18n.setLocale;
  500. var getLocale = i18n.getLocale;
  501. function initAppLocale(Vue, appVm, locale) {
  502. var state = Vue.observable({
  503. locale: locale || i18n.getLocale()
  504. });
  505. var localeWatchers = [];
  506. appVm.$watchLocale = function (fn) {
  507. localeWatchers.push(fn);
  508. };
  509. Object.defineProperty(appVm, '$locale', {
  510. get: function get() {
  511. return state.locale;
  512. },
  513. set: function set(v) {
  514. state.locale = v;
  515. localeWatchers.forEach(function (watch) {
  516. return watch(v);
  517. });
  518. }
  519. });
  520. }
  521. function isEnableLocale() {
  522. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  523. }
  524. function include(str, parts) {
  525. return !!parts.find(function (part) {
  526. return str.indexOf(part) !== -1;
  527. });
  528. }
  529. function startsWith(str, parts) {
  530. return parts.find(function (part) {
  531. return str.indexOf(part) === 0;
  532. });
  533. }
  534. function normalizeLocale(locale, messages) {
  535. if (!locale) {
  536. return;
  537. }
  538. locale = locale.trim().replace(/_/g, '-');
  539. if (messages && messages[locale]) {
  540. return locale;
  541. }
  542. locale = locale.toLowerCase();
  543. if (locale === 'chinese') {
  544. // 支付宝
  545. return LOCALE_ZH_HANS;
  546. }
  547. if (locale.indexOf('zh') === 0) {
  548. if (locale.indexOf('-hans') > -1) {
  549. return LOCALE_ZH_HANS;
  550. }
  551. if (locale.indexOf('-hant') > -1) {
  552. return LOCALE_ZH_HANT;
  553. }
  554. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  555. return LOCALE_ZH_HANT;
  556. }
  557. return LOCALE_ZH_HANS;
  558. }
  559. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  560. if (lang) {
  561. return lang;
  562. }
  563. }
  564. // export function initI18n() {
  565. // const localeKeys = Object.keys(__uniConfig.locales || {})
  566. // if (localeKeys.length) {
  567. // localeKeys.forEach((locale) =>
  568. // i18n.add(locale, __uniConfig.locales[locale])
  569. // )
  570. // }
  571. // }
  572. function getLocale$1() {
  573. // 优先使用 $locale
  574. if (isFn(getApp)) {
  575. var app = getApp({
  576. allowDefault: true
  577. });
  578. if (app && app.$vm) {
  579. return app.$vm.$locale;
  580. }
  581. }
  582. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  583. }
  584. function setLocale$1(locale) {
  585. var app = isFn(getApp) ? getApp() : false;
  586. if (!app) {
  587. return false;
  588. }
  589. var oldLocale = app.$vm.$locale;
  590. if (oldLocale !== locale) {
  591. app.$vm.$locale = locale;
  592. onLocaleChangeCallbacks.forEach(function (fn) {
  593. return fn({
  594. locale: locale
  595. });
  596. });
  597. return true;
  598. }
  599. return false;
  600. }
  601. var onLocaleChangeCallbacks = [];
  602. function onLocaleChange(fn) {
  603. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  604. onLocaleChangeCallbacks.push(fn);
  605. }
  606. }
  607. if (typeof global !== 'undefined') {
  608. global.getLocale = getLocale$1;
  609. }
  610. var interceptors = {
  611. promiseInterceptor: promiseInterceptor
  612. };
  613. var baseApi = /*#__PURE__*/Object.freeze({
  614. __proto__: null,
  615. upx2px: upx2px,
  616. getLocale: getLocale$1,
  617. setLocale: setLocale$1,
  618. onLocaleChange: onLocaleChange,
  619. addInterceptor: addInterceptor,
  620. removeInterceptor: removeInterceptor,
  621. interceptors: interceptors
  622. });
  623. function findExistsPageIndex(url) {
  624. var pages = getCurrentPages();
  625. var len = pages.length;
  626. while (len--) {
  627. var page = pages[len];
  628. if (page.$page && page.$page.fullPath === url) {
  629. return len;
  630. }
  631. }
  632. return -1;
  633. }
  634. var redirectTo = {
  635. name: function name(fromArgs) {
  636. if (fromArgs.exists === 'back' && fromArgs.delta) {
  637. return 'navigateBack';
  638. }
  639. return 'redirectTo';
  640. },
  641. args: function args(fromArgs) {
  642. if (fromArgs.exists === 'back' && fromArgs.url) {
  643. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  644. if (existsPageIndex !== -1) {
  645. var delta = getCurrentPages().length - 1 - existsPageIndex;
  646. if (delta > 0) {
  647. fromArgs.delta = delta;
  648. }
  649. }
  650. }
  651. }
  652. };
  653. var previewImage = {
  654. args: function args(fromArgs) {
  655. var currentIndex = parseInt(fromArgs.current);
  656. if (isNaN(currentIndex)) {
  657. return;
  658. }
  659. var urls = fromArgs.urls;
  660. if (!Array.isArray(urls)) {
  661. return;
  662. }
  663. var len = urls.length;
  664. if (!len) {
  665. return;
  666. }
  667. if (currentIndex < 0) {
  668. currentIndex = 0;
  669. } else if (currentIndex >= len) {
  670. currentIndex = len - 1;
  671. }
  672. if (currentIndex > 0) {
  673. fromArgs.current = urls[currentIndex];
  674. fromArgs.urls = urls.filter(function (item, index) {
  675. return index < currentIndex ? item !== urls[currentIndex] : true;
  676. });
  677. } else {
  678. fromArgs.current = urls[0];
  679. }
  680. return {
  681. indicator: false,
  682. loop: false
  683. };
  684. }
  685. };
  686. var UUID_KEY = '__DC_STAT_UUID';
  687. var deviceId;
  688. function useDeviceId(result) {
  689. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  690. if (!deviceId) {
  691. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  692. wx.setStorage({
  693. key: UUID_KEY,
  694. data: deviceId
  695. });
  696. }
  697. result.deviceId = deviceId;
  698. }
  699. function addSafeAreaInsets(result) {
  700. if (result.safeArea) {
  701. var safeArea = result.safeArea;
  702. result.safeAreaInsets = {
  703. top: safeArea.top,
  704. left: safeArea.left,
  705. right: result.windowWidth - safeArea.right,
  706. bottom: result.screenHeight - safeArea.bottom
  707. };
  708. }
  709. }
  710. function populateParameters(result) {
  711. var _result$brand = result.brand,
  712. brand = _result$brand === void 0 ? '' : _result$brand,
  713. _result$model = result.model,
  714. model = _result$model === void 0 ? '' : _result$model,
  715. _result$system = result.system,
  716. system = _result$system === void 0 ? '' : _result$system,
  717. _result$language = result.language,
  718. language = _result$language === void 0 ? '' : _result$language,
  719. theme = result.theme,
  720. version = result.version,
  721. platform = result.platform,
  722. fontSizeSetting = result.fontSizeSetting,
  723. SDKVersion = result.SDKVersion,
  724. pixelRatio = result.pixelRatio,
  725. deviceOrientation = result.deviceOrientation;
  726. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  727. var extraParam = {};
  728. // osName osVersion
  729. var osName = '';
  730. var osVersion = '';
  731. {
  732. osName = system.split(' ')[0] || '';
  733. osVersion = system.split(' ')[1] || '';
  734. }
  735. var hostVersion = version;
  736. // deviceType
  737. var deviceType = getGetDeviceType(result, model);
  738. // deviceModel
  739. var deviceBrand = getDeviceBrand(brand);
  740. // hostName
  741. var _hostName = getHostName(result);
  742. // deviceOrientation
  743. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  744. // devicePixelRatio
  745. var _devicePixelRatio = pixelRatio;
  746. // SDKVersion
  747. var _SDKVersion = SDKVersion;
  748. // hostLanguage
  749. var hostLanguage = language.replace(/_/g, '-');
  750. // wx.getAccountInfoSync
  751. var parameters = {
  752. appId: "__UNI__50B3EE1",
  753. appName: "wx-app-new",
  754. appVersion: "1.0.0",
  755. appVersionCode: "100",
  756. appLanguage: getAppLanguage(hostLanguage),
  757. uniCompileVersion: "3.7.9",
  758. uniRuntimeVersion: "3.7.9",
  759. uniPlatform: undefined || "mp-weixin",
  760. deviceBrand: deviceBrand,
  761. deviceModel: model,
  762. deviceType: deviceType,
  763. devicePixelRatio: _devicePixelRatio,
  764. deviceOrientation: _deviceOrientation,
  765. osName: osName.toLocaleLowerCase(),
  766. osVersion: osVersion,
  767. hostTheme: theme,
  768. hostVersion: hostVersion,
  769. hostLanguage: hostLanguage,
  770. hostName: _hostName,
  771. hostSDKVersion: _SDKVersion,
  772. hostFontSizeSetting: fontSizeSetting,
  773. windowTop: 0,
  774. windowBottom: 0,
  775. // TODO
  776. osLanguage: undefined,
  777. osTheme: undefined,
  778. ua: undefined,
  779. hostPackageName: undefined,
  780. browserName: undefined,
  781. browserVersion: undefined
  782. };
  783. Object.assign(result, parameters, extraParam);
  784. }
  785. function getGetDeviceType(result, model) {
  786. var deviceType = result.deviceType || 'phone';
  787. {
  788. var deviceTypeMaps = {
  789. ipad: 'pad',
  790. windows: 'pc',
  791. mac: 'pc'
  792. };
  793. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  794. var _model = model.toLocaleLowerCase();
  795. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  796. var _m = deviceTypeMapsKeys[index];
  797. if (_model.indexOf(_m) !== -1) {
  798. deviceType = deviceTypeMaps[_m];
  799. break;
  800. }
  801. }
  802. }
  803. return deviceType;
  804. }
  805. function getDeviceBrand(brand) {
  806. var deviceBrand = brand;
  807. if (deviceBrand) {
  808. deviceBrand = brand.toLocaleLowerCase();
  809. }
  810. return deviceBrand;
  811. }
  812. function getAppLanguage(defaultLanguage) {
  813. return getLocale$1 ? getLocale$1() : defaultLanguage;
  814. }
  815. function getHostName(result) {
  816. var _platform = 'WeChat';
  817. var _hostName = result.hostName || _platform; // mp-jd
  818. {
  819. if (result.environment) {
  820. _hostName = result.environment;
  821. } else if (result.host && result.host.env) {
  822. _hostName = result.host.env;
  823. }
  824. }
  825. return _hostName;
  826. }
  827. var getSystemInfo = {
  828. returnValue: function returnValue(result) {
  829. useDeviceId(result);
  830. addSafeAreaInsets(result);
  831. populateParameters(result);
  832. }
  833. };
  834. var showActionSheet = {
  835. args: function args(fromArgs) {
  836. if ((0, _typeof2.default)(fromArgs) === 'object') {
  837. fromArgs.alertText = fromArgs.title;
  838. }
  839. }
  840. };
  841. var getAppBaseInfo = {
  842. returnValue: function returnValue(result) {
  843. var _result = result,
  844. version = _result.version,
  845. language = _result.language,
  846. SDKVersion = _result.SDKVersion,
  847. theme = _result.theme;
  848. var _hostName = getHostName(result);
  849. var hostLanguage = language.replace('_', '-');
  850. result = sortObject(Object.assign(result, {
  851. appId: "__UNI__50B3EE1",
  852. appName: "wx-app-new",
  853. appVersion: "1.0.0",
  854. appVersionCode: "100",
  855. appLanguage: getAppLanguage(hostLanguage),
  856. hostVersion: version,
  857. hostLanguage: hostLanguage,
  858. hostName: _hostName,
  859. hostSDKVersion: SDKVersion,
  860. hostTheme: theme
  861. }));
  862. }
  863. };
  864. var getDeviceInfo = {
  865. returnValue: function returnValue(result) {
  866. var _result2 = result,
  867. brand = _result2.brand,
  868. model = _result2.model;
  869. var deviceType = getGetDeviceType(result, model);
  870. var deviceBrand = getDeviceBrand(brand);
  871. useDeviceId(result);
  872. result = sortObject(Object.assign(result, {
  873. deviceType: deviceType,
  874. deviceBrand: deviceBrand,
  875. deviceModel: model
  876. }));
  877. }
  878. };
  879. var getWindowInfo = {
  880. returnValue: function returnValue(result) {
  881. addSafeAreaInsets(result);
  882. result = sortObject(Object.assign(result, {
  883. windowTop: 0,
  884. windowBottom: 0
  885. }));
  886. }
  887. };
  888. var getAppAuthorizeSetting = {
  889. returnValue: function returnValue(result) {
  890. var locationReducedAccuracy = result.locationReducedAccuracy;
  891. result.locationAccuracy = 'unsupported';
  892. if (locationReducedAccuracy === true) {
  893. result.locationAccuracy = 'reduced';
  894. } else if (locationReducedAccuracy === false) {
  895. result.locationAccuracy = 'full';
  896. }
  897. }
  898. };
  899. // import navigateTo from 'uni-helpers/navigate-to'
  900. var compressImage = {
  901. args: function args(fromArgs) {
  902. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  903. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  904. fromArgs.compressHeight = fromArgs.compressedHeight;
  905. }
  906. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  907. fromArgs.compressWidth = fromArgs.compressedWidth;
  908. }
  909. }
  910. };
  911. var protocols = {
  912. redirectTo: redirectTo,
  913. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  914. previewImage: previewImage,
  915. getSystemInfo: getSystemInfo,
  916. getSystemInfoSync: getSystemInfo,
  917. showActionSheet: showActionSheet,
  918. getAppBaseInfo: getAppBaseInfo,
  919. getDeviceInfo: getDeviceInfo,
  920. getWindowInfo: getWindowInfo,
  921. getAppAuthorizeSetting: getAppAuthorizeSetting,
  922. compressImage: compressImage
  923. };
  924. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  925. var canIUses = [];
  926. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  927. function processCallback(methodName, method, returnValue) {
  928. return function (res) {
  929. return method(processReturnValue(methodName, res, returnValue));
  930. };
  931. }
  932. function processArgs(methodName, fromArgs) {
  933. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  934. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  935. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  936. if (isPlainObject(fromArgs)) {
  937. // 一般 api 的参数解析
  938. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  939. if (isFn(argsOption)) {
  940. argsOption = argsOption(fromArgs, toArgs) || {};
  941. }
  942. for (var key in fromArgs) {
  943. if (hasOwn(argsOption, key)) {
  944. var keyOption = argsOption[key];
  945. if (isFn(keyOption)) {
  946. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  947. }
  948. if (!keyOption) {
  949. // 不支持的参数
  950. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  951. } else if (isStr(keyOption)) {
  952. // 重写参数 key
  953. toArgs[keyOption] = fromArgs[key];
  954. } else if (isPlainObject(keyOption)) {
  955. // {name:newName,value:value}可重新指定参数 key:value
  956. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  957. }
  958. } else if (CALLBACKS.indexOf(key) !== -1) {
  959. if (isFn(fromArgs[key])) {
  960. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  961. }
  962. } else {
  963. if (!keepFromArgs) {
  964. toArgs[key] = fromArgs[key];
  965. }
  966. }
  967. }
  968. return toArgs;
  969. } else if (isFn(fromArgs)) {
  970. fromArgs = processCallback(methodName, fromArgs, returnValue);
  971. }
  972. return fromArgs;
  973. }
  974. function processReturnValue(methodName, res, returnValue) {
  975. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  976. if (isFn(protocols.returnValue)) {
  977. // 处理通用 returnValue
  978. res = protocols.returnValue(methodName, res);
  979. }
  980. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  981. }
  982. function wrapper(methodName, method) {
  983. if (hasOwn(protocols, methodName)) {
  984. var protocol = protocols[methodName];
  985. if (!protocol) {
  986. // 暂不支持的 api
  987. return function () {
  988. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  989. };
  990. }
  991. return function (arg1, arg2) {
  992. // 目前 api 最多两个参数
  993. var options = protocol;
  994. if (isFn(protocol)) {
  995. options = protocol(arg1);
  996. }
  997. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  998. var args = [arg1];
  999. if (typeof arg2 !== 'undefined') {
  1000. args.push(arg2);
  1001. }
  1002. if (isFn(options.name)) {
  1003. methodName = options.name(arg1);
  1004. } else if (isStr(options.name)) {
  1005. methodName = options.name;
  1006. }
  1007. var returnValue = wx[methodName].apply(wx, args);
  1008. if (isSyncApi(methodName)) {
  1009. // 同步 api
  1010. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1011. }
  1012. return returnValue;
  1013. };
  1014. }
  1015. return method;
  1016. }
  1017. var todoApis = Object.create(null);
  1018. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1019. function createTodoApi(name) {
  1020. return function todoApi(_ref) {
  1021. var fail = _ref.fail,
  1022. complete = _ref.complete;
  1023. var res = {
  1024. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1025. };
  1026. isFn(fail) && fail(res);
  1027. isFn(complete) && complete(res);
  1028. };
  1029. }
  1030. TODOS.forEach(function (name) {
  1031. todoApis[name] = createTodoApi(name);
  1032. });
  1033. var providers = {
  1034. oauth: ['weixin'],
  1035. share: ['weixin'],
  1036. payment: ['wxpay'],
  1037. push: ['weixin']
  1038. };
  1039. function getProvider(_ref2) {
  1040. var service = _ref2.service,
  1041. success = _ref2.success,
  1042. fail = _ref2.fail,
  1043. complete = _ref2.complete;
  1044. var res = false;
  1045. if (providers[service]) {
  1046. res = {
  1047. errMsg: 'getProvider:ok',
  1048. service: service,
  1049. provider: providers[service]
  1050. };
  1051. isFn(success) && success(res);
  1052. } else {
  1053. res = {
  1054. errMsg: 'getProvider:fail service not found'
  1055. };
  1056. isFn(fail) && fail(res);
  1057. }
  1058. isFn(complete) && complete(res);
  1059. }
  1060. var extraApi = /*#__PURE__*/Object.freeze({
  1061. __proto__: null,
  1062. getProvider: getProvider
  1063. });
  1064. var getEmitter = function () {
  1065. var Emitter;
  1066. return function getUniEmitter() {
  1067. if (!Emitter) {
  1068. Emitter = new _vue.default();
  1069. }
  1070. return Emitter;
  1071. };
  1072. }();
  1073. function apply(ctx, method, args) {
  1074. return ctx[method].apply(ctx, args);
  1075. }
  1076. function $on() {
  1077. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1078. }
  1079. function $off() {
  1080. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1081. }
  1082. function $once() {
  1083. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1084. }
  1085. function $emit() {
  1086. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1087. }
  1088. var eventApi = /*#__PURE__*/Object.freeze({
  1089. __proto__: null,
  1090. $on: $on,
  1091. $off: $off,
  1092. $once: $once,
  1093. $emit: $emit
  1094. });
  1095. /**
  1096. * 框架内 try-catch
  1097. */
  1098. /**
  1099. * 开发者 try-catch
  1100. */
  1101. function tryCatch(fn) {
  1102. return function () {
  1103. try {
  1104. return fn.apply(fn, arguments);
  1105. } catch (e) {
  1106. // TODO
  1107. console.error(e);
  1108. }
  1109. };
  1110. }
  1111. function getApiCallbacks(params) {
  1112. var apiCallbacks = {};
  1113. for (var name in params) {
  1114. var param = params[name];
  1115. if (isFn(param)) {
  1116. apiCallbacks[name] = tryCatch(param);
  1117. delete params[name];
  1118. }
  1119. }
  1120. return apiCallbacks;
  1121. }
  1122. var cid;
  1123. var cidErrMsg;
  1124. var enabled;
  1125. function normalizePushMessage(message) {
  1126. try {
  1127. return JSON.parse(message);
  1128. } catch (e) {}
  1129. return message;
  1130. }
  1131. function invokePushCallback(args) {
  1132. if (args.type === 'enabled') {
  1133. enabled = true;
  1134. } else if (args.type === 'clientId') {
  1135. cid = args.cid;
  1136. cidErrMsg = args.errMsg;
  1137. invokeGetPushCidCallbacks(cid, args.errMsg);
  1138. } else if (args.type === 'pushMsg') {
  1139. var message = {
  1140. type: 'receive',
  1141. data: normalizePushMessage(args.message)
  1142. };
  1143. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1144. var callback = onPushMessageCallbacks[i];
  1145. callback(message);
  1146. // 该消息已被阻止
  1147. if (message.stopped) {
  1148. break;
  1149. }
  1150. }
  1151. } else if (args.type === 'click') {
  1152. onPushMessageCallbacks.forEach(function (callback) {
  1153. callback({
  1154. type: 'click',
  1155. data: normalizePushMessage(args.message)
  1156. });
  1157. });
  1158. }
  1159. }
  1160. var getPushCidCallbacks = [];
  1161. function invokeGetPushCidCallbacks(cid, errMsg) {
  1162. getPushCidCallbacks.forEach(function (callback) {
  1163. callback(cid, errMsg);
  1164. });
  1165. getPushCidCallbacks.length = 0;
  1166. }
  1167. function getPushClientId(args) {
  1168. if (!isPlainObject(args)) {
  1169. args = {};
  1170. }
  1171. var _getApiCallbacks = getApiCallbacks(args),
  1172. success = _getApiCallbacks.success,
  1173. fail = _getApiCallbacks.fail,
  1174. complete = _getApiCallbacks.complete;
  1175. var hasSuccess = isFn(success);
  1176. var hasFail = isFn(fail);
  1177. var hasComplete = isFn(complete);
  1178. Promise.resolve().then(function () {
  1179. if (typeof enabled === 'undefined') {
  1180. enabled = false;
  1181. cid = '';
  1182. cidErrMsg = 'uniPush is not enabled';
  1183. }
  1184. getPushCidCallbacks.push(function (cid, errMsg) {
  1185. var res;
  1186. if (cid) {
  1187. res = {
  1188. errMsg: 'getPushClientId:ok',
  1189. cid: cid
  1190. };
  1191. hasSuccess && success(res);
  1192. } else {
  1193. res = {
  1194. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1195. };
  1196. hasFail && fail(res);
  1197. }
  1198. hasComplete && complete(res);
  1199. });
  1200. if (typeof cid !== 'undefined') {
  1201. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1202. }
  1203. });
  1204. }
  1205. var onPushMessageCallbacks = [];
  1206. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1207. var onPushMessage = function onPushMessage(fn) {
  1208. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1209. onPushMessageCallbacks.push(fn);
  1210. }
  1211. };
  1212. var offPushMessage = function offPushMessage(fn) {
  1213. if (!fn) {
  1214. onPushMessageCallbacks.length = 0;
  1215. } else {
  1216. var index = onPushMessageCallbacks.indexOf(fn);
  1217. if (index > -1) {
  1218. onPushMessageCallbacks.splice(index, 1);
  1219. }
  1220. }
  1221. };
  1222. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1223. if (!baseInfo) {
  1224. baseInfo = wx.getSystemInfoSync();
  1225. }
  1226. var host = baseInfo ? baseInfo.host : null;
  1227. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1228. var api = /*#__PURE__*/Object.freeze({
  1229. __proto__: null,
  1230. shareVideoMessage: shareVideoMessage,
  1231. getPushClientId: getPushClientId,
  1232. onPushMessage: onPushMessage,
  1233. offPushMessage: offPushMessage,
  1234. invokePushCallback: invokePushCallback
  1235. });
  1236. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1237. function findVmByVueId(vm, vuePid) {
  1238. var $children = vm.$children;
  1239. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1240. for (var i = $children.length - 1; i >= 0; i--) {
  1241. var childVm = $children[i];
  1242. if (childVm.$scope._$vueId === vuePid) {
  1243. return childVm;
  1244. }
  1245. }
  1246. // 反向递归查找
  1247. var parentVm;
  1248. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1249. parentVm = findVmByVueId($children[_i], vuePid);
  1250. if (parentVm) {
  1251. return parentVm;
  1252. }
  1253. }
  1254. }
  1255. function initBehavior(options) {
  1256. return Behavior(options);
  1257. }
  1258. function isPage() {
  1259. return !!this.route;
  1260. }
  1261. function initRelation(detail) {
  1262. this.triggerEvent('__l', detail);
  1263. }
  1264. function selectAllComponents(mpInstance, selector, $refs) {
  1265. var components = mpInstance.selectAllComponents(selector) || [];
  1266. components.forEach(function (component) {
  1267. var ref = component.dataset.ref;
  1268. $refs[ref] = component.$vm || toSkip(component);
  1269. {
  1270. if (component.dataset.vueGeneric === 'scoped') {
  1271. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1272. selectAllComponents(scopedComponent, selector, $refs);
  1273. });
  1274. }
  1275. }
  1276. });
  1277. }
  1278. function syncRefs(refs, newRefs) {
  1279. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1280. var newKeys = Object.keys(newRefs);
  1281. newKeys.forEach(function (key) {
  1282. var oldValue = refs[key];
  1283. var newValue = newRefs[key];
  1284. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1285. return oldValue.includes(value);
  1286. })) {
  1287. return;
  1288. }
  1289. refs[key] = newValue;
  1290. oldKeys.delete(key);
  1291. });
  1292. oldKeys.forEach(function (key) {
  1293. delete refs[key];
  1294. });
  1295. return refs;
  1296. }
  1297. function initRefs(vm) {
  1298. var mpInstance = vm.$scope;
  1299. var refs = {};
  1300. Object.defineProperty(vm, '$refs', {
  1301. get: function get() {
  1302. var $refs = {};
  1303. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1304. // TODO 暂不考虑 for 中的 scoped
  1305. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1306. forComponents.forEach(function (component) {
  1307. var ref = component.dataset.ref;
  1308. if (!$refs[ref]) {
  1309. $refs[ref] = [];
  1310. }
  1311. $refs[ref].push(component.$vm || toSkip(component));
  1312. });
  1313. return syncRefs(refs, $refs);
  1314. }
  1315. });
  1316. }
  1317. function handleLink(event) {
  1318. var _ref3 = event.detail || event.value,
  1319. vuePid = _ref3.vuePid,
  1320. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1321. var parentVm;
  1322. if (vuePid) {
  1323. parentVm = findVmByVueId(this.$vm, vuePid);
  1324. }
  1325. if (!parentVm) {
  1326. parentVm = this.$vm;
  1327. }
  1328. vueOptions.parent = parentVm;
  1329. }
  1330. function markMPComponent(component) {
  1331. // 在 Vue 中标记为小程序组件
  1332. var IS_MP = '__v_isMPComponent';
  1333. Object.defineProperty(component, IS_MP, {
  1334. configurable: true,
  1335. enumerable: false,
  1336. value: true
  1337. });
  1338. return component;
  1339. }
  1340. function toSkip(obj) {
  1341. var OB = '__ob__';
  1342. var SKIP = '__v_skip';
  1343. if (isObject(obj) && Object.isExtensible(obj)) {
  1344. // 避免被 @vue/composition-api 观测
  1345. Object.defineProperty(obj, OB, {
  1346. configurable: true,
  1347. enumerable: false,
  1348. value: (0, _defineProperty2.default)({}, SKIP, true)
  1349. });
  1350. }
  1351. return obj;
  1352. }
  1353. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1354. function initWorkletMethods(mpMethods, vueMethods) {
  1355. if (vueMethods) {
  1356. Object.keys(vueMethods).forEach(function (name) {
  1357. var matches = name.match(WORKLET_RE);
  1358. if (matches) {
  1359. var workletName = matches[1];
  1360. mpMethods[name] = vueMethods[name];
  1361. mpMethods[workletName] = vueMethods[workletName];
  1362. }
  1363. });
  1364. }
  1365. }
  1366. var MPPage = Page;
  1367. var MPComponent = Component;
  1368. var customizeRE = /:/g;
  1369. var customize = cached(function (str) {
  1370. return camelize(str.replace(customizeRE, '-'));
  1371. });
  1372. function initTriggerEvent(mpInstance) {
  1373. var oldTriggerEvent = mpInstance.triggerEvent;
  1374. var newTriggerEvent = function newTriggerEvent(event) {
  1375. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1376. args[_key3 - 1] = arguments[_key3];
  1377. }
  1378. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1379. if (this.$vm || this.dataset && this.dataset.comType) {
  1380. event = customize(event);
  1381. } else {
  1382. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1383. var newEvent = customize(event);
  1384. if (newEvent !== event) {
  1385. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1386. }
  1387. }
  1388. return oldTriggerEvent.apply(this, [event].concat(args));
  1389. };
  1390. try {
  1391. // 京东小程序 triggerEvent 为只读
  1392. mpInstance.triggerEvent = newTriggerEvent;
  1393. } catch (error) {
  1394. mpInstance._triggerEvent = newTriggerEvent;
  1395. }
  1396. }
  1397. function initHook(name, options, isComponent) {
  1398. var oldHook = options[name];
  1399. options[name] = function () {
  1400. markMPComponent(this);
  1401. initTriggerEvent(this);
  1402. if (oldHook) {
  1403. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1404. args[_key4] = arguments[_key4];
  1405. }
  1406. return oldHook.apply(this, args);
  1407. }
  1408. };
  1409. }
  1410. if (!MPPage.__$wrappered) {
  1411. MPPage.__$wrappered = true;
  1412. Page = function Page() {
  1413. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1414. initHook('onLoad', options);
  1415. return MPPage(options);
  1416. };
  1417. Page.after = MPPage.after;
  1418. Component = function Component() {
  1419. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1420. initHook('created', options);
  1421. return MPComponent(options);
  1422. };
  1423. }
  1424. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1425. function initMocks(vm, mocks) {
  1426. var mpInstance = vm.$mp[vm.mpType];
  1427. mocks.forEach(function (mock) {
  1428. if (hasOwn(mpInstance, mock)) {
  1429. vm[mock] = mpInstance[mock];
  1430. }
  1431. });
  1432. }
  1433. function hasHook(hook, vueOptions) {
  1434. if (!vueOptions) {
  1435. return true;
  1436. }
  1437. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1438. return true;
  1439. }
  1440. vueOptions = vueOptions.default || vueOptions;
  1441. if (isFn(vueOptions)) {
  1442. if (isFn(vueOptions.extendOptions[hook])) {
  1443. return true;
  1444. }
  1445. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1446. return true;
  1447. }
  1448. return false;
  1449. }
  1450. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1451. return true;
  1452. }
  1453. var mixins = vueOptions.mixins;
  1454. if (Array.isArray(mixins)) {
  1455. return !!mixins.find(function (mixin) {
  1456. return hasHook(hook, mixin);
  1457. });
  1458. }
  1459. }
  1460. function initHooks(mpOptions, hooks, vueOptions) {
  1461. hooks.forEach(function (hook) {
  1462. if (hasHook(hook, vueOptions)) {
  1463. mpOptions[hook] = function (args) {
  1464. return this.$vm && this.$vm.__call_hook(hook, args);
  1465. };
  1466. }
  1467. });
  1468. }
  1469. function initUnknownHooks(mpOptions, vueOptions) {
  1470. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1471. findHooks(vueOptions).forEach(function (hook) {
  1472. return initHook$1(mpOptions, hook, excludes);
  1473. });
  1474. }
  1475. function findHooks(vueOptions) {
  1476. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1477. if (vueOptions) {
  1478. Object.keys(vueOptions).forEach(function (name) {
  1479. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1480. hooks.push(name);
  1481. }
  1482. });
  1483. }
  1484. return hooks;
  1485. }
  1486. function initHook$1(mpOptions, hook, excludes) {
  1487. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1488. mpOptions[hook] = function (args) {
  1489. return this.$vm && this.$vm.__call_hook(hook, args);
  1490. };
  1491. }
  1492. }
  1493. function initVueComponent(Vue, vueOptions) {
  1494. vueOptions = vueOptions.default || vueOptions;
  1495. var VueComponent;
  1496. if (isFn(vueOptions)) {
  1497. VueComponent = vueOptions;
  1498. } else {
  1499. VueComponent = Vue.extend(vueOptions);
  1500. }
  1501. vueOptions = VueComponent.options;
  1502. return [VueComponent, vueOptions];
  1503. }
  1504. function initSlots(vm, vueSlots) {
  1505. if (Array.isArray(vueSlots) && vueSlots.length) {
  1506. var $slots = Object.create(null);
  1507. vueSlots.forEach(function (slotName) {
  1508. $slots[slotName] = true;
  1509. });
  1510. vm.$scopedSlots = vm.$slots = $slots;
  1511. }
  1512. }
  1513. function initVueIds(vueIds, mpInstance) {
  1514. vueIds = (vueIds || '').split(',');
  1515. var len = vueIds.length;
  1516. if (len === 1) {
  1517. mpInstance._$vueId = vueIds[0];
  1518. } else if (len === 2) {
  1519. mpInstance._$vueId = vueIds[0];
  1520. mpInstance._$vuePid = vueIds[1];
  1521. }
  1522. }
  1523. function initData(vueOptions, context) {
  1524. var data = vueOptions.data || {};
  1525. var methods = vueOptions.methods || {};
  1526. if (typeof data === 'function') {
  1527. try {
  1528. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1529. } catch (e) {
  1530. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1531. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1532. }
  1533. }
  1534. } else {
  1535. try {
  1536. // 对 data 格式化
  1537. data = JSON.parse(JSON.stringify(data));
  1538. } catch (e) {}
  1539. }
  1540. if (!isPlainObject(data)) {
  1541. data = {};
  1542. }
  1543. Object.keys(methods).forEach(function (methodName) {
  1544. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1545. data[methodName] = methods[methodName];
  1546. }
  1547. });
  1548. return data;
  1549. }
  1550. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1551. function createObserver(name) {
  1552. return function observer(newVal, oldVal) {
  1553. if (this.$vm) {
  1554. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1555. }
  1556. };
  1557. }
  1558. function initBehaviors(vueOptions, initBehavior) {
  1559. var vueBehaviors = vueOptions.behaviors;
  1560. var vueExtends = vueOptions.extends;
  1561. var vueMixins = vueOptions.mixins;
  1562. var vueProps = vueOptions.props;
  1563. if (!vueProps) {
  1564. vueOptions.props = vueProps = [];
  1565. }
  1566. var behaviors = [];
  1567. if (Array.isArray(vueBehaviors)) {
  1568. vueBehaviors.forEach(function (behavior) {
  1569. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1570. if (behavior === 'uni://form-field') {
  1571. if (Array.isArray(vueProps)) {
  1572. vueProps.push('name');
  1573. vueProps.push('value');
  1574. } else {
  1575. vueProps.name = {
  1576. type: String,
  1577. default: ''
  1578. };
  1579. vueProps.value = {
  1580. type: [String, Number, Boolean, Array, Object, Date],
  1581. default: ''
  1582. };
  1583. }
  1584. }
  1585. });
  1586. }
  1587. if (isPlainObject(vueExtends) && vueExtends.props) {
  1588. behaviors.push(initBehavior({
  1589. properties: initProperties(vueExtends.props, true)
  1590. }));
  1591. }
  1592. if (Array.isArray(vueMixins)) {
  1593. vueMixins.forEach(function (vueMixin) {
  1594. if (isPlainObject(vueMixin) && vueMixin.props) {
  1595. behaviors.push(initBehavior({
  1596. properties: initProperties(vueMixin.props, true)
  1597. }));
  1598. }
  1599. });
  1600. }
  1601. return behaviors;
  1602. }
  1603. function parsePropType(key, type, defaultValue, file) {
  1604. // [String]=>String
  1605. if (Array.isArray(type) && type.length === 1) {
  1606. return type[0];
  1607. }
  1608. return type;
  1609. }
  1610. function initProperties(props) {
  1611. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1612. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1613. var options = arguments.length > 3 ? arguments[3] : undefined;
  1614. var properties = {};
  1615. if (!isBehavior) {
  1616. properties.vueId = {
  1617. type: String,
  1618. value: ''
  1619. };
  1620. {
  1621. if (options.virtualHost) {
  1622. properties.virtualHostStyle = {
  1623. type: null,
  1624. value: ''
  1625. };
  1626. properties.virtualHostClass = {
  1627. type: null,
  1628. value: ''
  1629. };
  1630. }
  1631. }
  1632. // scopedSlotsCompiler auto
  1633. properties.scopedSlotsCompiler = {
  1634. type: String,
  1635. value: ''
  1636. };
  1637. properties.vueSlots = {
  1638. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1639. type: null,
  1640. value: [],
  1641. observer: function observer(newVal, oldVal) {
  1642. var $slots = Object.create(null);
  1643. newVal.forEach(function (slotName) {
  1644. $slots[slotName] = true;
  1645. });
  1646. this.setData({
  1647. $slots: $slots
  1648. });
  1649. }
  1650. };
  1651. }
  1652. if (Array.isArray(props)) {
  1653. // ['title']
  1654. props.forEach(function (key) {
  1655. properties[key] = {
  1656. type: null,
  1657. observer: createObserver(key)
  1658. };
  1659. });
  1660. } else if (isPlainObject(props)) {
  1661. // {title:{type:String,default:''},content:String}
  1662. Object.keys(props).forEach(function (key) {
  1663. var opts = props[key];
  1664. if (isPlainObject(opts)) {
  1665. // title:{type:String,default:''}
  1666. var value = opts.default;
  1667. if (isFn(value)) {
  1668. value = value();
  1669. }
  1670. opts.type = parsePropType(key, opts.type);
  1671. properties[key] = {
  1672. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1673. value: value,
  1674. observer: createObserver(key)
  1675. };
  1676. } else {
  1677. // content:String
  1678. var type = parsePropType(key, opts);
  1679. properties[key] = {
  1680. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1681. observer: createObserver(key)
  1682. };
  1683. }
  1684. });
  1685. }
  1686. return properties;
  1687. }
  1688. function wrapper$1(event) {
  1689. // TODO 又得兼容 mpvue 的 mp 对象
  1690. try {
  1691. event.mp = JSON.parse(JSON.stringify(event));
  1692. } catch (e) {}
  1693. event.stopPropagation = noop;
  1694. event.preventDefault = noop;
  1695. event.target = event.target || {};
  1696. if (!hasOwn(event, 'detail')) {
  1697. event.detail = {};
  1698. }
  1699. if (hasOwn(event, 'markerId')) {
  1700. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1701. event.detail.markerId = event.markerId;
  1702. }
  1703. if (isPlainObject(event.detail)) {
  1704. event.target = Object.assign({}, event.target, event.detail);
  1705. }
  1706. return event;
  1707. }
  1708. function getExtraValue(vm, dataPathsArray) {
  1709. var context = vm;
  1710. dataPathsArray.forEach(function (dataPathArray) {
  1711. var dataPath = dataPathArray[0];
  1712. var value = dataPathArray[2];
  1713. if (dataPath || typeof value !== 'undefined') {
  1714. // ['','',index,'disable']
  1715. var propPath = dataPathArray[1];
  1716. var valuePath = dataPathArray[3];
  1717. var vFor;
  1718. if (Number.isInteger(dataPath)) {
  1719. vFor = dataPath;
  1720. } else if (!dataPath) {
  1721. vFor = context;
  1722. } else if (typeof dataPath === 'string' && dataPath) {
  1723. if (dataPath.indexOf('#s#') === 0) {
  1724. vFor = dataPath.substr(3);
  1725. } else {
  1726. vFor = vm.__get_value(dataPath, context);
  1727. }
  1728. }
  1729. if (Number.isInteger(vFor)) {
  1730. context = value;
  1731. } else if (!propPath) {
  1732. context = vFor[value];
  1733. } else {
  1734. if (Array.isArray(vFor)) {
  1735. context = vFor.find(function (vForItem) {
  1736. return vm.__get_value(propPath, vForItem) === value;
  1737. });
  1738. } else if (isPlainObject(vFor)) {
  1739. context = Object.keys(vFor).find(function (vForKey) {
  1740. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1741. });
  1742. } else {
  1743. console.error('v-for 暂不支持循环数据:', vFor);
  1744. }
  1745. }
  1746. if (valuePath) {
  1747. context = vm.__get_value(valuePath, context);
  1748. }
  1749. }
  1750. });
  1751. return context;
  1752. }
  1753. function processEventExtra(vm, extra, event, __args__) {
  1754. var extraObj = {};
  1755. if (Array.isArray(extra) && extra.length) {
  1756. /**
  1757. *[
  1758. * ['data.items', 'data.id', item.data.id],
  1759. * ['metas', 'id', meta.id]
  1760. *],
  1761. *[
  1762. * ['data.items', 'data.id', item.data.id],
  1763. * ['metas', 'id', meta.id]
  1764. *],
  1765. *'test'
  1766. */
  1767. extra.forEach(function (dataPath, index) {
  1768. if (typeof dataPath === 'string') {
  1769. if (!dataPath) {
  1770. // model,prop.sync
  1771. extraObj['$' + index] = vm;
  1772. } else {
  1773. if (dataPath === '$event') {
  1774. // $event
  1775. extraObj['$' + index] = event;
  1776. } else if (dataPath === 'arguments') {
  1777. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1778. } else if (dataPath.indexOf('$event.') === 0) {
  1779. // $event.target.value
  1780. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1781. } else {
  1782. extraObj['$' + index] = vm.__get_value(dataPath);
  1783. }
  1784. }
  1785. } else {
  1786. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1787. }
  1788. });
  1789. }
  1790. return extraObj;
  1791. }
  1792. function getObjByArray(arr) {
  1793. var obj = {};
  1794. for (var i = 1; i < arr.length; i++) {
  1795. var element = arr[i];
  1796. obj[element[0]] = element[1];
  1797. }
  1798. return obj;
  1799. }
  1800. function processEventArgs(vm, event) {
  1801. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1802. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1803. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1804. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1805. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1806. // fixed 用户直接触发 mpInstance.triggerEvent
  1807. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1808. if (isCustom) {
  1809. // 自定义事件
  1810. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1811. if (!args.length) {
  1812. // 无参数,直接传入 event 或 detail 数组
  1813. if (isCustomMPEvent) {
  1814. return [event];
  1815. }
  1816. return __args__;
  1817. }
  1818. }
  1819. var extraObj = processEventExtra(vm, extra, event, __args__);
  1820. var ret = [];
  1821. args.forEach(function (arg) {
  1822. if (arg === '$event') {
  1823. if (methodName === '__set_model' && !isCustom) {
  1824. // input v-model value
  1825. ret.push(event.target.value);
  1826. } else {
  1827. if (isCustom && !isCustomMPEvent) {
  1828. ret.push(__args__[0]);
  1829. } else {
  1830. // wxcomponent 组件或内置组件
  1831. ret.push(event);
  1832. }
  1833. }
  1834. } else {
  1835. if (Array.isArray(arg) && arg[0] === 'o') {
  1836. ret.push(getObjByArray(arg));
  1837. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1838. ret.push(extraObj[arg]);
  1839. } else {
  1840. ret.push(arg);
  1841. }
  1842. }
  1843. });
  1844. return ret;
  1845. }
  1846. var ONCE = '~';
  1847. var CUSTOM = '^';
  1848. function isMatchEventType(eventType, optType) {
  1849. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1850. }
  1851. function getContextVm(vm) {
  1852. var $parent = vm.$parent;
  1853. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1854. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1855. $parent = $parent.$parent;
  1856. }
  1857. return $parent && $parent.$parent;
  1858. }
  1859. function handleEvent(event) {
  1860. var _this2 = this;
  1861. event = wrapper$1(event);
  1862. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1863. var dataset = (event.currentTarget || event.target).dataset;
  1864. if (!dataset) {
  1865. return console.warn('事件信息不存在');
  1866. }
  1867. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1868. if (!eventOpts) {
  1869. return console.warn('事件信息不存在');
  1870. }
  1871. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1872. var eventType = event.type;
  1873. var ret = [];
  1874. eventOpts.forEach(function (eventOpt) {
  1875. var type = eventOpt[0];
  1876. var eventsArray = eventOpt[1];
  1877. var isCustom = type.charAt(0) === CUSTOM;
  1878. type = isCustom ? type.slice(1) : type;
  1879. var isOnce = type.charAt(0) === ONCE;
  1880. type = isOnce ? type.slice(1) : type;
  1881. if (eventsArray && isMatchEventType(eventType, type)) {
  1882. eventsArray.forEach(function (eventArray) {
  1883. var methodName = eventArray[0];
  1884. if (methodName) {
  1885. var handlerCtx = _this2.$vm;
  1886. if (handlerCtx.$options.generic) {
  1887. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1888. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1889. }
  1890. if (methodName === '$emit') {
  1891. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1892. return;
  1893. }
  1894. var handler = handlerCtx[methodName];
  1895. if (!isFn(handler)) {
  1896. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1897. var path = _this2.route || _this2.is;
  1898. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1899. }
  1900. if (isOnce) {
  1901. if (handler.once) {
  1902. return;
  1903. }
  1904. handler.once = true;
  1905. }
  1906. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1907. params = Array.isArray(params) ? params : [];
  1908. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1909. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1910. // eslint-disable-next-line no-sparse-arrays
  1911. params = params.concat([,,,,,,,,,, event]);
  1912. }
  1913. ret.push(handler.apply(handlerCtx, params));
  1914. }
  1915. });
  1916. }
  1917. });
  1918. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  1919. return ret[0];
  1920. }
  1921. }
  1922. var eventChannels = {};
  1923. var eventChannelStack = [];
  1924. function getEventChannel(id) {
  1925. if (id) {
  1926. var eventChannel = eventChannels[id];
  1927. delete eventChannels[id];
  1928. return eventChannel;
  1929. }
  1930. return eventChannelStack.shift();
  1931. }
  1932. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  1933. function initEventChannel() {
  1934. _vue.default.prototype.getOpenerEventChannel = function () {
  1935. // 微信小程序使用自身getOpenerEventChannel
  1936. {
  1937. return this.$scope.getOpenerEventChannel();
  1938. }
  1939. };
  1940. var callHook = _vue.default.prototype.__call_hook;
  1941. _vue.default.prototype.__call_hook = function (hook, args) {
  1942. if (hook === 'onLoad' && args && args.__id__) {
  1943. this.__eventChannel__ = getEventChannel(args.__id__);
  1944. delete args.__id__;
  1945. }
  1946. return callHook.call(this, hook, args);
  1947. };
  1948. }
  1949. function initScopedSlotsParams() {
  1950. var center = {};
  1951. var parents = {};
  1952. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1953. var has = center[vueId];
  1954. if (!has) {
  1955. parents[vueId] = this;
  1956. this.$on('hook:destroyed', function () {
  1957. delete parents[vueId];
  1958. });
  1959. }
  1960. return has;
  1961. };
  1962. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1963. var data = center[vueId];
  1964. if (data) {
  1965. var object = data[name] || {};
  1966. return key ? object[key] : object;
  1967. } else {
  1968. parents[vueId] = this;
  1969. this.$on('hook:destroyed', function () {
  1970. delete parents[vueId];
  1971. });
  1972. }
  1973. };
  1974. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1975. var vueIds = this.$options.propsData.vueId;
  1976. if (vueIds) {
  1977. var vueId = vueIds.split(',')[0];
  1978. var object = center[vueId] = center[vueId] || {};
  1979. object[name] = value;
  1980. if (parents[vueId]) {
  1981. parents[vueId].$forceUpdate();
  1982. }
  1983. }
  1984. };
  1985. _vue.default.mixin({
  1986. destroyed: function destroyed() {
  1987. var propsData = this.$options.propsData;
  1988. var vueId = propsData && propsData.vueId;
  1989. if (vueId) {
  1990. delete center[vueId];
  1991. delete parents[vueId];
  1992. }
  1993. }
  1994. });
  1995. }
  1996. function parseBaseApp(vm, _ref4) {
  1997. var mocks = _ref4.mocks,
  1998. initRefs = _ref4.initRefs;
  1999. initEventChannel();
  2000. {
  2001. initScopedSlotsParams();
  2002. }
  2003. if (vm.$options.store) {
  2004. _vue.default.prototype.$store = vm.$options.store;
  2005. }
  2006. uniIdMixin(_vue.default);
  2007. _vue.default.prototype.mpHost = "mp-weixin";
  2008. _vue.default.mixin({
  2009. beforeCreate: function beforeCreate() {
  2010. if (!this.$options.mpType) {
  2011. return;
  2012. }
  2013. this.mpType = this.$options.mpType;
  2014. this.$mp = (0, _defineProperty2.default)({
  2015. data: {}
  2016. }, this.mpType, this.$options.mpInstance);
  2017. this.$scope = this.$options.mpInstance;
  2018. delete this.$options.mpType;
  2019. delete this.$options.mpInstance;
  2020. if (this.mpType === 'page' && typeof getApp === 'function') {
  2021. // hack vue-i18n
  2022. var app = getApp();
  2023. if (app.$vm && app.$vm.$i18n) {
  2024. this._i18n = app.$vm.$i18n;
  2025. }
  2026. }
  2027. if (this.mpType !== 'app') {
  2028. initRefs(this);
  2029. initMocks(this, mocks);
  2030. }
  2031. }
  2032. });
  2033. var appOptions = {
  2034. onLaunch: function onLaunch(args) {
  2035. if (this.$vm) {
  2036. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2037. return;
  2038. }
  2039. {
  2040. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2041. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2042. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2043. }
  2044. }
  2045. this.$vm = vm;
  2046. this.$vm.$mp = {
  2047. app: this
  2048. };
  2049. this.$vm.$scope = this;
  2050. // vm 上也挂载 globalData
  2051. this.$vm.globalData = this.globalData;
  2052. this.$vm._isMounted = true;
  2053. this.$vm.__call_hook('mounted', args);
  2054. this.$vm.__call_hook('onLaunch', args);
  2055. }
  2056. };
  2057. // 兼容旧版本 globalData
  2058. appOptions.globalData = vm.$options.globalData || {};
  2059. // 将 methods 中的方法挂在 getApp() 中
  2060. var methods = vm.$options.methods;
  2061. if (methods) {
  2062. Object.keys(methods).forEach(function (name) {
  2063. appOptions[name] = methods[name];
  2064. });
  2065. }
  2066. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2067. initHooks(appOptions, hooks);
  2068. initUnknownHooks(appOptions, vm.$options);
  2069. return appOptions;
  2070. }
  2071. function parseApp(vm) {
  2072. return parseBaseApp(vm, {
  2073. mocks: mocks,
  2074. initRefs: initRefs
  2075. });
  2076. }
  2077. function createApp(vm) {
  2078. App(parseApp(vm));
  2079. return vm;
  2080. }
  2081. var encodeReserveRE = /[!'()*]/g;
  2082. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2083. return '%' + c.charCodeAt(0).toString(16);
  2084. };
  2085. var commaRE = /%2C/g;
  2086. // fixed encodeURIComponent which is more conformant to RFC3986:
  2087. // - escapes [!'()*]
  2088. // - preserve commas
  2089. var encode = function encode(str) {
  2090. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2091. };
  2092. function stringifyQuery(obj) {
  2093. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2094. var res = obj ? Object.keys(obj).map(function (key) {
  2095. var val = obj[key];
  2096. if (val === undefined) {
  2097. return '';
  2098. }
  2099. if (val === null) {
  2100. return encodeStr(key);
  2101. }
  2102. if (Array.isArray(val)) {
  2103. var result = [];
  2104. val.forEach(function (val2) {
  2105. if (val2 === undefined) {
  2106. return;
  2107. }
  2108. if (val2 === null) {
  2109. result.push(encodeStr(key));
  2110. } else {
  2111. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2112. }
  2113. });
  2114. return result.join('&');
  2115. }
  2116. return encodeStr(key) + '=' + encodeStr(val);
  2117. }).filter(function (x) {
  2118. return x.length > 0;
  2119. }).join('&') : null;
  2120. return res ? "?".concat(res) : '';
  2121. }
  2122. function parseBaseComponent(vueComponentOptions) {
  2123. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2124. isPage = _ref5.isPage,
  2125. initRelation = _ref5.initRelation;
  2126. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2127. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2128. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2129. VueComponent = _initVueComponent2[0],
  2130. vueOptions = _initVueComponent2[1];
  2131. var options = _objectSpread({
  2132. multipleSlots: true,
  2133. addGlobalClass: true
  2134. }, vueOptions.options || {});
  2135. {
  2136. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2137. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2138. Object.assign(options, vueOptions['mp-weixin'].options);
  2139. }
  2140. }
  2141. var componentOptions = {
  2142. options: options,
  2143. data: initData(vueOptions, _vue.default.prototype),
  2144. behaviors: initBehaviors(vueOptions, initBehavior),
  2145. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2146. lifetimes: {
  2147. attached: function attached() {
  2148. var properties = this.properties;
  2149. var options = {
  2150. mpType: isPage.call(this) ? 'page' : 'component',
  2151. mpInstance: this,
  2152. propsData: properties
  2153. };
  2154. initVueIds(properties.vueId, this);
  2155. // 处理父子关系
  2156. initRelation.call(this, {
  2157. vuePid: this._$vuePid,
  2158. vueOptions: options
  2159. });
  2160. // 初始化 vue 实例
  2161. this.$vm = new VueComponent(options);
  2162. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2163. initSlots(this.$vm, properties.vueSlots);
  2164. // 触发首次 setData
  2165. this.$vm.$mount();
  2166. },
  2167. ready: function ready() {
  2168. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2169. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2170. if (this.$vm) {
  2171. this.$vm._isMounted = true;
  2172. this.$vm.__call_hook('mounted');
  2173. this.$vm.__call_hook('onReady');
  2174. }
  2175. },
  2176. detached: function detached() {
  2177. this.$vm && this.$vm.$destroy();
  2178. }
  2179. },
  2180. pageLifetimes: {
  2181. show: function show(args) {
  2182. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2183. },
  2184. hide: function hide() {
  2185. this.$vm && this.$vm.__call_hook('onPageHide');
  2186. },
  2187. resize: function resize(size) {
  2188. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2189. }
  2190. },
  2191. methods: {
  2192. __l: handleLink,
  2193. __e: handleEvent
  2194. }
  2195. };
  2196. // externalClasses
  2197. if (vueOptions.externalClasses) {
  2198. componentOptions.externalClasses = vueOptions.externalClasses;
  2199. }
  2200. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2201. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2202. componentOptions.methods[callMethod] = function (args) {
  2203. return this.$vm[callMethod](args);
  2204. };
  2205. });
  2206. }
  2207. if (needVueOptions) {
  2208. return [componentOptions, vueOptions, VueComponent];
  2209. }
  2210. if (isPage) {
  2211. return componentOptions;
  2212. }
  2213. return [componentOptions, VueComponent];
  2214. }
  2215. function parseComponent(vueComponentOptions, needVueOptions) {
  2216. return parseBaseComponent(vueComponentOptions, {
  2217. isPage: isPage,
  2218. initRelation: initRelation
  2219. }, needVueOptions);
  2220. }
  2221. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2222. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2223. function parseBasePage(vuePageOptions) {
  2224. var _parseComponent = parseComponent(vuePageOptions, true),
  2225. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2226. pageOptions = _parseComponent2[0],
  2227. vueOptions = _parseComponent2[1];
  2228. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2229. pageOptions.methods.onLoad = function (query) {
  2230. this.options = query;
  2231. var copyQuery = Object.assign({}, query);
  2232. delete copyQuery.__id__;
  2233. this.$page = {
  2234. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2235. };
  2236. this.$vm.$mp.query = query; // 兼容 mpvue
  2237. this.$vm.__call_hook('onLoad', query);
  2238. };
  2239. {
  2240. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2241. }
  2242. {
  2243. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2244. }
  2245. return pageOptions;
  2246. }
  2247. function parsePage(vuePageOptions) {
  2248. return parseBasePage(vuePageOptions);
  2249. }
  2250. function createPage(vuePageOptions) {
  2251. {
  2252. return Component(parsePage(vuePageOptions));
  2253. }
  2254. }
  2255. function createComponent(vueOptions) {
  2256. {
  2257. return Component(parseComponent(vueOptions));
  2258. }
  2259. }
  2260. function createSubpackageApp(vm) {
  2261. var appOptions = parseApp(vm);
  2262. var app = getApp({
  2263. allowDefault: true
  2264. });
  2265. vm.$scope = app;
  2266. var globalData = app.globalData;
  2267. if (globalData) {
  2268. Object.keys(appOptions.globalData).forEach(function (name) {
  2269. if (!hasOwn(globalData, name)) {
  2270. globalData[name] = appOptions.globalData[name];
  2271. }
  2272. });
  2273. }
  2274. Object.keys(appOptions).forEach(function (name) {
  2275. if (!hasOwn(app, name)) {
  2276. app[name] = appOptions[name];
  2277. }
  2278. });
  2279. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2280. wx.onAppShow(function () {
  2281. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2282. args[_key5] = arguments[_key5];
  2283. }
  2284. vm.__call_hook('onShow', args);
  2285. });
  2286. }
  2287. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2288. wx.onAppHide(function () {
  2289. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2290. args[_key6] = arguments[_key6];
  2291. }
  2292. vm.__call_hook('onHide', args);
  2293. });
  2294. }
  2295. if (isFn(appOptions.onLaunch)) {
  2296. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2297. vm.__call_hook('onLaunch', args);
  2298. }
  2299. return vm;
  2300. }
  2301. function createPlugin(vm) {
  2302. var appOptions = parseApp(vm);
  2303. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2304. wx.onAppShow(function () {
  2305. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2306. args[_key7] = arguments[_key7];
  2307. }
  2308. vm.__call_hook('onShow', args);
  2309. });
  2310. }
  2311. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2312. wx.onAppHide(function () {
  2313. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2314. args[_key8] = arguments[_key8];
  2315. }
  2316. vm.__call_hook('onHide', args);
  2317. });
  2318. }
  2319. if (isFn(appOptions.onLaunch)) {
  2320. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2321. vm.__call_hook('onLaunch', args);
  2322. }
  2323. return vm;
  2324. }
  2325. todos.forEach(function (todoApi) {
  2326. protocols[todoApi] = false;
  2327. });
  2328. canIUses.forEach(function (canIUseApi) {
  2329. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2330. if (!wx.canIUse(apiName)) {
  2331. protocols[canIUseApi] = false;
  2332. }
  2333. });
  2334. var uni = {};
  2335. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2336. uni = new Proxy({}, {
  2337. get: function get(target, name) {
  2338. if (hasOwn(target, name)) {
  2339. return target[name];
  2340. }
  2341. if (baseApi[name]) {
  2342. return baseApi[name];
  2343. }
  2344. if (api[name]) {
  2345. return promisify(name, api[name]);
  2346. }
  2347. {
  2348. if (extraApi[name]) {
  2349. return promisify(name, extraApi[name]);
  2350. }
  2351. if (todoApis[name]) {
  2352. return promisify(name, todoApis[name]);
  2353. }
  2354. }
  2355. if (eventApi[name]) {
  2356. return eventApi[name];
  2357. }
  2358. return promisify(name, wrapper(name, wx[name]));
  2359. },
  2360. set: function set(target, name, value) {
  2361. target[name] = value;
  2362. return true;
  2363. }
  2364. });
  2365. } else {
  2366. Object.keys(baseApi).forEach(function (name) {
  2367. uni[name] = baseApi[name];
  2368. });
  2369. {
  2370. Object.keys(todoApis).forEach(function (name) {
  2371. uni[name] = promisify(name, todoApis[name]);
  2372. });
  2373. Object.keys(extraApi).forEach(function (name) {
  2374. uni[name] = promisify(name, todoApis[name]);
  2375. });
  2376. }
  2377. Object.keys(eventApi).forEach(function (name) {
  2378. uni[name] = eventApi[name];
  2379. });
  2380. Object.keys(api).forEach(function (name) {
  2381. uni[name] = promisify(name, api[name]);
  2382. });
  2383. Object.keys(wx).forEach(function (name) {
  2384. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2385. uni[name] = promisify(name, wrapper(name, wx[name]));
  2386. }
  2387. });
  2388. }
  2389. wx.createApp = createApp;
  2390. wx.createPage = createPage;
  2391. wx.createComponent = createComponent;
  2392. wx.createSubpackageApp = createSubpackageApp;
  2393. wx.createPlugin = createPlugin;
  2394. var uni$1 = uni;
  2395. var _default = uni$1;
  2396. exports.default = _default;
  2397. /* 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)))
  2398. /***/ }),
  2399. /* 3 */
  2400. /*!***********************************!*\
  2401. !*** (webpack)/buildin/global.js ***!
  2402. \***********************************/
  2403. /*! no static exports found */
  2404. /***/ (function(module, exports) {
  2405. var g;
  2406. // This works in non-strict mode
  2407. g = (function() {
  2408. return this;
  2409. })();
  2410. try {
  2411. // This works if eval is allowed (see CSP)
  2412. g = g || new Function("return this")();
  2413. } catch (e) {
  2414. // This works if the window reference is available
  2415. if (typeof window === "object") g = window;
  2416. }
  2417. // g can still be undefined, but nothing to do about it...
  2418. // We return undefined, instead of nothing here, so it's
  2419. // easier to handle this case. if(!global) { ...}
  2420. module.exports = g;
  2421. /***/ }),
  2422. /* 4 */
  2423. /*!**********************************************************************!*\
  2424. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  2425. \**********************************************************************/
  2426. /*! no static exports found */
  2427. /***/ (function(module, exports) {
  2428. function _interopRequireDefault(obj) {
  2429. return obj && obj.__esModule ? obj : {
  2430. "default": obj
  2431. };
  2432. }
  2433. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2434. /***/ }),
  2435. /* 5 */
  2436. /*!**************************************************************!*\
  2437. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  2438. \**************************************************************/
  2439. /*! no static exports found */
  2440. /***/ (function(module, exports, __webpack_require__) {
  2441. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  2442. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  2443. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2444. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  2445. function _slicedToArray(arr, i) {
  2446. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  2447. }
  2448. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2449. /***/ }),
  2450. /* 6 */
  2451. /*!***************************************************************!*\
  2452. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  2453. \***************************************************************/
  2454. /*! no static exports found */
  2455. /***/ (function(module, exports) {
  2456. function _arrayWithHoles(arr) {
  2457. if (Array.isArray(arr)) return arr;
  2458. }
  2459. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2460. /***/ }),
  2461. /* 7 */
  2462. /*!*********************************************************************!*\
  2463. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  2464. \*********************************************************************/
  2465. /*! no static exports found */
  2466. /***/ (function(module, exports) {
  2467. function _iterableToArrayLimit(arr, i) {
  2468. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  2469. if (null != _i) {
  2470. var _s,
  2471. _e,
  2472. _x,
  2473. _r,
  2474. _arr = [],
  2475. _n = !0,
  2476. _d = !1;
  2477. try {
  2478. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  2479. if (Object(_i) !== _i) return;
  2480. _n = !1;
  2481. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  2482. ;
  2483. }
  2484. } catch (err) {
  2485. _d = !0, _e = err;
  2486. } finally {
  2487. try {
  2488. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  2489. } finally {
  2490. if (_d) throw _e;
  2491. }
  2492. }
  2493. return _arr;
  2494. }
  2495. }
  2496. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2497. /***/ }),
  2498. /* 8 */
  2499. /*!***************************************************************************!*\
  2500. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  2501. \***************************************************************************/
  2502. /*! no static exports found */
  2503. /***/ (function(module, exports, __webpack_require__) {
  2504. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2505. function _unsupportedIterableToArray(o, minLen) {
  2506. if (!o) return;
  2507. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  2508. var n = Object.prototype.toString.call(o).slice(8, -1);
  2509. if (n === "Object" && o.constructor) n = o.constructor.name;
  2510. if (n === "Map" || n === "Set") return Array.from(o);
  2511. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  2512. }
  2513. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2514. /***/ }),
  2515. /* 9 */
  2516. /*!*****************************************************************!*\
  2517. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  2518. \*****************************************************************/
  2519. /*! no static exports found */
  2520. /***/ (function(module, exports) {
  2521. function _arrayLikeToArray(arr, len) {
  2522. if (len == null || len > arr.length) len = arr.length;
  2523. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2524. arr2[i] = arr[i];
  2525. }
  2526. return arr2;
  2527. }
  2528. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2529. /***/ }),
  2530. /* 10 */
  2531. /*!****************************************************************!*\
  2532. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  2533. \****************************************************************/
  2534. /*! no static exports found */
  2535. /***/ (function(module, exports) {
  2536. function _nonIterableRest() {
  2537. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2538. }
  2539. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2540. /***/ }),
  2541. /* 11 */
  2542. /*!***************************************************************!*\
  2543. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2544. \***************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  2548. function _defineProperty(obj, key, value) {
  2549. key = toPropertyKey(key);
  2550. if (key in obj) {
  2551. Object.defineProperty(obj, key, {
  2552. value: value,
  2553. enumerable: true,
  2554. configurable: true,
  2555. writable: true
  2556. });
  2557. } else {
  2558. obj[key] = value;
  2559. }
  2560. return obj;
  2561. }
  2562. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2563. /***/ }),
  2564. /* 12 */
  2565. /*!**************************************************************!*\
  2566. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2567. \**************************************************************/
  2568. /*! no static exports found */
  2569. /***/ (function(module, exports, __webpack_require__) {
  2570. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2571. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  2572. function _toPropertyKey(arg) {
  2573. var key = toPrimitive(arg, "string");
  2574. return _typeof(key) === "symbol" ? key : String(key);
  2575. }
  2576. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2577. /***/ }),
  2578. /* 13 */
  2579. /*!*******************************************************!*\
  2580. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2581. \*******************************************************/
  2582. /*! no static exports found */
  2583. /***/ (function(module, exports) {
  2584. function _typeof(obj) {
  2585. "@babel/helpers - typeof";
  2586. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  2587. return typeof obj;
  2588. } : function (obj) {
  2589. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2590. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  2591. }
  2592. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2593. /***/ }),
  2594. /* 14 */
  2595. /*!************************************************************!*\
  2596. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2597. \************************************************************/
  2598. /*! no static exports found */
  2599. /***/ (function(module, exports, __webpack_require__) {
  2600. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2601. function _toPrimitive(input, hint) {
  2602. if (_typeof(input) !== "object" || input === null) return input;
  2603. var prim = input[Symbol.toPrimitive];
  2604. if (prim !== undefined) {
  2605. var res = prim.call(input, hint || "default");
  2606. if (_typeof(res) !== "object") return res;
  2607. throw new TypeError("@@toPrimitive must return a primitive value.");
  2608. }
  2609. return (hint === "string" ? String : Number)(input);
  2610. }
  2611. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2612. /***/ }),
  2613. /* 15 */
  2614. /*!**********************************************************!*\
  2615. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2616. \**********************************************************/
  2617. /*! no static exports found */
  2618. /***/ (function(module, exports, __webpack_require__) {
  2619. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  2620. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  2621. function _construct(Parent, args, Class) {
  2622. if (isNativeReflectConstruct()) {
  2623. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  2624. } else {
  2625. module.exports = _construct = function _construct(Parent, args, Class) {
  2626. var a = [null];
  2627. a.push.apply(a, args);
  2628. var Constructor = Function.bind.apply(Parent, a);
  2629. var instance = new Constructor();
  2630. if (Class) setPrototypeOf(instance, Class.prototype);
  2631. return instance;
  2632. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2633. }
  2634. return _construct.apply(null, arguments);
  2635. }
  2636. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2637. /***/ }),
  2638. /* 16 */
  2639. /*!***************************************************************!*\
  2640. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2641. \***************************************************************/
  2642. /*! no static exports found */
  2643. /***/ (function(module, exports) {
  2644. function _setPrototypeOf(o, p) {
  2645. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2646. o.__proto__ = p;
  2647. return o;
  2648. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2649. return _setPrototypeOf(o, p);
  2650. }
  2651. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2652. /***/ }),
  2653. /* 17 */
  2654. /*!*************************************************************************!*\
  2655. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2656. \*************************************************************************/
  2657. /*! no static exports found */
  2658. /***/ (function(module, exports) {
  2659. function _isNativeReflectConstruct() {
  2660. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  2661. if (Reflect.construct.sham) return false;
  2662. if (typeof Proxy === "function") return true;
  2663. try {
  2664. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2665. return true;
  2666. } catch (e) {
  2667. return false;
  2668. }
  2669. }
  2670. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2671. /***/ }),
  2672. /* 18 */
  2673. /*!******************************************************************!*\
  2674. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2675. \******************************************************************/
  2676. /*! no static exports found */
  2677. /***/ (function(module, exports, __webpack_require__) {
  2678. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2679. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2680. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2681. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2682. function _toConsumableArray(arr) {
  2683. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2684. }
  2685. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2686. /***/ }),
  2687. /* 19 */
  2688. /*!******************************************************************!*\
  2689. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2690. \******************************************************************/
  2691. /*! no static exports found */
  2692. /***/ (function(module, exports, __webpack_require__) {
  2693. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2694. function _arrayWithoutHoles(arr) {
  2695. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2696. }
  2697. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2698. /***/ }),
  2699. /* 20 */
  2700. /*!****************************************************************!*\
  2701. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2702. \****************************************************************/
  2703. /*! no static exports found */
  2704. /***/ (function(module, exports) {
  2705. function _iterableToArray(iter) {
  2706. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2707. }
  2708. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2709. /***/ }),
  2710. /* 21 */
  2711. /*!******************************************************************!*\
  2712. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2713. \******************************************************************/
  2714. /*! no static exports found */
  2715. /***/ (function(module, exports) {
  2716. function _nonIterableSpread() {
  2717. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2718. }
  2719. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2720. /***/ }),
  2721. /* 22 */
  2722. /*!*************************************************************!*\
  2723. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2724. \*************************************************************/
  2725. /*! no static exports found */
  2726. /***/ (function(module, exports, __webpack_require__) {
  2727. "use strict";
  2728. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2729. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2730. Object.defineProperty(exports, "__esModule", {
  2731. value: true
  2732. });
  2733. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2734. exports.compileI18nJsonStr = compileI18nJsonStr;
  2735. exports.hasI18nJson = hasI18nJson;
  2736. exports.initVueI18n = initVueI18n;
  2737. exports.isI18nStr = isI18nStr;
  2738. exports.isString = void 0;
  2739. exports.normalizeLocale = normalizeLocale;
  2740. exports.parseI18nJson = parseI18nJson;
  2741. exports.resolveLocale = resolveLocale;
  2742. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2743. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2744. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2745. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2746. var isArray = Array.isArray;
  2747. var isObject = function isObject(val) {
  2748. return val !== null && (0, _typeof2.default)(val) === 'object';
  2749. };
  2750. var defaultDelimiters = ['{', '}'];
  2751. var BaseFormatter = /*#__PURE__*/function () {
  2752. function BaseFormatter() {
  2753. (0, _classCallCheck2.default)(this, BaseFormatter);
  2754. this._caches = Object.create(null);
  2755. }
  2756. (0, _createClass2.default)(BaseFormatter, [{
  2757. key: "interpolate",
  2758. value: function interpolate(message, values) {
  2759. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2760. if (!values) {
  2761. return [message];
  2762. }
  2763. var tokens = this._caches[message];
  2764. if (!tokens) {
  2765. tokens = parse(message, delimiters);
  2766. this._caches[message] = tokens;
  2767. }
  2768. return compile(tokens, values);
  2769. }
  2770. }]);
  2771. return BaseFormatter;
  2772. }();
  2773. exports.Formatter = BaseFormatter;
  2774. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2775. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2776. function parse(format, _ref) {
  2777. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2778. startDelimiter = _ref2[0],
  2779. endDelimiter = _ref2[1];
  2780. var tokens = [];
  2781. var position = 0;
  2782. var text = '';
  2783. while (position < format.length) {
  2784. var char = format[position++];
  2785. if (char === startDelimiter) {
  2786. if (text) {
  2787. tokens.push({
  2788. type: 'text',
  2789. value: text
  2790. });
  2791. }
  2792. text = '';
  2793. var sub = '';
  2794. char = format[position++];
  2795. while (char !== undefined && char !== endDelimiter) {
  2796. sub += char;
  2797. char = format[position++];
  2798. }
  2799. var isClosed = char === endDelimiter;
  2800. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2801. tokens.push({
  2802. value: sub,
  2803. type: type
  2804. });
  2805. }
  2806. // else if (char === '%') {
  2807. // // when found rails i18n syntax, skip text capture
  2808. // if (format[position] !== '{') {
  2809. // text += char
  2810. // }
  2811. // }
  2812. else {
  2813. text += char;
  2814. }
  2815. }
  2816. text && tokens.push({
  2817. type: 'text',
  2818. value: text
  2819. });
  2820. return tokens;
  2821. }
  2822. function compile(tokens, values) {
  2823. var compiled = [];
  2824. var index = 0;
  2825. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2826. if (mode === 'unknown') {
  2827. return compiled;
  2828. }
  2829. while (index < tokens.length) {
  2830. var token = tokens[index];
  2831. switch (token.type) {
  2832. case 'text':
  2833. compiled.push(token.value);
  2834. break;
  2835. case 'list':
  2836. compiled.push(values[parseInt(token.value, 10)]);
  2837. break;
  2838. case 'named':
  2839. if (mode === 'named') {
  2840. compiled.push(values[token.value]);
  2841. } else {
  2842. if (true) {
  2843. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2844. }
  2845. }
  2846. break;
  2847. case 'unknown':
  2848. if (true) {
  2849. console.warn("Detect 'unknown' type of token!");
  2850. }
  2851. break;
  2852. }
  2853. index++;
  2854. }
  2855. return compiled;
  2856. }
  2857. var LOCALE_ZH_HANS = 'zh-Hans';
  2858. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2859. var LOCALE_ZH_HANT = 'zh-Hant';
  2860. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2861. var LOCALE_EN = 'en';
  2862. exports.LOCALE_EN = LOCALE_EN;
  2863. var LOCALE_FR = 'fr';
  2864. exports.LOCALE_FR = LOCALE_FR;
  2865. var LOCALE_ES = 'es';
  2866. exports.LOCALE_ES = LOCALE_ES;
  2867. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2868. var hasOwn = function hasOwn(val, key) {
  2869. return hasOwnProperty.call(val, key);
  2870. };
  2871. var defaultFormatter = new BaseFormatter();
  2872. function include(str, parts) {
  2873. return !!parts.find(function (part) {
  2874. return str.indexOf(part) !== -1;
  2875. });
  2876. }
  2877. function startsWith(str, parts) {
  2878. return parts.find(function (part) {
  2879. return str.indexOf(part) === 0;
  2880. });
  2881. }
  2882. function normalizeLocale(locale, messages) {
  2883. if (!locale) {
  2884. return;
  2885. }
  2886. locale = locale.trim().replace(/_/g, '-');
  2887. if (messages && messages[locale]) {
  2888. return locale;
  2889. }
  2890. locale = locale.toLowerCase();
  2891. if (locale.indexOf('zh') === 0) {
  2892. if (locale.indexOf('-hans') > -1) {
  2893. return LOCALE_ZH_HANS;
  2894. }
  2895. if (locale.indexOf('-hant') > -1) {
  2896. return LOCALE_ZH_HANT;
  2897. }
  2898. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2899. return LOCALE_ZH_HANT;
  2900. }
  2901. return LOCALE_ZH_HANS;
  2902. }
  2903. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2904. if (lang) {
  2905. return lang;
  2906. }
  2907. }
  2908. var I18n = /*#__PURE__*/function () {
  2909. function I18n(_ref3) {
  2910. var locale = _ref3.locale,
  2911. fallbackLocale = _ref3.fallbackLocale,
  2912. messages = _ref3.messages,
  2913. watcher = _ref3.watcher,
  2914. formater = _ref3.formater;
  2915. (0, _classCallCheck2.default)(this, I18n);
  2916. this.locale = LOCALE_EN;
  2917. this.fallbackLocale = LOCALE_EN;
  2918. this.message = {};
  2919. this.messages = {};
  2920. this.watchers = [];
  2921. if (fallbackLocale) {
  2922. this.fallbackLocale = fallbackLocale;
  2923. }
  2924. this.formater = formater || defaultFormatter;
  2925. this.messages = messages || {};
  2926. this.setLocale(locale || LOCALE_EN);
  2927. if (watcher) {
  2928. this.watchLocale(watcher);
  2929. }
  2930. }
  2931. (0, _createClass2.default)(I18n, [{
  2932. key: "setLocale",
  2933. value: function setLocale(locale) {
  2934. var _this = this;
  2935. var oldLocale = this.locale;
  2936. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2937. if (!this.messages[this.locale]) {
  2938. // 可能初始化时不存在
  2939. this.messages[this.locale] = {};
  2940. }
  2941. this.message = this.messages[this.locale];
  2942. // 仅发生变化时,通知
  2943. if (oldLocale !== this.locale) {
  2944. this.watchers.forEach(function (watcher) {
  2945. watcher(_this.locale, oldLocale);
  2946. });
  2947. }
  2948. }
  2949. }, {
  2950. key: "getLocale",
  2951. value: function getLocale() {
  2952. return this.locale;
  2953. }
  2954. }, {
  2955. key: "watchLocale",
  2956. value: function watchLocale(fn) {
  2957. var _this2 = this;
  2958. var index = this.watchers.push(fn) - 1;
  2959. return function () {
  2960. _this2.watchers.splice(index, 1);
  2961. };
  2962. }
  2963. }, {
  2964. key: "add",
  2965. value: function add(locale, message) {
  2966. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2967. var curMessages = this.messages[locale];
  2968. if (curMessages) {
  2969. if (override) {
  2970. Object.assign(curMessages, message);
  2971. } else {
  2972. Object.keys(message).forEach(function (key) {
  2973. if (!hasOwn(curMessages, key)) {
  2974. curMessages[key] = message[key];
  2975. }
  2976. });
  2977. }
  2978. } else {
  2979. this.messages[locale] = message;
  2980. }
  2981. }
  2982. }, {
  2983. key: "f",
  2984. value: function f(message, values, delimiters) {
  2985. return this.formater.interpolate(message, values, delimiters).join('');
  2986. }
  2987. }, {
  2988. key: "t",
  2989. value: function t(key, locale, values) {
  2990. var message = this.message;
  2991. if (typeof locale === 'string') {
  2992. locale = normalizeLocale(locale, this.messages);
  2993. locale && (message = this.messages[locale]);
  2994. } else {
  2995. values = locale;
  2996. }
  2997. if (!hasOwn(message, key)) {
  2998. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2999. return key;
  3000. }
  3001. return this.formater.interpolate(message[key], values).join('');
  3002. }
  3003. }]);
  3004. return I18n;
  3005. }();
  3006. exports.I18n = I18n;
  3007. function watchAppLocale(appVm, i18n) {
  3008. // 需要保证 watch 的触发在组件渲染之前
  3009. if (appVm.$watchLocale) {
  3010. // vue2
  3011. appVm.$watchLocale(function (newLocale) {
  3012. i18n.setLocale(newLocale);
  3013. });
  3014. } else {
  3015. appVm.$watch(function () {
  3016. return appVm.$locale;
  3017. }, function (newLocale) {
  3018. i18n.setLocale(newLocale);
  3019. });
  3020. }
  3021. }
  3022. function getDefaultLocale() {
  3023. if (typeof uni !== 'undefined' && uni.getLocale) {
  3024. return uni.getLocale();
  3025. }
  3026. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3027. if (typeof global !== 'undefined' && global.getLocale) {
  3028. return global.getLocale();
  3029. }
  3030. return LOCALE_EN;
  3031. }
  3032. function initVueI18n(locale) {
  3033. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3034. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3035. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3036. // 兼容旧版本入参
  3037. if (typeof locale !== 'string') {
  3038. var _ref4 = [messages, locale];
  3039. locale = _ref4[0];
  3040. messages = _ref4[1];
  3041. }
  3042. if (typeof locale !== 'string') {
  3043. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3044. locale = getDefaultLocale();
  3045. }
  3046. if (typeof fallbackLocale !== 'string') {
  3047. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3048. }
  3049. var i18n = new I18n({
  3050. locale: locale,
  3051. fallbackLocale: fallbackLocale,
  3052. messages: messages,
  3053. watcher: watcher
  3054. });
  3055. var _t = function t(key, values) {
  3056. if (typeof getApp !== 'function') {
  3057. // app view
  3058. /* eslint-disable no-func-assign */
  3059. _t = function t(key, values) {
  3060. return i18n.t(key, values);
  3061. };
  3062. } else {
  3063. var isWatchedAppLocale = false;
  3064. _t = function t(key, values) {
  3065. var appVm = getApp().$vm;
  3066. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3067. // options: {
  3068. // type: Array,
  3069. // default () {
  3070. // return [{
  3071. // icon: 'shop',
  3072. // text: t("uni-goods-nav.options.shop"),
  3073. // }, {
  3074. // icon: 'cart',
  3075. // text: t("uni-goods-nav.options.cart")
  3076. // }]
  3077. // }
  3078. // },
  3079. if (appVm) {
  3080. // 触发响应式
  3081. appVm.$locale;
  3082. if (!isWatchedAppLocale) {
  3083. isWatchedAppLocale = true;
  3084. watchAppLocale(appVm, i18n);
  3085. }
  3086. }
  3087. return i18n.t(key, values);
  3088. };
  3089. }
  3090. return _t(key, values);
  3091. };
  3092. return {
  3093. i18n: i18n,
  3094. f: function f(message, values, delimiters) {
  3095. return i18n.f(message, values, delimiters);
  3096. },
  3097. t: function t(key, values) {
  3098. return _t(key, values);
  3099. },
  3100. add: function add(locale, message) {
  3101. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3102. return i18n.add(locale, message, override);
  3103. },
  3104. watch: function watch(fn) {
  3105. return i18n.watchLocale(fn);
  3106. },
  3107. getLocale: function getLocale() {
  3108. return i18n.getLocale();
  3109. },
  3110. setLocale: function setLocale(newLocale) {
  3111. return i18n.setLocale(newLocale);
  3112. }
  3113. };
  3114. }
  3115. var isString = function isString(val) {
  3116. return typeof val === 'string';
  3117. };
  3118. exports.isString = isString;
  3119. var formater;
  3120. function hasI18nJson(jsonObj, delimiters) {
  3121. if (!formater) {
  3122. formater = new BaseFormatter();
  3123. }
  3124. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3125. var value = jsonObj[key];
  3126. if (isString(value)) {
  3127. if (isI18nStr(value, delimiters)) {
  3128. return true;
  3129. }
  3130. } else {
  3131. return hasI18nJson(value, delimiters);
  3132. }
  3133. });
  3134. }
  3135. function parseI18nJson(jsonObj, values, delimiters) {
  3136. if (!formater) {
  3137. formater = new BaseFormatter();
  3138. }
  3139. walkJsonObj(jsonObj, function (jsonObj, key) {
  3140. var value = jsonObj[key];
  3141. if (isString(value)) {
  3142. if (isI18nStr(value, delimiters)) {
  3143. jsonObj[key] = compileStr(value, values, delimiters);
  3144. }
  3145. } else {
  3146. parseI18nJson(value, values, delimiters);
  3147. }
  3148. });
  3149. return jsonObj;
  3150. }
  3151. function compileI18nJsonStr(jsonStr, _ref5) {
  3152. var locale = _ref5.locale,
  3153. locales = _ref5.locales,
  3154. delimiters = _ref5.delimiters;
  3155. if (!isI18nStr(jsonStr, delimiters)) {
  3156. return jsonStr;
  3157. }
  3158. if (!formater) {
  3159. formater = new BaseFormatter();
  3160. }
  3161. var localeValues = [];
  3162. Object.keys(locales).forEach(function (name) {
  3163. if (name !== locale) {
  3164. localeValues.push({
  3165. locale: name,
  3166. values: locales[name]
  3167. });
  3168. }
  3169. });
  3170. localeValues.unshift({
  3171. locale: locale,
  3172. values: locales[locale]
  3173. });
  3174. try {
  3175. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3176. } catch (e) {}
  3177. return jsonStr;
  3178. }
  3179. function isI18nStr(value, delimiters) {
  3180. return value.indexOf(delimiters[0]) > -1;
  3181. }
  3182. function compileStr(value, values, delimiters) {
  3183. return formater.interpolate(value, values, delimiters).join('');
  3184. }
  3185. function compileValue(jsonObj, key, localeValues, delimiters) {
  3186. var value = jsonObj[key];
  3187. if (isString(value)) {
  3188. // 存在国际化
  3189. if (isI18nStr(value, delimiters)) {
  3190. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3191. if (localeValues.length > 1) {
  3192. // 格式化国际化语言
  3193. var valueLocales = jsonObj[key + 'Locales'] = {};
  3194. localeValues.forEach(function (localValue) {
  3195. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3196. });
  3197. }
  3198. }
  3199. } else {
  3200. compileJsonObj(value, localeValues, delimiters);
  3201. }
  3202. }
  3203. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3204. walkJsonObj(jsonObj, function (jsonObj, key) {
  3205. compileValue(jsonObj, key, localeValues, delimiters);
  3206. });
  3207. return jsonObj;
  3208. }
  3209. function walkJsonObj(jsonObj, walk) {
  3210. if (isArray(jsonObj)) {
  3211. for (var i = 0; i < jsonObj.length; i++) {
  3212. if (walk(jsonObj, i)) {
  3213. return true;
  3214. }
  3215. }
  3216. } else if (isObject(jsonObj)) {
  3217. for (var key in jsonObj) {
  3218. if (walk(jsonObj, key)) {
  3219. return true;
  3220. }
  3221. }
  3222. }
  3223. return false;
  3224. }
  3225. function resolveLocale(locales) {
  3226. return function (locale) {
  3227. if (!locale) {
  3228. return locale;
  3229. }
  3230. locale = normalizeLocale(locale) || locale;
  3231. return resolveLocaleChain(locale).find(function (locale) {
  3232. return locales.indexOf(locale) > -1;
  3233. });
  3234. };
  3235. }
  3236. function resolveLocaleChain(locale) {
  3237. var chain = [];
  3238. var tokens = locale.split('-');
  3239. while (tokens.length) {
  3240. chain.push(tokens.join('-'));
  3241. tokens.pop();
  3242. }
  3243. return chain;
  3244. }
  3245. /* 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)))
  3246. /***/ }),
  3247. /* 23 */
  3248. /*!***************************************************************!*\
  3249. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3250. \***************************************************************/
  3251. /*! no static exports found */
  3252. /***/ (function(module, exports) {
  3253. function _classCallCheck(instance, Constructor) {
  3254. if (!(instance instanceof Constructor)) {
  3255. throw new TypeError("Cannot call a class as a function");
  3256. }
  3257. }
  3258. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3259. /***/ }),
  3260. /* 24 */
  3261. /*!************************************************************!*\
  3262. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3263. \************************************************************/
  3264. /*! no static exports found */
  3265. /***/ (function(module, exports, __webpack_require__) {
  3266. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3267. function _defineProperties(target, props) {
  3268. for (var i = 0; i < props.length; i++) {
  3269. var descriptor = props[i];
  3270. descriptor.enumerable = descriptor.enumerable || false;
  3271. descriptor.configurable = true;
  3272. if ("value" in descriptor) descriptor.writable = true;
  3273. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3274. }
  3275. }
  3276. function _createClass(Constructor, protoProps, staticProps) {
  3277. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3278. if (staticProps) _defineProperties(Constructor, staticProps);
  3279. Object.defineProperty(Constructor, "prototype", {
  3280. writable: false
  3281. });
  3282. return Constructor;
  3283. }
  3284. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3285. /***/ }),
  3286. /* 25 */
  3287. /*!******************************************************************************************!*\
  3288. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3289. \******************************************************************************************/
  3290. /*! exports provided: default */
  3291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3292. "use strict";
  3293. __webpack_require__.r(__webpack_exports__);
  3294. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3295. * Vue.js v2.6.11
  3296. * (c) 2014-2022 Evan You
  3297. * Released under the MIT License.
  3298. */
  3299. /* */
  3300. var emptyObject = Object.freeze({});
  3301. // These helpers produce better VM code in JS engines due to their
  3302. // explicitness and function inlining.
  3303. function isUndef (v) {
  3304. return v === undefined || v === null
  3305. }
  3306. function isDef (v) {
  3307. return v !== undefined && v !== null
  3308. }
  3309. function isTrue (v) {
  3310. return v === true
  3311. }
  3312. function isFalse (v) {
  3313. return v === false
  3314. }
  3315. /**
  3316. * Check if value is primitive.
  3317. */
  3318. function isPrimitive (value) {
  3319. return (
  3320. typeof value === 'string' ||
  3321. typeof value === 'number' ||
  3322. // $flow-disable-line
  3323. typeof value === 'symbol' ||
  3324. typeof value === 'boolean'
  3325. )
  3326. }
  3327. /**
  3328. * Quick object check - this is primarily used to tell
  3329. * Objects from primitive values when we know the value
  3330. * is a JSON-compliant type.
  3331. */
  3332. function isObject (obj) {
  3333. return obj !== null && typeof obj === 'object'
  3334. }
  3335. /**
  3336. * Get the raw type string of a value, e.g., [object Object].
  3337. */
  3338. var _toString = Object.prototype.toString;
  3339. function toRawType (value) {
  3340. return _toString.call(value).slice(8, -1)
  3341. }
  3342. /**
  3343. * Strict object type check. Only returns true
  3344. * for plain JavaScript objects.
  3345. */
  3346. function isPlainObject (obj) {
  3347. return _toString.call(obj) === '[object Object]'
  3348. }
  3349. function isRegExp (v) {
  3350. return _toString.call(v) === '[object RegExp]'
  3351. }
  3352. /**
  3353. * Check if val is a valid array index.
  3354. */
  3355. function isValidArrayIndex (val) {
  3356. var n = parseFloat(String(val));
  3357. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3358. }
  3359. function isPromise (val) {
  3360. return (
  3361. isDef(val) &&
  3362. typeof val.then === 'function' &&
  3363. typeof val.catch === 'function'
  3364. )
  3365. }
  3366. /**
  3367. * Convert a value to a string that is actually rendered.
  3368. */
  3369. function toString (val) {
  3370. return val == null
  3371. ? ''
  3372. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3373. ? JSON.stringify(val, null, 2)
  3374. : String(val)
  3375. }
  3376. /**
  3377. * Convert an input value to a number for persistence.
  3378. * If the conversion fails, return original string.
  3379. */
  3380. function toNumber (val) {
  3381. var n = parseFloat(val);
  3382. return isNaN(n) ? val : n
  3383. }
  3384. /**
  3385. * Make a map and return a function for checking if a key
  3386. * is in that map.
  3387. */
  3388. function makeMap (
  3389. str,
  3390. expectsLowerCase
  3391. ) {
  3392. var map = Object.create(null);
  3393. var list = str.split(',');
  3394. for (var i = 0; i < list.length; i++) {
  3395. map[list[i]] = true;
  3396. }
  3397. return expectsLowerCase
  3398. ? function (val) { return map[val.toLowerCase()]; }
  3399. : function (val) { return map[val]; }
  3400. }
  3401. /**
  3402. * Check if a tag is a built-in tag.
  3403. */
  3404. var isBuiltInTag = makeMap('slot,component', true);
  3405. /**
  3406. * Check if an attribute is a reserved attribute.
  3407. */
  3408. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3409. /**
  3410. * Remove an item from an array.
  3411. */
  3412. function remove (arr, item) {
  3413. if (arr.length) {
  3414. var index = arr.indexOf(item);
  3415. if (index > -1) {
  3416. return arr.splice(index, 1)
  3417. }
  3418. }
  3419. }
  3420. /**
  3421. * Check whether an object has the property.
  3422. */
  3423. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3424. function hasOwn (obj, key) {
  3425. return hasOwnProperty.call(obj, key)
  3426. }
  3427. /**
  3428. * Create a cached version of a pure function.
  3429. */
  3430. function cached (fn) {
  3431. var cache = Object.create(null);
  3432. return (function cachedFn (str) {
  3433. var hit = cache[str];
  3434. return hit || (cache[str] = fn(str))
  3435. })
  3436. }
  3437. /**
  3438. * Camelize a hyphen-delimited string.
  3439. */
  3440. var camelizeRE = /-(\w)/g;
  3441. var camelize = cached(function (str) {
  3442. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3443. });
  3444. /**
  3445. * Capitalize a string.
  3446. */
  3447. var capitalize = cached(function (str) {
  3448. return str.charAt(0).toUpperCase() + str.slice(1)
  3449. });
  3450. /**
  3451. * Hyphenate a camelCase string.
  3452. */
  3453. var hyphenateRE = /\B([A-Z])/g;
  3454. var hyphenate = cached(function (str) {
  3455. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3456. });
  3457. /**
  3458. * Simple bind polyfill for environments that do not support it,
  3459. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3460. * since native bind is now performant enough in most browsers.
  3461. * But removing it would mean breaking code that was able to run in
  3462. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3463. */
  3464. /* istanbul ignore next */
  3465. function polyfillBind (fn, ctx) {
  3466. function boundFn (a) {
  3467. var l = arguments.length;
  3468. return l
  3469. ? l > 1
  3470. ? fn.apply(ctx, arguments)
  3471. : fn.call(ctx, a)
  3472. : fn.call(ctx)
  3473. }
  3474. boundFn._length = fn.length;
  3475. return boundFn
  3476. }
  3477. function nativeBind (fn, ctx) {
  3478. return fn.bind(ctx)
  3479. }
  3480. var bind = Function.prototype.bind
  3481. ? nativeBind
  3482. : polyfillBind;
  3483. /**
  3484. * Convert an Array-like object to a real Array.
  3485. */
  3486. function toArray (list, start) {
  3487. start = start || 0;
  3488. var i = list.length - start;
  3489. var ret = new Array(i);
  3490. while (i--) {
  3491. ret[i] = list[i + start];
  3492. }
  3493. return ret
  3494. }
  3495. /**
  3496. * Mix properties into target object.
  3497. */
  3498. function extend (to, _from) {
  3499. for (var key in _from) {
  3500. to[key] = _from[key];
  3501. }
  3502. return to
  3503. }
  3504. /**
  3505. * Merge an Array of Objects into a single Object.
  3506. */
  3507. function toObject (arr) {
  3508. var res = {};
  3509. for (var i = 0; i < arr.length; i++) {
  3510. if (arr[i]) {
  3511. extend(res, arr[i]);
  3512. }
  3513. }
  3514. return res
  3515. }
  3516. /* eslint-disable no-unused-vars */
  3517. /**
  3518. * Perform no operation.
  3519. * Stubbing args to make Flow happy without leaving useless transpiled code
  3520. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3521. */
  3522. function noop (a, b, c) {}
  3523. /**
  3524. * Always return false.
  3525. */
  3526. var no = function (a, b, c) { return false; };
  3527. /* eslint-enable no-unused-vars */
  3528. /**
  3529. * Return the same value.
  3530. */
  3531. var identity = function (_) { return _; };
  3532. /**
  3533. * Check if two values are loosely equal - that is,
  3534. * if they are plain objects, do they have the same shape?
  3535. */
  3536. function looseEqual (a, b) {
  3537. if (a === b) { return true }
  3538. var isObjectA = isObject(a);
  3539. var isObjectB = isObject(b);
  3540. if (isObjectA && isObjectB) {
  3541. try {
  3542. var isArrayA = Array.isArray(a);
  3543. var isArrayB = Array.isArray(b);
  3544. if (isArrayA && isArrayB) {
  3545. return a.length === b.length && a.every(function (e, i) {
  3546. return looseEqual(e, b[i])
  3547. })
  3548. } else if (a instanceof Date && b instanceof Date) {
  3549. return a.getTime() === b.getTime()
  3550. } else if (!isArrayA && !isArrayB) {
  3551. var keysA = Object.keys(a);
  3552. var keysB = Object.keys(b);
  3553. return keysA.length === keysB.length && keysA.every(function (key) {
  3554. return looseEqual(a[key], b[key])
  3555. })
  3556. } else {
  3557. /* istanbul ignore next */
  3558. return false
  3559. }
  3560. } catch (e) {
  3561. /* istanbul ignore next */
  3562. return false
  3563. }
  3564. } else if (!isObjectA && !isObjectB) {
  3565. return String(a) === String(b)
  3566. } else {
  3567. return false
  3568. }
  3569. }
  3570. /**
  3571. * Return the first index at which a loosely equal value can be
  3572. * found in the array (if value is a plain object, the array must
  3573. * contain an object of the same shape), or -1 if it is not present.
  3574. */
  3575. function looseIndexOf (arr, val) {
  3576. for (var i = 0; i < arr.length; i++) {
  3577. if (looseEqual(arr[i], val)) { return i }
  3578. }
  3579. return -1
  3580. }
  3581. /**
  3582. * Ensure a function is called only once.
  3583. */
  3584. function once (fn) {
  3585. var called = false;
  3586. return function () {
  3587. if (!called) {
  3588. called = true;
  3589. fn.apply(this, arguments);
  3590. }
  3591. }
  3592. }
  3593. var ASSET_TYPES = [
  3594. 'component',
  3595. 'directive',
  3596. 'filter'
  3597. ];
  3598. var LIFECYCLE_HOOKS = [
  3599. 'beforeCreate',
  3600. 'created',
  3601. 'beforeMount',
  3602. 'mounted',
  3603. 'beforeUpdate',
  3604. 'updated',
  3605. 'beforeDestroy',
  3606. 'destroyed',
  3607. 'activated',
  3608. 'deactivated',
  3609. 'errorCaptured',
  3610. 'serverPrefetch'
  3611. ];
  3612. /* */
  3613. var config = ({
  3614. /**
  3615. * Option merge strategies (used in core/util/options)
  3616. */
  3617. // $flow-disable-line
  3618. optionMergeStrategies: Object.create(null),
  3619. /**
  3620. * Whether to suppress warnings.
  3621. */
  3622. silent: false,
  3623. /**
  3624. * Show production mode tip message on boot?
  3625. */
  3626. productionTip: "development" !== 'production',
  3627. /**
  3628. * Whether to enable devtools
  3629. */
  3630. devtools: "development" !== 'production',
  3631. /**
  3632. * Whether to record perf
  3633. */
  3634. performance: false,
  3635. /**
  3636. * Error handler for watcher errors
  3637. */
  3638. errorHandler: null,
  3639. /**
  3640. * Warn handler for watcher warns
  3641. */
  3642. warnHandler: null,
  3643. /**
  3644. * Ignore certain custom elements
  3645. */
  3646. ignoredElements: [],
  3647. /**
  3648. * Custom user key aliases for v-on
  3649. */
  3650. // $flow-disable-line
  3651. keyCodes: Object.create(null),
  3652. /**
  3653. * Check if a tag is reserved so that it cannot be registered as a
  3654. * component. This is platform-dependent and may be overwritten.
  3655. */
  3656. isReservedTag: no,
  3657. /**
  3658. * Check if an attribute is reserved so that it cannot be used as a component
  3659. * prop. This is platform-dependent and may be overwritten.
  3660. */
  3661. isReservedAttr: no,
  3662. /**
  3663. * Check if a tag is an unknown element.
  3664. * Platform-dependent.
  3665. */
  3666. isUnknownElement: no,
  3667. /**
  3668. * Get the namespace of an element
  3669. */
  3670. getTagNamespace: noop,
  3671. /**
  3672. * Parse the real tag name for the specific platform.
  3673. */
  3674. parsePlatformTagName: identity,
  3675. /**
  3676. * Check if an attribute must be bound using property, e.g. value
  3677. * Platform-dependent.
  3678. */
  3679. mustUseProp: no,
  3680. /**
  3681. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3682. * This will significantly reduce performance if set to false.
  3683. */
  3684. async: true,
  3685. /**
  3686. * Exposed for legacy reasons
  3687. */
  3688. _lifecycleHooks: LIFECYCLE_HOOKS
  3689. });
  3690. /* */
  3691. /**
  3692. * unicode letters used for parsing html tags, component names and property paths.
  3693. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3694. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3695. */
  3696. 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/;
  3697. /**
  3698. * Check if a string starts with $ or _
  3699. */
  3700. function isReserved (str) {
  3701. var c = (str + '').charCodeAt(0);
  3702. return c === 0x24 || c === 0x5F
  3703. }
  3704. /**
  3705. * Define a property.
  3706. */
  3707. function def (obj, key, val, enumerable) {
  3708. Object.defineProperty(obj, key, {
  3709. value: val,
  3710. enumerable: !!enumerable,
  3711. writable: true,
  3712. configurable: true
  3713. });
  3714. }
  3715. /**
  3716. * Parse simple path.
  3717. */
  3718. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3719. function parsePath (path) {
  3720. if (bailRE.test(path)) {
  3721. return
  3722. }
  3723. var segments = path.split('.');
  3724. return function (obj) {
  3725. for (var i = 0; i < segments.length; i++) {
  3726. if (!obj) { return }
  3727. obj = obj[segments[i]];
  3728. }
  3729. return obj
  3730. }
  3731. }
  3732. /* */
  3733. // can we use __proto__?
  3734. var hasProto = '__proto__' in {};
  3735. // Browser environment sniffing
  3736. var inBrowser = typeof window !== 'undefined';
  3737. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3738. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3739. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3740. var isIE = UA && /msie|trident/.test(UA);
  3741. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3742. var isEdge = UA && UA.indexOf('edge/') > 0;
  3743. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3744. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3745. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3746. var isPhantomJS = UA && /phantomjs/.test(UA);
  3747. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3748. // Firefox has a "watch" function on Object.prototype...
  3749. var nativeWatch = ({}).watch;
  3750. if (inBrowser) {
  3751. try {
  3752. var opts = {};
  3753. Object.defineProperty(opts, 'passive', ({
  3754. get: function get () {
  3755. }
  3756. })); // https://github.com/facebook/flow/issues/285
  3757. window.addEventListener('test-passive', null, opts);
  3758. } catch (e) {}
  3759. }
  3760. // this needs to be lazy-evaled because vue may be required before
  3761. // vue-server-renderer can set VUE_ENV
  3762. var _isServer;
  3763. var isServerRendering = function () {
  3764. if (_isServer === undefined) {
  3765. /* istanbul ignore if */
  3766. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3767. // detect presence of vue-server-renderer and avoid
  3768. // Webpack shimming the process
  3769. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3770. } else {
  3771. _isServer = false;
  3772. }
  3773. }
  3774. return _isServer
  3775. };
  3776. // detect devtools
  3777. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3778. /* istanbul ignore next */
  3779. function isNative (Ctor) {
  3780. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3781. }
  3782. var hasSymbol =
  3783. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3784. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3785. var _Set;
  3786. /* istanbul ignore if */ // $flow-disable-line
  3787. if (typeof Set !== 'undefined' && isNative(Set)) {
  3788. // use native Set when available.
  3789. _Set = Set;
  3790. } else {
  3791. // a non-standard Set polyfill that only works with primitive keys.
  3792. _Set = /*@__PURE__*/(function () {
  3793. function Set () {
  3794. this.set = Object.create(null);
  3795. }
  3796. Set.prototype.has = function has (key) {
  3797. return this.set[key] === true
  3798. };
  3799. Set.prototype.add = function add (key) {
  3800. this.set[key] = true;
  3801. };
  3802. Set.prototype.clear = function clear () {
  3803. this.set = Object.create(null);
  3804. };
  3805. return Set;
  3806. }());
  3807. }
  3808. /* */
  3809. var warn = noop;
  3810. var tip = noop;
  3811. var generateComponentTrace = (noop); // work around flow check
  3812. var formatComponentName = (noop);
  3813. if (true) {
  3814. var hasConsole = typeof console !== 'undefined';
  3815. var classifyRE = /(?:^|[-_])(\w)/g;
  3816. var classify = function (str) { return str
  3817. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3818. .replace(/[-_]/g, ''); };
  3819. warn = function (msg, vm) {
  3820. var trace = vm ? generateComponentTrace(vm) : '';
  3821. if (config.warnHandler) {
  3822. config.warnHandler.call(null, msg, vm, trace);
  3823. } else if (hasConsole && (!config.silent)) {
  3824. console.error(("[Vue warn]: " + msg + trace));
  3825. }
  3826. };
  3827. tip = function (msg, vm) {
  3828. if (hasConsole && (!config.silent)) {
  3829. console.warn("[Vue tip]: " + msg + (
  3830. vm ? generateComponentTrace(vm) : ''
  3831. ));
  3832. }
  3833. };
  3834. formatComponentName = function (vm, includeFile) {
  3835. if (vm.$root === vm) {
  3836. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3837. return ('') + vm.$options.__file
  3838. }
  3839. return '<Root>'
  3840. }
  3841. var options = typeof vm === 'function' && vm.cid != null
  3842. ? vm.options
  3843. : vm._isVue
  3844. ? vm.$options || vm.constructor.options
  3845. : vm;
  3846. var name = options.name || options._componentTag;
  3847. var file = options.__file;
  3848. if (!name && file) {
  3849. var match = file.match(/([^/\\]+)\.vue$/);
  3850. name = match && match[1];
  3851. }
  3852. return (
  3853. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3854. (file && includeFile !== false ? (" at " + file) : '')
  3855. )
  3856. };
  3857. var repeat = function (str, n) {
  3858. var res = '';
  3859. while (n) {
  3860. if (n % 2 === 1) { res += str; }
  3861. if (n > 1) { str += str; }
  3862. n >>= 1;
  3863. }
  3864. return res
  3865. };
  3866. generateComponentTrace = function (vm) {
  3867. if (vm._isVue && vm.$parent) {
  3868. var tree = [];
  3869. var currentRecursiveSequence = 0;
  3870. while (vm && vm.$options.name !== 'PageBody') {
  3871. if (tree.length > 0) {
  3872. var last = tree[tree.length - 1];
  3873. if (last.constructor === vm.constructor) {
  3874. currentRecursiveSequence++;
  3875. vm = vm.$parent;
  3876. continue
  3877. } else if (currentRecursiveSequence > 0) {
  3878. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3879. currentRecursiveSequence = 0;
  3880. }
  3881. }
  3882. !vm.$options.isReserved && tree.push(vm);
  3883. vm = vm.$parent;
  3884. }
  3885. return '\n\nfound in\n\n' + tree
  3886. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3887. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3888. : formatComponentName(vm))); })
  3889. .join('\n')
  3890. } else {
  3891. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3892. }
  3893. };
  3894. }
  3895. /* */
  3896. var uid = 0;
  3897. /**
  3898. * A dep is an observable that can have multiple
  3899. * directives subscribing to it.
  3900. */
  3901. var Dep = function Dep () {
  3902. this.id = uid++;
  3903. this.subs = [];
  3904. };
  3905. Dep.prototype.addSub = function addSub (sub) {
  3906. this.subs.push(sub);
  3907. };
  3908. Dep.prototype.removeSub = function removeSub (sub) {
  3909. remove(this.subs, sub);
  3910. };
  3911. Dep.prototype.depend = function depend () {
  3912. if (Dep.SharedObject.target) {
  3913. Dep.SharedObject.target.addDep(this);
  3914. }
  3915. };
  3916. Dep.prototype.notify = function notify () {
  3917. // stabilize the subscriber list first
  3918. var subs = this.subs.slice();
  3919. if ( true && !config.async) {
  3920. // subs aren't sorted in scheduler if not running async
  3921. // we need to sort them now to make sure they fire in correct
  3922. // order
  3923. subs.sort(function (a, b) { return a.id - b.id; });
  3924. }
  3925. for (var i = 0, l = subs.length; i < l; i++) {
  3926. subs[i].update();
  3927. }
  3928. };
  3929. // The current target watcher being evaluated.
  3930. // This is globally unique because only one watcher
  3931. // can be evaluated at a time.
  3932. // fixed by xxxxxx (nvue shared vuex)
  3933. /* eslint-disable no-undef */
  3934. Dep.SharedObject = {};
  3935. Dep.SharedObject.target = null;
  3936. Dep.SharedObject.targetStack = [];
  3937. function pushTarget (target) {
  3938. Dep.SharedObject.targetStack.push(target);
  3939. Dep.SharedObject.target = target;
  3940. Dep.target = target;
  3941. }
  3942. function popTarget () {
  3943. Dep.SharedObject.targetStack.pop();
  3944. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3945. Dep.target = Dep.SharedObject.target;
  3946. }
  3947. /* */
  3948. var VNode = function VNode (
  3949. tag,
  3950. data,
  3951. children,
  3952. text,
  3953. elm,
  3954. context,
  3955. componentOptions,
  3956. asyncFactory
  3957. ) {
  3958. this.tag = tag;
  3959. this.data = data;
  3960. this.children = children;
  3961. this.text = text;
  3962. this.elm = elm;
  3963. this.ns = undefined;
  3964. this.context = context;
  3965. this.fnContext = undefined;
  3966. this.fnOptions = undefined;
  3967. this.fnScopeId = undefined;
  3968. this.key = data && data.key;
  3969. this.componentOptions = componentOptions;
  3970. this.componentInstance = undefined;
  3971. this.parent = undefined;
  3972. this.raw = false;
  3973. this.isStatic = false;
  3974. this.isRootInsert = true;
  3975. this.isComment = false;
  3976. this.isCloned = false;
  3977. this.isOnce = false;
  3978. this.asyncFactory = asyncFactory;
  3979. this.asyncMeta = undefined;
  3980. this.isAsyncPlaceholder = false;
  3981. };
  3982. var prototypeAccessors = { child: { configurable: true } };
  3983. // DEPRECATED: alias for componentInstance for backwards compat.
  3984. /* istanbul ignore next */
  3985. prototypeAccessors.child.get = function () {
  3986. return this.componentInstance
  3987. };
  3988. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3989. var createEmptyVNode = function (text) {
  3990. if ( text === void 0 ) text = '';
  3991. var node = new VNode();
  3992. node.text = text;
  3993. node.isComment = true;
  3994. return node
  3995. };
  3996. function createTextVNode (val) {
  3997. return new VNode(undefined, undefined, undefined, String(val))
  3998. }
  3999. // optimized shallow clone
  4000. // used for static nodes and slot nodes because they may be reused across
  4001. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4002. // on their elm reference.
  4003. function cloneVNode (vnode) {
  4004. var cloned = new VNode(
  4005. vnode.tag,
  4006. vnode.data,
  4007. // #7975
  4008. // clone children array to avoid mutating original in case of cloning
  4009. // a child.
  4010. vnode.children && vnode.children.slice(),
  4011. vnode.text,
  4012. vnode.elm,
  4013. vnode.context,
  4014. vnode.componentOptions,
  4015. vnode.asyncFactory
  4016. );
  4017. cloned.ns = vnode.ns;
  4018. cloned.isStatic = vnode.isStatic;
  4019. cloned.key = vnode.key;
  4020. cloned.isComment = vnode.isComment;
  4021. cloned.fnContext = vnode.fnContext;
  4022. cloned.fnOptions = vnode.fnOptions;
  4023. cloned.fnScopeId = vnode.fnScopeId;
  4024. cloned.asyncMeta = vnode.asyncMeta;
  4025. cloned.isCloned = true;
  4026. return cloned
  4027. }
  4028. /*
  4029. * not type checking this file because flow doesn't play well with
  4030. * dynamically accessing methods on Array prototype
  4031. */
  4032. var arrayProto = Array.prototype;
  4033. var arrayMethods = Object.create(arrayProto);
  4034. var methodsToPatch = [
  4035. 'push',
  4036. 'pop',
  4037. 'shift',
  4038. 'unshift',
  4039. 'splice',
  4040. 'sort',
  4041. 'reverse'
  4042. ];
  4043. /**
  4044. * Intercept mutating methods and emit events
  4045. */
  4046. methodsToPatch.forEach(function (method) {
  4047. // cache original method
  4048. var original = arrayProto[method];
  4049. def(arrayMethods, method, function mutator () {
  4050. var args = [], len = arguments.length;
  4051. while ( len-- ) args[ len ] = arguments[ len ];
  4052. var result = original.apply(this, args);
  4053. var ob = this.__ob__;
  4054. var inserted;
  4055. switch (method) {
  4056. case 'push':
  4057. case 'unshift':
  4058. inserted = args;
  4059. break
  4060. case 'splice':
  4061. inserted = args.slice(2);
  4062. break
  4063. }
  4064. if (inserted) { ob.observeArray(inserted); }
  4065. // notify change
  4066. ob.dep.notify();
  4067. return result
  4068. });
  4069. });
  4070. /* */
  4071. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4072. /**
  4073. * In some cases we may want to disable observation inside a component's
  4074. * update computation.
  4075. */
  4076. var shouldObserve = true;
  4077. function toggleObserving (value) {
  4078. shouldObserve = value;
  4079. }
  4080. /**
  4081. * Observer class that is attached to each observed
  4082. * object. Once attached, the observer converts the target
  4083. * object's property keys into getter/setters that
  4084. * collect dependencies and dispatch updates.
  4085. */
  4086. var Observer = function Observer (value) {
  4087. this.value = value;
  4088. this.dep = new Dep();
  4089. this.vmCount = 0;
  4090. def(value, '__ob__', this);
  4091. if (Array.isArray(value)) {
  4092. if (hasProto) {
  4093. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4094. if(value.push !== value.__proto__.push){
  4095. copyAugment(value, arrayMethods, arrayKeys);
  4096. } else {
  4097. protoAugment(value, arrayMethods);
  4098. }
  4099. }
  4100. } else {
  4101. copyAugment(value, arrayMethods, arrayKeys);
  4102. }
  4103. this.observeArray(value);
  4104. } else {
  4105. this.walk(value);
  4106. }
  4107. };
  4108. /**
  4109. * Walk through all properties and convert them into
  4110. * getter/setters. This method should only be called when
  4111. * value type is Object.
  4112. */
  4113. Observer.prototype.walk = function walk (obj) {
  4114. var keys = Object.keys(obj);
  4115. for (var i = 0; i < keys.length; i++) {
  4116. defineReactive$$1(obj, keys[i]);
  4117. }
  4118. };
  4119. /**
  4120. * Observe a list of Array items.
  4121. */
  4122. Observer.prototype.observeArray = function observeArray (items) {
  4123. for (var i = 0, l = items.length; i < l; i++) {
  4124. observe(items[i]);
  4125. }
  4126. };
  4127. // helpers
  4128. /**
  4129. * Augment a target Object or Array by intercepting
  4130. * the prototype chain using __proto__
  4131. */
  4132. function protoAugment (target, src) {
  4133. /* eslint-disable no-proto */
  4134. target.__proto__ = src;
  4135. /* eslint-enable no-proto */
  4136. }
  4137. /**
  4138. * Augment a target Object or Array by defining
  4139. * hidden properties.
  4140. */
  4141. /* istanbul ignore next */
  4142. function copyAugment (target, src, keys) {
  4143. for (var i = 0, l = keys.length; i < l; i++) {
  4144. var key = keys[i];
  4145. def(target, key, src[key]);
  4146. }
  4147. }
  4148. /**
  4149. * Attempt to create an observer instance for a value,
  4150. * returns the new observer if successfully observed,
  4151. * or the existing observer if the value already has one.
  4152. */
  4153. function observe (value, asRootData) {
  4154. if (!isObject(value) || value instanceof VNode) {
  4155. return
  4156. }
  4157. var ob;
  4158. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4159. ob = value.__ob__;
  4160. } else if (
  4161. shouldObserve &&
  4162. !isServerRendering() &&
  4163. (Array.isArray(value) || isPlainObject(value)) &&
  4164. Object.isExtensible(value) &&
  4165. !value._isVue &&
  4166. !value.__v_isMPComponent
  4167. ) {
  4168. ob = new Observer(value);
  4169. }
  4170. if (asRootData && ob) {
  4171. ob.vmCount++;
  4172. }
  4173. return ob
  4174. }
  4175. /**
  4176. * Define a reactive property on an Object.
  4177. */
  4178. function defineReactive$$1 (
  4179. obj,
  4180. key,
  4181. val,
  4182. customSetter,
  4183. shallow
  4184. ) {
  4185. var dep = new Dep();
  4186. var property = Object.getOwnPropertyDescriptor(obj, key);
  4187. if (property && property.configurable === false) {
  4188. return
  4189. }
  4190. // cater for pre-defined getter/setters
  4191. var getter = property && property.get;
  4192. var setter = property && property.set;
  4193. if ((!getter || setter) && arguments.length === 2) {
  4194. val = obj[key];
  4195. }
  4196. var childOb = !shallow && observe(val);
  4197. Object.defineProperty(obj, key, {
  4198. enumerable: true,
  4199. configurable: true,
  4200. get: function reactiveGetter () {
  4201. var value = getter ? getter.call(obj) : val;
  4202. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4203. dep.depend();
  4204. if (childOb) {
  4205. childOb.dep.depend();
  4206. if (Array.isArray(value)) {
  4207. dependArray(value);
  4208. }
  4209. }
  4210. }
  4211. return value
  4212. },
  4213. set: function reactiveSetter (newVal) {
  4214. var value = getter ? getter.call(obj) : val;
  4215. /* eslint-disable no-self-compare */
  4216. if (newVal === value || (newVal !== newVal && value !== value)) {
  4217. return
  4218. }
  4219. /* eslint-enable no-self-compare */
  4220. if ( true && customSetter) {
  4221. customSetter();
  4222. }
  4223. // #7981: for accessor properties without setter
  4224. if (getter && !setter) { return }
  4225. if (setter) {
  4226. setter.call(obj, newVal);
  4227. } else {
  4228. val = newVal;
  4229. }
  4230. childOb = !shallow && observe(newVal);
  4231. dep.notify();
  4232. }
  4233. });
  4234. }
  4235. /**
  4236. * Set a property on an object. Adds the new property and
  4237. * triggers change notification if the property doesn't
  4238. * already exist.
  4239. */
  4240. function set (target, key, val) {
  4241. if ( true &&
  4242. (isUndef(target) || isPrimitive(target))
  4243. ) {
  4244. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4245. }
  4246. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4247. target.length = Math.max(target.length, key);
  4248. target.splice(key, 1, val);
  4249. return val
  4250. }
  4251. if (key in target && !(key in Object.prototype)) {
  4252. target[key] = val;
  4253. return val
  4254. }
  4255. var ob = (target).__ob__;
  4256. if (target._isVue || (ob && ob.vmCount)) {
  4257. true && warn(
  4258. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4259. 'at runtime - declare it upfront in the data option.'
  4260. );
  4261. return val
  4262. }
  4263. if (!ob) {
  4264. target[key] = val;
  4265. return val
  4266. }
  4267. defineReactive$$1(ob.value, key, val);
  4268. ob.dep.notify();
  4269. return val
  4270. }
  4271. /**
  4272. * Delete a property and trigger change if necessary.
  4273. */
  4274. function del (target, key) {
  4275. if ( true &&
  4276. (isUndef(target) || isPrimitive(target))
  4277. ) {
  4278. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4279. }
  4280. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4281. target.splice(key, 1);
  4282. return
  4283. }
  4284. var ob = (target).__ob__;
  4285. if (target._isVue || (ob && ob.vmCount)) {
  4286. true && warn(
  4287. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4288. '- just set it to null.'
  4289. );
  4290. return
  4291. }
  4292. if (!hasOwn(target, key)) {
  4293. return
  4294. }
  4295. delete target[key];
  4296. if (!ob) {
  4297. return
  4298. }
  4299. ob.dep.notify();
  4300. }
  4301. /**
  4302. * Collect dependencies on array elements when the array is touched, since
  4303. * we cannot intercept array element access like property getters.
  4304. */
  4305. function dependArray (value) {
  4306. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4307. e = value[i];
  4308. e && e.__ob__ && e.__ob__.dep.depend();
  4309. if (Array.isArray(e)) {
  4310. dependArray(e);
  4311. }
  4312. }
  4313. }
  4314. /* */
  4315. /**
  4316. * Option overwriting strategies are functions that handle
  4317. * how to merge a parent option value and a child option
  4318. * value into the final value.
  4319. */
  4320. var strats = config.optionMergeStrategies;
  4321. /**
  4322. * Options with restrictions
  4323. */
  4324. if (true) {
  4325. strats.el = strats.propsData = function (parent, child, vm, key) {
  4326. if (!vm) {
  4327. warn(
  4328. "option \"" + key + "\" can only be used during instance " +
  4329. 'creation with the `new` keyword.'
  4330. );
  4331. }
  4332. return defaultStrat(parent, child)
  4333. };
  4334. }
  4335. /**
  4336. * Helper that recursively merges two data objects together.
  4337. */
  4338. function mergeData (to, from) {
  4339. if (!from) { return to }
  4340. var key, toVal, fromVal;
  4341. var keys = hasSymbol
  4342. ? Reflect.ownKeys(from)
  4343. : Object.keys(from);
  4344. for (var i = 0; i < keys.length; i++) {
  4345. key = keys[i];
  4346. // in case the object is already observed...
  4347. if (key === '__ob__') { continue }
  4348. toVal = to[key];
  4349. fromVal = from[key];
  4350. if (!hasOwn(to, key)) {
  4351. set(to, key, fromVal);
  4352. } else if (
  4353. toVal !== fromVal &&
  4354. isPlainObject(toVal) &&
  4355. isPlainObject(fromVal)
  4356. ) {
  4357. mergeData(toVal, fromVal);
  4358. }
  4359. }
  4360. return to
  4361. }
  4362. /**
  4363. * Data
  4364. */
  4365. function mergeDataOrFn (
  4366. parentVal,
  4367. childVal,
  4368. vm
  4369. ) {
  4370. if (!vm) {
  4371. // in a Vue.extend merge, both should be functions
  4372. if (!childVal) {
  4373. return parentVal
  4374. }
  4375. if (!parentVal) {
  4376. return childVal
  4377. }
  4378. // when parentVal & childVal are both present,
  4379. // we need to return a function that returns the
  4380. // merged result of both functions... no need to
  4381. // check if parentVal is a function here because
  4382. // it has to be a function to pass previous merges.
  4383. return function mergedDataFn () {
  4384. return mergeData(
  4385. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4386. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4387. )
  4388. }
  4389. } else {
  4390. return function mergedInstanceDataFn () {
  4391. // instance merge
  4392. var instanceData = typeof childVal === 'function'
  4393. ? childVal.call(vm, vm)
  4394. : childVal;
  4395. var defaultData = typeof parentVal === 'function'
  4396. ? parentVal.call(vm, vm)
  4397. : parentVal;
  4398. if (instanceData) {
  4399. return mergeData(instanceData, defaultData)
  4400. } else {
  4401. return defaultData
  4402. }
  4403. }
  4404. }
  4405. }
  4406. strats.data = function (
  4407. parentVal,
  4408. childVal,
  4409. vm
  4410. ) {
  4411. if (!vm) {
  4412. if (childVal && typeof childVal !== 'function') {
  4413. true && warn(
  4414. 'The "data" option should be a function ' +
  4415. 'that returns a per-instance value in component ' +
  4416. 'definitions.',
  4417. vm
  4418. );
  4419. return parentVal
  4420. }
  4421. return mergeDataOrFn(parentVal, childVal)
  4422. }
  4423. return mergeDataOrFn(parentVal, childVal, vm)
  4424. };
  4425. /**
  4426. * Hooks and props are merged as arrays.
  4427. */
  4428. function mergeHook (
  4429. parentVal,
  4430. childVal
  4431. ) {
  4432. var res = childVal
  4433. ? parentVal
  4434. ? parentVal.concat(childVal)
  4435. : Array.isArray(childVal)
  4436. ? childVal
  4437. : [childVal]
  4438. : parentVal;
  4439. return res
  4440. ? dedupeHooks(res)
  4441. : res
  4442. }
  4443. function dedupeHooks (hooks) {
  4444. var res = [];
  4445. for (var i = 0; i < hooks.length; i++) {
  4446. if (res.indexOf(hooks[i]) === -1) {
  4447. res.push(hooks[i]);
  4448. }
  4449. }
  4450. return res
  4451. }
  4452. LIFECYCLE_HOOKS.forEach(function (hook) {
  4453. strats[hook] = mergeHook;
  4454. });
  4455. /**
  4456. * Assets
  4457. *
  4458. * When a vm is present (instance creation), we need to do
  4459. * a three-way merge between constructor options, instance
  4460. * options and parent options.
  4461. */
  4462. function mergeAssets (
  4463. parentVal,
  4464. childVal,
  4465. vm,
  4466. key
  4467. ) {
  4468. var res = Object.create(parentVal || null);
  4469. if (childVal) {
  4470. true && assertObjectType(key, childVal, vm);
  4471. return extend(res, childVal)
  4472. } else {
  4473. return res
  4474. }
  4475. }
  4476. ASSET_TYPES.forEach(function (type) {
  4477. strats[type + 's'] = mergeAssets;
  4478. });
  4479. /**
  4480. * Watchers.
  4481. *
  4482. * Watchers hashes should not overwrite one
  4483. * another, so we merge them as arrays.
  4484. */
  4485. strats.watch = function (
  4486. parentVal,
  4487. childVal,
  4488. vm,
  4489. key
  4490. ) {
  4491. // work around Firefox's Object.prototype.watch...
  4492. if (parentVal === nativeWatch) { parentVal = undefined; }
  4493. if (childVal === nativeWatch) { childVal = undefined; }
  4494. /* istanbul ignore if */
  4495. if (!childVal) { return Object.create(parentVal || null) }
  4496. if (true) {
  4497. assertObjectType(key, childVal, vm);
  4498. }
  4499. if (!parentVal) { return childVal }
  4500. var ret = {};
  4501. extend(ret, parentVal);
  4502. for (var key$1 in childVal) {
  4503. var parent = ret[key$1];
  4504. var child = childVal[key$1];
  4505. if (parent && !Array.isArray(parent)) {
  4506. parent = [parent];
  4507. }
  4508. ret[key$1] = parent
  4509. ? parent.concat(child)
  4510. : Array.isArray(child) ? child : [child];
  4511. }
  4512. return ret
  4513. };
  4514. /**
  4515. * Other object hashes.
  4516. */
  4517. strats.props =
  4518. strats.methods =
  4519. strats.inject =
  4520. strats.computed = function (
  4521. parentVal,
  4522. childVal,
  4523. vm,
  4524. key
  4525. ) {
  4526. if (childVal && "development" !== 'production') {
  4527. assertObjectType(key, childVal, vm);
  4528. }
  4529. if (!parentVal) { return childVal }
  4530. var ret = Object.create(null);
  4531. extend(ret, parentVal);
  4532. if (childVal) { extend(ret, childVal); }
  4533. return ret
  4534. };
  4535. strats.provide = mergeDataOrFn;
  4536. /**
  4537. * Default strategy.
  4538. */
  4539. var defaultStrat = function (parentVal, childVal) {
  4540. return childVal === undefined
  4541. ? parentVal
  4542. : childVal
  4543. };
  4544. /**
  4545. * Validate component names
  4546. */
  4547. function checkComponents (options) {
  4548. for (var key in options.components) {
  4549. validateComponentName(key);
  4550. }
  4551. }
  4552. function validateComponentName (name) {
  4553. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4554. warn(
  4555. 'Invalid component name: "' + name + '". Component names ' +
  4556. 'should conform to valid custom element name in html5 specification.'
  4557. );
  4558. }
  4559. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4560. warn(
  4561. 'Do not use built-in or reserved HTML elements as component ' +
  4562. 'id: ' + name
  4563. );
  4564. }
  4565. }
  4566. /**
  4567. * Ensure all props option syntax are normalized into the
  4568. * Object-based format.
  4569. */
  4570. function normalizeProps (options, vm) {
  4571. var props = options.props;
  4572. if (!props) { return }
  4573. var res = {};
  4574. var i, val, name;
  4575. if (Array.isArray(props)) {
  4576. i = props.length;
  4577. while (i--) {
  4578. val = props[i];
  4579. if (typeof val === 'string') {
  4580. name = camelize(val);
  4581. res[name] = { type: null };
  4582. } else if (true) {
  4583. warn('props must be strings when using array syntax.');
  4584. }
  4585. }
  4586. } else if (isPlainObject(props)) {
  4587. for (var key in props) {
  4588. val = props[key];
  4589. name = camelize(key);
  4590. res[name] = isPlainObject(val)
  4591. ? val
  4592. : { type: val };
  4593. }
  4594. } else if (true) {
  4595. warn(
  4596. "Invalid value for option \"props\": expected an Array or an Object, " +
  4597. "but got " + (toRawType(props)) + ".",
  4598. vm
  4599. );
  4600. }
  4601. options.props = res;
  4602. }
  4603. /**
  4604. * Normalize all injections into Object-based format
  4605. */
  4606. function normalizeInject (options, vm) {
  4607. var inject = options.inject;
  4608. if (!inject) { return }
  4609. var normalized = options.inject = {};
  4610. if (Array.isArray(inject)) {
  4611. for (var i = 0; i < inject.length; i++) {
  4612. normalized[inject[i]] = { from: inject[i] };
  4613. }
  4614. } else if (isPlainObject(inject)) {
  4615. for (var key in inject) {
  4616. var val = inject[key];
  4617. normalized[key] = isPlainObject(val)
  4618. ? extend({ from: key }, val)
  4619. : { from: val };
  4620. }
  4621. } else if (true) {
  4622. warn(
  4623. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4624. "but got " + (toRawType(inject)) + ".",
  4625. vm
  4626. );
  4627. }
  4628. }
  4629. /**
  4630. * Normalize raw function directives into object format.
  4631. */
  4632. function normalizeDirectives (options) {
  4633. var dirs = options.directives;
  4634. if (dirs) {
  4635. for (var key in dirs) {
  4636. var def$$1 = dirs[key];
  4637. if (typeof def$$1 === 'function') {
  4638. dirs[key] = { bind: def$$1, update: def$$1 };
  4639. }
  4640. }
  4641. }
  4642. }
  4643. function assertObjectType (name, value, vm) {
  4644. if (!isPlainObject(value)) {
  4645. warn(
  4646. "Invalid value for option \"" + name + "\": expected an Object, " +
  4647. "but got " + (toRawType(value)) + ".",
  4648. vm
  4649. );
  4650. }
  4651. }
  4652. /**
  4653. * Merge two option objects into a new one.
  4654. * Core utility used in both instantiation and inheritance.
  4655. */
  4656. function mergeOptions (
  4657. parent,
  4658. child,
  4659. vm
  4660. ) {
  4661. if (true) {
  4662. checkComponents(child);
  4663. }
  4664. if (typeof child === 'function') {
  4665. child = child.options;
  4666. }
  4667. normalizeProps(child, vm);
  4668. normalizeInject(child, vm);
  4669. normalizeDirectives(child);
  4670. // Apply extends and mixins on the child options,
  4671. // but only if it is a raw options object that isn't
  4672. // the result of another mergeOptions call.
  4673. // Only merged options has the _base property.
  4674. if (!child._base) {
  4675. if (child.extends) {
  4676. parent = mergeOptions(parent, child.extends, vm);
  4677. }
  4678. if (child.mixins) {
  4679. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4680. parent = mergeOptions(parent, child.mixins[i], vm);
  4681. }
  4682. }
  4683. }
  4684. var options = {};
  4685. var key;
  4686. for (key in parent) {
  4687. mergeField(key);
  4688. }
  4689. for (key in child) {
  4690. if (!hasOwn(parent, key)) {
  4691. mergeField(key);
  4692. }
  4693. }
  4694. function mergeField (key) {
  4695. var strat = strats[key] || defaultStrat;
  4696. options[key] = strat(parent[key], child[key], vm, key);
  4697. }
  4698. return options
  4699. }
  4700. /**
  4701. * Resolve an asset.
  4702. * This function is used because child instances need access
  4703. * to assets defined in its ancestor chain.
  4704. */
  4705. function resolveAsset (
  4706. options,
  4707. type,
  4708. id,
  4709. warnMissing
  4710. ) {
  4711. /* istanbul ignore if */
  4712. if (typeof id !== 'string') {
  4713. return
  4714. }
  4715. var assets = options[type];
  4716. // check local registration variations first
  4717. if (hasOwn(assets, id)) { return assets[id] }
  4718. var camelizedId = camelize(id);
  4719. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4720. var PascalCaseId = capitalize(camelizedId);
  4721. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4722. // fallback to prototype chain
  4723. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4724. if ( true && warnMissing && !res) {
  4725. warn(
  4726. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4727. options
  4728. );
  4729. }
  4730. return res
  4731. }
  4732. /* */
  4733. function validateProp (
  4734. key,
  4735. propOptions,
  4736. propsData,
  4737. vm
  4738. ) {
  4739. var prop = propOptions[key];
  4740. var absent = !hasOwn(propsData, key);
  4741. var value = propsData[key];
  4742. // boolean casting
  4743. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4744. if (booleanIndex > -1) {
  4745. if (absent && !hasOwn(prop, 'default')) {
  4746. value = false;
  4747. } else if (value === '' || value === hyphenate(key)) {
  4748. // only cast empty string / same name to boolean if
  4749. // boolean has higher priority
  4750. var stringIndex = getTypeIndex(String, prop.type);
  4751. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4752. value = true;
  4753. }
  4754. }
  4755. }
  4756. // check default value
  4757. if (value === undefined) {
  4758. value = getPropDefaultValue(vm, prop, key);
  4759. // since the default value is a fresh copy,
  4760. // make sure to observe it.
  4761. var prevShouldObserve = shouldObserve;
  4762. toggleObserving(true);
  4763. observe(value);
  4764. toggleObserving(prevShouldObserve);
  4765. }
  4766. if (
  4767. true
  4768. ) {
  4769. assertProp(prop, key, value, vm, absent);
  4770. }
  4771. return value
  4772. }
  4773. /**
  4774. * Get the default value of a prop.
  4775. */
  4776. function getPropDefaultValue (vm, prop, key) {
  4777. // no default, return undefined
  4778. if (!hasOwn(prop, 'default')) {
  4779. return undefined
  4780. }
  4781. var def = prop.default;
  4782. // warn against non-factory defaults for Object & Array
  4783. if ( true && isObject(def)) {
  4784. warn(
  4785. 'Invalid default value for prop "' + key + '": ' +
  4786. 'Props with type Object/Array must use a factory function ' +
  4787. 'to return the default value.',
  4788. vm
  4789. );
  4790. }
  4791. // the raw prop value was also undefined from previous render,
  4792. // return previous default value to avoid unnecessary watcher trigger
  4793. if (vm && vm.$options.propsData &&
  4794. vm.$options.propsData[key] === undefined &&
  4795. vm._props[key] !== undefined
  4796. ) {
  4797. return vm._props[key]
  4798. }
  4799. // call factory function for non-Function types
  4800. // a value is Function if its prototype is function even across different execution context
  4801. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4802. ? def.call(vm)
  4803. : def
  4804. }
  4805. /**
  4806. * Assert whether a prop is valid.
  4807. */
  4808. function assertProp (
  4809. prop,
  4810. name,
  4811. value,
  4812. vm,
  4813. absent
  4814. ) {
  4815. if (prop.required && absent) {
  4816. warn(
  4817. 'Missing required prop: "' + name + '"',
  4818. vm
  4819. );
  4820. return
  4821. }
  4822. if (value == null && !prop.required) {
  4823. return
  4824. }
  4825. var type = prop.type;
  4826. var valid = !type || type === true;
  4827. var expectedTypes = [];
  4828. if (type) {
  4829. if (!Array.isArray(type)) {
  4830. type = [type];
  4831. }
  4832. for (var i = 0; i < type.length && !valid; i++) {
  4833. var assertedType = assertType(value, type[i]);
  4834. expectedTypes.push(assertedType.expectedType || '');
  4835. valid = assertedType.valid;
  4836. }
  4837. }
  4838. if (!valid) {
  4839. warn(
  4840. getInvalidTypeMessage(name, value, expectedTypes),
  4841. vm
  4842. );
  4843. return
  4844. }
  4845. var validator = prop.validator;
  4846. if (validator) {
  4847. if (!validator(value)) {
  4848. warn(
  4849. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4850. vm
  4851. );
  4852. }
  4853. }
  4854. }
  4855. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4856. function assertType (value, type) {
  4857. var valid;
  4858. var expectedType = getType(type);
  4859. if (simpleCheckRE.test(expectedType)) {
  4860. var t = typeof value;
  4861. valid = t === expectedType.toLowerCase();
  4862. // for primitive wrapper objects
  4863. if (!valid && t === 'object') {
  4864. valid = value instanceof type;
  4865. }
  4866. } else if (expectedType === 'Object') {
  4867. valid = isPlainObject(value);
  4868. } else if (expectedType === 'Array') {
  4869. valid = Array.isArray(value);
  4870. } else {
  4871. valid = value instanceof type;
  4872. }
  4873. return {
  4874. valid: valid,
  4875. expectedType: expectedType
  4876. }
  4877. }
  4878. /**
  4879. * Use function string name to check built-in types,
  4880. * because a simple equality check will fail when running
  4881. * across different vms / iframes.
  4882. */
  4883. function getType (fn) {
  4884. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4885. return match ? match[1] : ''
  4886. }
  4887. function isSameType (a, b) {
  4888. return getType(a) === getType(b)
  4889. }
  4890. function getTypeIndex (type, expectedTypes) {
  4891. if (!Array.isArray(expectedTypes)) {
  4892. return isSameType(expectedTypes, type) ? 0 : -1
  4893. }
  4894. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4895. if (isSameType(expectedTypes[i], type)) {
  4896. return i
  4897. }
  4898. }
  4899. return -1
  4900. }
  4901. function getInvalidTypeMessage (name, value, expectedTypes) {
  4902. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4903. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4904. var expectedType = expectedTypes[0];
  4905. var receivedType = toRawType(value);
  4906. var expectedValue = styleValue(value, expectedType);
  4907. var receivedValue = styleValue(value, receivedType);
  4908. // check if we need to specify expected value
  4909. if (expectedTypes.length === 1 &&
  4910. isExplicable(expectedType) &&
  4911. !isBoolean(expectedType, receivedType)) {
  4912. message += " with value " + expectedValue;
  4913. }
  4914. message += ", got " + receivedType + " ";
  4915. // check if we need to specify received value
  4916. if (isExplicable(receivedType)) {
  4917. message += "with value " + receivedValue + ".";
  4918. }
  4919. return message
  4920. }
  4921. function styleValue (value, type) {
  4922. if (type === 'String') {
  4923. return ("\"" + value + "\"")
  4924. } else if (type === 'Number') {
  4925. return ("" + (Number(value)))
  4926. } else {
  4927. return ("" + value)
  4928. }
  4929. }
  4930. function isExplicable (value) {
  4931. var explicitTypes = ['string', 'number', 'boolean'];
  4932. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4933. }
  4934. function isBoolean () {
  4935. var args = [], len = arguments.length;
  4936. while ( len-- ) args[ len ] = arguments[ len ];
  4937. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4938. }
  4939. /* */
  4940. function handleError (err, vm, info) {
  4941. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4942. // See: https://github.com/vuejs/vuex/issues/1505
  4943. pushTarget();
  4944. try {
  4945. if (vm) {
  4946. var cur = vm;
  4947. while ((cur = cur.$parent)) {
  4948. var hooks = cur.$options.errorCaptured;
  4949. if (hooks) {
  4950. for (var i = 0; i < hooks.length; i++) {
  4951. try {
  4952. var capture = hooks[i].call(cur, err, vm, info) === false;
  4953. if (capture) { return }
  4954. } catch (e) {
  4955. globalHandleError(e, cur, 'errorCaptured hook');
  4956. }
  4957. }
  4958. }
  4959. }
  4960. }
  4961. globalHandleError(err, vm, info);
  4962. } finally {
  4963. popTarget();
  4964. }
  4965. }
  4966. function invokeWithErrorHandling (
  4967. handler,
  4968. context,
  4969. args,
  4970. vm,
  4971. info
  4972. ) {
  4973. var res;
  4974. try {
  4975. res = args ? handler.apply(context, args) : handler.call(context);
  4976. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4977. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4978. // issue #9511
  4979. // avoid catch triggering multiple times when nested calls
  4980. res._handled = true;
  4981. }
  4982. } catch (e) {
  4983. handleError(e, vm, info);
  4984. }
  4985. return res
  4986. }
  4987. function globalHandleError (err, vm, info) {
  4988. if (config.errorHandler) {
  4989. try {
  4990. return config.errorHandler.call(null, err, vm, info)
  4991. } catch (e) {
  4992. // if the user intentionally throws the original error in the handler,
  4993. // do not log it twice
  4994. if (e !== err) {
  4995. logError(e, null, 'config.errorHandler');
  4996. }
  4997. }
  4998. }
  4999. logError(err, vm, info);
  5000. }
  5001. function logError (err, vm, info) {
  5002. if (true) {
  5003. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5004. }
  5005. /* istanbul ignore else */
  5006. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5007. console.error(err);
  5008. } else {
  5009. throw err
  5010. }
  5011. }
  5012. /* */
  5013. var callbacks = [];
  5014. var pending = false;
  5015. function flushCallbacks () {
  5016. pending = false;
  5017. var copies = callbacks.slice(0);
  5018. callbacks.length = 0;
  5019. for (var i = 0; i < copies.length; i++) {
  5020. copies[i]();
  5021. }
  5022. }
  5023. // Here we have async deferring wrappers using microtasks.
  5024. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5025. // However, it has subtle problems when state is changed right before repaint
  5026. // (e.g. #6813, out-in transitions).
  5027. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5028. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5029. // So we now use microtasks everywhere, again.
  5030. // A major drawback of this tradeoff is that there are some scenarios
  5031. // where microtasks have too high a priority and fire in between supposedly
  5032. // sequential events (e.g. #4521, #6690, which have workarounds)
  5033. // or even between bubbling of the same event (#6566).
  5034. var timerFunc;
  5035. // The nextTick behavior leverages the microtask queue, which can be accessed
  5036. // via either native Promise.then or MutationObserver.
  5037. // MutationObserver has wider support, however it is seriously bugged in
  5038. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5039. // completely stops working after triggering a few times... so, if native
  5040. // Promise is available, we will use it:
  5041. /* istanbul ignore next, $flow-disable-line */
  5042. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5043. var p = Promise.resolve();
  5044. timerFunc = function () {
  5045. p.then(flushCallbacks);
  5046. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5047. // it can get stuck in a weird state where callbacks are pushed into the
  5048. // microtask queue but the queue isn't being flushed, until the browser
  5049. // needs to do some other work, e.g. handle a timer. Therefore we can
  5050. // "force" the microtask queue to be flushed by adding an empty timer.
  5051. if (isIOS) { setTimeout(noop); }
  5052. };
  5053. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5054. isNative(MutationObserver) ||
  5055. // PhantomJS and iOS 7.x
  5056. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5057. )) {
  5058. // Use MutationObserver where native Promise is not available,
  5059. // e.g. PhantomJS, iOS7, Android 4.4
  5060. // (#6466 MutationObserver is unreliable in IE11)
  5061. var counter = 1;
  5062. var observer = new MutationObserver(flushCallbacks);
  5063. var textNode = document.createTextNode(String(counter));
  5064. observer.observe(textNode, {
  5065. characterData: true
  5066. });
  5067. timerFunc = function () {
  5068. counter = (counter + 1) % 2;
  5069. textNode.data = String(counter);
  5070. };
  5071. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5072. // Fallback to setImmediate.
  5073. // Technically it leverages the (macro) task queue,
  5074. // but it is still a better choice than setTimeout.
  5075. timerFunc = function () {
  5076. setImmediate(flushCallbacks);
  5077. };
  5078. } else {
  5079. // Fallback to setTimeout.
  5080. timerFunc = function () {
  5081. setTimeout(flushCallbacks, 0);
  5082. };
  5083. }
  5084. function nextTick (cb, ctx) {
  5085. var _resolve;
  5086. callbacks.push(function () {
  5087. if (cb) {
  5088. try {
  5089. cb.call(ctx);
  5090. } catch (e) {
  5091. handleError(e, ctx, 'nextTick');
  5092. }
  5093. } else if (_resolve) {
  5094. _resolve(ctx);
  5095. }
  5096. });
  5097. if (!pending) {
  5098. pending = true;
  5099. timerFunc();
  5100. }
  5101. // $flow-disable-line
  5102. if (!cb && typeof Promise !== 'undefined') {
  5103. return new Promise(function (resolve) {
  5104. _resolve = resolve;
  5105. })
  5106. }
  5107. }
  5108. /* */
  5109. /* not type checking this file because flow doesn't play well with Proxy */
  5110. var initProxy;
  5111. if (true) {
  5112. var allowedGlobals = makeMap(
  5113. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5114. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5115. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5116. 'require' // for Webpack/Browserify
  5117. );
  5118. var warnNonPresent = function (target, key) {
  5119. warn(
  5120. "Property or method \"" + key + "\" is not defined on the instance but " +
  5121. 'referenced during render. Make sure that this property is reactive, ' +
  5122. 'either in the data option, or for class-based components, by ' +
  5123. 'initializing the property. ' +
  5124. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5125. target
  5126. );
  5127. };
  5128. var warnReservedPrefix = function (target, key) {
  5129. warn(
  5130. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5131. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5132. 'prevent conflicts with Vue internals. ' +
  5133. 'See: https://vuejs.org/v2/api/#data',
  5134. target
  5135. );
  5136. };
  5137. var hasProxy =
  5138. typeof Proxy !== 'undefined' && isNative(Proxy);
  5139. if (hasProxy) {
  5140. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5141. config.keyCodes = new Proxy(config.keyCodes, {
  5142. set: function set (target, key, value) {
  5143. if (isBuiltInModifier(key)) {
  5144. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5145. return false
  5146. } else {
  5147. target[key] = value;
  5148. return true
  5149. }
  5150. }
  5151. });
  5152. }
  5153. var hasHandler = {
  5154. has: function has (target, key) {
  5155. var has = key in target;
  5156. var isAllowed = allowedGlobals(key) ||
  5157. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5158. if (!has && !isAllowed) {
  5159. if (key in target.$data) { warnReservedPrefix(target, key); }
  5160. else { warnNonPresent(target, key); }
  5161. }
  5162. return has || !isAllowed
  5163. }
  5164. };
  5165. var getHandler = {
  5166. get: function get (target, key) {
  5167. if (typeof key === 'string' && !(key in target)) {
  5168. if (key in target.$data) { warnReservedPrefix(target, key); }
  5169. else { warnNonPresent(target, key); }
  5170. }
  5171. return target[key]
  5172. }
  5173. };
  5174. initProxy = function initProxy (vm) {
  5175. if (hasProxy) {
  5176. // determine which proxy handler to use
  5177. var options = vm.$options;
  5178. var handlers = options.render && options.render._withStripped
  5179. ? getHandler
  5180. : hasHandler;
  5181. vm._renderProxy = new Proxy(vm, handlers);
  5182. } else {
  5183. vm._renderProxy = vm;
  5184. }
  5185. };
  5186. }
  5187. /* */
  5188. var seenObjects = new _Set();
  5189. /**
  5190. * Recursively traverse an object to evoke all converted
  5191. * getters, so that every nested property inside the object
  5192. * is collected as a "deep" dependency.
  5193. */
  5194. function traverse (val) {
  5195. _traverse(val, seenObjects);
  5196. seenObjects.clear();
  5197. }
  5198. function _traverse (val, seen) {
  5199. var i, keys;
  5200. var isA = Array.isArray(val);
  5201. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5202. return
  5203. }
  5204. if (val.__ob__) {
  5205. var depId = val.__ob__.dep.id;
  5206. if (seen.has(depId)) {
  5207. return
  5208. }
  5209. seen.add(depId);
  5210. }
  5211. if (isA) {
  5212. i = val.length;
  5213. while (i--) { _traverse(val[i], seen); }
  5214. } else {
  5215. keys = Object.keys(val);
  5216. i = keys.length;
  5217. while (i--) { _traverse(val[keys[i]], seen); }
  5218. }
  5219. }
  5220. var mark;
  5221. var measure;
  5222. if (true) {
  5223. var perf = inBrowser && window.performance;
  5224. /* istanbul ignore if */
  5225. if (
  5226. perf &&
  5227. perf.mark &&
  5228. perf.measure &&
  5229. perf.clearMarks &&
  5230. perf.clearMeasures
  5231. ) {
  5232. mark = function (tag) { return perf.mark(tag); };
  5233. measure = function (name, startTag, endTag) {
  5234. perf.measure(name, startTag, endTag);
  5235. perf.clearMarks(startTag);
  5236. perf.clearMarks(endTag);
  5237. // perf.clearMeasures(name)
  5238. };
  5239. }
  5240. }
  5241. /* */
  5242. var normalizeEvent = cached(function (name) {
  5243. var passive = name.charAt(0) === '&';
  5244. name = passive ? name.slice(1) : name;
  5245. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5246. name = once$$1 ? name.slice(1) : name;
  5247. var capture = name.charAt(0) === '!';
  5248. name = capture ? name.slice(1) : name;
  5249. return {
  5250. name: name,
  5251. once: once$$1,
  5252. capture: capture,
  5253. passive: passive
  5254. }
  5255. });
  5256. function createFnInvoker (fns, vm) {
  5257. function invoker () {
  5258. var arguments$1 = arguments;
  5259. var fns = invoker.fns;
  5260. if (Array.isArray(fns)) {
  5261. var cloned = fns.slice();
  5262. for (var i = 0; i < cloned.length; i++) {
  5263. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5264. }
  5265. } else {
  5266. // return handler return value for single handlers
  5267. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5268. }
  5269. }
  5270. invoker.fns = fns;
  5271. return invoker
  5272. }
  5273. function updateListeners (
  5274. on,
  5275. oldOn,
  5276. add,
  5277. remove$$1,
  5278. createOnceHandler,
  5279. vm
  5280. ) {
  5281. var name, def$$1, cur, old, event;
  5282. for (name in on) {
  5283. def$$1 = cur = on[name];
  5284. old = oldOn[name];
  5285. event = normalizeEvent(name);
  5286. if (isUndef(cur)) {
  5287. true && warn(
  5288. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5289. vm
  5290. );
  5291. } else if (isUndef(old)) {
  5292. if (isUndef(cur.fns)) {
  5293. cur = on[name] = createFnInvoker(cur, vm);
  5294. }
  5295. if (isTrue(event.once)) {
  5296. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5297. }
  5298. add(event.name, cur, event.capture, event.passive, event.params);
  5299. } else if (cur !== old) {
  5300. old.fns = cur;
  5301. on[name] = old;
  5302. }
  5303. }
  5304. for (name in oldOn) {
  5305. if (isUndef(on[name])) {
  5306. event = normalizeEvent(name);
  5307. remove$$1(event.name, oldOn[name], event.capture);
  5308. }
  5309. }
  5310. }
  5311. /* */
  5312. /* */
  5313. // fixed by xxxxxx (mp properties)
  5314. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5315. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5316. if (isUndef(propOptions)) {
  5317. return res
  5318. }
  5319. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5320. var attrs = data.attrs;
  5321. var props = data.props;
  5322. if (isDef(attrs) || isDef(props)) {
  5323. for (var key in propOptions) {
  5324. var altKey = hyphenate(key);
  5325. var result = checkProp(res, props, key, altKey, true) ||
  5326. checkProp(res, attrs, key, altKey, false);
  5327. // externalClass
  5328. if (
  5329. result &&
  5330. res[key] &&
  5331. externalClasses.indexOf(altKey) !== -1 &&
  5332. context[camelize(res[key])]
  5333. ) {
  5334. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5335. res[key] = context[camelize(res[key])];
  5336. }
  5337. }
  5338. }
  5339. return res
  5340. }
  5341. function extractPropsFromVNodeData (
  5342. data,
  5343. Ctor,
  5344. tag,
  5345. context// fixed by xxxxxx
  5346. ) {
  5347. // we are only extracting raw values here.
  5348. // validation and default values are handled in the child
  5349. // component itself.
  5350. var propOptions = Ctor.options.props;
  5351. if (isUndef(propOptions)) {
  5352. // fixed by xxxxxx
  5353. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5354. }
  5355. var res = {};
  5356. var attrs = data.attrs;
  5357. var props = data.props;
  5358. if (isDef(attrs) || isDef(props)) {
  5359. for (var key in propOptions) {
  5360. var altKey = hyphenate(key);
  5361. if (true) {
  5362. var keyInLowerCase = key.toLowerCase();
  5363. if (
  5364. key !== keyInLowerCase &&
  5365. attrs && hasOwn(attrs, keyInLowerCase)
  5366. ) {
  5367. tip(
  5368. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5369. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5370. " \"" + key + "\". " +
  5371. "Note that HTML attributes are case-insensitive and camelCased " +
  5372. "props need to use their kebab-case equivalents when using in-DOM " +
  5373. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5374. );
  5375. }
  5376. }
  5377. checkProp(res, props, key, altKey, true) ||
  5378. checkProp(res, attrs, key, altKey, false);
  5379. }
  5380. }
  5381. // fixed by xxxxxx
  5382. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5383. }
  5384. function checkProp (
  5385. res,
  5386. hash,
  5387. key,
  5388. altKey,
  5389. preserve
  5390. ) {
  5391. if (isDef(hash)) {
  5392. if (hasOwn(hash, key)) {
  5393. res[key] = hash[key];
  5394. if (!preserve) {
  5395. delete hash[key];
  5396. }
  5397. return true
  5398. } else if (hasOwn(hash, altKey)) {
  5399. res[key] = hash[altKey];
  5400. if (!preserve) {
  5401. delete hash[altKey];
  5402. }
  5403. return true
  5404. }
  5405. }
  5406. return false
  5407. }
  5408. /* */
  5409. // The template compiler attempts to minimize the need for normalization by
  5410. // statically analyzing the template at compile time.
  5411. //
  5412. // For plain HTML markup, normalization can be completely skipped because the
  5413. // generated render function is guaranteed to return Array<VNode>. There are
  5414. // two cases where extra normalization is needed:
  5415. // 1. When the children contains components - because a functional component
  5416. // may return an Array instead of a single root. In this case, just a simple
  5417. // normalization is needed - if any child is an Array, we flatten the whole
  5418. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5419. // because functional components already normalize their own children.
  5420. function simpleNormalizeChildren (children) {
  5421. for (var i = 0; i < children.length; i++) {
  5422. if (Array.isArray(children[i])) {
  5423. return Array.prototype.concat.apply([], children)
  5424. }
  5425. }
  5426. return children
  5427. }
  5428. // 2. When the children contains constructs that always generated nested Arrays,
  5429. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5430. // with hand-written render functions / JSX. In such cases a full normalization
  5431. // is needed to cater to all possible types of children values.
  5432. function normalizeChildren (children) {
  5433. return isPrimitive(children)
  5434. ? [createTextVNode(children)]
  5435. : Array.isArray(children)
  5436. ? normalizeArrayChildren(children)
  5437. : undefined
  5438. }
  5439. function isTextNode (node) {
  5440. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5441. }
  5442. function normalizeArrayChildren (children, nestedIndex) {
  5443. var res = [];
  5444. var i, c, lastIndex, last;
  5445. for (i = 0; i < children.length; i++) {
  5446. c = children[i];
  5447. if (isUndef(c) || typeof c === 'boolean') { continue }
  5448. lastIndex = res.length - 1;
  5449. last = res[lastIndex];
  5450. // nested
  5451. if (Array.isArray(c)) {
  5452. if (c.length > 0) {
  5453. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5454. // merge adjacent text nodes
  5455. if (isTextNode(c[0]) && isTextNode(last)) {
  5456. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5457. c.shift();
  5458. }
  5459. res.push.apply(res, c);
  5460. }
  5461. } else if (isPrimitive(c)) {
  5462. if (isTextNode(last)) {
  5463. // merge adjacent text nodes
  5464. // this is necessary for SSR hydration because text nodes are
  5465. // essentially merged when rendered to HTML strings
  5466. res[lastIndex] = createTextVNode(last.text + c);
  5467. } else if (c !== '') {
  5468. // convert primitive to vnode
  5469. res.push(createTextVNode(c));
  5470. }
  5471. } else {
  5472. if (isTextNode(c) && isTextNode(last)) {
  5473. // merge adjacent text nodes
  5474. res[lastIndex] = createTextVNode(last.text + c.text);
  5475. } else {
  5476. // default key for nested array children (likely generated by v-for)
  5477. if (isTrue(children._isVList) &&
  5478. isDef(c.tag) &&
  5479. isUndef(c.key) &&
  5480. isDef(nestedIndex)) {
  5481. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5482. }
  5483. res.push(c);
  5484. }
  5485. }
  5486. }
  5487. return res
  5488. }
  5489. /* */
  5490. function initProvide (vm) {
  5491. var provide = vm.$options.provide;
  5492. if (provide) {
  5493. vm._provided = typeof provide === 'function'
  5494. ? provide.call(vm)
  5495. : provide;
  5496. }
  5497. }
  5498. function initInjections (vm) {
  5499. var result = resolveInject(vm.$options.inject, vm);
  5500. if (result) {
  5501. toggleObserving(false);
  5502. Object.keys(result).forEach(function (key) {
  5503. /* istanbul ignore else */
  5504. if (true) {
  5505. defineReactive$$1(vm, key, result[key], function () {
  5506. warn(
  5507. "Avoid mutating an injected value directly since the changes will be " +
  5508. "overwritten whenever the provided component re-renders. " +
  5509. "injection being mutated: \"" + key + "\"",
  5510. vm
  5511. );
  5512. });
  5513. } else {}
  5514. });
  5515. toggleObserving(true);
  5516. }
  5517. }
  5518. function resolveInject (inject, vm) {
  5519. if (inject) {
  5520. // inject is :any because flow is not smart enough to figure out cached
  5521. var result = Object.create(null);
  5522. var keys = hasSymbol
  5523. ? Reflect.ownKeys(inject)
  5524. : Object.keys(inject);
  5525. for (var i = 0; i < keys.length; i++) {
  5526. var key = keys[i];
  5527. // #6574 in case the inject object is observed...
  5528. if (key === '__ob__') { continue }
  5529. var provideKey = inject[key].from;
  5530. var source = vm;
  5531. while (source) {
  5532. if (source._provided && hasOwn(source._provided, provideKey)) {
  5533. result[key] = source._provided[provideKey];
  5534. break
  5535. }
  5536. source = source.$parent;
  5537. }
  5538. if (!source) {
  5539. if ('default' in inject[key]) {
  5540. var provideDefault = inject[key].default;
  5541. result[key] = typeof provideDefault === 'function'
  5542. ? provideDefault.call(vm)
  5543. : provideDefault;
  5544. } else if (true) {
  5545. warn(("Injection \"" + key + "\" not found"), vm);
  5546. }
  5547. }
  5548. }
  5549. return result
  5550. }
  5551. }
  5552. /* */
  5553. /**
  5554. * Runtime helper for resolving raw children VNodes into a slot object.
  5555. */
  5556. function resolveSlots (
  5557. children,
  5558. context
  5559. ) {
  5560. if (!children || !children.length) {
  5561. return {}
  5562. }
  5563. var slots = {};
  5564. for (var i = 0, l = children.length; i < l; i++) {
  5565. var child = children[i];
  5566. var data = child.data;
  5567. // remove slot attribute if the node is resolved as a Vue slot node
  5568. if (data && data.attrs && data.attrs.slot) {
  5569. delete data.attrs.slot;
  5570. }
  5571. // named slots should only be respected if the vnode was rendered in the
  5572. // same context.
  5573. if ((child.context === context || child.fnContext === context) &&
  5574. data && data.slot != null
  5575. ) {
  5576. var name = data.slot;
  5577. var slot = (slots[name] || (slots[name] = []));
  5578. if (child.tag === 'template') {
  5579. slot.push.apply(slot, child.children || []);
  5580. } else {
  5581. slot.push(child);
  5582. }
  5583. } else {
  5584. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5585. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5586. (slots['page'] || (slots['page'] = [])).push(child);
  5587. }else{
  5588. (slots.default || (slots.default = [])).push(child);
  5589. }
  5590. }
  5591. }
  5592. // ignore slots that contains only whitespace
  5593. for (var name$1 in slots) {
  5594. if (slots[name$1].every(isWhitespace)) {
  5595. delete slots[name$1];
  5596. }
  5597. }
  5598. return slots
  5599. }
  5600. function isWhitespace (node) {
  5601. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5602. }
  5603. /* */
  5604. function normalizeScopedSlots (
  5605. slots,
  5606. normalSlots,
  5607. prevSlots
  5608. ) {
  5609. var res;
  5610. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5611. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5612. var key = slots && slots.$key;
  5613. if (!slots) {
  5614. res = {};
  5615. } else if (slots._normalized) {
  5616. // fast path 1: child component re-render only, parent did not change
  5617. return slots._normalized
  5618. } else if (
  5619. isStable &&
  5620. prevSlots &&
  5621. prevSlots !== emptyObject &&
  5622. key === prevSlots.$key &&
  5623. !hasNormalSlots &&
  5624. !prevSlots.$hasNormal
  5625. ) {
  5626. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5627. // only need to normalize once
  5628. return prevSlots
  5629. } else {
  5630. res = {};
  5631. for (var key$1 in slots) {
  5632. if (slots[key$1] && key$1[0] !== '$') {
  5633. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5634. }
  5635. }
  5636. }
  5637. // expose normal slots on scopedSlots
  5638. for (var key$2 in normalSlots) {
  5639. if (!(key$2 in res)) {
  5640. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5641. }
  5642. }
  5643. // avoriaz seems to mock a non-extensible $scopedSlots object
  5644. // and when that is passed down this would cause an error
  5645. if (slots && Object.isExtensible(slots)) {
  5646. (slots)._normalized = res;
  5647. }
  5648. def(res, '$stable', isStable);
  5649. def(res, '$key', key);
  5650. def(res, '$hasNormal', hasNormalSlots);
  5651. return res
  5652. }
  5653. function normalizeScopedSlot(normalSlots, key, fn) {
  5654. var normalized = function () {
  5655. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5656. res = res && typeof res === 'object' && !Array.isArray(res)
  5657. ? [res] // single vnode
  5658. : normalizeChildren(res);
  5659. return res && (
  5660. res.length === 0 ||
  5661. (res.length === 1 && res[0].isComment) // #9658
  5662. ) ? undefined
  5663. : res
  5664. };
  5665. // this is a slot using the new v-slot syntax without scope. although it is
  5666. // compiled as a scoped slot, render fn users would expect it to be present
  5667. // on this.$slots because the usage is semantically a normal slot.
  5668. if (fn.proxy) {
  5669. Object.defineProperty(normalSlots, key, {
  5670. get: normalized,
  5671. enumerable: true,
  5672. configurable: true
  5673. });
  5674. }
  5675. return normalized
  5676. }
  5677. function proxyNormalSlot(slots, key) {
  5678. return function () { return slots[key]; }
  5679. }
  5680. /* */
  5681. /**
  5682. * Runtime helper for rendering v-for lists.
  5683. */
  5684. function renderList (
  5685. val,
  5686. render
  5687. ) {
  5688. var ret, i, l, keys, key;
  5689. if (Array.isArray(val) || typeof val === 'string') {
  5690. ret = new Array(val.length);
  5691. for (i = 0, l = val.length; i < l; i++) {
  5692. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5693. }
  5694. } else if (typeof val === 'number') {
  5695. ret = new Array(val);
  5696. for (i = 0; i < val; i++) {
  5697. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5698. }
  5699. } else if (isObject(val)) {
  5700. if (hasSymbol && val[Symbol.iterator]) {
  5701. ret = [];
  5702. var iterator = val[Symbol.iterator]();
  5703. var result = iterator.next();
  5704. while (!result.done) {
  5705. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5706. result = iterator.next();
  5707. }
  5708. } else {
  5709. keys = Object.keys(val);
  5710. ret = new Array(keys.length);
  5711. for (i = 0, l = keys.length; i < l; i++) {
  5712. key = keys[i];
  5713. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5714. }
  5715. }
  5716. }
  5717. if (!isDef(ret)) {
  5718. ret = [];
  5719. }
  5720. (ret)._isVList = true;
  5721. return ret
  5722. }
  5723. /* */
  5724. /**
  5725. * Runtime helper for rendering <slot>
  5726. */
  5727. function renderSlot (
  5728. name,
  5729. fallback,
  5730. props,
  5731. bindObject
  5732. ) {
  5733. var scopedSlotFn = this.$scopedSlots[name];
  5734. var nodes;
  5735. if (scopedSlotFn) { // scoped slot
  5736. props = props || {};
  5737. if (bindObject) {
  5738. if ( true && !isObject(bindObject)) {
  5739. warn(
  5740. 'slot v-bind without argument expects an Object',
  5741. this
  5742. );
  5743. }
  5744. props = extend(extend({}, bindObject), props);
  5745. }
  5746. // fixed by xxxxxx app-plus scopedSlot
  5747. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5748. } else {
  5749. nodes = this.$slots[name] || fallback;
  5750. }
  5751. var target = props && props.slot;
  5752. if (target) {
  5753. return this.$createElement('template', { slot: target }, nodes)
  5754. } else {
  5755. return nodes
  5756. }
  5757. }
  5758. /* */
  5759. /**
  5760. * Runtime helper for resolving filters
  5761. */
  5762. function resolveFilter (id) {
  5763. return resolveAsset(this.$options, 'filters', id, true) || identity
  5764. }
  5765. /* */
  5766. function isKeyNotMatch (expect, actual) {
  5767. if (Array.isArray(expect)) {
  5768. return expect.indexOf(actual) === -1
  5769. } else {
  5770. return expect !== actual
  5771. }
  5772. }
  5773. /**
  5774. * Runtime helper for checking keyCodes from config.
  5775. * exposed as Vue.prototype._k
  5776. * passing in eventKeyName as last argument separately for backwards compat
  5777. */
  5778. function checkKeyCodes (
  5779. eventKeyCode,
  5780. key,
  5781. builtInKeyCode,
  5782. eventKeyName,
  5783. builtInKeyName
  5784. ) {
  5785. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5786. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5787. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5788. } else if (mappedKeyCode) {
  5789. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5790. } else if (eventKeyName) {
  5791. return hyphenate(eventKeyName) !== key
  5792. }
  5793. }
  5794. /* */
  5795. /**
  5796. * Runtime helper for merging v-bind="object" into a VNode's data.
  5797. */
  5798. function bindObjectProps (
  5799. data,
  5800. tag,
  5801. value,
  5802. asProp,
  5803. isSync
  5804. ) {
  5805. if (value) {
  5806. if (!isObject(value)) {
  5807. true && warn(
  5808. 'v-bind without argument expects an Object or Array value',
  5809. this
  5810. );
  5811. } else {
  5812. if (Array.isArray(value)) {
  5813. value = toObject(value);
  5814. }
  5815. var hash;
  5816. var loop = function ( key ) {
  5817. if (
  5818. key === 'class' ||
  5819. key === 'style' ||
  5820. isReservedAttribute(key)
  5821. ) {
  5822. hash = data;
  5823. } else {
  5824. var type = data.attrs && data.attrs.type;
  5825. hash = asProp || config.mustUseProp(tag, type, key)
  5826. ? data.domProps || (data.domProps = {})
  5827. : data.attrs || (data.attrs = {});
  5828. }
  5829. var camelizedKey = camelize(key);
  5830. var hyphenatedKey = hyphenate(key);
  5831. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5832. hash[key] = value[key];
  5833. if (isSync) {
  5834. var on = data.on || (data.on = {});
  5835. on[("update:" + key)] = function ($event) {
  5836. value[key] = $event;
  5837. };
  5838. }
  5839. }
  5840. };
  5841. for (var key in value) loop( key );
  5842. }
  5843. }
  5844. return data
  5845. }
  5846. /* */
  5847. /**
  5848. * Runtime helper for rendering static trees.
  5849. */
  5850. function renderStatic (
  5851. index,
  5852. isInFor
  5853. ) {
  5854. var cached = this._staticTrees || (this._staticTrees = []);
  5855. var tree = cached[index];
  5856. // if has already-rendered static tree and not inside v-for,
  5857. // we can reuse the same tree.
  5858. if (tree && !isInFor) {
  5859. return tree
  5860. }
  5861. // otherwise, render a fresh tree.
  5862. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5863. this._renderProxy,
  5864. null,
  5865. this // for render fns generated for functional component templates
  5866. );
  5867. markStatic(tree, ("__static__" + index), false);
  5868. return tree
  5869. }
  5870. /**
  5871. * Runtime helper for v-once.
  5872. * Effectively it means marking the node as static with a unique key.
  5873. */
  5874. function markOnce (
  5875. tree,
  5876. index,
  5877. key
  5878. ) {
  5879. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5880. return tree
  5881. }
  5882. function markStatic (
  5883. tree,
  5884. key,
  5885. isOnce
  5886. ) {
  5887. if (Array.isArray(tree)) {
  5888. for (var i = 0; i < tree.length; i++) {
  5889. if (tree[i] && typeof tree[i] !== 'string') {
  5890. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5891. }
  5892. }
  5893. } else {
  5894. markStaticNode(tree, key, isOnce);
  5895. }
  5896. }
  5897. function markStaticNode (node, key, isOnce) {
  5898. node.isStatic = true;
  5899. node.key = key;
  5900. node.isOnce = isOnce;
  5901. }
  5902. /* */
  5903. function bindObjectListeners (data, value) {
  5904. if (value) {
  5905. if (!isPlainObject(value)) {
  5906. true && warn(
  5907. 'v-on without argument expects an Object value',
  5908. this
  5909. );
  5910. } else {
  5911. var on = data.on = data.on ? extend({}, data.on) : {};
  5912. for (var key in value) {
  5913. var existing = on[key];
  5914. var ours = value[key];
  5915. on[key] = existing ? [].concat(existing, ours) : ours;
  5916. }
  5917. }
  5918. }
  5919. return data
  5920. }
  5921. /* */
  5922. function resolveScopedSlots (
  5923. fns, // see flow/vnode
  5924. res,
  5925. // the following are added in 2.6
  5926. hasDynamicKeys,
  5927. contentHashKey
  5928. ) {
  5929. res = res || { $stable: !hasDynamicKeys };
  5930. for (var i = 0; i < fns.length; i++) {
  5931. var slot = fns[i];
  5932. if (Array.isArray(slot)) {
  5933. resolveScopedSlots(slot, res, hasDynamicKeys);
  5934. } else if (slot) {
  5935. // marker for reverse proxying v-slot without scope on this.$slots
  5936. if (slot.proxy) {
  5937. slot.fn.proxy = true;
  5938. }
  5939. res[slot.key] = slot.fn;
  5940. }
  5941. }
  5942. if (contentHashKey) {
  5943. (res).$key = contentHashKey;
  5944. }
  5945. return res
  5946. }
  5947. /* */
  5948. function bindDynamicKeys (baseObj, values) {
  5949. for (var i = 0; i < values.length; i += 2) {
  5950. var key = values[i];
  5951. if (typeof key === 'string' && key) {
  5952. baseObj[values[i]] = values[i + 1];
  5953. } else if ( true && key !== '' && key !== null) {
  5954. // null is a special value for explicitly removing a binding
  5955. warn(
  5956. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5957. this
  5958. );
  5959. }
  5960. }
  5961. return baseObj
  5962. }
  5963. // helper to dynamically append modifier runtime markers to event names.
  5964. // ensure only append when value is already string, otherwise it will be cast
  5965. // to string and cause the type check to miss.
  5966. function prependModifier (value, symbol) {
  5967. return typeof value === 'string' ? symbol + value : value
  5968. }
  5969. /* */
  5970. function installRenderHelpers (target) {
  5971. target._o = markOnce;
  5972. target._n = toNumber;
  5973. target._s = toString;
  5974. target._l = renderList;
  5975. target._t = renderSlot;
  5976. target._q = looseEqual;
  5977. target._i = looseIndexOf;
  5978. target._m = renderStatic;
  5979. target._f = resolveFilter;
  5980. target._k = checkKeyCodes;
  5981. target._b = bindObjectProps;
  5982. target._v = createTextVNode;
  5983. target._e = createEmptyVNode;
  5984. target._u = resolveScopedSlots;
  5985. target._g = bindObjectListeners;
  5986. target._d = bindDynamicKeys;
  5987. target._p = prependModifier;
  5988. }
  5989. /* */
  5990. function FunctionalRenderContext (
  5991. data,
  5992. props,
  5993. children,
  5994. parent,
  5995. Ctor
  5996. ) {
  5997. var this$1 = this;
  5998. var options = Ctor.options;
  5999. // ensure the createElement function in functional components
  6000. // gets a unique context - this is necessary for correct named slot check
  6001. var contextVm;
  6002. if (hasOwn(parent, '_uid')) {
  6003. contextVm = Object.create(parent);
  6004. // $flow-disable-line
  6005. contextVm._original = parent;
  6006. } else {
  6007. // the context vm passed in is a functional context as well.
  6008. // in this case we want to make sure we are able to get a hold to the
  6009. // real context instance.
  6010. contextVm = parent;
  6011. // $flow-disable-line
  6012. parent = parent._original;
  6013. }
  6014. var isCompiled = isTrue(options._compiled);
  6015. var needNormalization = !isCompiled;
  6016. this.data = data;
  6017. this.props = props;
  6018. this.children = children;
  6019. this.parent = parent;
  6020. this.listeners = data.on || emptyObject;
  6021. this.injections = resolveInject(options.inject, parent);
  6022. this.slots = function () {
  6023. if (!this$1.$slots) {
  6024. normalizeScopedSlots(
  6025. data.scopedSlots,
  6026. this$1.$slots = resolveSlots(children, parent)
  6027. );
  6028. }
  6029. return this$1.$slots
  6030. };
  6031. Object.defineProperty(this, 'scopedSlots', ({
  6032. enumerable: true,
  6033. get: function get () {
  6034. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6035. }
  6036. }));
  6037. // support for compiled functional template
  6038. if (isCompiled) {
  6039. // exposing $options for renderStatic()
  6040. this.$options = options;
  6041. // pre-resolve slots for renderSlot()
  6042. this.$slots = this.slots();
  6043. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6044. }
  6045. if (options._scopeId) {
  6046. this._c = function (a, b, c, d) {
  6047. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6048. if (vnode && !Array.isArray(vnode)) {
  6049. vnode.fnScopeId = options._scopeId;
  6050. vnode.fnContext = parent;
  6051. }
  6052. return vnode
  6053. };
  6054. } else {
  6055. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6056. }
  6057. }
  6058. installRenderHelpers(FunctionalRenderContext.prototype);
  6059. function createFunctionalComponent (
  6060. Ctor,
  6061. propsData,
  6062. data,
  6063. contextVm,
  6064. children
  6065. ) {
  6066. var options = Ctor.options;
  6067. var props = {};
  6068. var propOptions = options.props;
  6069. if (isDef(propOptions)) {
  6070. for (var key in propOptions) {
  6071. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6072. }
  6073. } else {
  6074. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6075. if (isDef(data.props)) { mergeProps(props, data.props); }
  6076. }
  6077. var renderContext = new FunctionalRenderContext(
  6078. data,
  6079. props,
  6080. children,
  6081. contextVm,
  6082. Ctor
  6083. );
  6084. var vnode = options.render.call(null, renderContext._c, renderContext);
  6085. if (vnode instanceof VNode) {
  6086. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6087. } else if (Array.isArray(vnode)) {
  6088. var vnodes = normalizeChildren(vnode) || [];
  6089. var res = new Array(vnodes.length);
  6090. for (var i = 0; i < vnodes.length; i++) {
  6091. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6092. }
  6093. return res
  6094. }
  6095. }
  6096. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6097. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6098. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6099. // that should not be matched to match.
  6100. var clone = cloneVNode(vnode);
  6101. clone.fnContext = contextVm;
  6102. clone.fnOptions = options;
  6103. if (true) {
  6104. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6105. }
  6106. if (data.slot) {
  6107. (clone.data || (clone.data = {})).slot = data.slot;
  6108. }
  6109. return clone
  6110. }
  6111. function mergeProps (to, from) {
  6112. for (var key in from) {
  6113. to[camelize(key)] = from[key];
  6114. }
  6115. }
  6116. /* */
  6117. /* */
  6118. /* */
  6119. /* */
  6120. // inline hooks to be invoked on component VNodes during patch
  6121. var componentVNodeHooks = {
  6122. init: function init (vnode, hydrating) {
  6123. if (
  6124. vnode.componentInstance &&
  6125. !vnode.componentInstance._isDestroyed &&
  6126. vnode.data.keepAlive
  6127. ) {
  6128. // kept-alive components, treat as a patch
  6129. var mountedNode = vnode; // work around flow
  6130. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6131. } else {
  6132. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6133. vnode,
  6134. activeInstance
  6135. );
  6136. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6137. }
  6138. },
  6139. prepatch: function prepatch (oldVnode, vnode) {
  6140. var options = vnode.componentOptions;
  6141. var child = vnode.componentInstance = oldVnode.componentInstance;
  6142. updateChildComponent(
  6143. child,
  6144. options.propsData, // updated props
  6145. options.listeners, // updated listeners
  6146. vnode, // new parent vnode
  6147. options.children // new children
  6148. );
  6149. },
  6150. insert: function insert (vnode) {
  6151. var context = vnode.context;
  6152. var componentInstance = vnode.componentInstance;
  6153. if (!componentInstance._isMounted) {
  6154. callHook(componentInstance, 'onServiceCreated');
  6155. callHook(componentInstance, 'onServiceAttached');
  6156. componentInstance._isMounted = true;
  6157. callHook(componentInstance, 'mounted');
  6158. }
  6159. if (vnode.data.keepAlive) {
  6160. if (context._isMounted) {
  6161. // vue-router#1212
  6162. // During updates, a kept-alive component's child components may
  6163. // change, so directly walking the tree here may call activated hooks
  6164. // on incorrect children. Instead we push them into a queue which will
  6165. // be processed after the whole patch process ended.
  6166. queueActivatedComponent(componentInstance);
  6167. } else {
  6168. activateChildComponent(componentInstance, true /* direct */);
  6169. }
  6170. }
  6171. },
  6172. destroy: function destroy (vnode) {
  6173. var componentInstance = vnode.componentInstance;
  6174. if (!componentInstance._isDestroyed) {
  6175. if (!vnode.data.keepAlive) {
  6176. componentInstance.$destroy();
  6177. } else {
  6178. deactivateChildComponent(componentInstance, true /* direct */);
  6179. }
  6180. }
  6181. }
  6182. };
  6183. var hooksToMerge = Object.keys(componentVNodeHooks);
  6184. function createComponent (
  6185. Ctor,
  6186. data,
  6187. context,
  6188. children,
  6189. tag
  6190. ) {
  6191. if (isUndef(Ctor)) {
  6192. return
  6193. }
  6194. var baseCtor = context.$options._base;
  6195. // plain options object: turn it into a constructor
  6196. if (isObject(Ctor)) {
  6197. Ctor = baseCtor.extend(Ctor);
  6198. }
  6199. // if at this stage it's not a constructor or an async component factory,
  6200. // reject.
  6201. if (typeof Ctor !== 'function') {
  6202. if (true) {
  6203. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6204. }
  6205. return
  6206. }
  6207. // async component
  6208. var asyncFactory;
  6209. if (isUndef(Ctor.cid)) {
  6210. asyncFactory = Ctor;
  6211. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6212. if (Ctor === undefined) {
  6213. // return a placeholder node for async component, which is rendered
  6214. // as a comment node but preserves all the raw information for the node.
  6215. // the information will be used for async server-rendering and hydration.
  6216. return createAsyncPlaceholder(
  6217. asyncFactory,
  6218. data,
  6219. context,
  6220. children,
  6221. tag
  6222. )
  6223. }
  6224. }
  6225. data = data || {};
  6226. // resolve constructor options in case global mixins are applied after
  6227. // component constructor creation
  6228. resolveConstructorOptions(Ctor);
  6229. // transform component v-model data into props & events
  6230. if (isDef(data.model)) {
  6231. transformModel(Ctor.options, data);
  6232. }
  6233. // extract props
  6234. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6235. // functional component
  6236. if (isTrue(Ctor.options.functional)) {
  6237. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6238. }
  6239. // extract listeners, since these needs to be treated as
  6240. // child component listeners instead of DOM listeners
  6241. var listeners = data.on;
  6242. // replace with listeners with .native modifier
  6243. // so it gets processed during parent component patch.
  6244. data.on = data.nativeOn;
  6245. if (isTrue(Ctor.options.abstract)) {
  6246. // abstract components do not keep anything
  6247. // other than props & listeners & slot
  6248. // work around flow
  6249. var slot = data.slot;
  6250. data = {};
  6251. if (slot) {
  6252. data.slot = slot;
  6253. }
  6254. }
  6255. // install component management hooks onto the placeholder node
  6256. installComponentHooks(data);
  6257. // return a placeholder vnode
  6258. var name = Ctor.options.name || tag;
  6259. var vnode = new VNode(
  6260. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6261. data, undefined, undefined, undefined, context,
  6262. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6263. asyncFactory
  6264. );
  6265. return vnode
  6266. }
  6267. function createComponentInstanceForVnode (
  6268. vnode, // we know it's MountedComponentVNode but flow doesn't
  6269. parent // activeInstance in lifecycle state
  6270. ) {
  6271. var options = {
  6272. _isComponent: true,
  6273. _parentVnode: vnode,
  6274. parent: parent
  6275. };
  6276. // check inline-template render functions
  6277. var inlineTemplate = vnode.data.inlineTemplate;
  6278. if (isDef(inlineTemplate)) {
  6279. options.render = inlineTemplate.render;
  6280. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6281. }
  6282. return new vnode.componentOptions.Ctor(options)
  6283. }
  6284. function installComponentHooks (data) {
  6285. var hooks = data.hook || (data.hook = {});
  6286. for (var i = 0; i < hooksToMerge.length; i++) {
  6287. var key = hooksToMerge[i];
  6288. var existing = hooks[key];
  6289. var toMerge = componentVNodeHooks[key];
  6290. if (existing !== toMerge && !(existing && existing._merged)) {
  6291. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6292. }
  6293. }
  6294. }
  6295. function mergeHook$1 (f1, f2) {
  6296. var merged = function (a, b) {
  6297. // flow complains about extra args which is why we use any
  6298. f1(a, b);
  6299. f2(a, b);
  6300. };
  6301. merged._merged = true;
  6302. return merged
  6303. }
  6304. // transform component v-model info (value and callback) into
  6305. // prop and event handler respectively.
  6306. function transformModel (options, data) {
  6307. var prop = (options.model && options.model.prop) || 'value';
  6308. var event = (options.model && options.model.event) || 'input'
  6309. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6310. var on = data.on || (data.on = {});
  6311. var existing = on[event];
  6312. var callback = data.model.callback;
  6313. if (isDef(existing)) {
  6314. if (
  6315. Array.isArray(existing)
  6316. ? existing.indexOf(callback) === -1
  6317. : existing !== callback
  6318. ) {
  6319. on[event] = [callback].concat(existing);
  6320. }
  6321. } else {
  6322. on[event] = callback;
  6323. }
  6324. }
  6325. /* */
  6326. var SIMPLE_NORMALIZE = 1;
  6327. var ALWAYS_NORMALIZE = 2;
  6328. // wrapper function for providing a more flexible interface
  6329. // without getting yelled at by flow
  6330. function createElement (
  6331. context,
  6332. tag,
  6333. data,
  6334. children,
  6335. normalizationType,
  6336. alwaysNormalize
  6337. ) {
  6338. if (Array.isArray(data) || isPrimitive(data)) {
  6339. normalizationType = children;
  6340. children = data;
  6341. data = undefined;
  6342. }
  6343. if (isTrue(alwaysNormalize)) {
  6344. normalizationType = ALWAYS_NORMALIZE;
  6345. }
  6346. return _createElement(context, tag, data, children, normalizationType)
  6347. }
  6348. function _createElement (
  6349. context,
  6350. tag,
  6351. data,
  6352. children,
  6353. normalizationType
  6354. ) {
  6355. if (isDef(data) && isDef((data).__ob__)) {
  6356. true && warn(
  6357. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6358. 'Always create fresh vnode data objects in each render!',
  6359. context
  6360. );
  6361. return createEmptyVNode()
  6362. }
  6363. // object syntax in v-bind
  6364. if (isDef(data) && isDef(data.is)) {
  6365. tag = data.is;
  6366. }
  6367. if (!tag) {
  6368. // in case of component :is set to falsy value
  6369. return createEmptyVNode()
  6370. }
  6371. // warn against non-primitive key
  6372. if ( true &&
  6373. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6374. ) {
  6375. {
  6376. warn(
  6377. 'Avoid using non-primitive value as key, ' +
  6378. 'use string/number value instead.',
  6379. context
  6380. );
  6381. }
  6382. }
  6383. // support single function children as default scoped slot
  6384. if (Array.isArray(children) &&
  6385. typeof children[0] === 'function'
  6386. ) {
  6387. data = data || {};
  6388. data.scopedSlots = { default: children[0] };
  6389. children.length = 0;
  6390. }
  6391. if (normalizationType === ALWAYS_NORMALIZE) {
  6392. children = normalizeChildren(children);
  6393. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6394. children = simpleNormalizeChildren(children);
  6395. }
  6396. var vnode, ns;
  6397. if (typeof tag === 'string') {
  6398. var Ctor;
  6399. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6400. if (config.isReservedTag(tag)) {
  6401. // platform built-in elements
  6402. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6403. warn(
  6404. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6405. context
  6406. );
  6407. }
  6408. vnode = new VNode(
  6409. config.parsePlatformTagName(tag), data, children,
  6410. undefined, undefined, context
  6411. );
  6412. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6413. // component
  6414. vnode = createComponent(Ctor, data, context, children, tag);
  6415. } else {
  6416. // unknown or unlisted namespaced elements
  6417. // check at runtime because it may get assigned a namespace when its
  6418. // parent normalizes children
  6419. vnode = new VNode(
  6420. tag, data, children,
  6421. undefined, undefined, context
  6422. );
  6423. }
  6424. } else {
  6425. // direct component options / constructor
  6426. vnode = createComponent(tag, data, context, children);
  6427. }
  6428. if (Array.isArray(vnode)) {
  6429. return vnode
  6430. } else if (isDef(vnode)) {
  6431. if (isDef(ns)) { applyNS(vnode, ns); }
  6432. if (isDef(data)) { registerDeepBindings(data); }
  6433. return vnode
  6434. } else {
  6435. return createEmptyVNode()
  6436. }
  6437. }
  6438. function applyNS (vnode, ns, force) {
  6439. vnode.ns = ns;
  6440. if (vnode.tag === 'foreignObject') {
  6441. // use default namespace inside foreignObject
  6442. ns = undefined;
  6443. force = true;
  6444. }
  6445. if (isDef(vnode.children)) {
  6446. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6447. var child = vnode.children[i];
  6448. if (isDef(child.tag) && (
  6449. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6450. applyNS(child, ns, force);
  6451. }
  6452. }
  6453. }
  6454. }
  6455. // ref #5318
  6456. // necessary to ensure parent re-render when deep bindings like :style and
  6457. // :class are used on slot nodes
  6458. function registerDeepBindings (data) {
  6459. if (isObject(data.style)) {
  6460. traverse(data.style);
  6461. }
  6462. if (isObject(data.class)) {
  6463. traverse(data.class);
  6464. }
  6465. }
  6466. /* */
  6467. function initRender (vm) {
  6468. vm._vnode = null; // the root of the child tree
  6469. vm._staticTrees = null; // v-once cached trees
  6470. var options = vm.$options;
  6471. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6472. var renderContext = parentVnode && parentVnode.context;
  6473. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6474. vm.$scopedSlots = emptyObject;
  6475. // bind the createElement fn to this instance
  6476. // so that we get proper render context inside it.
  6477. // args order: tag, data, children, normalizationType, alwaysNormalize
  6478. // internal version is used by render functions compiled from templates
  6479. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6480. // normalization is always applied for the public version, used in
  6481. // user-written render functions.
  6482. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6483. // $attrs & $listeners are exposed for easier HOC creation.
  6484. // they need to be reactive so that HOCs using them are always updated
  6485. var parentData = parentVnode && parentVnode.data;
  6486. /* istanbul ignore else */
  6487. if (true) {
  6488. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6489. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6490. }, true);
  6491. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6492. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6493. }, true);
  6494. } else {}
  6495. }
  6496. var currentRenderingInstance = null;
  6497. function renderMixin (Vue) {
  6498. // install runtime convenience helpers
  6499. installRenderHelpers(Vue.prototype);
  6500. Vue.prototype.$nextTick = function (fn) {
  6501. return nextTick(fn, this)
  6502. };
  6503. Vue.prototype._render = function () {
  6504. var vm = this;
  6505. var ref = vm.$options;
  6506. var render = ref.render;
  6507. var _parentVnode = ref._parentVnode;
  6508. if (_parentVnode) {
  6509. vm.$scopedSlots = normalizeScopedSlots(
  6510. _parentVnode.data.scopedSlots,
  6511. vm.$slots,
  6512. vm.$scopedSlots
  6513. );
  6514. }
  6515. // set parent vnode. this allows render functions to have access
  6516. // to the data on the placeholder node.
  6517. vm.$vnode = _parentVnode;
  6518. // render self
  6519. var vnode;
  6520. try {
  6521. // There's no need to maintain a stack because all render fns are called
  6522. // separately from one another. Nested component's render fns are called
  6523. // when parent component is patched.
  6524. currentRenderingInstance = vm;
  6525. vnode = render.call(vm._renderProxy, vm.$createElement);
  6526. } catch (e) {
  6527. handleError(e, vm, "render");
  6528. // return error render result,
  6529. // or previous vnode to prevent render error causing blank component
  6530. /* istanbul ignore else */
  6531. if ( true && vm.$options.renderError) {
  6532. try {
  6533. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6534. } catch (e) {
  6535. handleError(e, vm, "renderError");
  6536. vnode = vm._vnode;
  6537. }
  6538. } else {
  6539. vnode = vm._vnode;
  6540. }
  6541. } finally {
  6542. currentRenderingInstance = null;
  6543. }
  6544. // if the returned array contains only a single node, allow it
  6545. if (Array.isArray(vnode) && vnode.length === 1) {
  6546. vnode = vnode[0];
  6547. }
  6548. // return empty vnode in case the render function errored out
  6549. if (!(vnode instanceof VNode)) {
  6550. if ( true && Array.isArray(vnode)) {
  6551. warn(
  6552. 'Multiple root nodes returned from render function. Render function ' +
  6553. 'should return a single root node.',
  6554. vm
  6555. );
  6556. }
  6557. vnode = createEmptyVNode();
  6558. }
  6559. // set parent
  6560. vnode.parent = _parentVnode;
  6561. return vnode
  6562. };
  6563. }
  6564. /* */
  6565. function ensureCtor (comp, base) {
  6566. if (
  6567. comp.__esModule ||
  6568. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6569. ) {
  6570. comp = comp.default;
  6571. }
  6572. return isObject(comp)
  6573. ? base.extend(comp)
  6574. : comp
  6575. }
  6576. function createAsyncPlaceholder (
  6577. factory,
  6578. data,
  6579. context,
  6580. children,
  6581. tag
  6582. ) {
  6583. var node = createEmptyVNode();
  6584. node.asyncFactory = factory;
  6585. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6586. return node
  6587. }
  6588. function resolveAsyncComponent (
  6589. factory,
  6590. baseCtor
  6591. ) {
  6592. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6593. return factory.errorComp
  6594. }
  6595. if (isDef(factory.resolved)) {
  6596. return factory.resolved
  6597. }
  6598. var owner = currentRenderingInstance;
  6599. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6600. // already pending
  6601. factory.owners.push(owner);
  6602. }
  6603. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6604. return factory.loadingComp
  6605. }
  6606. if (owner && !isDef(factory.owners)) {
  6607. var owners = factory.owners = [owner];
  6608. var sync = true;
  6609. var timerLoading = null;
  6610. var timerTimeout = null
  6611. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6612. var forceRender = function (renderCompleted) {
  6613. for (var i = 0, l = owners.length; i < l; i++) {
  6614. (owners[i]).$forceUpdate();
  6615. }
  6616. if (renderCompleted) {
  6617. owners.length = 0;
  6618. if (timerLoading !== null) {
  6619. clearTimeout(timerLoading);
  6620. timerLoading = null;
  6621. }
  6622. if (timerTimeout !== null) {
  6623. clearTimeout(timerTimeout);
  6624. timerTimeout = null;
  6625. }
  6626. }
  6627. };
  6628. var resolve = once(function (res) {
  6629. // cache resolved
  6630. factory.resolved = ensureCtor(res, baseCtor);
  6631. // invoke callbacks only if this is not a synchronous resolve
  6632. // (async resolves are shimmed as synchronous during SSR)
  6633. if (!sync) {
  6634. forceRender(true);
  6635. } else {
  6636. owners.length = 0;
  6637. }
  6638. });
  6639. var reject = once(function (reason) {
  6640. true && warn(
  6641. "Failed to resolve async component: " + (String(factory)) +
  6642. (reason ? ("\nReason: " + reason) : '')
  6643. );
  6644. if (isDef(factory.errorComp)) {
  6645. factory.error = true;
  6646. forceRender(true);
  6647. }
  6648. });
  6649. var res = factory(resolve, reject);
  6650. if (isObject(res)) {
  6651. if (isPromise(res)) {
  6652. // () => Promise
  6653. if (isUndef(factory.resolved)) {
  6654. res.then(resolve, reject);
  6655. }
  6656. } else if (isPromise(res.component)) {
  6657. res.component.then(resolve, reject);
  6658. if (isDef(res.error)) {
  6659. factory.errorComp = ensureCtor(res.error, baseCtor);
  6660. }
  6661. if (isDef(res.loading)) {
  6662. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6663. if (res.delay === 0) {
  6664. factory.loading = true;
  6665. } else {
  6666. timerLoading = setTimeout(function () {
  6667. timerLoading = null;
  6668. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6669. factory.loading = true;
  6670. forceRender(false);
  6671. }
  6672. }, res.delay || 200);
  6673. }
  6674. }
  6675. if (isDef(res.timeout)) {
  6676. timerTimeout = setTimeout(function () {
  6677. timerTimeout = null;
  6678. if (isUndef(factory.resolved)) {
  6679. reject(
  6680. true
  6681. ? ("timeout (" + (res.timeout) + "ms)")
  6682. : undefined
  6683. );
  6684. }
  6685. }, res.timeout);
  6686. }
  6687. }
  6688. }
  6689. sync = false;
  6690. // return in case resolved synchronously
  6691. return factory.loading
  6692. ? factory.loadingComp
  6693. : factory.resolved
  6694. }
  6695. }
  6696. /* */
  6697. function isAsyncPlaceholder (node) {
  6698. return node.isComment && node.asyncFactory
  6699. }
  6700. /* */
  6701. function getFirstComponentChild (children) {
  6702. if (Array.isArray(children)) {
  6703. for (var i = 0; i < children.length; i++) {
  6704. var c = children[i];
  6705. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6706. return c
  6707. }
  6708. }
  6709. }
  6710. }
  6711. /* */
  6712. /* */
  6713. function initEvents (vm) {
  6714. vm._events = Object.create(null);
  6715. vm._hasHookEvent = false;
  6716. // init parent attached events
  6717. var listeners = vm.$options._parentListeners;
  6718. if (listeners) {
  6719. updateComponentListeners(vm, listeners);
  6720. }
  6721. }
  6722. var target;
  6723. function add (event, fn) {
  6724. target.$on(event, fn);
  6725. }
  6726. function remove$1 (event, fn) {
  6727. target.$off(event, fn);
  6728. }
  6729. function createOnceHandler (event, fn) {
  6730. var _target = target;
  6731. return function onceHandler () {
  6732. var res = fn.apply(null, arguments);
  6733. if (res !== null) {
  6734. _target.$off(event, onceHandler);
  6735. }
  6736. }
  6737. }
  6738. function updateComponentListeners (
  6739. vm,
  6740. listeners,
  6741. oldListeners
  6742. ) {
  6743. target = vm;
  6744. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6745. target = undefined;
  6746. }
  6747. function eventsMixin (Vue) {
  6748. var hookRE = /^hook:/;
  6749. Vue.prototype.$on = function (event, fn) {
  6750. var vm = this;
  6751. if (Array.isArray(event)) {
  6752. for (var i = 0, l = event.length; i < l; i++) {
  6753. vm.$on(event[i], fn);
  6754. }
  6755. } else {
  6756. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6757. // optimize hook:event cost by using a boolean flag marked at registration
  6758. // instead of a hash lookup
  6759. if (hookRE.test(event)) {
  6760. vm._hasHookEvent = true;
  6761. }
  6762. }
  6763. return vm
  6764. };
  6765. Vue.prototype.$once = function (event, fn) {
  6766. var vm = this;
  6767. function on () {
  6768. vm.$off(event, on);
  6769. fn.apply(vm, arguments);
  6770. }
  6771. on.fn = fn;
  6772. vm.$on(event, on);
  6773. return vm
  6774. };
  6775. Vue.prototype.$off = function (event, fn) {
  6776. var vm = this;
  6777. // all
  6778. if (!arguments.length) {
  6779. vm._events = Object.create(null);
  6780. return vm
  6781. }
  6782. // array of events
  6783. if (Array.isArray(event)) {
  6784. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6785. vm.$off(event[i$1], fn);
  6786. }
  6787. return vm
  6788. }
  6789. // specific event
  6790. var cbs = vm._events[event];
  6791. if (!cbs) {
  6792. return vm
  6793. }
  6794. if (!fn) {
  6795. vm._events[event] = null;
  6796. return vm
  6797. }
  6798. // specific handler
  6799. var cb;
  6800. var i = cbs.length;
  6801. while (i--) {
  6802. cb = cbs[i];
  6803. if (cb === fn || cb.fn === fn) {
  6804. cbs.splice(i, 1);
  6805. break
  6806. }
  6807. }
  6808. return vm
  6809. };
  6810. Vue.prototype.$emit = function (event) {
  6811. var vm = this;
  6812. if (true) {
  6813. var lowerCaseEvent = event.toLowerCase();
  6814. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6815. tip(
  6816. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6817. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6818. "Note that HTML attributes are case-insensitive and you cannot use " +
  6819. "v-on to listen to camelCase events when using in-DOM templates. " +
  6820. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6821. );
  6822. }
  6823. }
  6824. var cbs = vm._events[event];
  6825. if (cbs) {
  6826. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6827. var args = toArray(arguments, 1);
  6828. var info = "event handler for \"" + event + "\"";
  6829. for (var i = 0, l = cbs.length; i < l; i++) {
  6830. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6831. }
  6832. }
  6833. return vm
  6834. };
  6835. }
  6836. /* */
  6837. var activeInstance = null;
  6838. var isUpdatingChildComponent = false;
  6839. function setActiveInstance(vm) {
  6840. var prevActiveInstance = activeInstance;
  6841. activeInstance = vm;
  6842. return function () {
  6843. activeInstance = prevActiveInstance;
  6844. }
  6845. }
  6846. function initLifecycle (vm) {
  6847. var options = vm.$options;
  6848. // locate first non-abstract parent
  6849. var parent = options.parent;
  6850. if (parent && !options.abstract) {
  6851. while (parent.$options.abstract && parent.$parent) {
  6852. parent = parent.$parent;
  6853. }
  6854. parent.$children.push(vm);
  6855. }
  6856. vm.$parent = parent;
  6857. vm.$root = parent ? parent.$root : vm;
  6858. vm.$children = [];
  6859. vm.$refs = {};
  6860. vm._watcher = null;
  6861. vm._inactive = null;
  6862. vm._directInactive = false;
  6863. vm._isMounted = false;
  6864. vm._isDestroyed = false;
  6865. vm._isBeingDestroyed = false;
  6866. }
  6867. function lifecycleMixin (Vue) {
  6868. Vue.prototype._update = function (vnode, hydrating) {
  6869. var vm = this;
  6870. var prevEl = vm.$el;
  6871. var prevVnode = vm._vnode;
  6872. var restoreActiveInstance = setActiveInstance(vm);
  6873. vm._vnode = vnode;
  6874. // Vue.prototype.__patch__ is injected in entry points
  6875. // based on the rendering backend used.
  6876. if (!prevVnode) {
  6877. // initial render
  6878. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6879. } else {
  6880. // updates
  6881. vm.$el = vm.__patch__(prevVnode, vnode);
  6882. }
  6883. restoreActiveInstance();
  6884. // update __vue__ reference
  6885. if (prevEl) {
  6886. prevEl.__vue__ = null;
  6887. }
  6888. if (vm.$el) {
  6889. vm.$el.__vue__ = vm;
  6890. }
  6891. // if parent is an HOC, update its $el as well
  6892. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6893. vm.$parent.$el = vm.$el;
  6894. }
  6895. // updated hook is called by the scheduler to ensure that children are
  6896. // updated in a parent's updated hook.
  6897. };
  6898. Vue.prototype.$forceUpdate = function () {
  6899. var vm = this;
  6900. if (vm._watcher) {
  6901. vm._watcher.update();
  6902. }
  6903. };
  6904. Vue.prototype.$destroy = function () {
  6905. var vm = this;
  6906. if (vm._isBeingDestroyed) {
  6907. return
  6908. }
  6909. callHook(vm, 'beforeDestroy');
  6910. vm._isBeingDestroyed = true;
  6911. // remove self from parent
  6912. var parent = vm.$parent;
  6913. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6914. remove(parent.$children, vm);
  6915. }
  6916. // teardown watchers
  6917. if (vm._watcher) {
  6918. vm._watcher.teardown();
  6919. }
  6920. var i = vm._watchers.length;
  6921. while (i--) {
  6922. vm._watchers[i].teardown();
  6923. }
  6924. // remove reference from data ob
  6925. // frozen object may not have observer.
  6926. if (vm._data.__ob__) {
  6927. vm._data.__ob__.vmCount--;
  6928. }
  6929. // call the last hook...
  6930. vm._isDestroyed = true;
  6931. // invoke destroy hooks on current rendered tree
  6932. vm.__patch__(vm._vnode, null);
  6933. // fire destroyed hook
  6934. callHook(vm, 'destroyed');
  6935. // turn off all instance listeners.
  6936. vm.$off();
  6937. // remove __vue__ reference
  6938. if (vm.$el) {
  6939. vm.$el.__vue__ = null;
  6940. }
  6941. // release circular reference (#6759)
  6942. if (vm.$vnode) {
  6943. vm.$vnode.parent = null;
  6944. }
  6945. };
  6946. }
  6947. function updateChildComponent (
  6948. vm,
  6949. propsData,
  6950. listeners,
  6951. parentVnode,
  6952. renderChildren
  6953. ) {
  6954. if (true) {
  6955. isUpdatingChildComponent = true;
  6956. }
  6957. // determine whether component has slot children
  6958. // we need to do this before overwriting $options._renderChildren.
  6959. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6960. // dynamic slot names). Static scoped slots compiled from template has the
  6961. // "$stable" marker.
  6962. var newScopedSlots = parentVnode.data.scopedSlots;
  6963. var oldScopedSlots = vm.$scopedSlots;
  6964. var hasDynamicScopedSlot = !!(
  6965. (newScopedSlots && !newScopedSlots.$stable) ||
  6966. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6967. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6968. );
  6969. // Any static slot children from the parent may have changed during parent's
  6970. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6971. // update is necessary to ensure correctness.
  6972. var needsForceUpdate = !!(
  6973. renderChildren || // has new static slots
  6974. vm.$options._renderChildren || // has old static slots
  6975. hasDynamicScopedSlot
  6976. );
  6977. vm.$options._parentVnode = parentVnode;
  6978. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6979. if (vm._vnode) { // update child tree's parent
  6980. vm._vnode.parent = parentVnode;
  6981. }
  6982. vm.$options._renderChildren = renderChildren;
  6983. // update $attrs and $listeners hash
  6984. // these are also reactive so they may trigger child update if the child
  6985. // used them during render
  6986. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6987. vm.$listeners = listeners || emptyObject;
  6988. // update props
  6989. if (propsData && vm.$options.props) {
  6990. toggleObserving(false);
  6991. var props = vm._props;
  6992. var propKeys = vm.$options._propKeys || [];
  6993. for (var i = 0; i < propKeys.length; i++) {
  6994. var key = propKeys[i];
  6995. var propOptions = vm.$options.props; // wtf flow?
  6996. props[key] = validateProp(key, propOptions, propsData, vm);
  6997. }
  6998. toggleObserving(true);
  6999. // keep a copy of raw propsData
  7000. vm.$options.propsData = propsData;
  7001. }
  7002. // fixed by xxxxxx update properties(mp runtime)
  7003. vm._$updateProperties && vm._$updateProperties(vm);
  7004. // update listeners
  7005. listeners = listeners || emptyObject;
  7006. var oldListeners = vm.$options._parentListeners;
  7007. vm.$options._parentListeners = listeners;
  7008. updateComponentListeners(vm, listeners, oldListeners);
  7009. // resolve slots + force update if has children
  7010. if (needsForceUpdate) {
  7011. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7012. vm.$forceUpdate();
  7013. }
  7014. if (true) {
  7015. isUpdatingChildComponent = false;
  7016. }
  7017. }
  7018. function isInInactiveTree (vm) {
  7019. while (vm && (vm = vm.$parent)) {
  7020. if (vm._inactive) { return true }
  7021. }
  7022. return false
  7023. }
  7024. function activateChildComponent (vm, direct) {
  7025. if (direct) {
  7026. vm._directInactive = false;
  7027. if (isInInactiveTree(vm)) {
  7028. return
  7029. }
  7030. } else if (vm._directInactive) {
  7031. return
  7032. }
  7033. if (vm._inactive || vm._inactive === null) {
  7034. vm._inactive = false;
  7035. for (var i = 0; i < vm.$children.length; i++) {
  7036. activateChildComponent(vm.$children[i]);
  7037. }
  7038. callHook(vm, 'activated');
  7039. }
  7040. }
  7041. function deactivateChildComponent (vm, direct) {
  7042. if (direct) {
  7043. vm._directInactive = true;
  7044. if (isInInactiveTree(vm)) {
  7045. return
  7046. }
  7047. }
  7048. if (!vm._inactive) {
  7049. vm._inactive = true;
  7050. for (var i = 0; i < vm.$children.length; i++) {
  7051. deactivateChildComponent(vm.$children[i]);
  7052. }
  7053. callHook(vm, 'deactivated');
  7054. }
  7055. }
  7056. function callHook (vm, hook) {
  7057. // #7573 disable dep collection when invoking lifecycle hooks
  7058. pushTarget();
  7059. var handlers = vm.$options[hook];
  7060. var info = hook + " hook";
  7061. if (handlers) {
  7062. for (var i = 0, j = handlers.length; i < j; i++) {
  7063. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7064. }
  7065. }
  7066. if (vm._hasHookEvent) {
  7067. vm.$emit('hook:' + hook);
  7068. }
  7069. popTarget();
  7070. }
  7071. /* */
  7072. var MAX_UPDATE_COUNT = 100;
  7073. var queue = [];
  7074. var activatedChildren = [];
  7075. var has = {};
  7076. var circular = {};
  7077. var waiting = false;
  7078. var flushing = false;
  7079. var index = 0;
  7080. /**
  7081. * Reset the scheduler's state.
  7082. */
  7083. function resetSchedulerState () {
  7084. index = queue.length = activatedChildren.length = 0;
  7085. has = {};
  7086. if (true) {
  7087. circular = {};
  7088. }
  7089. waiting = flushing = false;
  7090. }
  7091. // Async edge case #6566 requires saving the timestamp when event listeners are
  7092. // attached. However, calling performance.now() has a perf overhead especially
  7093. // if the page has thousands of event listeners. Instead, we take a timestamp
  7094. // every time the scheduler flushes and use that for all event listeners
  7095. // attached during that flush.
  7096. var currentFlushTimestamp = 0;
  7097. // Async edge case fix requires storing an event listener's attach timestamp.
  7098. var getNow = Date.now;
  7099. // Determine what event timestamp the browser is using. Annoyingly, the
  7100. // timestamp can either be hi-res (relative to page load) or low-res
  7101. // (relative to UNIX epoch), so in order to compare time we have to use the
  7102. // same timestamp type when saving the flush timestamp.
  7103. // All IE versions use low-res event timestamps, and have problematic clock
  7104. // implementations (#9632)
  7105. if (inBrowser && !isIE) {
  7106. var performance = window.performance;
  7107. if (
  7108. performance &&
  7109. typeof performance.now === 'function' &&
  7110. getNow() > document.createEvent('Event').timeStamp
  7111. ) {
  7112. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7113. // smaller than it, it means the event is using a hi-res timestamp,
  7114. // and we need to use the hi-res version for event listener timestamps as
  7115. // well.
  7116. getNow = function () { return performance.now(); };
  7117. }
  7118. }
  7119. /**
  7120. * Flush both queues and run the watchers.
  7121. */
  7122. function flushSchedulerQueue () {
  7123. currentFlushTimestamp = getNow();
  7124. flushing = true;
  7125. var watcher, id;
  7126. // Sort queue before flush.
  7127. // This ensures that:
  7128. // 1. Components are updated from parent to child. (because parent is always
  7129. // created before the child)
  7130. // 2. A component's user watchers are run before its render watcher (because
  7131. // user watchers are created before the render watcher)
  7132. // 3. If a component is destroyed during a parent component's watcher run,
  7133. // its watchers can be skipped.
  7134. queue.sort(function (a, b) { return a.id - b.id; });
  7135. // do not cache length because more watchers might be pushed
  7136. // as we run existing watchers
  7137. for (index = 0; index < queue.length; index++) {
  7138. watcher = queue[index];
  7139. if (watcher.before) {
  7140. watcher.before();
  7141. }
  7142. id = watcher.id;
  7143. has[id] = null;
  7144. watcher.run();
  7145. // in dev build, check and stop circular updates.
  7146. if ( true && has[id] != null) {
  7147. circular[id] = (circular[id] || 0) + 1;
  7148. if (circular[id] > MAX_UPDATE_COUNT) {
  7149. warn(
  7150. 'You may have an infinite update loop ' + (
  7151. watcher.user
  7152. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7153. : "in a component render function."
  7154. ),
  7155. watcher.vm
  7156. );
  7157. break
  7158. }
  7159. }
  7160. }
  7161. // keep copies of post queues before resetting state
  7162. var activatedQueue = activatedChildren.slice();
  7163. var updatedQueue = queue.slice();
  7164. resetSchedulerState();
  7165. // call component updated and activated hooks
  7166. callActivatedHooks(activatedQueue);
  7167. callUpdatedHooks(updatedQueue);
  7168. // devtool hook
  7169. /* istanbul ignore if */
  7170. if (devtools && config.devtools) {
  7171. devtools.emit('flush');
  7172. }
  7173. }
  7174. function callUpdatedHooks (queue) {
  7175. var i = queue.length;
  7176. while (i--) {
  7177. var watcher = queue[i];
  7178. var vm = watcher.vm;
  7179. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7180. callHook(vm, 'updated');
  7181. }
  7182. }
  7183. }
  7184. /**
  7185. * Queue a kept-alive component that was activated during patch.
  7186. * The queue will be processed after the entire tree has been patched.
  7187. */
  7188. function queueActivatedComponent (vm) {
  7189. // setting _inactive to false here so that a render function can
  7190. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7191. vm._inactive = false;
  7192. activatedChildren.push(vm);
  7193. }
  7194. function callActivatedHooks (queue) {
  7195. for (var i = 0; i < queue.length; i++) {
  7196. queue[i]._inactive = true;
  7197. activateChildComponent(queue[i], true /* true */);
  7198. }
  7199. }
  7200. /**
  7201. * Push a watcher into the watcher queue.
  7202. * Jobs with duplicate IDs will be skipped unless it's
  7203. * pushed when the queue is being flushed.
  7204. */
  7205. function queueWatcher (watcher) {
  7206. var id = watcher.id;
  7207. if (has[id] == null) {
  7208. has[id] = true;
  7209. if (!flushing) {
  7210. queue.push(watcher);
  7211. } else {
  7212. // if already flushing, splice the watcher based on its id
  7213. // if already past its id, it will be run next immediately.
  7214. var i = queue.length - 1;
  7215. while (i > index && queue[i].id > watcher.id) {
  7216. i--;
  7217. }
  7218. queue.splice(i + 1, 0, watcher);
  7219. }
  7220. // queue the flush
  7221. if (!waiting) {
  7222. waiting = true;
  7223. if ( true && !config.async) {
  7224. flushSchedulerQueue();
  7225. return
  7226. }
  7227. nextTick(flushSchedulerQueue);
  7228. }
  7229. }
  7230. }
  7231. /* */
  7232. var uid$2 = 0;
  7233. /**
  7234. * A watcher parses an expression, collects dependencies,
  7235. * and fires callback when the expression value changes.
  7236. * This is used for both the $watch() api and directives.
  7237. */
  7238. var Watcher = function Watcher (
  7239. vm,
  7240. expOrFn,
  7241. cb,
  7242. options,
  7243. isRenderWatcher
  7244. ) {
  7245. this.vm = vm;
  7246. if (isRenderWatcher) {
  7247. vm._watcher = this;
  7248. }
  7249. vm._watchers.push(this);
  7250. // options
  7251. if (options) {
  7252. this.deep = !!options.deep;
  7253. this.user = !!options.user;
  7254. this.lazy = !!options.lazy;
  7255. this.sync = !!options.sync;
  7256. this.before = options.before;
  7257. } else {
  7258. this.deep = this.user = this.lazy = this.sync = false;
  7259. }
  7260. this.cb = cb;
  7261. this.id = ++uid$2; // uid for batching
  7262. this.active = true;
  7263. this.dirty = this.lazy; // for lazy watchers
  7264. this.deps = [];
  7265. this.newDeps = [];
  7266. this.depIds = new _Set();
  7267. this.newDepIds = new _Set();
  7268. this.expression = true
  7269. ? expOrFn.toString()
  7270. : undefined;
  7271. // parse expression for getter
  7272. if (typeof expOrFn === 'function') {
  7273. this.getter = expOrFn;
  7274. } else {
  7275. this.getter = parsePath(expOrFn);
  7276. if (!this.getter) {
  7277. this.getter = noop;
  7278. true && warn(
  7279. "Failed watching path: \"" + expOrFn + "\" " +
  7280. 'Watcher only accepts simple dot-delimited paths. ' +
  7281. 'For full control, use a function instead.',
  7282. vm
  7283. );
  7284. }
  7285. }
  7286. this.value = this.lazy
  7287. ? undefined
  7288. : this.get();
  7289. };
  7290. /**
  7291. * Evaluate the getter, and re-collect dependencies.
  7292. */
  7293. Watcher.prototype.get = function get () {
  7294. pushTarget(this);
  7295. var value;
  7296. var vm = this.vm;
  7297. try {
  7298. value = this.getter.call(vm, vm);
  7299. } catch (e) {
  7300. if (this.user) {
  7301. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7302. } else {
  7303. throw e
  7304. }
  7305. } finally {
  7306. // "touch" every property so they are all tracked as
  7307. // dependencies for deep watching
  7308. if (this.deep) {
  7309. traverse(value);
  7310. }
  7311. popTarget();
  7312. this.cleanupDeps();
  7313. }
  7314. return value
  7315. };
  7316. /**
  7317. * Add a dependency to this directive.
  7318. */
  7319. Watcher.prototype.addDep = function addDep (dep) {
  7320. var id = dep.id;
  7321. if (!this.newDepIds.has(id)) {
  7322. this.newDepIds.add(id);
  7323. this.newDeps.push(dep);
  7324. if (!this.depIds.has(id)) {
  7325. dep.addSub(this);
  7326. }
  7327. }
  7328. };
  7329. /**
  7330. * Clean up for dependency collection.
  7331. */
  7332. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7333. var i = this.deps.length;
  7334. while (i--) {
  7335. var dep = this.deps[i];
  7336. if (!this.newDepIds.has(dep.id)) {
  7337. dep.removeSub(this);
  7338. }
  7339. }
  7340. var tmp = this.depIds;
  7341. this.depIds = this.newDepIds;
  7342. this.newDepIds = tmp;
  7343. this.newDepIds.clear();
  7344. tmp = this.deps;
  7345. this.deps = this.newDeps;
  7346. this.newDeps = tmp;
  7347. this.newDeps.length = 0;
  7348. };
  7349. /**
  7350. * Subscriber interface.
  7351. * Will be called when a dependency changes.
  7352. */
  7353. Watcher.prototype.update = function update () {
  7354. /* istanbul ignore else */
  7355. if (this.lazy) {
  7356. this.dirty = true;
  7357. } else if (this.sync) {
  7358. this.run();
  7359. } else {
  7360. queueWatcher(this);
  7361. }
  7362. };
  7363. /**
  7364. * Scheduler job interface.
  7365. * Will be called by the scheduler.
  7366. */
  7367. Watcher.prototype.run = function run () {
  7368. if (this.active) {
  7369. var value = this.get();
  7370. if (
  7371. value !== this.value ||
  7372. // Deep watchers and watchers on Object/Arrays should fire even
  7373. // when the value is the same, because the value may
  7374. // have mutated.
  7375. isObject(value) ||
  7376. this.deep
  7377. ) {
  7378. // set new value
  7379. var oldValue = this.value;
  7380. this.value = value;
  7381. if (this.user) {
  7382. try {
  7383. this.cb.call(this.vm, value, oldValue);
  7384. } catch (e) {
  7385. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7386. }
  7387. } else {
  7388. this.cb.call(this.vm, value, oldValue);
  7389. }
  7390. }
  7391. }
  7392. };
  7393. /**
  7394. * Evaluate the value of the watcher.
  7395. * This only gets called for lazy watchers.
  7396. */
  7397. Watcher.prototype.evaluate = function evaluate () {
  7398. this.value = this.get();
  7399. this.dirty = false;
  7400. };
  7401. /**
  7402. * Depend on all deps collected by this watcher.
  7403. */
  7404. Watcher.prototype.depend = function depend () {
  7405. var i = this.deps.length;
  7406. while (i--) {
  7407. this.deps[i].depend();
  7408. }
  7409. };
  7410. /**
  7411. * Remove self from all dependencies' subscriber list.
  7412. */
  7413. Watcher.prototype.teardown = function teardown () {
  7414. if (this.active) {
  7415. // remove self from vm's watcher list
  7416. // this is a somewhat expensive operation so we skip it
  7417. // if the vm is being destroyed.
  7418. if (!this.vm._isBeingDestroyed) {
  7419. remove(this.vm._watchers, this);
  7420. }
  7421. var i = this.deps.length;
  7422. while (i--) {
  7423. this.deps[i].removeSub(this);
  7424. }
  7425. this.active = false;
  7426. }
  7427. };
  7428. /* */
  7429. var sharedPropertyDefinition = {
  7430. enumerable: true,
  7431. configurable: true,
  7432. get: noop,
  7433. set: noop
  7434. };
  7435. function proxy (target, sourceKey, key) {
  7436. sharedPropertyDefinition.get = function proxyGetter () {
  7437. return this[sourceKey][key]
  7438. };
  7439. sharedPropertyDefinition.set = function proxySetter (val) {
  7440. this[sourceKey][key] = val;
  7441. };
  7442. Object.defineProperty(target, key, sharedPropertyDefinition);
  7443. }
  7444. function initState (vm) {
  7445. vm._watchers = [];
  7446. var opts = vm.$options;
  7447. if (opts.props) { initProps(vm, opts.props); }
  7448. if (opts.methods) { initMethods(vm, opts.methods); }
  7449. if (opts.data) {
  7450. initData(vm);
  7451. } else {
  7452. observe(vm._data = {}, true /* asRootData */);
  7453. }
  7454. if (opts.computed) { initComputed(vm, opts.computed); }
  7455. if (opts.watch && opts.watch !== nativeWatch) {
  7456. initWatch(vm, opts.watch);
  7457. }
  7458. }
  7459. function initProps (vm, propsOptions) {
  7460. var propsData = vm.$options.propsData || {};
  7461. var props = vm._props = {};
  7462. // cache prop keys so that future props updates can iterate using Array
  7463. // instead of dynamic object key enumeration.
  7464. var keys = vm.$options._propKeys = [];
  7465. var isRoot = !vm.$parent;
  7466. // root instance props should be converted
  7467. if (!isRoot) {
  7468. toggleObserving(false);
  7469. }
  7470. var loop = function ( key ) {
  7471. keys.push(key);
  7472. var value = validateProp(key, propsOptions, propsData, vm);
  7473. /* istanbul ignore else */
  7474. if (true) {
  7475. var hyphenatedKey = hyphenate(key);
  7476. if (isReservedAttribute(hyphenatedKey) ||
  7477. config.isReservedAttr(hyphenatedKey)) {
  7478. warn(
  7479. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7480. vm
  7481. );
  7482. }
  7483. defineReactive$$1(props, key, value, function () {
  7484. if (!isRoot && !isUpdatingChildComponent) {
  7485. {
  7486. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7487. return
  7488. }
  7489. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7490. if(
  7491. key === 'value' &&
  7492. Array.isArray(vm.$options.behaviors) &&
  7493. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7494. ){
  7495. return
  7496. }
  7497. if(vm._getFormData){
  7498. return
  7499. }
  7500. var $parent = vm.$parent;
  7501. while($parent){
  7502. if($parent.__next_tick_pending){
  7503. return
  7504. }
  7505. $parent = $parent.$parent;
  7506. }
  7507. }
  7508. warn(
  7509. "Avoid mutating a prop directly since the value will be " +
  7510. "overwritten whenever the parent component re-renders. " +
  7511. "Instead, use a data or computed property based on the prop's " +
  7512. "value. Prop being mutated: \"" + key + "\"",
  7513. vm
  7514. );
  7515. }
  7516. });
  7517. } else {}
  7518. // static props are already proxied on the component's prototype
  7519. // during Vue.extend(). We only need to proxy props defined at
  7520. // instantiation here.
  7521. if (!(key in vm)) {
  7522. proxy(vm, "_props", key);
  7523. }
  7524. };
  7525. for (var key in propsOptions) loop( key );
  7526. toggleObserving(true);
  7527. }
  7528. function initData (vm) {
  7529. var data = vm.$options.data;
  7530. data = vm._data = typeof data === 'function'
  7531. ? getData(data, vm)
  7532. : data || {};
  7533. if (!isPlainObject(data)) {
  7534. data = {};
  7535. true && warn(
  7536. 'data functions should return an object:\n' +
  7537. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7538. vm
  7539. );
  7540. }
  7541. // proxy data on instance
  7542. var keys = Object.keys(data);
  7543. var props = vm.$options.props;
  7544. var methods = vm.$options.methods;
  7545. var i = keys.length;
  7546. while (i--) {
  7547. var key = keys[i];
  7548. if (true) {
  7549. if (methods && hasOwn(methods, key)) {
  7550. warn(
  7551. ("Method \"" + key + "\" has already been defined as a data property."),
  7552. vm
  7553. );
  7554. }
  7555. }
  7556. if (props && hasOwn(props, key)) {
  7557. true && warn(
  7558. "The data property \"" + key + "\" is already declared as a prop. " +
  7559. "Use prop default value instead.",
  7560. vm
  7561. );
  7562. } else if (!isReserved(key)) {
  7563. proxy(vm, "_data", key);
  7564. }
  7565. }
  7566. // observe data
  7567. observe(data, true /* asRootData */);
  7568. }
  7569. function getData (data, vm) {
  7570. // #7573 disable dep collection when invoking data getters
  7571. pushTarget();
  7572. try {
  7573. return data.call(vm, vm)
  7574. } catch (e) {
  7575. handleError(e, vm, "data()");
  7576. return {}
  7577. } finally {
  7578. popTarget();
  7579. }
  7580. }
  7581. var computedWatcherOptions = { lazy: true };
  7582. function initComputed (vm, computed) {
  7583. // $flow-disable-line
  7584. var watchers = vm._computedWatchers = Object.create(null);
  7585. // computed properties are just getters during SSR
  7586. var isSSR = isServerRendering();
  7587. for (var key in computed) {
  7588. var userDef = computed[key];
  7589. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7590. if ( true && getter == null) {
  7591. warn(
  7592. ("Getter is missing for computed property \"" + key + "\"."),
  7593. vm
  7594. );
  7595. }
  7596. if (!isSSR) {
  7597. // create internal watcher for the computed property.
  7598. watchers[key] = new Watcher(
  7599. vm,
  7600. getter || noop,
  7601. noop,
  7602. computedWatcherOptions
  7603. );
  7604. }
  7605. // component-defined computed properties are already defined on the
  7606. // component prototype. We only need to define computed properties defined
  7607. // at instantiation here.
  7608. if (!(key in vm)) {
  7609. defineComputed(vm, key, userDef);
  7610. } else if (true) {
  7611. if (key in vm.$data) {
  7612. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7613. } else if (vm.$options.props && key in vm.$options.props) {
  7614. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7615. }
  7616. }
  7617. }
  7618. }
  7619. function defineComputed (
  7620. target,
  7621. key,
  7622. userDef
  7623. ) {
  7624. var shouldCache = !isServerRendering();
  7625. if (typeof userDef === 'function') {
  7626. sharedPropertyDefinition.get = shouldCache
  7627. ? createComputedGetter(key)
  7628. : createGetterInvoker(userDef);
  7629. sharedPropertyDefinition.set = noop;
  7630. } else {
  7631. sharedPropertyDefinition.get = userDef.get
  7632. ? shouldCache && userDef.cache !== false
  7633. ? createComputedGetter(key)
  7634. : createGetterInvoker(userDef.get)
  7635. : noop;
  7636. sharedPropertyDefinition.set = userDef.set || noop;
  7637. }
  7638. if ( true &&
  7639. sharedPropertyDefinition.set === noop) {
  7640. sharedPropertyDefinition.set = function () {
  7641. warn(
  7642. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7643. this
  7644. );
  7645. };
  7646. }
  7647. Object.defineProperty(target, key, sharedPropertyDefinition);
  7648. }
  7649. function createComputedGetter (key) {
  7650. return function computedGetter () {
  7651. var watcher = this._computedWatchers && this._computedWatchers[key];
  7652. if (watcher) {
  7653. if (watcher.dirty) {
  7654. watcher.evaluate();
  7655. }
  7656. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7657. watcher.depend();
  7658. }
  7659. return watcher.value
  7660. }
  7661. }
  7662. }
  7663. function createGetterInvoker(fn) {
  7664. return function computedGetter () {
  7665. return fn.call(this, this)
  7666. }
  7667. }
  7668. function initMethods (vm, methods) {
  7669. var props = vm.$options.props;
  7670. for (var key in methods) {
  7671. if (true) {
  7672. if (typeof methods[key] !== 'function') {
  7673. warn(
  7674. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7675. "Did you reference the function correctly?",
  7676. vm
  7677. );
  7678. }
  7679. if (props && hasOwn(props, key)) {
  7680. warn(
  7681. ("Method \"" + key + "\" has already been defined as a prop."),
  7682. vm
  7683. );
  7684. }
  7685. if ((key in vm) && isReserved(key)) {
  7686. warn(
  7687. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7688. "Avoid defining component methods that start with _ or $."
  7689. );
  7690. }
  7691. }
  7692. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7693. }
  7694. }
  7695. function initWatch (vm, watch) {
  7696. for (var key in watch) {
  7697. var handler = watch[key];
  7698. if (Array.isArray(handler)) {
  7699. for (var i = 0; i < handler.length; i++) {
  7700. createWatcher(vm, key, handler[i]);
  7701. }
  7702. } else {
  7703. createWatcher(vm, key, handler);
  7704. }
  7705. }
  7706. }
  7707. function createWatcher (
  7708. vm,
  7709. expOrFn,
  7710. handler,
  7711. options
  7712. ) {
  7713. if (isPlainObject(handler)) {
  7714. options = handler;
  7715. handler = handler.handler;
  7716. }
  7717. if (typeof handler === 'string') {
  7718. handler = vm[handler];
  7719. }
  7720. return vm.$watch(expOrFn, handler, options)
  7721. }
  7722. function stateMixin (Vue) {
  7723. // flow somehow has problems with directly declared definition object
  7724. // when using Object.defineProperty, so we have to procedurally build up
  7725. // the object here.
  7726. var dataDef = {};
  7727. dataDef.get = function () { return this._data };
  7728. var propsDef = {};
  7729. propsDef.get = function () { return this._props };
  7730. if (true) {
  7731. dataDef.set = function () {
  7732. warn(
  7733. 'Avoid replacing instance root $data. ' +
  7734. 'Use nested data properties instead.',
  7735. this
  7736. );
  7737. };
  7738. propsDef.set = function () {
  7739. warn("$props is readonly.", this);
  7740. };
  7741. }
  7742. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7743. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7744. Vue.prototype.$set = set;
  7745. Vue.prototype.$delete = del;
  7746. Vue.prototype.$watch = function (
  7747. expOrFn,
  7748. cb,
  7749. options
  7750. ) {
  7751. var vm = this;
  7752. if (isPlainObject(cb)) {
  7753. return createWatcher(vm, expOrFn, cb, options)
  7754. }
  7755. options = options || {};
  7756. options.user = true;
  7757. var watcher = new Watcher(vm, expOrFn, cb, options);
  7758. if (options.immediate) {
  7759. try {
  7760. cb.call(vm, watcher.value);
  7761. } catch (error) {
  7762. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7763. }
  7764. }
  7765. return function unwatchFn () {
  7766. watcher.teardown();
  7767. }
  7768. };
  7769. }
  7770. /* */
  7771. var uid$3 = 0;
  7772. function initMixin (Vue) {
  7773. Vue.prototype._init = function (options) {
  7774. var vm = this;
  7775. // a uid
  7776. vm._uid = uid$3++;
  7777. var startTag, endTag;
  7778. /* istanbul ignore if */
  7779. if ( true && config.performance && mark) {
  7780. startTag = "vue-perf-start:" + (vm._uid);
  7781. endTag = "vue-perf-end:" + (vm._uid);
  7782. mark(startTag);
  7783. }
  7784. // a flag to avoid this being observed
  7785. vm._isVue = true;
  7786. // merge options
  7787. if (options && options._isComponent) {
  7788. // optimize internal component instantiation
  7789. // since dynamic options merging is pretty slow, and none of the
  7790. // internal component options needs special treatment.
  7791. initInternalComponent(vm, options);
  7792. } else {
  7793. vm.$options = mergeOptions(
  7794. resolveConstructorOptions(vm.constructor),
  7795. options || {},
  7796. vm
  7797. );
  7798. }
  7799. /* istanbul ignore else */
  7800. if (true) {
  7801. initProxy(vm);
  7802. } else {}
  7803. // expose real self
  7804. vm._self = vm;
  7805. initLifecycle(vm);
  7806. initEvents(vm);
  7807. initRender(vm);
  7808. callHook(vm, 'beforeCreate');
  7809. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7810. initState(vm);
  7811. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7812. !vm._$fallback && callHook(vm, 'created');
  7813. /* istanbul ignore if */
  7814. if ( true && config.performance && mark) {
  7815. vm._name = formatComponentName(vm, false);
  7816. mark(endTag);
  7817. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7818. }
  7819. if (vm.$options.el) {
  7820. vm.$mount(vm.$options.el);
  7821. }
  7822. };
  7823. }
  7824. function initInternalComponent (vm, options) {
  7825. var opts = vm.$options = Object.create(vm.constructor.options);
  7826. // doing this because it's faster than dynamic enumeration.
  7827. var parentVnode = options._parentVnode;
  7828. opts.parent = options.parent;
  7829. opts._parentVnode = parentVnode;
  7830. var vnodeComponentOptions = parentVnode.componentOptions;
  7831. opts.propsData = vnodeComponentOptions.propsData;
  7832. opts._parentListeners = vnodeComponentOptions.listeners;
  7833. opts._renderChildren = vnodeComponentOptions.children;
  7834. opts._componentTag = vnodeComponentOptions.tag;
  7835. if (options.render) {
  7836. opts.render = options.render;
  7837. opts.staticRenderFns = options.staticRenderFns;
  7838. }
  7839. }
  7840. function resolveConstructorOptions (Ctor) {
  7841. var options = Ctor.options;
  7842. if (Ctor.super) {
  7843. var superOptions = resolveConstructorOptions(Ctor.super);
  7844. var cachedSuperOptions = Ctor.superOptions;
  7845. if (superOptions !== cachedSuperOptions) {
  7846. // super option changed,
  7847. // need to resolve new options.
  7848. Ctor.superOptions = superOptions;
  7849. // check if there are any late-modified/attached options (#4976)
  7850. var modifiedOptions = resolveModifiedOptions(Ctor);
  7851. // update base extend options
  7852. if (modifiedOptions) {
  7853. extend(Ctor.extendOptions, modifiedOptions);
  7854. }
  7855. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7856. if (options.name) {
  7857. options.components[options.name] = Ctor;
  7858. }
  7859. }
  7860. }
  7861. return options
  7862. }
  7863. function resolveModifiedOptions (Ctor) {
  7864. var modified;
  7865. var latest = Ctor.options;
  7866. var sealed = Ctor.sealedOptions;
  7867. for (var key in latest) {
  7868. if (latest[key] !== sealed[key]) {
  7869. if (!modified) { modified = {}; }
  7870. modified[key] = latest[key];
  7871. }
  7872. }
  7873. return modified
  7874. }
  7875. function Vue (options) {
  7876. if ( true &&
  7877. !(this instanceof Vue)
  7878. ) {
  7879. warn('Vue is a constructor and should be called with the `new` keyword');
  7880. }
  7881. this._init(options);
  7882. }
  7883. initMixin(Vue);
  7884. stateMixin(Vue);
  7885. eventsMixin(Vue);
  7886. lifecycleMixin(Vue);
  7887. renderMixin(Vue);
  7888. /* */
  7889. function initUse (Vue) {
  7890. Vue.use = function (plugin) {
  7891. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7892. if (installedPlugins.indexOf(plugin) > -1) {
  7893. return this
  7894. }
  7895. // additional parameters
  7896. var args = toArray(arguments, 1);
  7897. args.unshift(this);
  7898. if (typeof plugin.install === 'function') {
  7899. plugin.install.apply(plugin, args);
  7900. } else if (typeof plugin === 'function') {
  7901. plugin.apply(null, args);
  7902. }
  7903. installedPlugins.push(plugin);
  7904. return this
  7905. };
  7906. }
  7907. /* */
  7908. function initMixin$1 (Vue) {
  7909. Vue.mixin = function (mixin) {
  7910. this.options = mergeOptions(this.options, mixin);
  7911. return this
  7912. };
  7913. }
  7914. /* */
  7915. function initExtend (Vue) {
  7916. /**
  7917. * Each instance constructor, including Vue, has a unique
  7918. * cid. This enables us to create wrapped "child
  7919. * constructors" for prototypal inheritance and cache them.
  7920. */
  7921. Vue.cid = 0;
  7922. var cid = 1;
  7923. /**
  7924. * Class inheritance
  7925. */
  7926. Vue.extend = function (extendOptions) {
  7927. extendOptions = extendOptions || {};
  7928. var Super = this;
  7929. var SuperId = Super.cid;
  7930. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7931. if (cachedCtors[SuperId]) {
  7932. return cachedCtors[SuperId]
  7933. }
  7934. var name = extendOptions.name || Super.options.name;
  7935. if ( true && name) {
  7936. validateComponentName(name);
  7937. }
  7938. var Sub = function VueComponent (options) {
  7939. this._init(options);
  7940. };
  7941. Sub.prototype = Object.create(Super.prototype);
  7942. Sub.prototype.constructor = Sub;
  7943. Sub.cid = cid++;
  7944. Sub.options = mergeOptions(
  7945. Super.options,
  7946. extendOptions
  7947. );
  7948. Sub['super'] = Super;
  7949. // For props and computed properties, we define the proxy getters on
  7950. // the Vue instances at extension time, on the extended prototype. This
  7951. // avoids Object.defineProperty calls for each instance created.
  7952. if (Sub.options.props) {
  7953. initProps$1(Sub);
  7954. }
  7955. if (Sub.options.computed) {
  7956. initComputed$1(Sub);
  7957. }
  7958. // allow further extension/mixin/plugin usage
  7959. Sub.extend = Super.extend;
  7960. Sub.mixin = Super.mixin;
  7961. Sub.use = Super.use;
  7962. // create asset registers, so extended classes
  7963. // can have their private assets too.
  7964. ASSET_TYPES.forEach(function (type) {
  7965. Sub[type] = Super[type];
  7966. });
  7967. // enable recursive self-lookup
  7968. if (name) {
  7969. Sub.options.components[name] = Sub;
  7970. }
  7971. // keep a reference to the super options at extension time.
  7972. // later at instantiation we can check if Super's options have
  7973. // been updated.
  7974. Sub.superOptions = Super.options;
  7975. Sub.extendOptions = extendOptions;
  7976. Sub.sealedOptions = extend({}, Sub.options);
  7977. // cache constructor
  7978. cachedCtors[SuperId] = Sub;
  7979. return Sub
  7980. };
  7981. }
  7982. function initProps$1 (Comp) {
  7983. var props = Comp.options.props;
  7984. for (var key in props) {
  7985. proxy(Comp.prototype, "_props", key);
  7986. }
  7987. }
  7988. function initComputed$1 (Comp) {
  7989. var computed = Comp.options.computed;
  7990. for (var key in computed) {
  7991. defineComputed(Comp.prototype, key, computed[key]);
  7992. }
  7993. }
  7994. /* */
  7995. function initAssetRegisters (Vue) {
  7996. /**
  7997. * Create asset registration methods.
  7998. */
  7999. ASSET_TYPES.forEach(function (type) {
  8000. Vue[type] = function (
  8001. id,
  8002. definition
  8003. ) {
  8004. if (!definition) {
  8005. return this.options[type + 's'][id]
  8006. } else {
  8007. /* istanbul ignore if */
  8008. if ( true && type === 'component') {
  8009. validateComponentName(id);
  8010. }
  8011. if (type === 'component' && isPlainObject(definition)) {
  8012. definition.name = definition.name || id;
  8013. definition = this.options._base.extend(definition);
  8014. }
  8015. if (type === 'directive' && typeof definition === 'function') {
  8016. definition = { bind: definition, update: definition };
  8017. }
  8018. this.options[type + 's'][id] = definition;
  8019. return definition
  8020. }
  8021. };
  8022. });
  8023. }
  8024. /* */
  8025. function getComponentName (opts) {
  8026. return opts && (opts.Ctor.options.name || opts.tag)
  8027. }
  8028. function matches (pattern, name) {
  8029. if (Array.isArray(pattern)) {
  8030. return pattern.indexOf(name) > -1
  8031. } else if (typeof pattern === 'string') {
  8032. return pattern.split(',').indexOf(name) > -1
  8033. } else if (isRegExp(pattern)) {
  8034. return pattern.test(name)
  8035. }
  8036. /* istanbul ignore next */
  8037. return false
  8038. }
  8039. function pruneCache (keepAliveInstance, filter) {
  8040. var cache = keepAliveInstance.cache;
  8041. var keys = keepAliveInstance.keys;
  8042. var _vnode = keepAliveInstance._vnode;
  8043. for (var key in cache) {
  8044. var cachedNode = cache[key];
  8045. if (cachedNode) {
  8046. var name = getComponentName(cachedNode.componentOptions);
  8047. if (name && !filter(name)) {
  8048. pruneCacheEntry(cache, key, keys, _vnode);
  8049. }
  8050. }
  8051. }
  8052. }
  8053. function pruneCacheEntry (
  8054. cache,
  8055. key,
  8056. keys,
  8057. current
  8058. ) {
  8059. var cached$$1 = cache[key];
  8060. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8061. cached$$1.componentInstance.$destroy();
  8062. }
  8063. cache[key] = null;
  8064. remove(keys, key);
  8065. }
  8066. var patternTypes = [String, RegExp, Array];
  8067. var KeepAlive = {
  8068. name: 'keep-alive',
  8069. abstract: true,
  8070. props: {
  8071. include: patternTypes,
  8072. exclude: patternTypes,
  8073. max: [String, Number]
  8074. },
  8075. created: function created () {
  8076. this.cache = Object.create(null);
  8077. this.keys = [];
  8078. },
  8079. destroyed: function destroyed () {
  8080. for (var key in this.cache) {
  8081. pruneCacheEntry(this.cache, key, this.keys);
  8082. }
  8083. },
  8084. mounted: function mounted () {
  8085. var this$1 = this;
  8086. this.$watch('include', function (val) {
  8087. pruneCache(this$1, function (name) { return matches(val, name); });
  8088. });
  8089. this.$watch('exclude', function (val) {
  8090. pruneCache(this$1, function (name) { return !matches(val, name); });
  8091. });
  8092. },
  8093. render: function render () {
  8094. var slot = this.$slots.default;
  8095. var vnode = getFirstComponentChild(slot);
  8096. var componentOptions = vnode && vnode.componentOptions;
  8097. if (componentOptions) {
  8098. // check pattern
  8099. var name = getComponentName(componentOptions);
  8100. var ref = this;
  8101. var include = ref.include;
  8102. var exclude = ref.exclude;
  8103. if (
  8104. // not included
  8105. (include && (!name || !matches(include, name))) ||
  8106. // excluded
  8107. (exclude && name && matches(exclude, name))
  8108. ) {
  8109. return vnode
  8110. }
  8111. var ref$1 = this;
  8112. var cache = ref$1.cache;
  8113. var keys = ref$1.keys;
  8114. var key = vnode.key == null
  8115. // same constructor may get registered as different local components
  8116. // so cid alone is not enough (#3269)
  8117. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8118. : vnode.key;
  8119. if (cache[key]) {
  8120. vnode.componentInstance = cache[key].componentInstance;
  8121. // make current key freshest
  8122. remove(keys, key);
  8123. keys.push(key);
  8124. } else {
  8125. cache[key] = vnode;
  8126. keys.push(key);
  8127. // prune oldest entry
  8128. if (this.max && keys.length > parseInt(this.max)) {
  8129. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8130. }
  8131. }
  8132. vnode.data.keepAlive = true;
  8133. }
  8134. return vnode || (slot && slot[0])
  8135. }
  8136. };
  8137. var builtInComponents = {
  8138. KeepAlive: KeepAlive
  8139. };
  8140. /* */
  8141. function initGlobalAPI (Vue) {
  8142. // config
  8143. var configDef = {};
  8144. configDef.get = function () { return config; };
  8145. if (true) {
  8146. configDef.set = function () {
  8147. warn(
  8148. 'Do not replace the Vue.config object, set individual fields instead.'
  8149. );
  8150. };
  8151. }
  8152. Object.defineProperty(Vue, 'config', configDef);
  8153. // exposed util methods.
  8154. // NOTE: these are not considered part of the public API - avoid relying on
  8155. // them unless you are aware of the risk.
  8156. Vue.util = {
  8157. warn: warn,
  8158. extend: extend,
  8159. mergeOptions: mergeOptions,
  8160. defineReactive: defineReactive$$1
  8161. };
  8162. Vue.set = set;
  8163. Vue.delete = del;
  8164. Vue.nextTick = nextTick;
  8165. // 2.6 explicit observable API
  8166. Vue.observable = function (obj) {
  8167. observe(obj);
  8168. return obj
  8169. };
  8170. Vue.options = Object.create(null);
  8171. ASSET_TYPES.forEach(function (type) {
  8172. Vue.options[type + 's'] = Object.create(null);
  8173. });
  8174. // this is used to identify the "base" constructor to extend all plain-object
  8175. // components with in Weex's multi-instance scenarios.
  8176. Vue.options._base = Vue;
  8177. extend(Vue.options.components, builtInComponents);
  8178. initUse(Vue);
  8179. initMixin$1(Vue);
  8180. initExtend(Vue);
  8181. initAssetRegisters(Vue);
  8182. }
  8183. initGlobalAPI(Vue);
  8184. Object.defineProperty(Vue.prototype, '$isServer', {
  8185. get: isServerRendering
  8186. });
  8187. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8188. get: function get () {
  8189. /* istanbul ignore next */
  8190. return this.$vnode && this.$vnode.ssrContext
  8191. }
  8192. });
  8193. // expose FunctionalRenderContext for ssr runtime helper installation
  8194. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8195. value: FunctionalRenderContext
  8196. });
  8197. Vue.version = '2.6.11';
  8198. /**
  8199. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8200. */
  8201. var ARRAYTYPE = '[object Array]';
  8202. var OBJECTTYPE = '[object Object]';
  8203. var NULLTYPE = '[object Null]';
  8204. var UNDEFINEDTYPE = '[object Undefined]';
  8205. // const FUNCTIONTYPE = '[object Function]'
  8206. function diff(current, pre) {
  8207. var result = {};
  8208. syncKeys(current, pre);
  8209. _diff(current, pre, '', result);
  8210. return result
  8211. }
  8212. function syncKeys(current, pre) {
  8213. if (current === pre) { return }
  8214. var rootCurrentType = type(current);
  8215. var rootPreType = type(pre);
  8216. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8217. if(Object.keys(current).length >= Object.keys(pre).length){
  8218. for (var key in pre) {
  8219. var currentValue = current[key];
  8220. if (currentValue === undefined) {
  8221. current[key] = null;
  8222. } else {
  8223. syncKeys(currentValue, pre[key]);
  8224. }
  8225. }
  8226. }
  8227. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8228. if (current.length >= pre.length) {
  8229. pre.forEach(function (item, index) {
  8230. syncKeys(current[index], item);
  8231. });
  8232. }
  8233. }
  8234. }
  8235. function nullOrUndefined(currentType, preType) {
  8236. if(
  8237. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8238. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8239. ) {
  8240. return false
  8241. }
  8242. return true
  8243. }
  8244. function _diff(current, pre, path, result) {
  8245. if (current === pre) { return }
  8246. var rootCurrentType = type(current);
  8247. var rootPreType = type(pre);
  8248. if (rootCurrentType == OBJECTTYPE) {
  8249. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8250. setResult(result, path, current);
  8251. } else {
  8252. var loop = function ( key ) {
  8253. var currentValue = current[key];
  8254. var preValue = pre[key];
  8255. var currentType = type(currentValue);
  8256. var preType = type(preValue);
  8257. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8258. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8259. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8260. }
  8261. } else if (currentType == ARRAYTYPE) {
  8262. if (preType != ARRAYTYPE) {
  8263. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8264. } else {
  8265. if (currentValue.length < preValue.length) {
  8266. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8267. } else {
  8268. currentValue.forEach(function (item, index) {
  8269. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8270. });
  8271. }
  8272. }
  8273. } else if (currentType == OBJECTTYPE) {
  8274. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8275. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8276. } else {
  8277. for (var subKey in currentValue) {
  8278. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8279. }
  8280. }
  8281. }
  8282. };
  8283. for (var key in current) loop( key );
  8284. }
  8285. } else if (rootCurrentType == ARRAYTYPE) {
  8286. if (rootPreType != ARRAYTYPE) {
  8287. setResult(result, path, current);
  8288. } else {
  8289. if (current.length < pre.length) {
  8290. setResult(result, path, current);
  8291. } else {
  8292. current.forEach(function (item, index) {
  8293. _diff(item, pre[index], path + '[' + index + ']', result);
  8294. });
  8295. }
  8296. }
  8297. } else {
  8298. setResult(result, path, current);
  8299. }
  8300. }
  8301. function setResult(result, k, v) {
  8302. // if (type(v) != FUNCTIONTYPE) {
  8303. result[k] = v;
  8304. // }
  8305. }
  8306. function type(obj) {
  8307. return Object.prototype.toString.call(obj)
  8308. }
  8309. /* */
  8310. function flushCallbacks$1(vm) {
  8311. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8312. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8313. var mpInstance = vm.$scope;
  8314. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8315. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8316. }
  8317. var copies = vm.__next_tick_callbacks.slice(0);
  8318. vm.__next_tick_callbacks.length = 0;
  8319. for (var i = 0; i < copies.length; i++) {
  8320. copies[i]();
  8321. }
  8322. }
  8323. }
  8324. function hasRenderWatcher(vm) {
  8325. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8326. }
  8327. function nextTick$1(vm, cb) {
  8328. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8329. //2.nextTick 之前存在 render watcher
  8330. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8331. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8332. var mpInstance = vm.$scope;
  8333. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8334. ']:nextVueTick');
  8335. }
  8336. return nextTick(cb, vm)
  8337. }else{
  8338. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8339. var mpInstance$1 = vm.$scope;
  8340. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8341. ']:nextMPTick');
  8342. }
  8343. }
  8344. var _resolve;
  8345. if (!vm.__next_tick_callbacks) {
  8346. vm.__next_tick_callbacks = [];
  8347. }
  8348. vm.__next_tick_callbacks.push(function () {
  8349. if (cb) {
  8350. try {
  8351. cb.call(vm);
  8352. } catch (e) {
  8353. handleError(e, vm, 'nextTick');
  8354. }
  8355. } else if (_resolve) {
  8356. _resolve(vm);
  8357. }
  8358. });
  8359. // $flow-disable-line
  8360. if (!cb && typeof Promise !== 'undefined') {
  8361. return new Promise(function (resolve) {
  8362. _resolve = resolve;
  8363. })
  8364. }
  8365. }
  8366. /* */
  8367. function clearInstance(key, value) {
  8368. // 简易去除 Vue 和小程序组件实例
  8369. if (value) {
  8370. if (value._isVue || value.__v_isMPComponent) {
  8371. return {}
  8372. }
  8373. }
  8374. return value
  8375. }
  8376. function cloneWithData(vm) {
  8377. // 确保当前 vm 所有数据被同步
  8378. var ret = Object.create(null);
  8379. var dataKeys = [].concat(
  8380. Object.keys(vm._data || {}),
  8381. Object.keys(vm._computedWatchers || {}));
  8382. dataKeys.reduce(function(ret, key) {
  8383. ret[key] = vm[key];
  8384. return ret
  8385. }, ret);
  8386. // vue-composition-api
  8387. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8388. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8389. if (rawBindings) {
  8390. Object.keys(rawBindings).forEach(function (key) {
  8391. ret[key] = vm[key];
  8392. });
  8393. }
  8394. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8395. Object.assign(ret, vm.$mp.data || {});
  8396. if (
  8397. Array.isArray(vm.$options.behaviors) &&
  8398. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8399. ) { //form-field
  8400. ret['name'] = vm.name;
  8401. ret['value'] = vm.value;
  8402. }
  8403. return JSON.parse(JSON.stringify(ret, clearInstance))
  8404. }
  8405. var patch = function(oldVnode, vnode) {
  8406. var this$1 = this;
  8407. if (vnode === null) { //destroy
  8408. return
  8409. }
  8410. if (this.mpType === 'page' || this.mpType === 'component') {
  8411. var mpInstance = this.$scope;
  8412. var data = Object.create(null);
  8413. try {
  8414. data = cloneWithData(this);
  8415. } catch (err) {
  8416. console.error(err);
  8417. }
  8418. data.__webviewId__ = mpInstance.data.__webviewId__;
  8419. var mpData = Object.create(null);
  8420. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8421. mpData[key] = mpInstance.data[key];
  8422. });
  8423. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8424. if (Object.keys(diffData).length) {
  8425. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx-app-new","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8426. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8427. ']差量更新',
  8428. JSON.stringify(diffData));
  8429. }
  8430. this.__next_tick_pending = true;
  8431. mpInstance.setData(diffData, function () {
  8432. this$1.__next_tick_pending = false;
  8433. flushCallbacks$1(this$1);
  8434. });
  8435. } else {
  8436. flushCallbacks$1(this);
  8437. }
  8438. }
  8439. };
  8440. /* */
  8441. function createEmptyRender() {
  8442. }
  8443. function mountComponent$1(
  8444. vm,
  8445. el,
  8446. hydrating
  8447. ) {
  8448. if (!vm.mpType) {//main.js 中的 new Vue
  8449. return vm
  8450. }
  8451. if (vm.mpType === 'app') {
  8452. vm.$options.render = createEmptyRender;
  8453. }
  8454. if (!vm.$options.render) {
  8455. vm.$options.render = createEmptyRender;
  8456. if (true) {
  8457. /* istanbul ignore if */
  8458. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8459. vm.$options.el || el) {
  8460. warn(
  8461. 'You are using the runtime-only build of Vue where the template ' +
  8462. 'compiler is not available. Either pre-compile the templates into ' +
  8463. 'render functions, or use the compiler-included build.',
  8464. vm
  8465. );
  8466. } else {
  8467. warn(
  8468. 'Failed to mount component: template or render function not defined.',
  8469. vm
  8470. );
  8471. }
  8472. }
  8473. }
  8474. !vm._$fallback && callHook(vm, 'beforeMount');
  8475. var updateComponent = function () {
  8476. vm._update(vm._render(), hydrating);
  8477. };
  8478. // we set this to vm._watcher inside the watcher's constructor
  8479. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8480. // component's mounted hook), which relies on vm._watcher being already defined
  8481. new Watcher(vm, updateComponent, noop, {
  8482. before: function before() {
  8483. if (vm._isMounted && !vm._isDestroyed) {
  8484. callHook(vm, 'beforeUpdate');
  8485. }
  8486. }
  8487. }, true /* isRenderWatcher */);
  8488. hydrating = false;
  8489. return vm
  8490. }
  8491. /* */
  8492. function renderClass (
  8493. staticClass,
  8494. dynamicClass
  8495. ) {
  8496. if (isDef(staticClass) || isDef(dynamicClass)) {
  8497. return concat(staticClass, stringifyClass(dynamicClass))
  8498. }
  8499. /* istanbul ignore next */
  8500. return ''
  8501. }
  8502. function concat (a, b) {
  8503. return a ? b ? (a + ' ' + b) : a : (b || '')
  8504. }
  8505. function stringifyClass (value) {
  8506. if (Array.isArray(value)) {
  8507. return stringifyArray(value)
  8508. }
  8509. if (isObject(value)) {
  8510. return stringifyObject(value)
  8511. }
  8512. if (typeof value === 'string') {
  8513. return value
  8514. }
  8515. /* istanbul ignore next */
  8516. return ''
  8517. }
  8518. function stringifyArray (value) {
  8519. var res = '';
  8520. var stringified;
  8521. for (var i = 0, l = value.length; i < l; i++) {
  8522. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8523. if (res) { res += ' '; }
  8524. res += stringified;
  8525. }
  8526. }
  8527. return res
  8528. }
  8529. function stringifyObject (value) {
  8530. var res = '';
  8531. for (var key in value) {
  8532. if (value[key]) {
  8533. if (res) { res += ' '; }
  8534. res += key;
  8535. }
  8536. }
  8537. return res
  8538. }
  8539. /* */
  8540. var parseStyleText = cached(function (cssText) {
  8541. var res = {};
  8542. var listDelimiter = /;(?![^(]*\))/g;
  8543. var propertyDelimiter = /:(.+)/;
  8544. cssText.split(listDelimiter).forEach(function (item) {
  8545. if (item) {
  8546. var tmp = item.split(propertyDelimiter);
  8547. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8548. }
  8549. });
  8550. return res
  8551. });
  8552. // normalize possible array / string values into Object
  8553. function normalizeStyleBinding (bindingStyle) {
  8554. if (Array.isArray(bindingStyle)) {
  8555. return toObject(bindingStyle)
  8556. }
  8557. if (typeof bindingStyle === 'string') {
  8558. return parseStyleText(bindingStyle)
  8559. }
  8560. return bindingStyle
  8561. }
  8562. /* */
  8563. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8564. function getTarget(obj, path) {
  8565. var parts = path.split('.');
  8566. var key = parts[0];
  8567. if (key.indexOf('__$n') === 0) { //number index
  8568. key = parseInt(key.replace('__$n', ''));
  8569. }
  8570. if (parts.length === 1) {
  8571. return obj[key]
  8572. }
  8573. return getTarget(obj[key], parts.slice(1).join('.'))
  8574. }
  8575. function internalMixin(Vue) {
  8576. Vue.config.errorHandler = function(err, vm, info) {
  8577. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8578. console.error(err);
  8579. /* eslint-disable no-undef */
  8580. var app = typeof getApp === 'function' && getApp();
  8581. if (app && app.onError) {
  8582. app.onError(err);
  8583. }
  8584. };
  8585. var oldEmit = Vue.prototype.$emit;
  8586. Vue.prototype.$emit = function(event) {
  8587. if (this.$scope && event) {
  8588. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8589. if (triggerEvent) {
  8590. try {
  8591. triggerEvent.call(this.$scope, event, {
  8592. __args__: toArray(arguments, 1)
  8593. });
  8594. } catch (error) {
  8595. }
  8596. }
  8597. }
  8598. return oldEmit.apply(this, arguments)
  8599. };
  8600. Vue.prototype.$nextTick = function(fn) {
  8601. return nextTick$1(this, fn)
  8602. };
  8603. MP_METHODS.forEach(function (method) {
  8604. Vue.prototype[method] = function(args) {
  8605. if (this.$scope && this.$scope[method]) {
  8606. return this.$scope[method](args)
  8607. }
  8608. // mp-alipay
  8609. if (typeof my === 'undefined') {
  8610. return
  8611. }
  8612. if (method === 'createSelectorQuery') {
  8613. /* eslint-disable no-undef */
  8614. return my.createSelectorQuery(args)
  8615. } else if (method === 'createIntersectionObserver') {
  8616. /* eslint-disable no-undef */
  8617. return my.createIntersectionObserver(args)
  8618. }
  8619. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8620. };
  8621. });
  8622. Vue.prototype.__init_provide = initProvide;
  8623. Vue.prototype.__init_injections = initInjections;
  8624. Vue.prototype.__call_hook = function(hook, args) {
  8625. var vm = this;
  8626. // #7573 disable dep collection when invoking lifecycle hooks
  8627. pushTarget();
  8628. var handlers = vm.$options[hook];
  8629. var info = hook + " hook";
  8630. var ret;
  8631. if (handlers) {
  8632. for (var i = 0, j = handlers.length; i < j; i++) {
  8633. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8634. }
  8635. }
  8636. if (vm._hasHookEvent) {
  8637. vm.$emit('hook:' + hook, args);
  8638. }
  8639. popTarget();
  8640. return ret
  8641. };
  8642. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8643. if (Array.isArray(modifiers)) {
  8644. if (modifiers.indexOf('trim') !== -1) {
  8645. value = value.trim();
  8646. }
  8647. if (modifiers.indexOf('number') !== -1) {
  8648. value = this._n(value);
  8649. }
  8650. }
  8651. if (!target) {
  8652. target = this;
  8653. }
  8654. // 解决动态属性添加
  8655. Vue.set(target, key, value);
  8656. };
  8657. Vue.prototype.__set_sync = function(target, key, value) {
  8658. if (!target) {
  8659. target = this;
  8660. }
  8661. // 解决动态属性添加
  8662. Vue.set(target, key, value);
  8663. };
  8664. Vue.prototype.__get_orig = function(item) {
  8665. if (isPlainObject(item)) {
  8666. return item['$orig'] || item
  8667. }
  8668. return item
  8669. };
  8670. Vue.prototype.__get_value = function(dataPath, target) {
  8671. return getTarget(target || this, dataPath)
  8672. };
  8673. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8674. return renderClass(staticClass, dynamicClass)
  8675. };
  8676. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8677. if (!dynamicStyle && !staticStyle) {
  8678. return ''
  8679. }
  8680. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8681. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8682. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8683. };
  8684. Vue.prototype.__map = function(val, iteratee) {
  8685. //TODO 暂不考虑 string
  8686. var ret, i, l, keys, key;
  8687. if (Array.isArray(val)) {
  8688. ret = new Array(val.length);
  8689. for (i = 0, l = val.length; i < l; i++) {
  8690. ret[i] = iteratee(val[i], i);
  8691. }
  8692. return ret
  8693. } else if (isObject(val)) {
  8694. keys = Object.keys(val);
  8695. ret = Object.create(null);
  8696. for (i = 0, l = keys.length; i < l; i++) {
  8697. key = keys[i];
  8698. ret[key] = iteratee(val[key], key, i);
  8699. }
  8700. return ret
  8701. } else if (typeof val === 'number') {
  8702. ret = new Array(val);
  8703. for (i = 0, l = val; i < l; i++) {
  8704. // 第一个参数暂时仍和小程序一致
  8705. ret[i] = iteratee(i, i);
  8706. }
  8707. return ret
  8708. }
  8709. return []
  8710. };
  8711. }
  8712. /* */
  8713. var LIFECYCLE_HOOKS$1 = [
  8714. //App
  8715. 'onLaunch',
  8716. 'onShow',
  8717. 'onHide',
  8718. 'onUniNViewMessage',
  8719. 'onPageNotFound',
  8720. 'onThemeChange',
  8721. 'onError',
  8722. 'onUnhandledRejection',
  8723. //Page
  8724. 'onInit',
  8725. 'onLoad',
  8726. // 'onShow',
  8727. 'onReady',
  8728. // 'onHide',
  8729. 'onUnload',
  8730. 'onPullDownRefresh',
  8731. 'onReachBottom',
  8732. 'onTabItemTap',
  8733. 'onAddToFavorites',
  8734. 'onShareTimeline',
  8735. 'onShareAppMessage',
  8736. 'onResize',
  8737. 'onPageScroll',
  8738. 'onNavigationBarButtonTap',
  8739. 'onBackPress',
  8740. 'onNavigationBarSearchInputChanged',
  8741. 'onNavigationBarSearchInputConfirmed',
  8742. 'onNavigationBarSearchInputClicked',
  8743. //Component
  8744. // 'onReady', // 兼容旧版本,应该移除该事件
  8745. 'onPageShow',
  8746. 'onPageHide',
  8747. 'onPageResize',
  8748. 'onUploadDouyinVideo'
  8749. ];
  8750. function lifecycleMixin$1(Vue) {
  8751. //fixed vue-class-component
  8752. var oldExtend = Vue.extend;
  8753. Vue.extend = function(extendOptions) {
  8754. extendOptions = extendOptions || {};
  8755. var methods = extendOptions.methods;
  8756. if (methods) {
  8757. Object.keys(methods).forEach(function (methodName) {
  8758. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8759. extendOptions[methodName] = methods[methodName];
  8760. delete methods[methodName];
  8761. }
  8762. });
  8763. }
  8764. return oldExtend.call(this, extendOptions)
  8765. };
  8766. var strategies = Vue.config.optionMergeStrategies;
  8767. var mergeHook = strategies.created;
  8768. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8769. strategies[hook] = mergeHook;
  8770. });
  8771. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8772. }
  8773. /* */
  8774. // install platform patch function
  8775. Vue.prototype.__patch__ = patch;
  8776. // public mount method
  8777. Vue.prototype.$mount = function(
  8778. el ,
  8779. hydrating
  8780. ) {
  8781. return mountComponent$1(this, el, hydrating)
  8782. };
  8783. lifecycleMixin$1(Vue);
  8784. internalMixin(Vue);
  8785. /* */
  8786. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8787. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8788. /***/ }),
  8789. /* 26 */
  8790. /*!*******************************************************!*\
  8791. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json ***!
  8792. \*******************************************************/
  8793. /*! no static exports found */
  8794. /***/ (function(module, exports) {
  8795. /***/ }),
  8796. /* 27 */,
  8797. /* 28 */,
  8798. /* 29 */,
  8799. /* 30 */,
  8800. /* 31 */,
  8801. /* 32 */
  8802. /*!**********************************************************************************************************!*\
  8803. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8804. \**********************************************************************************************************/
  8805. /*! exports provided: default */
  8806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8807. "use strict";
  8808. __webpack_require__.r(__webpack_exports__);
  8809. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8810. /* globals __VUE_SSR_CONTEXT__ */
  8811. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8812. // This module is a runtime utility for cleaner component module output and will
  8813. // be included in the final webpack user bundle.
  8814. function normalizeComponent (
  8815. scriptExports,
  8816. render,
  8817. staticRenderFns,
  8818. functionalTemplate,
  8819. injectStyles,
  8820. scopeId,
  8821. moduleIdentifier, /* server only */
  8822. shadowMode, /* vue-cli only */
  8823. components, // fixed by xxxxxx auto components
  8824. renderjs // fixed by xxxxxx renderjs
  8825. ) {
  8826. // Vue.extend constructor export interop
  8827. var options = typeof scriptExports === 'function'
  8828. ? scriptExports.options
  8829. : scriptExports
  8830. // fixed by xxxxxx auto components
  8831. if (components) {
  8832. if (!options.components) {
  8833. options.components = {}
  8834. }
  8835. var hasOwn = Object.prototype.hasOwnProperty
  8836. for (var name in components) {
  8837. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8838. options.components[name] = components[name]
  8839. }
  8840. }
  8841. }
  8842. // fixed by xxxxxx renderjs
  8843. if (renderjs) {
  8844. if(typeof renderjs.beforeCreate === 'function'){
  8845. renderjs.beforeCreate = [renderjs.beforeCreate]
  8846. }
  8847. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8848. this[renderjs.__module] = this
  8849. });
  8850. (options.mixins || (options.mixins = [])).push(renderjs)
  8851. }
  8852. // render functions
  8853. if (render) {
  8854. options.render = render
  8855. options.staticRenderFns = staticRenderFns
  8856. options._compiled = true
  8857. }
  8858. // functional template
  8859. if (functionalTemplate) {
  8860. options.functional = true
  8861. }
  8862. // scopedId
  8863. if (scopeId) {
  8864. options._scopeId = 'data-v-' + scopeId
  8865. }
  8866. var hook
  8867. if (moduleIdentifier) { // server build
  8868. hook = function (context) {
  8869. // 2.3 injection
  8870. context =
  8871. context || // cached call
  8872. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8873. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8874. // 2.2 with runInNewContext: true
  8875. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8876. context = __VUE_SSR_CONTEXT__
  8877. }
  8878. // inject component styles
  8879. if (injectStyles) {
  8880. injectStyles.call(this, context)
  8881. }
  8882. // register component module identifier for async chunk inferrence
  8883. if (context && context._registeredComponents) {
  8884. context._registeredComponents.add(moduleIdentifier)
  8885. }
  8886. }
  8887. // used by ssr in case component is cached and beforeCreate
  8888. // never gets called
  8889. options._ssrRegister = hook
  8890. } else if (injectStyles) {
  8891. hook = shadowMode
  8892. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8893. : injectStyles
  8894. }
  8895. if (hook) {
  8896. if (options.functional) {
  8897. // for template-only hot-reload because in that case the render fn doesn't
  8898. // go through the normalizer
  8899. options._injectStyles = hook
  8900. // register for functioal component in vue file
  8901. var originalRender = options.render
  8902. options.render = function renderWithStyleInjection (h, context) {
  8903. hook.call(context)
  8904. return originalRender(h, context)
  8905. }
  8906. } else {
  8907. // inject component registration as beforeCreate hook
  8908. var existing = options.beforeCreate
  8909. options.beforeCreate = existing
  8910. ? [].concat(existing, hook)
  8911. : [hook]
  8912. }
  8913. }
  8914. return {
  8915. exports: scriptExports,
  8916. options: options
  8917. }
  8918. }
  8919. /***/ }),
  8920. /* 33 */,
  8921. /* 34 */,
  8922. /* 35 */,
  8923. /* 36 */,
  8924. /* 37 */,
  8925. /* 38 */,
  8926. /* 39 */
  8927. /*!***********************************************************!*\
  8928. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/https.js ***!
  8929. \***********************************************************/
  8930. /*! no static exports found */
  8931. /***/ (function(module, exports, __webpack_require__) {
  8932. "use strict";
  8933. /* WEBPACK VAR INJECTION */(function(wx, uni) {
  8934. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  8935. Object.defineProperty(exports, "__esModule", {
  8936. value: true
  8937. });
  8938. exports.default = void 0;
  8939. var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 40));
  8940. // 区分开发环境和生产环境 接口地址
  8941. var baseUrl = _config.default.baseUrl;
  8942. // let baseUrl = 'http://60.191.110.205:19099/';
  8943. // let baseUrl = 'https://ksfdc.zjugis.com:19099/';
  8944. function https(config) {
  8945. //显示loading
  8946. wx.showLoading({
  8947. title: '正在请求中'
  8948. });
  8949. //设置请求头
  8950. if (!config.header) {
  8951. config.header = {};
  8952. }
  8953. if (!config.header['content-type']) {
  8954. config.header['content-type'] = 'application/json';
  8955. }
  8956. config.url = baseUrl + config.url; // 请求地址
  8957. var promise = new Promise(function (resolve, reject) {
  8958. uni.request(config).then(function (res) {
  8959. wx.hideLoading(); //隐藏loading
  8960. if (res[0]) {
  8961. uni.showToast({
  8962. title: "数据获取失败",
  8963. icon: "none",
  8964. duration: 1500
  8965. });
  8966. reject(false);
  8967. } else {
  8968. var data = res[1].data;
  8969. if (data.code == 1) {
  8970. resolve(data);
  8971. } else {
  8972. resolve(data);
  8973. }
  8974. }
  8975. }).catch(function (error) {
  8976. wx.hideLoading(); //隐藏loading
  8977. reject(error);
  8978. });
  8979. });
  8980. return promise;
  8981. }
  8982. var _default = https;
  8983. exports.default = _default;
  8984. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  8985. /***/ }),
  8986. /* 40 */
  8987. /*!************************************************************!*\
  8988. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/config.js ***!
  8989. \************************************************************/
  8990. /*! no static exports found */
  8991. /***/ (function(module, exports, __webpack_require__) {
  8992. "use strict";
  8993. Object.defineProperty(exports, "__esModule", {
  8994. value: true
  8995. });
  8996. exports.default = void 0;
  8997. var config = {
  8998. //发布线上需要吧login里面地址跟这里替换掉
  8999. // baseUrl: "http://10.10.9.71:7089/ysgzybz/",
  9000. // webViewUrl: "http://10.10.9.58:8083/#/",
  9001. baseUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/ybz-api/",
  9002. webViewUrl: "https://zlzd.zrzyt.zj.gov.cn/app215/wxin-view/#/",
  9003. bjdkgl: 'https://zlzd.zrzyt.zj.gov.cn/geoserver/sde'
  9004. };
  9005. var _default = config;
  9006. exports.default = _default;
  9007. /***/ }),
  9008. /* 41 */,
  9009. /* 42 */,
  9010. /* 43 */,
  9011. /* 44 */,
  9012. /* 45 */,
  9013. /* 46 */,
  9014. /* 47 */,
  9015. /* 48 */,
  9016. /* 49 */,
  9017. /* 50 */,
  9018. /* 51 */,
  9019. /* 52 */,
  9020. /* 53 */,
  9021. /* 54 */,
  9022. /* 55 */,
  9023. /* 56 */,
  9024. /* 57 */
  9025. /*!*******************************************************************!*\
  9026. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/mixins/CustomMixins.js ***!
  9027. \*******************************************************************/
  9028. /*! no static exports found */
  9029. /***/ (function(module, exports, __webpack_require__) {
  9030. "use strict";
  9031. /* WEBPACK VAR INJECTION */(function(wx) {
  9032. Object.defineProperty(exports, "__esModule", {
  9033. value: true
  9034. });
  9035. exports.default = void 0;
  9036. var _default = {
  9037. data: function data() {
  9038. return {
  9039. innerAudioContext: null,
  9040. address: ''
  9041. };
  9042. },
  9043. methods: {
  9044. getLocationInfoByLatLnt: function getLocationInfoByLatLnt(lat, lng) {
  9045. var that = this;
  9046. var locationInfoURL = "https://apis.map.qq.com/ws/geocoder/v1/?location=".concat(lat, ",").concat(lng, "&key=G4BBZ-YSMCJ-56AFX-KD4FQ-23RQZ-S7FX3");
  9047. wx.request({
  9048. url: locationInfoURL,
  9049. //仅为示例,并非真实的接口地址
  9050. success: function success(res) {
  9051. var resultData = res.data;
  9052. that.address = resultData['result'].address;
  9053. }
  9054. });
  9055. },
  9056. setTabBarIndex: function setTabBarIndex(index) {
  9057. if (typeof this.$scope.getTabBar === 'function' && this.$scope.getTabBar()) {
  9058. this.$scope.getTabBar().setData({
  9059. selected: index
  9060. });
  9061. }
  9062. },
  9063. getTimeFuns: function getTimeFuns(sTimeStr, eTimeStr) {
  9064. var sTime = new Date(sTimeStr);
  9065. var eTime = +new Date(eTimeStr); //返回的是用户输入时间总的毫秒数
  9066. var secondTime = (eTime - sTime) / 1000; //剩余时间总的秒数
  9067. var d = parseInt(secondTime / 60 / 60 / 24); //计算天数
  9068. var h = parseInt(secondTime / 60 / 60 % 24); //计算小时
  9069. var m = parseInt(secondTime / 60 % 60); //计算分
  9070. var s = parseInt(secondTime % 60); //计算当前秒数
  9071. return {
  9072. time: Math.abs(d) + '天' + Math.abs(h) + '时' + Math.abs(m) + '分',
  9073. time2: {
  9074. a: d,
  9075. b: h,
  9076. c: m
  9077. }
  9078. };
  9079. },
  9080. //播放语音
  9081. createAudio: function createAudio(srcMic) {
  9082. if (this.innerAudioContext) return;
  9083. var that = this;
  9084. //创建内部 audio 上下文 InnerAudioContext 对象。
  9085. that.innerAudioContext = wx.createInnerAudioContext();
  9086. that.innerAudioContext.onError(function (error) {
  9087. console.error("自定义报错(checkedDetail 137行):" + error);
  9088. });
  9089. that.innerAudioContext.src = srcMic; //设置音频地址
  9090. },
  9091. //播放
  9092. audioPlay: function audioPlay(srcMic) {
  9093. this.createAudio(srcMic);
  9094. this.innerAudioContext.play(); //播放音频
  9095. return this.innerAudioContext;
  9096. },
  9097. // 停止播放
  9098. audioPause: function audioPause() {
  9099. if (!this.innerAudioContext) return;
  9100. this.innerAudioContext.pause(); //播放音频
  9101. }
  9102. }
  9103. };
  9104. exports.default = _default;
  9105. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9106. /***/ }),
  9107. /* 58 */
  9108. /*!***********************************************************************!*\
  9109. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/formData.js ***!
  9110. \***********************************************************************/
  9111. /*! no static exports found */
  9112. /***/ (function(module, exports, __webpack_require__) {
  9113. /* WEBPACK VAR INJECTION */(function(wx) {var _toConsumableArray = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18);
  9114. var mimeMap = __webpack_require__(/*! ./mimeMap.js */ 59);
  9115. function FormData() {
  9116. var fileManager = wx.getFileSystemManager();
  9117. var data = {};
  9118. var files = [];
  9119. this.append = function (name, value) {
  9120. data[name] = value;
  9121. return true;
  9122. };
  9123. this.appendFile = function (name, path, fileName) {
  9124. var buffer = fileManager.readFileSync(path);
  9125. if (Object.prototype.toString.call(buffer).indexOf("ArrayBuffer") < 0) {
  9126. return false;
  9127. }
  9128. if (!fileName) {
  9129. fileName = getFileNameFromPath(path);
  9130. }
  9131. files.push({
  9132. name: name,
  9133. buffer: buffer,
  9134. fileName: fileName
  9135. });
  9136. return true;
  9137. };
  9138. this.getData = function () {
  9139. return convert(data, files);
  9140. };
  9141. }
  9142. function getFileNameFromPath(path) {
  9143. var idx = path.lastIndexOf("/");
  9144. return path.substr(idx + 1);
  9145. }
  9146. function convert(data, files) {
  9147. var boundaryKey = 'wxmpFormBoundary' + randString(); // 数据分割符,一般是随机的字符串
  9148. var boundary = '--' + boundaryKey;
  9149. var endBoundary = boundary + '--';
  9150. var postArray = [];
  9151. //拼接参数
  9152. if (data && Object.prototype.toString.call(data) == "[object Object]") {
  9153. for (var key in data) {
  9154. postArray = postArray.concat(formDataArray(boundary, key, data[key]));
  9155. }
  9156. }
  9157. //拼接文件
  9158. if (files && Object.prototype.toString.call(files) == "[object Array]") {
  9159. for (var i in files) {
  9160. var file = files[i];
  9161. postArray = postArray.concat(formDataArray(boundary, file.name, file.buffer, file.fileName));
  9162. }
  9163. }
  9164. //结尾
  9165. var endBoundaryArray = [];
  9166. endBoundaryArray.push.apply(endBoundaryArray, _toConsumableArray(endBoundary.toUtf8Bytes()));
  9167. postArray = postArray.concat(endBoundaryArray);
  9168. return {
  9169. contentType: 'multipart/form-data; boundary=' + boundaryKey,
  9170. buffer: new Uint8Array(postArray).buffer
  9171. };
  9172. }
  9173. function randString() {
  9174. var res = "";
  9175. for (var i = 0; i < 17; i++) {
  9176. var n = parseInt(Math.random() * 62);
  9177. if (n <= 9) {
  9178. res += n;
  9179. } else if (n <= 35) {
  9180. res += String.fromCharCode(n + 55);
  9181. } else {
  9182. res += String.fromCharCode(n + 61);
  9183. }
  9184. }
  9185. return res;
  9186. }
  9187. function formDataArray(boundary, name, value, fileName) {
  9188. var _dataArray, _dataArray2, _dataArray3;
  9189. var dataString = '';
  9190. var isFile = !!fileName;
  9191. dataString += boundary + '\r\n';
  9192. dataString += 'Content-Disposition: form-data; name="' + name + '"';
  9193. if (isFile) {
  9194. dataString += '; filename="' + fileName + '"' + '\r\n';
  9195. dataString += 'Content-Type: ' + getFileMime(fileName) + '\r\n\r\n';
  9196. } else {
  9197. dataString += '\r\n\r\n';
  9198. dataString += value;
  9199. }
  9200. var dataArray = [];
  9201. (_dataArray = dataArray).push.apply(_dataArray, _toConsumableArray(dataString.toUtf8Bytes()));
  9202. if (isFile) {
  9203. var fileArray = new Uint8Array(value);
  9204. dataArray = dataArray.concat(Array.prototype.slice.call(fileArray));
  9205. }
  9206. (_dataArray2 = dataArray).push.apply(_dataArray2, _toConsumableArray("\r".toUtf8Bytes()));
  9207. (_dataArray3 = dataArray).push.apply(_dataArray3, _toConsumableArray("\n".toUtf8Bytes()));
  9208. return dataArray;
  9209. }
  9210. function getFileMime(fileName) {
  9211. var idx = fileName.lastIndexOf(".");
  9212. var mime = mimeMap[fileName.substr(idx)];
  9213. return mime ? mime : "application/octet-stream";
  9214. }
  9215. String.prototype.toUtf8Bytes = function () {
  9216. var str = this;
  9217. var bytes = [];
  9218. for (var i = 0; i < str.length; i++) {
  9219. bytes.push.apply(bytes, _toConsumableArray(str.utf8CodeAt(i)));
  9220. if (str.codePointAt(i) > 0xffff) {
  9221. i++;
  9222. }
  9223. }
  9224. return bytes;
  9225. };
  9226. String.prototype.utf8CodeAt = function (i) {
  9227. var str = this;
  9228. var out = [],
  9229. p = 0;
  9230. var c = str.charCodeAt(i);
  9231. if (c < 128) {
  9232. out[p++] = c;
  9233. } else if (c < 2048) {
  9234. out[p++] = c >> 6 | 192;
  9235. out[p++] = c & 63 | 128;
  9236. } else if ((c & 0xFC00) == 0xD800 && i + 1 < str.length && (str.charCodeAt(i + 1) & 0xFC00) == 0xDC00) {
  9237. // Surrogate Pair
  9238. c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF);
  9239. out[p++] = c >> 18 | 240;
  9240. out[p++] = c >> 12 & 63 | 128;
  9241. out[p++] = c >> 6 & 63 | 128;
  9242. out[p++] = c & 63 | 128;
  9243. } else {
  9244. out[p++] = c >> 12 | 224;
  9245. out[p++] = c >> 6 & 63 | 128;
  9246. out[p++] = c & 63 | 128;
  9247. }
  9248. return out;
  9249. };
  9250. module.exports = FormData;
  9251. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9252. /***/ }),
  9253. /* 59 */
  9254. /*!**********************************************************************!*\
  9255. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/utils/formData/mimeMap.js ***!
  9256. \**********************************************************************/
  9257. /*! no static exports found */
  9258. /***/ (function(module, exports, __webpack_require__) {
  9259. var _defineProperty = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11);
  9260. var _module$exports;
  9261. module.exports = (_module$exports = {
  9262. "0.001": "application/x-001",
  9263. "0.323": "text/h323",
  9264. "0.907": "drawing/907",
  9265. ".acp": "audio/x-mei-aac",
  9266. ".aif": "audio/aiff",
  9267. ".aiff": "audio/aiff",
  9268. ".asa": "text/asa",
  9269. ".asp": "text/asp",
  9270. ".au": "audio/basic",
  9271. ".awf": "application/vnd.adobe.workflow",
  9272. ".bmp": "application/x-bmp",
  9273. ".c4t": "application/x-c4t",
  9274. ".cal": "application/x-cals",
  9275. ".cdf": "application/x-netcdf",
  9276. ".cel": "application/x-cel",
  9277. ".cg4": "application/x-g4",
  9278. ".cit": "application/x-cit",
  9279. ".cml": "text/xml",
  9280. ".cmx": "application/x-cmx",
  9281. ".crl": "application/pkix-crl",
  9282. ".csi": "application/x-csi",
  9283. ".cut": "application/x-cut",
  9284. ".dbm": "application/x-dbm",
  9285. ".dcd": "text/xml",
  9286. ".der": "application/x-x509-ca-cert",
  9287. ".dib": "application/x-dib",
  9288. ".doc": "application/msword",
  9289. ".drw": "application/x-drw",
  9290. ".dwf": "Model/vnd.dwf",
  9291. ".dwg": "application/x-dwg",
  9292. ".dxf": "application/x-dxf",
  9293. ".emf": "application/x-emf",
  9294. ".ent": "text/xml",
  9295. ".eps": "application/x-ps",
  9296. ".etd": "application/x-ebx",
  9297. ".fax": "image/fax",
  9298. ".fif": "application/fractals",
  9299. ".frm": "application/x-frm",
  9300. ".gbr": "application/x-gbr",
  9301. ".gif": "image/gif",
  9302. ".gp4": "application/x-gp4",
  9303. ".hmr": "application/x-hmr",
  9304. ".hpl": "application/x-hpl",
  9305. ".hrf": "application/x-hrf",
  9306. ".htc": "text/x-component",
  9307. ".html": "text/html",
  9308. ".htx": "text/html",
  9309. ".ico": "image/x-icon",
  9310. ".iff": "application/x-iff",
  9311. ".igs": "application/x-igs",
  9312. ".img": "application/x-img",
  9313. ".isp": "application/x-internet-signup",
  9314. ".java": "java/*",
  9315. ".jpe": "image/jpeg",
  9316. ".jpeg": "image/jpeg",
  9317. ".jpg": "application/x-jpg",
  9318. ".jsp": "text/html",
  9319. ".lar": "application/x-laplayer-reg",
  9320. ".lavs": "audio/x-liquid-secure",
  9321. ".lmsff": "audio/x-la-lms",
  9322. ".ltr": "application/x-ltr",
  9323. ".m2v": "video/x-mpeg",
  9324. ".m4e": "video/mpeg4",
  9325. ".man": "application/x-troff-man",
  9326. ".mdb": "application/msaccess",
  9327. ".mfp": "application/x-shockwave-flash",
  9328. ".mhtml": "message/rfc822",
  9329. ".mid": "audio/mid",
  9330. ".mil": "application/x-mil",
  9331. ".mnd": "audio/x-musicnet-download",
  9332. ".mocha": "application/x-javascript",
  9333. ".mp1": "audio/mp1",
  9334. ".mp2v": "video/mpeg",
  9335. ".mp4": "video/mpeg4",
  9336. ".mpd": "application/vnd.ms-project",
  9337. ".mpeg": "video/mpg",
  9338. ".mpga": "audio/rn-mpeg",
  9339. ".mps": "video/x-mpeg",
  9340. ".mpv": "video/mpg",
  9341. ".mpw": "application/vnd.ms-project",
  9342. ".mtx": "text/xml",
  9343. ".net": "image/pnetvue",
  9344. ".nws": "message/rfc822",
  9345. ".out": "application/x-out",
  9346. ".p12": "application/x-pkcs12",
  9347. ".p7c": "application/pkcs7-mime",
  9348. ".p7r": "application/x-pkcs7-certreqresp",
  9349. ".pc5": "application/x-pc5",
  9350. ".pcl": "application/x-pcl",
  9351. ".pdf": "application/pdf",
  9352. ".pdx": "application/vnd.adobe.pdx",
  9353. ".pgl": "application/x-pgl",
  9354. ".pko": "application/vnd.ms-pki.pko",
  9355. ".plg": "text/html",
  9356. ".plt": "application/x-plt",
  9357. ".png": "application/x-png",
  9358. ".ppa": "application/vnd.ms-powerpoint",
  9359. ".pps": "application/vnd.ms-powerpoint",
  9360. ".ppt": "application/x-ppt",
  9361. ".prf": "application/pics-rules",
  9362. ".prt": "application/x-prt",
  9363. ".ps": "application/postscript",
  9364. ".pwz": "application/vnd.ms-powerpoint",
  9365. ".ra": "audio/vnd.rn-realaudio",
  9366. ".ras": "application/x-ras",
  9367. ".rdf": "text/xml",
  9368. ".red": "application/x-red",
  9369. ".rjs": "application/vnd.rn-realsystem-rjs",
  9370. ".rlc": "application/x-rlc",
  9371. ".rm": "application/vnd.rn-realmedia",
  9372. ".rmi": "audio/mid",
  9373. ".rmm": "audio/x-pn-realaudio",
  9374. ".rms": "application/vnd.rn-realmedia-secure",
  9375. ".rmx": "application/vnd.rn-realsystem-rmx",
  9376. ".rp": "image/vnd.rn-realpix",
  9377. ".rsml": "application/vnd.rn-rsml",
  9378. ".rtf": "application/msword",
  9379. ".rv": "video/vnd.rn-realvideo",
  9380. ".sat": "application/x-sat",
  9381. ".sdw": "application/x-sdw",
  9382. ".slb": "application/x-slb",
  9383. ".slk": "drawing/x-slk",
  9384. ".smil": "application/smil",
  9385. ".snd": "audio/basic",
  9386. ".sor": "text/plain",
  9387. ".spl": "application/futuresplash",
  9388. ".ssm": "application/streamingmedia",
  9389. ".stl": "application/vnd.ms-pki.stl",
  9390. ".sty": "application/x-sty",
  9391. ".swf": "application/x-shockwave-flash",
  9392. ".tg4": "application/x-tg4",
  9393. ".tif": "image/tiff",
  9394. ".tiff": "image/tiff",
  9395. ".top": "drawing/x-top",
  9396. ".tsd": "text/xml",
  9397. ".uin": "application/x-icq",
  9398. ".vcf": "text/x-vcard",
  9399. ".vdx": "application/vnd.visio",
  9400. ".vpg": "application/x-vpeg005",
  9401. ".vsd": "application/x-vsd",
  9402. ".vst": "application/vnd.visio",
  9403. ".vsw": "application/vnd.visio",
  9404. ".vtx": "application/vnd.visio",
  9405. ".wav": "audio/wav",
  9406. ".wb1": "application/x-wb1",
  9407. ".wb3": "application/x-wb3",
  9408. ".wiz": "application/msword",
  9409. ".wk4": "application/x-wk4",
  9410. ".wks": "application/x-wks",
  9411. ".wma": "audio/x-ms-wma",
  9412. ".wmf": "application/x-wmf",
  9413. ".wmv": "video/x-ms-wmv",
  9414. ".wmz": "application/x-ms-wmz",
  9415. ".wpd": "application/x-wpd",
  9416. ".wpl": "application/vnd.ms-wpl",
  9417. ".wr1": "application/x-wr1",
  9418. ".wrk": "application/x-wrk",
  9419. ".ws2": "application/x-ws",
  9420. ".wsdl": "text/xml",
  9421. ".xdp": "application/vnd.adobe.xdp",
  9422. ".xfd": "application/vnd.adobe.xfd",
  9423. ".xhtml": "text/html",
  9424. ".xls": "application/x-xls",
  9425. ".xml": "text/xml",
  9426. ".xq": "text/xml",
  9427. ".xquery": "text/xml",
  9428. ".xsl": "text/xml",
  9429. ".xwd": "application/x-xwd",
  9430. ".sis": "application/vnd.symbian.install",
  9431. ".x_t": "application/x-x_t",
  9432. ".apk": "application/vnd.android.package-archive",
  9433. "0.301": "application/x-301",
  9434. "0.906": "application/x-906",
  9435. ".a11": "application/x-a11",
  9436. ".ai": "application/postscript",
  9437. ".aifc": "audio/aiff",
  9438. ".anv": "application/x-anv",
  9439. ".asf": "video/x-ms-asf",
  9440. ".asx": "video/x-ms-asf",
  9441. ".avi": "video/avi",
  9442. ".biz": "text/xml",
  9443. ".bot": "application/x-bot",
  9444. ".c90": "application/x-c90",
  9445. ".cat": "application/vnd.ms-pki.seccat",
  9446. ".cdr": "application/x-cdr",
  9447. ".cer": "application/x-x509-ca-cert",
  9448. ".cgm": "application/x-cgm",
  9449. ".class": "java/*",
  9450. ".cmp": "application/x-cmp",
  9451. ".cot": "application/x-cot",
  9452. ".crt": "application/x-x509-ca-cert",
  9453. ".css": "text/css",
  9454. ".dbf": "application/x-dbf",
  9455. ".dbx": "application/x-dbx",
  9456. ".dcx": "application/x-dcx",
  9457. ".dgn": "application/x-dgn",
  9458. ".dll": "application/x-msdownload",
  9459. ".dot": "application/msword",
  9460. ".dtd": "text/xml"
  9461. }, _defineProperty(_module$exports, ".dwf", "application/x-dwf"), _defineProperty(_module$exports, ".dxb", "application/x-dxb"), _defineProperty(_module$exports, ".edn", "application/vnd.adobe.edn"), _defineProperty(_module$exports, ".eml", "message/rfc822"), _defineProperty(_module$exports, ".epi", "application/x-epi"), _defineProperty(_module$exports, ".eps", "application/postscript"), _defineProperty(_module$exports, ".exe", "application/x-msdownload"), _defineProperty(_module$exports, ".fdf", "application/vnd.fdf"), _defineProperty(_module$exports, ".fo", "text/xml"), _defineProperty(_module$exports, ".g4", "application/x-g4"), _defineProperty(_module$exports, ".tif", "image/tiff"), _defineProperty(_module$exports, ".gl2", "application/x-gl2"), _defineProperty(_module$exports, ".hgl", "application/x-hgl"), _defineProperty(_module$exports, ".hpg", "application/x-hpgl"), _defineProperty(_module$exports, ".hqx", "application/mac-binhex40"), _defineProperty(_module$exports, ".hta", "application/hta"), _defineProperty(_module$exports, ".htm", "text/html"), _defineProperty(_module$exports, ".htt", "text/webviewhtml"), _defineProperty(_module$exports, ".icb", "application/x-icb"), _defineProperty(_module$exports, ".ico", "application/x-ico"), _defineProperty(_module$exports, ".ig4", "application/x-g4"), _defineProperty(_module$exports, ".iii", "application/x-iphone"), _defineProperty(_module$exports, ".ins", "application/x-internet-signup"), _defineProperty(_module$exports, ".IVF", "video/x-ivf"), _defineProperty(_module$exports, ".jfif", "image/jpeg"), _defineProperty(_module$exports, ".jpe", "application/x-jpe"), _defineProperty(_module$exports, ".jpg", "image/jpeg"), _defineProperty(_module$exports, ".js", "application/x-javascript"), _defineProperty(_module$exports, ".la1", "audio/x-liquid-file"), _defineProperty(_module$exports, ".latex", "application/x-latex"), _defineProperty(_module$exports, ".lbm", "application/x-lbm"), _defineProperty(_module$exports, ".ls", "application/x-javascript"), _defineProperty(_module$exports, ".m1v", "video/x-mpeg"), _defineProperty(_module$exports, ".m3u", "audio/mpegurl"), _defineProperty(_module$exports, ".mac", "application/x-mac"), _defineProperty(_module$exports, ".math", "text/xml"), _defineProperty(_module$exports, ".mdb", "application/x-mdb"), _defineProperty(_module$exports, ".mht", "message/rfc822"), _defineProperty(_module$exports, ".mi", "application/x-mi"), _defineProperty(_module$exports, ".midi", "audio/mid"), _defineProperty(_module$exports, ".mml", "text/xml"), _defineProperty(_module$exports, ".mns", "audio/x-musicnet-stream"), _defineProperty(_module$exports, ".movie", "video/x-sgi-movie"), _defineProperty(_module$exports, ".mp2", "audio/mp2"), _defineProperty(_module$exports, ".mp3", "audio/mp3"), _defineProperty(_module$exports, ".mpa", "video/x-mpg"), _defineProperty(_module$exports, ".mpe", "video/x-mpeg"), _defineProperty(_module$exports, ".mpg", "video/mpg"), _defineProperty(_module$exports, ".mpp", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mpt", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mpv2", "video/mpeg"), _defineProperty(_module$exports, ".mpx", "application/vnd.ms-project"), _defineProperty(_module$exports, ".mxp", "application/x-mmxp"), _defineProperty(_module$exports, ".nrf", "application/x-nrf"), _defineProperty(_module$exports, ".odc", "text/x-ms-odc"), _defineProperty(_module$exports, ".p10", "application/pkcs10"), _defineProperty(_module$exports, ".p7b", "application/x-pkcs7-certificates"), _defineProperty(_module$exports, ".p7m", "application/pkcs7-mime"), _defineProperty(_module$exports, ".p7s", "application/pkcs7-signature"), _defineProperty(_module$exports, ".pci", "application/x-pci"), _defineProperty(_module$exports, ".pcx", "application/x-pcx"), _defineProperty(_module$exports, ".pdf", "application/pdf"), _defineProperty(_module$exports, ".pfx", "application/x-pkcs12"), _defineProperty(_module$exports, ".pic", "application/x-pic"), _defineProperty(_module$exports, ".pl", "application/x-perl"), _defineProperty(_module$exports, ".pls", "audio/scpls"), _defineProperty(_module$exports, ".png", "image/png"), _defineProperty(_module$exports, ".pot", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports, ".ppm", "application/x-ppm"), _defineProperty(_module$exports, ".ppt", "application/vnd.ms-powerpoint"), _defineProperty(_module$exports, ".pr", "application/x-pr"), _defineProperty(_module$exports, ".prn", "application/x-prn"), _defineProperty(_module$exports, ".ps", "application/x-ps"), _defineProperty(_module$exports, ".ptn", "application/x-ptn"), _defineProperty(_module$exports, ".r3t", "text/vnd.rn-realtext3d"), _defineProperty(_module$exports, ".ram", "audio/x-pn-realaudio"), _defineProperty(_module$exports, ".rat", "application/rat-file"), _defineProperty(_module$exports, ".rec", "application/vnd.rn-recording"), _defineProperty(_module$exports, ".rgb", "application/x-rgb"), _defineProperty(_module$exports, ".rjt", "application/vnd.rn-realsystem-rjt"), _defineProperty(_module$exports, ".rle", "application/x-rle"), _defineProperty(_module$exports, ".rmf", "application/vnd.adobe.rmf"), _defineProperty(_module$exports, ".rmj", "application/vnd.rn-realsystem-rmj"), _defineProperty(_module$exports, ".rmp", "application/vnd.rn-rn_music_package"), _defineProperty(_module$exports, ".rmvb", "application/vnd.rn-realmedia-vbr"), _defineProperty(_module$exports, ".rnx", "application/vnd.rn-realplayer"), _defineProperty(_module$exports, ".rpm", "audio/x-pn-realaudio-plugin"), _defineProperty(_module$exports, ".rt", "text/vnd.rn-realtext"), _defineProperty(_module$exports, ".rtf", "application/x-rtf"), _defineProperty(_module$exports, ".sam", "application/x-sam"), _defineProperty(_module$exports, ".sdp", "application/sdp"), _defineProperty(_module$exports, ".sit", "application/x-stuffit"), _defineProperty(_module$exports, ".sld", "application/x-sld"), _defineProperty(_module$exports, ".smi", "application/smil"), _defineProperty(_module$exports, ".smk", "application/x-smk"), _defineProperty(_module$exports, ".sol", "text/plain"), _defineProperty(_module$exports, ".spc", "application/x-pkcs7-certificates"), _defineProperty(_module$exports, ".spp", "text/xml"), _defineProperty(_module$exports, ".sst", "application/vnd.ms-pki.certstore"), _defineProperty(_module$exports, ".stm", "text/html"), _defineProperty(_module$exports, ".svg", "text/xml"), _defineProperty(_module$exports, ".tdf", "application/x-tdf"), _defineProperty(_module$exports, ".tga", "application/x-tga"), _defineProperty(_module$exports, ".tif", "application/x-tif"), _defineProperty(_module$exports, ".tld", "text/xml"), _defineProperty(_module$exports, ".torrent", "application/x-bittorrent"), _defineProperty(_module$exports, ".txt", "text/plain"), _defineProperty(_module$exports, ".uls", "text/iuls"), _defineProperty(_module$exports, ".vda", "application/x-vda"), _defineProperty(_module$exports, ".vml", "text/xml"), _defineProperty(_module$exports, ".vsd", "application/vnd.visio"), _defineProperty(_module$exports, ".vss", "application/vnd.visio"), _defineProperty(_module$exports, ".vst", "application/x-vst"), _defineProperty(_module$exports, ".vsx", "application/vnd.visio"), _defineProperty(_module$exports, ".vxml", "text/xml"), _defineProperty(_module$exports, ".wax", "audio/x-ms-wax"), _defineProperty(_module$exports, ".wb2", "application/x-wb2"), _defineProperty(_module$exports, ".wbmp", "image/vnd.wap.wbmp"), _defineProperty(_module$exports, ".wk3", "application/x-wk3"), _defineProperty(_module$exports, ".wkq", "application/x-wkq"), _defineProperty(_module$exports, ".wm", "video/x-ms-wm"), _defineProperty(_module$exports, ".wmd", "application/x-ms-wmd"), _defineProperty(_module$exports, ".wml", "text/vnd.wap.wml"), _defineProperty(_module$exports, ".wmx", "video/x-ms-wmx"), _defineProperty(_module$exports, ".wp6", "application/x-wp6"), _defineProperty(_module$exports, ".wpg", "application/x-wpg"), _defineProperty(_module$exports, ".wq1", "application/x-wq1"), _defineProperty(_module$exports, ".wri", "application/x-wri"), _defineProperty(_module$exports, ".ws", "application/x-ws"), _defineProperty(_module$exports, ".wsc", "text/scriptlet"), _defineProperty(_module$exports, ".wvx", "video/x-ms-wvx"), _defineProperty(_module$exports, ".xdr", "text/xml"), _defineProperty(_module$exports, ".xfdf", "application/vnd.adobe.xfdf"), _defineProperty(_module$exports, ".xls", "application/vnd.ms-excel"), _defineProperty(_module$exports, ".xlw", "application/x-xlw"), _defineProperty(_module$exports, ".xpl", "audio/scpls"), _defineProperty(_module$exports, ".xql", "text/xml"), _defineProperty(_module$exports, ".xsd", "text/xml"), _defineProperty(_module$exports, ".xslt", "text/xml"), _defineProperty(_module$exports, ".x_b", "application/x-x_b"), _defineProperty(_module$exports, ".sisx", "application/vnd.symbian.install"), _defineProperty(_module$exports, ".ipa", "application/vnd.iphone"), _defineProperty(_module$exports, ".xap", "application/x-silverlight-app"), _defineProperty(_module$exports, ".zip", "application/x-zip-compressed"), _module$exports);
  9462. /***/ }),
  9463. /* 60 */,
  9464. /* 61 */,
  9465. /* 62 */,
  9466. /* 63 */,
  9467. /* 64 */,
  9468. /* 65 */,
  9469. /* 66 */,
  9470. /* 67 */,
  9471. /* 68 */
  9472. /*!************************************************************************************************!*\
  9473. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9474. \************************************************************************************************/
  9475. /*! no static exports found */
  9476. /***/ (function(module, exports, __webpack_require__) {
  9477. // TODO(Babel 8): Remove this file.
  9478. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 69)();
  9479. module.exports = runtime;
  9480. /***/ }),
  9481. /* 69 */
  9482. /*!*******************************************************************!*\
  9483. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9484. \*******************************************************************/
  9485. /*! no static exports found */
  9486. /***/ (function(module, exports, __webpack_require__) {
  9487. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9488. function _regeneratorRuntime() {
  9489. "use strict";
  9490. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9491. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9492. return exports;
  9493. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9494. var exports = {},
  9495. Op = Object.prototype,
  9496. hasOwn = Op.hasOwnProperty,
  9497. defineProperty = Object.defineProperty || function (obj, key, desc) {
  9498. obj[key] = desc.value;
  9499. },
  9500. $Symbol = "function" == typeof Symbol ? Symbol : {},
  9501. iteratorSymbol = $Symbol.iterator || "@@iterator",
  9502. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  9503. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9504. function define(obj, key, value) {
  9505. return Object.defineProperty(obj, key, {
  9506. value: value,
  9507. enumerable: !0,
  9508. configurable: !0,
  9509. writable: !0
  9510. }), obj[key];
  9511. }
  9512. try {
  9513. define({}, "");
  9514. } catch (err) {
  9515. define = function define(obj, key, value) {
  9516. return obj[key] = value;
  9517. };
  9518. }
  9519. function wrap(innerFn, outerFn, self, tryLocsList) {
  9520. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  9521. generator = Object.create(protoGenerator.prototype),
  9522. context = new Context(tryLocsList || []);
  9523. return defineProperty(generator, "_invoke", {
  9524. value: makeInvokeMethod(innerFn, self, context)
  9525. }), generator;
  9526. }
  9527. function tryCatch(fn, obj, arg) {
  9528. try {
  9529. return {
  9530. type: "normal",
  9531. arg: fn.call(obj, arg)
  9532. };
  9533. } catch (err) {
  9534. return {
  9535. type: "throw",
  9536. arg: err
  9537. };
  9538. }
  9539. }
  9540. exports.wrap = wrap;
  9541. var ContinueSentinel = {};
  9542. function Generator() {}
  9543. function GeneratorFunction() {}
  9544. function GeneratorFunctionPrototype() {}
  9545. var IteratorPrototype = {};
  9546. define(IteratorPrototype, iteratorSymbol, function () {
  9547. return this;
  9548. });
  9549. var getProto = Object.getPrototypeOf,
  9550. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9551. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  9552. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  9553. function defineIteratorMethods(prototype) {
  9554. ["next", "throw", "return"].forEach(function (method) {
  9555. define(prototype, method, function (arg) {
  9556. return this._invoke(method, arg);
  9557. });
  9558. });
  9559. }
  9560. function AsyncIterator(generator, PromiseImpl) {
  9561. function invoke(method, arg, resolve, reject) {
  9562. var record = tryCatch(generator[method], generator, arg);
  9563. if ("throw" !== record.type) {
  9564. var result = record.arg,
  9565. value = result.value;
  9566. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  9567. invoke("next", value, resolve, reject);
  9568. }, function (err) {
  9569. invoke("throw", err, resolve, reject);
  9570. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  9571. result.value = unwrapped, resolve(result);
  9572. }, function (error) {
  9573. return invoke("throw", error, resolve, reject);
  9574. });
  9575. }
  9576. reject(record.arg);
  9577. }
  9578. var previousPromise;
  9579. defineProperty(this, "_invoke", {
  9580. value: function value(method, arg) {
  9581. function callInvokeWithMethodAndArg() {
  9582. return new PromiseImpl(function (resolve, reject) {
  9583. invoke(method, arg, resolve, reject);
  9584. });
  9585. }
  9586. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9587. }
  9588. });
  9589. }
  9590. function makeInvokeMethod(innerFn, self, context) {
  9591. var state = "suspendedStart";
  9592. return function (method, arg) {
  9593. if ("executing" === state) throw new Error("Generator is already running");
  9594. if ("completed" === state) {
  9595. if ("throw" === method) throw arg;
  9596. return doneResult();
  9597. }
  9598. for (context.method = method, context.arg = arg;;) {
  9599. var delegate = context.delegate;
  9600. if (delegate) {
  9601. var delegateResult = maybeInvokeDelegate(delegate, context);
  9602. if (delegateResult) {
  9603. if (delegateResult === ContinueSentinel) continue;
  9604. return delegateResult;
  9605. }
  9606. }
  9607. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  9608. if ("suspendedStart" === state) throw state = "completed", context.arg;
  9609. context.dispatchException(context.arg);
  9610. } else "return" === context.method && context.abrupt("return", context.arg);
  9611. state = "executing";
  9612. var record = tryCatch(innerFn, self, context);
  9613. if ("normal" === record.type) {
  9614. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  9615. return {
  9616. value: record.arg,
  9617. done: context.done
  9618. };
  9619. }
  9620. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  9621. }
  9622. };
  9623. }
  9624. function maybeInvokeDelegate(delegate, context) {
  9625. var methodName = context.method,
  9626. method = delegate.iterator[methodName];
  9627. 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;
  9628. var record = tryCatch(method, delegate.iterator, context.arg);
  9629. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  9630. var info = record.arg;
  9631. 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);
  9632. }
  9633. function pushTryEntry(locs) {
  9634. var entry = {
  9635. tryLoc: locs[0]
  9636. };
  9637. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  9638. }
  9639. function resetTryEntry(entry) {
  9640. var record = entry.completion || {};
  9641. record.type = "normal", delete record.arg, entry.completion = record;
  9642. }
  9643. function Context(tryLocsList) {
  9644. this.tryEntries = [{
  9645. tryLoc: "root"
  9646. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  9647. }
  9648. function values(iterable) {
  9649. if (iterable) {
  9650. var iteratorMethod = iterable[iteratorSymbol];
  9651. if (iteratorMethod) return iteratorMethod.call(iterable);
  9652. if ("function" == typeof iterable.next) return iterable;
  9653. if (!isNaN(iterable.length)) {
  9654. var i = -1,
  9655. next = function next() {
  9656. for (; ++i < iterable.length;) {
  9657. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  9658. }
  9659. return next.value = undefined, next.done = !0, next;
  9660. };
  9661. return next.next = next;
  9662. }
  9663. }
  9664. return {
  9665. next: doneResult
  9666. };
  9667. }
  9668. function doneResult() {
  9669. return {
  9670. value: undefined,
  9671. done: !0
  9672. };
  9673. }
  9674. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  9675. value: GeneratorFunctionPrototype,
  9676. configurable: !0
  9677. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  9678. value: GeneratorFunction,
  9679. configurable: !0
  9680. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  9681. var ctor = "function" == typeof genFun && genFun.constructor;
  9682. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  9683. }, exports.mark = function (genFun) {
  9684. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  9685. }, exports.awrap = function (arg) {
  9686. return {
  9687. __await: arg
  9688. };
  9689. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  9690. return this;
  9691. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  9692. void 0 === PromiseImpl && (PromiseImpl = Promise);
  9693. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  9694. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  9695. return result.done ? result.value : iter.next();
  9696. });
  9697. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  9698. return this;
  9699. }), define(Gp, "toString", function () {
  9700. return "[object Generator]";
  9701. }), exports.keys = function (val) {
  9702. var object = Object(val),
  9703. keys = [];
  9704. for (var key in object) {
  9705. keys.push(key);
  9706. }
  9707. return keys.reverse(), function next() {
  9708. for (; keys.length;) {
  9709. var key = keys.pop();
  9710. if (key in object) return next.value = key, next.done = !1, next;
  9711. }
  9712. return next.done = !0, next;
  9713. };
  9714. }, exports.values = values, Context.prototype = {
  9715. constructor: Context,
  9716. reset: function reset(skipTempReset) {
  9717. 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) {
  9718. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  9719. }
  9720. },
  9721. stop: function stop() {
  9722. this.done = !0;
  9723. var rootRecord = this.tryEntries[0].completion;
  9724. if ("throw" === rootRecord.type) throw rootRecord.arg;
  9725. return this.rval;
  9726. },
  9727. dispatchException: function dispatchException(exception) {
  9728. if (this.done) throw exception;
  9729. var context = this;
  9730. function handle(loc, caught) {
  9731. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  9732. }
  9733. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9734. var entry = this.tryEntries[i],
  9735. record = entry.completion;
  9736. if ("root" === entry.tryLoc) return handle("end");
  9737. if (entry.tryLoc <= this.prev) {
  9738. var hasCatch = hasOwn.call(entry, "catchLoc"),
  9739. hasFinally = hasOwn.call(entry, "finallyLoc");
  9740. if (hasCatch && hasFinally) {
  9741. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9742. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9743. } else if (hasCatch) {
  9744. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9745. } else {
  9746. if (!hasFinally) throw new Error("try statement without catch or finally");
  9747. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9748. }
  9749. }
  9750. }
  9751. },
  9752. abrupt: function abrupt(type, arg) {
  9753. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9754. var entry = this.tryEntries[i];
  9755. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  9756. var finallyEntry = entry;
  9757. break;
  9758. }
  9759. }
  9760. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  9761. var record = finallyEntry ? finallyEntry.completion : {};
  9762. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9763. },
  9764. complete: function complete(record, afterLoc) {
  9765. if ("throw" === record.type) throw record.arg;
  9766. 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;
  9767. },
  9768. finish: function finish(finallyLoc) {
  9769. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9770. var entry = this.tryEntries[i];
  9771. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9772. }
  9773. },
  9774. "catch": function _catch(tryLoc) {
  9775. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9776. var entry = this.tryEntries[i];
  9777. if (entry.tryLoc === tryLoc) {
  9778. var record = entry.completion;
  9779. if ("throw" === record.type) {
  9780. var thrown = record.arg;
  9781. resetTryEntry(entry);
  9782. }
  9783. return thrown;
  9784. }
  9785. }
  9786. throw new Error("illegal catch attempt");
  9787. },
  9788. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9789. return this.delegate = {
  9790. iterator: values(iterable),
  9791. resultName: resultName,
  9792. nextLoc: nextLoc
  9793. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9794. }
  9795. }, exports;
  9796. }
  9797. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9798. /***/ }),
  9799. /* 70 */
  9800. /*!*****************************************************************!*\
  9801. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9802. \*****************************************************************/
  9803. /*! no static exports found */
  9804. /***/ (function(module, exports) {
  9805. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9806. try {
  9807. var info = gen[key](arg);
  9808. var value = info.value;
  9809. } catch (error) {
  9810. reject(error);
  9811. return;
  9812. }
  9813. if (info.done) {
  9814. resolve(value);
  9815. } else {
  9816. Promise.resolve(value).then(_next, _throw);
  9817. }
  9818. }
  9819. function _asyncToGenerator(fn) {
  9820. return function () {
  9821. var self = this,
  9822. args = arguments;
  9823. return new Promise(function (resolve, reject) {
  9824. var gen = fn.apply(self, args);
  9825. function _next(value) {
  9826. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9827. }
  9828. function _throw(err) {
  9829. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9830. }
  9831. _next(undefined);
  9832. });
  9833. };
  9834. }
  9835. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9836. /***/ }),
  9837. /* 71 */,
  9838. /* 72 */,
  9839. /* 73 */,
  9840. /* 74 */,
  9841. /* 75 */,
  9842. /* 76 */,
  9843. /* 77 */,
  9844. /* 78 */,
  9845. /* 79 */,
  9846. /* 80 */,
  9847. /* 81 */,
  9848. /* 82 */,
  9849. /* 83 */,
  9850. /* 84 */,
  9851. /* 85 */,
  9852. /* 86 */,
  9853. /* 87 */,
  9854. /* 88 */,
  9855. /* 89 */,
  9856. /* 90 */,
  9857. /* 91 */,
  9858. /* 92 */,
  9859. /* 93 */,
  9860. /* 94 */,
  9861. /* 95 */,
  9862. /* 96 */,
  9863. /* 97 */,
  9864. /* 98 */,
  9865. /* 99 */,
  9866. /* 100 */,
  9867. /* 101 */,
  9868. /* 102 */,
  9869. /* 103 */,
  9870. /* 104 */,
  9871. /* 105 */,
  9872. /* 106 */
  9873. /*!************************************************************************************!*\
  9874. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  9875. \************************************************************************************/
  9876. /*! no static exports found */
  9877. /***/ (function(module, exports, __webpack_require__) {
  9878. "use strict";
  9879. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  9880. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9881. Object.defineProperty(exports, "__esModule", {
  9882. value: true
  9883. });
  9884. exports.default = void 0;
  9885. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 68));
  9886. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  9887. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9888. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  9889. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 70));
  9890. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  9891. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 107));
  9892. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 108));
  9893. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 110));
  9894. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 111));
  9895. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  9896. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  9897. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  9898. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 113));
  9899. 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(_e33) { throw _e33; }, 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(_e34) { didErr = true; err = _e34; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  9900. 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); }
  9901. 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; }
  9902. 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; }
  9903. 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; }
  9904. 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); }; }
  9905. 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; } }
  9906. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  9907. function n(e) {
  9908. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  9909. }
  9910. function s(e, t, n) {
  9911. return e(n = {
  9912. path: t,
  9913. exports: {},
  9914. require: function require(e, t) {
  9915. return function () {
  9916. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  9917. }(null == t && n.path);
  9918. }
  9919. }, n.exports), n.exports;
  9920. }
  9921. var r = s(function (e, t) {
  9922. var n;
  9923. e.exports = (n = n || function (e, t) {
  9924. var n = Object.create || function () {
  9925. function e() {}
  9926. return function (t) {
  9927. var n;
  9928. return e.prototype = t, n = new e(), e.prototype = null, n;
  9929. };
  9930. }(),
  9931. s = {},
  9932. r = s.lib = {},
  9933. i = r.Base = {
  9934. extend: function extend(e) {
  9935. var t = n(this);
  9936. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  9937. t.$super.init.apply(this, arguments);
  9938. }), t.init.prototype = t, t.$super = this, t;
  9939. },
  9940. create: function create() {
  9941. var e = this.extend();
  9942. return e.init.apply(e, arguments), e;
  9943. },
  9944. init: function init() {},
  9945. mixIn: function mixIn(e) {
  9946. for (var t in e) {
  9947. e.hasOwnProperty(t) && (this[t] = e[t]);
  9948. }
  9949. e.hasOwnProperty("toString") && (this.toString = e.toString);
  9950. },
  9951. clone: function clone() {
  9952. return this.init.prototype.extend(this);
  9953. }
  9954. },
  9955. o = r.WordArray = i.extend({
  9956. init: function init(e, n) {
  9957. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  9958. },
  9959. toString: function toString(e) {
  9960. return (e || c).stringify(this);
  9961. },
  9962. concat: function concat(e) {
  9963. var t = this.words,
  9964. n = e.words,
  9965. s = this.sigBytes,
  9966. r = e.sigBytes;
  9967. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  9968. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  9969. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  9970. } else for (i = 0; i < r; i += 4) {
  9971. t[s + i >>> 2] = n[i >>> 2];
  9972. }
  9973. return this.sigBytes += r, this;
  9974. },
  9975. clamp: function clamp() {
  9976. var t = this.words,
  9977. n = this.sigBytes;
  9978. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  9979. },
  9980. clone: function clone() {
  9981. var e = i.clone.call(this);
  9982. return e.words = this.words.slice(0), e;
  9983. },
  9984. random: function random(t) {
  9985. for (var n, s = [], r = function r(t) {
  9986. t = t;
  9987. var n = 987654321,
  9988. s = 4294967295;
  9989. return function () {
  9990. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  9991. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  9992. };
  9993. }, i = 0; i < t; i += 4) {
  9994. var a = r(4294967296 * (n || e.random()));
  9995. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  9996. }
  9997. return new o.init(s, t);
  9998. }
  9999. }),
  10000. a = s.enc = {},
  10001. c = a.Hex = {
  10002. stringify: function stringify(e) {
  10003. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10004. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10005. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  10006. }
  10007. return s.join("");
  10008. },
  10009. parse: function parse(e) {
  10010. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  10011. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  10012. }
  10013. return new o.init(n, t / 2);
  10014. }
  10015. },
  10016. u = a.Latin1 = {
  10017. stringify: function stringify(e) {
  10018. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  10019. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  10020. s.push(String.fromCharCode(i));
  10021. }
  10022. return s.join("");
  10023. },
  10024. parse: function parse(e) {
  10025. for (var t = e.length, n = [], s = 0; s < t; s++) {
  10026. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  10027. }
  10028. return new o.init(n, t);
  10029. }
  10030. },
  10031. l = a.Utf8 = {
  10032. stringify: function stringify(e) {
  10033. try {
  10034. return decodeURIComponent(escape(u.stringify(e)));
  10035. } catch (e) {
  10036. throw new Error("Malformed UTF-8 data");
  10037. }
  10038. },
  10039. parse: function parse(e) {
  10040. return u.parse(unescape(encodeURIComponent(e)));
  10041. }
  10042. },
  10043. h = r.BufferedBlockAlgorithm = i.extend({
  10044. reset: function reset() {
  10045. this._data = new o.init(), this._nDataBytes = 0;
  10046. },
  10047. _append: function _append(e) {
  10048. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  10049. },
  10050. _process: function _process(t) {
  10051. var n = this._data,
  10052. s = n.words,
  10053. r = n.sigBytes,
  10054. i = this.blockSize,
  10055. a = r / (4 * i),
  10056. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  10057. u = e.min(4 * c, r);
  10058. if (c) {
  10059. for (var l = 0; l < c; l += i) {
  10060. this._doProcessBlock(s, l);
  10061. }
  10062. var h = s.splice(0, c);
  10063. n.sigBytes -= u;
  10064. }
  10065. return new o.init(h, u);
  10066. },
  10067. clone: function clone() {
  10068. var e = i.clone.call(this);
  10069. return e._data = this._data.clone(), e;
  10070. },
  10071. _minBufferSize: 0
  10072. });
  10073. r.Hasher = h.extend({
  10074. cfg: i.extend(),
  10075. init: function init(e) {
  10076. this.cfg = this.cfg.extend(e), this.reset();
  10077. },
  10078. reset: function reset() {
  10079. h.reset.call(this), this._doReset();
  10080. },
  10081. update: function update(e) {
  10082. return this._append(e), this._process(), this;
  10083. },
  10084. finalize: function finalize(e) {
  10085. return e && this._append(e), this._doFinalize();
  10086. },
  10087. blockSize: 16,
  10088. _createHelper: function _createHelper(e) {
  10089. return function (t, n) {
  10090. return new e.init(n).finalize(t);
  10091. };
  10092. },
  10093. _createHmacHelper: function _createHmacHelper(e) {
  10094. return function (t, n) {
  10095. return new d.HMAC.init(e, n).finalize(t);
  10096. };
  10097. }
  10098. });
  10099. var d = s.algo = {};
  10100. return s;
  10101. }(Math), n);
  10102. }),
  10103. i = r,
  10104. o = (s(function (e, t) {
  10105. var n;
  10106. e.exports = (n = i, function (e) {
  10107. var t = n,
  10108. s = t.lib,
  10109. r = s.WordArray,
  10110. i = s.Hasher,
  10111. o = t.algo,
  10112. a = [];
  10113. !function () {
  10114. for (var t = 0; t < 64; t++) {
  10115. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  10116. }
  10117. }();
  10118. var c = o.MD5 = i.extend({
  10119. _doReset: function _doReset() {
  10120. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  10121. },
  10122. _doProcessBlock: function _doProcessBlock(e, t) {
  10123. for (var n = 0; n < 16; n++) {
  10124. var s = t + n,
  10125. r = e[s];
  10126. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  10127. }
  10128. var i = this._hash.words,
  10129. o = e[t + 0],
  10130. c = e[t + 1],
  10131. p = e[t + 2],
  10132. f = e[t + 3],
  10133. g = e[t + 4],
  10134. m = e[t + 5],
  10135. y = e[t + 6],
  10136. _ = e[t + 7],
  10137. w = e[t + 8],
  10138. v = e[t + 9],
  10139. b = e[t + 10],
  10140. S = e[t + 11],
  10141. k = e[t + 12],
  10142. I = e[t + 13],
  10143. T = e[t + 14],
  10144. C = e[t + 15],
  10145. A = i[0],
  10146. P = i[1],
  10147. E = i[2],
  10148. O = i[3];
  10149. A = u(A, P, E, O, o, 7, a[0]), O = u(O, A, P, E, c, 12, a[1]), E = u(E, O, A, P, p, 17, a[2]), P = u(P, E, O, A, f, 22, a[3]), A = u(A, P, E, O, g, 7, a[4]), O = u(O, A, P, E, m, 12, a[5]), E = u(E, O, A, P, y, 17, a[6]), P = u(P, E, O, A, _, 22, a[7]), A = u(A, P, E, O, w, 7, a[8]), O = u(O, A, P, E, v, 12, a[9]), E = u(E, O, A, P, b, 17, a[10]), P = u(P, E, O, A, S, 22, a[11]), A = u(A, P, E, O, k, 7, a[12]), O = u(O, A, P, E, I, 12, a[13]), E = u(E, O, A, P, T, 17, a[14]), A = l(A, P = u(P, E, O, A, C, 22, a[15]), E, O, c, 5, a[16]), O = l(O, A, P, E, y, 9, a[17]), E = l(E, O, A, P, S, 14, a[18]), P = l(P, E, O, A, o, 20, a[19]), A = l(A, P, E, O, m, 5, a[20]), O = l(O, A, P, E, b, 9, a[21]), E = l(E, O, A, P, C, 14, a[22]), P = l(P, E, O, A, g, 20, a[23]), A = l(A, P, E, O, v, 5, a[24]), O = l(O, A, P, E, T, 9, a[25]), E = l(E, O, A, P, f, 14, a[26]), P = l(P, E, O, A, w, 20, a[27]), A = l(A, P, E, O, I, 5, a[28]), O = l(O, A, P, E, p, 9, a[29]), E = l(E, O, A, P, _, 14, a[30]), A = h(A, P = l(P, E, O, A, k, 20, a[31]), E, O, m, 4, a[32]), O = h(O, A, P, E, w, 11, a[33]), E = h(E, O, A, P, S, 16, a[34]), P = h(P, E, O, A, T, 23, a[35]), A = h(A, P, E, O, c, 4, a[36]), O = h(O, A, P, E, g, 11, a[37]), E = h(E, O, A, P, _, 16, a[38]), P = h(P, E, O, A, b, 23, a[39]), A = h(A, P, E, O, I, 4, a[40]), O = h(O, A, P, E, o, 11, a[41]), E = h(E, O, A, P, f, 16, a[42]), P = h(P, E, O, A, y, 23, a[43]), A = h(A, P, E, O, v, 4, a[44]), O = h(O, A, P, E, k, 11, a[45]), E = h(E, O, A, P, C, 16, a[46]), A = d(A, P = h(P, E, O, A, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, A, P, E, _, 10, a[49]), E = d(E, O, A, P, T, 15, a[50]), P = d(P, E, O, A, m, 21, a[51]), A = d(A, P, E, O, k, 6, a[52]), O = d(O, A, P, E, f, 10, a[53]), E = d(E, O, A, P, b, 15, a[54]), P = d(P, E, O, A, c, 21, a[55]), A = d(A, P, E, O, w, 6, a[56]), O = d(O, A, P, E, C, 10, a[57]), E = d(E, O, A, P, y, 15, a[58]), P = d(P, E, O, A, I, 21, a[59]), A = d(A, P, E, O, g, 6, a[60]), O = d(O, A, P, E, S, 10, a[61]), E = d(E, O, A, P, p, 15, a[62]), P = d(P, E, O, A, v, 21, a[63]), i[0] = i[0] + A | 0, i[1] = i[1] + P | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  10150. },
  10151. _doFinalize: function _doFinalize() {
  10152. var t = this._data,
  10153. n = t.words,
  10154. s = 8 * this._nDataBytes,
  10155. r = 8 * t.sigBytes;
  10156. n[r >>> 5] |= 128 << 24 - r % 32;
  10157. var i = e.floor(s / 4294967296),
  10158. o = s;
  10159. 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();
  10160. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  10161. var l = c[u];
  10162. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  10163. }
  10164. return a;
  10165. },
  10166. clone: function clone() {
  10167. var e = i.clone.call(this);
  10168. return e._hash = this._hash.clone(), e;
  10169. }
  10170. });
  10171. function u(e, t, n, s, r, i, o) {
  10172. var a = e + (t & n | ~t & s) + r + o;
  10173. return (a << i | a >>> 32 - i) + t;
  10174. }
  10175. function l(e, t, n, s, r, i, o) {
  10176. var a = e + (t & s | n & ~s) + r + o;
  10177. return (a << i | a >>> 32 - i) + t;
  10178. }
  10179. function h(e, t, n, s, r, i, o) {
  10180. var a = e + (t ^ n ^ s) + r + o;
  10181. return (a << i | a >>> 32 - i) + t;
  10182. }
  10183. function d(e, t, n, s, r, i, o) {
  10184. var a = e + (n ^ (t | ~s)) + r + o;
  10185. return (a << i | a >>> 32 - i) + t;
  10186. }
  10187. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  10188. }(Math), n.MD5);
  10189. }), s(function (e, t) {
  10190. var n;
  10191. e.exports = (n = i, void function () {
  10192. var e = n,
  10193. t = e.lib.Base,
  10194. s = e.enc.Utf8;
  10195. e.algo.HMAC = t.extend({
  10196. init: function init(e, t) {
  10197. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  10198. var n = e.blockSize,
  10199. r = 4 * n;
  10200. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  10201. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  10202. a[u] ^= 1549556828, c[u] ^= 909522486;
  10203. }
  10204. i.sigBytes = o.sigBytes = r, this.reset();
  10205. },
  10206. reset: function reset() {
  10207. var e = this._hasher;
  10208. e.reset(), e.update(this._iKey);
  10209. },
  10210. update: function update(e) {
  10211. return this._hasher.update(e), this;
  10212. },
  10213. finalize: function finalize(e) {
  10214. var t = this._hasher,
  10215. n = t.finalize(e);
  10216. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  10217. }
  10218. });
  10219. }());
  10220. }), s(function (e, t) {
  10221. e.exports = i.HmacMD5;
  10222. })),
  10223. a = s(function (e, t) {
  10224. e.exports = i.enc.Utf8;
  10225. }),
  10226. c = s(function (e, t) {
  10227. var n;
  10228. e.exports = (n = i, function () {
  10229. var e = n,
  10230. t = e.lib.WordArray;
  10231. function s(e, n, s) {
  10232. for (var r = [], i = 0, o = 0; o < n; o++) {
  10233. if (o % 4) {
  10234. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  10235. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  10236. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  10237. }
  10238. }
  10239. return t.create(r, i);
  10240. }
  10241. e.enc.Base64 = {
  10242. stringify: function stringify(e) {
  10243. var t = e.words,
  10244. n = e.sigBytes,
  10245. s = this._map;
  10246. e.clamp();
  10247. for (var r = [], i = 0; i < n; i += 3) {
  10248. 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++) {
  10249. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  10250. }
  10251. }
  10252. var c = s.charAt(64);
  10253. if (c) for (; r.length % 4;) {
  10254. r.push(c);
  10255. }
  10256. return r.join("");
  10257. },
  10258. parse: function parse(e) {
  10259. var t = e.length,
  10260. n = this._map,
  10261. r = this._reverseMap;
  10262. if (!r) {
  10263. r = this._reverseMap = [];
  10264. for (var i = 0; i < n.length; i++) {
  10265. r[n.charCodeAt(i)] = i;
  10266. }
  10267. }
  10268. var o = n.charAt(64);
  10269. if (o) {
  10270. var a = e.indexOf(o);
  10271. -1 !== a && (t = a);
  10272. }
  10273. return s(e, t, r);
  10274. },
  10275. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  10276. };
  10277. }(), n.enc.Base64);
  10278. });
  10279. var u = "FUNCTION",
  10280. l = "OBJECT",
  10281. h = "CLIENT_DB",
  10282. d = "pending",
  10283. p = "fullfilled",
  10284. f = "rejected";
  10285. function g(e) {
  10286. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  10287. }
  10288. function m(e) {
  10289. return "object" === g(e);
  10290. }
  10291. function y(e) {
  10292. return "function" == typeof e;
  10293. }
  10294. function _(e) {
  10295. return function () {
  10296. try {
  10297. return e.apply(e, arguments);
  10298. } catch (e) {
  10299. console.error(e);
  10300. }
  10301. };
  10302. }
  10303. var w = "REJECTED",
  10304. v = "NOT_PENDING";
  10305. var b = /*#__PURE__*/function () {
  10306. function b() {
  10307. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10308. e = _ref.createPromise,
  10309. _ref$retryRule = _ref.retryRule,
  10310. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  10311. (0, _classCallCheck2.default)(this, b);
  10312. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  10313. }
  10314. (0, _createClass2.default)(b, [{
  10315. key: "needRetry",
  10316. get: function get() {
  10317. if (!this.status) return !0;
  10318. switch (this.retryRule) {
  10319. case w:
  10320. return this.status === f;
  10321. case v:
  10322. return this.status !== d;
  10323. }
  10324. }
  10325. }, {
  10326. key: "exec",
  10327. value: function exec() {
  10328. var _this = this;
  10329. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  10330. return _this.status = p, Promise.resolve(e);
  10331. }, function (e) {
  10332. return _this.status = f, Promise.reject(e);
  10333. }), this.promise) : this.promise;
  10334. }
  10335. }]);
  10336. return b;
  10337. }();
  10338. function S(e) {
  10339. return e && "string" == typeof e ? JSON.parse(e) : e;
  10340. }
  10341. var k = "development" === "development",
  10342. I = "mp-weixin",
  10343. T = "true" === undefined || !0 === undefined,
  10344. C = S([]),
  10345. A = "h5" === I ? "web" : "app-plus" === I ? "app" : I,
  10346. P = S(undefined),
  10347. E = S([]) || [],
  10348. O = true;
  10349. var x = "";
  10350. try {
  10351. x = (__webpack_require__(/*! uni-stat-config */ 114).default || __webpack_require__(/*! uni-stat-config */ 114)).appid;
  10352. } catch (e) {}
  10353. var R = {};
  10354. function U(e) {
  10355. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10356. var n, s;
  10357. return n = R, s = e, Object.prototype.hasOwnProperty.call(n, s) || (R[e] = t), R[e];
  10358. }
  10359. "app" === A && (R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  10360. var L = ["invoke", "success", "fail", "complete"],
  10361. N = U("_globalUniCloudInterceptor");
  10362. function D(e, t) {
  10363. N[e] || (N[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  10364. L.indexOf(n) > -1 && function (e, t, n) {
  10365. var s = N[e][t];
  10366. s || (s = N[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  10367. }(e, n, t[n]);
  10368. });
  10369. }
  10370. function F(e, t) {
  10371. N[e] || (N[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  10372. L.indexOf(n) > -1 && function (e, t, n) {
  10373. var s = N[e][t];
  10374. if (!s) return;
  10375. var r = s.indexOf(n);
  10376. r > -1 && s.splice(r, 1);
  10377. }(e, n, t[n]);
  10378. }) : delete N[e];
  10379. }
  10380. function q(e, t) {
  10381. return e && 0 !== e.length ? e.reduce(function (e, n) {
  10382. return e.then(function () {
  10383. return n(t);
  10384. });
  10385. }, Promise.resolve()) : Promise.resolve();
  10386. }
  10387. function K(e, t) {
  10388. return N[e] && N[e][t] || [];
  10389. }
  10390. function M(e) {
  10391. D("callObject", e);
  10392. }
  10393. var j = U("_globalUniCloudListener"),
  10394. B = "response",
  10395. $ = "needLogin",
  10396. W = "refreshToken",
  10397. z = "clientdb",
  10398. J = "cloudfunction",
  10399. H = "cloudobject";
  10400. function G(e) {
  10401. return j[e] || (j[e] = []), j[e];
  10402. }
  10403. function V(e, t) {
  10404. var n = G(e);
  10405. n.includes(t) || n.push(t);
  10406. }
  10407. function Y(e, t) {
  10408. var n = G(e),
  10409. s = n.indexOf(t);
  10410. -1 !== s && n.splice(s, 1);
  10411. }
  10412. function Q(e, t) {
  10413. var n = G(e);
  10414. for (var _e2 = 0; _e2 < n.length; _e2++) {
  10415. (0, n[_e2])(t);
  10416. }
  10417. }
  10418. var X,
  10419. Z = !1;
  10420. function ee() {
  10421. return X || (X = new Promise(function (e) {
  10422. Z && e(), function t() {
  10423. if ("function" == typeof getCurrentPages) {
  10424. var _t2 = getCurrentPages();
  10425. _t2 && _t2[0] && (Z = !0, e());
  10426. }
  10427. Z || setTimeout(function () {
  10428. t();
  10429. }, 30);
  10430. }();
  10431. }), X);
  10432. }
  10433. function te(e) {
  10434. var t = {};
  10435. for (var _n2 in e) {
  10436. var _s2 = e[_n2];
  10437. y(_s2) && (t[_n2] = _(_s2));
  10438. }
  10439. return t;
  10440. }
  10441. var ne = /*#__PURE__*/function (_Error) {
  10442. (0, _inherits2.default)(ne, _Error);
  10443. var _super = _createSuper(ne);
  10444. function ne(e) {
  10445. var _this2;
  10446. (0, _classCallCheck2.default)(this, ne);
  10447. _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;
  10448. return _this2;
  10449. }
  10450. (0, _createClass2.default)(ne, [{
  10451. key: "toJson",
  10452. value: function toJson() {
  10453. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  10454. if (!(e >= 10)) return e++, {
  10455. errCode: this.errCode,
  10456. errMsg: this.errMsg,
  10457. errSubject: this.errSubject,
  10458. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  10459. };
  10460. }
  10461. }]);
  10462. return ne;
  10463. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  10464. var se = {
  10465. request: function request(e) {
  10466. return uni.request(e);
  10467. },
  10468. uploadFile: function uploadFile(e) {
  10469. return uni.uploadFile(e);
  10470. },
  10471. setStorageSync: function setStorageSync(e, t) {
  10472. return uni.setStorageSync(e, t);
  10473. },
  10474. getStorageSync: function getStorageSync(e) {
  10475. return uni.getStorageSync(e);
  10476. },
  10477. removeStorageSync: function removeStorageSync(e) {
  10478. return uni.removeStorageSync(e);
  10479. },
  10480. clearStorageSync: function clearStorageSync() {
  10481. return uni.clearStorageSync();
  10482. }
  10483. };
  10484. function re() {
  10485. return {
  10486. token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"),
  10487. tokenExpired: se.getStorageSync("uni_id_token_expired")
  10488. };
  10489. }
  10490. function ie() {
  10491. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10492. e = _ref2.token,
  10493. t = _ref2.tokenExpired;
  10494. e && se.setStorageSync("uni_id_token", e), t && se.setStorageSync("uni_id_token_expired", t);
  10495. }
  10496. var oe, ae;
  10497. function ce() {
  10498. return oe || (oe = uni.getSystemInfoSync()), oe;
  10499. }
  10500. function ue() {
  10501. var e, t;
  10502. try {
  10503. if (uni.getLaunchOptionsSync) {
  10504. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  10505. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  10506. _n3 = _uni$getLaunchOptions.scene,
  10507. _s3 = _uni$getLaunchOptions.channel;
  10508. e = _s3, t = _n3;
  10509. }
  10510. } catch (e) {}
  10511. return {
  10512. channel: e,
  10513. scene: t
  10514. };
  10515. }
  10516. function le() {
  10517. var e = uni.getLocale && uni.getLocale() || "en";
  10518. if (ae) return _objectSpread(_objectSpread({}, ae), {}, {
  10519. locale: e,
  10520. LOCALE: e
  10521. });
  10522. var t = ce(),
  10523. n = t.deviceId,
  10524. s = t.osName,
  10525. r = t.uniPlatform,
  10526. i = t.appId,
  10527. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  10528. for (var _e3 = 0; _e3 < o.length; _e3++) {
  10529. delete t[o[_e3]];
  10530. }
  10531. return ae = _objectSpread(_objectSpread({
  10532. PLATFORM: r,
  10533. OS: s,
  10534. APPID: i,
  10535. DEVICEID: n
  10536. }, ue()), t), _objectSpread(_objectSpread({}, ae), {}, {
  10537. locale: e,
  10538. LOCALE: e
  10539. });
  10540. }
  10541. var he = {
  10542. sign: function sign(e, t) {
  10543. var n = "";
  10544. return Object.keys(e).sort().forEach(function (t) {
  10545. e[t] && (n = n + "&" + t + "=" + e[t]);
  10546. }), n = n.slice(1), o(n, t).toString();
  10547. },
  10548. wrappedRequest: function wrappedRequest(e, t) {
  10549. return new Promise(function (n, s) {
  10550. t(Object.assign(e, {
  10551. complete: function complete(e) {
  10552. e || (e = {}), k && "web" === A && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  10553. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  10554. if (!e.statusCode || e.statusCode >= 400) return s(new ne({
  10555. code: "SYS_ERR",
  10556. message: e.errMsg || "request:fail",
  10557. requestId: t
  10558. }));
  10559. var r = e.data;
  10560. if (r.error) return s(new ne({
  10561. code: r.error.code,
  10562. message: r.error.message,
  10563. requestId: t
  10564. }));
  10565. r.result = r.data, r.requestId = t, delete r.data, n(r);
  10566. }
  10567. }));
  10568. });
  10569. },
  10570. toBase64: function toBase64(e) {
  10571. return c.stringify(a.parse(e));
  10572. }
  10573. },
  10574. de = {
  10575. "uniCloud.init.paramRequired": "{param} required",
  10576. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10577. };
  10578. var _e4 = (0, _uniI18n.initVueI18n)({
  10579. "zh-Hans": {
  10580. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10581. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10582. },
  10583. "zh-Hant": {
  10584. "uniCloud.init.paramRequired": "缺少参数:{param}",
  10585. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  10586. },
  10587. en: de,
  10588. fr: {
  10589. "uniCloud.init.paramRequired": "{param} required",
  10590. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10591. },
  10592. es: {
  10593. "uniCloud.init.paramRequired": "{param} required",
  10594. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  10595. },
  10596. ja: de
  10597. }, "zh-Hans"),
  10598. pe = _e4.t;
  10599. var fe = /*#__PURE__*/function () {
  10600. function fe(e) {
  10601. var _this3 = this;
  10602. (0, _classCallCheck2.default)(this, fe);
  10603. ["spaceId", "clientSecret"].forEach(function (t) {
  10604. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(pe("uniCloud.init.paramRequired", {
  10605. param: t
  10606. }));
  10607. }), this.config = Object.assign({}, {
  10608. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  10609. }, 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 b({
  10610. createPromise: function createPromise() {
  10611. return _this3.requestAuth(_this3.setupRequest({
  10612. method: "serverless.auth.user.anonymousAuthorize",
  10613. params: "{}"
  10614. }, "auth")).then(function (e) {
  10615. if (!e.result || !e.result.accessToken) throw new ne({
  10616. code: "AUTH_FAILED",
  10617. message: "获取accessToken失败"
  10618. });
  10619. _this3.setAccessToken(e.result.accessToken);
  10620. });
  10621. },
  10622. retryRule: v
  10623. });
  10624. }
  10625. (0, _createClass2.default)(fe, [{
  10626. key: "hasAccessToken",
  10627. get: function get() {
  10628. return !!this.accessToken;
  10629. }
  10630. }, {
  10631. key: "setAccessToken",
  10632. value: function setAccessToken(e) {
  10633. this.accessToken = e;
  10634. }
  10635. }, {
  10636. key: "requestWrapped",
  10637. value: function requestWrapped(e) {
  10638. return he.wrappedRequest(e, this.adapter.request);
  10639. }
  10640. }, {
  10641. key: "requestAuth",
  10642. value: function requestAuth(e) {
  10643. return this.requestWrapped(e);
  10644. }
  10645. }, {
  10646. key: "request",
  10647. value: function request(e, t) {
  10648. var _this4 = this;
  10649. return Promise.resolve().then(function () {
  10650. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  10651. return new Promise(function (e, n) {
  10652. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  10653. }).then(function () {
  10654. return _this4.getAccessToken();
  10655. }).then(function () {
  10656. var t = _this4.rebuildRequest(e);
  10657. return _this4.request(t, !0);
  10658. });
  10659. }) : _this4.getAccessToken().then(function () {
  10660. var t = _this4.rebuildRequest(e);
  10661. return _this4.request(t, !0);
  10662. });
  10663. });
  10664. }
  10665. }, {
  10666. key: "rebuildRequest",
  10667. value: function rebuildRequest(e) {
  10668. var t = Object.assign({}, e);
  10669. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = he.sign(t.data, this.config.clientSecret), t;
  10670. }
  10671. }, {
  10672. key: "setupRequest",
  10673. value: function setupRequest(e, t) {
  10674. var n = Object.assign({}, e, {
  10675. spaceId: this.config.spaceId,
  10676. timestamp: Date.now()
  10677. }),
  10678. s = {
  10679. "Content-Type": "application/json"
  10680. };
  10681. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret), {
  10682. url: this.config.requestUrl,
  10683. method: "POST",
  10684. data: n,
  10685. dataType: "json",
  10686. header: s
  10687. };
  10688. }
  10689. }, {
  10690. key: "getAccessToken",
  10691. value: function getAccessToken() {
  10692. return this._getAccessTokenPromiseHub.exec();
  10693. }
  10694. }, {
  10695. key: "authorize",
  10696. value: function () {
  10697. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10698. return _regenerator.default.wrap(function _callee$(_context) {
  10699. while (1) {
  10700. switch (_context.prev = _context.next) {
  10701. case 0:
  10702. _context.next = 2;
  10703. return this.getAccessToken();
  10704. case 2:
  10705. case "end":
  10706. return _context.stop();
  10707. }
  10708. }
  10709. }, _callee, this);
  10710. }));
  10711. function authorize() {
  10712. return _authorize.apply(this, arguments);
  10713. }
  10714. return authorize;
  10715. }()
  10716. }, {
  10717. key: "callFunction",
  10718. value: function callFunction(e) {
  10719. var t = {
  10720. method: "serverless.function.runtime.invoke",
  10721. params: JSON.stringify({
  10722. functionTarget: e.name,
  10723. functionArgs: e.data || {}
  10724. })
  10725. };
  10726. return this.request(this.setupRequest(t));
  10727. }
  10728. }, {
  10729. key: "getOSSUploadOptionsFromPath",
  10730. value: function getOSSUploadOptionsFromPath(e) {
  10731. var t = {
  10732. method: "serverless.file.resource.generateProximalSign",
  10733. params: JSON.stringify(e)
  10734. };
  10735. return this.request(this.setupRequest(t));
  10736. }
  10737. }, {
  10738. key: "uploadFileToOSS",
  10739. value: function uploadFileToOSS(_ref3) {
  10740. var _this5 = this;
  10741. var e = _ref3.url,
  10742. t = _ref3.formData,
  10743. n = _ref3.name,
  10744. s = _ref3.filePath,
  10745. r = _ref3.fileType,
  10746. i = _ref3.onUploadProgress;
  10747. return new Promise(function (o, a) {
  10748. var c = _this5.adapter.uploadFile({
  10749. url: e,
  10750. formData: t,
  10751. name: n,
  10752. filePath: s,
  10753. fileType: r,
  10754. header: {
  10755. "X-OSS-server-side-encrpytion": "AES256"
  10756. },
  10757. success: function success(e) {
  10758. e && e.statusCode < 400 ? o(e) : a(new ne({
  10759. code: "UPLOAD_FAILED",
  10760. message: "文件上传失败"
  10761. }));
  10762. },
  10763. fail: function fail(e) {
  10764. a(new ne({
  10765. code: e.code || "UPLOAD_FAILED",
  10766. message: e.message || e.errMsg || "文件上传失败"
  10767. }));
  10768. }
  10769. });
  10770. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  10771. i({
  10772. loaded: e.totalBytesSent,
  10773. total: e.totalBytesExpectedToSend
  10774. });
  10775. });
  10776. });
  10777. }
  10778. }, {
  10779. key: "reportOSSUpload",
  10780. value: function reportOSSUpload(e) {
  10781. var t = {
  10782. method: "serverless.file.resource.report",
  10783. params: JSON.stringify(e)
  10784. };
  10785. return this.request(this.setupRequest(t));
  10786. }
  10787. }, {
  10788. key: "uploadFile",
  10789. value: function () {
  10790. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  10791. var e, t, _ref4$fileType, n, s, r, i, o, a, c, u, l, h, d, p, f, m, y, _e5, _;
  10792. return _regenerator.default.wrap(function _callee2$(_context2) {
  10793. while (1) {
  10794. switch (_context2.prev = _context2.next) {
  10795. case 0:
  10796. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, s = _ref4.onUploadProgress, r = _ref4.config;
  10797. if (!("string" !== g(t))) {
  10798. _context2.next = 3;
  10799. break;
  10800. }
  10801. throw new ne({
  10802. code: "INVALID_PARAM",
  10803. message: "cloudPath必须为字符串类型"
  10804. });
  10805. case 3:
  10806. if (t = t.trim()) {
  10807. _context2.next = 5;
  10808. break;
  10809. }
  10810. throw new ne({
  10811. code: "CLOUDPATH_REQUIRED",
  10812. message: "cloudPath不可为空"
  10813. });
  10814. case 5:
  10815. if (!/:\/\//.test(t)) {
  10816. _context2.next = 7;
  10817. break;
  10818. }
  10819. throw new ne({
  10820. code: "INVALID_PARAM",
  10821. message: "cloudPath不合法"
  10822. });
  10823. case 7:
  10824. i = r && r.envType || this.config.envType;
  10825. _context2.next = 10;
  10826. return this.getOSSUploadOptionsFromPath({
  10827. env: i,
  10828. filename: t
  10829. });
  10830. case 10:
  10831. o = _context2.sent.result;
  10832. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  10833. c = o.securityToken;
  10834. u = o.accessKeyId;
  10835. l = o.signature;
  10836. h = o.host;
  10837. d = o.ossPath;
  10838. p = o.id;
  10839. f = o.policy;
  10840. m = o.ossCallbackUrl;
  10841. y = {
  10842. "Cache-Control": "max-age=2592000",
  10843. "Content-Disposition": "attachment",
  10844. OSSAccessKeyId: u,
  10845. Signature: l,
  10846. host: h,
  10847. id: p,
  10848. key: d,
  10849. policy: f,
  10850. success_action_status: 200
  10851. };
  10852. if (c && (y["x-oss-security-token"] = c), m) {
  10853. _e5 = JSON.stringify({
  10854. callbackUrl: m,
  10855. callbackBody: JSON.stringify({
  10856. fileId: p,
  10857. spaceId: this.config.spaceId
  10858. }),
  10859. callbackBodyType: "application/json"
  10860. });
  10861. y.callback = he.toBase64(_e5);
  10862. }
  10863. _ = {
  10864. url: "https://" + o.host,
  10865. formData: y,
  10866. fileName: "file",
  10867. name: "file",
  10868. filePath: e,
  10869. fileType: n
  10870. };
  10871. _context2.next = 25;
  10872. return this.uploadFileToOSS(Object.assign({}, _, {
  10873. onUploadProgress: s
  10874. }));
  10875. case 25:
  10876. if (!m) {
  10877. _context2.next = 27;
  10878. break;
  10879. }
  10880. return _context2.abrupt("return", {
  10881. success: !0,
  10882. filePath: e,
  10883. fileID: a
  10884. });
  10885. case 27:
  10886. _context2.next = 29;
  10887. return this.reportOSSUpload({
  10888. id: p
  10889. });
  10890. case 29:
  10891. if (!_context2.sent.success) {
  10892. _context2.next = 31;
  10893. break;
  10894. }
  10895. return _context2.abrupt("return", {
  10896. success: !0,
  10897. filePath: e,
  10898. fileID: a
  10899. });
  10900. case 31:
  10901. throw new ne({
  10902. code: "UPLOAD_FAILED",
  10903. message: "文件上传失败"
  10904. });
  10905. case 32:
  10906. case "end":
  10907. return _context2.stop();
  10908. }
  10909. }
  10910. }, _callee2, this);
  10911. }));
  10912. function uploadFile(_x) {
  10913. return _uploadFile.apply(this, arguments);
  10914. }
  10915. return uploadFile;
  10916. }()
  10917. }, {
  10918. key: "getTempFileURL",
  10919. value: function getTempFileURL() {
  10920. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10921. e = _ref5.fileList;
  10922. return new Promise(function (t, n) {
  10923. Array.isArray(e) && 0 !== e.length || n(new ne({
  10924. code: "INVALID_PARAM",
  10925. message: "fileList的元素必须是非空的字符串"
  10926. })), t({
  10927. fileList: e.map(function (e) {
  10928. return {
  10929. fileID: e,
  10930. tempFileURL: e
  10931. };
  10932. })
  10933. });
  10934. });
  10935. }
  10936. }, {
  10937. key: "getFileInfo",
  10938. value: function () {
  10939. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  10940. var _ref6,
  10941. e,
  10942. t,
  10943. _args3 = arguments;
  10944. return _regenerator.default.wrap(function _callee3$(_context3) {
  10945. while (1) {
  10946. switch (_context3.prev = _context3.next) {
  10947. case 0:
  10948. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  10949. if (!(!Array.isArray(e) || 0 === e.length)) {
  10950. _context3.next = 3;
  10951. break;
  10952. }
  10953. throw new ne({
  10954. code: "INVALID_PARAM",
  10955. message: "fileList的元素必须是非空的字符串"
  10956. });
  10957. case 3:
  10958. t = {
  10959. method: "serverless.file.resource.info",
  10960. params: JSON.stringify({
  10961. id: e.map(function (e) {
  10962. return e.split("?")[0];
  10963. }).join(",")
  10964. })
  10965. };
  10966. _context3.next = 6;
  10967. return this.request(this.setupRequest(t));
  10968. case 6:
  10969. _context3.t0 = _context3.sent.result;
  10970. return _context3.abrupt("return", {
  10971. fileList: _context3.t0
  10972. });
  10973. case 8:
  10974. case "end":
  10975. return _context3.stop();
  10976. }
  10977. }
  10978. }, _callee3, this);
  10979. }));
  10980. function getFileInfo() {
  10981. return _getFileInfo.apply(this, arguments);
  10982. }
  10983. return getFileInfo;
  10984. }()
  10985. }]);
  10986. return fe;
  10987. }();
  10988. var ge = {
  10989. init: function init(e) {
  10990. var t = new fe(e),
  10991. n = {
  10992. signInAnonymously: function signInAnonymously() {
  10993. return t.authorize();
  10994. },
  10995. getLoginState: function getLoginState() {
  10996. return Promise.resolve(!1);
  10997. }
  10998. };
  10999. return t.auth = function () {
  11000. return n;
  11001. }, t.customAuth = t.auth, t;
  11002. }
  11003. };
  11004. var me = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11005. var ye;
  11006. !function (e) {
  11007. e.local = "local", e.none = "none", e.session = "session";
  11008. }(ye || (ye = {}));
  11009. var _e = function _e() {};
  11010. var we = function we() {
  11011. var e;
  11012. if (!Promise) {
  11013. e = function e() {}, e.promise = {};
  11014. var _t3 = function _t3() {
  11015. throw new ne({
  11016. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  11017. });
  11018. };
  11019. return Object.defineProperty(e.promise, "then", {
  11020. get: _t3
  11021. }), Object.defineProperty(e.promise, "catch", {
  11022. get: _t3
  11023. }), e;
  11024. }
  11025. var t = new Promise(function (t, n) {
  11026. e = function e(_e6, s) {
  11027. return _e6 ? n(_e6) : t(s);
  11028. };
  11029. });
  11030. return e.promise = t, e;
  11031. };
  11032. function ve(e) {
  11033. return void 0 === e;
  11034. }
  11035. function be(e) {
  11036. return "[object Null]" === Object.prototype.toString.call(e);
  11037. }
  11038. var Se;
  11039. function ke(e) {
  11040. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  11041. var n;
  11042. var _iterator = _createForOfIteratorHelper(t),
  11043. _step;
  11044. try {
  11045. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  11046. var _e7 = _step.value;
  11047. var _t4 = _e7.isMatch,
  11048. _n4 = _e7.genAdapter,
  11049. _s4 = _e7.runtime;
  11050. if (_t4()) return {
  11051. adapter: _n4(),
  11052. runtime: _s4
  11053. };
  11054. }
  11055. } catch (err) {
  11056. _iterator.e(err);
  11057. } finally {
  11058. _iterator.f();
  11059. }
  11060. }
  11061. !function (e) {
  11062. e.WEB = "web", e.WX_MP = "wx_mp";
  11063. }(Se || (Se = {}));
  11064. var Ie = {
  11065. adapter: null,
  11066. runtime: void 0
  11067. },
  11068. Te = ["anonymousUuidKey"];
  11069. var Ce = /*#__PURE__*/function (_e8) {
  11070. (0, _inherits2.default)(Ce, _e8);
  11071. var _super2 = _createSuper(Ce);
  11072. function Ce() {
  11073. var _this6;
  11074. (0, _classCallCheck2.default)(this, Ce);
  11075. _this6 = _super2.call(this), Ie.adapter.root.tcbObject || (Ie.adapter.root.tcbObject = {});
  11076. return _this6;
  11077. }
  11078. (0, _createClass2.default)(Ce, [{
  11079. key: "setItem",
  11080. value: function setItem(e, t) {
  11081. Ie.adapter.root.tcbObject[e] = t;
  11082. }
  11083. }, {
  11084. key: "getItem",
  11085. value: function getItem(e) {
  11086. return Ie.adapter.root.tcbObject[e];
  11087. }
  11088. }, {
  11089. key: "removeItem",
  11090. value: function removeItem(e) {
  11091. delete Ie.adapter.root.tcbObject[e];
  11092. }
  11093. }, {
  11094. key: "clear",
  11095. value: function clear() {
  11096. delete Ie.adapter.root.tcbObject;
  11097. }
  11098. }]);
  11099. return Ce;
  11100. }(_e);
  11101. function Ae(e, t) {
  11102. switch (e) {
  11103. case "local":
  11104. return t.localStorage || new Ce();
  11105. case "none":
  11106. return new Ce();
  11107. default:
  11108. return t.sessionStorage || new Ce();
  11109. }
  11110. }
  11111. var Pe = /*#__PURE__*/function () {
  11112. function Pe(e) {
  11113. (0, _classCallCheck2.default)(this, Pe);
  11114. if (!this._storage) {
  11115. this._persistence = Ie.adapter.primaryStorage || e.persistence, this._storage = Ae(this._persistence, Ie.adapter);
  11116. var _t5 = "access_token_".concat(e.env),
  11117. _n5 = "access_token_expire_".concat(e.env),
  11118. _s5 = "refresh_token_".concat(e.env),
  11119. _r = "anonymous_uuid_".concat(e.env),
  11120. _i = "login_type_".concat(e.env),
  11121. _o = "user_info_".concat(e.env);
  11122. this.keys = {
  11123. accessTokenKey: _t5,
  11124. accessTokenExpireKey: _n5,
  11125. refreshTokenKey: _s5,
  11126. anonymousUuidKey: _r,
  11127. loginTypeKey: _i,
  11128. userInfoKey: _o
  11129. };
  11130. }
  11131. }
  11132. (0, _createClass2.default)(Pe, [{
  11133. key: "updatePersistence",
  11134. value: function updatePersistence(e) {
  11135. if (e === this._persistence) return;
  11136. var t = "local" === this._persistence;
  11137. this._persistence = e;
  11138. var n = Ae(e, Ie.adapter);
  11139. for (var _e9 in this.keys) {
  11140. var _s6 = this.keys[_e9];
  11141. if (t && Te.includes(_e9)) continue;
  11142. var _r2 = this._storage.getItem(_s6);
  11143. ve(_r2) || be(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  11144. }
  11145. this._storage = n;
  11146. }
  11147. }, {
  11148. key: "setStore",
  11149. value: function setStore(e, t, n) {
  11150. if (!this._storage) return;
  11151. var s = {
  11152. version: n || "localCachev1",
  11153. content: t
  11154. },
  11155. r = JSON.stringify(s);
  11156. try {
  11157. this._storage.setItem(e, r);
  11158. } catch (e) {
  11159. throw e;
  11160. }
  11161. }
  11162. }, {
  11163. key: "getStore",
  11164. value: function getStore(e, t) {
  11165. try {
  11166. if (!this._storage) return;
  11167. } catch (e) {
  11168. return "";
  11169. }
  11170. t = t || "localCachev1";
  11171. var n = this._storage.getItem(e);
  11172. if (!n) return "";
  11173. if (n.indexOf(t) >= 0) {
  11174. return JSON.parse(n).content;
  11175. }
  11176. return "";
  11177. }
  11178. }, {
  11179. key: "removeStore",
  11180. value: function removeStore(e) {
  11181. this._storage.removeItem(e);
  11182. }
  11183. }]);
  11184. return Pe;
  11185. }();
  11186. var Ee = {},
  11187. Oe = {};
  11188. function xe(e) {
  11189. return Ee[e];
  11190. }
  11191. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  11192. (0, _classCallCheck2.default)(this, Re);
  11193. this.data = t || null, this.name = e;
  11194. });
  11195. var Ue = /*#__PURE__*/function (_Re) {
  11196. (0, _inherits2.default)(Ue, _Re);
  11197. var _super3 = _createSuper(Ue);
  11198. function Ue(e, t) {
  11199. var _this7;
  11200. (0, _classCallCheck2.default)(this, Ue);
  11201. _this7 = _super3.call(this, "error", {
  11202. error: e,
  11203. data: t
  11204. }), _this7.error = e;
  11205. return _this7;
  11206. }
  11207. return (0, _createClass2.default)(Ue);
  11208. }(Re);
  11209. var Le = new ( /*#__PURE__*/function () {
  11210. function _class() {
  11211. (0, _classCallCheck2.default)(this, _class);
  11212. this._listeners = {};
  11213. }
  11214. (0, _createClass2.default)(_class, [{
  11215. key: "on",
  11216. value: function on(e, t) {
  11217. return function (e, t, n) {
  11218. n[e] = n[e] || [], n[e].push(t);
  11219. }(e, t, this._listeners), this;
  11220. }
  11221. }, {
  11222. key: "off",
  11223. value: function off(e, t) {
  11224. return function (e, t, n) {
  11225. if (n && n[e]) {
  11226. var _s7 = n[e].indexOf(t);
  11227. -1 !== _s7 && n[e].splice(_s7, 1);
  11228. }
  11229. }(e, t, this._listeners), this;
  11230. }
  11231. }, {
  11232. key: "fire",
  11233. value: function fire(e, t) {
  11234. if (e instanceof Ue) return console.error(e.error), this;
  11235. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  11236. var s = n.name;
  11237. if (this._listens(s)) {
  11238. n.target = this;
  11239. var _e10 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  11240. var _iterator2 = _createForOfIteratorHelper(_e10),
  11241. _step2;
  11242. try {
  11243. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  11244. var _t6 = _step2.value;
  11245. _t6.call(this, n);
  11246. }
  11247. } catch (err) {
  11248. _iterator2.e(err);
  11249. } finally {
  11250. _iterator2.f();
  11251. }
  11252. }
  11253. return this;
  11254. }
  11255. }, {
  11256. key: "_listens",
  11257. value: function _listens(e) {
  11258. return this._listeners[e] && this._listeners[e].length > 0;
  11259. }
  11260. }]);
  11261. return _class;
  11262. }())();
  11263. function Ne(e, t) {
  11264. Le.on(e, t);
  11265. }
  11266. function De(e) {
  11267. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11268. Le.fire(e, t);
  11269. }
  11270. function Fe(e, t) {
  11271. Le.off(e, t);
  11272. }
  11273. var qe = "loginStateChanged",
  11274. Ke = "loginStateExpire",
  11275. Me = "loginTypeChanged",
  11276. je = "anonymousConverted",
  11277. Be = "refreshAccessToken";
  11278. var $e;
  11279. !function (e) {
  11280. 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";
  11281. }($e || ($e = {}));
  11282. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  11283. ze = {
  11284. "X-SDK-Version": "1.3.5"
  11285. };
  11286. function Je(e, t, n) {
  11287. var s = e[t];
  11288. e[t] = function (t) {
  11289. var r = {},
  11290. i = {};
  11291. n.forEach(function (n) {
  11292. var _n$call = n.call(e, t),
  11293. s = _n$call.data,
  11294. o = _n$call.headers;
  11295. Object.assign(r, s), Object.assign(i, o);
  11296. });
  11297. var o = t.data;
  11298. return o && function () {
  11299. var e;
  11300. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e11 in r) {
  11301. o.append(_e11, r[_e11]);
  11302. }
  11303. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  11304. };
  11305. }
  11306. function He() {
  11307. var e = Math.random().toString(16).slice(2);
  11308. return {
  11309. data: {
  11310. seqId: e
  11311. },
  11312. headers: _objectSpread(_objectSpread({}, ze), {}, {
  11313. "x-seqid": e
  11314. })
  11315. };
  11316. }
  11317. var Ge = /*#__PURE__*/function () {
  11318. function Ge() {
  11319. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11320. (0, _classCallCheck2.default)(this, Ge);
  11321. var t;
  11322. this.config = e, this._reqClass = new Ie.adapter.reqClass({
  11323. timeout: this.config.timeout,
  11324. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  11325. restrictedMethods: ["post"]
  11326. }), 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]);
  11327. }
  11328. (0, _createClass2.default)(Ge, [{
  11329. key: "post",
  11330. value: function () {
  11331. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  11332. return _regenerator.default.wrap(function _callee4$(_context4) {
  11333. while (1) {
  11334. switch (_context4.prev = _context4.next) {
  11335. case 0:
  11336. _context4.next = 2;
  11337. return this._reqClass.post(e);
  11338. case 2:
  11339. return _context4.abrupt("return", _context4.sent);
  11340. case 3:
  11341. case "end":
  11342. return _context4.stop();
  11343. }
  11344. }
  11345. }, _callee4, this);
  11346. }));
  11347. function post(_x2) {
  11348. return _post.apply(this, arguments);
  11349. }
  11350. return post;
  11351. }()
  11352. }, {
  11353. key: "upload",
  11354. value: function () {
  11355. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  11356. return _regenerator.default.wrap(function _callee5$(_context5) {
  11357. while (1) {
  11358. switch (_context5.prev = _context5.next) {
  11359. case 0:
  11360. _context5.next = 2;
  11361. return this._reqClass.upload(e);
  11362. case 2:
  11363. return _context5.abrupt("return", _context5.sent);
  11364. case 3:
  11365. case "end":
  11366. return _context5.stop();
  11367. }
  11368. }
  11369. }, _callee5, this);
  11370. }));
  11371. function upload(_x3) {
  11372. return _upload.apply(this, arguments);
  11373. }
  11374. return upload;
  11375. }()
  11376. }, {
  11377. key: "download",
  11378. value: function () {
  11379. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  11380. return _regenerator.default.wrap(function _callee6$(_context6) {
  11381. while (1) {
  11382. switch (_context6.prev = _context6.next) {
  11383. case 0:
  11384. _context6.next = 2;
  11385. return this._reqClass.download(e);
  11386. case 2:
  11387. return _context6.abrupt("return", _context6.sent);
  11388. case 3:
  11389. case "end":
  11390. return _context6.stop();
  11391. }
  11392. }
  11393. }, _callee6, this);
  11394. }));
  11395. function download(_x4) {
  11396. return _download.apply(this, arguments);
  11397. }
  11398. return download;
  11399. }()
  11400. }, {
  11401. key: "refreshAccessToken",
  11402. value: function () {
  11403. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  11404. var e, t;
  11405. return _regenerator.default.wrap(function _callee7$(_context7) {
  11406. while (1) {
  11407. switch (_context7.prev = _context7.next) {
  11408. case 0:
  11409. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  11410. _context7.prev = 1;
  11411. _context7.next = 4;
  11412. return this._refreshAccessTokenPromise;
  11413. case 4:
  11414. e = _context7.sent;
  11415. _context7.next = 10;
  11416. break;
  11417. case 7:
  11418. _context7.prev = 7;
  11419. _context7.t0 = _context7["catch"](1);
  11420. t = _context7.t0;
  11421. case 10:
  11422. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  11423. _context7.next = 12;
  11424. break;
  11425. }
  11426. throw t;
  11427. case 12:
  11428. return _context7.abrupt("return", e);
  11429. case 13:
  11430. case "end":
  11431. return _context7.stop();
  11432. }
  11433. }
  11434. }, _callee7, this, [[1, 7]]);
  11435. }));
  11436. function refreshAccessToken() {
  11437. return _refreshAccessToken2.apply(this, arguments);
  11438. }
  11439. return refreshAccessToken;
  11440. }()
  11441. }, {
  11442. key: "_refreshAccessToken",
  11443. value: function () {
  11444. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  11445. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e12, _e13, _t7, _s8;
  11446. return _regenerator.default.wrap(function _callee8$(_context8) {
  11447. while (1) {
  11448. switch (_context8.prev = _context8.next) {
  11449. case 0:
  11450. _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;
  11451. this._cache.removeStore(e), this._cache.removeStore(t);
  11452. i = this._cache.getStore(n);
  11453. if (i) {
  11454. _context8.next = 5;
  11455. break;
  11456. }
  11457. throw new ne({
  11458. message: "未登录CloudBase"
  11459. });
  11460. case 5:
  11461. o = {
  11462. refresh_token: i
  11463. };
  11464. _context8.next = 8;
  11465. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  11466. case 8:
  11467. a = _context8.sent;
  11468. if (!a.data.code) {
  11469. _context8.next = 21;
  11470. break;
  11471. }
  11472. _e12 = a.data.code;
  11473. if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {
  11474. _context8.next = 20;
  11475. break;
  11476. }
  11477. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {
  11478. _context8.next = 19;
  11479. break;
  11480. }
  11481. _e13 = this._cache.getStore(r);
  11482. _t7 = this._cache.getStore(n);
  11483. _context8.next = 17;
  11484. return this.send("auth.signInAnonymously", {
  11485. anonymous_uuid: _e13,
  11486. refresh_token: _t7
  11487. });
  11488. case 17:
  11489. _s8 = _context8.sent;
  11490. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  11491. case 19:
  11492. De(Ke), this._cache.removeStore(n);
  11493. case 20:
  11494. throw new ne({
  11495. code: a.data.code,
  11496. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  11497. });
  11498. case 21:
  11499. if (!a.data.access_token) {
  11500. _context8.next = 23;
  11501. break;
  11502. }
  11503. 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()), {
  11504. accessToken: a.data.access_token,
  11505. accessTokenExpire: a.data.access_token_expire
  11506. }));
  11507. case 23:
  11508. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  11509. case 24:
  11510. case "end":
  11511. return _context8.stop();
  11512. }
  11513. }
  11514. }, _callee8, this);
  11515. }));
  11516. function _refreshAccessToken() {
  11517. return _refreshAccessToken3.apply(this, arguments);
  11518. }
  11519. return _refreshAccessToken;
  11520. }()
  11521. }, {
  11522. key: "getAccessToken",
  11523. value: function () {
  11524. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  11525. var _this$_cache$keys2, e, t, n, s, r, i;
  11526. return _regenerator.default.wrap(function _callee9$(_context9) {
  11527. while (1) {
  11528. switch (_context9.prev = _context9.next) {
  11529. case 0:
  11530. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  11531. if (this._cache.getStore(n)) {
  11532. _context9.next = 3;
  11533. break;
  11534. }
  11535. throw new ne({
  11536. message: "refresh token不存在,登录状态异常"
  11537. });
  11538. case 3:
  11539. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  11540. _context9.t0 = this._shouldRefreshAccessTokenHook;
  11541. if (!_context9.t0) {
  11542. _context9.next = 9;
  11543. break;
  11544. }
  11545. _context9.next = 8;
  11546. return this._shouldRefreshAccessTokenHook(s, r);
  11547. case 8:
  11548. _context9.t0 = !_context9.sent;
  11549. case 9:
  11550. _context9.t1 = _context9.t0;
  11551. if (!_context9.t1) {
  11552. _context9.next = 12;
  11553. break;
  11554. }
  11555. i = !1;
  11556. case 12:
  11557. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  11558. accessToken: s,
  11559. accessTokenExpire: r
  11560. });
  11561. case 13:
  11562. case "end":
  11563. return _context9.stop();
  11564. }
  11565. }
  11566. }, _callee9, this);
  11567. }));
  11568. function getAccessToken() {
  11569. return _getAccessToken.apply(this, arguments);
  11570. }
  11571. return getAccessToken;
  11572. }()
  11573. }, {
  11574. key: "request",
  11575. value: function () {
  11576. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  11577. var s, r, i, _e14, o, _e15, _e16, a, c, u, l, h, d, p, f, g;
  11578. return _regenerator.default.wrap(function _callee10$(_context10) {
  11579. while (1) {
  11580. switch (_context10.prev = _context10.next) {
  11581. case 0:
  11582. s = "x-tcb-trace_".concat(this.config.env);
  11583. r = "application/x-www-form-urlencoded";
  11584. i = _objectSpread({
  11585. action: e,
  11586. env: this.config.env,
  11587. dataVersion: "2019-08-16"
  11588. }, t);
  11589. if (!(-1 === We.indexOf(e))) {
  11590. _context10.next = 10;
  11591. break;
  11592. }
  11593. _e14 = this._cache.keys.refreshTokenKey;
  11594. _context10.t0 = this._cache.getStore(_e14);
  11595. if (!_context10.t0) {
  11596. _context10.next = 10;
  11597. break;
  11598. }
  11599. _context10.next = 9;
  11600. return this.getAccessToken();
  11601. case 9:
  11602. i.access_token = _context10.sent.accessToken;
  11603. case 10:
  11604. if ("storage.uploadFile" === e) {
  11605. o = new FormData();
  11606. for (_e15 in o) {
  11607. o.hasOwnProperty(_e15) && void 0 !== o[_e15] && o.append(_e15, i[_e15]);
  11608. }
  11609. r = "multipart/form-data";
  11610. } else {
  11611. r = "application/json", o = {};
  11612. for (_e16 in i) {
  11613. void 0 !== i[_e16] && (o[_e16] = i[_e16]);
  11614. }
  11615. }
  11616. a = {
  11617. headers: {
  11618. "content-type": r
  11619. }
  11620. };
  11621. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  11622. c = this._localCache.getStore(s);
  11623. c && (a.headers["X-TCB-Trace"] = c);
  11624. u = t.parse, l = t.inQuery, h = t.search;
  11625. d = {
  11626. env: this.config.env
  11627. };
  11628. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  11629. p = function (e, t) {
  11630. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  11631. var s = /\?/.test(t);
  11632. var r = "";
  11633. for (var _e17 in n) {
  11634. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));
  11635. }
  11636. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  11637. }(me, "//tcb-api.tencentcloudapi.com/web", d);
  11638. h && (p += h);
  11639. _context10.next = 22;
  11640. return this.post(_objectSpread({
  11641. url: p,
  11642. data: o
  11643. }, a));
  11644. case 22:
  11645. f = _context10.sent;
  11646. g = f.header && f.header["x-tcb-trace"];
  11647. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  11648. _context10.next = 26;
  11649. break;
  11650. }
  11651. throw new ne({
  11652. code: "NETWORK_ERROR",
  11653. message: "network request error"
  11654. });
  11655. case 26:
  11656. return _context10.abrupt("return", f);
  11657. case 27:
  11658. case "end":
  11659. return _context10.stop();
  11660. }
  11661. }
  11662. }, _callee10, this);
  11663. }));
  11664. function request(_x5, _x6, _x7) {
  11665. return _request.apply(this, arguments);
  11666. }
  11667. return request;
  11668. }()
  11669. }, {
  11670. key: "send",
  11671. value: function () {
  11672. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  11673. var t,
  11674. n,
  11675. _n6,
  11676. _args11 = arguments;
  11677. return _regenerator.default.wrap(function _callee11$(_context11) {
  11678. while (1) {
  11679. switch (_context11.prev = _context11.next) {
  11680. case 0:
  11681. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  11682. _context11.next = 3;
  11683. return this.request(e, t, {
  11684. onUploadProgress: t.onUploadProgress
  11685. });
  11686. case 3:
  11687. n = _context11.sent;
  11688. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  11689. _context11.next = 13;
  11690. break;
  11691. }
  11692. _context11.next = 7;
  11693. return this.refreshAccessToken();
  11694. case 7:
  11695. _context11.next = 9;
  11696. return this.request(e, t, {
  11697. onUploadProgress: t.onUploadProgress
  11698. });
  11699. case 9:
  11700. _n6 = _context11.sent;
  11701. if (!_n6.data.code) {
  11702. _context11.next = 12;
  11703. break;
  11704. }
  11705. throw new ne({
  11706. code: _n6.data.code,
  11707. message: _n6.data.message
  11708. });
  11709. case 12:
  11710. return _context11.abrupt("return", _n6.data);
  11711. case 13:
  11712. if (!n.data.code) {
  11713. _context11.next = 15;
  11714. break;
  11715. }
  11716. throw new ne({
  11717. code: n.data.code,
  11718. message: n.data.message
  11719. });
  11720. case 15:
  11721. return _context11.abrupt("return", n.data);
  11722. case 16:
  11723. case "end":
  11724. return _context11.stop();
  11725. }
  11726. }
  11727. }, _callee11, this);
  11728. }));
  11729. function send(_x8) {
  11730. return _send.apply(this, arguments);
  11731. }
  11732. return send;
  11733. }()
  11734. }, {
  11735. key: "setRefreshToken",
  11736. value: function setRefreshToken(e) {
  11737. var _this$_cache$keys3 = this._cache.keys,
  11738. t = _this$_cache$keys3.accessTokenKey,
  11739. n = _this$_cache$keys3.accessTokenExpireKey,
  11740. s = _this$_cache$keys3.refreshTokenKey;
  11741. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  11742. }
  11743. }]);
  11744. return Ge;
  11745. }();
  11746. var Ve = {};
  11747. function Ye(e) {
  11748. return Ve[e];
  11749. }
  11750. var Qe = /*#__PURE__*/function () {
  11751. function Qe(e) {
  11752. (0, _classCallCheck2.default)(this, Qe);
  11753. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env);
  11754. }
  11755. (0, _createClass2.default)(Qe, [{
  11756. key: "setRefreshToken",
  11757. value: function setRefreshToken(e) {
  11758. var _this$_cache$keys4 = this._cache.keys,
  11759. t = _this$_cache$keys4.accessTokenKey,
  11760. n = _this$_cache$keys4.accessTokenExpireKey,
  11761. s = _this$_cache$keys4.refreshTokenKey;
  11762. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  11763. }
  11764. }, {
  11765. key: "setAccessToken",
  11766. value: function setAccessToken(e, t) {
  11767. var _this$_cache$keys5 = this._cache.keys,
  11768. n = _this$_cache$keys5.accessTokenKey,
  11769. s = _this$_cache$keys5.accessTokenExpireKey;
  11770. this._cache.setStore(n, e), this._cache.setStore(s, t);
  11771. }
  11772. }, {
  11773. key: "refreshUserInfo",
  11774. value: function () {
  11775. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  11776. var _yield$this$_request$, e;
  11777. return _regenerator.default.wrap(function _callee12$(_context12) {
  11778. while (1) {
  11779. switch (_context12.prev = _context12.next) {
  11780. case 0:
  11781. _context12.next = 2;
  11782. return this._request.send("auth.getUserInfo", {});
  11783. case 2:
  11784. _yield$this$_request$ = _context12.sent;
  11785. e = _yield$this$_request$.data;
  11786. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  11787. case 5:
  11788. case "end":
  11789. return _context12.stop();
  11790. }
  11791. }
  11792. }, _callee12, this);
  11793. }));
  11794. function refreshUserInfo() {
  11795. return _refreshUserInfo.apply(this, arguments);
  11796. }
  11797. return refreshUserInfo;
  11798. }()
  11799. }, {
  11800. key: "setLocalUserInfo",
  11801. value: function setLocalUserInfo(e) {
  11802. var t = this._cache.keys.userInfoKey;
  11803. this._cache.setStore(t, e);
  11804. }
  11805. }]);
  11806. return Qe;
  11807. }();
  11808. var Xe = /*#__PURE__*/function () {
  11809. function Xe(e) {
  11810. (0, _classCallCheck2.default)(this, Xe);
  11811. if (!e) throw new ne({
  11812. code: "PARAM_ERROR",
  11813. message: "envId is not defined"
  11814. });
  11815. this._envId = e, this._cache = xe(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  11816. }
  11817. (0, _createClass2.default)(Xe, [{
  11818. key: "linkWithTicket",
  11819. value: function linkWithTicket(e) {
  11820. if ("string" != typeof e) throw new ne({
  11821. code: "PARAM_ERROR",
  11822. message: "ticket must be string"
  11823. });
  11824. return this._request.send("auth.linkWithTicket", {
  11825. ticket: e
  11826. });
  11827. }
  11828. }, {
  11829. key: "linkWithRedirect",
  11830. value: function linkWithRedirect(e) {
  11831. e.signInWithRedirect();
  11832. }
  11833. }, {
  11834. key: "updatePassword",
  11835. value: function updatePassword(e, t) {
  11836. return this._request.send("auth.updatePassword", {
  11837. oldPassword: t,
  11838. newPassword: e
  11839. });
  11840. }
  11841. }, {
  11842. key: "updateEmail",
  11843. value: function updateEmail(e) {
  11844. return this._request.send("auth.updateEmail", {
  11845. newEmail: e
  11846. });
  11847. }
  11848. }, {
  11849. key: "updateUsername",
  11850. value: function updateUsername(e) {
  11851. if ("string" != typeof e) throw new ne({
  11852. code: "PARAM_ERROR",
  11853. message: "username must be a string"
  11854. });
  11855. return this._request.send("auth.updateUsername", {
  11856. username: e
  11857. });
  11858. }
  11859. }, {
  11860. key: "getLinkedUidList",
  11861. value: function () {
  11862. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  11863. var _yield$this$_request$2, e, t, n;
  11864. return _regenerator.default.wrap(function _callee13$(_context13) {
  11865. while (1) {
  11866. switch (_context13.prev = _context13.next) {
  11867. case 0:
  11868. _context13.next = 2;
  11869. return this._request.send("auth.getLinkedUidList", {});
  11870. case 2:
  11871. _yield$this$_request$2 = _context13.sent;
  11872. e = _yield$this$_request$2.data;
  11873. t = !1;
  11874. n = e.users;
  11875. return _context13.abrupt("return", (n.forEach(function (e) {
  11876. e.wxOpenId && e.wxPublicId && (t = !0);
  11877. }), {
  11878. users: n,
  11879. hasPrimaryUid: t
  11880. }));
  11881. case 7:
  11882. case "end":
  11883. return _context13.stop();
  11884. }
  11885. }
  11886. }, _callee13, this);
  11887. }));
  11888. function getLinkedUidList() {
  11889. return _getLinkedUidList.apply(this, arguments);
  11890. }
  11891. return getLinkedUidList;
  11892. }()
  11893. }, {
  11894. key: "setPrimaryUid",
  11895. value: function setPrimaryUid(e) {
  11896. return this._request.send("auth.setPrimaryUid", {
  11897. uid: e
  11898. });
  11899. }
  11900. }, {
  11901. key: "unlink",
  11902. value: function unlink(e) {
  11903. return this._request.send("auth.unlink", {
  11904. platform: e
  11905. });
  11906. }
  11907. }, {
  11908. key: "update",
  11909. value: function () {
  11910. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  11911. var t, n, s, r, i, o, _yield$this$_request$3, a;
  11912. return _regenerator.default.wrap(function _callee14$(_context14) {
  11913. while (1) {
  11914. switch (_context14.prev = _context14.next) {
  11915. case 0:
  11916. t = e.nickName;
  11917. n = e.gender;
  11918. s = e.avatarUrl;
  11919. r = e.province;
  11920. i = e.country;
  11921. o = e.city;
  11922. _context14.next = 8;
  11923. return this._request.send("auth.updateUserInfo", {
  11924. nickName: t,
  11925. gender: n,
  11926. avatarUrl: s,
  11927. province: r,
  11928. country: i,
  11929. city: o
  11930. });
  11931. case 8:
  11932. _yield$this$_request$3 = _context14.sent;
  11933. a = _yield$this$_request$3.data;
  11934. this.setLocalUserInfo(a);
  11935. case 11:
  11936. case "end":
  11937. return _context14.stop();
  11938. }
  11939. }
  11940. }, _callee14, this);
  11941. }));
  11942. function update(_x9) {
  11943. return _update.apply(this, arguments);
  11944. }
  11945. return update;
  11946. }()
  11947. }, {
  11948. key: "refresh",
  11949. value: function () {
  11950. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  11951. var _yield$this$_request$4, e;
  11952. return _regenerator.default.wrap(function _callee15$(_context15) {
  11953. while (1) {
  11954. switch (_context15.prev = _context15.next) {
  11955. case 0:
  11956. _context15.next = 2;
  11957. return this._request.send("auth.getUserInfo", {});
  11958. case 2:
  11959. _yield$this$_request$4 = _context15.sent;
  11960. e = _yield$this$_request$4.data;
  11961. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  11962. case 5:
  11963. case "end":
  11964. return _context15.stop();
  11965. }
  11966. }
  11967. }, _callee15, this);
  11968. }));
  11969. function refresh() {
  11970. return _refresh.apply(this, arguments);
  11971. }
  11972. return refresh;
  11973. }()
  11974. }, {
  11975. key: "setUserInfo",
  11976. value: function setUserInfo() {
  11977. var _this8 = this;
  11978. var e = this._cache.keys.userInfoKey,
  11979. t = this._cache.getStore(e);
  11980. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  11981. _this8[e] = t[e];
  11982. }), this.location = {
  11983. country: t.country,
  11984. province: t.province,
  11985. city: t.city
  11986. };
  11987. }
  11988. }, {
  11989. key: "setLocalUserInfo",
  11990. value: function setLocalUserInfo(e) {
  11991. var t = this._cache.keys.userInfoKey;
  11992. this._cache.setStore(t, e), this.setUserInfo();
  11993. }
  11994. }]);
  11995. return Xe;
  11996. }();
  11997. var Ze = /*#__PURE__*/function () {
  11998. function Ze(e) {
  11999. (0, _classCallCheck2.default)(this, Ze);
  12000. if (!e) throw new ne({
  12001. code: "PARAM_ERROR",
  12002. message: "envId is not defined"
  12003. });
  12004. this._cache = xe(e);
  12005. var _this$_cache$keys6 = this._cache.keys,
  12006. t = _this$_cache$keys6.refreshTokenKey,
  12007. n = _this$_cache$keys6.accessTokenKey,
  12008. s = _this$_cache$keys6.accessTokenExpireKey,
  12009. r = this._cache.getStore(t),
  12010. i = this._cache.getStore(n),
  12011. o = this._cache.getStore(s);
  12012. this.credential = {
  12013. refreshToken: r,
  12014. accessToken: i,
  12015. accessTokenExpire: o
  12016. }, this.user = new Xe(e);
  12017. }
  12018. (0, _createClass2.default)(Ze, [{
  12019. key: "isAnonymousAuth",
  12020. get: function get() {
  12021. return this.loginType === $e.ANONYMOUS;
  12022. }
  12023. }, {
  12024. key: "isCustomAuth",
  12025. get: function get() {
  12026. return this.loginType === $e.CUSTOM;
  12027. }
  12028. }, {
  12029. key: "isWeixinAuth",
  12030. get: function get() {
  12031. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  12032. }
  12033. }, {
  12034. key: "loginType",
  12035. get: function get() {
  12036. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12037. }
  12038. }]);
  12039. return Ze;
  12040. }();
  12041. var et = /*#__PURE__*/function (_Qe) {
  12042. (0, _inherits2.default)(et, _Qe);
  12043. var _super4 = _createSuper(et);
  12044. function et() {
  12045. (0, _classCallCheck2.default)(this, et);
  12046. return _super4.apply(this, arguments);
  12047. }
  12048. (0, _createClass2.default)(et, [{
  12049. key: "signIn",
  12050. value: function () {
  12051. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  12052. var _this$_cache$keys7, e, t, n, s, r, _e18;
  12053. return _regenerator.default.wrap(function _callee16$(_context16) {
  12054. while (1) {
  12055. switch (_context16.prev = _context16.next) {
  12056. case 0:
  12057. this._cache.updatePersistence("local");
  12058. _this$_cache$keys7 = this._cache.keys;
  12059. e = _this$_cache$keys7.anonymousUuidKey;
  12060. t = _this$_cache$keys7.refreshTokenKey;
  12061. n = this._cache.getStore(e) || void 0;
  12062. s = this._cache.getStore(t) || void 0;
  12063. _context16.next = 8;
  12064. return this._request.send("auth.signInAnonymously", {
  12065. anonymous_uuid: n,
  12066. refresh_token: s
  12067. });
  12068. case 8:
  12069. r = _context16.sent;
  12070. if (!(r.uuid && r.refresh_token)) {
  12071. _context16.next = 20;
  12072. break;
  12073. }
  12074. this._setAnonymousUUID(r.uuid);
  12075. this.setRefreshToken(r.refresh_token);
  12076. _context16.next = 14;
  12077. return this._request.refreshAccessToken();
  12078. case 14:
  12079. De(qe);
  12080. De(Me, {
  12081. env: this.config.env,
  12082. loginType: $e.ANONYMOUS,
  12083. persistence: "local"
  12084. });
  12085. _e18 = new Ze(this.config.env);
  12086. _context16.next = 19;
  12087. return _e18.user.refresh();
  12088. case 19:
  12089. return _context16.abrupt("return", _e18);
  12090. case 20:
  12091. throw new ne({
  12092. message: "匿名登录失败"
  12093. });
  12094. case 21:
  12095. case "end":
  12096. return _context16.stop();
  12097. }
  12098. }
  12099. }, _callee16, this);
  12100. }));
  12101. function signIn() {
  12102. return _signIn.apply(this, arguments);
  12103. }
  12104. return signIn;
  12105. }()
  12106. }, {
  12107. key: "linkAndRetrieveDataWithTicket",
  12108. value: function () {
  12109. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  12110. var _this$_cache$keys8, t, n, s, r, i;
  12111. return _regenerator.default.wrap(function _callee17$(_context17) {
  12112. while (1) {
  12113. switch (_context17.prev = _context17.next) {
  12114. case 0:
  12115. _this$_cache$keys8 = this._cache.keys;
  12116. t = _this$_cache$keys8.anonymousUuidKey;
  12117. n = _this$_cache$keys8.refreshTokenKey;
  12118. s = this._cache.getStore(t);
  12119. r = this._cache.getStore(n);
  12120. _context17.next = 7;
  12121. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  12122. anonymous_uuid: s,
  12123. refresh_token: r,
  12124. ticket: e
  12125. });
  12126. case 7:
  12127. i = _context17.sent;
  12128. if (!i.refresh_token) {
  12129. _context17.next = 16;
  12130. break;
  12131. }
  12132. this._clearAnonymousUUID();
  12133. this.setRefreshToken(i.refresh_token);
  12134. _context17.next = 13;
  12135. return this._request.refreshAccessToken();
  12136. case 13:
  12137. De(je, {
  12138. env: this.config.env
  12139. });
  12140. De(Me, {
  12141. loginType: $e.CUSTOM,
  12142. persistence: "local"
  12143. });
  12144. return _context17.abrupt("return", {
  12145. credential: {
  12146. refreshToken: i.refresh_token
  12147. }
  12148. });
  12149. case 16:
  12150. throw new ne({
  12151. message: "匿名转化失败"
  12152. });
  12153. case 17:
  12154. case "end":
  12155. return _context17.stop();
  12156. }
  12157. }
  12158. }, _callee17, this);
  12159. }));
  12160. function linkAndRetrieveDataWithTicket(_x10) {
  12161. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  12162. }
  12163. return linkAndRetrieveDataWithTicket;
  12164. }()
  12165. }, {
  12166. key: "_setAnonymousUUID",
  12167. value: function _setAnonymousUUID(e) {
  12168. var _this$_cache$keys9 = this._cache.keys,
  12169. t = _this$_cache$keys9.anonymousUuidKey,
  12170. n = _this$_cache$keys9.loginTypeKey;
  12171. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  12172. }
  12173. }, {
  12174. key: "_clearAnonymousUUID",
  12175. value: function _clearAnonymousUUID() {
  12176. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  12177. }
  12178. }]);
  12179. return et;
  12180. }(Qe);
  12181. var tt = /*#__PURE__*/function (_Qe2) {
  12182. (0, _inherits2.default)(tt, _Qe2);
  12183. var _super5 = _createSuper(tt);
  12184. function tt() {
  12185. (0, _classCallCheck2.default)(this, tt);
  12186. return _super5.apply(this, arguments);
  12187. }
  12188. (0, _createClass2.default)(tt, [{
  12189. key: "signIn",
  12190. value: function () {
  12191. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  12192. var t, n;
  12193. return _regenerator.default.wrap(function _callee18$(_context18) {
  12194. while (1) {
  12195. switch (_context18.prev = _context18.next) {
  12196. case 0:
  12197. if (!("string" != typeof e)) {
  12198. _context18.next = 2;
  12199. break;
  12200. }
  12201. throw new ne({
  12202. code: "PARAM_ERROR",
  12203. message: "ticket must be a string"
  12204. });
  12205. case 2:
  12206. t = this._cache.keys.refreshTokenKey;
  12207. _context18.next = 5;
  12208. return this._request.send("auth.signInWithTicket", {
  12209. ticket: e,
  12210. refresh_token: this._cache.getStore(t) || ""
  12211. });
  12212. case 5:
  12213. n = _context18.sent;
  12214. if (!n.refresh_token) {
  12215. _context18.next = 15;
  12216. break;
  12217. }
  12218. this.setRefreshToken(n.refresh_token);
  12219. _context18.next = 10;
  12220. return this._request.refreshAccessToken();
  12221. case 10:
  12222. De(qe);
  12223. De(Me, {
  12224. env: this.config.env,
  12225. loginType: $e.CUSTOM,
  12226. persistence: this.config.persistence
  12227. });
  12228. _context18.next = 14;
  12229. return this.refreshUserInfo();
  12230. case 14:
  12231. return _context18.abrupt("return", new Ze(this.config.env));
  12232. case 15:
  12233. throw new ne({
  12234. message: "自定义登录失败"
  12235. });
  12236. case 16:
  12237. case "end":
  12238. return _context18.stop();
  12239. }
  12240. }
  12241. }, _callee18, this);
  12242. }));
  12243. function signIn(_x11) {
  12244. return _signIn2.apply(this, arguments);
  12245. }
  12246. return signIn;
  12247. }()
  12248. }]);
  12249. return tt;
  12250. }(Qe);
  12251. var nt = /*#__PURE__*/function (_Qe3) {
  12252. (0, _inherits2.default)(nt, _Qe3);
  12253. var _super6 = _createSuper(nt);
  12254. function nt() {
  12255. (0, _classCallCheck2.default)(this, nt);
  12256. return _super6.apply(this, arguments);
  12257. }
  12258. (0, _createClass2.default)(nt, [{
  12259. key: "signIn",
  12260. value: function () {
  12261. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  12262. var n, s, r, i, o;
  12263. return _regenerator.default.wrap(function _callee19$(_context19) {
  12264. while (1) {
  12265. switch (_context19.prev = _context19.next) {
  12266. case 0:
  12267. if (!("string" != typeof e)) {
  12268. _context19.next = 2;
  12269. break;
  12270. }
  12271. throw new ne({
  12272. code: "PARAM_ERROR",
  12273. message: "email must be a string"
  12274. });
  12275. case 2:
  12276. n = this._cache.keys.refreshTokenKey;
  12277. _context19.next = 5;
  12278. return this._request.send("auth.signIn", {
  12279. loginType: "EMAIL",
  12280. email: e,
  12281. password: t,
  12282. refresh_token: this._cache.getStore(n) || ""
  12283. });
  12284. case 5:
  12285. s = _context19.sent;
  12286. r = s.refresh_token;
  12287. i = s.access_token;
  12288. o = s.access_token_expire;
  12289. if (!r) {
  12290. _context19.next = 22;
  12291. break;
  12292. }
  12293. this.setRefreshToken(r);
  12294. if (!(i && o)) {
  12295. _context19.next = 15;
  12296. break;
  12297. }
  12298. this.setAccessToken(i, o);
  12299. _context19.next = 17;
  12300. break;
  12301. case 15:
  12302. _context19.next = 17;
  12303. return this._request.refreshAccessToken();
  12304. case 17:
  12305. _context19.next = 19;
  12306. return this.refreshUserInfo();
  12307. case 19:
  12308. De(qe);
  12309. De(Me, {
  12310. env: this.config.env,
  12311. loginType: $e.EMAIL,
  12312. persistence: this.config.persistence
  12313. });
  12314. return _context19.abrupt("return", new Ze(this.config.env));
  12315. case 22:
  12316. throw s.code ? new ne({
  12317. code: s.code,
  12318. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12319. }) : new ne({
  12320. message: "邮箱登录失败"
  12321. });
  12322. case 23:
  12323. case "end":
  12324. return _context19.stop();
  12325. }
  12326. }
  12327. }, _callee19, this);
  12328. }));
  12329. function signIn(_x12, _x13) {
  12330. return _signIn3.apply(this, arguments);
  12331. }
  12332. return signIn;
  12333. }()
  12334. }, {
  12335. key: "activate",
  12336. value: function () {
  12337. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  12338. return _regenerator.default.wrap(function _callee20$(_context20) {
  12339. while (1) {
  12340. switch (_context20.prev = _context20.next) {
  12341. case 0:
  12342. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  12343. token: e
  12344. }));
  12345. case 1:
  12346. case "end":
  12347. return _context20.stop();
  12348. }
  12349. }
  12350. }, _callee20, this);
  12351. }));
  12352. function activate(_x14) {
  12353. return _activate.apply(this, arguments);
  12354. }
  12355. return activate;
  12356. }()
  12357. }, {
  12358. key: "resetPasswordWithToken",
  12359. value: function () {
  12360. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  12361. return _regenerator.default.wrap(function _callee21$(_context21) {
  12362. while (1) {
  12363. switch (_context21.prev = _context21.next) {
  12364. case 0:
  12365. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  12366. token: e,
  12367. newPassword: t
  12368. }));
  12369. case 1:
  12370. case "end":
  12371. return _context21.stop();
  12372. }
  12373. }
  12374. }, _callee21, this);
  12375. }));
  12376. function resetPasswordWithToken(_x15, _x16) {
  12377. return _resetPasswordWithToken.apply(this, arguments);
  12378. }
  12379. return resetPasswordWithToken;
  12380. }()
  12381. }]);
  12382. return nt;
  12383. }(Qe);
  12384. var st = /*#__PURE__*/function (_Qe4) {
  12385. (0, _inherits2.default)(st, _Qe4);
  12386. var _super7 = _createSuper(st);
  12387. function st() {
  12388. (0, _classCallCheck2.default)(this, st);
  12389. return _super7.apply(this, arguments);
  12390. }
  12391. (0, _createClass2.default)(st, [{
  12392. key: "signIn",
  12393. value: function () {
  12394. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  12395. var n, s, r, i, o;
  12396. return _regenerator.default.wrap(function _callee22$(_context22) {
  12397. while (1) {
  12398. switch (_context22.prev = _context22.next) {
  12399. case 0:
  12400. if (!("string" != typeof e)) {
  12401. _context22.next = 2;
  12402. break;
  12403. }
  12404. throw new ne({
  12405. code: "PARAM_ERROR",
  12406. message: "username must be a string"
  12407. });
  12408. case 2:
  12409. "string" != typeof t && (t = "", console.warn("password is empty"));
  12410. n = this._cache.keys.refreshTokenKey;
  12411. _context22.next = 6;
  12412. return this._request.send("auth.signIn", {
  12413. loginType: $e.USERNAME,
  12414. username: e,
  12415. password: t,
  12416. refresh_token: this._cache.getStore(n) || ""
  12417. });
  12418. case 6:
  12419. s = _context22.sent;
  12420. r = s.refresh_token;
  12421. i = s.access_token_expire;
  12422. o = s.access_token;
  12423. if (!r) {
  12424. _context22.next = 23;
  12425. break;
  12426. }
  12427. this.setRefreshToken(r);
  12428. if (!(o && i)) {
  12429. _context22.next = 16;
  12430. break;
  12431. }
  12432. this.setAccessToken(o, i);
  12433. _context22.next = 18;
  12434. break;
  12435. case 16:
  12436. _context22.next = 18;
  12437. return this._request.refreshAccessToken();
  12438. case 18:
  12439. _context22.next = 20;
  12440. return this.refreshUserInfo();
  12441. case 20:
  12442. De(qe);
  12443. De(Me, {
  12444. env: this.config.env,
  12445. loginType: $e.USERNAME,
  12446. persistence: this.config.persistence
  12447. });
  12448. return _context22.abrupt("return", new Ze(this.config.env));
  12449. case 23:
  12450. throw s.code ? new ne({
  12451. code: s.code,
  12452. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  12453. }) : new ne({
  12454. message: "用户名密码登录失败"
  12455. });
  12456. case 24:
  12457. case "end":
  12458. return _context22.stop();
  12459. }
  12460. }
  12461. }, _callee22, this);
  12462. }));
  12463. function signIn(_x17, _x18) {
  12464. return _signIn4.apply(this, arguments);
  12465. }
  12466. return signIn;
  12467. }()
  12468. }]);
  12469. return st;
  12470. }(Qe);
  12471. var rt = /*#__PURE__*/function () {
  12472. function rt(e) {
  12473. (0, _classCallCheck2.default)(this, rt);
  12474. 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(Me, this._onLoginTypeChanged);
  12475. }
  12476. (0, _createClass2.default)(rt, [{
  12477. key: "currentUser",
  12478. get: function get() {
  12479. var e = this.hasLoginState();
  12480. return e && e.user || null;
  12481. }
  12482. }, {
  12483. key: "loginType",
  12484. get: function get() {
  12485. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12486. }
  12487. }, {
  12488. key: "anonymousAuthProvider",
  12489. value: function anonymousAuthProvider() {
  12490. return new et(this.config);
  12491. }
  12492. }, {
  12493. key: "customAuthProvider",
  12494. value: function customAuthProvider() {
  12495. return new tt(this.config);
  12496. }
  12497. }, {
  12498. key: "emailAuthProvider",
  12499. value: function emailAuthProvider() {
  12500. return new nt(this.config);
  12501. }
  12502. }, {
  12503. key: "usernameAuthProvider",
  12504. value: function usernameAuthProvider() {
  12505. return new st(this.config);
  12506. }
  12507. }, {
  12508. key: "signInAnonymously",
  12509. value: function () {
  12510. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  12511. return _regenerator.default.wrap(function _callee23$(_context23) {
  12512. while (1) {
  12513. switch (_context23.prev = _context23.next) {
  12514. case 0:
  12515. return _context23.abrupt("return", new et(this.config).signIn());
  12516. case 1:
  12517. case "end":
  12518. return _context23.stop();
  12519. }
  12520. }
  12521. }, _callee23, this);
  12522. }));
  12523. function signInAnonymously() {
  12524. return _signInAnonymously.apply(this, arguments);
  12525. }
  12526. return signInAnonymously;
  12527. }()
  12528. }, {
  12529. key: "signInWithEmailAndPassword",
  12530. value: function () {
  12531. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  12532. return _regenerator.default.wrap(function _callee24$(_context24) {
  12533. while (1) {
  12534. switch (_context24.prev = _context24.next) {
  12535. case 0:
  12536. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  12537. case 1:
  12538. case "end":
  12539. return _context24.stop();
  12540. }
  12541. }
  12542. }, _callee24, this);
  12543. }));
  12544. function signInWithEmailAndPassword(_x19, _x20) {
  12545. return _signInWithEmailAndPassword.apply(this, arguments);
  12546. }
  12547. return signInWithEmailAndPassword;
  12548. }()
  12549. }, {
  12550. key: "signInWithUsernameAndPassword",
  12551. value: function signInWithUsernameAndPassword(e, t) {
  12552. return new st(this.config).signIn(e, t);
  12553. }
  12554. }, {
  12555. key: "linkAndRetrieveDataWithTicket",
  12556. value: function () {
  12557. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  12558. return _regenerator.default.wrap(function _callee25$(_context25) {
  12559. while (1) {
  12560. switch (_context25.prev = _context25.next) {
  12561. case 0:
  12562. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  12563. _context25.next = 3;
  12564. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  12565. case 3:
  12566. return _context25.abrupt("return", _context25.sent);
  12567. case 4:
  12568. case "end":
  12569. return _context25.stop();
  12570. }
  12571. }
  12572. }, _callee25, this);
  12573. }));
  12574. function linkAndRetrieveDataWithTicket(_x21) {
  12575. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  12576. }
  12577. return linkAndRetrieveDataWithTicket;
  12578. }()
  12579. }, {
  12580. key: "signOut",
  12581. value: function () {
  12582. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  12583. var _this$_cache$keys10, e, t, n, s, r;
  12584. return _regenerator.default.wrap(function _callee26$(_context26) {
  12585. while (1) {
  12586. switch (_context26.prev = _context26.next) {
  12587. case 0:
  12588. if (!(this.loginType === $e.ANONYMOUS)) {
  12589. _context26.next = 2;
  12590. break;
  12591. }
  12592. throw new ne({
  12593. message: "匿名用户不支持登出操作"
  12594. });
  12595. case 2:
  12596. _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);
  12597. if (s) {
  12598. _context26.next = 5;
  12599. break;
  12600. }
  12601. return _context26.abrupt("return");
  12602. case 5:
  12603. _context26.next = 7;
  12604. return this._request.send("auth.logout", {
  12605. refresh_token: s
  12606. });
  12607. case 7:
  12608. r = _context26.sent;
  12609. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Me, {
  12610. env: this.config.env,
  12611. loginType: $e.NULL,
  12612. persistence: this.config.persistence
  12613. }), r));
  12614. case 9:
  12615. case "end":
  12616. return _context26.stop();
  12617. }
  12618. }
  12619. }, _callee26, this);
  12620. }));
  12621. function signOut() {
  12622. return _signOut.apply(this, arguments);
  12623. }
  12624. return signOut;
  12625. }()
  12626. }, {
  12627. key: "signUpWithEmailAndPassword",
  12628. value: function () {
  12629. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  12630. return _regenerator.default.wrap(function _callee27$(_context27) {
  12631. while (1) {
  12632. switch (_context27.prev = _context27.next) {
  12633. case 0:
  12634. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  12635. email: e,
  12636. password: t
  12637. }));
  12638. case 1:
  12639. case "end":
  12640. return _context27.stop();
  12641. }
  12642. }
  12643. }, _callee27, this);
  12644. }));
  12645. function signUpWithEmailAndPassword(_x22, _x23) {
  12646. return _signUpWithEmailAndPassword.apply(this, arguments);
  12647. }
  12648. return signUpWithEmailAndPassword;
  12649. }()
  12650. }, {
  12651. key: "sendPasswordResetEmail",
  12652. value: function () {
  12653. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  12654. return _regenerator.default.wrap(function _callee28$(_context28) {
  12655. while (1) {
  12656. switch (_context28.prev = _context28.next) {
  12657. case 0:
  12658. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  12659. email: e
  12660. }));
  12661. case 1:
  12662. case "end":
  12663. return _context28.stop();
  12664. }
  12665. }
  12666. }, _callee28, this);
  12667. }));
  12668. function sendPasswordResetEmail(_x24) {
  12669. return _sendPasswordResetEmail.apply(this, arguments);
  12670. }
  12671. return sendPasswordResetEmail;
  12672. }()
  12673. }, {
  12674. key: "onLoginStateChanged",
  12675. value: function onLoginStateChanged(e) {
  12676. var _this9 = this;
  12677. Ne(qe, function () {
  12678. var t = _this9.hasLoginState();
  12679. e.call(_this9, t);
  12680. });
  12681. var t = this.hasLoginState();
  12682. e.call(this, t);
  12683. }
  12684. }, {
  12685. key: "onLoginStateExpired",
  12686. value: function onLoginStateExpired(e) {
  12687. Ne(Ke, e.bind(this));
  12688. }
  12689. }, {
  12690. key: "onAccessTokenRefreshed",
  12691. value: function onAccessTokenRefreshed(e) {
  12692. Ne(Be, e.bind(this));
  12693. }
  12694. }, {
  12695. key: "onAnonymousConverted",
  12696. value: function onAnonymousConverted(e) {
  12697. Ne(je, e.bind(this));
  12698. }
  12699. }, {
  12700. key: "onLoginTypeChanged",
  12701. value: function onLoginTypeChanged(e) {
  12702. var _this10 = this;
  12703. Ne(Me, function () {
  12704. var t = _this10.hasLoginState();
  12705. e.call(_this10, t);
  12706. });
  12707. }
  12708. }, {
  12709. key: "getAccessToken",
  12710. value: function () {
  12711. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  12712. return _regenerator.default.wrap(function _callee29$(_context29) {
  12713. while (1) {
  12714. switch (_context29.prev = _context29.next) {
  12715. case 0:
  12716. _context29.next = 2;
  12717. return this._request.getAccessToken();
  12718. case 2:
  12719. _context29.t0 = _context29.sent.accessToken;
  12720. _context29.t1 = this.config.env;
  12721. return _context29.abrupt("return", {
  12722. accessToken: _context29.t0,
  12723. env: _context29.t1
  12724. });
  12725. case 5:
  12726. case "end":
  12727. return _context29.stop();
  12728. }
  12729. }
  12730. }, _callee29, this);
  12731. }));
  12732. function getAccessToken() {
  12733. return _getAccessToken2.apply(this, arguments);
  12734. }
  12735. return getAccessToken;
  12736. }()
  12737. }, {
  12738. key: "hasLoginState",
  12739. value: function hasLoginState() {
  12740. var e = this._cache.keys.refreshTokenKey;
  12741. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  12742. }
  12743. }, {
  12744. key: "isUsernameRegistered",
  12745. value: function () {
  12746. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  12747. var _yield$this$_request$5, t;
  12748. return _regenerator.default.wrap(function _callee30$(_context30) {
  12749. while (1) {
  12750. switch (_context30.prev = _context30.next) {
  12751. case 0:
  12752. if (!("string" != typeof e)) {
  12753. _context30.next = 2;
  12754. break;
  12755. }
  12756. throw new ne({
  12757. code: "PARAM_ERROR",
  12758. message: "username must be a string"
  12759. });
  12760. case 2:
  12761. _context30.next = 4;
  12762. return this._request.send("auth.isUsernameRegistered", {
  12763. username: e
  12764. });
  12765. case 4:
  12766. _yield$this$_request$5 = _context30.sent;
  12767. t = _yield$this$_request$5.data;
  12768. return _context30.abrupt("return", t && t.isRegistered);
  12769. case 7:
  12770. case "end":
  12771. return _context30.stop();
  12772. }
  12773. }
  12774. }, _callee30, this);
  12775. }));
  12776. function isUsernameRegistered(_x25) {
  12777. return _isUsernameRegistered.apply(this, arguments);
  12778. }
  12779. return isUsernameRegistered;
  12780. }()
  12781. }, {
  12782. key: "getLoginState",
  12783. value: function getLoginState() {
  12784. return Promise.resolve(this.hasLoginState());
  12785. }
  12786. }, {
  12787. key: "signInWithTicket",
  12788. value: function () {
  12789. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  12790. return _regenerator.default.wrap(function _callee31$(_context31) {
  12791. while (1) {
  12792. switch (_context31.prev = _context31.next) {
  12793. case 0:
  12794. return _context31.abrupt("return", new tt(this.config).signIn(e));
  12795. case 1:
  12796. case "end":
  12797. return _context31.stop();
  12798. }
  12799. }
  12800. }, _callee31, this);
  12801. }));
  12802. function signInWithTicket(_x26) {
  12803. return _signInWithTicket.apply(this, arguments);
  12804. }
  12805. return signInWithTicket;
  12806. }()
  12807. }, {
  12808. key: "shouldRefreshAccessToken",
  12809. value: function shouldRefreshAccessToken(e) {
  12810. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  12811. }
  12812. }, {
  12813. key: "getUserInfo",
  12814. value: function getUserInfo() {
  12815. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  12816. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  12817. requestId: e.seqId
  12818. });
  12819. });
  12820. }
  12821. }, {
  12822. key: "getAuthHeader",
  12823. value: function getAuthHeader() {
  12824. var _this$_cache$keys11 = this._cache.keys,
  12825. e = _this$_cache$keys11.refreshTokenKey,
  12826. t = _this$_cache$keys11.accessTokenKey,
  12827. n = this._cache.getStore(e);
  12828. return {
  12829. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  12830. };
  12831. }
  12832. }, {
  12833. key: "_onAnonymousConverted",
  12834. value: function _onAnonymousConverted(e) {
  12835. var t = e.data.env;
  12836. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  12837. }
  12838. }, {
  12839. key: "_onLoginTypeChanged",
  12840. value: function _onLoginTypeChanged(e) {
  12841. var _e$data = e.data,
  12842. t = _e$data.loginType,
  12843. n = _e$data.persistence,
  12844. s = _e$data.env;
  12845. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  12846. }
  12847. }]);
  12848. return rt;
  12849. }();
  12850. var it = function it(e, t) {
  12851. t = t || we();
  12852. var n = Ye(this.config.env),
  12853. s = e.cloudPath,
  12854. r = e.filePath,
  12855. i = e.onUploadProgress,
  12856. _e$fileType = e.fileType,
  12857. o = _e$fileType === void 0 ? "image" : _e$fileType;
  12858. return n.send("storage.getUploadMetadata", {
  12859. path: s
  12860. }).then(function (e) {
  12861. var _e$data2 = e.data,
  12862. a = _e$data2.url,
  12863. c = _e$data2.authorization,
  12864. u = _e$data2.token,
  12865. l = _e$data2.fileId,
  12866. h = _e$data2.cosFileId,
  12867. d = e.requestId,
  12868. p = {
  12869. key: s,
  12870. signature: c,
  12871. "x-cos-meta-fileid": h,
  12872. success_action_status: "201",
  12873. "x-cos-security-token": u
  12874. };
  12875. n.upload({
  12876. url: a,
  12877. data: p,
  12878. file: r,
  12879. name: s,
  12880. fileType: o,
  12881. onUploadProgress: i
  12882. }).then(function (e) {
  12883. 201 === e.statusCode ? t(null, {
  12884. fileID: l,
  12885. requestId: d
  12886. }) : t(new ne({
  12887. code: "STORAGE_REQUEST_FAIL",
  12888. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  12889. }));
  12890. }).catch(function (e) {
  12891. t(e);
  12892. });
  12893. }).catch(function (e) {
  12894. t(e);
  12895. }), t.promise;
  12896. },
  12897. ot = function ot(e, t) {
  12898. t = t || we();
  12899. var n = Ye(this.config.env),
  12900. s = e.cloudPath;
  12901. return n.send("storage.getUploadMetadata", {
  12902. path: s
  12903. }).then(function (e) {
  12904. t(null, e);
  12905. }).catch(function (e) {
  12906. t(e);
  12907. }), t.promise;
  12908. },
  12909. at = function at(_ref7, t) {
  12910. var e = _ref7.fileList;
  12911. if (t = t || we(), !e || !Array.isArray(e)) return {
  12912. code: "INVALID_PARAM",
  12913. message: "fileList必须是非空的数组"
  12914. };
  12915. var _iterator3 = _createForOfIteratorHelper(e),
  12916. _step3;
  12917. try {
  12918. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  12919. var _t8 = _step3.value;
  12920. if (!_t8 || "string" != typeof _t8) return {
  12921. code: "INVALID_PARAM",
  12922. message: "fileList的元素必须是非空的字符串"
  12923. };
  12924. }
  12925. } catch (err) {
  12926. _iterator3.e(err);
  12927. } finally {
  12928. _iterator3.f();
  12929. }
  12930. var n = {
  12931. fileid_list: e
  12932. };
  12933. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  12934. e.code ? t(null, e) : t(null, {
  12935. fileList: e.data.delete_list,
  12936. requestId: e.requestId
  12937. });
  12938. }).catch(function (e) {
  12939. t(e);
  12940. }), t.promise;
  12941. },
  12942. ct = function ct(_ref8, t) {
  12943. var e = _ref8.fileList;
  12944. t = t || we(), e && Array.isArray(e) || t(null, {
  12945. code: "INVALID_PARAM",
  12946. message: "fileList必须是非空的数组"
  12947. });
  12948. var n = [];
  12949. var _iterator4 = _createForOfIteratorHelper(e),
  12950. _step4;
  12951. try {
  12952. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  12953. var _s9 = _step4.value;
  12954. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  12955. code: "INVALID_PARAM",
  12956. message: "fileList的元素必须是包含fileID和maxAge的对象"
  12957. }), n.push({
  12958. fileid: _s9.fileID,
  12959. max_age: _s9.maxAge
  12960. })) : "string" == typeof _s9 ? n.push({
  12961. fileid: _s9
  12962. }) : t(null, {
  12963. code: "INVALID_PARAM",
  12964. message: "fileList的元素必须是字符串"
  12965. });
  12966. }
  12967. } catch (err) {
  12968. _iterator4.e(err);
  12969. } finally {
  12970. _iterator4.f();
  12971. }
  12972. var s = {
  12973. file_list: n
  12974. };
  12975. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  12976. e.code ? t(null, e) : t(null, {
  12977. fileList: e.data.download_list,
  12978. requestId: e.requestId
  12979. });
  12980. }).catch(function (e) {
  12981. t(e);
  12982. }), t.promise;
  12983. },
  12984. ut = /*#__PURE__*/function () {
  12985. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  12986. var e, n, s, r;
  12987. return _regenerator.default.wrap(function _callee32$(_context32) {
  12988. while (1) {
  12989. switch (_context32.prev = _context32.next) {
  12990. case 0:
  12991. e = _ref9.fileID;
  12992. _context32.next = 3;
  12993. return ct.call(this, {
  12994. fileList: [{
  12995. fileID: e,
  12996. maxAge: 600
  12997. }]
  12998. });
  12999. case 3:
  13000. n = _context32.sent.fileList[0];
  13001. if (!("SUCCESS" !== n.code)) {
  13002. _context32.next = 6;
  13003. break;
  13004. }
  13005. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  13006. e(n);
  13007. }));
  13008. case 6:
  13009. s = Ye(this.config.env);
  13010. r = n.download_url;
  13011. if (!(r = encodeURI(r), !t)) {
  13012. _context32.next = 10;
  13013. break;
  13014. }
  13015. return _context32.abrupt("return", s.download({
  13016. url: r
  13017. }));
  13018. case 10:
  13019. _context32.t0 = t;
  13020. _context32.next = 13;
  13021. return s.download({
  13022. url: r
  13023. });
  13024. case 13:
  13025. _context32.t1 = _context32.sent;
  13026. (0, _context32.t0)(_context32.t1);
  13027. case 15:
  13028. case "end":
  13029. return _context32.stop();
  13030. }
  13031. }
  13032. }, _callee32, this);
  13033. }));
  13034. return function ut(_x27, _x28) {
  13035. return _ref10.apply(this, arguments);
  13036. };
  13037. }(),
  13038. lt = function lt(_ref11, i) {
  13039. var e = _ref11.name,
  13040. t = _ref11.data,
  13041. n = _ref11.query,
  13042. s = _ref11.parse,
  13043. r = _ref11.search;
  13044. var o = i || we();
  13045. var a;
  13046. try {
  13047. a = t ? JSON.stringify(t) : "";
  13048. } catch (e) {
  13049. return Promise.reject(e);
  13050. }
  13051. if (!e) return Promise.reject(new ne({
  13052. code: "PARAM_ERROR",
  13053. message: "函数名不能为空"
  13054. }));
  13055. var c = {
  13056. inQuery: n,
  13057. parse: s,
  13058. search: r,
  13059. function_name: e,
  13060. request_data: a
  13061. };
  13062. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  13063. if (e.code) o(null, e);else {
  13064. var _t9 = e.data.response_data;
  13065. if (s) o(null, {
  13066. result: _t9,
  13067. requestId: e.requestId
  13068. });else try {
  13069. _t9 = JSON.parse(e.data.response_data), o(null, {
  13070. result: _t9,
  13071. requestId: e.requestId
  13072. });
  13073. } catch (e) {
  13074. o(new ne({
  13075. message: "response data must be json"
  13076. }));
  13077. }
  13078. }
  13079. return o.promise;
  13080. }).catch(function (e) {
  13081. o(e);
  13082. }), o.promise;
  13083. },
  13084. ht = {
  13085. timeout: 15e3,
  13086. persistence: "session"
  13087. },
  13088. dt = {};
  13089. var pt = /*#__PURE__*/function () {
  13090. function pt(e) {
  13091. (0, _classCallCheck2.default)(this, pt);
  13092. this.config = e || this.config, this.authObj = void 0;
  13093. }
  13094. (0, _createClass2.default)(pt, [{
  13095. key: "init",
  13096. value: function init(e) {
  13097. switch (Ie.adapter || (this.requestClient = new Ie.adapter.reqClass({
  13098. timeout: e.timeout || 5e3,
  13099. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  13100. })), this.config = _objectSpread(_objectSpread({}, ht), e), !0) {
  13101. case this.config.timeout > 6e5:
  13102. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  13103. break;
  13104. case this.config.timeout < 100:
  13105. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  13106. }
  13107. return new pt(this.config);
  13108. }
  13109. }, {
  13110. key: "auth",
  13111. value: function auth() {
  13112. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13113. e = _ref12.persistence;
  13114. if (this.authObj) return this.authObj;
  13115. var t = e || Ie.adapter.primaryStorage || ht.persistence;
  13116. var n;
  13117. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  13118. var t = e.env;
  13119. Ee[t] = new Pe(e), Oe[t] = new Pe(_objectSpread(_objectSpread({}, e), {}, {
  13120. persistence: "local"
  13121. }));
  13122. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  13123. }
  13124. }, {
  13125. key: "on",
  13126. value: function on(e, t) {
  13127. return Ne.apply(this, [e, t]);
  13128. }
  13129. }, {
  13130. key: "off",
  13131. value: function off(e, t) {
  13132. return Fe.apply(this, [e, t]);
  13133. }
  13134. }, {
  13135. key: "callFunction",
  13136. value: function callFunction(e, t) {
  13137. return lt.apply(this, [e, t]);
  13138. }
  13139. }, {
  13140. key: "deleteFile",
  13141. value: function deleteFile(e, t) {
  13142. return at.apply(this, [e, t]);
  13143. }
  13144. }, {
  13145. key: "getTempFileURL",
  13146. value: function getTempFileURL(e, t) {
  13147. return ct.apply(this, [e, t]);
  13148. }
  13149. }, {
  13150. key: "downloadFile",
  13151. value: function downloadFile(e, t) {
  13152. return ut.apply(this, [e, t]);
  13153. }
  13154. }, {
  13155. key: "uploadFile",
  13156. value: function uploadFile(e, t) {
  13157. return it.apply(this, [e, t]);
  13158. }
  13159. }, {
  13160. key: "getUploadMetadata",
  13161. value: function getUploadMetadata(e, t) {
  13162. return ot.apply(this, [e, t]);
  13163. }
  13164. }, {
  13165. key: "registerExtension",
  13166. value: function registerExtension(e) {
  13167. dt[e.name] = e;
  13168. }
  13169. }, {
  13170. key: "invokeExtension",
  13171. value: function () {
  13172. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  13173. var n;
  13174. return _regenerator.default.wrap(function _callee33$(_context33) {
  13175. while (1) {
  13176. switch (_context33.prev = _context33.next) {
  13177. case 0:
  13178. n = dt[e];
  13179. if (n) {
  13180. _context33.next = 3;
  13181. break;
  13182. }
  13183. throw new ne({
  13184. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  13185. });
  13186. case 3:
  13187. _context33.next = 5;
  13188. return n.invoke(t, this);
  13189. case 5:
  13190. return _context33.abrupt("return", _context33.sent);
  13191. case 6:
  13192. case "end":
  13193. return _context33.stop();
  13194. }
  13195. }
  13196. }, _callee33, this);
  13197. }));
  13198. function invokeExtension(_x29, _x30) {
  13199. return _invokeExtension.apply(this, arguments);
  13200. }
  13201. return invokeExtension;
  13202. }()
  13203. }, {
  13204. key: "useAdapters",
  13205. value: function useAdapters(e) {
  13206. var _ref13 = ke(e) || {},
  13207. t = _ref13.adapter,
  13208. n = _ref13.runtime;
  13209. t && (Ie.adapter = t), n && (Ie.runtime = n);
  13210. }
  13211. }]);
  13212. return pt;
  13213. }();
  13214. var ft = new pt();
  13215. function gt(e, t, n) {
  13216. void 0 === n && (n = {});
  13217. var s = /\?/.test(t),
  13218. r = "";
  13219. for (var i in n) {
  13220. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  13221. }
  13222. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  13223. }
  13224. var mt = /*#__PURE__*/function () {
  13225. function mt() {
  13226. (0, _classCallCheck2.default)(this, mt);
  13227. }
  13228. (0, _createClass2.default)(mt, [{
  13229. key: "post",
  13230. value: function post(e) {
  13231. var t = e.url,
  13232. n = e.data,
  13233. s = e.headers;
  13234. return new Promise(function (e, r) {
  13235. se.request({
  13236. url: gt("https:", t),
  13237. data: n,
  13238. method: "POST",
  13239. header: s,
  13240. success: function success(t) {
  13241. e(t);
  13242. },
  13243. fail: function fail(e) {
  13244. r(e);
  13245. }
  13246. });
  13247. });
  13248. }
  13249. }, {
  13250. key: "upload",
  13251. value: function upload(e) {
  13252. return new Promise(function (t, n) {
  13253. var s = e.url,
  13254. r = e.file,
  13255. i = e.data,
  13256. o = e.headers,
  13257. a = e.fileType,
  13258. c = se.uploadFile({
  13259. url: gt("https:", s),
  13260. name: "file",
  13261. formData: Object.assign({}, i),
  13262. filePath: r,
  13263. fileType: a,
  13264. header: o,
  13265. success: function success(e) {
  13266. var n = {
  13267. statusCode: e.statusCode,
  13268. data: e.data || {}
  13269. };
  13270. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  13271. },
  13272. fail: function fail(e) {
  13273. n(new Error(e.errMsg || "uploadFile:fail"));
  13274. }
  13275. });
  13276. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  13277. e.onUploadProgress({
  13278. loaded: t.totalBytesSent,
  13279. total: t.totalBytesExpectedToSend
  13280. });
  13281. });
  13282. });
  13283. }
  13284. }]);
  13285. return mt;
  13286. }();
  13287. var yt = {
  13288. setItem: function setItem(e, t) {
  13289. se.setStorageSync(e, t);
  13290. },
  13291. getItem: function getItem(e) {
  13292. return se.getStorageSync(e);
  13293. },
  13294. removeItem: function removeItem(e) {
  13295. se.removeStorageSync(e);
  13296. },
  13297. clear: function clear() {
  13298. se.clearStorageSync();
  13299. }
  13300. };
  13301. var _t = {
  13302. genAdapter: function genAdapter() {
  13303. return {
  13304. root: {},
  13305. reqClass: mt,
  13306. localStorage: yt,
  13307. primaryStorage: "local"
  13308. };
  13309. },
  13310. isMatch: function isMatch() {
  13311. return !0;
  13312. },
  13313. runtime: "uni_app"
  13314. };
  13315. ft.useAdapters(_t);
  13316. var wt = ft,
  13317. vt = wt.init;
  13318. wt.init = function (e) {
  13319. e.env = e.spaceId;
  13320. var t = vt.call(this, e);
  13321. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  13322. var n = t.auth;
  13323. return t.auth = function (e) {
  13324. var t = n.call(this, e);
  13325. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  13326. var n;
  13327. t[e] = (n = t[e], function (e) {
  13328. e = e || {};
  13329. var _te = te(e),
  13330. t = _te.success,
  13331. s = _te.fail,
  13332. r = _te.complete;
  13333. if (!(t || s || r)) return n.call(this, e);
  13334. n.call(this, e).then(function (e) {
  13335. t && t(e), r && r(e);
  13336. }, function (e) {
  13337. s && s(e), r && r(e);
  13338. });
  13339. }).bind(t);
  13340. }), t;
  13341. }, t.customAuth = t.auth, t;
  13342. };
  13343. var bt = wt;
  13344. var St = /*#__PURE__*/function (_fe) {
  13345. (0, _inherits2.default)(St, _fe);
  13346. var _super8 = _createSuper(St);
  13347. function St() {
  13348. (0, _classCallCheck2.default)(this, St);
  13349. return _super8.apply(this, arguments);
  13350. }
  13351. (0, _createClass2.default)(St, [{
  13352. key: "getAccessToken",
  13353. value: function getAccessToken() {
  13354. var _this11 = this;
  13355. return new Promise(function (e, t) {
  13356. var n = "Anonymous_Access_token";
  13357. _this11.setAccessToken(n), e(n);
  13358. });
  13359. }
  13360. }, {
  13361. key: "setupRequest",
  13362. value: function setupRequest(e, t) {
  13363. var n = Object.assign({}, e, {
  13364. spaceId: this.config.spaceId,
  13365. timestamp: Date.now()
  13366. }),
  13367. s = {
  13368. "Content-Type": "application/json"
  13369. };
  13370. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = he.sign(n, this.config.clientSecret);
  13371. var r = le();
  13372. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  13373. var _re = re(),
  13374. i = _re.token;
  13375. return s["x-client-token"] = i, {
  13376. url: this.config.requestUrl,
  13377. method: "POST",
  13378. data: n,
  13379. dataType: "json",
  13380. header: JSON.parse(JSON.stringify(s))
  13381. };
  13382. }
  13383. }, {
  13384. key: "uploadFileToOSS",
  13385. value: function uploadFileToOSS(_ref14) {
  13386. var _this12 = this;
  13387. var e = _ref14.url,
  13388. t = _ref14.formData,
  13389. n = _ref14.name,
  13390. s = _ref14.filePath,
  13391. r = _ref14.fileType,
  13392. i = _ref14.onUploadProgress;
  13393. return new Promise(function (o, a) {
  13394. var c = _this12.adapter.uploadFile({
  13395. url: e,
  13396. formData: t,
  13397. name: n,
  13398. filePath: s,
  13399. fileType: r,
  13400. success: function success(e) {
  13401. e && e.statusCode < 400 ? o(e) : a(new ne({
  13402. code: "UPLOAD_FAILED",
  13403. message: "文件上传失败"
  13404. }));
  13405. },
  13406. fail: function fail(e) {
  13407. a(new ne({
  13408. code: e.code || "UPLOAD_FAILED",
  13409. message: e.message || e.errMsg || "文件上传失败"
  13410. }));
  13411. }
  13412. });
  13413. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  13414. i({
  13415. loaded: e.totalBytesSent,
  13416. total: e.totalBytesExpectedToSend
  13417. });
  13418. });
  13419. });
  13420. }
  13421. }, {
  13422. key: "uploadFile",
  13423. value: function uploadFile(_ref15) {
  13424. var _this13 = this;
  13425. var e = _ref15.filePath,
  13426. t = _ref15.cloudPath,
  13427. _ref15$fileType = _ref15.fileType,
  13428. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  13429. s = _ref15.onUploadProgress;
  13430. if (!t) throw new ne({
  13431. code: "CLOUDPATH_REQUIRED",
  13432. message: "cloudPath不可为空"
  13433. });
  13434. var r;
  13435. return this.getOSSUploadOptionsFromPath({
  13436. cloudPath: t
  13437. }).then(function (t) {
  13438. var _t$result = t.result,
  13439. i = _t$result.url,
  13440. o = _t$result.formData,
  13441. a = _t$result.name;
  13442. r = t.result.fileUrl;
  13443. var c = {
  13444. url: i,
  13445. formData: o,
  13446. name: a,
  13447. filePath: e,
  13448. fileType: n
  13449. };
  13450. return _this13.uploadFileToOSS(Object.assign({}, c, {
  13451. onUploadProgress: s
  13452. }));
  13453. }).then(function () {
  13454. return _this13.reportOSSUpload({
  13455. cloudPath: t
  13456. });
  13457. }).then(function (t) {
  13458. return new Promise(function (n, s) {
  13459. t.success ? n({
  13460. success: !0,
  13461. filePath: e,
  13462. fileID: r
  13463. }) : s(new ne({
  13464. code: "UPLOAD_FAILED",
  13465. message: "文件上传失败"
  13466. }));
  13467. });
  13468. });
  13469. }
  13470. }, {
  13471. key: "deleteFile",
  13472. value: function deleteFile(_ref16) {
  13473. var e = _ref16.fileList;
  13474. var t = {
  13475. method: "serverless.file.resource.delete",
  13476. params: JSON.stringify({
  13477. fileList: e
  13478. })
  13479. };
  13480. return this.request(this.setupRequest(t)).then(function (e) {
  13481. if (e.success) return e.result;
  13482. throw new ne({
  13483. code: "DELETE_FILE_FAILED",
  13484. message: "删除文件失败"
  13485. });
  13486. });
  13487. }
  13488. }, {
  13489. key: "getTempFileURL",
  13490. value: function getTempFileURL() {
  13491. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13492. e = _ref17.fileList;
  13493. if (!Array.isArray(e) || 0 === e.length) throw new ne({
  13494. code: "INVALID_PARAM",
  13495. message: "fileList的元素必须是非空的字符串"
  13496. });
  13497. var t = {
  13498. method: "serverless.file.resource.getTempFileURL",
  13499. params: JSON.stringify({
  13500. fileList: e
  13501. })
  13502. };
  13503. return this.request(this.setupRequest(t)).then(function (e) {
  13504. if (e.success) return {
  13505. fileList: e.result.fileList.map(function (e) {
  13506. return {
  13507. fileID: e.fileID,
  13508. tempFileURL: e.tempFileURL
  13509. };
  13510. })
  13511. };
  13512. throw new ne({
  13513. code: "GET_TEMP_FILE_URL_FAILED",
  13514. message: "获取临时文件链接失败"
  13515. });
  13516. });
  13517. }
  13518. }]);
  13519. return St;
  13520. }(fe);
  13521. var kt = {
  13522. init: function init(e) {
  13523. var t = new St(e),
  13524. n = {
  13525. signInAnonymously: function signInAnonymously() {
  13526. return t.authorize();
  13527. },
  13528. getLoginState: function getLoginState() {
  13529. return Promise.resolve(!1);
  13530. }
  13531. };
  13532. return t.auth = function () {
  13533. return n;
  13534. }, t.customAuth = t.auth, t;
  13535. }
  13536. };
  13537. function It(_ref18) {
  13538. var e = _ref18.data;
  13539. var t;
  13540. t = le();
  13541. var n = JSON.parse(JSON.stringify(e || {}));
  13542. if (Object.assign(n, {
  13543. clientInfo: t
  13544. }), !n.uniIdToken) {
  13545. var _re2 = re(),
  13546. _e19 = _re2.token;
  13547. _e19 && (n.uniIdToken = _e19);
  13548. }
  13549. return n;
  13550. }
  13551. function Tt() {
  13552. return _Tt.apply(this, arguments);
  13553. }
  13554. function _Tt() {
  13555. _Tt = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  13556. var _this23 = this;
  13557. var _ref55,
  13558. e,
  13559. t,
  13560. _this$__dev__,
  13561. n,
  13562. s,
  13563. r,
  13564. i,
  13565. o,
  13566. a,
  13567. _args5 = arguments;
  13568. return _regenerator.default.wrap(function _callee53$(_context53) {
  13569. while (1) {
  13570. switch (_context53.prev = _context53.next) {
  13571. case 0:
  13572. _ref55 = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, e = _ref55.name, t = _ref55.data;
  13573. _context53.next = 3;
  13574. return this.__dev__.initLocalNetwork();
  13575. case 3:
  13576. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  13577. aliyun: "aliyun",
  13578. tencent: "tcb"
  13579. }[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);
  13580. return _context53.abrupt("return", new Promise(function (t, n) {
  13581. se.request({
  13582. method: "POST",
  13583. url: o,
  13584. data: {
  13585. name: e,
  13586. platform: A,
  13587. provider: r,
  13588. spaceId: i
  13589. },
  13590. timeout: 3e3,
  13591. success: function success(e) {
  13592. t(e);
  13593. },
  13594. fail: function fail() {
  13595. t({
  13596. data: {
  13597. code: "NETWORK_ERROR",
  13598. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  13599. }
  13600. });
  13601. }
  13602. });
  13603. }).then(function () {
  13604. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13605. e = _ref56.data;
  13606. var _ref57 = e || {},
  13607. t = _ref57.code,
  13608. n = _ref57.message;
  13609. return {
  13610. code: 0 === t ? 0 : t || "SYS_ERR",
  13611. message: n || "SYS_ERR"
  13612. };
  13613. }).then(function (_ref58) {
  13614. var n = _ref58.code,
  13615. s = _ref58.message;
  13616. if (0 !== n) {
  13617. switch (n) {
  13618. case "MODULE_ENCRYPTED":
  13619. 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"));
  13620. break;
  13621. case "FUNCTION_ENCRYPTED":
  13622. 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"));
  13623. break;
  13624. case "ACTION_ENCRYPTED":
  13625. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  13626. break;
  13627. case "NETWORK_ERROR":
  13628. {
  13629. var _e29 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  13630. throw console.error(_e29), new Error(_e29);
  13631. }
  13632. case "SWITCH_TO_CLOUD":
  13633. break;
  13634. default:
  13635. {
  13636. var _e30 = "\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");
  13637. throw console.error(_e30), new Error(_e30);
  13638. }
  13639. }
  13640. return _this23._callCloudFunction({
  13641. name: e,
  13642. data: t
  13643. });
  13644. }
  13645. return new Promise(function (e, n) {
  13646. var s = It.call(_this23, {
  13647. data: t
  13648. });
  13649. se.request({
  13650. method: "POST",
  13651. url: a,
  13652. data: {
  13653. provider: r,
  13654. platform: A,
  13655. param: s
  13656. },
  13657. success: function success() {
  13658. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13659. t = _ref59.statusCode,
  13660. s = _ref59.data;
  13661. return !t || t >= 400 ? n(new ne({
  13662. code: s.code || "SYS_ERR",
  13663. message: s.message || "request:fail"
  13664. })) : e({
  13665. result: s
  13666. });
  13667. },
  13668. fail: function fail(e) {
  13669. n(new ne({
  13670. code: e.code || e.errCode || "SYS_ERR",
  13671. message: e.message || e.errMsg || "request:fail"
  13672. }));
  13673. }
  13674. });
  13675. });
  13676. }));
  13677. case 5:
  13678. case "end":
  13679. return _context53.stop();
  13680. }
  13681. }
  13682. }, _callee53, this);
  13683. }));
  13684. return _Tt.apply(this, arguments);
  13685. }
  13686. var Ct = [{
  13687. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  13688. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  13689. mode: "append"
  13690. }];
  13691. var At = /[\\^$.*+?()[\]{}|]/g,
  13692. Pt = RegExp(At.source);
  13693. function Et(e, t, n) {
  13694. return e.replace(new RegExp((s = t) && Pt.test(s) ? s.replace(At, "\\$&") : s, "g"), n);
  13695. var s;
  13696. }
  13697. var Ot = "none",
  13698. xt = "request",
  13699. Rt = "response",
  13700. Ut = "both";
  13701. var Lt = /*#__PURE__*/function () {
  13702. function Lt() {
  13703. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  13704. e = _ref19.secretType,
  13705. t = _ref19.uniCloudIns;
  13706. (0, _classCallCheck2.default)(this, Lt);
  13707. this.clientType = "", this.secretType = e || Ot, this.uniCloudIns = t;
  13708. var _this$uniCloudIns$con = this.uniCloudIns.config,
  13709. n = _this$uniCloudIns$con.provider,
  13710. s = _this$uniCloudIns$con.spaceId;
  13711. var r;
  13712. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  13713. }
  13714. (0, _createClass2.default)(Lt, [{
  13715. key: "getSystemInfo",
  13716. value: function getSystemInfo() {
  13717. return this._systemInfo || (this._systemInfo = ce()), this._systemInfo;
  13718. }
  13719. }, {
  13720. key: "appId",
  13721. get: function get() {
  13722. return this.getSystemInfo().appId;
  13723. }
  13724. }, {
  13725. key: "deviceId",
  13726. get: function get() {
  13727. return this.getSystemInfo().deviceId;
  13728. }
  13729. }, {
  13730. key: "encryptData",
  13731. value: function () {
  13732. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  13733. return _regenerator.default.wrap(function _callee34$(_context34) {
  13734. while (1) {
  13735. switch (_context34.prev = _context34.next) {
  13736. case 0:
  13737. return _context34.abrupt("return", this.secretType === Ot ? e : this.platformEncryptData(e));
  13738. case 1:
  13739. case "end":
  13740. return _context34.stop();
  13741. }
  13742. }
  13743. }, _callee34, this);
  13744. }));
  13745. function encryptData(_x31) {
  13746. return _encryptData.apply(this, arguments);
  13747. }
  13748. return encryptData;
  13749. }()
  13750. }, {
  13751. key: "decryptResult",
  13752. value: function () {
  13753. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  13754. var _ref20, t, n;
  13755. return _regenerator.default.wrap(function _callee35$(_context35) {
  13756. while (1) {
  13757. switch (_context35.prev = _context35.next) {
  13758. case 0:
  13759. if (!(this.secretType === Ot)) {
  13760. _context35.next = 2;
  13761. break;
  13762. }
  13763. return _context35.abrupt("return", e);
  13764. case 2:
  13765. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  13766. return _context35.abrupt("return", t || !n ? e : this.secretType === xt ? n : this.platformDecryptResult(e));
  13767. case 4:
  13768. case "end":
  13769. return _context35.stop();
  13770. }
  13771. }
  13772. }, _callee35, this);
  13773. }));
  13774. function decryptResult(_x32) {
  13775. return _decryptResult.apply(this, arguments);
  13776. }
  13777. return decryptResult;
  13778. }()
  13779. }, {
  13780. key: "wrapVerifyClientCallFunction",
  13781. value: function wrapVerifyClientCallFunction(e) {
  13782. var t = this;
  13783. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  13784. var _ref22,
  13785. n,
  13786. _ref22$data,
  13787. s,
  13788. r,
  13789. _args36 = arguments;
  13790. return _regenerator.default.wrap(function _callee36$(_context36) {
  13791. while (1) {
  13792. switch (_context36.prev = _context36.next) {
  13793. case 0:
  13794. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  13795. _context36.next = 3;
  13796. return t.prepare();
  13797. case 3:
  13798. _context36.next = 5;
  13799. return t.platformGetSignOption();
  13800. case 5:
  13801. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  13802. _context36.next = 8;
  13803. return e({
  13804. name: n,
  13805. data: s
  13806. });
  13807. case 8:
  13808. r = _context36.sent;
  13809. _context36.t0 = t.isClientKeyNotFound(r);
  13810. if (!_context36.t0) {
  13811. _context36.next = 19;
  13812. break;
  13813. }
  13814. _context36.next = 13;
  13815. return t.prepare({
  13816. forceUpdate: !0
  13817. });
  13818. case 13:
  13819. _context36.next = 15;
  13820. return t.platformGetSignOption();
  13821. case 15:
  13822. s._uniCloudOptions = _context36.sent;
  13823. _context36.next = 18;
  13824. return e({
  13825. name: n,
  13826. data: s
  13827. });
  13828. case 18:
  13829. r = _context36.sent;
  13830. case 19:
  13831. return _context36.abrupt("return", r);
  13832. case 20:
  13833. case "end":
  13834. return _context36.stop();
  13835. }
  13836. }
  13837. }, _callee36);
  13838. }));
  13839. }
  13840. }, {
  13841. key: "wrapEncryptDataCallFunction",
  13842. value: function wrapEncryptDataCallFunction(e) {
  13843. var t = this;
  13844. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  13845. var _ref24,
  13846. n,
  13847. _ref24$data,
  13848. s,
  13849. r,
  13850. i,
  13851. _r3,
  13852. _args37 = arguments;
  13853. return _regenerator.default.wrap(function _callee37$(_context37) {
  13854. while (1) {
  13855. switch (_context37.prev = _context37.next) {
  13856. case 0:
  13857. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  13858. _context37.next = 3;
  13859. return t.prepare();
  13860. case 3:
  13861. _context37.next = 5;
  13862. return t.encryptData(s);
  13863. case 5:
  13864. r = _context37.sent;
  13865. _context37.next = 8;
  13866. return e({
  13867. name: n,
  13868. data: r
  13869. });
  13870. case 8:
  13871. i = _context37.sent;
  13872. if (!t.isClientKeyNotFound(i)) {
  13873. _context37.next = 21;
  13874. break;
  13875. }
  13876. _context37.next = 12;
  13877. return t.prepare({
  13878. forceUpdate: !0
  13879. });
  13880. case 12:
  13881. _context37.next = 14;
  13882. return t.encryptData(s);
  13883. case 14:
  13884. _r3 = _context37.sent;
  13885. _context37.next = 17;
  13886. return t.platformGetSignOption();
  13887. case 17:
  13888. s._uniCloudOptions = _context37.sent;
  13889. _context37.next = 20;
  13890. return e({
  13891. name: n,
  13892. data: _r3
  13893. });
  13894. case 20:
  13895. i = _context37.sent;
  13896. case 21:
  13897. _context37.next = 23;
  13898. return t.decryptResult(i.result);
  13899. case 23:
  13900. i.result = _context37.sent;
  13901. return _context37.abrupt("return", i);
  13902. case 25:
  13903. case "end":
  13904. return _context37.stop();
  13905. }
  13906. }
  13907. }, _callee37);
  13908. }));
  13909. }
  13910. }]);
  13911. return Lt;
  13912. }();
  13913. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  13914. function Nt(e) {
  13915. return parseInt(e) === e;
  13916. }
  13917. function Dt(e) {
  13918. if (!Nt(e.length)) return !1;
  13919. for (var t = 0; t < e.length; t++) {
  13920. if (!Nt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  13921. }
  13922. return !0;
  13923. }
  13924. function Ft(e, t) {
  13925. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  13926. if (Array.isArray(e)) {
  13927. if (!Dt(e)) throw new Error("Array contains invalid value: " + e);
  13928. return new Uint8Array(e);
  13929. }
  13930. if (Nt(e.length) && Dt(e)) return new Uint8Array(e);
  13931. throw new Error("unsupported array-like object");
  13932. }
  13933. function qt(e) {
  13934. return new Uint8Array(e);
  13935. }
  13936. function Kt(e, t, n, s, r) {
  13937. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  13938. }
  13939. var Mt,
  13940. jt = {
  13941. toBytes: function toBytes(e) {
  13942. var t = [],
  13943. n = 0;
  13944. for (e = encodeURI(e); n < e.length;) {
  13945. var s = e.charCodeAt(n++);
  13946. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  13947. }
  13948. return Ft(t);
  13949. },
  13950. fromBytes: function fromBytes(e) {
  13951. for (var t = [], n = 0; n < e.length;) {
  13952. var s = e[n];
  13953. 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);
  13954. }
  13955. return t.join("");
  13956. }
  13957. },
  13958. Bt = (Mt = "0123456789abcdef", {
  13959. toBytes: function toBytes(e) {
  13960. for (var t = [], n = 0; n < e.length; n += 2) {
  13961. t.push(parseInt(e.substr(n, 2), 16));
  13962. }
  13963. return t;
  13964. },
  13965. fromBytes: function fromBytes(e) {
  13966. for (var t = [], n = 0; n < e.length; n++) {
  13967. var s = e[n];
  13968. t.push(Mt[(240 & s) >> 4] + Mt[15 & s]);
  13969. }
  13970. return t.join("");
  13971. }
  13972. }),
  13973. $t = {
  13974. 16: 10,
  13975. 24: 12,
  13976. 32: 14
  13977. },
  13978. 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],
  13979. 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],
  13980. 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],
  13981. 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],
  13982. 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],
  13983. 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],
  13984. 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],
  13985. 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],
  13986. 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],
  13987. 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],
  13988. 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],
  13989. 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],
  13990. 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],
  13991. 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],
  13992. 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];
  13993. function on(e) {
  13994. for (var t = [], n = 0; n < e.length; n += 4) {
  13995. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  13996. }
  13997. return t;
  13998. }
  13999. var an = /*#__PURE__*/function () {
  14000. function an(e) {
  14001. (0, _classCallCheck2.default)(this, an);
  14002. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  14003. Object.defineProperty(this, "key", {
  14004. value: Ft(e, !0)
  14005. }), this._prepare();
  14006. }
  14007. (0, _createClass2.default)(an, [{
  14008. key: "_prepare",
  14009. value: function _prepare() {
  14010. var e = $t[this.key.length];
  14011. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  14012. this._Ke = [], this._Kd = [];
  14013. for (var t = 0; t <= e; t++) {
  14014. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  14015. }
  14016. var n,
  14017. s = 4 * (e + 1),
  14018. r = this.key.length / 4,
  14019. i = on(this.key);
  14020. for (t = 0; t < r; t++) {
  14021. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  14022. }
  14023. for (var o, a = 0, c = r; c < s;) {
  14024. 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++) {
  14025. i[t] ^= i[t - 1];
  14026. } else {
  14027. for (t = 1; t < r / 2; t++) {
  14028. i[t] ^= i[t - 1];
  14029. }
  14030. 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;
  14031. for (t = r / 2 + 1; t < r; t++) {
  14032. i[t] ^= i[t - 1];
  14033. }
  14034. }
  14035. for (t = 0; t < r && c < s;) {
  14036. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  14037. }
  14038. }
  14039. for (var u = 1; u < e; u++) {
  14040. for (var l = 0; l < 4; l++) {
  14041. o = this._Kd[u][l], this._Kd[u][l] = tn[o >> 24 & 255] ^ nn[o >> 16 & 255] ^ sn[o >> 8 & 255] ^ rn[255 & o];
  14042. }
  14043. }
  14044. }
  14045. }, {
  14046. key: "encrypt",
  14047. value: function encrypt(e) {
  14048. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  14049. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14050. s[r] ^= this._Ke[0][r];
  14051. }
  14052. for (var i = 1; i < t; i++) {
  14053. for (r = 0; r < 4; r++) {
  14054. 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];
  14055. }
  14056. s = n.slice();
  14057. }
  14058. var o,
  14059. a = qt(16);
  14060. for (r = 0; r < 4; r++) {
  14061. 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);
  14062. }
  14063. return a;
  14064. }
  14065. }, {
  14066. key: "decrypt",
  14067. value: function decrypt(e) {
  14068. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  14069. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  14070. s[r] ^= this._Kd[0][r];
  14071. }
  14072. for (var i = 1; i < t; i++) {
  14073. for (r = 0; r < 4; r++) {
  14074. 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];
  14075. }
  14076. s = n.slice();
  14077. }
  14078. var o,
  14079. a = qt(16);
  14080. for (r = 0; r < 4; r++) {
  14081. 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);
  14082. }
  14083. return a;
  14084. }
  14085. }]);
  14086. return an;
  14087. }();
  14088. var cn = /*#__PURE__*/function () {
  14089. function cn(e) {
  14090. (0, _classCallCheck2.default)(this, cn);
  14091. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  14092. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new an(e);
  14093. }
  14094. (0, _createClass2.default)(cn, [{
  14095. key: "encrypt",
  14096. value: function encrypt(e) {
  14097. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14098. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14099. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.encrypt(n), t, s);
  14100. }
  14101. return t;
  14102. }
  14103. }, {
  14104. key: "decrypt",
  14105. value: function decrypt(e) {
  14106. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14107. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14108. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.decrypt(n), t, s);
  14109. }
  14110. return t;
  14111. }
  14112. }]);
  14113. return cn;
  14114. }();
  14115. var un = /*#__PURE__*/function () {
  14116. function un(e, t) {
  14117. (0, _classCallCheck2.default)(this, un);
  14118. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  14119. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  14120. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14121. } else t = qt(16);
  14122. this._lastCipherblock = Ft(t, !0), this._aes = new an(e);
  14123. }
  14124. (0, _createClass2.default)(un, [{
  14125. key: "encrypt",
  14126. value: function encrypt(e) {
  14127. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  14128. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14129. Kt(e, n, 0, s, s + 16);
  14130. for (var r = 0; r < 16; r++) {
  14131. n[r] ^= this._lastCipherblock[r];
  14132. }
  14133. this._lastCipherblock = this._aes.encrypt(n), Kt(this._lastCipherblock, t, s);
  14134. }
  14135. return t;
  14136. }
  14137. }, {
  14138. key: "decrypt",
  14139. value: function decrypt(e) {
  14140. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  14141. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  14142. Kt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  14143. for (var r = 0; r < 16; r++) {
  14144. t[s + r] = n[r] ^ this._lastCipherblock[r];
  14145. }
  14146. Kt(e, this._lastCipherblock, 0, s, s + 16);
  14147. }
  14148. return t;
  14149. }
  14150. }]);
  14151. return un;
  14152. }();
  14153. var ln = /*#__PURE__*/function () {
  14154. function ln(e, t, n) {
  14155. (0, _classCallCheck2.default)(this, ln);
  14156. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  14157. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  14158. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  14159. } else t = qt(16);
  14160. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ft(t, !0), this._aes = new an(e);
  14161. }
  14162. (0, _createClass2.default)(ln, [{
  14163. key: "encrypt",
  14164. value: function encrypt(e) {
  14165. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  14166. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14167. t = this._aes.encrypt(this._shiftRegister);
  14168. for (var r = 0; r < this.segmentSize; r++) {
  14169. n[s + r] ^= t[r];
  14170. }
  14171. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14172. }
  14173. return n;
  14174. }
  14175. }, {
  14176. key: "decrypt",
  14177. value: function decrypt(e) {
  14178. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  14179. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  14180. t = this._aes.encrypt(this._shiftRegister);
  14181. for (var r = 0; r < this.segmentSize; r++) {
  14182. n[s + r] ^= t[r];
  14183. }
  14184. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  14185. }
  14186. return n;
  14187. }
  14188. }]);
  14189. return ln;
  14190. }();
  14191. var hn = /*#__PURE__*/function () {
  14192. function hn(e, t) {
  14193. (0, _classCallCheck2.default)(this, hn);
  14194. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  14195. if (this.description = "Output Feedback", this.name = "ofb", t) {
  14196. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  14197. } else t = qt(16);
  14198. this._lastPrecipher = Ft(t, !0), this._lastPrecipherIndex = 16, this._aes = new an(e);
  14199. }
  14200. (0, _createClass2.default)(hn, [{
  14201. key: "encrypt",
  14202. value: function encrypt(e) {
  14203. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14204. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  14205. }
  14206. return t;
  14207. }
  14208. }, {
  14209. key: "decrypt",
  14210. value: function decrypt(e) {
  14211. return this.encrypt(e);
  14212. }
  14213. }]);
  14214. return hn;
  14215. }();
  14216. var dn = /*#__PURE__*/function () {
  14217. function dn(e) {
  14218. (0, _classCallCheck2.default)(this, dn);
  14219. if (!(this instanceof dn)) throw Error("Counter must be instanitated with `new`");
  14220. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = qt(16), this.setValue(e)) : this.setBytes(e);
  14221. }
  14222. (0, _createClass2.default)(dn, [{
  14223. key: "setValue",
  14224. value: function setValue(e) {
  14225. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  14226. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  14227. for (var t = 15; t >= 0; --t) {
  14228. this._counter[t] = e % 256, e = parseInt(e / 256);
  14229. }
  14230. }
  14231. }, {
  14232. key: "setBytes",
  14233. value: function setBytes(e) {
  14234. if (16 != (e = Ft(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  14235. this._counter = e;
  14236. }
  14237. }, {
  14238. key: "increment",
  14239. value: function increment() {
  14240. for (var e = 15; e >= 0; e--) {
  14241. if (255 !== this._counter[e]) {
  14242. this._counter[e]++;
  14243. break;
  14244. }
  14245. this._counter[e] = 0;
  14246. }
  14247. }
  14248. }]);
  14249. return dn;
  14250. }();
  14251. var pn = /*#__PURE__*/function () {
  14252. function pn(e, t) {
  14253. (0, _classCallCheck2.default)(this, pn);
  14254. if (!(this instanceof pn)) throw Error("AES must be instanitated with `new`");
  14255. 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);
  14256. }
  14257. (0, _createClass2.default)(pn, [{
  14258. key: "encrypt",
  14259. value: function encrypt(e) {
  14260. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  14261. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  14262. }
  14263. return t;
  14264. }
  14265. }, {
  14266. key: "decrypt",
  14267. value: function decrypt(e) {
  14268. return this.encrypt(e);
  14269. }
  14270. }]);
  14271. return pn;
  14272. }();
  14273. var fn = {
  14274. AES: an,
  14275. Counter: dn,
  14276. ModeOfOperation: {
  14277. ecb: cn,
  14278. cbc: un,
  14279. cfb: ln,
  14280. ofb: hn,
  14281. ctr: pn
  14282. },
  14283. utils: {
  14284. hex: Bt,
  14285. utf8: jt
  14286. },
  14287. padding: {
  14288. pkcs7: {
  14289. pad: function pad(e) {
  14290. var t = 16 - (e = Ft(e, !0)).length % 16,
  14291. n = qt(e.length + t);
  14292. Kt(e, n);
  14293. for (var s = e.length; s < n.length; s++) {
  14294. n[s] = t;
  14295. }
  14296. return n;
  14297. },
  14298. strip: function strip(e) {
  14299. if ((e = Ft(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  14300. var t = e[e.length - 1];
  14301. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  14302. for (var n = e.length - t, s = 0; s < t; s++) {
  14303. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  14304. }
  14305. var r = qt(n);
  14306. return Kt(e, r, 0, 0, n), r;
  14307. }
  14308. }
  14309. },
  14310. _arrayTest: {
  14311. coerceArray: Ft,
  14312. createArray: qt,
  14313. copyArray: Kt
  14314. }
  14315. };
  14316. function gn(e, t, n) {
  14317. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14318. r = fn.utils.utf8.toBytes(n),
  14319. i = fn.utils.utf8.toBytes(e),
  14320. o = new fn.ModeOfOperation.cbc(s, r),
  14321. a = fn.padding.pkcs7.pad(i),
  14322. c = o.encrypt(a);
  14323. return uni.arrayBufferToBase64(c);
  14324. }
  14325. var mn = {
  14326. code: 2e4,
  14327. message: "System error"
  14328. },
  14329. yn = {
  14330. code: 20101,
  14331. message: "Invalid client"
  14332. },
  14333. _n = {
  14334. code: 20102,
  14335. message: "Get encrypt key failed"
  14336. },
  14337. wn = {
  14338. 10001: "Secure network is not supported on current playground or unimpsdk",
  14339. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  14340. 10009: "Encrypt payload failed",
  14341. 10010: "Decrypt response failed"
  14342. };
  14343. function vn(e) {
  14344. var _ref25 = e || {},
  14345. t = _ref25.errSubject,
  14346. n = _ref25.subject,
  14347. s = _ref25.errCode,
  14348. r = _ref25.errMsg,
  14349. i = _ref25.code,
  14350. o = _ref25.message,
  14351. a = _ref25.cause;
  14352. return new ne({
  14353. subject: t || n || "uni-secure-network",
  14354. code: s || i || mn.code,
  14355. message: r || o,
  14356. cause: a
  14357. });
  14358. }
  14359. var bn,
  14360. Sn,
  14361. kn = null;
  14362. var In = /*#__PURE__*/function (_Lt) {
  14363. (0, _inherits2.default)(In, _Lt);
  14364. var _super9 = _createSuper(In);
  14365. function In(e) {
  14366. var _this14;
  14367. (0, _classCallCheck2.default)(this, In);
  14368. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  14369. return _this14;
  14370. }
  14371. (0, _createClass2.default)(In, [{
  14372. key: "isLogin",
  14373. value: function isLogin() {
  14374. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  14375. }
  14376. }, {
  14377. key: "prepare",
  14378. value: function () {
  14379. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  14380. return _regenerator.default.wrap(function _callee38$(_context38) {
  14381. while (1) {
  14382. switch (_context38.prev = _context38.next) {
  14383. case 0:
  14384. if (this.isLogin()) {
  14385. _context38.next = 7;
  14386. break;
  14387. }
  14388. if (this.scopedGlobalCache.initPromise) {
  14389. _context38.next = 3;
  14390. break;
  14391. }
  14392. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  14393. case 3:
  14394. _context38.next = 5;
  14395. return this.scopedGlobalCache.initPromise;
  14396. case 5:
  14397. if (this.isLogin()) {
  14398. _context38.next = 7;
  14399. break;
  14400. }
  14401. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  14402. case 7:
  14403. case "end":
  14404. return _context38.stop();
  14405. }
  14406. }
  14407. }, _callee38, this);
  14408. }));
  14409. function prepare() {
  14410. return _prepare2.apply(this, arguments);
  14411. }
  14412. return prepare;
  14413. }()
  14414. }, {
  14415. key: "getUserEncryptKey",
  14416. value: function () {
  14417. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  14418. var _this15 = this;
  14419. var e;
  14420. return _regenerator.default.wrap(function _callee39$(_context39) {
  14421. while (1) {
  14422. switch (_context39.prev = _context39.next) {
  14423. case 0:
  14424. if (!this.userEncryptKey) {
  14425. _context39.next = 2;
  14426. break;
  14427. }
  14428. return _context39.abrupt("return", this.userEncryptKey);
  14429. case 2:
  14430. if (!(kn && kn.expireTime)) {
  14431. _context39.next = 6;
  14432. break;
  14433. }
  14434. e = Date.now();
  14435. if (!(kn.expireTime - e > 0)) {
  14436. _context39.next = 6;
  14437. break;
  14438. }
  14439. return _context39.abrupt("return", (this.userEncryptKey = kn, this.userEncryptKey));
  14440. case 6:
  14441. return _context39.abrupt("return", new Promise(function (e, t) {
  14442. uni.getUserCryptoManager().getLatestUserKey({
  14443. success: function success(t) {
  14444. kn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  14445. },
  14446. fail: function fail(e) {
  14447. t(vn(_objectSpread(_objectSpread({}, _n), {}, {
  14448. cause: e
  14449. })));
  14450. }
  14451. });
  14452. }));
  14453. case 7:
  14454. case "end":
  14455. return _context39.stop();
  14456. }
  14457. }
  14458. }, _callee39, this);
  14459. }));
  14460. function getUserEncryptKey() {
  14461. return _getUserEncryptKey.apply(this, arguments);
  14462. }
  14463. return getUserEncryptKey;
  14464. }()
  14465. }, {
  14466. key: "getWxAppId",
  14467. value: function getWxAppId() {
  14468. return wx.getAccountInfoSync().miniProgram.appId;
  14469. }
  14470. }, {
  14471. key: "platformGetSignOption",
  14472. value: function () {
  14473. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  14474. var _yield$this$getUserEn, e, t, n;
  14475. return _regenerator.default.wrap(function _callee40$(_context40) {
  14476. while (1) {
  14477. switch (_context40.prev = _context40.next) {
  14478. case 0:
  14479. _context40.next = 2;
  14480. return this.getUserEncryptKey();
  14481. case 2:
  14482. _yield$this$getUserEn = _context40.sent;
  14483. e = _yield$this$getUserEn.encryptKey;
  14484. t = _yield$this$getUserEn.iv;
  14485. n = _yield$this$getUserEn.version;
  14486. return _context40.abrupt("return", {
  14487. verifyClientSign: gn(JSON.stringify({
  14488. data: JSON.stringify({}),
  14489. appId: this.appId,
  14490. deviceId: this.deviceId,
  14491. wxAppId: this.getWxAppId(),
  14492. simulator: "devtools" === ce().platform,
  14493. timestamp: Date.now()
  14494. }), e, t),
  14495. encryptKeyId: n,
  14496. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14497. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14498. });
  14499. case 7:
  14500. case "end":
  14501. return _context40.stop();
  14502. }
  14503. }
  14504. }, _callee40, this);
  14505. }));
  14506. function platformGetSignOption() {
  14507. return _platformGetSignOption.apply(this, arguments);
  14508. }
  14509. return platformGetSignOption;
  14510. }()
  14511. }, {
  14512. key: "platformEncryptData",
  14513. value: function () {
  14514. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  14515. var _yield$this$getUserEn2, t, n, s, r;
  14516. return _regenerator.default.wrap(function _callee41$(_context41) {
  14517. while (1) {
  14518. switch (_context41.prev = _context41.next) {
  14519. case 0:
  14520. _context41.next = 2;
  14521. return this.getUserEncryptKey();
  14522. case 2:
  14523. _yield$this$getUserEn2 = _context41.sent;
  14524. t = _yield$this$getUserEn2.encryptKey;
  14525. n = _yield$this$getUserEn2.iv;
  14526. s = _yield$this$getUserEn2.version;
  14527. r = {
  14528. secretType: this.secretType,
  14529. encryptKeyId: s,
  14530. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  14531. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  14532. };
  14533. return _context41.abrupt("return", this.secretType === Rt ? {
  14534. content: e,
  14535. _uniCloudOptions: r
  14536. } : {
  14537. content: gn(JSON.stringify({
  14538. data: JSON.stringify(e),
  14539. appId: this.appId,
  14540. deviceId: this.deviceId,
  14541. wxAppId: this.getWxAppId(),
  14542. simulator: "devtools" === ce().platform,
  14543. timestamp: Date.now()
  14544. }), t, n),
  14545. _uniCloudOptions: r
  14546. });
  14547. case 8:
  14548. case "end":
  14549. return _context41.stop();
  14550. }
  14551. }
  14552. }, _callee41, this);
  14553. }));
  14554. function platformEncryptData(_x33) {
  14555. return _platformEncryptData.apply(this, arguments);
  14556. }
  14557. return platformEncryptData;
  14558. }()
  14559. }, {
  14560. key: "platformDecryptResult",
  14561. value: function () {
  14562. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  14563. var t, _yield$this$getUserEn3, n, s;
  14564. return _regenerator.default.wrap(function _callee42$(_context42) {
  14565. while (1) {
  14566. switch (_context42.prev = _context42.next) {
  14567. case 0:
  14568. t = e.content;
  14569. _context42.next = 3;
  14570. return this.getUserEncryptKey();
  14571. case 3:
  14572. _yield$this$getUserEn3 = _context42.sent;
  14573. n = _yield$this$getUserEn3.encryptKey;
  14574. s = _yield$this$getUserEn3.iv;
  14575. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  14576. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  14577. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  14578. i = fn.utils.utf8.toBytes(n),
  14579. o = new fn.ModeOfOperation.cbc(r, i),
  14580. a = fn.padding.pkcs7.strip(o.decrypt(s));
  14581. return fn.utils.utf8.fromBytes(a);
  14582. }(t, n, s)));
  14583. case 7:
  14584. case "end":
  14585. return _context42.stop();
  14586. }
  14587. }
  14588. }, _callee42, this);
  14589. }));
  14590. function platformDecryptResult(_x34) {
  14591. return _platformDecryptResult.apply(this, arguments);
  14592. }
  14593. return platformDecryptResult;
  14594. }()
  14595. }, {
  14596. key: "isClientKeyNotFound",
  14597. value: function isClientKeyNotFound() {
  14598. return !1;
  14599. }
  14600. }]);
  14601. return In;
  14602. }(Lt);
  14603. function Tn(e) {
  14604. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  14605. n = {};
  14606. var _loop = function _loop(_s10) {
  14607. var r = t[_s10];
  14608. n[r] = function () {
  14609. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  14610. t[_key] = arguments[_key];
  14611. }
  14612. return new Promise(function (n, s) {
  14613. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  14614. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14615. e = _ref26.type,
  14616. t = _ref26.data,
  14617. r = _ref26.errCode,
  14618. i = _ref26.errMsg,
  14619. o = _ref26.errSubject,
  14620. a = _ref26.message;
  14621. "success" === e ? n(t) : s(vn({
  14622. errCode: r,
  14623. errMsg: wn[r] || i || a,
  14624. errSubject: o
  14625. }));
  14626. }])) : s(vn({
  14627. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  14628. }));
  14629. });
  14630. };
  14631. };
  14632. for (var _s10 = 0; _s10 < t.length; _s10++) {
  14633. _loop(_s10);
  14634. }
  14635. return n;
  14636. }
  14637. var Cn = /*#__PURE__*/function (_Lt2) {
  14638. (0, _inherits2.default)(Cn, _Lt2);
  14639. var _super10 = _createSuper(Cn);
  14640. function Cn(e) {
  14641. var _this16;
  14642. (0, _classCallCheck2.default)(this, Cn);
  14643. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Tn(uni.requireNativePlugin("plus"))), _this16.systemInfo = bn || (bn = ce());
  14644. return _this16;
  14645. }
  14646. (0, _createClass2.default)(Cn, [{
  14647. key: "hasClientKey",
  14648. value: function () {
  14649. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  14650. return _regenerator.default.wrap(function _callee43$(_context43) {
  14651. while (1) {
  14652. switch (_context43.prev = _context43.next) {
  14653. case 0:
  14654. _context43.next = 2;
  14655. return this.appUtils.hasClientKey({
  14656. provider: this.provider,
  14657. spaceId: this.spaceId
  14658. });
  14659. case 2:
  14660. this._hasClientKey = _context43.sent;
  14661. return _context43.abrupt("return", this._hasClientKey);
  14662. case 4:
  14663. case "end":
  14664. return _context43.stop();
  14665. }
  14666. }
  14667. }, _callee43, this);
  14668. }));
  14669. function hasClientKey() {
  14670. return _hasClientKey.apply(this, arguments);
  14671. }
  14672. return hasClientKey;
  14673. }()
  14674. }, {
  14675. key: "getAppClientKey",
  14676. value: function () {
  14677. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  14678. var _yield$this$appUtils$, e, t, n, s, r;
  14679. return _regenerator.default.wrap(function _callee44$(_context44) {
  14680. while (1) {
  14681. switch (_context44.prev = _context44.next) {
  14682. case 0:
  14683. _context44.next = 2;
  14684. return this.appUtils.encryptGetClientKeyPayload({
  14685. data: JSON.stringify({})
  14686. });
  14687. case 2:
  14688. _yield$this$appUtils$ = _context44.sent;
  14689. e = _yield$this$appUtils$.data;
  14690. t = _yield$this$appUtils$.key;
  14691. _context44.next = 7;
  14692. return this.uniCloudIns.callFunction({
  14693. name: "DCloud-clientDB",
  14694. data: {
  14695. redirectTo: "encryption",
  14696. action: "getAppClientKey",
  14697. data: e,
  14698. key: t
  14699. }
  14700. });
  14701. case 7:
  14702. _context44.t0 = _context44.sent.result;
  14703. if (_context44.t0) {
  14704. _context44.next = 10;
  14705. break;
  14706. }
  14707. _context44.t0 = {};
  14708. case 10:
  14709. n = _context44.t0;
  14710. if (!(0 !== n.errCode)) {
  14711. _context44.next = 13;
  14712. break;
  14713. }
  14714. throw function (e) {
  14715. return new ne({
  14716. subject: e.errSubject || "uni-secure-network",
  14717. code: e.errCode || e.code || mn.code,
  14718. message: e.errMsg || e.message
  14719. });
  14720. }(n);
  14721. case 13:
  14722. s = n.clientKey, r = n.key;
  14723. _context44.next = 16;
  14724. return this.appUtils.setClientKey({
  14725. provider: this.provider,
  14726. spaceId: this.spaceId,
  14727. clientKey: s,
  14728. key: r
  14729. });
  14730. case 16:
  14731. case "end":
  14732. return _context44.stop();
  14733. }
  14734. }
  14735. }, _callee44, this);
  14736. }));
  14737. function getAppClientKey() {
  14738. return _getAppClientKey.apply(this, arguments);
  14739. }
  14740. return getAppClientKey;
  14741. }()
  14742. }, {
  14743. key: "ensureClientKey",
  14744. value: function () {
  14745. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  14746. var _this17 = this;
  14747. var _ref27,
  14748. _ref27$forceUpdate,
  14749. e,
  14750. _args45 = arguments;
  14751. return _regenerator.default.wrap(function _callee45$(_context45) {
  14752. while (1) {
  14753. switch (_context45.prev = _context45.next) {
  14754. case 0:
  14755. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  14756. _context45.t1 = !0;
  14757. _context45.next = 4;
  14758. return this.hasClientKey();
  14759. case 4:
  14760. _context45.t2 = _context45.sent;
  14761. _context45.t0 = _context45.t1 !== _context45.t2;
  14762. if (_context45.t0) {
  14763. _context45.next = 8;
  14764. break;
  14765. }
  14766. _context45.t0 = e;
  14767. case 8:
  14768. if (!_context45.t0) {
  14769. _context45.next = 10;
  14770. break;
  14771. }
  14772. 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) {
  14773. _this17.scopedGlobalCache.initStatus = p;
  14774. }).catch(function (e) {
  14775. throw _this17.scopedGlobalCache.initStatus = f, e;
  14776. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  14777. case 10:
  14778. case "end":
  14779. return _context45.stop();
  14780. }
  14781. }
  14782. }, _callee45, this);
  14783. }));
  14784. function ensureClientKey() {
  14785. return _ensureClientKey.apply(this, arguments);
  14786. }
  14787. return ensureClientKey;
  14788. }()
  14789. }, {
  14790. key: "prepare",
  14791. value: function () {
  14792. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  14793. var _ref28,
  14794. _ref28$forceUpdate,
  14795. e,
  14796. _args46 = arguments;
  14797. return _regenerator.default.wrap(function _callee46$(_context46) {
  14798. while (1) {
  14799. switch (_context46.prev = _context46.next) {
  14800. case 0:
  14801. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  14802. _context46.next = 3;
  14803. return this.ensureClientKey({
  14804. forceUpdate: e
  14805. });
  14806. case 3:
  14807. case "end":
  14808. return _context46.stop();
  14809. }
  14810. }
  14811. }, _callee46, this);
  14812. }));
  14813. function prepare() {
  14814. return _prepare3.apply(this, arguments);
  14815. }
  14816. return prepare;
  14817. }()
  14818. }, {
  14819. key: "platformGetSignOption",
  14820. value: function () {
  14821. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  14822. var _yield$this$appUtils$2, e, t;
  14823. return _regenerator.default.wrap(function _callee47$(_context47) {
  14824. while (1) {
  14825. switch (_context47.prev = _context47.next) {
  14826. case 0:
  14827. _context47.next = 2;
  14828. return this.appUtils.encrypt({
  14829. provider: this.provider,
  14830. spaceId: this.spaceId,
  14831. data: JSON.stringify({})
  14832. });
  14833. case 2:
  14834. _yield$this$appUtils$2 = _context47.sent;
  14835. e = _yield$this$appUtils$2.data;
  14836. t = _yield$this$appUtils$2.key;
  14837. return _context47.abrupt("return", {
  14838. verifyClientSign: e,
  14839. encryptKeyId: t
  14840. });
  14841. case 6:
  14842. case "end":
  14843. return _context47.stop();
  14844. }
  14845. }
  14846. }, _callee47, this);
  14847. }));
  14848. function platformGetSignOption() {
  14849. return _platformGetSignOption2.apply(this, arguments);
  14850. }
  14851. return platformGetSignOption;
  14852. }()
  14853. }, {
  14854. key: "platformEncryptData",
  14855. value: function () {
  14856. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  14857. var _yield$this$appUtils$3, t, n, s;
  14858. return _regenerator.default.wrap(function _callee48$(_context48) {
  14859. while (1) {
  14860. switch (_context48.prev = _context48.next) {
  14861. case 0:
  14862. _context48.next = 2;
  14863. return this.appUtils.encrypt({
  14864. provider: this.provider,
  14865. spaceId: this.spaceId,
  14866. data: JSON.stringify(e)
  14867. });
  14868. case 2:
  14869. _yield$this$appUtils$3 = _context48.sent;
  14870. t = _yield$this$appUtils$3.data;
  14871. n = _yield$this$appUtils$3.key;
  14872. s = {
  14873. secretType: this.secretType,
  14874. encryptKeyId: n
  14875. };
  14876. return _context48.abrupt("return", this.secretType === Rt ? {
  14877. content: e,
  14878. _uniCloudOptions: s
  14879. } : {
  14880. content: t,
  14881. _uniCloudOptions: s
  14882. });
  14883. case 7:
  14884. case "end":
  14885. return _context48.stop();
  14886. }
  14887. }
  14888. }, _callee48, this);
  14889. }));
  14890. function platformEncryptData(_x35) {
  14891. return _platformEncryptData2.apply(this, arguments);
  14892. }
  14893. return platformEncryptData;
  14894. }()
  14895. }, {
  14896. key: "platformDecryptResult",
  14897. value: function () {
  14898. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  14899. var t, _e$_uniCloudOptions, n, s, r;
  14900. return _regenerator.default.wrap(function _callee49$(_context49) {
  14901. while (1) {
  14902. switch (_context49.prev = _context49.next) {
  14903. case 0:
  14904. t = e.content;
  14905. _e$_uniCloudOptions = e._uniCloudOptions;
  14906. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  14907. s = n.encryptKeyId;
  14908. _context49.next = 6;
  14909. return this.appUtils.decrypt({
  14910. provider: this.provider,
  14911. spaceId: this.spaceId,
  14912. data: t,
  14913. key: s
  14914. });
  14915. case 6:
  14916. r = _context49.sent;
  14917. return _context49.abrupt("return", JSON.parse(r.data));
  14918. case 8:
  14919. case "end":
  14920. return _context49.stop();
  14921. }
  14922. }
  14923. }, _callee49, this);
  14924. }));
  14925. function platformDecryptResult(_x36) {
  14926. return _platformDecryptResult2.apply(this, arguments);
  14927. }
  14928. return platformDecryptResult;
  14929. }()
  14930. }, {
  14931. key: "isClientKeyNotFound",
  14932. value: function isClientKeyNotFound() {
  14933. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14934. var t = e.result || {};
  14935. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  14936. }
  14937. }]);
  14938. return Cn;
  14939. }(Lt);
  14940. function An() {
  14941. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14942. e = _ref29.secretType;
  14943. return e === xt || e === Rt || e === Ut;
  14944. }
  14945. function Pn() {
  14946. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14947. e = _ref30.name,
  14948. _ref30$data = _ref30.data,
  14949. t = _ref30$data === void 0 ? {} : _ref30$data;
  14950. return "app" === A && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  14951. }
  14952. function En() {
  14953. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14954. e = _ref31.provider,
  14955. t = _ref31.spaceId,
  14956. n = _ref31.functionName;
  14957. var _ce = ce(),
  14958. s = _ce.appId,
  14959. r = _ce.uniPlatform,
  14960. i = _ce.osName;
  14961. var o = r;
  14962. "app" === r && (o = i);
  14963. var a = function () {
  14964. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  14965. e = _ref32.provider,
  14966. t = _ref32.spaceId;
  14967. var n = C;
  14968. if (!n) return {};
  14969. e = function (e) {
  14970. return "tencent" === e ? "tcb" : e;
  14971. }(e);
  14972. var s = n.find(function (n) {
  14973. return n.provider === e && n.spaceId === t;
  14974. });
  14975. return s && s.config;
  14976. }({
  14977. provider: e,
  14978. spaceId: t
  14979. });
  14980. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  14981. var c = a.accessControl.function || {},
  14982. u = Object.keys(c);
  14983. if (0 === u.length) return !0;
  14984. var l = function (e, t) {
  14985. var n, s, r;
  14986. for (var _i2 = 0; _i2 < e.length; _i2++) {
  14987. var _o2 = e[_i2];
  14988. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  14989. return e.trim();
  14990. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  14991. }
  14992. return n || s || r;
  14993. }(u, n);
  14994. if (!l) return !1;
  14995. if ((c[l] || []).find(function () {
  14996. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14997. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  14998. })) return !0;
  14999. 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);
  15000. }
  15001. function On(_ref33) {
  15002. var e = _ref33.functionName,
  15003. t = _ref33.result,
  15004. n = _ref33.logPvd;
  15005. if (k && this.__dev__.debugLog && t && t.requestId) {
  15006. var _s11 = JSON.stringify({
  15007. spaceId: this.config.spaceId,
  15008. functionName: e,
  15009. requestId: t.requestId
  15010. });
  15011. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  15012. }
  15013. }
  15014. function xn(e) {
  15015. var t = e.callFunction,
  15016. n = function n(_n7) {
  15017. var _this18 = this;
  15018. var s = _n7.name;
  15019. _n7.data = It.call(e, {
  15020. data: _n7.data
  15021. });
  15022. var r = {
  15023. aliyun: "aliyun",
  15024. tencent: "tcb",
  15025. tcb: "tcb"
  15026. }[this.config.provider],
  15027. i = An(_n7),
  15028. o = Pn(_n7),
  15029. a = i || o;
  15030. return t.call(this, _n7).then(function (e) {
  15031. return e.errCode = 0, !a && On.call(_this18, {
  15032. functionName: s,
  15033. result: e,
  15034. logPvd: r
  15035. }), Promise.resolve(e);
  15036. }, function (e) {
  15037. return !a && On.call(_this18, {
  15038. functionName: s,
  15039. result: e,
  15040. logPvd: r
  15041. }), e && e.message && (e.message = function () {
  15042. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15043. _ref34$message = _ref34.message,
  15044. e = _ref34$message === void 0 ? "" : _ref34$message,
  15045. _ref34$extraInfo = _ref34.extraInfo,
  15046. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  15047. _ref34$formatter = _ref34.formatter,
  15048. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  15049. for (var _s12 = 0; _s12 < n.length; _s12++) {
  15050. var _n$_s = n[_s12],
  15051. _r4 = _n$_s.rule,
  15052. _i3 = _n$_s.content,
  15053. _o3 = _n$_s.mode,
  15054. _a = e.match(_r4);
  15055. if (!_a) continue;
  15056. var _c = _i3;
  15057. for (var _e20 = 1; _e20 < _a.length; _e20++) {
  15058. _c = Et(_c, "{$".concat(_e20, "}"), _a[_e20]);
  15059. }
  15060. for (var _e21 in t) {
  15061. _c = Et(_c, "{".concat(_e21, "}"), t[_e21]);
  15062. }
  15063. return "replace" === _o3 ? _c : e + _c;
  15064. }
  15065. return e;
  15066. }({
  15067. message: "[".concat(_n7.name, "]: ").concat(e.message),
  15068. formatter: Ct,
  15069. extraInfo: {
  15070. functionName: s
  15071. }
  15072. })), Promise.reject(e);
  15073. });
  15074. };
  15075. e.callFunction = function (t) {
  15076. var _e$config = e.config,
  15077. s = _e$config.provider,
  15078. r = _e$config.spaceId,
  15079. i = t.name;
  15080. var o, a;
  15081. if (t.data = t.data || {}, k && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && E ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Tt), o = Tt) : o = n, o = o.bind(e), Pn(t)) a = n.call(e, t);else if (function (_ref35) {
  15082. var e = _ref35.name,
  15083. _ref35$data = _ref35.data,
  15084. t = _ref35$data === void 0 ? {} : _ref35$data;
  15085. return "mp-weixin" === A && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  15086. }(t)) a = o.call(e, t);else if (An(t)) {
  15087. a = new Sn({
  15088. secretType: t.secretType,
  15089. uniCloudIns: e
  15090. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  15091. } else if (En({
  15092. provider: s,
  15093. spaceId: r,
  15094. functionName: i
  15095. })) {
  15096. a = new Sn({
  15097. secretType: t.secretType,
  15098. uniCloudIns: e
  15099. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  15100. } else a = o(t);
  15101. return Object.defineProperty(a, "result", {
  15102. get: function get() {
  15103. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  15104. }
  15105. }), a;
  15106. };
  15107. }
  15108. Sn = "mp-weixin" !== A && "app" !== A ? /*#__PURE__*/function () {
  15109. function _class2() {
  15110. (0, _classCallCheck2.default)(this, _class2);
  15111. throw vn({
  15112. message: "Platform ".concat(A, " is not supported by secure network")
  15113. });
  15114. }
  15115. return (0, _createClass2.default)(_class2);
  15116. }() : T ? "mp-weixin" === A ? In : Cn : /*#__PURE__*/function () {
  15117. function _class3() {
  15118. (0, _classCallCheck2.default)(this, _class3);
  15119. throw vn({
  15120. message: "Platform ".concat(A, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  15121. });
  15122. }
  15123. return (0, _createClass2.default)(_class3);
  15124. }();
  15125. var Rn = Symbol("CLIENT_DB_INTERNAL");
  15126. function Un(e, t) {
  15127. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Rn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  15128. get: function get(e, n, s) {
  15129. if ("_uniClient" === n) return null;
  15130. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  15131. if (n in e || "string" != typeof n) {
  15132. var _t10 = e[n];
  15133. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  15134. }
  15135. return t.get(e, n, s);
  15136. }
  15137. });
  15138. }
  15139. function Ln(e) {
  15140. return {
  15141. on: function on(t, n) {
  15142. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  15143. },
  15144. off: function off(t, n) {
  15145. e[t] = e[t] || [];
  15146. var s = e[t].indexOf(n);
  15147. -1 !== s && e[t].splice(s, 1);
  15148. }
  15149. };
  15150. }
  15151. var Nn = ["db.Geo", "db.command", "command.aggregate"];
  15152. function Dn(e, t) {
  15153. return Nn.indexOf("".concat(e, ".").concat(t)) > -1;
  15154. }
  15155. function Fn(e) {
  15156. switch (g(e)) {
  15157. case "array":
  15158. return e.map(function (e) {
  15159. return Fn(e);
  15160. });
  15161. case "object":
  15162. return e._internalType === Rn || Object.keys(e).forEach(function (t) {
  15163. e[t] = Fn(e[t]);
  15164. }), e;
  15165. case "regexp":
  15166. return {
  15167. $regexp: {
  15168. source: e.source,
  15169. flags: e.flags
  15170. }
  15171. };
  15172. case "date":
  15173. return {
  15174. $date: e.toISOString()
  15175. };
  15176. default:
  15177. return e;
  15178. }
  15179. }
  15180. function qn(e) {
  15181. return e && e.content && e.content.$method;
  15182. }
  15183. var Kn = /*#__PURE__*/function () {
  15184. function Kn(e, t, n) {
  15185. (0, _classCallCheck2.default)(this, Kn);
  15186. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  15187. }
  15188. (0, _createClass2.default)(Kn, [{
  15189. key: "toJSON",
  15190. value: function toJSON() {
  15191. var e = this;
  15192. var t = [e.content];
  15193. for (; e.prevStage;) {
  15194. e = e.prevStage, t.push(e.content);
  15195. }
  15196. return {
  15197. $db: t.reverse().map(function (e) {
  15198. return {
  15199. $method: e.$method,
  15200. $param: Fn(e.$param)
  15201. };
  15202. })
  15203. };
  15204. }
  15205. }, {
  15206. key: "getAction",
  15207. value: function getAction() {
  15208. var e = this.toJSON().$db.find(function (e) {
  15209. return "action" === e.$method;
  15210. });
  15211. return e && e.$param && e.$param[0];
  15212. }
  15213. }, {
  15214. key: "getCommand",
  15215. value: function getCommand() {
  15216. return {
  15217. $db: this.toJSON().$db.filter(function (e) {
  15218. return "action" !== e.$method;
  15219. })
  15220. };
  15221. }
  15222. }, {
  15223. key: "isAggregate",
  15224. get: function get() {
  15225. var e = this;
  15226. for (; e;) {
  15227. var t = qn(e),
  15228. _n8 = qn(e.prevStage);
  15229. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  15230. e = e.prevStage;
  15231. }
  15232. return !1;
  15233. }
  15234. }, {
  15235. key: "isCommand",
  15236. get: function get() {
  15237. var e = this;
  15238. for (; e;) {
  15239. if ("command" === qn(e)) return !0;
  15240. e = e.prevStage;
  15241. }
  15242. return !1;
  15243. }
  15244. }, {
  15245. key: "isAggregateCommand",
  15246. get: function get() {
  15247. var e = this;
  15248. for (; e;) {
  15249. var t = qn(e),
  15250. _n9 = qn(e.prevStage);
  15251. if ("aggregate" === t && "command" === _n9) return !0;
  15252. e = e.prevStage;
  15253. }
  15254. return !1;
  15255. }
  15256. }, {
  15257. key: "getNextStageFn",
  15258. value: function getNextStageFn(e) {
  15259. var t = this;
  15260. return function () {
  15261. return Mn({
  15262. $method: e,
  15263. $param: Fn(Array.from(arguments))
  15264. }, t, t._database);
  15265. };
  15266. }
  15267. }, {
  15268. key: "count",
  15269. get: function get() {
  15270. return this.isAggregate ? this.getNextStageFn("count") : function () {
  15271. return this._send("count", Array.from(arguments));
  15272. };
  15273. }
  15274. }, {
  15275. key: "remove",
  15276. get: function get() {
  15277. return this.isCommand ? this.getNextStageFn("remove") : function () {
  15278. return this._send("remove", Array.from(arguments));
  15279. };
  15280. }
  15281. }, {
  15282. key: "get",
  15283. value: function get() {
  15284. return this._send("get", Array.from(arguments));
  15285. }
  15286. }, {
  15287. key: "add",
  15288. get: function get() {
  15289. return this.isCommand ? this.getNextStageFn("add") : function () {
  15290. return this._send("add", Array.from(arguments));
  15291. };
  15292. }
  15293. }, {
  15294. key: "update",
  15295. value: function update() {
  15296. return this._send("update", Array.from(arguments));
  15297. }
  15298. }, {
  15299. key: "end",
  15300. value: function end() {
  15301. return this._send("end", Array.from(arguments));
  15302. }
  15303. }, {
  15304. key: "set",
  15305. get: function get() {
  15306. return this.isCommand ? this.getNextStageFn("set") : function () {
  15307. throw new Error("JQL禁止使用set方法");
  15308. };
  15309. }
  15310. }, {
  15311. key: "_send",
  15312. value: function _send(e, t) {
  15313. var n = this.getAction(),
  15314. s = this.getCommand();
  15315. if (s.$db.push({
  15316. $method: e,
  15317. $param: Fn(t)
  15318. }), k) {
  15319. var _e22 = s.$db.find(function (e) {
  15320. return "collection" === e.$method;
  15321. }),
  15322. _t11 = _e22 && _e22.$param;
  15323. _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- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  15324. }
  15325. return this._database._callCloudFunction({
  15326. action: n,
  15327. command: s
  15328. });
  15329. }
  15330. }]);
  15331. return Kn;
  15332. }();
  15333. function Mn(e, t, n) {
  15334. return Un(new Kn(e, t, n), {
  15335. get: function get(e, t) {
  15336. var s = "db";
  15337. return e && e.content && (s = e.content.$method), Dn(s, t) ? Mn({
  15338. $method: t
  15339. }, e, n) : function () {
  15340. return Mn({
  15341. $method: t,
  15342. $param: Fn(Array.from(arguments))
  15343. }, e, n);
  15344. };
  15345. }
  15346. });
  15347. }
  15348. function jn(_ref36) {
  15349. var e = _ref36.path,
  15350. t = _ref36.method;
  15351. return /*#__PURE__*/function () {
  15352. function _class4() {
  15353. (0, _classCallCheck2.default)(this, _class4);
  15354. this.param = Array.from(arguments);
  15355. }
  15356. (0, _createClass2.default)(_class4, [{
  15357. key: "toJSON",
  15358. value: function toJSON() {
  15359. return {
  15360. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  15361. return {
  15362. $method: e
  15363. };
  15364. })), [{
  15365. $method: t,
  15366. $param: this.param
  15367. }])
  15368. };
  15369. }
  15370. }]);
  15371. return _class4;
  15372. }();
  15373. }
  15374. function Bn(e) {
  15375. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15376. return Un(new e(t), {
  15377. get: function get(e, t) {
  15378. return Dn("db", t) ? Mn({
  15379. $method: t
  15380. }, null, e) : function () {
  15381. return Mn({
  15382. $method: t,
  15383. $param: Fn(Array.from(arguments))
  15384. }, null, e);
  15385. };
  15386. }
  15387. });
  15388. }
  15389. var $n = /*#__PURE__*/function (_ref37) {
  15390. (0, _inherits2.default)($n, _ref37);
  15391. var _super11 = _createSuper($n);
  15392. function $n() {
  15393. (0, _classCallCheck2.default)(this, $n);
  15394. return _super11.apply(this, arguments);
  15395. }
  15396. (0, _createClass2.default)($n, [{
  15397. key: "_parseResult",
  15398. value: function _parseResult(e) {
  15399. return this._isJQL ? e.result : e;
  15400. }
  15401. }, {
  15402. key: "_callCloudFunction",
  15403. value: function _callCloudFunction(_ref38) {
  15404. var _this19 = this;
  15405. var e = _ref38.action,
  15406. t = _ref38.command,
  15407. n = _ref38.multiCommand,
  15408. s = _ref38.queryList;
  15409. function r(e, t) {
  15410. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  15411. var _r5 = s[_n10];
  15412. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  15413. }
  15414. }
  15415. var i = this,
  15416. o = this._isJQL ? "databaseForJQL" : "database";
  15417. function a(e) {
  15418. return i._callback("error", [e]), q(K(o, "fail"), e).then(function () {
  15419. return q(K(o, "complete"), e);
  15420. }).then(function () {
  15421. return r(null, e), Q(B, {
  15422. type: z,
  15423. content: e
  15424. }), Promise.reject(e);
  15425. });
  15426. }
  15427. var c = q(K(o, "invoke")),
  15428. u = this._uniClient;
  15429. return c.then(function () {
  15430. return u.callFunction({
  15431. name: "DCloud-clientDB",
  15432. type: h,
  15433. data: {
  15434. action: e,
  15435. command: t,
  15436. multiCommand: n
  15437. }
  15438. });
  15439. }).then(function (e) {
  15440. var _e$result = e.result,
  15441. t = _e$result.code,
  15442. n = _e$result.message,
  15443. s = _e$result.token,
  15444. c = _e$result.tokenExpired,
  15445. _e$result$systemInfo = _e$result.systemInfo,
  15446. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  15447. if (u) for (var _e23 = 0; _e23 < u.length; _e23++) {
  15448. var _u$_e = u[_e23],
  15449. _t12 = _u$_e.level,
  15450. _n11 = _u$_e.message,
  15451. _s13 = _u$_e.detail,
  15452. _r6 = console["app" === A && "warn" === _t12 ? "error" : _t12] || console.log;
  15453. var _i4 = "[System Info]" + _n11;
  15454. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  15455. }
  15456. if (t) {
  15457. return a(new ne({
  15458. code: t,
  15459. message: n,
  15460. requestId: e.requestId
  15461. }));
  15462. }
  15463. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ie({
  15464. token: s,
  15465. tokenExpired: c
  15466. }), _this19._callbackAuth("refreshToken", [{
  15467. token: s,
  15468. tokenExpired: c
  15469. }]), _this19._callback("refreshToken", [{
  15470. token: s,
  15471. tokenExpired: c
  15472. }]), Q(W, {
  15473. token: s,
  15474. tokenExpired: c
  15475. }));
  15476. var l = [{
  15477. prop: "affectedDocs",
  15478. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  15479. }, {
  15480. prop: "code",
  15481. tips: "code不再推荐使用,请使用errCode替代"
  15482. }, {
  15483. prop: "message",
  15484. tips: "message不再推荐使用,请使用errMsg替代"
  15485. }];
  15486. var _loop2 = function _loop2(_t13) {
  15487. var _l$_t = l[_t13],
  15488. n = _l$_t.prop,
  15489. s = _l$_t.tips;
  15490. if (n in e.result) {
  15491. var _t14 = e.result[n];
  15492. Object.defineProperty(e.result, n, {
  15493. get: function get() {
  15494. return console.warn(s), _t14;
  15495. }
  15496. });
  15497. }
  15498. };
  15499. for (var _t13 = 0; _t13 < l.length; _t13++) {
  15500. _loop2(_t13);
  15501. }
  15502. return function (e) {
  15503. return q(K(o, "success"), e).then(function () {
  15504. return q(K(o, "complete"), e);
  15505. }).then(function () {
  15506. r(e, null);
  15507. var t = i._parseResult(e);
  15508. return Q(B, {
  15509. type: z,
  15510. content: t
  15511. }), Promise.resolve(t);
  15512. });
  15513. }(e);
  15514. }, function (e) {
  15515. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  15516. return a(new ne({
  15517. code: e.code || "SYSTEM_ERROR",
  15518. message: e.message,
  15519. requestId: e.requestId
  15520. }));
  15521. });
  15522. }
  15523. }]);
  15524. return $n;
  15525. }( /*#__PURE__*/function () {
  15526. function _class5() {
  15527. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15528. _ref39$uniClient = _ref39.uniClient,
  15529. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  15530. _ref39$isJQL = _ref39.isJQL,
  15531. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  15532. (0, _classCallCheck2.default)(this, _class5);
  15533. 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({}, {
  15534. get: function get(e, t) {
  15535. return {
  15536. $env: t
  15537. };
  15538. }
  15539. }), this.Geo = Un({}, {
  15540. get: function get(e, t) {
  15541. return jn({
  15542. path: ["Geo"],
  15543. method: t
  15544. });
  15545. }
  15546. }), this.serverDate = jn({
  15547. path: [],
  15548. method: "serverDate"
  15549. }), this.RegExp = jn({
  15550. path: [],
  15551. method: "RegExp"
  15552. });
  15553. }
  15554. (0, _createClass2.default)(_class5, [{
  15555. key: "getCloudEnv",
  15556. value: function getCloudEnv(e) {
  15557. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  15558. return {
  15559. $env: e.replace("$cloudEnv_", "")
  15560. };
  15561. }
  15562. }, {
  15563. key: "_callback",
  15564. value: function _callback(e, t) {
  15565. var n = this._dbCallBacks;
  15566. n[e] && n[e].forEach(function (e) {
  15567. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15568. });
  15569. }
  15570. }, {
  15571. key: "_callbackAuth",
  15572. value: function _callbackAuth(e, t) {
  15573. var n = this._authCallBacks;
  15574. n[e] && n[e].forEach(function (e) {
  15575. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  15576. });
  15577. }
  15578. }, {
  15579. key: "multiSend",
  15580. value: function multiSend() {
  15581. var e = Array.from(arguments),
  15582. t = e.map(function (e) {
  15583. var t = e.getAction(),
  15584. n = e.getCommand();
  15585. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  15586. return {
  15587. action: t,
  15588. command: n
  15589. };
  15590. });
  15591. return this._callCloudFunction({
  15592. multiCommand: t,
  15593. queryList: e
  15594. });
  15595. }
  15596. }]);
  15597. return _class5;
  15598. }());
  15599. var Wn = "token无效,跳转登录页面",
  15600. zn = "token过期,跳转登录页面",
  15601. Jn = {
  15602. TOKEN_INVALID_TOKEN_EXPIRED: zn,
  15603. TOKEN_INVALID_INVALID_CLIENTID: Wn,
  15604. TOKEN_INVALID: Wn,
  15605. TOKEN_INVALID_WRONG_TOKEN: Wn,
  15606. TOKEN_INVALID_ANONYMOUS_USER: Wn
  15607. },
  15608. Hn = {
  15609. "uni-id-token-expired": zn,
  15610. "uni-id-check-token-failed": Wn,
  15611. "uni-id-token-not-exist": Wn,
  15612. "uni-id-check-device-feature-failed": Wn
  15613. };
  15614. function Gn(e, t) {
  15615. var n = "";
  15616. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  15617. }
  15618. function Vn() {
  15619. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  15620. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  15621. var n = [],
  15622. s = [];
  15623. return e.forEach(function (e) {
  15624. !0 === e.needLogin ? n.push(Gn(t, e.path)) : !1 === e.needLogin && s.push(Gn(t, e.path));
  15625. }), {
  15626. needLoginPage: n,
  15627. notNeedLoginPage: s
  15628. };
  15629. }
  15630. function Yn(e) {
  15631. return e.split("?")[0].replace(/^\//, "");
  15632. }
  15633. function Qn() {
  15634. return function (e) {
  15635. var t = e && e.$page && e.$page.fullPath || "";
  15636. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  15637. }(function () {
  15638. var e = getCurrentPages();
  15639. return e[e.length - 1];
  15640. }());
  15641. }
  15642. function Xn() {
  15643. return Yn(Qn());
  15644. }
  15645. function Zn() {
  15646. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  15647. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15648. if (!e) return !1;
  15649. if (!(t && t.list && t.list.length)) return !1;
  15650. var n = t.list,
  15651. s = Yn(e);
  15652. return n.some(function (e) {
  15653. return e.pagePath === s;
  15654. });
  15655. }
  15656. var es = !!_pages.default.uniIdRouter;
  15657. var _ref40 = function () {
  15658. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  15659. _ref21$pages = _ref21.pages,
  15660. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  15661. _ref21$subPackages = _ref21.subPackages,
  15662. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  15663. _ref21$uniIdRouter = _ref21.uniIdRouter,
  15664. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  15665. _ref21$tabBar = _ref21.tabBar,
  15666. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  15667. var i = s.loginPage,
  15668. _s$needLogin = s.needLogin,
  15669. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  15670. _s$resToLogin = s.resToLogin,
  15671. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  15672. _Vn = Vn(e),
  15673. c = _Vn.needLoginPage,
  15674. u = _Vn.notNeedLoginPage,
  15675. _ref23 = function () {
  15676. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  15677. var t = [],
  15678. n = [];
  15679. return e.forEach(function (e) {
  15680. var s = e.root,
  15681. _e$pages = e.pages,
  15682. r = _e$pages === void 0 ? [] : _e$pages,
  15683. _Vn2 = Vn(r, s),
  15684. i = _Vn2.needLoginPage,
  15685. o = _Vn2.notNeedLoginPage;
  15686. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  15687. }), {
  15688. needLoginPage: t,
  15689. notNeedLoginPage: n
  15690. };
  15691. }(n),
  15692. l = _ref23.needLoginPage,
  15693. h = _ref23.notNeedLoginPage;
  15694. return {
  15695. loginPage: i,
  15696. routerNeedLogin: o,
  15697. resToLogin: a,
  15698. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  15699. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  15700. loginPageInTabBar: Zn(i, r)
  15701. };
  15702. }(),
  15703. ts = _ref40.loginPage,
  15704. ns = _ref40.routerNeedLogin,
  15705. ss = _ref40.resToLogin,
  15706. rs = _ref40.needLoginPage,
  15707. is = _ref40.notNeedLoginPage,
  15708. os = _ref40.loginPageInTabBar;
  15709. if (rs.indexOf(ts) > -1) throw new Error("Login page [".concat(ts, "] should not be \"needLogin\", please check your pages.json"));
  15710. function as(e) {
  15711. var t = Xn();
  15712. if ("/" === e.charAt(0)) return e;
  15713. var _e$split = e.split("?"),
  15714. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  15715. n = _e$split2[0],
  15716. s = _e$split2[1],
  15717. r = n.replace(/^\//, "").split("/"),
  15718. i = t.split("/");
  15719. i.pop();
  15720. for (var _e24 = 0; _e24 < r.length; _e24++) {
  15721. var _t15 = r[_e24];
  15722. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  15723. }
  15724. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  15725. }
  15726. function cs(e) {
  15727. var t = Yn(as(e));
  15728. return !(is.indexOf(t) > -1) && (rs.indexOf(t) > -1 || ns.some(function (t) {
  15729. return function (e, t) {
  15730. return new RegExp(t).test(e);
  15731. }(e, t);
  15732. }));
  15733. }
  15734. function us(_ref41) {
  15735. var e = _ref41.redirect;
  15736. var t = Yn(e),
  15737. n = Yn(ts);
  15738. return Xn() !== n && t !== n;
  15739. }
  15740. function ls() {
  15741. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15742. e = _ref42.api,
  15743. t = _ref42.redirect;
  15744. if (!t || !us({
  15745. redirect: t
  15746. })) return;
  15747. var n = function (e, t) {
  15748. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  15749. }(ts, t);
  15750. os ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  15751. var s = {
  15752. navigateTo: uni.navigateTo,
  15753. redirectTo: uni.redirectTo,
  15754. switchTab: uni.switchTab,
  15755. reLaunch: uni.reLaunch
  15756. };
  15757. setTimeout(function () {
  15758. s[e]({
  15759. url: n
  15760. });
  15761. });
  15762. }
  15763. function hs() {
  15764. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15765. e = _ref43.url;
  15766. var t = {
  15767. abortLoginPageJump: !1,
  15768. autoToLoginPage: !1
  15769. },
  15770. n = function () {
  15771. var _re3 = re(),
  15772. e = _re3.token,
  15773. t = _re3.tokenExpired;
  15774. var n;
  15775. if (e) {
  15776. if (t < Date.now()) {
  15777. var _e25 = "uni-id-token-expired";
  15778. n = {
  15779. errCode: _e25,
  15780. errMsg: Hn[_e25]
  15781. };
  15782. }
  15783. } else {
  15784. var _e26 = "uni-id-check-token-failed";
  15785. n = {
  15786. errCode: _e26,
  15787. errMsg: Hn[_e26]
  15788. };
  15789. }
  15790. return n;
  15791. }();
  15792. if (cs(e) && n) {
  15793. n.uniIdRedirectUrl = e;
  15794. if (G($).length > 0) return setTimeout(function () {
  15795. Q($, n);
  15796. }, 0), t.abortLoginPageJump = !0, t;
  15797. t.autoToLoginPage = !0;
  15798. }
  15799. return t;
  15800. }
  15801. function ds() {
  15802. !function () {
  15803. var e = Qn(),
  15804. _hs = hs({
  15805. url: e
  15806. }),
  15807. t = _hs.abortLoginPageJump,
  15808. n = _hs.autoToLoginPage;
  15809. t || n && ls({
  15810. api: "redirectTo",
  15811. redirect: e
  15812. });
  15813. }();
  15814. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  15815. var _loop3 = function _loop3(_t16) {
  15816. var n = e[_t16];
  15817. uni.addInterceptor(n, {
  15818. invoke: function invoke(e) {
  15819. var _hs2 = hs({
  15820. url: e.url
  15821. }),
  15822. t = _hs2.abortLoginPageJump,
  15823. s = _hs2.autoToLoginPage;
  15824. return t ? e : s ? (ls({
  15825. api: n,
  15826. redirect: as(e.url)
  15827. }), !1) : e;
  15828. }
  15829. });
  15830. };
  15831. for (var _t16 = 0; _t16 < e.length; _t16++) {
  15832. _loop3(_t16);
  15833. }
  15834. }
  15835. function ps() {
  15836. this.onResponse(function (e) {
  15837. var t = e.type,
  15838. n = e.content;
  15839. var s = !1;
  15840. switch (t) {
  15841. case "cloudobject":
  15842. s = function (e) {
  15843. if ("object" != (0, _typeof2.default)(e)) return !1;
  15844. var _ref44 = e || {},
  15845. t = _ref44.errCode;
  15846. return t in Hn;
  15847. }(n);
  15848. break;
  15849. case "clientdb":
  15850. s = function (e) {
  15851. if ("object" != (0, _typeof2.default)(e)) return !1;
  15852. var _ref45 = e || {},
  15853. t = _ref45.errCode;
  15854. return t in Jn;
  15855. }(n);
  15856. }
  15857. s && function () {
  15858. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15859. var t = G($);
  15860. ee().then(function () {
  15861. var n = Qn();
  15862. if (n && us({
  15863. redirect: n
  15864. })) return t.length > 0 ? Q($, Object.assign({
  15865. uniIdRedirectUrl: n
  15866. }, e)) : void (ts && ls({
  15867. api: "navigateTo",
  15868. redirect: n
  15869. }));
  15870. });
  15871. }(n);
  15872. });
  15873. }
  15874. function fs(e) {
  15875. !function (e) {
  15876. e.onResponse = function (e) {
  15877. V(B, e);
  15878. }, e.offResponse = function (e) {
  15879. Y(B, e);
  15880. };
  15881. }(e), function (e) {
  15882. e.onNeedLogin = function (e) {
  15883. V($, e);
  15884. }, e.offNeedLogin = function (e) {
  15885. Y($, e);
  15886. }, es && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = !0, ee().then(function () {
  15887. ds.call(e);
  15888. }), ss && ps.call(e)));
  15889. }(e), function (e) {
  15890. e.onRefreshToken = function (e) {
  15891. V(W, e);
  15892. }, e.offRefreshToken = function (e) {
  15893. Y(W, e);
  15894. };
  15895. }(e);
  15896. }
  15897. var gs;
  15898. var ms = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  15899. ys = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15900. function _s() {
  15901. var e = re().token || "",
  15902. t = e.split(".");
  15903. if (!e || 3 !== t.length) return {
  15904. uid: null,
  15905. role: [],
  15906. permission: [],
  15907. tokenExpired: 0
  15908. };
  15909. var n;
  15910. try {
  15911. n = JSON.parse((s = t[1], decodeURIComponent(gs(s).split("").map(function (e) {
  15912. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  15913. }).join(""))));
  15914. } catch (e) {
  15915. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  15916. }
  15917. var s;
  15918. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  15919. }
  15920. gs = "function" != typeof atob ? function (e) {
  15921. 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.");
  15922. var t;
  15923. e += "==".slice(2 - (3 & e.length));
  15924. for (var n, s, r = "", i = 0; i < e.length;) {
  15925. 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);
  15926. }
  15927. return r;
  15928. } : atob;
  15929. var ws = s(function (e, t) {
  15930. Object.defineProperty(t, "__esModule", {
  15931. value: !0
  15932. });
  15933. var n = "chooseAndUploadFile:ok",
  15934. s = "chooseAndUploadFile:fail";
  15935. function r(e, t) {
  15936. return e.tempFiles.forEach(function (e, n) {
  15937. 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("."));
  15938. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  15939. return e.path;
  15940. })), e;
  15941. }
  15942. function i(e, t, _ref46) {
  15943. var s = _ref46.onChooseFile,
  15944. r = _ref46.onUploadProgress;
  15945. return t.then(function (e) {
  15946. if (s) {
  15947. var _t17 = s(e);
  15948. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  15949. return void 0 === t ? e : t;
  15950. });
  15951. }
  15952. return e;
  15953. }).then(function (t) {
  15954. return !1 === t ? {
  15955. errMsg: n,
  15956. tempFilePaths: [],
  15957. tempFiles: []
  15958. } : function (e, t) {
  15959. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  15960. var r = arguments.length > 3 ? arguments[3] : undefined;
  15961. (t = Object.assign({}, t)).errMsg = n;
  15962. var i = t.tempFiles,
  15963. o = i.length;
  15964. var a = 0;
  15965. return new Promise(function (n) {
  15966. for (; a < s;) {
  15967. c();
  15968. }
  15969. function c() {
  15970. var s = a++;
  15971. if (s >= o) return void (!i.find(function (e) {
  15972. return !e.url && !e.errMsg;
  15973. }) && n(t));
  15974. var u = i[s];
  15975. e.uploadFile({
  15976. filePath: u.path,
  15977. cloudPath: u.cloudPath,
  15978. fileType: u.fileType,
  15979. onUploadProgress: function onUploadProgress(e) {
  15980. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  15981. }
  15982. }).then(function (e) {
  15983. u.url = e.fileID, s < o && c();
  15984. }).catch(function (e) {
  15985. u.errMsg = e.errMsg || e.message, s < o && c();
  15986. });
  15987. }
  15988. });
  15989. }(e, t, 5, r);
  15990. });
  15991. }
  15992. t.initChooseAndUploadFile = function (e) {
  15993. return function () {
  15994. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  15995. type: "all"
  15996. };
  15997. return "image" === t.type ? i(e, function (e) {
  15998. var t = e.count,
  15999. n = e.sizeType,
  16000. _e$sourceType = e.sourceType,
  16001. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  16002. o = e.extension;
  16003. return new Promise(function (e, a) {
  16004. uni.chooseImage({
  16005. count: t,
  16006. sizeType: n,
  16007. sourceType: i,
  16008. extension: o,
  16009. success: function success(t) {
  16010. e(r(t, "image"));
  16011. },
  16012. fail: function fail(e) {
  16013. a({
  16014. errMsg: e.errMsg.replace("chooseImage:fail", s)
  16015. });
  16016. }
  16017. });
  16018. });
  16019. }(t), t) : "video" === t.type ? i(e, function (e) {
  16020. var t = e.camera,
  16021. n = e.compressed,
  16022. i = e.maxDuration,
  16023. _e$sourceType2 = e.sourceType,
  16024. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  16025. a = e.extension;
  16026. return new Promise(function (e, c) {
  16027. uni.chooseVideo({
  16028. camera: t,
  16029. compressed: n,
  16030. maxDuration: i,
  16031. sourceType: o,
  16032. extension: a,
  16033. success: function success(t) {
  16034. var n = t.tempFilePath,
  16035. s = t.duration,
  16036. i = t.size,
  16037. o = t.height,
  16038. a = t.width;
  16039. e(r({
  16040. errMsg: "chooseVideo:ok",
  16041. tempFilePaths: [n],
  16042. tempFiles: [{
  16043. name: t.tempFile && t.tempFile.name || "",
  16044. path: n,
  16045. size: i,
  16046. type: t.tempFile && t.tempFile.type || "",
  16047. width: a,
  16048. height: o,
  16049. duration: s,
  16050. fileType: "video",
  16051. cloudPath: ""
  16052. }]
  16053. }, "video"));
  16054. },
  16055. fail: function fail(e) {
  16056. c({
  16057. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  16058. });
  16059. }
  16060. });
  16061. });
  16062. }(t), t) : i(e, function (e) {
  16063. var t = e.count,
  16064. n = e.extension;
  16065. return new Promise(function (e, i) {
  16066. var o = uni.chooseFile;
  16067. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  16068. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  16069. });
  16070. o({
  16071. type: "all",
  16072. count: t,
  16073. extension: n,
  16074. success: function success(t) {
  16075. e(r(t));
  16076. },
  16077. fail: function fail(e) {
  16078. i({
  16079. errMsg: e.errMsg.replace("chooseFile:fail", s)
  16080. });
  16081. }
  16082. });
  16083. });
  16084. }(t), t);
  16085. };
  16086. };
  16087. }),
  16088. vs = n(ws);
  16089. var bs = "manual";
  16090. function Ss(e) {
  16091. return {
  16092. props: {
  16093. localdata: {
  16094. type: Array,
  16095. default: function _default() {
  16096. return [];
  16097. }
  16098. },
  16099. options: {
  16100. type: [Object, Array],
  16101. default: function _default() {
  16102. return {};
  16103. }
  16104. },
  16105. spaceInfo: {
  16106. type: Object,
  16107. default: function _default() {
  16108. return {};
  16109. }
  16110. },
  16111. collection: {
  16112. type: [String, Array],
  16113. default: ""
  16114. },
  16115. action: {
  16116. type: String,
  16117. default: ""
  16118. },
  16119. field: {
  16120. type: String,
  16121. default: ""
  16122. },
  16123. orderby: {
  16124. type: String,
  16125. default: ""
  16126. },
  16127. where: {
  16128. type: [String, Object],
  16129. default: ""
  16130. },
  16131. pageData: {
  16132. type: String,
  16133. default: "add"
  16134. },
  16135. pageCurrent: {
  16136. type: Number,
  16137. default: 1
  16138. },
  16139. pageSize: {
  16140. type: Number,
  16141. default: 20
  16142. },
  16143. getcount: {
  16144. type: [Boolean, String],
  16145. default: !1
  16146. },
  16147. gettree: {
  16148. type: [Boolean, String],
  16149. default: !1
  16150. },
  16151. gettreepath: {
  16152. type: [Boolean, String],
  16153. default: !1
  16154. },
  16155. startwith: {
  16156. type: String,
  16157. default: ""
  16158. },
  16159. limitlevel: {
  16160. type: Number,
  16161. default: 10
  16162. },
  16163. groupby: {
  16164. type: String,
  16165. default: ""
  16166. },
  16167. groupField: {
  16168. type: String,
  16169. default: ""
  16170. },
  16171. distinct: {
  16172. type: [Boolean, String],
  16173. default: !1
  16174. },
  16175. foreignKey: {
  16176. type: String,
  16177. default: ""
  16178. },
  16179. loadtime: {
  16180. type: String,
  16181. default: "auto"
  16182. },
  16183. manual: {
  16184. type: Boolean,
  16185. default: !1
  16186. }
  16187. },
  16188. data: function data() {
  16189. return {
  16190. mixinDatacomLoading: !1,
  16191. mixinDatacomHasMore: !1,
  16192. mixinDatacomResData: [],
  16193. mixinDatacomErrorMessage: "",
  16194. mixinDatacomPage: {}
  16195. };
  16196. },
  16197. created: function created() {
  16198. var _this20 = this;
  16199. this.mixinDatacomPage = {
  16200. current: this.pageCurrent,
  16201. size: this.pageSize,
  16202. count: 0
  16203. }, this.$watch(function () {
  16204. var e = [];
  16205. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  16206. e.push(_this20[t]);
  16207. }), e;
  16208. }, function (e, t) {
  16209. if (_this20.loadtime === bs) return;
  16210. var n = !1;
  16211. var s = [];
  16212. for (var _r7 = 2; _r7 < e.length; _r7++) {
  16213. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  16214. }
  16215. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  16216. });
  16217. },
  16218. methods: {
  16219. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  16220. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  16221. var _this21 = this;
  16222. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16223. _ref47$getone = _ref47.getone,
  16224. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  16225. t = _ref47.success,
  16226. n = _ref47.fail;
  16227. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  16228. _this21.mixinDatacomLoading = !1;
  16229. var _n$result = n.result,
  16230. s = _n$result.data,
  16231. r = _n$result.count;
  16232. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  16233. var i = e ? s.length ? s[0] : void 0 : s;
  16234. _this21.mixinDatacomResData = i, t && t(i);
  16235. }).catch(function (e) {
  16236. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  16237. }));
  16238. },
  16239. mixinDatacomGet: function mixinDatacomGet() {
  16240. var _n12;
  16241. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  16242. var n = e.database(this.spaceInfo);
  16243. var s = t.action || this.action;
  16244. s && (n = n.action(s));
  16245. var r = t.collection || this.collection;
  16246. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  16247. var i = t.where || this.where;
  16248. i && Object.keys(i).length && (n = n.where(i));
  16249. var o = t.field || this.field;
  16250. o && (n = n.field(o));
  16251. var a = t.foreignKey || this.foreignKey;
  16252. a && (n = n.foreignKey(a));
  16253. var c = t.groupby || this.groupby;
  16254. c && (n = n.groupBy(c));
  16255. var u = t.groupField || this.groupField;
  16256. u && (n = n.groupField(u));
  16257. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  16258. var l = t.orderby || this.orderby;
  16259. l && (n = n.orderBy(l));
  16260. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  16261. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  16262. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  16263. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  16264. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  16265. m = {
  16266. getCount: p
  16267. },
  16268. y = {
  16269. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  16270. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  16271. };
  16272. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  16273. }
  16274. }
  16275. };
  16276. }
  16277. function ks(e) {
  16278. return function (t) {
  16279. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16280. n = function (e) {
  16281. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16282. 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;
  16283. }({
  16284. customUI: !1,
  16285. loadingOptions: {
  16286. title: "加载中...",
  16287. mask: !0
  16288. },
  16289. errorOptions: {
  16290. type: "modal",
  16291. retry: !1
  16292. }
  16293. }, n);
  16294. var _n13 = n,
  16295. s = _n13.customUI,
  16296. r = _n13.loadingOptions,
  16297. i = _n13.errorOptions,
  16298. o = _n13.parseSystemError,
  16299. a = !s;
  16300. return new Proxy({}, {
  16301. get: function get(s, c) {
  16302. return function () {
  16303. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16304. e = _ref48.fn,
  16305. t = _ref48.interceptorName,
  16306. n = _ref48.getCallbackArgs;
  16307. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  16308. var _len2,
  16309. s,
  16310. _key2,
  16311. r,
  16312. i,
  16313. o,
  16314. _args = arguments;
  16315. return _regenerator.default.wrap(function _callee50$(_context50) {
  16316. while (1) {
  16317. switch (_context50.prev = _context50.next) {
  16318. case 0:
  16319. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  16320. s[_key2] = _args[_key2];
  16321. }
  16322. r = n ? n({
  16323. params: s
  16324. }) : {};
  16325. _context50.prev = 2;
  16326. _context50.next = 5;
  16327. return q(K(t, "invoke"), _objectSpread({}, r));
  16328. case 5:
  16329. _context50.next = 7;
  16330. return e.apply(void 0, s);
  16331. case 7:
  16332. i = _context50.sent;
  16333. _context50.next = 10;
  16334. return q(K(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  16335. result: i
  16336. }));
  16337. case 10:
  16338. return _context50.abrupt("return", i);
  16339. case 13:
  16340. _context50.prev = 13;
  16341. _context50.t0 = _context50["catch"](2);
  16342. o = _context50.t0;
  16343. _context50.next = 18;
  16344. return q(K(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  16345. error: o
  16346. }));
  16347. case 18:
  16348. throw o;
  16349. case 19:
  16350. _context50.prev = 19;
  16351. _context50.next = 22;
  16352. return q(K(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  16353. error: o
  16354. }) : _objectSpread(_objectSpread({}, r), {}, {
  16355. result: i
  16356. }));
  16357. case 22:
  16358. return _context50.finish(19);
  16359. case 23:
  16360. case "end":
  16361. return _context50.stop();
  16362. }
  16363. }
  16364. }, _callee50, null, [[2, 13, 19, 23]]);
  16365. }));
  16366. }({
  16367. fn: function () {
  16368. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  16369. var h,
  16370. _len3,
  16371. u,
  16372. _key3,
  16373. d,
  16374. p,
  16375. _ref50,
  16376. f,
  16377. g,
  16378. m,
  16379. y,
  16380. _e27,
  16381. _yield,
  16382. _t18,
  16383. _n14,
  16384. _args4 = arguments;
  16385. return _regenerator.default.wrap(function _callee52$(_context52) {
  16386. while (1) {
  16387. switch (_context52.prev = _context52.next) {
  16388. case 0:
  16389. a && uni.showLoading({
  16390. title: r.title,
  16391. mask: r.mask
  16392. });
  16393. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  16394. u[_key3] = _args4[_key3];
  16395. }
  16396. d = {
  16397. name: t,
  16398. type: l,
  16399. data: {
  16400. method: c,
  16401. params: u
  16402. }
  16403. };
  16404. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  16405. var n = t.data.method,
  16406. s = e.secretMethods || {},
  16407. r = s[n] || s["*"];
  16408. r && (t.secretType = r);
  16409. }(n, d);
  16410. p = !1;
  16411. _context52.prev = 5;
  16412. _context52.next = 8;
  16413. return e.callFunction(d);
  16414. case 8:
  16415. h = _context52.sent;
  16416. _context52.next = 14;
  16417. break;
  16418. case 11:
  16419. _context52.prev = 11;
  16420. _context52.t0 = _context52["catch"](5);
  16421. p = !0, h = {
  16422. result: new ne(_context52.t0)
  16423. };
  16424. case 14:
  16425. _ref50 = h.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  16426. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ie(y), Q(W, _objectSpread({}, y))), g)) {
  16427. _context52.next = 39;
  16428. break;
  16429. }
  16430. _e27 = m;
  16431. if (!(p && o)) {
  16432. _context52.next = 24;
  16433. break;
  16434. }
  16435. _context52.next = 20;
  16436. return o({
  16437. objectName: t,
  16438. methodName: c,
  16439. params: u,
  16440. errSubject: f,
  16441. errCode: g,
  16442. errMsg: m
  16443. });
  16444. case 20:
  16445. _context52.t1 = _context52.sent.errMsg;
  16446. if (_context52.t1) {
  16447. _context52.next = 23;
  16448. break;
  16449. }
  16450. _context52.t1 = m;
  16451. case 23:
  16452. _e27 = _context52.t1;
  16453. case 24:
  16454. if (!a) {
  16455. _context52.next = 37;
  16456. break;
  16457. }
  16458. if (!("toast" === i.type)) {
  16459. _context52.next = 29;
  16460. break;
  16461. }
  16462. uni.showToast({
  16463. title: _e27,
  16464. icon: "none"
  16465. });
  16466. _context52.next = 37;
  16467. break;
  16468. case 29:
  16469. if (!("modal" !== i.type)) {
  16470. _context52.next = 31;
  16471. break;
  16472. }
  16473. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  16474. case 31:
  16475. _context52.next = 33;
  16476. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  16477. var _ref52,
  16478. e,
  16479. t,
  16480. n,
  16481. s,
  16482. r,
  16483. _args2 = arguments;
  16484. return _regenerator.default.wrap(function _callee51$(_context51) {
  16485. while (1) {
  16486. switch (_context51.prev = _context51.next) {
  16487. case 0:
  16488. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  16489. return _context51.abrupt("return", new Promise(function (i, o) {
  16490. uni.showModal({
  16491. title: e,
  16492. content: t,
  16493. showCancel: n,
  16494. cancelText: s,
  16495. confirmText: r,
  16496. success: function success(e) {
  16497. i(e);
  16498. },
  16499. fail: function fail() {
  16500. i({
  16501. confirm: !1,
  16502. cancel: !0
  16503. });
  16504. }
  16505. });
  16506. }));
  16507. case 2:
  16508. case "end":
  16509. return _context51.stop();
  16510. }
  16511. }
  16512. }, _callee51);
  16513. }))({
  16514. title: "提示",
  16515. content: _e27,
  16516. showCancel: i.retry,
  16517. cancelText: "取消",
  16518. confirmText: i.retry ? "重试" : "确定"
  16519. });
  16520. case 33:
  16521. _yield = _context52.sent;
  16522. _t18 = _yield.confirm;
  16523. if (!(i.retry && _t18)) {
  16524. _context52.next = 37;
  16525. break;
  16526. }
  16527. return _context52.abrupt("return", s.apply(void 0, u));
  16528. case 37:
  16529. _n14 = new ne({
  16530. subject: f,
  16531. code: g,
  16532. message: m,
  16533. requestId: h.requestId
  16534. });
  16535. throw _n14.detail = h.result, Q(B, {
  16536. type: H,
  16537. content: _n14
  16538. }), _n14;
  16539. case 39:
  16540. return _context52.abrupt("return", (Q(B, {
  16541. type: H,
  16542. content: h.result
  16543. }), h.result));
  16544. case 40:
  16545. case "end":
  16546. return _context52.stop();
  16547. }
  16548. }
  16549. }, _callee52, null, [[5, 11]]);
  16550. }));
  16551. function s() {
  16552. return _s14.apply(this, arguments);
  16553. }
  16554. return s;
  16555. }(),
  16556. interceptorName: "callObject",
  16557. getCallbackArgs: function getCallbackArgs() {
  16558. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16559. e = _ref53.params;
  16560. return {
  16561. objectName: t,
  16562. methodName: c,
  16563. params: e
  16564. };
  16565. }
  16566. });
  16567. }
  16568. });
  16569. };
  16570. }
  16571. function Is(e) {
  16572. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  16573. }
  16574. function Ts() {
  16575. return _Ts.apply(this, arguments);
  16576. }
  16577. function _Ts() {
  16578. _Ts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  16579. var _ref60,
  16580. e,
  16581. _ref60$callLoginByWei,
  16582. t,
  16583. n,
  16584. s,
  16585. r,
  16586. _args6 = arguments;
  16587. return _regenerator.default.wrap(function _callee54$(_context54) {
  16588. while (1) {
  16589. switch (_context54.prev = _context54.next) {
  16590. case 0:
  16591. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.openid, _ref60$callLoginByWei = _ref60.callLoginByWeixin, t = _ref60$callLoginByWei === void 0 ? !1 : _ref60$callLoginByWei;
  16592. n = Is(this);
  16593. if (!("mp-weixin" !== A)) {
  16594. _context54.next = 4;
  16595. break;
  16596. }
  16597. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(A, "`"));
  16598. case 4:
  16599. if (!(e && t)) {
  16600. _context54.next = 6;
  16601. break;
  16602. }
  16603. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  16604. case 6:
  16605. if (!e) {
  16606. _context54.next = 8;
  16607. break;
  16608. }
  16609. return _context54.abrupt("return", (n.mpWeixinOpenid = e, {}));
  16610. case 8:
  16611. _context54.next = 10;
  16612. return new Promise(function (e, t) {
  16613. uni.login({
  16614. success: function success(t) {
  16615. e(t.code);
  16616. },
  16617. fail: function fail(e) {
  16618. t(new Error(e.errMsg));
  16619. }
  16620. });
  16621. });
  16622. case 10:
  16623. s = _context54.sent;
  16624. r = this.importObject("uni-id-co", {
  16625. customUI: !0
  16626. });
  16627. _context54.next = 14;
  16628. return r.secureNetworkHandshakeByWeixin({
  16629. code: s,
  16630. callLoginByWeixin: t
  16631. });
  16632. case 14:
  16633. n.mpWeixinCode = s;
  16634. return _context54.abrupt("return", {
  16635. code: s
  16636. });
  16637. case 16:
  16638. case "end":
  16639. return _context54.stop();
  16640. }
  16641. }
  16642. }, _callee54, this);
  16643. }));
  16644. return _Ts.apply(this, arguments);
  16645. }
  16646. function Cs(_x37) {
  16647. return _Cs.apply(this, arguments);
  16648. }
  16649. function _Cs() {
  16650. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(e) {
  16651. var t;
  16652. return _regenerator.default.wrap(function _callee55$(_context55) {
  16653. while (1) {
  16654. switch (_context55.prev = _context55.next) {
  16655. case 0:
  16656. t = Is(this);
  16657. return _context55.abrupt("return", (t.initPromise || (t.initPromise = Ts.call(this, e)), t.initPromise));
  16658. case 2:
  16659. case "end":
  16660. return _context55.stop();
  16661. }
  16662. }
  16663. }, _callee55, this);
  16664. }));
  16665. return _Cs.apply(this, arguments);
  16666. }
  16667. function As(e) {
  16668. return function () {
  16669. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16670. t = _ref54.openid,
  16671. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  16672. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  16673. return Cs.call(e, {
  16674. openid: t,
  16675. callLoginByWeixin: n
  16676. });
  16677. };
  16678. }
  16679. function Ps(_x38, _x39) {
  16680. return _Ps.apply(this, arguments);
  16681. }
  16682. function _Ps() {
  16683. _Ps = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e, t) {
  16684. var n, _e31, s;
  16685. return _regenerator.default.wrap(function _callee56$(_context56) {
  16686. while (1) {
  16687. switch (_context56.prev = _context56.next) {
  16688. case 0:
  16689. n = "http://".concat(e, ":").concat(t, "/system/ping");
  16690. _context56.prev = 1;
  16691. _context56.next = 4;
  16692. return s = {
  16693. url: n,
  16694. timeout: 500
  16695. }, new Promise(function (e, t) {
  16696. se.request(_objectSpread(_objectSpread({}, s), {}, {
  16697. success: function success(t) {
  16698. e(t);
  16699. },
  16700. fail: function fail(e) {
  16701. t(e);
  16702. }
  16703. }));
  16704. });
  16705. case 4:
  16706. _e31 = _context56.sent;
  16707. return _context56.abrupt("return", !(!_e31.data || 0 !== _e31.data.code));
  16708. case 8:
  16709. _context56.prev = 8;
  16710. _context56.t0 = _context56["catch"](1);
  16711. return _context56.abrupt("return", !1);
  16712. case 11:
  16713. case "end":
  16714. return _context56.stop();
  16715. }
  16716. }
  16717. }, _callee56, null, [[1, 8]]);
  16718. }));
  16719. return _Ps.apply(this, arguments);
  16720. }
  16721. function Es(_x40) {
  16722. return _Es.apply(this, arguments);
  16723. }
  16724. function _Es() {
  16725. _Es = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e) {
  16726. var _ce2, _e32, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  16727. return _regenerator.default.wrap(function _callee58$(_context58) {
  16728. while (1) {
  16729. switch (_context58.prev = _context58.next) {
  16730. case 0:
  16731. if (k) {
  16732. _context58.next = 2;
  16733. break;
  16734. }
  16735. return _context58.abrupt("return", Promise.resolve());
  16736. case 2:
  16737. if ("app" === A) {
  16738. _ce2 = ce(), _e32 = _ce2.osName, _t20 = _ce2.osVersion;
  16739. "ios" === _e32 && function (e) {
  16740. if (!e || "string" != typeof e) return 0;
  16741. var t = e.match(/^(\d+)./);
  16742. return t && t[1] ? parseInt(t[1]) : 0;
  16743. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  16744. }
  16745. t = e.__dev__;
  16746. if (t.debugInfo) {
  16747. _context58.next = 6;
  16748. break;
  16749. }
  16750. return _context58.abrupt("return");
  16751. case 6:
  16752. _t$debugInfo = t.debugInfo;
  16753. n = _t$debugInfo.address;
  16754. s = _t$debugInfo.servePort;
  16755. _context58.next = 11;
  16756. return function () {
  16757. var _ref61 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  16758. var n, _s15, _r8;
  16759. return _regenerator.default.wrap(function _callee57$(_context57) {
  16760. while (1) {
  16761. switch (_context57.prev = _context57.next) {
  16762. case 0:
  16763. _s15 = 0;
  16764. case 1:
  16765. if (!(_s15 < e.length)) {
  16766. _context57.next = 11;
  16767. break;
  16768. }
  16769. _r8 = e[_s15];
  16770. _context57.next = 5;
  16771. return Ps(_r8, t);
  16772. case 5:
  16773. if (!_context57.sent) {
  16774. _context57.next = 8;
  16775. break;
  16776. }
  16777. n = _r8;
  16778. return _context57.abrupt("break", 11);
  16779. case 8:
  16780. _s15++;
  16781. _context57.next = 1;
  16782. break;
  16783. case 11:
  16784. return _context57.abrupt("return", {
  16785. address: n,
  16786. port: t
  16787. });
  16788. case 12:
  16789. case "end":
  16790. return _context57.stop();
  16791. }
  16792. }
  16793. }, _callee57);
  16794. }));
  16795. return function (_x41, _x42) {
  16796. return _ref61.apply(this, arguments);
  16797. };
  16798. }()(n, s);
  16799. case 11:
  16800. _yield2 = _context58.sent;
  16801. r = _yield2.address;
  16802. if (!r) {
  16803. _context58.next = 15;
  16804. break;
  16805. }
  16806. return _context58.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  16807. case 15:
  16808. i = console["app" === A ? "error" : "warn"];
  16809. o = "";
  16810. 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" === A && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === A.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  16811. _context58.next = 19;
  16812. break;
  16813. }
  16814. throw new Error(o);
  16815. case 19:
  16816. i(o);
  16817. case 20:
  16818. case "end":
  16819. return _context58.stop();
  16820. }
  16821. }
  16822. }, _callee58);
  16823. }));
  16824. return _Es.apply(this, arguments);
  16825. }
  16826. function Os(e) {
  16827. e._initPromiseHub || (e._initPromiseHub = new b({
  16828. createPromise: function createPromise() {
  16829. var t = Promise.resolve();
  16830. var n;
  16831. n = 1, t = new Promise(function (e) {
  16832. setTimeout(function () {
  16833. e();
  16834. }, n);
  16835. });
  16836. var s = e.auth();
  16837. return t.then(function () {
  16838. return s.getLoginState();
  16839. }).then(function (e) {
  16840. return e ? Promise.resolve() : s.signInAnonymously();
  16841. });
  16842. }
  16843. }));
  16844. }
  16845. var xs = {
  16846. tcb: bt,
  16847. tencent: bt,
  16848. aliyun: ge,
  16849. private: kt
  16850. };
  16851. var Rs = new ( /*#__PURE__*/function () {
  16852. function _class6() {
  16853. (0, _classCallCheck2.default)(this, _class6);
  16854. }
  16855. (0, _createClass2.default)(_class6, [{
  16856. key: "init",
  16857. value: function init(e) {
  16858. var t = {};
  16859. var n = xs[e.provider];
  16860. if (!n) throw new Error("未提供正确的provider参数");
  16861. t = n.init(e), k && function (e) {
  16862. if (!k) return;
  16863. var t = {};
  16864. e.__dev__ = t, t.debugLog = k && ("web" === A && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === A);
  16865. var n = P;
  16866. n && !n.code && (t.debugInfo = n);
  16867. var s = new b({
  16868. createPromise: function createPromise() {
  16869. return Es(e);
  16870. }
  16871. });
  16872. t.initLocalNetwork = function () {
  16873. return s.exec();
  16874. };
  16875. }(t), Os(t), xn(t), function (e) {
  16876. var t = e.uploadFile;
  16877. e.uploadFile = function (e) {
  16878. return t.call(this, e);
  16879. };
  16880. }(t), function (e) {
  16881. e.database = function (t) {
  16882. if (t && Object.keys(t).length > 0) return e.init(t).database();
  16883. if (this._database) return this._database;
  16884. var n = Bn($n, {
  16885. uniClient: e
  16886. });
  16887. return this._database = n, n;
  16888. }, e.databaseForJQL = function (t) {
  16889. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  16890. if (this._databaseForJQL) return this._databaseForJQL;
  16891. var n = Bn($n, {
  16892. uniClient: e,
  16893. isJQL: !0
  16894. });
  16895. return this._databaseForJQL = n, n;
  16896. };
  16897. }(t), function (e) {
  16898. e.getCurrentUserInfo = _s, e.chooseAndUploadFile = vs.initChooseAndUploadFile(e), Object.assign(e, {
  16899. get mixinDatacom() {
  16900. return Ss(e);
  16901. }
  16902. }), e.importObject = ks(e), e.initSecureNetworkByWeixin = As(e);
  16903. }(t);
  16904. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  16905. if (!t[e]) return;
  16906. var n = t[e];
  16907. t[e] = function () {
  16908. return n.apply(t, Array.from(arguments));
  16909. }, t[e] = function (e, t) {
  16910. return function (n) {
  16911. var _this22 = this;
  16912. var s = !1;
  16913. if ("callFunction" === t) {
  16914. var _e28 = n && n.type || u;
  16915. s = _e28 !== u;
  16916. }
  16917. var r = "callFunction" === t && !s,
  16918. i = this._initPromiseHub.exec();
  16919. n = n || {};
  16920. var _te2 = te(n),
  16921. o = _te2.success,
  16922. a = _te2.fail,
  16923. c = _te2.complete,
  16924. l = i.then(function () {
  16925. return s ? Promise.resolve() : q(K(t, "invoke"), n);
  16926. }).then(function () {
  16927. return e.call(_this22, n);
  16928. }).then(function (e) {
  16929. return s ? Promise.resolve(e) : q(K(t, "success"), e).then(function () {
  16930. return q(K(t, "complete"), e);
  16931. }).then(function () {
  16932. return r && Q(B, {
  16933. type: J,
  16934. content: e
  16935. }), Promise.resolve(e);
  16936. });
  16937. }, function (e) {
  16938. return s ? Promise.reject(e) : q(K(t, "fail"), e).then(function () {
  16939. return q(K(t, "complete"), e);
  16940. }).then(function () {
  16941. return Q(B, {
  16942. type: J,
  16943. content: e
  16944. }), Promise.reject(e);
  16945. });
  16946. });
  16947. if (!(o || a || c)) return l;
  16948. l.then(function (e) {
  16949. o && o(e), c && c(e), r && Q(B, {
  16950. type: J,
  16951. content: e
  16952. });
  16953. }, function (e) {
  16954. a && a(e), c && c(e), r && Q(B, {
  16955. type: J,
  16956. content: e
  16957. });
  16958. });
  16959. };
  16960. }(t[e], e).bind(t);
  16961. }), t.init = this.init, t;
  16962. }
  16963. }]);
  16964. return _class6;
  16965. }())();
  16966. (function () {
  16967. var e = E;
  16968. var t = {};
  16969. if (e && 1 === e.length) t = e[0], Rs = Rs.init(t), Rs._isDefault = !0;else {
  16970. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  16971. var _n15;
  16972. _n15 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : O ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  16973. Rs[e] = function () {
  16974. return console.error(_n15), Promise.reject(new ne({
  16975. code: "SYS_ERR",
  16976. message: _n15
  16977. }));
  16978. };
  16979. });
  16980. }
  16981. Object.assign(Rs, {
  16982. get mixinDatacom() {
  16983. return Ss(Rs);
  16984. }
  16985. }), fs(Rs), Rs.addInterceptor = D, Rs.removeInterceptor = F, Rs.interceptObject = M, k && "web" === A && (window.uniCloud = Rs);
  16986. })();
  16987. var Us = Rs;
  16988. exports.default = Us;
  16989. /* 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"]))
  16990. /***/ }),
  16991. /* 107 */
  16992. /*!*********************************************************!*\
  16993. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  16994. \*********************************************************/
  16995. /*! no static exports found */
  16996. /***/ (function(module, exports, __webpack_require__) {
  16997. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  16998. function _inherits(subClass, superClass) {
  16999. if (typeof superClass !== "function" && superClass !== null) {
  17000. throw new TypeError("Super expression must either be null or a function");
  17001. }
  17002. subClass.prototype = Object.create(superClass && superClass.prototype, {
  17003. constructor: {
  17004. value: subClass,
  17005. writable: true,
  17006. configurable: true
  17007. }
  17008. });
  17009. Object.defineProperty(subClass, "prototype", {
  17010. writable: false
  17011. });
  17012. if (superClass) setPrototypeOf(subClass, superClass);
  17013. }
  17014. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17015. /***/ }),
  17016. /* 108 */
  17017. /*!**************************************************************************!*\
  17018. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  17019. \**************************************************************************/
  17020. /*! no static exports found */
  17021. /***/ (function(module, exports, __webpack_require__) {
  17022. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  17023. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 109);
  17024. function _possibleConstructorReturn(self, call) {
  17025. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  17026. return call;
  17027. } else if (call !== void 0) {
  17028. throw new TypeError("Derived constructors may only return object or undefined");
  17029. }
  17030. return assertThisInitialized(self);
  17031. }
  17032. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17033. /***/ }),
  17034. /* 109 */
  17035. /*!**********************************************************************!*\
  17036. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  17037. \**********************************************************************/
  17038. /*! no static exports found */
  17039. /***/ (function(module, exports) {
  17040. function _assertThisInitialized(self) {
  17041. if (self === void 0) {
  17042. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  17043. }
  17044. return self;
  17045. }
  17046. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17047. /***/ }),
  17048. /* 110 */
  17049. /*!***************************************************************!*\
  17050. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  17051. \***************************************************************/
  17052. /*! no static exports found */
  17053. /***/ (function(module, exports) {
  17054. function _getPrototypeOf(o) {
  17055. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  17056. return o.__proto__ || Object.getPrototypeOf(o);
  17057. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17058. return _getPrototypeOf(o);
  17059. }
  17060. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17061. /***/ }),
  17062. /* 111 */
  17063. /*!****************************************************************!*\
  17064. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  17065. \****************************************************************/
  17066. /*! no static exports found */
  17067. /***/ (function(module, exports, __webpack_require__) {
  17068. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 110);
  17069. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  17070. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 112);
  17071. var construct = __webpack_require__(/*! ./construct.js */ 15);
  17072. function _wrapNativeSuper(Class) {
  17073. var _cache = typeof Map === "function" ? new Map() : undefined;
  17074. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  17075. if (Class === null || !isNativeFunction(Class)) return Class;
  17076. if (typeof Class !== "function") {
  17077. throw new TypeError("Super expression must either be null or a function");
  17078. }
  17079. if (typeof _cache !== "undefined") {
  17080. if (_cache.has(Class)) return _cache.get(Class);
  17081. _cache.set(Class, Wrapper);
  17082. }
  17083. function Wrapper() {
  17084. return construct(Class, arguments, getPrototypeOf(this).constructor);
  17085. }
  17086. Wrapper.prototype = Object.create(Class.prototype, {
  17087. constructor: {
  17088. value: Wrapper,
  17089. enumerable: false,
  17090. writable: true,
  17091. configurable: true
  17092. }
  17093. });
  17094. return setPrototypeOf(Wrapper, Class);
  17095. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17096. return _wrapNativeSuper(Class);
  17097. }
  17098. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17099. /***/ }),
  17100. /* 112 */
  17101. /*!*****************************************************************!*\
  17102. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  17103. \*****************************************************************/
  17104. /*! no static exports found */
  17105. /***/ (function(module, exports) {
  17106. function _isNativeFunction(fn) {
  17107. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  17108. }
  17109. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  17110. /***/ }),
  17111. /* 113 */
  17112. /*!************************************************************************************!*\
  17113. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"origin-pages-json"} ***!
  17114. \************************************************************************************/
  17115. /*! no static exports found */
  17116. /***/ (function(module, exports, __webpack_require__) {
  17117. "use strict";
  17118. Object.defineProperty(exports, "__esModule", {
  17119. value: true
  17120. });
  17121. exports.default = void 0;
  17122. var _default = {
  17123. "pages": [{
  17124. "path": "pages/login/index",
  17125. "style": {
  17126. "navigationBarTitleText": "地块管护",
  17127. "navigationStyle": "custom"
  17128. }
  17129. }, {
  17130. "path": "pages/main/index",
  17131. "style": {
  17132. "navigationBarTitleText": "地块管护",
  17133. "navigationStyle": "custom"
  17134. }
  17135. }, {
  17136. "path": "pages/receivedDetail/index",
  17137. "style": {
  17138. "navigationBarTitleText": "地块管护",
  17139. "navigationStyle": "custom"
  17140. }
  17141. }, {
  17142. "path": "pages/nocheckDetail/index",
  17143. "style": {
  17144. "navigationBarTitleText": "地块管护",
  17145. "navigationStyle": "custom"
  17146. }
  17147. }],
  17148. "globalStyle": {
  17149. "navigationBarTextStyle": "black",
  17150. "navigationBarTitleText": "uni-app",
  17151. "navigationBarBackgroundColor": "#F8F8F8",
  17152. "backgroundColor": "#F8F8F8"
  17153. },
  17154. "uniIdRouter": {},
  17155. "condition": {
  17156. "current": 0,
  17157. "list": [{
  17158. "name": "",
  17159. "path": "",
  17160. "query": ""
  17161. }]
  17162. }
  17163. };
  17164. exports.default = _default;
  17165. /***/ }),
  17166. /* 114 */
  17167. /*!***********************************************************************!*\
  17168. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/pages.json?{"type":"stat"} ***!
  17169. \***********************************************************************/
  17170. /*! no static exports found */
  17171. /***/ (function(module, exports, __webpack_require__) {
  17172. "use strict";
  17173. Object.defineProperty(exports, "__esModule", {
  17174. value: true
  17175. });
  17176. exports.default = void 0;
  17177. var _default = {
  17178. "appid": "__UNI__50B3EE1"
  17179. };
  17180. exports.default = _default;
  17181. /***/ }),
  17182. /* 115 */
  17183. /*!*****************************************************************************************************************************!*\
  17184. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  17185. \*****************************************************************************************************************************/
  17186. /*! no static exports found */
  17187. /***/ (function(module, exports, __webpack_require__) {
  17188. "use strict";
  17189. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  17190. Object.defineProperty(exports, "__esModule", {
  17191. value: true
  17192. });
  17193. exports.chooseAndUploadFile = chooseAndUploadFile;
  17194. exports.uploadCloudFiles = uploadCloudFiles;
  17195. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  17196. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  17197. function chooseImage(opts) {
  17198. var count = opts.count,
  17199. _opts$sizeType = opts.sizeType,
  17200. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  17201. sourceType = opts.sourceType,
  17202. extension = opts.extension;
  17203. return new Promise(function (resolve, reject) {
  17204. uni.chooseImage({
  17205. count: count,
  17206. sizeType: sizeType,
  17207. sourceType: sourceType,
  17208. extension: extension,
  17209. success: function success(res) {
  17210. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  17211. },
  17212. fail: function fail(res) {
  17213. reject({
  17214. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  17215. });
  17216. }
  17217. });
  17218. });
  17219. }
  17220. function chooseVideo(opts) {
  17221. var camera = opts.camera,
  17222. compressed = opts.compressed,
  17223. maxDuration = opts.maxDuration,
  17224. sourceType = opts.sourceType,
  17225. extension = opts.extension;
  17226. return new Promise(function (resolve, reject) {
  17227. uni.chooseVideo({
  17228. camera: camera,
  17229. compressed: compressed,
  17230. maxDuration: maxDuration,
  17231. sourceType: sourceType,
  17232. extension: extension,
  17233. success: function success(res) {
  17234. var tempFilePath = res.tempFilePath,
  17235. duration = res.duration,
  17236. size = res.size,
  17237. height = res.height,
  17238. width = res.width;
  17239. resolve(normalizeChooseAndUploadFileRes({
  17240. errMsg: 'chooseVideo:ok',
  17241. tempFilePaths: [tempFilePath],
  17242. tempFiles: [{
  17243. name: res.tempFile && res.tempFile.name || '',
  17244. path: tempFilePath,
  17245. size: size,
  17246. type: res.tempFile && res.tempFile.type || '',
  17247. width: width,
  17248. height: height,
  17249. duration: duration,
  17250. fileType: 'video',
  17251. cloudPath: ''
  17252. }]
  17253. }, 'video'));
  17254. },
  17255. fail: function fail(res) {
  17256. reject({
  17257. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  17258. });
  17259. }
  17260. });
  17261. });
  17262. }
  17263. function chooseAll(opts) {
  17264. var count = opts.count,
  17265. extension = opts.extension;
  17266. return new Promise(function (resolve, reject) {
  17267. var chooseFile = uni.chooseFile;
  17268. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  17269. chooseFile = wx.chooseMessageFile;
  17270. }
  17271. if (typeof chooseFile !== 'function') {
  17272. return reject({
  17273. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  17274. });
  17275. }
  17276. chooseFile({
  17277. type: 'all',
  17278. count: count,
  17279. extension: extension,
  17280. success: function success(res) {
  17281. resolve(normalizeChooseAndUploadFileRes(res));
  17282. },
  17283. fail: function fail(res) {
  17284. reject({
  17285. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  17286. });
  17287. }
  17288. });
  17289. });
  17290. }
  17291. function normalizeChooseAndUploadFileRes(res, fileType) {
  17292. res.tempFiles.forEach(function (item, index) {
  17293. if (!item.name) {
  17294. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  17295. }
  17296. if (fileType) {
  17297. item.fileType = fileType;
  17298. }
  17299. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  17300. });
  17301. if (!res.tempFilePaths) {
  17302. res.tempFilePaths = res.tempFiles.map(function (file) {
  17303. return file.path;
  17304. });
  17305. }
  17306. return res;
  17307. }
  17308. function uploadCloudFiles(files) {
  17309. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  17310. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  17311. files = JSON.parse(JSON.stringify(files));
  17312. var len = files.length;
  17313. var count = 0;
  17314. var self = this;
  17315. return new Promise(function (resolve) {
  17316. while (count < max) {
  17317. next();
  17318. }
  17319. function next() {
  17320. var cur = count++;
  17321. if (cur >= len) {
  17322. !files.find(function (item) {
  17323. return !item.url && !item.errMsg;
  17324. }) && resolve(files);
  17325. return;
  17326. }
  17327. var fileItem = files[cur];
  17328. var index = self.files.findIndex(function (v) {
  17329. return v.uuid === fileItem.uuid;
  17330. });
  17331. fileItem.url = '';
  17332. delete fileItem.errMsg;
  17333. uniCloud.uploadFile({
  17334. filePath: fileItem.path,
  17335. cloudPath: fileItem.cloudPath,
  17336. fileType: fileItem.fileType,
  17337. onUploadProgress: function onUploadProgress(res) {
  17338. res.index = index;
  17339. _onUploadProgress && _onUploadProgress(res);
  17340. }
  17341. }).then(function (res) {
  17342. fileItem.url = res.fileID;
  17343. fileItem.index = index;
  17344. if (cur < len) {
  17345. next();
  17346. }
  17347. }).catch(function (res) {
  17348. fileItem.errMsg = res.errMsg || res.message;
  17349. fileItem.index = index;
  17350. if (cur < len) {
  17351. next();
  17352. }
  17353. });
  17354. }
  17355. });
  17356. }
  17357. function uploadFiles(choosePromise, _ref) {
  17358. var onChooseFile = _ref.onChooseFile,
  17359. onUploadProgress = _ref.onUploadProgress;
  17360. return choosePromise.then(function (res) {
  17361. if (onChooseFile) {
  17362. var customChooseRes = onChooseFile(res);
  17363. if (typeof customChooseRes !== 'undefined') {
  17364. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  17365. return typeof chooseRes === 'undefined' ? res : chooseRes;
  17366. });
  17367. }
  17368. }
  17369. return res;
  17370. }).then(function (res) {
  17371. if (res === false) {
  17372. return {
  17373. errMsg: ERR_MSG_OK,
  17374. tempFilePaths: [],
  17375. tempFiles: []
  17376. };
  17377. }
  17378. return res;
  17379. });
  17380. }
  17381. function chooseAndUploadFile() {
  17382. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  17383. type: 'all'
  17384. };
  17385. if (opts.type === 'image') {
  17386. return uploadFiles(chooseImage(opts), opts);
  17387. } else if (opts.type === 'video') {
  17388. return uploadFiles(chooseVideo(opts), opts);
  17389. }
  17390. return uploadFiles(chooseAll(opts), opts);
  17391. }
  17392. /* 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 */ 106)["default"]))
  17393. /***/ }),
  17394. /* 116 */
  17395. /*!************************************************************************************************************!*\
  17396. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  17397. \************************************************************************************************************/
  17398. /*! no static exports found */
  17399. /***/ (function(module, exports, __webpack_require__) {
  17400. "use strict";
  17401. /* WEBPACK VAR INJECTION */(function(uni) {
  17402. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17403. Object.defineProperty(exports, "__esModule", {
  17404. value: true
  17405. });
  17406. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  17407. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 68));
  17408. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 70));
  17409. /**
  17410. * 获取文件名和后缀
  17411. * @param {String} name
  17412. */
  17413. var get_file_ext = function get_file_ext(name) {
  17414. var last_len = name.lastIndexOf('.');
  17415. var len = name.length;
  17416. return {
  17417. name: name.substring(0, last_len),
  17418. ext: name.substring(last_len + 1, len)
  17419. };
  17420. };
  17421. /**
  17422. * 获取扩展名
  17423. * @param {Array} fileExtname
  17424. */
  17425. exports.get_file_ext = get_file_ext;
  17426. var get_extname = function get_extname(fileExtname) {
  17427. if (!Array.isArray(fileExtname)) {
  17428. var extname = fileExtname.replace(/(\[|\])/g, '');
  17429. return extname.split(',');
  17430. } else {
  17431. return fileExtname;
  17432. }
  17433. return [];
  17434. };
  17435. /**
  17436. * 获取文件和检测是否可选
  17437. */
  17438. exports.get_extname = get_extname;
  17439. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  17440. var filePaths = [];
  17441. var files = [];
  17442. if (!_extname || _extname.length === 0) {
  17443. return {
  17444. filePaths: filePaths,
  17445. files: files
  17446. };
  17447. }
  17448. res.tempFiles.forEach(function (v) {
  17449. var fileFullName = get_file_ext(v.name);
  17450. var extname = fileFullName.ext.toLowerCase();
  17451. if (_extname.indexOf(extname) !== -1) {
  17452. files.push(v);
  17453. filePaths.push(v.path);
  17454. }
  17455. });
  17456. if (files.length !== res.tempFiles.length) {
  17457. uni.showToast({
  17458. 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"),
  17459. icon: 'none',
  17460. duration: 5000
  17461. });
  17462. }
  17463. return {
  17464. filePaths: filePaths,
  17465. files: files
  17466. };
  17467. };
  17468. /**
  17469. * 获取图片信息
  17470. * @param {Object} filepath
  17471. */
  17472. exports.get_files_and_is_max = get_files_and_is_max;
  17473. var get_file_info = function get_file_info(filepath) {
  17474. return new Promise(function (resolve, reject) {
  17475. uni.getImageInfo({
  17476. src: filepath,
  17477. success: function success(res) {
  17478. resolve(res);
  17479. },
  17480. fail: function fail(err) {
  17481. reject(err);
  17482. }
  17483. });
  17484. });
  17485. };
  17486. /**
  17487. * 获取封装数据
  17488. */
  17489. exports.get_file_info = get_file_info;
  17490. var get_file_data = /*#__PURE__*/function () {
  17491. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  17492. var type,
  17493. fileFullName,
  17494. extname,
  17495. filedata,
  17496. imageinfo,
  17497. _args = arguments;
  17498. return _regenerator.default.wrap(function _callee$(_context) {
  17499. while (1) {
  17500. switch (_context.prev = _context.next) {
  17501. case 0:
  17502. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  17503. // 最终需要上传数据库的数据
  17504. fileFullName = get_file_ext(files.name);
  17505. extname = fileFullName.ext.toLowerCase();
  17506. filedata = {
  17507. name: files.name,
  17508. uuid: files.uuid,
  17509. extname: extname || '',
  17510. cloudPath: files.cloudPath,
  17511. fileType: files.fileType,
  17512. url: files.path || files.path,
  17513. size: files.size,
  17514. //单位是字节
  17515. image: {},
  17516. path: files.path,
  17517. video: {}
  17518. };
  17519. if (!(type === 'image')) {
  17520. _context.next = 14;
  17521. break;
  17522. }
  17523. _context.next = 7;
  17524. return get_file_info(files.path);
  17525. case 7:
  17526. imageinfo = _context.sent;
  17527. delete filedata.video;
  17528. filedata.image.width = imageinfo.width;
  17529. filedata.image.height = imageinfo.height;
  17530. filedata.image.location = imageinfo.path;
  17531. _context.next = 15;
  17532. break;
  17533. case 14:
  17534. delete filedata.image;
  17535. case 15:
  17536. return _context.abrupt("return", filedata);
  17537. case 16:
  17538. case "end":
  17539. return _context.stop();
  17540. }
  17541. }
  17542. }, _callee);
  17543. }));
  17544. return function get_file_data(_x) {
  17545. return _ref.apply(this, arguments);
  17546. };
  17547. }();
  17548. exports.get_file_data = get_file_data;
  17549. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  17550. /***/ }),
  17551. /* 117 */,
  17552. /* 118 */,
  17553. /* 119 */,
  17554. /* 120 */,
  17555. /* 121 */,
  17556. /* 122 */,
  17557. /* 123 */,
  17558. /* 124 */,
  17559. /* 125 */,
  17560. /* 126 */,
  17561. /* 127 */,
  17562. /* 128 */,
  17563. /* 129 */,
  17564. /* 130 */,
  17565. /* 131 */,
  17566. /* 132 */,
  17567. /* 133 */,
  17568. /* 134 */,
  17569. /* 135 */,
  17570. /* 136 */
  17571. /*!************************************************************************************************!*\
  17572. !*** E:/WorkProject/BJYSYBZ/YSGZYBZ_WXAPP/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  17573. \************************************************************************************************/
  17574. /*! no static exports found */
  17575. /***/ (function(module, exports, __webpack_require__) {
  17576. "use strict";
  17577. Object.defineProperty(exports, "__esModule", {
  17578. value: true
  17579. });
  17580. exports.default = void 0;
  17581. var _default = {
  17582. "id": "2852637",
  17583. "name": "uniui图标库",
  17584. "font_family": "uniicons",
  17585. "css_prefix_text": "uniui-",
  17586. "description": "",
  17587. "glyphs": [{
  17588. "icon_id": "25027049",
  17589. "name": "yanse",
  17590. "font_class": "color",
  17591. "unicode": "e6cf",
  17592. "unicode_decimal": 59087
  17593. }, {
  17594. "icon_id": "25027048",
  17595. "name": "wallet",
  17596. "font_class": "wallet",
  17597. "unicode": "e6b1",
  17598. "unicode_decimal": 59057
  17599. }, {
  17600. "icon_id": "25015720",
  17601. "name": "settings-filled",
  17602. "font_class": "settings-filled",
  17603. "unicode": "e6ce",
  17604. "unicode_decimal": 59086
  17605. }, {
  17606. "icon_id": "25015434",
  17607. "name": "shimingrenzheng-filled",
  17608. "font_class": "auth-filled",
  17609. "unicode": "e6cc",
  17610. "unicode_decimal": 59084
  17611. }, {
  17612. "icon_id": "24934246",
  17613. "name": "shop-filled",
  17614. "font_class": "shop-filled",
  17615. "unicode": "e6cd",
  17616. "unicode_decimal": 59085
  17617. }, {
  17618. "icon_id": "24934159",
  17619. "name": "staff-filled-01",
  17620. "font_class": "staff-filled",
  17621. "unicode": "e6cb",
  17622. "unicode_decimal": 59083
  17623. }, {
  17624. "icon_id": "24932461",
  17625. "name": "VIP-filled",
  17626. "font_class": "vip-filled",
  17627. "unicode": "e6c6",
  17628. "unicode_decimal": 59078
  17629. }, {
  17630. "icon_id": "24932462",
  17631. "name": "plus_circle_fill",
  17632. "font_class": "plus-filled",
  17633. "unicode": "e6c7",
  17634. "unicode_decimal": 59079
  17635. }, {
  17636. "icon_id": "24932463",
  17637. "name": "folder_add-filled",
  17638. "font_class": "folder-add-filled",
  17639. "unicode": "e6c8",
  17640. "unicode_decimal": 59080
  17641. }, {
  17642. "icon_id": "24932464",
  17643. "name": "yanse-filled",
  17644. "font_class": "color-filled",
  17645. "unicode": "e6c9",
  17646. "unicode_decimal": 59081
  17647. }, {
  17648. "icon_id": "24932465",
  17649. "name": "tune-filled",
  17650. "font_class": "tune-filled",
  17651. "unicode": "e6ca",
  17652. "unicode_decimal": 59082
  17653. }, {
  17654. "icon_id": "24932455",
  17655. "name": "a-rilidaka-filled",
  17656. "font_class": "calendar-filled",
  17657. "unicode": "e6c0",
  17658. "unicode_decimal": 59072
  17659. }, {
  17660. "icon_id": "24932456",
  17661. "name": "notification-filled",
  17662. "font_class": "notification-filled",
  17663. "unicode": "e6c1",
  17664. "unicode_decimal": 59073
  17665. }, {
  17666. "icon_id": "24932457",
  17667. "name": "wallet-filled",
  17668. "font_class": "wallet-filled",
  17669. "unicode": "e6c2",
  17670. "unicode_decimal": 59074
  17671. }, {
  17672. "icon_id": "24932458",
  17673. "name": "paihangbang-filled",
  17674. "font_class": "medal-filled",
  17675. "unicode": "e6c3",
  17676. "unicode_decimal": 59075
  17677. }, {
  17678. "icon_id": "24932459",
  17679. "name": "gift-filled",
  17680. "font_class": "gift-filled",
  17681. "unicode": "e6c4",
  17682. "unicode_decimal": 59076
  17683. }, {
  17684. "icon_id": "24932460",
  17685. "name": "fire-filled",
  17686. "font_class": "fire-filled",
  17687. "unicode": "e6c5",
  17688. "unicode_decimal": 59077
  17689. }, {
  17690. "icon_id": "24928001",
  17691. "name": "refreshempty",
  17692. "font_class": "refreshempty",
  17693. "unicode": "e6bf",
  17694. "unicode_decimal": 59071
  17695. }, {
  17696. "icon_id": "24926853",
  17697. "name": "location-ellipse",
  17698. "font_class": "location-filled",
  17699. "unicode": "e6af",
  17700. "unicode_decimal": 59055
  17701. }, {
  17702. "icon_id": "24926735",
  17703. "name": "person-filled",
  17704. "font_class": "person-filled",
  17705. "unicode": "e69d",
  17706. "unicode_decimal": 59037
  17707. }, {
  17708. "icon_id": "24926703",
  17709. "name": "personadd-filled",
  17710. "font_class": "personadd-filled",
  17711. "unicode": "e698",
  17712. "unicode_decimal": 59032
  17713. }, {
  17714. "icon_id": "24923351",
  17715. "name": "back",
  17716. "font_class": "back",
  17717. "unicode": "e6b9",
  17718. "unicode_decimal": 59065
  17719. }, {
  17720. "icon_id": "24923352",
  17721. "name": "forward",
  17722. "font_class": "forward",
  17723. "unicode": "e6ba",
  17724. "unicode_decimal": 59066
  17725. }, {
  17726. "icon_id": "24923353",
  17727. "name": "arrowthinright",
  17728. "font_class": "arrow-right",
  17729. "unicode": "e6bb",
  17730. "unicode_decimal": 59067
  17731. }, {
  17732. "icon_id": "24923353",
  17733. "name": "arrowthinright",
  17734. "font_class": "arrowthinright",
  17735. "unicode": "e6bb",
  17736. "unicode_decimal": 59067
  17737. }, {
  17738. "icon_id": "24923354",
  17739. "name": "arrowthinleft",
  17740. "font_class": "arrow-left",
  17741. "unicode": "e6bc",
  17742. "unicode_decimal": 59068
  17743. }, {
  17744. "icon_id": "24923354",
  17745. "name": "arrowthinleft",
  17746. "font_class": "arrowthinleft",
  17747. "unicode": "e6bc",
  17748. "unicode_decimal": 59068
  17749. }, {
  17750. "icon_id": "24923355",
  17751. "name": "arrowthinup",
  17752. "font_class": "arrow-up",
  17753. "unicode": "e6bd",
  17754. "unicode_decimal": 59069
  17755. }, {
  17756. "icon_id": "24923355",
  17757. "name": "arrowthinup",
  17758. "font_class": "arrowthinup",
  17759. "unicode": "e6bd",
  17760. "unicode_decimal": 59069
  17761. }, {
  17762. "icon_id": "24923356",
  17763. "name": "arrowthindown",
  17764. "font_class": "arrow-down",
  17765. "unicode": "e6be",
  17766. "unicode_decimal": 59070
  17767. }, {
  17768. "icon_id": "24923356",
  17769. "name": "arrowthindown",
  17770. "font_class": "arrowthindown",
  17771. "unicode": "e6be",
  17772. "unicode_decimal": 59070
  17773. }, {
  17774. "icon_id": "24923349",
  17775. "name": "arrowdown",
  17776. "font_class": "bottom",
  17777. "unicode": "e6b8",
  17778. "unicode_decimal": 59064
  17779. }, {
  17780. "icon_id": "24923349",
  17781. "name": "arrowdown",
  17782. "font_class": "arrowdown",
  17783. "unicode": "e6b8",
  17784. "unicode_decimal": 59064
  17785. }, {
  17786. "icon_id": "24923346",
  17787. "name": "arrowright",
  17788. "font_class": "right",
  17789. "unicode": "e6b5",
  17790. "unicode_decimal": 59061
  17791. }, {
  17792. "icon_id": "24923346",
  17793. "name": "arrowright",
  17794. "font_class": "arrowright",
  17795. "unicode": "e6b5",
  17796. "unicode_decimal": 59061
  17797. }, {
  17798. "icon_id": "24923347",
  17799. "name": "arrowup",
  17800. "font_class": "top",
  17801. "unicode": "e6b6",
  17802. "unicode_decimal": 59062
  17803. }, {
  17804. "icon_id": "24923347",
  17805. "name": "arrowup",
  17806. "font_class": "arrowup",
  17807. "unicode": "e6b6",
  17808. "unicode_decimal": 59062
  17809. }, {
  17810. "icon_id": "24923348",
  17811. "name": "arrowleft",
  17812. "font_class": "left",
  17813. "unicode": "e6b7",
  17814. "unicode_decimal": 59063
  17815. }, {
  17816. "icon_id": "24923348",
  17817. "name": "arrowleft",
  17818. "font_class": "arrowleft",
  17819. "unicode": "e6b7",
  17820. "unicode_decimal": 59063
  17821. }, {
  17822. "icon_id": "24923334",
  17823. "name": "eye",
  17824. "font_class": "eye",
  17825. "unicode": "e651",
  17826. "unicode_decimal": 58961
  17827. }, {
  17828. "icon_id": "24923335",
  17829. "name": "eye-filled",
  17830. "font_class": "eye-filled",
  17831. "unicode": "e66a",
  17832. "unicode_decimal": 58986
  17833. }, {
  17834. "icon_id": "24923336",
  17835. "name": "eye-slash",
  17836. "font_class": "eye-slash",
  17837. "unicode": "e6b3",
  17838. "unicode_decimal": 59059
  17839. }, {
  17840. "icon_id": "24923337",
  17841. "name": "eye-slash-filled",
  17842. "font_class": "eye-slash-filled",
  17843. "unicode": "e6b4",
  17844. "unicode_decimal": 59060
  17845. }, {
  17846. "icon_id": "24923305",
  17847. "name": "info-filled",
  17848. "font_class": "info-filled",
  17849. "unicode": "e649",
  17850. "unicode_decimal": 58953
  17851. }, {
  17852. "icon_id": "24923299",
  17853. "name": "reload-01",
  17854. "font_class": "reload",
  17855. "unicode": "e6b2",
  17856. "unicode_decimal": 59058
  17857. }, {
  17858. "icon_id": "24923195",
  17859. "name": "mic_slash_fill",
  17860. "font_class": "micoff-filled",
  17861. "unicode": "e6b0",
  17862. "unicode_decimal": 59056
  17863. }, {
  17864. "icon_id": "24923165",
  17865. "name": "map-pin-ellipse",
  17866. "font_class": "map-pin-ellipse",
  17867. "unicode": "e6ac",
  17868. "unicode_decimal": 59052
  17869. }, {
  17870. "icon_id": "24923166",
  17871. "name": "map-pin",
  17872. "font_class": "map-pin",
  17873. "unicode": "e6ad",
  17874. "unicode_decimal": 59053
  17875. }, {
  17876. "icon_id": "24923167",
  17877. "name": "location",
  17878. "font_class": "location",
  17879. "unicode": "e6ae",
  17880. "unicode_decimal": 59054
  17881. }, {
  17882. "icon_id": "24923064",
  17883. "name": "starhalf",
  17884. "font_class": "starhalf",
  17885. "unicode": "e683",
  17886. "unicode_decimal": 59011
  17887. }, {
  17888. "icon_id": "24923065",
  17889. "name": "star",
  17890. "font_class": "star",
  17891. "unicode": "e688",
  17892. "unicode_decimal": 59016
  17893. }, {
  17894. "icon_id": "24923066",
  17895. "name": "star-filled",
  17896. "font_class": "star-filled",
  17897. "unicode": "e68f",
  17898. "unicode_decimal": 59023
  17899. }, {
  17900. "icon_id": "24899646",
  17901. "name": "a-rilidaka",
  17902. "font_class": "calendar",
  17903. "unicode": "e6a0",
  17904. "unicode_decimal": 59040
  17905. }, {
  17906. "icon_id": "24899647",
  17907. "name": "fire",
  17908. "font_class": "fire",
  17909. "unicode": "e6a1",
  17910. "unicode_decimal": 59041
  17911. }, {
  17912. "icon_id": "24899648",
  17913. "name": "paihangbang",
  17914. "font_class": "medal",
  17915. "unicode": "e6a2",
  17916. "unicode_decimal": 59042
  17917. }, {
  17918. "icon_id": "24899649",
  17919. "name": "font",
  17920. "font_class": "font",
  17921. "unicode": "e6a3",
  17922. "unicode_decimal": 59043
  17923. }, {
  17924. "icon_id": "24899650",
  17925. "name": "gift",
  17926. "font_class": "gift",
  17927. "unicode": "e6a4",
  17928. "unicode_decimal": 59044
  17929. }, {
  17930. "icon_id": "24899651",
  17931. "name": "link",
  17932. "font_class": "link",
  17933. "unicode": "e6a5",
  17934. "unicode_decimal": 59045
  17935. }, {
  17936. "icon_id": "24899652",
  17937. "name": "notification",
  17938. "font_class": "notification",
  17939. "unicode": "e6a6",
  17940. "unicode_decimal": 59046
  17941. }, {
  17942. "icon_id": "24899653",
  17943. "name": "staff",
  17944. "font_class": "staff",
  17945. "unicode": "e6a7",
  17946. "unicode_decimal": 59047
  17947. }, {
  17948. "icon_id": "24899654",
  17949. "name": "VIP",
  17950. "font_class": "vip",
  17951. "unicode": "e6a8",
  17952. "unicode_decimal": 59048
  17953. }, {
  17954. "icon_id": "24899655",
  17955. "name": "folder_add",
  17956. "font_class": "folder-add",
  17957. "unicode": "e6a9",
  17958. "unicode_decimal": 59049
  17959. }, {
  17960. "icon_id": "24899656",
  17961. "name": "tune",
  17962. "font_class": "tune",
  17963. "unicode": "e6aa",
  17964. "unicode_decimal": 59050
  17965. }, {
  17966. "icon_id": "24899657",
  17967. "name": "shimingrenzheng",
  17968. "font_class": "auth",
  17969. "unicode": "e6ab",
  17970. "unicode_decimal": 59051
  17971. }, {
  17972. "icon_id": "24899565",
  17973. "name": "person",
  17974. "font_class": "person",
  17975. "unicode": "e699",
  17976. "unicode_decimal": 59033
  17977. }, {
  17978. "icon_id": "24899566",
  17979. "name": "email-filled",
  17980. "font_class": "email-filled",
  17981. "unicode": "e69a",
  17982. "unicode_decimal": 59034
  17983. }, {
  17984. "icon_id": "24899567",
  17985. "name": "phone-filled",
  17986. "font_class": "phone-filled",
  17987. "unicode": "e69b",
  17988. "unicode_decimal": 59035
  17989. }, {
  17990. "icon_id": "24899568",
  17991. "name": "phone",
  17992. "font_class": "phone",
  17993. "unicode": "e69c",
  17994. "unicode_decimal": 59036
  17995. }, {
  17996. "icon_id": "24899570",
  17997. "name": "email",
  17998. "font_class": "email",
  17999. "unicode": "e69e",
  18000. "unicode_decimal": 59038
  18001. }, {
  18002. "icon_id": "24899571",
  18003. "name": "personadd",
  18004. "font_class": "personadd",
  18005. "unicode": "e69f",
  18006. "unicode_decimal": 59039
  18007. }, {
  18008. "icon_id": "24899558",
  18009. "name": "chatboxes-filled",
  18010. "font_class": "chatboxes-filled",
  18011. "unicode": "e692",
  18012. "unicode_decimal": 59026
  18013. }, {
  18014. "icon_id": "24899559",
  18015. "name": "contact",
  18016. "font_class": "contact",
  18017. "unicode": "e693",
  18018. "unicode_decimal": 59027
  18019. }, {
  18020. "icon_id": "24899560",
  18021. "name": "chatbubble-filled",
  18022. "font_class": "chatbubble-filled",
  18023. "unicode": "e694",
  18024. "unicode_decimal": 59028
  18025. }, {
  18026. "icon_id": "24899561",
  18027. "name": "contact-filled",
  18028. "font_class": "contact-filled",
  18029. "unicode": "e695",
  18030. "unicode_decimal": 59029
  18031. }, {
  18032. "icon_id": "24899562",
  18033. "name": "chatboxes",
  18034. "font_class": "chatboxes",
  18035. "unicode": "e696",
  18036. "unicode_decimal": 59030
  18037. }, {
  18038. "icon_id": "24899563",
  18039. "name": "chatbubble",
  18040. "font_class": "chatbubble",
  18041. "unicode": "e697",
  18042. "unicode_decimal": 59031
  18043. }, {
  18044. "icon_id": "24881290",
  18045. "name": "upload-filled",
  18046. "font_class": "upload-filled",
  18047. "unicode": "e68e",
  18048. "unicode_decimal": 59022
  18049. }, {
  18050. "icon_id": "24881292",
  18051. "name": "upload",
  18052. "font_class": "upload",
  18053. "unicode": "e690",
  18054. "unicode_decimal": 59024
  18055. }, {
  18056. "icon_id": "24881293",
  18057. "name": "weixin",
  18058. "font_class": "weixin",
  18059. "unicode": "e691",
  18060. "unicode_decimal": 59025
  18061. }, {
  18062. "icon_id": "24881274",
  18063. "name": "compose",
  18064. "font_class": "compose",
  18065. "unicode": "e67f",
  18066. "unicode_decimal": 59007
  18067. }, {
  18068. "icon_id": "24881275",
  18069. "name": "qq",
  18070. "font_class": "qq",
  18071. "unicode": "e680",
  18072. "unicode_decimal": 59008
  18073. }, {
  18074. "icon_id": "24881276",
  18075. "name": "download-filled",
  18076. "font_class": "download-filled",
  18077. "unicode": "e681",
  18078. "unicode_decimal": 59009
  18079. }, {
  18080. "icon_id": "24881277",
  18081. "name": "pengyouquan",
  18082. "font_class": "pyq",
  18083. "unicode": "e682",
  18084. "unicode_decimal": 59010
  18085. }, {
  18086. "icon_id": "24881279",
  18087. "name": "sound",
  18088. "font_class": "sound",
  18089. "unicode": "e684",
  18090. "unicode_decimal": 59012
  18091. }, {
  18092. "icon_id": "24881280",
  18093. "name": "trash-filled",
  18094. "font_class": "trash-filled",
  18095. "unicode": "e685",
  18096. "unicode_decimal": 59013
  18097. }, {
  18098. "icon_id": "24881281",
  18099. "name": "sound-filled",
  18100. "font_class": "sound-filled",
  18101. "unicode": "e686",
  18102. "unicode_decimal": 59014
  18103. }, {
  18104. "icon_id": "24881282",
  18105. "name": "trash",
  18106. "font_class": "trash",
  18107. "unicode": "e687",
  18108. "unicode_decimal": 59015
  18109. }, {
  18110. "icon_id": "24881284",
  18111. "name": "videocam-filled",
  18112. "font_class": "videocam-filled",
  18113. "unicode": "e689",
  18114. "unicode_decimal": 59017
  18115. }, {
  18116. "icon_id": "24881285",
  18117. "name": "spinner-cycle",
  18118. "font_class": "spinner-cycle",
  18119. "unicode": "e68a",
  18120. "unicode_decimal": 59018
  18121. }, {
  18122. "icon_id": "24881286",
  18123. "name": "weibo",
  18124. "font_class": "weibo",
  18125. "unicode": "e68b",
  18126. "unicode_decimal": 59019
  18127. }, {
  18128. "icon_id": "24881288",
  18129. "name": "videocam",
  18130. "font_class": "videocam",
  18131. "unicode": "e68c",
  18132. "unicode_decimal": 59020
  18133. }, {
  18134. "icon_id": "24881289",
  18135. "name": "download",
  18136. "font_class": "download",
  18137. "unicode": "e68d",
  18138. "unicode_decimal": 59021
  18139. }, {
  18140. "icon_id": "24879601",
  18141. "name": "help",
  18142. "font_class": "help",
  18143. "unicode": "e679",
  18144. "unicode_decimal": 59001
  18145. }, {
  18146. "icon_id": "24879602",
  18147. "name": "navigate-filled",
  18148. "font_class": "navigate-filled",
  18149. "unicode": "e67a",
  18150. "unicode_decimal": 59002
  18151. }, {
  18152. "icon_id": "24879603",
  18153. "name": "plusempty",
  18154. "font_class": "plusempty",
  18155. "unicode": "e67b",
  18156. "unicode_decimal": 59003
  18157. }, {
  18158. "icon_id": "24879604",
  18159. "name": "smallcircle",
  18160. "font_class": "smallcircle",
  18161. "unicode": "e67c",
  18162. "unicode_decimal": 59004
  18163. }, {
  18164. "icon_id": "24879605",
  18165. "name": "minus-filled",
  18166. "font_class": "minus-filled",
  18167. "unicode": "e67d",
  18168. "unicode_decimal": 59005
  18169. }, {
  18170. "icon_id": "24879606",
  18171. "name": "micoff",
  18172. "font_class": "micoff",
  18173. "unicode": "e67e",
  18174. "unicode_decimal": 59006
  18175. }, {
  18176. "icon_id": "24879588",
  18177. "name": "closeempty",
  18178. "font_class": "closeempty",
  18179. "unicode": "e66c",
  18180. "unicode_decimal": 58988
  18181. }, {
  18182. "icon_id": "24879589",
  18183. "name": "clear",
  18184. "font_class": "clear",
  18185. "unicode": "e66d",
  18186. "unicode_decimal": 58989
  18187. }, {
  18188. "icon_id": "24879590",
  18189. "name": "navigate",
  18190. "font_class": "navigate",
  18191. "unicode": "e66e",
  18192. "unicode_decimal": 58990
  18193. }, {
  18194. "icon_id": "24879591",
  18195. "name": "minus",
  18196. "font_class": "minus",
  18197. "unicode": "e66f",
  18198. "unicode_decimal": 58991
  18199. }, {
  18200. "icon_id": "24879592",
  18201. "name": "image",
  18202. "font_class": "image",
  18203. "unicode": "e670",
  18204. "unicode_decimal": 58992
  18205. }, {
  18206. "icon_id": "24879593",
  18207. "name": "mic",
  18208. "font_class": "mic",
  18209. "unicode": "e671",
  18210. "unicode_decimal": 58993
  18211. }, {
  18212. "icon_id": "24879594",
  18213. "name": "paperplane",
  18214. "font_class": "paperplane",
  18215. "unicode": "e672",
  18216. "unicode_decimal": 58994
  18217. }, {
  18218. "icon_id": "24879595",
  18219. "name": "close",
  18220. "font_class": "close",
  18221. "unicode": "e673",
  18222. "unicode_decimal": 58995
  18223. }, {
  18224. "icon_id": "24879596",
  18225. "name": "help-filled",
  18226. "font_class": "help-filled",
  18227. "unicode": "e674",
  18228. "unicode_decimal": 58996
  18229. }, {
  18230. "icon_id": "24879597",
  18231. "name": "plus-filled",
  18232. "font_class": "paperplane-filled",
  18233. "unicode": "e675",
  18234. "unicode_decimal": 58997
  18235. }, {
  18236. "icon_id": "24879598",
  18237. "name": "plus",
  18238. "font_class": "plus",
  18239. "unicode": "e676",
  18240. "unicode_decimal": 58998
  18241. }, {
  18242. "icon_id": "24879599",
  18243. "name": "mic-filled",
  18244. "font_class": "mic-filled",
  18245. "unicode": "e677",
  18246. "unicode_decimal": 58999
  18247. }, {
  18248. "icon_id": "24879600",
  18249. "name": "image-filled",
  18250. "font_class": "image-filled",
  18251. "unicode": "e678",
  18252. "unicode_decimal": 59000
  18253. }, {
  18254. "icon_id": "24855900",
  18255. "name": "locked-filled",
  18256. "font_class": "locked-filled",
  18257. "unicode": "e668",
  18258. "unicode_decimal": 58984
  18259. }, {
  18260. "icon_id": "24855901",
  18261. "name": "info",
  18262. "font_class": "info",
  18263. "unicode": "e669",
  18264. "unicode_decimal": 58985
  18265. }, {
  18266. "icon_id": "24855903",
  18267. "name": "locked",
  18268. "font_class": "locked",
  18269. "unicode": "e66b",
  18270. "unicode_decimal": 58987
  18271. }, {
  18272. "icon_id": "24855884",
  18273. "name": "camera-filled",
  18274. "font_class": "camera-filled",
  18275. "unicode": "e658",
  18276. "unicode_decimal": 58968
  18277. }, {
  18278. "icon_id": "24855885",
  18279. "name": "chat-filled",
  18280. "font_class": "chat-filled",
  18281. "unicode": "e659",
  18282. "unicode_decimal": 58969
  18283. }, {
  18284. "icon_id": "24855886",
  18285. "name": "camera",
  18286. "font_class": "camera",
  18287. "unicode": "e65a",
  18288. "unicode_decimal": 58970
  18289. }, {
  18290. "icon_id": "24855887",
  18291. "name": "circle",
  18292. "font_class": "circle",
  18293. "unicode": "e65b",
  18294. "unicode_decimal": 58971
  18295. }, {
  18296. "icon_id": "24855888",
  18297. "name": "checkmarkempty",
  18298. "font_class": "checkmarkempty",
  18299. "unicode": "e65c",
  18300. "unicode_decimal": 58972
  18301. }, {
  18302. "icon_id": "24855889",
  18303. "name": "chat",
  18304. "font_class": "chat",
  18305. "unicode": "e65d",
  18306. "unicode_decimal": 58973
  18307. }, {
  18308. "icon_id": "24855890",
  18309. "name": "circle-filled",
  18310. "font_class": "circle-filled",
  18311. "unicode": "e65e",
  18312. "unicode_decimal": 58974
  18313. }, {
  18314. "icon_id": "24855891",
  18315. "name": "flag",
  18316. "font_class": "flag",
  18317. "unicode": "e65f",
  18318. "unicode_decimal": 58975
  18319. }, {
  18320. "icon_id": "24855892",
  18321. "name": "flag-filled",
  18322. "font_class": "flag-filled",
  18323. "unicode": "e660",
  18324. "unicode_decimal": 58976
  18325. }, {
  18326. "icon_id": "24855893",
  18327. "name": "gear-filled",
  18328. "font_class": "gear-filled",
  18329. "unicode": "e661",
  18330. "unicode_decimal": 58977
  18331. }, {
  18332. "icon_id": "24855894",
  18333. "name": "home",
  18334. "font_class": "home",
  18335. "unicode": "e662",
  18336. "unicode_decimal": 58978
  18337. }, {
  18338. "icon_id": "24855895",
  18339. "name": "home-filled",
  18340. "font_class": "home-filled",
  18341. "unicode": "e663",
  18342. "unicode_decimal": 58979
  18343. }, {
  18344. "icon_id": "24855896",
  18345. "name": "gear",
  18346. "font_class": "gear",
  18347. "unicode": "e664",
  18348. "unicode_decimal": 58980
  18349. }, {
  18350. "icon_id": "24855897",
  18351. "name": "smallcircle-filled",
  18352. "font_class": "smallcircle-filled",
  18353. "unicode": "e665",
  18354. "unicode_decimal": 58981
  18355. }, {
  18356. "icon_id": "24855898",
  18357. "name": "map-filled",
  18358. "font_class": "map-filled",
  18359. "unicode": "e666",
  18360. "unicode_decimal": 58982
  18361. }, {
  18362. "icon_id": "24855899",
  18363. "name": "map",
  18364. "font_class": "map",
  18365. "unicode": "e667",
  18366. "unicode_decimal": 58983
  18367. }, {
  18368. "icon_id": "24855825",
  18369. "name": "refresh-filled",
  18370. "font_class": "refresh-filled",
  18371. "unicode": "e656",
  18372. "unicode_decimal": 58966
  18373. }, {
  18374. "icon_id": "24855826",
  18375. "name": "refresh",
  18376. "font_class": "refresh",
  18377. "unicode": "e657",
  18378. "unicode_decimal": 58967
  18379. }, {
  18380. "icon_id": "24855808",
  18381. "name": "cloud-upload",
  18382. "font_class": "cloud-upload",
  18383. "unicode": "e645",
  18384. "unicode_decimal": 58949
  18385. }, {
  18386. "icon_id": "24855809",
  18387. "name": "cloud-download-filled",
  18388. "font_class": "cloud-download-filled",
  18389. "unicode": "e646",
  18390. "unicode_decimal": 58950
  18391. }, {
  18392. "icon_id": "24855810",
  18393. "name": "cloud-download",
  18394. "font_class": "cloud-download",
  18395. "unicode": "e647",
  18396. "unicode_decimal": 58951
  18397. }, {
  18398. "icon_id": "24855811",
  18399. "name": "cloud-upload-filled",
  18400. "font_class": "cloud-upload-filled",
  18401. "unicode": "e648",
  18402. "unicode_decimal": 58952
  18403. }, {
  18404. "icon_id": "24855813",
  18405. "name": "redo",
  18406. "font_class": "redo",
  18407. "unicode": "e64a",
  18408. "unicode_decimal": 58954
  18409. }, {
  18410. "icon_id": "24855814",
  18411. "name": "images-filled",
  18412. "font_class": "images-filled",
  18413. "unicode": "e64b",
  18414. "unicode_decimal": 58955
  18415. }, {
  18416. "icon_id": "24855815",
  18417. "name": "undo-filled",
  18418. "font_class": "undo-filled",
  18419. "unicode": "e64c",
  18420. "unicode_decimal": 58956
  18421. }, {
  18422. "icon_id": "24855816",
  18423. "name": "more",
  18424. "font_class": "more",
  18425. "unicode": "e64d",
  18426. "unicode_decimal": 58957
  18427. }, {
  18428. "icon_id": "24855817",
  18429. "name": "more-filled",
  18430. "font_class": "more-filled",
  18431. "unicode": "e64e",
  18432. "unicode_decimal": 58958
  18433. }, {
  18434. "icon_id": "24855818",
  18435. "name": "undo",
  18436. "font_class": "undo",
  18437. "unicode": "e64f",
  18438. "unicode_decimal": 58959
  18439. }, {
  18440. "icon_id": "24855819",
  18441. "name": "images",
  18442. "font_class": "images",
  18443. "unicode": "e650",
  18444. "unicode_decimal": 58960
  18445. }, {
  18446. "icon_id": "24855821",
  18447. "name": "paperclip",
  18448. "font_class": "paperclip",
  18449. "unicode": "e652",
  18450. "unicode_decimal": 58962
  18451. }, {
  18452. "icon_id": "24855822",
  18453. "name": "settings",
  18454. "font_class": "settings",
  18455. "unicode": "e653",
  18456. "unicode_decimal": 58963
  18457. }, {
  18458. "icon_id": "24855823",
  18459. "name": "search",
  18460. "font_class": "search",
  18461. "unicode": "e654",
  18462. "unicode_decimal": 58964
  18463. }, {
  18464. "icon_id": "24855824",
  18465. "name": "redo-filled",
  18466. "font_class": "redo-filled",
  18467. "unicode": "e655",
  18468. "unicode_decimal": 58965
  18469. }, {
  18470. "icon_id": "24841702",
  18471. "name": "list",
  18472. "font_class": "list",
  18473. "unicode": "e644",
  18474. "unicode_decimal": 58948
  18475. }, {
  18476. "icon_id": "24841489",
  18477. "name": "mail-open-filled",
  18478. "font_class": "mail-open-filled",
  18479. "unicode": "e63a",
  18480. "unicode_decimal": 58938
  18481. }, {
  18482. "icon_id": "24841491",
  18483. "name": "hand-thumbsdown-filled",
  18484. "font_class": "hand-down-filled",
  18485. "unicode": "e63c",
  18486. "unicode_decimal": 58940
  18487. }, {
  18488. "icon_id": "24841492",
  18489. "name": "hand-thumbsdown",
  18490. "font_class": "hand-down",
  18491. "unicode": "e63d",
  18492. "unicode_decimal": 58941
  18493. }, {
  18494. "icon_id": "24841493",
  18495. "name": "hand-thumbsup-filled",
  18496. "font_class": "hand-up-filled",
  18497. "unicode": "e63e",
  18498. "unicode_decimal": 58942
  18499. }, {
  18500. "icon_id": "24841494",
  18501. "name": "hand-thumbsup",
  18502. "font_class": "hand-up",
  18503. "unicode": "e63f",
  18504. "unicode_decimal": 58943
  18505. }, {
  18506. "icon_id": "24841496",
  18507. "name": "heart-filled",
  18508. "font_class": "heart-filled",
  18509. "unicode": "e641",
  18510. "unicode_decimal": 58945
  18511. }, {
  18512. "icon_id": "24841498",
  18513. "name": "mail-open",
  18514. "font_class": "mail-open",
  18515. "unicode": "e643",
  18516. "unicode_decimal": 58947
  18517. }, {
  18518. "icon_id": "24841488",
  18519. "name": "heart",
  18520. "font_class": "heart",
  18521. "unicode": "e639",
  18522. "unicode_decimal": 58937
  18523. }, {
  18524. "icon_id": "24839963",
  18525. "name": "loop",
  18526. "font_class": "loop",
  18527. "unicode": "e633",
  18528. "unicode_decimal": 58931
  18529. }, {
  18530. "icon_id": "24839866",
  18531. "name": "pulldown",
  18532. "font_class": "pulldown",
  18533. "unicode": "e632",
  18534. "unicode_decimal": 58930
  18535. }, {
  18536. "icon_id": "24813798",
  18537. "name": "scan",
  18538. "font_class": "scan",
  18539. "unicode": "e62a",
  18540. "unicode_decimal": 58922
  18541. }, {
  18542. "icon_id": "24813786",
  18543. "name": "bars",
  18544. "font_class": "bars",
  18545. "unicode": "e627",
  18546. "unicode_decimal": 58919
  18547. }, {
  18548. "icon_id": "24813788",
  18549. "name": "cart-filled",
  18550. "font_class": "cart-filled",
  18551. "unicode": "e629",
  18552. "unicode_decimal": 58921
  18553. }, {
  18554. "icon_id": "24813790",
  18555. "name": "checkbox",
  18556. "font_class": "checkbox",
  18557. "unicode": "e62b",
  18558. "unicode_decimal": 58923
  18559. }, {
  18560. "icon_id": "24813791",
  18561. "name": "checkbox-filled",
  18562. "font_class": "checkbox-filled",
  18563. "unicode": "e62c",
  18564. "unicode_decimal": 58924
  18565. }, {
  18566. "icon_id": "24813794",
  18567. "name": "shop",
  18568. "font_class": "shop",
  18569. "unicode": "e62f",
  18570. "unicode_decimal": 58927
  18571. }, {
  18572. "icon_id": "24813795",
  18573. "name": "headphones",
  18574. "font_class": "headphones",
  18575. "unicode": "e630",
  18576. "unicode_decimal": 58928
  18577. }, {
  18578. "icon_id": "24813796",
  18579. "name": "cart",
  18580. "font_class": "cart",
  18581. "unicode": "e631",
  18582. "unicode_decimal": 58929
  18583. }]
  18584. };
  18585. exports.default = _default;
  18586. /***/ })
  18587. ]]);
  18588. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map