vendor.js 627 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 12:
  76. /*!**************************************************************!*\
  77. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  78. \**************************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  82. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  83. function _toPropertyKey(arg) {
  84. var key = toPrimitive(arg, "string");
  85. return _typeof(key) === "symbol" ? key : String(key);
  86. }
  87. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  88. /***/ }),
  89. /***/ 13:
  90. /*!*******************************************************!*\
  91. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  92. \*******************************************************/
  93. /*! no static exports found */
  94. /***/ (function(module, exports) {
  95. function _typeof(obj) {
  96. "@babel/helpers - typeof";
  97. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  98. return typeof obj;
  99. } : function (obj) {
  100. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  101. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  102. }
  103. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  104. /***/ }),
  105. /***/ 14:
  106. /*!************************************************************!*\
  107. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  108. \************************************************************/
  109. /*! no static exports found */
  110. /***/ (function(module, exports, __webpack_require__) {
  111. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  112. function _toPrimitive(input, hint) {
  113. if (_typeof(input) !== "object" || input === null) return input;
  114. var prim = input[Symbol.toPrimitive];
  115. if (prim !== undefined) {
  116. var res = prim.call(input, hint || "default");
  117. if (_typeof(res) !== "object") return res;
  118. throw new TypeError("@@toPrimitive must return a primitive value.");
  119. }
  120. return (hint === "string" ? String : Number)(input);
  121. }
  122. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  123. /***/ }),
  124. /***/ 15:
  125. /*!**********************************************************!*\
  126. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  127. \**********************************************************/
  128. /*! no static exports found */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  131. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  132. function _construct(Parent, args, Class) {
  133. if (isNativeReflectConstruct()) {
  134. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  135. } else {
  136. module.exports = _construct = function _construct(Parent, args, Class) {
  137. var a = [null];
  138. a.push.apply(a, args);
  139. var Constructor = Function.bind.apply(Parent, a);
  140. var instance = new Constructor();
  141. if (Class) setPrototypeOf(instance, Class.prototype);
  142. return instance;
  143. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  144. }
  145. return _construct.apply(null, arguments);
  146. }
  147. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  148. /***/ }),
  149. /***/ 16:
  150. /*!***************************************************************!*\
  151. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  152. \***************************************************************/
  153. /*! no static exports found */
  154. /***/ (function(module, exports) {
  155. function _setPrototypeOf(o, p) {
  156. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  157. o.__proto__ = p;
  158. return o;
  159. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  160. return _setPrototypeOf(o, p);
  161. }
  162. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  163. /***/ }),
  164. /***/ 17:
  165. /*!*************************************************************************!*\
  166. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  167. \*************************************************************************/
  168. /*! no static exports found */
  169. /***/ (function(module, exports) {
  170. function _isNativeReflectConstruct() {
  171. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  172. if (Reflect.construct.sham) return false;
  173. if (typeof Proxy === "function") return true;
  174. try {
  175. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  176. return true;
  177. } catch (e) {
  178. return false;
  179. }
  180. }
  181. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  182. /***/ }),
  183. /***/ 175:
  184. /*!**********************************************************************************!*\
  185. !*** D:/project/项目模板/uniapp/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  186. \**********************************************************************************/
  187. /*! no static exports found */
  188. /***/ (function(module, exports, __webpack_require__) {
  189. "use strict";
  190. Object.defineProperty(exports, "__esModule", {
  191. value: true
  192. });
  193. exports.default = void 0;
  194. var _default = {
  195. "id": "2852637",
  196. "name": "uniui图标库",
  197. "font_family": "uniicons",
  198. "css_prefix_text": "uniui-",
  199. "description": "",
  200. "glyphs": [{
  201. "icon_id": "25027049",
  202. "name": "yanse",
  203. "font_class": "color",
  204. "unicode": "e6cf",
  205. "unicode_decimal": 59087
  206. }, {
  207. "icon_id": "25027048",
  208. "name": "wallet",
  209. "font_class": "wallet",
  210. "unicode": "e6b1",
  211. "unicode_decimal": 59057
  212. }, {
  213. "icon_id": "25015720",
  214. "name": "settings-filled",
  215. "font_class": "settings-filled",
  216. "unicode": "e6ce",
  217. "unicode_decimal": 59086
  218. }, {
  219. "icon_id": "25015434",
  220. "name": "shimingrenzheng-filled",
  221. "font_class": "auth-filled",
  222. "unicode": "e6cc",
  223. "unicode_decimal": 59084
  224. }, {
  225. "icon_id": "24934246",
  226. "name": "shop-filled",
  227. "font_class": "shop-filled",
  228. "unicode": "e6cd",
  229. "unicode_decimal": 59085
  230. }, {
  231. "icon_id": "24934159",
  232. "name": "staff-filled-01",
  233. "font_class": "staff-filled",
  234. "unicode": "e6cb",
  235. "unicode_decimal": 59083
  236. }, {
  237. "icon_id": "24932461",
  238. "name": "VIP-filled",
  239. "font_class": "vip-filled",
  240. "unicode": "e6c6",
  241. "unicode_decimal": 59078
  242. }, {
  243. "icon_id": "24932462",
  244. "name": "plus_circle_fill",
  245. "font_class": "plus-filled",
  246. "unicode": "e6c7",
  247. "unicode_decimal": 59079
  248. }, {
  249. "icon_id": "24932463",
  250. "name": "folder_add-filled",
  251. "font_class": "folder-add-filled",
  252. "unicode": "e6c8",
  253. "unicode_decimal": 59080
  254. }, {
  255. "icon_id": "24932464",
  256. "name": "yanse-filled",
  257. "font_class": "color-filled",
  258. "unicode": "e6c9",
  259. "unicode_decimal": 59081
  260. }, {
  261. "icon_id": "24932465",
  262. "name": "tune-filled",
  263. "font_class": "tune-filled",
  264. "unicode": "e6ca",
  265. "unicode_decimal": 59082
  266. }, {
  267. "icon_id": "24932455",
  268. "name": "a-rilidaka-filled",
  269. "font_class": "calendar-filled",
  270. "unicode": "e6c0",
  271. "unicode_decimal": 59072
  272. }, {
  273. "icon_id": "24932456",
  274. "name": "notification-filled",
  275. "font_class": "notification-filled",
  276. "unicode": "e6c1",
  277. "unicode_decimal": 59073
  278. }, {
  279. "icon_id": "24932457",
  280. "name": "wallet-filled",
  281. "font_class": "wallet-filled",
  282. "unicode": "e6c2",
  283. "unicode_decimal": 59074
  284. }, {
  285. "icon_id": "24932458",
  286. "name": "paihangbang-filled",
  287. "font_class": "medal-filled",
  288. "unicode": "e6c3",
  289. "unicode_decimal": 59075
  290. }, {
  291. "icon_id": "24932459",
  292. "name": "gift-filled",
  293. "font_class": "gift-filled",
  294. "unicode": "e6c4",
  295. "unicode_decimal": 59076
  296. }, {
  297. "icon_id": "24932460",
  298. "name": "fire-filled",
  299. "font_class": "fire-filled",
  300. "unicode": "e6c5",
  301. "unicode_decimal": 59077
  302. }, {
  303. "icon_id": "24928001",
  304. "name": "refreshempty",
  305. "font_class": "refreshempty",
  306. "unicode": "e6bf",
  307. "unicode_decimal": 59071
  308. }, {
  309. "icon_id": "24926853",
  310. "name": "location-ellipse",
  311. "font_class": "location-filled",
  312. "unicode": "e6af",
  313. "unicode_decimal": 59055
  314. }, {
  315. "icon_id": "24926735",
  316. "name": "person-filled",
  317. "font_class": "person-filled",
  318. "unicode": "e69d",
  319. "unicode_decimal": 59037
  320. }, {
  321. "icon_id": "24926703",
  322. "name": "personadd-filled",
  323. "font_class": "personadd-filled",
  324. "unicode": "e698",
  325. "unicode_decimal": 59032
  326. }, {
  327. "icon_id": "24923351",
  328. "name": "back",
  329. "font_class": "back",
  330. "unicode": "e6b9",
  331. "unicode_decimal": 59065
  332. }, {
  333. "icon_id": "24923352",
  334. "name": "forward",
  335. "font_class": "forward",
  336. "unicode": "e6ba",
  337. "unicode_decimal": 59066
  338. }, {
  339. "icon_id": "24923353",
  340. "name": "arrowthinright",
  341. "font_class": "arrow-right",
  342. "unicode": "e6bb",
  343. "unicode_decimal": 59067
  344. }, {
  345. "icon_id": "24923353",
  346. "name": "arrowthinright",
  347. "font_class": "arrowthinright",
  348. "unicode": "e6bb",
  349. "unicode_decimal": 59067
  350. }, {
  351. "icon_id": "24923354",
  352. "name": "arrowthinleft",
  353. "font_class": "arrow-left",
  354. "unicode": "e6bc",
  355. "unicode_decimal": 59068
  356. }, {
  357. "icon_id": "24923354",
  358. "name": "arrowthinleft",
  359. "font_class": "arrowthinleft",
  360. "unicode": "e6bc",
  361. "unicode_decimal": 59068
  362. }, {
  363. "icon_id": "24923355",
  364. "name": "arrowthinup",
  365. "font_class": "arrow-up",
  366. "unicode": "e6bd",
  367. "unicode_decimal": 59069
  368. }, {
  369. "icon_id": "24923355",
  370. "name": "arrowthinup",
  371. "font_class": "arrowthinup",
  372. "unicode": "e6bd",
  373. "unicode_decimal": 59069
  374. }, {
  375. "icon_id": "24923356",
  376. "name": "arrowthindown",
  377. "font_class": "arrow-down",
  378. "unicode": "e6be",
  379. "unicode_decimal": 59070
  380. }, {
  381. "icon_id": "24923356",
  382. "name": "arrowthindown",
  383. "font_class": "arrowthindown",
  384. "unicode": "e6be",
  385. "unicode_decimal": 59070
  386. }, {
  387. "icon_id": "24923349",
  388. "name": "arrowdown",
  389. "font_class": "bottom",
  390. "unicode": "e6b8",
  391. "unicode_decimal": 59064
  392. }, {
  393. "icon_id": "24923349",
  394. "name": "arrowdown",
  395. "font_class": "arrowdown",
  396. "unicode": "e6b8",
  397. "unicode_decimal": 59064
  398. }, {
  399. "icon_id": "24923346",
  400. "name": "arrowright",
  401. "font_class": "right",
  402. "unicode": "e6b5",
  403. "unicode_decimal": 59061
  404. }, {
  405. "icon_id": "24923346",
  406. "name": "arrowright",
  407. "font_class": "arrowright",
  408. "unicode": "e6b5",
  409. "unicode_decimal": 59061
  410. }, {
  411. "icon_id": "24923347",
  412. "name": "arrowup",
  413. "font_class": "top",
  414. "unicode": "e6b6",
  415. "unicode_decimal": 59062
  416. }, {
  417. "icon_id": "24923347",
  418. "name": "arrowup",
  419. "font_class": "arrowup",
  420. "unicode": "e6b6",
  421. "unicode_decimal": 59062
  422. }, {
  423. "icon_id": "24923348",
  424. "name": "arrowleft",
  425. "font_class": "left",
  426. "unicode": "e6b7",
  427. "unicode_decimal": 59063
  428. }, {
  429. "icon_id": "24923348",
  430. "name": "arrowleft",
  431. "font_class": "arrowleft",
  432. "unicode": "e6b7",
  433. "unicode_decimal": 59063
  434. }, {
  435. "icon_id": "24923334",
  436. "name": "eye",
  437. "font_class": "eye",
  438. "unicode": "e651",
  439. "unicode_decimal": 58961
  440. }, {
  441. "icon_id": "24923335",
  442. "name": "eye-filled",
  443. "font_class": "eye-filled",
  444. "unicode": "e66a",
  445. "unicode_decimal": 58986
  446. }, {
  447. "icon_id": "24923336",
  448. "name": "eye-slash",
  449. "font_class": "eye-slash",
  450. "unicode": "e6b3",
  451. "unicode_decimal": 59059
  452. }, {
  453. "icon_id": "24923337",
  454. "name": "eye-slash-filled",
  455. "font_class": "eye-slash-filled",
  456. "unicode": "e6b4",
  457. "unicode_decimal": 59060
  458. }, {
  459. "icon_id": "24923305",
  460. "name": "info-filled",
  461. "font_class": "info-filled",
  462. "unicode": "e649",
  463. "unicode_decimal": 58953
  464. }, {
  465. "icon_id": "24923299",
  466. "name": "reload-01",
  467. "font_class": "reload",
  468. "unicode": "e6b2",
  469. "unicode_decimal": 59058
  470. }, {
  471. "icon_id": "24923195",
  472. "name": "mic_slash_fill",
  473. "font_class": "micoff-filled",
  474. "unicode": "e6b0",
  475. "unicode_decimal": 59056
  476. }, {
  477. "icon_id": "24923165",
  478. "name": "map-pin-ellipse",
  479. "font_class": "map-pin-ellipse",
  480. "unicode": "e6ac",
  481. "unicode_decimal": 59052
  482. }, {
  483. "icon_id": "24923166",
  484. "name": "map-pin",
  485. "font_class": "map-pin",
  486. "unicode": "e6ad",
  487. "unicode_decimal": 59053
  488. }, {
  489. "icon_id": "24923167",
  490. "name": "location",
  491. "font_class": "location",
  492. "unicode": "e6ae",
  493. "unicode_decimal": 59054
  494. }, {
  495. "icon_id": "24923064",
  496. "name": "starhalf",
  497. "font_class": "starhalf",
  498. "unicode": "e683",
  499. "unicode_decimal": 59011
  500. }, {
  501. "icon_id": "24923065",
  502. "name": "star",
  503. "font_class": "star",
  504. "unicode": "e688",
  505. "unicode_decimal": 59016
  506. }, {
  507. "icon_id": "24923066",
  508. "name": "star-filled",
  509. "font_class": "star-filled",
  510. "unicode": "e68f",
  511. "unicode_decimal": 59023
  512. }, {
  513. "icon_id": "24899646",
  514. "name": "a-rilidaka",
  515. "font_class": "calendar",
  516. "unicode": "e6a0",
  517. "unicode_decimal": 59040
  518. }, {
  519. "icon_id": "24899647",
  520. "name": "fire",
  521. "font_class": "fire",
  522. "unicode": "e6a1",
  523. "unicode_decimal": 59041
  524. }, {
  525. "icon_id": "24899648",
  526. "name": "paihangbang",
  527. "font_class": "medal",
  528. "unicode": "e6a2",
  529. "unicode_decimal": 59042
  530. }, {
  531. "icon_id": "24899649",
  532. "name": "font",
  533. "font_class": "font",
  534. "unicode": "e6a3",
  535. "unicode_decimal": 59043
  536. }, {
  537. "icon_id": "24899650",
  538. "name": "gift",
  539. "font_class": "gift",
  540. "unicode": "e6a4",
  541. "unicode_decimal": 59044
  542. }, {
  543. "icon_id": "24899651",
  544. "name": "link",
  545. "font_class": "link",
  546. "unicode": "e6a5",
  547. "unicode_decimal": 59045
  548. }, {
  549. "icon_id": "24899652",
  550. "name": "notification",
  551. "font_class": "notification",
  552. "unicode": "e6a6",
  553. "unicode_decimal": 59046
  554. }, {
  555. "icon_id": "24899653",
  556. "name": "staff",
  557. "font_class": "staff",
  558. "unicode": "e6a7",
  559. "unicode_decimal": 59047
  560. }, {
  561. "icon_id": "24899654",
  562. "name": "VIP",
  563. "font_class": "vip",
  564. "unicode": "e6a8",
  565. "unicode_decimal": 59048
  566. }, {
  567. "icon_id": "24899655",
  568. "name": "folder_add",
  569. "font_class": "folder-add",
  570. "unicode": "e6a9",
  571. "unicode_decimal": 59049
  572. }, {
  573. "icon_id": "24899656",
  574. "name": "tune",
  575. "font_class": "tune",
  576. "unicode": "e6aa",
  577. "unicode_decimal": 59050
  578. }, {
  579. "icon_id": "24899657",
  580. "name": "shimingrenzheng",
  581. "font_class": "auth",
  582. "unicode": "e6ab",
  583. "unicode_decimal": 59051
  584. }, {
  585. "icon_id": "24899565",
  586. "name": "person",
  587. "font_class": "person",
  588. "unicode": "e699",
  589. "unicode_decimal": 59033
  590. }, {
  591. "icon_id": "24899566",
  592. "name": "email-filled",
  593. "font_class": "email-filled",
  594. "unicode": "e69a",
  595. "unicode_decimal": 59034
  596. }, {
  597. "icon_id": "24899567",
  598. "name": "phone-filled",
  599. "font_class": "phone-filled",
  600. "unicode": "e69b",
  601. "unicode_decimal": 59035
  602. }, {
  603. "icon_id": "24899568",
  604. "name": "phone",
  605. "font_class": "phone",
  606. "unicode": "e69c",
  607. "unicode_decimal": 59036
  608. }, {
  609. "icon_id": "24899570",
  610. "name": "email",
  611. "font_class": "email",
  612. "unicode": "e69e",
  613. "unicode_decimal": 59038
  614. }, {
  615. "icon_id": "24899571",
  616. "name": "personadd",
  617. "font_class": "personadd",
  618. "unicode": "e69f",
  619. "unicode_decimal": 59039
  620. }, {
  621. "icon_id": "24899558",
  622. "name": "chatboxes-filled",
  623. "font_class": "chatboxes-filled",
  624. "unicode": "e692",
  625. "unicode_decimal": 59026
  626. }, {
  627. "icon_id": "24899559",
  628. "name": "contact",
  629. "font_class": "contact",
  630. "unicode": "e693",
  631. "unicode_decimal": 59027
  632. }, {
  633. "icon_id": "24899560",
  634. "name": "chatbubble-filled",
  635. "font_class": "chatbubble-filled",
  636. "unicode": "e694",
  637. "unicode_decimal": 59028
  638. }, {
  639. "icon_id": "24899561",
  640. "name": "contact-filled",
  641. "font_class": "contact-filled",
  642. "unicode": "e695",
  643. "unicode_decimal": 59029
  644. }, {
  645. "icon_id": "24899562",
  646. "name": "chatboxes",
  647. "font_class": "chatboxes",
  648. "unicode": "e696",
  649. "unicode_decimal": 59030
  650. }, {
  651. "icon_id": "24899563",
  652. "name": "chatbubble",
  653. "font_class": "chatbubble",
  654. "unicode": "e697",
  655. "unicode_decimal": 59031
  656. }, {
  657. "icon_id": "24881290",
  658. "name": "upload-filled",
  659. "font_class": "upload-filled",
  660. "unicode": "e68e",
  661. "unicode_decimal": 59022
  662. }, {
  663. "icon_id": "24881292",
  664. "name": "upload",
  665. "font_class": "upload",
  666. "unicode": "e690",
  667. "unicode_decimal": 59024
  668. }, {
  669. "icon_id": "24881293",
  670. "name": "weixin",
  671. "font_class": "weixin",
  672. "unicode": "e691",
  673. "unicode_decimal": 59025
  674. }, {
  675. "icon_id": "24881274",
  676. "name": "compose",
  677. "font_class": "compose",
  678. "unicode": "e67f",
  679. "unicode_decimal": 59007
  680. }, {
  681. "icon_id": "24881275",
  682. "name": "qq",
  683. "font_class": "qq",
  684. "unicode": "e680",
  685. "unicode_decimal": 59008
  686. }, {
  687. "icon_id": "24881276",
  688. "name": "download-filled",
  689. "font_class": "download-filled",
  690. "unicode": "e681",
  691. "unicode_decimal": 59009
  692. }, {
  693. "icon_id": "24881277",
  694. "name": "pengyouquan",
  695. "font_class": "pyq",
  696. "unicode": "e682",
  697. "unicode_decimal": 59010
  698. }, {
  699. "icon_id": "24881279",
  700. "name": "sound",
  701. "font_class": "sound",
  702. "unicode": "e684",
  703. "unicode_decimal": 59012
  704. }, {
  705. "icon_id": "24881280",
  706. "name": "trash-filled",
  707. "font_class": "trash-filled",
  708. "unicode": "e685",
  709. "unicode_decimal": 59013
  710. }, {
  711. "icon_id": "24881281",
  712. "name": "sound-filled",
  713. "font_class": "sound-filled",
  714. "unicode": "e686",
  715. "unicode_decimal": 59014
  716. }, {
  717. "icon_id": "24881282",
  718. "name": "trash",
  719. "font_class": "trash",
  720. "unicode": "e687",
  721. "unicode_decimal": 59015
  722. }, {
  723. "icon_id": "24881284",
  724. "name": "videocam-filled",
  725. "font_class": "videocam-filled",
  726. "unicode": "e689",
  727. "unicode_decimal": 59017
  728. }, {
  729. "icon_id": "24881285",
  730. "name": "spinner-cycle",
  731. "font_class": "spinner-cycle",
  732. "unicode": "e68a",
  733. "unicode_decimal": 59018
  734. }, {
  735. "icon_id": "24881286",
  736. "name": "weibo",
  737. "font_class": "weibo",
  738. "unicode": "e68b",
  739. "unicode_decimal": 59019
  740. }, {
  741. "icon_id": "24881288",
  742. "name": "videocam",
  743. "font_class": "videocam",
  744. "unicode": "e68c",
  745. "unicode_decimal": 59020
  746. }, {
  747. "icon_id": "24881289",
  748. "name": "download",
  749. "font_class": "download",
  750. "unicode": "e68d",
  751. "unicode_decimal": 59021
  752. }, {
  753. "icon_id": "24879601",
  754. "name": "help",
  755. "font_class": "help",
  756. "unicode": "e679",
  757. "unicode_decimal": 59001
  758. }, {
  759. "icon_id": "24879602",
  760. "name": "navigate-filled",
  761. "font_class": "navigate-filled",
  762. "unicode": "e67a",
  763. "unicode_decimal": 59002
  764. }, {
  765. "icon_id": "24879603",
  766. "name": "plusempty",
  767. "font_class": "plusempty",
  768. "unicode": "e67b",
  769. "unicode_decimal": 59003
  770. }, {
  771. "icon_id": "24879604",
  772. "name": "smallcircle",
  773. "font_class": "smallcircle",
  774. "unicode": "e67c",
  775. "unicode_decimal": 59004
  776. }, {
  777. "icon_id": "24879605",
  778. "name": "minus-filled",
  779. "font_class": "minus-filled",
  780. "unicode": "e67d",
  781. "unicode_decimal": 59005
  782. }, {
  783. "icon_id": "24879606",
  784. "name": "micoff",
  785. "font_class": "micoff",
  786. "unicode": "e67e",
  787. "unicode_decimal": 59006
  788. }, {
  789. "icon_id": "24879588",
  790. "name": "closeempty",
  791. "font_class": "closeempty",
  792. "unicode": "e66c",
  793. "unicode_decimal": 58988
  794. }, {
  795. "icon_id": "24879589",
  796. "name": "clear",
  797. "font_class": "clear",
  798. "unicode": "e66d",
  799. "unicode_decimal": 58989
  800. }, {
  801. "icon_id": "24879590",
  802. "name": "navigate",
  803. "font_class": "navigate",
  804. "unicode": "e66e",
  805. "unicode_decimal": 58990
  806. }, {
  807. "icon_id": "24879591",
  808. "name": "minus",
  809. "font_class": "minus",
  810. "unicode": "e66f",
  811. "unicode_decimal": 58991
  812. }, {
  813. "icon_id": "24879592",
  814. "name": "image",
  815. "font_class": "image",
  816. "unicode": "e670",
  817. "unicode_decimal": 58992
  818. }, {
  819. "icon_id": "24879593",
  820. "name": "mic",
  821. "font_class": "mic",
  822. "unicode": "e671",
  823. "unicode_decimal": 58993
  824. }, {
  825. "icon_id": "24879594",
  826. "name": "paperplane",
  827. "font_class": "paperplane",
  828. "unicode": "e672",
  829. "unicode_decimal": 58994
  830. }, {
  831. "icon_id": "24879595",
  832. "name": "close",
  833. "font_class": "close",
  834. "unicode": "e673",
  835. "unicode_decimal": 58995
  836. }, {
  837. "icon_id": "24879596",
  838. "name": "help-filled",
  839. "font_class": "help-filled",
  840. "unicode": "e674",
  841. "unicode_decimal": 58996
  842. }, {
  843. "icon_id": "24879597",
  844. "name": "plus-filled",
  845. "font_class": "paperplane-filled",
  846. "unicode": "e675",
  847. "unicode_decimal": 58997
  848. }, {
  849. "icon_id": "24879598",
  850. "name": "plus",
  851. "font_class": "plus",
  852. "unicode": "e676",
  853. "unicode_decimal": 58998
  854. }, {
  855. "icon_id": "24879599",
  856. "name": "mic-filled",
  857. "font_class": "mic-filled",
  858. "unicode": "e677",
  859. "unicode_decimal": 58999
  860. }, {
  861. "icon_id": "24879600",
  862. "name": "image-filled",
  863. "font_class": "image-filled",
  864. "unicode": "e678",
  865. "unicode_decimal": 59000
  866. }, {
  867. "icon_id": "24855900",
  868. "name": "locked-filled",
  869. "font_class": "locked-filled",
  870. "unicode": "e668",
  871. "unicode_decimal": 58984
  872. }, {
  873. "icon_id": "24855901",
  874. "name": "info",
  875. "font_class": "info",
  876. "unicode": "e669",
  877. "unicode_decimal": 58985
  878. }, {
  879. "icon_id": "24855903",
  880. "name": "locked",
  881. "font_class": "locked",
  882. "unicode": "e66b",
  883. "unicode_decimal": 58987
  884. }, {
  885. "icon_id": "24855884",
  886. "name": "camera-filled",
  887. "font_class": "camera-filled",
  888. "unicode": "e658",
  889. "unicode_decimal": 58968
  890. }, {
  891. "icon_id": "24855885",
  892. "name": "chat-filled",
  893. "font_class": "chat-filled",
  894. "unicode": "e659",
  895. "unicode_decimal": 58969
  896. }, {
  897. "icon_id": "24855886",
  898. "name": "camera",
  899. "font_class": "camera",
  900. "unicode": "e65a",
  901. "unicode_decimal": 58970
  902. }, {
  903. "icon_id": "24855887",
  904. "name": "circle",
  905. "font_class": "circle",
  906. "unicode": "e65b",
  907. "unicode_decimal": 58971
  908. }, {
  909. "icon_id": "24855888",
  910. "name": "checkmarkempty",
  911. "font_class": "checkmarkempty",
  912. "unicode": "e65c",
  913. "unicode_decimal": 58972
  914. }, {
  915. "icon_id": "24855889",
  916. "name": "chat",
  917. "font_class": "chat",
  918. "unicode": "e65d",
  919. "unicode_decimal": 58973
  920. }, {
  921. "icon_id": "24855890",
  922. "name": "circle-filled",
  923. "font_class": "circle-filled",
  924. "unicode": "e65e",
  925. "unicode_decimal": 58974
  926. }, {
  927. "icon_id": "24855891",
  928. "name": "flag",
  929. "font_class": "flag",
  930. "unicode": "e65f",
  931. "unicode_decimal": 58975
  932. }, {
  933. "icon_id": "24855892",
  934. "name": "flag-filled",
  935. "font_class": "flag-filled",
  936. "unicode": "e660",
  937. "unicode_decimal": 58976
  938. }, {
  939. "icon_id": "24855893",
  940. "name": "gear-filled",
  941. "font_class": "gear-filled",
  942. "unicode": "e661",
  943. "unicode_decimal": 58977
  944. }, {
  945. "icon_id": "24855894",
  946. "name": "home",
  947. "font_class": "home",
  948. "unicode": "e662",
  949. "unicode_decimal": 58978
  950. }, {
  951. "icon_id": "24855895",
  952. "name": "home-filled",
  953. "font_class": "home-filled",
  954. "unicode": "e663",
  955. "unicode_decimal": 58979
  956. }, {
  957. "icon_id": "24855896",
  958. "name": "gear",
  959. "font_class": "gear",
  960. "unicode": "e664",
  961. "unicode_decimal": 58980
  962. }, {
  963. "icon_id": "24855897",
  964. "name": "smallcircle-filled",
  965. "font_class": "smallcircle-filled",
  966. "unicode": "e665",
  967. "unicode_decimal": 58981
  968. }, {
  969. "icon_id": "24855898",
  970. "name": "map-filled",
  971. "font_class": "map-filled",
  972. "unicode": "e666",
  973. "unicode_decimal": 58982
  974. }, {
  975. "icon_id": "24855899",
  976. "name": "map",
  977. "font_class": "map",
  978. "unicode": "e667",
  979. "unicode_decimal": 58983
  980. }, {
  981. "icon_id": "24855825",
  982. "name": "refresh-filled",
  983. "font_class": "refresh-filled",
  984. "unicode": "e656",
  985. "unicode_decimal": 58966
  986. }, {
  987. "icon_id": "24855826",
  988. "name": "refresh",
  989. "font_class": "refresh",
  990. "unicode": "e657",
  991. "unicode_decimal": 58967
  992. }, {
  993. "icon_id": "24855808",
  994. "name": "cloud-upload",
  995. "font_class": "cloud-upload",
  996. "unicode": "e645",
  997. "unicode_decimal": 58949
  998. }, {
  999. "icon_id": "24855809",
  1000. "name": "cloud-download-filled",
  1001. "font_class": "cloud-download-filled",
  1002. "unicode": "e646",
  1003. "unicode_decimal": 58950
  1004. }, {
  1005. "icon_id": "24855810",
  1006. "name": "cloud-download",
  1007. "font_class": "cloud-download",
  1008. "unicode": "e647",
  1009. "unicode_decimal": 58951
  1010. }, {
  1011. "icon_id": "24855811",
  1012. "name": "cloud-upload-filled",
  1013. "font_class": "cloud-upload-filled",
  1014. "unicode": "e648",
  1015. "unicode_decimal": 58952
  1016. }, {
  1017. "icon_id": "24855813",
  1018. "name": "redo",
  1019. "font_class": "redo",
  1020. "unicode": "e64a",
  1021. "unicode_decimal": 58954
  1022. }, {
  1023. "icon_id": "24855814",
  1024. "name": "images-filled",
  1025. "font_class": "images-filled",
  1026. "unicode": "e64b",
  1027. "unicode_decimal": 58955
  1028. }, {
  1029. "icon_id": "24855815",
  1030. "name": "undo-filled",
  1031. "font_class": "undo-filled",
  1032. "unicode": "e64c",
  1033. "unicode_decimal": 58956
  1034. }, {
  1035. "icon_id": "24855816",
  1036. "name": "more",
  1037. "font_class": "more",
  1038. "unicode": "e64d",
  1039. "unicode_decimal": 58957
  1040. }, {
  1041. "icon_id": "24855817",
  1042. "name": "more-filled",
  1043. "font_class": "more-filled",
  1044. "unicode": "e64e",
  1045. "unicode_decimal": 58958
  1046. }, {
  1047. "icon_id": "24855818",
  1048. "name": "undo",
  1049. "font_class": "undo",
  1050. "unicode": "e64f",
  1051. "unicode_decimal": 58959
  1052. }, {
  1053. "icon_id": "24855819",
  1054. "name": "images",
  1055. "font_class": "images",
  1056. "unicode": "e650",
  1057. "unicode_decimal": 58960
  1058. }, {
  1059. "icon_id": "24855821",
  1060. "name": "paperclip",
  1061. "font_class": "paperclip",
  1062. "unicode": "e652",
  1063. "unicode_decimal": 58962
  1064. }, {
  1065. "icon_id": "24855822",
  1066. "name": "settings",
  1067. "font_class": "settings",
  1068. "unicode": "e653",
  1069. "unicode_decimal": 58963
  1070. }, {
  1071. "icon_id": "24855823",
  1072. "name": "search",
  1073. "font_class": "search",
  1074. "unicode": "e654",
  1075. "unicode_decimal": 58964
  1076. }, {
  1077. "icon_id": "24855824",
  1078. "name": "redo-filled",
  1079. "font_class": "redo-filled",
  1080. "unicode": "e655",
  1081. "unicode_decimal": 58965
  1082. }, {
  1083. "icon_id": "24841702",
  1084. "name": "list",
  1085. "font_class": "list",
  1086. "unicode": "e644",
  1087. "unicode_decimal": 58948
  1088. }, {
  1089. "icon_id": "24841489",
  1090. "name": "mail-open-filled",
  1091. "font_class": "mail-open-filled",
  1092. "unicode": "e63a",
  1093. "unicode_decimal": 58938
  1094. }, {
  1095. "icon_id": "24841491",
  1096. "name": "hand-thumbsdown-filled",
  1097. "font_class": "hand-down-filled",
  1098. "unicode": "e63c",
  1099. "unicode_decimal": 58940
  1100. }, {
  1101. "icon_id": "24841492",
  1102. "name": "hand-thumbsdown",
  1103. "font_class": "hand-down",
  1104. "unicode": "e63d",
  1105. "unicode_decimal": 58941
  1106. }, {
  1107. "icon_id": "24841493",
  1108. "name": "hand-thumbsup-filled",
  1109. "font_class": "hand-up-filled",
  1110. "unicode": "e63e",
  1111. "unicode_decimal": 58942
  1112. }, {
  1113. "icon_id": "24841494",
  1114. "name": "hand-thumbsup",
  1115. "font_class": "hand-up",
  1116. "unicode": "e63f",
  1117. "unicode_decimal": 58943
  1118. }, {
  1119. "icon_id": "24841496",
  1120. "name": "heart-filled",
  1121. "font_class": "heart-filled",
  1122. "unicode": "e641",
  1123. "unicode_decimal": 58945
  1124. }, {
  1125. "icon_id": "24841498",
  1126. "name": "mail-open",
  1127. "font_class": "mail-open",
  1128. "unicode": "e643",
  1129. "unicode_decimal": 58947
  1130. }, {
  1131. "icon_id": "24841488",
  1132. "name": "heart",
  1133. "font_class": "heart",
  1134. "unicode": "e639",
  1135. "unicode_decimal": 58937
  1136. }, {
  1137. "icon_id": "24839963",
  1138. "name": "loop",
  1139. "font_class": "loop",
  1140. "unicode": "e633",
  1141. "unicode_decimal": 58931
  1142. }, {
  1143. "icon_id": "24839866",
  1144. "name": "pulldown",
  1145. "font_class": "pulldown",
  1146. "unicode": "e632",
  1147. "unicode_decimal": 58930
  1148. }, {
  1149. "icon_id": "24813798",
  1150. "name": "scan",
  1151. "font_class": "scan",
  1152. "unicode": "e62a",
  1153. "unicode_decimal": 58922
  1154. }, {
  1155. "icon_id": "24813786",
  1156. "name": "bars",
  1157. "font_class": "bars",
  1158. "unicode": "e627",
  1159. "unicode_decimal": 58919
  1160. }, {
  1161. "icon_id": "24813788",
  1162. "name": "cart-filled",
  1163. "font_class": "cart-filled",
  1164. "unicode": "e629",
  1165. "unicode_decimal": 58921
  1166. }, {
  1167. "icon_id": "24813790",
  1168. "name": "checkbox",
  1169. "font_class": "checkbox",
  1170. "unicode": "e62b",
  1171. "unicode_decimal": 58923
  1172. }, {
  1173. "icon_id": "24813791",
  1174. "name": "checkbox-filled",
  1175. "font_class": "checkbox-filled",
  1176. "unicode": "e62c",
  1177. "unicode_decimal": 58924
  1178. }, {
  1179. "icon_id": "24813794",
  1180. "name": "shop",
  1181. "font_class": "shop",
  1182. "unicode": "e62f",
  1183. "unicode_decimal": 58927
  1184. }, {
  1185. "icon_id": "24813795",
  1186. "name": "headphones",
  1187. "font_class": "headphones",
  1188. "unicode": "e630",
  1189. "unicode_decimal": 58928
  1190. }, {
  1191. "icon_id": "24813796",
  1192. "name": "cart",
  1193. "font_class": "cart",
  1194. "unicode": "e631",
  1195. "unicode_decimal": 58929
  1196. }]
  1197. };
  1198. exports.default = _default;
  1199. /***/ }),
  1200. /***/ 18:
  1201. /*!******************************************************************!*\
  1202. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1203. \******************************************************************/
  1204. /*! no static exports found */
  1205. /***/ (function(module, exports, __webpack_require__) {
  1206. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1207. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1208. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1209. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1210. function _toConsumableArray(arr) {
  1211. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1212. }
  1213. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1214. /***/ }),
  1215. /***/ 19:
  1216. /*!******************************************************************!*\
  1217. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1218. \******************************************************************/
  1219. /*! no static exports found */
  1220. /***/ (function(module, exports, __webpack_require__) {
  1221. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1222. function _arrayWithoutHoles(arr) {
  1223. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1224. }
  1225. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1226. /***/ }),
  1227. /***/ 190:
  1228. /*!*************************************************************************************!*\
  1229. !*** D:/project/项目模板/uniapp/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  1230. \*************************************************************************************/
  1231. /*! no static exports found */
  1232. /***/ (function(module, exports, __webpack_require__) {
  1233. "use strict";
  1234. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1235. Object.defineProperty(exports, "__esModule", {
  1236. value: true
  1237. });
  1238. exports.default = void 0;
  1239. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  1240. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 191));
  1241. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 192));
  1242. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 194));
  1243. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  1244. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  1245. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  1246. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1247. 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); }; }
  1248. 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; } }
  1249. var pattern = {
  1250. email: /^\S+?@\S+?\.\S+?$/,
  1251. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  1252. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  1253. };
  1254. var FORMAT_MAPPING = {
  1255. "int": 'integer',
  1256. "bool": 'boolean',
  1257. "double": 'number',
  1258. "long": 'number',
  1259. "password": 'string'
  1260. // "fileurls": 'array'
  1261. };
  1262. function formatMessage(args) {
  1263. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  1264. var defaultMessage = ['label'];
  1265. defaultMessage.forEach(function (item) {
  1266. if (args[item] === undefined) {
  1267. args[item] = '';
  1268. }
  1269. });
  1270. var str = resources;
  1271. for (var key in args) {
  1272. var reg = new RegExp('{' + key + '}');
  1273. str = str.replace(reg, args[key]);
  1274. }
  1275. return str;
  1276. }
  1277. function isEmptyValue(value, type) {
  1278. if (value === undefined || value === null) {
  1279. return true;
  1280. }
  1281. if (typeof value === 'string' && !value) {
  1282. return true;
  1283. }
  1284. if (Array.isArray(value) && !value.length) {
  1285. return true;
  1286. }
  1287. if (type === 'object' && !Object.keys(value).length) {
  1288. return true;
  1289. }
  1290. return false;
  1291. }
  1292. var types = {
  1293. integer: function integer(value) {
  1294. return types.number(value) && parseInt(value, 10) === value;
  1295. },
  1296. string: function string(value) {
  1297. return typeof value === 'string';
  1298. },
  1299. number: function number(value) {
  1300. if (isNaN(value)) {
  1301. return false;
  1302. }
  1303. return typeof value === 'number';
  1304. },
  1305. "boolean": function boolean(value) {
  1306. return typeof value === 'boolean';
  1307. },
  1308. "float": function float(value) {
  1309. return types.number(value) && !types.integer(value);
  1310. },
  1311. array: function array(value) {
  1312. return Array.isArray(value);
  1313. },
  1314. object: function object(value) {
  1315. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  1316. },
  1317. date: function date(value) {
  1318. return value instanceof Date;
  1319. },
  1320. timestamp: function timestamp(value) {
  1321. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  1322. return false;
  1323. }
  1324. return true;
  1325. },
  1326. file: function file(value) {
  1327. return typeof value.url === 'string';
  1328. },
  1329. email: function email(value) {
  1330. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  1331. },
  1332. url: function url(value) {
  1333. return typeof value === 'string' && !!value.match(pattern.url);
  1334. },
  1335. pattern: function pattern(reg, value) {
  1336. try {
  1337. return new RegExp(reg).test(value);
  1338. } catch (e) {
  1339. return false;
  1340. }
  1341. },
  1342. method: function method(value) {
  1343. return typeof value === 'function';
  1344. },
  1345. idcard: function idcard(value) {
  1346. return typeof value === 'string' && !!value.match(pattern.idcard);
  1347. },
  1348. 'url-https': function urlHttps(value) {
  1349. return this.url(value) && value.startsWith('https://');
  1350. },
  1351. 'url-scheme': function urlScheme(value) {
  1352. return value.startsWith('://');
  1353. },
  1354. 'url-web': function urlWeb(value) {
  1355. return false;
  1356. }
  1357. };
  1358. var RuleValidator = /*#__PURE__*/function () {
  1359. function RuleValidator(message) {
  1360. (0, _classCallCheck2.default)(this, RuleValidator);
  1361. this._message = message;
  1362. }
  1363. (0, _createClass2.default)(RuleValidator, [{
  1364. key: "validateRule",
  1365. value: function () {
  1366. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  1367. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  1368. return _regenerator.default.wrap(function _callee$(_context) {
  1369. while (1) {
  1370. switch (_context.prev = _context.next) {
  1371. case 0:
  1372. result = null;
  1373. rules = fieldValue.rules;
  1374. hasRequired = rules.findIndex(function (item) {
  1375. return item.required;
  1376. });
  1377. if (!(hasRequired < 0)) {
  1378. _context.next = 8;
  1379. break;
  1380. }
  1381. if (!(value === null || value === undefined)) {
  1382. _context.next = 6;
  1383. break;
  1384. }
  1385. return _context.abrupt("return", result);
  1386. case 6:
  1387. if (!(typeof value === 'string' && !value.length)) {
  1388. _context.next = 8;
  1389. break;
  1390. }
  1391. return _context.abrupt("return", result);
  1392. case 8:
  1393. message = this._message;
  1394. if (!(rules === undefined)) {
  1395. _context.next = 11;
  1396. break;
  1397. }
  1398. return _context.abrupt("return", message['default']);
  1399. case 11:
  1400. i = 0;
  1401. case 12:
  1402. if (!(i < rules.length)) {
  1403. _context.next = 35;
  1404. break;
  1405. }
  1406. rule = rules[i];
  1407. vt = this._getValidateType(rule);
  1408. Object.assign(rule, {
  1409. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  1410. });
  1411. if (!RuleValidatorHelper[vt]) {
  1412. _context.next = 20;
  1413. break;
  1414. }
  1415. result = RuleValidatorHelper[vt](rule, value, message);
  1416. if (!(result != null)) {
  1417. _context.next = 20;
  1418. break;
  1419. }
  1420. return _context.abrupt("break", 35);
  1421. case 20:
  1422. if (!rule.validateExpr) {
  1423. _context.next = 26;
  1424. break;
  1425. }
  1426. now = Date.now();
  1427. resultExpr = rule.validateExpr(value, allData, now);
  1428. if (!(resultExpr === false)) {
  1429. _context.next = 26;
  1430. break;
  1431. }
  1432. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  1433. return _context.abrupt("break", 35);
  1434. case 26:
  1435. if (!rule.validateFunction) {
  1436. _context.next = 32;
  1437. break;
  1438. }
  1439. _context.next = 29;
  1440. return this.validateFunction(rule, value, data, allData, vt);
  1441. case 29:
  1442. result = _context.sent;
  1443. if (!(result !== null)) {
  1444. _context.next = 32;
  1445. break;
  1446. }
  1447. return _context.abrupt("break", 35);
  1448. case 32:
  1449. i++;
  1450. _context.next = 12;
  1451. break;
  1452. case 35:
  1453. if (result !== null) {
  1454. result = message.TAG + result;
  1455. }
  1456. return _context.abrupt("return", result);
  1457. case 37:
  1458. case "end":
  1459. return _context.stop();
  1460. }
  1461. }
  1462. }, _callee, this);
  1463. }));
  1464. function validateRule(_x, _x2, _x3, _x4, _x5) {
  1465. return _validateRule.apply(this, arguments);
  1466. }
  1467. return validateRule;
  1468. }()
  1469. }, {
  1470. key: "validateFunction",
  1471. value: function () {
  1472. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  1473. var result, callbackMessage, res;
  1474. return _regenerator.default.wrap(function _callee2$(_context2) {
  1475. while (1) {
  1476. switch (_context2.prev = _context2.next) {
  1477. case 0:
  1478. result = null;
  1479. _context2.prev = 1;
  1480. callbackMessage = null;
  1481. _context2.next = 5;
  1482. return rule.validateFunction(rule, value, allData || data, function (message) {
  1483. callbackMessage = message;
  1484. });
  1485. case 5:
  1486. res = _context2.sent;
  1487. if (callbackMessage || typeof res === 'string' && res || res === false) {
  1488. result = this._getMessage(rule, callbackMessage || res, vt);
  1489. }
  1490. _context2.next = 12;
  1491. break;
  1492. case 9:
  1493. _context2.prev = 9;
  1494. _context2.t0 = _context2["catch"](1);
  1495. result = this._getMessage(rule, _context2.t0.message, vt);
  1496. case 12:
  1497. return _context2.abrupt("return", result);
  1498. case 13:
  1499. case "end":
  1500. return _context2.stop();
  1501. }
  1502. }
  1503. }, _callee2, this, [[1, 9]]);
  1504. }));
  1505. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  1506. return _validateFunction.apply(this, arguments);
  1507. }
  1508. return validateFunction;
  1509. }()
  1510. }, {
  1511. key: "_getMessage",
  1512. value: function _getMessage(rule, message, vt) {
  1513. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  1514. }
  1515. }, {
  1516. key: "_getValidateType",
  1517. value: function _getValidateType(rule) {
  1518. var result = '';
  1519. if (rule.required) {
  1520. result = 'required';
  1521. } else if (rule.format) {
  1522. result = 'format';
  1523. } else if (rule.arrayType) {
  1524. result = 'arrayTypeFormat';
  1525. } else if (rule.range) {
  1526. result = 'range';
  1527. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  1528. result = 'rangeNumber';
  1529. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  1530. result = 'rangeLength';
  1531. } else if (rule.pattern) {
  1532. result = 'pattern';
  1533. } else if (rule.validateFunction) {
  1534. result = 'validateFunction';
  1535. }
  1536. return result;
  1537. }
  1538. }]);
  1539. return RuleValidator;
  1540. }();
  1541. var RuleValidatorHelper = {
  1542. required: function required(rule, value, message) {
  1543. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  1544. return formatMessage(rule, rule.errorMessage || message.required);
  1545. }
  1546. return null;
  1547. },
  1548. range: function range(rule, value, message) {
  1549. var range = rule.range,
  1550. errorMessage = rule.errorMessage;
  1551. var list = new Array(range.length);
  1552. for (var i = 0; i < range.length; i++) {
  1553. var item = range[i];
  1554. if (types.object(item) && item.value !== undefined) {
  1555. list[i] = item.value;
  1556. } else {
  1557. list[i] = item;
  1558. }
  1559. }
  1560. var result = false;
  1561. if (Array.isArray(value)) {
  1562. result = new Set(value.concat(list)).size === list.length;
  1563. } else {
  1564. if (list.indexOf(value) > -1) {
  1565. result = true;
  1566. }
  1567. }
  1568. if (!result) {
  1569. return formatMessage(rule, errorMessage || message['enum']);
  1570. }
  1571. return null;
  1572. },
  1573. rangeNumber: function rangeNumber(rule, value, message) {
  1574. if (!types.number(value)) {
  1575. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1576. }
  1577. var minimum = rule.minimum,
  1578. maximum = rule.maximum,
  1579. exclusiveMinimum = rule.exclusiveMinimum,
  1580. exclusiveMaximum = rule.exclusiveMaximum;
  1581. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  1582. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  1583. if (minimum !== undefined && min) {
  1584. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  1585. } else if (maximum !== undefined && max) {
  1586. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  1587. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  1588. return formatMessage(rule, rule.errorMessage || message['number'].range);
  1589. }
  1590. return null;
  1591. },
  1592. rangeLength: function rangeLength(rule, value, message) {
  1593. if (!types.string(value) && !types.array(value)) {
  1594. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1595. }
  1596. var min = rule.minLength;
  1597. var max = rule.maxLength;
  1598. var val = value.length;
  1599. if (min !== undefined && val < min) {
  1600. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  1601. } else if (max !== undefined && val > max) {
  1602. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  1603. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  1604. return formatMessage(rule, rule.errorMessage || message['length'].range);
  1605. }
  1606. return null;
  1607. },
  1608. pattern: function pattern(rule, value, message) {
  1609. if (!types['pattern'](rule.pattern, value)) {
  1610. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  1611. }
  1612. return null;
  1613. },
  1614. format: function format(rule, value, message) {
  1615. var customTypes = Object.keys(types);
  1616. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  1617. if (customTypes.indexOf(format) > -1) {
  1618. if (!types[format](value)) {
  1619. return formatMessage(rule, rule.errorMessage || message.typeError);
  1620. }
  1621. }
  1622. return null;
  1623. },
  1624. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  1625. if (!Array.isArray(value)) {
  1626. return formatMessage(rule, rule.errorMessage || message.typeError);
  1627. }
  1628. for (var i = 0; i < value.length; i++) {
  1629. var element = value[i];
  1630. var formatResult = this.format(rule, element, message);
  1631. if (formatResult !== null) {
  1632. return formatResult;
  1633. }
  1634. }
  1635. return null;
  1636. }
  1637. };
  1638. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  1639. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  1640. var _super = _createSuper(SchemaValidator);
  1641. function SchemaValidator(schema, options) {
  1642. var _this;
  1643. (0, _classCallCheck2.default)(this, SchemaValidator);
  1644. _this = _super.call(this, SchemaValidator.message);
  1645. _this._schema = schema;
  1646. _this._options = options || null;
  1647. return _this;
  1648. }
  1649. (0, _createClass2.default)(SchemaValidator, [{
  1650. key: "updateSchema",
  1651. value: function updateSchema(schema) {
  1652. this._schema = schema;
  1653. }
  1654. }, {
  1655. key: "validate",
  1656. value: function () {
  1657. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  1658. var result;
  1659. return _regenerator.default.wrap(function _callee3$(_context3) {
  1660. while (1) {
  1661. switch (_context3.prev = _context3.next) {
  1662. case 0:
  1663. result = this._checkFieldInSchema(data);
  1664. if (result) {
  1665. _context3.next = 5;
  1666. break;
  1667. }
  1668. _context3.next = 4;
  1669. return this.invokeValidate(data, false, allData);
  1670. case 4:
  1671. result = _context3.sent;
  1672. case 5:
  1673. return _context3.abrupt("return", result.length ? result[0] : null);
  1674. case 6:
  1675. case "end":
  1676. return _context3.stop();
  1677. }
  1678. }
  1679. }, _callee3, this);
  1680. }));
  1681. function validate(_x11, _x12) {
  1682. return _validate.apply(this, arguments);
  1683. }
  1684. return validate;
  1685. }()
  1686. }, {
  1687. key: "validateAll",
  1688. value: function () {
  1689. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  1690. var result;
  1691. return _regenerator.default.wrap(function _callee4$(_context4) {
  1692. while (1) {
  1693. switch (_context4.prev = _context4.next) {
  1694. case 0:
  1695. result = this._checkFieldInSchema(data);
  1696. if (result) {
  1697. _context4.next = 5;
  1698. break;
  1699. }
  1700. _context4.next = 4;
  1701. return this.invokeValidate(data, true, allData);
  1702. case 4:
  1703. result = _context4.sent;
  1704. case 5:
  1705. return _context4.abrupt("return", result);
  1706. case 6:
  1707. case "end":
  1708. return _context4.stop();
  1709. }
  1710. }
  1711. }, _callee4, this);
  1712. }));
  1713. function validateAll(_x13, _x14) {
  1714. return _validateAll.apply(this, arguments);
  1715. }
  1716. return validateAll;
  1717. }()
  1718. }, {
  1719. key: "validateUpdate",
  1720. value: function () {
  1721. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  1722. var result;
  1723. return _regenerator.default.wrap(function _callee5$(_context5) {
  1724. while (1) {
  1725. switch (_context5.prev = _context5.next) {
  1726. case 0:
  1727. result = this._checkFieldInSchema(data);
  1728. if (result) {
  1729. _context5.next = 5;
  1730. break;
  1731. }
  1732. _context5.next = 4;
  1733. return this.invokeValidateUpdate(data, false, allData);
  1734. case 4:
  1735. result = _context5.sent;
  1736. case 5:
  1737. return _context5.abrupt("return", result.length ? result[0] : null);
  1738. case 6:
  1739. case "end":
  1740. return _context5.stop();
  1741. }
  1742. }
  1743. }, _callee5, this);
  1744. }));
  1745. function validateUpdate(_x15, _x16) {
  1746. return _validateUpdate.apply(this, arguments);
  1747. }
  1748. return validateUpdate;
  1749. }()
  1750. }, {
  1751. key: "invokeValidate",
  1752. value: function () {
  1753. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  1754. var result, schema, key, value, errorMessage;
  1755. return _regenerator.default.wrap(function _callee6$(_context6) {
  1756. while (1) {
  1757. switch (_context6.prev = _context6.next) {
  1758. case 0:
  1759. result = [];
  1760. schema = this._schema;
  1761. _context6.t0 = _regenerator.default.keys(schema);
  1762. case 3:
  1763. if ((_context6.t1 = _context6.t0()).done) {
  1764. _context6.next = 15;
  1765. break;
  1766. }
  1767. key = _context6.t1.value;
  1768. value = schema[key];
  1769. _context6.next = 8;
  1770. return this.validateRule(key, value, data[key], data, allData);
  1771. case 8:
  1772. errorMessage = _context6.sent;
  1773. if (!(errorMessage != null)) {
  1774. _context6.next = 13;
  1775. break;
  1776. }
  1777. result.push({
  1778. key: key,
  1779. errorMessage: errorMessage
  1780. });
  1781. if (all) {
  1782. _context6.next = 13;
  1783. break;
  1784. }
  1785. return _context6.abrupt("break", 15);
  1786. case 13:
  1787. _context6.next = 3;
  1788. break;
  1789. case 15:
  1790. return _context6.abrupt("return", result);
  1791. case 16:
  1792. case "end":
  1793. return _context6.stop();
  1794. }
  1795. }
  1796. }, _callee6, this);
  1797. }));
  1798. function invokeValidate(_x17, _x18, _x19) {
  1799. return _invokeValidate.apply(this, arguments);
  1800. }
  1801. return invokeValidate;
  1802. }()
  1803. }, {
  1804. key: "invokeValidateUpdate",
  1805. value: function () {
  1806. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  1807. var result, key, errorMessage;
  1808. return _regenerator.default.wrap(function _callee7$(_context7) {
  1809. while (1) {
  1810. switch (_context7.prev = _context7.next) {
  1811. case 0:
  1812. result = [];
  1813. _context7.t0 = _regenerator.default.keys(data);
  1814. case 2:
  1815. if ((_context7.t1 = _context7.t0()).done) {
  1816. _context7.next = 13;
  1817. break;
  1818. }
  1819. key = _context7.t1.value;
  1820. _context7.next = 6;
  1821. return this.validateRule(key, this._schema[key], data[key], data, allData);
  1822. case 6:
  1823. errorMessage = _context7.sent;
  1824. if (!(errorMessage != null)) {
  1825. _context7.next = 11;
  1826. break;
  1827. }
  1828. result.push({
  1829. key: key,
  1830. errorMessage: errorMessage
  1831. });
  1832. if (all) {
  1833. _context7.next = 11;
  1834. break;
  1835. }
  1836. return _context7.abrupt("break", 13);
  1837. case 11:
  1838. _context7.next = 2;
  1839. break;
  1840. case 13:
  1841. return _context7.abrupt("return", result);
  1842. case 14:
  1843. case "end":
  1844. return _context7.stop();
  1845. }
  1846. }
  1847. }, _callee7, this);
  1848. }));
  1849. function invokeValidateUpdate(_x20, _x21, _x22) {
  1850. return _invokeValidateUpdate.apply(this, arguments);
  1851. }
  1852. return invokeValidateUpdate;
  1853. }()
  1854. }, {
  1855. key: "_checkFieldInSchema",
  1856. value: function _checkFieldInSchema(data) {
  1857. var keys = Object.keys(data);
  1858. var keys2 = Object.keys(this._schema);
  1859. if (new Set(keys.concat(keys2)).size === keys2.length) {
  1860. return '';
  1861. }
  1862. var noExistFields = keys.filter(function (key) {
  1863. return keys2.indexOf(key) < 0;
  1864. });
  1865. var errorMessage = formatMessage({
  1866. field: JSON.stringify(noExistFields)
  1867. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  1868. return [{
  1869. key: 'invalid',
  1870. errorMessage: errorMessage
  1871. }];
  1872. }
  1873. }]);
  1874. return SchemaValidator;
  1875. }(RuleValidator);
  1876. function Message() {
  1877. return {
  1878. TAG: "",
  1879. default: '验证错误',
  1880. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  1881. validateFunction: '验证无效',
  1882. required: '{label}必填',
  1883. 'enum': '{label}超出范围',
  1884. timestamp: '{label}格式无效',
  1885. whitespace: '{label}不能为空',
  1886. typeError: '{label}类型无效',
  1887. date: {
  1888. format: '{label}日期{value}格式无效',
  1889. parse: '{label}日期无法解析,{value}无效',
  1890. invalid: '{label}日期{value}无效'
  1891. },
  1892. length: {
  1893. minLength: '{label}长度不能少于{minLength}',
  1894. maxLength: '{label}长度不能超过{maxLength}',
  1895. range: '{label}必须介于{minLength}和{maxLength}之间'
  1896. },
  1897. number: {
  1898. minimum: '{label}不能小于{minimum}',
  1899. maximum: '{label}不能大于{maximum}',
  1900. exclusiveMinimum: '{label}不能小于等于{minimum}',
  1901. exclusiveMaximum: '{label}不能大于等于{maximum}',
  1902. range: '{label}必须介于{minimum}and{maximum}之间'
  1903. },
  1904. pattern: {
  1905. mismatch: '{label}格式不匹配'
  1906. }
  1907. };
  1908. }
  1909. SchemaValidator.message = new Message();
  1910. var _default = SchemaValidator;
  1911. exports.default = _default;
  1912. /***/ }),
  1913. /***/ 191:
  1914. /*!*********************************************************!*\
  1915. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  1916. \*********************************************************/
  1917. /*! no static exports found */
  1918. /***/ (function(module, exports, __webpack_require__) {
  1919. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1920. function _inherits(subClass, superClass) {
  1921. if (typeof superClass !== "function" && superClass !== null) {
  1922. throw new TypeError("Super expression must either be null or a function");
  1923. }
  1924. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1925. constructor: {
  1926. value: subClass,
  1927. writable: true,
  1928. configurable: true
  1929. }
  1930. });
  1931. Object.defineProperty(subClass, "prototype", {
  1932. writable: false
  1933. });
  1934. if (superClass) setPrototypeOf(subClass, superClass);
  1935. }
  1936. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1937. /***/ }),
  1938. /***/ 192:
  1939. /*!**************************************************************************!*\
  1940. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  1941. \**************************************************************************/
  1942. /*! no static exports found */
  1943. /***/ (function(module, exports, __webpack_require__) {
  1944. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  1945. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 193);
  1946. function _possibleConstructorReturn(self, call) {
  1947. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  1948. return call;
  1949. } else if (call !== void 0) {
  1950. throw new TypeError("Derived constructors may only return object or undefined");
  1951. }
  1952. return assertThisInitialized(self);
  1953. }
  1954. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1955. /***/ }),
  1956. /***/ 193:
  1957. /*!**********************************************************************!*\
  1958. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  1959. \**********************************************************************/
  1960. /*! no static exports found */
  1961. /***/ (function(module, exports) {
  1962. function _assertThisInitialized(self) {
  1963. if (self === void 0) {
  1964. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1965. }
  1966. return self;
  1967. }
  1968. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1969. /***/ }),
  1970. /***/ 194:
  1971. /*!***************************************************************!*\
  1972. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  1973. \***************************************************************/
  1974. /*! no static exports found */
  1975. /***/ (function(module, exports) {
  1976. function _getPrototypeOf(o) {
  1977. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  1978. return o.__proto__ || Object.getPrototypeOf(o);
  1979. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1980. return _getPrototypeOf(o);
  1981. }
  1982. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1983. /***/ }),
  1984. /***/ 195:
  1985. /*!**********************************************************************************!*\
  1986. !*** D:/project/项目模板/uniapp/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  1987. \**********************************************************************************/
  1988. /*! no static exports found */
  1989. /***/ (function(module, exports, __webpack_require__) {
  1990. "use strict";
  1991. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1992. Object.defineProperty(exports, "__esModule", {
  1993. value: true
  1994. });
  1995. exports.typeFilter = exports.type = exports.setDataValue = exports.realName = exports.rawData = exports.objSet = exports.objGet = exports.name2arr = exports.isRequiredField = exports.isRealName = exports.isNumber = exports.isEqual = exports.isBoolean = exports.getValue = exports.getDataValueType = exports.getDataValue = exports.deepCopy = void 0;
  1996. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1997. /**
  1998. * 简单处理对象拷贝
  1999. * @param {Obejct} 被拷贝对象
  2000. * @@return {Object} 拷贝对象
  2001. */
  2002. var deepCopy = function deepCopy(val) {
  2003. return JSON.parse(JSON.stringify(val));
  2004. };
  2005. /**
  2006. * 过滤数字类型
  2007. * @param {String} format 数字类型
  2008. * @@return {Boolean} 返回是否为数字类型
  2009. */
  2010. exports.deepCopy = deepCopy;
  2011. var typeFilter = function typeFilter(format) {
  2012. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  2013. };
  2014. /**
  2015. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  2016. * @param {String} key 字段名
  2017. * @param {any} value 字段值
  2018. * @param {Object} rules 表单校验规则
  2019. */
  2020. exports.typeFilter = typeFilter;
  2021. var getValue = function getValue(key, value, rules) {
  2022. var isRuleNumType = rules.find(function (val) {
  2023. return val.format && typeFilter(val.format);
  2024. });
  2025. var isRuleBoolType = rules.find(function (val) {
  2026. return val.format && val.format === 'boolean' || val.format === 'bool';
  2027. });
  2028. // 输入类型为 number
  2029. if (!!isRuleNumType) {
  2030. if (!value && value !== 0) {
  2031. value = null;
  2032. } else {
  2033. value = isNumber(Number(value)) ? Number(value) : value;
  2034. }
  2035. }
  2036. // 输入类型为 boolean
  2037. if (!!isRuleBoolType) {
  2038. value = isBoolean(value) ? value : false;
  2039. }
  2040. return value;
  2041. };
  2042. /**
  2043. * 获取表单数据
  2044. * @param {String|Array} name 真实名称,需要使用 realName 获取
  2045. * @param {Object} data 原始数据
  2046. * @param {any} value 需要设置的值
  2047. */
  2048. exports.getValue = getValue;
  2049. var setDataValue = function setDataValue(field, formdata, value) {
  2050. formdata[field] = value;
  2051. return value || '';
  2052. };
  2053. /**
  2054. * 获取表单数据
  2055. * @param {String|Array} field 真实名称,需要使用 realName 获取
  2056. * @param {Object} data 原始数据
  2057. */
  2058. exports.setDataValue = setDataValue;
  2059. var getDataValue = function getDataValue(field, data) {
  2060. return objGet(data, field);
  2061. };
  2062. /**
  2063. * 获取表单类型
  2064. * @param {String|Array} field 真实名称,需要使用 realName 获取
  2065. */
  2066. exports.getDataValue = getDataValue;
  2067. var getDataValueType = function getDataValueType(field, data) {
  2068. var value = getDataValue(field, data);
  2069. return {
  2070. type: type(value),
  2071. value: value
  2072. };
  2073. };
  2074. /**
  2075. * 获取表单可用的真实name
  2076. * @param {String|Array} name 表单name
  2077. * @@return {String} 表单可用的真实name
  2078. */
  2079. exports.getDataValueType = getDataValueType;
  2080. var realName = function realName(name) {
  2081. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2082. var base_name = _basePath(name);
  2083. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  2084. var realname = base_name.reduce(function (a, b) {
  2085. return a += "#".concat(b);
  2086. }, '_formdata_');
  2087. return realname;
  2088. }
  2089. return base_name[0] || name;
  2090. };
  2091. /**
  2092. * 判断是否表单可用的真实name
  2093. * @param {String|Array} name 表单name
  2094. * @@return {String} 表单可用的真实name
  2095. */
  2096. exports.realName = realName;
  2097. var isRealName = function isRealName(name) {
  2098. var reg = /^_formdata_#*/;
  2099. return reg.test(name);
  2100. };
  2101. /**
  2102. * 获取表单数据的原始格式
  2103. * @@return {Object|Array} object 需要解析的数据
  2104. */
  2105. exports.isRealName = isRealName;
  2106. var rawData = function rawData() {
  2107. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2108. var name = arguments.length > 1 ? arguments[1] : undefined;
  2109. var newData = JSON.parse(JSON.stringify(object));
  2110. var formData = {};
  2111. for (var i in newData) {
  2112. var path = name2arr(i);
  2113. objSet(formData, path, newData[i]);
  2114. }
  2115. return formData;
  2116. };
  2117. /**
  2118. * 真实name还原为 array
  2119. * @param {*} name
  2120. */
  2121. exports.rawData = rawData;
  2122. var name2arr = function name2arr(name) {
  2123. var field = name.replace('_formdata_#', '');
  2124. field = field.split('#').map(function (v) {
  2125. return isNumber(v) ? Number(v) : v;
  2126. });
  2127. return field;
  2128. };
  2129. /**
  2130. * 对象中设置值
  2131. * @param {Object|Array} object 源数据
  2132. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  2133. * @param {String} value 需要设置的值
  2134. */
  2135. exports.name2arr = name2arr;
  2136. var objSet = function objSet(object, path, value) {
  2137. if ((0, _typeof2.default)(object) !== 'object') return object;
  2138. _basePath(path).reduce(function (o, k, i, _) {
  2139. if (i === _.length - 1) {
  2140. // 若遍历结束直接赋值
  2141. o[k] = value;
  2142. return null;
  2143. } else if (k in o) {
  2144. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  2145. return o[k];
  2146. } else {
  2147. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  2148. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  2149. return o[k];
  2150. }
  2151. }, object);
  2152. // 返回object
  2153. return object;
  2154. };
  2155. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  2156. exports.objSet = objSet;
  2157. function _basePath(path) {
  2158. // 若是数组,则直接返回
  2159. if (Array.isArray(path)) return path;
  2160. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  2161. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  2162. }
  2163. /**
  2164. * 从对象中获取值
  2165. * @param {Object|Array} object 源数据
  2166. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  2167. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  2168. */
  2169. var objGet = function objGet(object, path) {
  2170. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  2171. // 先将path处理成统一格式
  2172. var newPath = _basePath(path);
  2173. // 递归处理,返回最后结果
  2174. var val = newPath.reduce(function (o, k) {
  2175. return (o || {})[k];
  2176. }, object);
  2177. return !val || val !== undefined ? val : defaultVal;
  2178. };
  2179. /**
  2180. * 是否为 number 类型
  2181. * @param {any} num 需要判断的值
  2182. * @return {Boolean} 是否为 number
  2183. */
  2184. exports.objGet = objGet;
  2185. var isNumber = function isNumber(num) {
  2186. return !isNaN(Number(num));
  2187. };
  2188. /**
  2189. * 是否为 boolean 类型
  2190. * @param {any} bool 需要判断的值
  2191. * @return {Boolean} 是否为 boolean
  2192. */
  2193. exports.isNumber = isNumber;
  2194. var isBoolean = function isBoolean(bool) {
  2195. return typeof bool === 'boolean';
  2196. };
  2197. /**
  2198. * 是否有必填字段
  2199. * @param {Object} rules 规则
  2200. * @return {Boolean} 是否有必填字段
  2201. */
  2202. exports.isBoolean = isBoolean;
  2203. var isRequiredField = function isRequiredField(rules) {
  2204. var isNoField = false;
  2205. for (var i = 0; i < rules.length; i++) {
  2206. var ruleData = rules[i];
  2207. if (ruleData.required) {
  2208. isNoField = true;
  2209. break;
  2210. }
  2211. }
  2212. return isNoField;
  2213. };
  2214. /**
  2215. * 获取数据类型
  2216. * @param {Any} obj 需要获取数据类型的值
  2217. */
  2218. exports.isRequiredField = isRequiredField;
  2219. var type = function type(obj) {
  2220. var class2type = {};
  2221. // 生成class2type映射
  2222. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  2223. class2type["[object " + item + "]"] = item.toLowerCase();
  2224. });
  2225. if (obj == null) {
  2226. return obj + "";
  2227. }
  2228. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  2229. };
  2230. /**
  2231. * 判断两个值是否相等
  2232. * @param {any} a 值
  2233. * @param {any} b 值
  2234. * @return {Boolean} 是否相等
  2235. */
  2236. exports.type = type;
  2237. var isEqual = function isEqual(a, b) {
  2238. //如果a和b本来就全等
  2239. if (a === b) {
  2240. //判断是否为0和-0
  2241. return a !== 0 || 1 / a === 1 / b;
  2242. }
  2243. //判断是否为null和undefined
  2244. if (a == null || b == null) {
  2245. return a === b;
  2246. }
  2247. //接下来判断a和b的数据类型
  2248. var classNameA = toString.call(a),
  2249. classNameB = toString.call(b);
  2250. //如果数据类型不相等,则返回false
  2251. if (classNameA !== classNameB) {
  2252. return false;
  2253. }
  2254. //如果数据类型相等,再根据不同数据类型分别判断
  2255. switch (classNameA) {
  2256. case '[object RegExp]':
  2257. case '[object String]':
  2258. //进行字符串转换比较
  2259. return '' + a === '' + b;
  2260. case '[object Number]':
  2261. //进行数字转换比较,判断是否为NaN
  2262. if (+a !== +a) {
  2263. return +b !== +b;
  2264. }
  2265. //判断是否为0或-0
  2266. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  2267. case '[object Date]':
  2268. case '[object Boolean]':
  2269. return +a === +b;
  2270. }
  2271. //如果是对象类型
  2272. if (classNameA == '[object Object]') {
  2273. //获取a和b的属性长度
  2274. var propsA = Object.getOwnPropertyNames(a),
  2275. propsB = Object.getOwnPropertyNames(b);
  2276. if (propsA.length != propsB.length) {
  2277. return false;
  2278. }
  2279. for (var i = 0; i < propsA.length; i++) {
  2280. var propName = propsA[i];
  2281. //如果对应属性对应值不相等,则返回false
  2282. if (a[propName] !== b[propName]) {
  2283. return false;
  2284. }
  2285. }
  2286. return true;
  2287. }
  2288. //如果是数组类型
  2289. if (classNameA == '[object Array]') {
  2290. if (a.toString() == b.toString()) {
  2291. return true;
  2292. }
  2293. return false;
  2294. }
  2295. };
  2296. exports.isEqual = isEqual;
  2297. /***/ }),
  2298. /***/ 2:
  2299. /*!************************************************************!*\
  2300. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  2301. \************************************************************/
  2302. /*! no static exports found */
  2303. /***/ (function(module, exports, __webpack_require__) {
  2304. "use strict";
  2305. /* WEBPACK VAR INJECTION */(function(wx, global) {
  2306. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2307. Object.defineProperty(exports, "__esModule", {
  2308. value: true
  2309. });
  2310. exports.createApp = createApp;
  2311. exports.createComponent = createComponent;
  2312. exports.createPage = createPage;
  2313. exports.createPlugin = createPlugin;
  2314. exports.createSubpackageApp = createSubpackageApp;
  2315. exports.default = void 0;
  2316. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2317. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  2318. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  2319. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  2320. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2321. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  2322. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  2323. 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; }
  2324. 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; }
  2325. var realAtob;
  2326. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  2327. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  2328. if (typeof atob !== 'function') {
  2329. realAtob = function realAtob(str) {
  2330. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  2331. if (!b64re.test(str)) {
  2332. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  2333. }
  2334. // Adding the padding if missing, for semplicity
  2335. str += '=='.slice(2 - (str.length & 3));
  2336. var bitmap;
  2337. var result = '';
  2338. var r1;
  2339. var r2;
  2340. var i = 0;
  2341. for (; i < str.length;) {
  2342. 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++)));
  2343. 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);
  2344. }
  2345. return result;
  2346. };
  2347. } else {
  2348. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  2349. realAtob = atob;
  2350. }
  2351. function b64DecodeUnicode(str) {
  2352. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  2353. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  2354. }).join(''));
  2355. }
  2356. function getCurrentUserInfo() {
  2357. var token = wx.getStorageSync('uni_id_token') || '';
  2358. var tokenArr = token.split('.');
  2359. if (!token || tokenArr.length !== 3) {
  2360. return {
  2361. uid: null,
  2362. role: [],
  2363. permission: [],
  2364. tokenExpired: 0
  2365. };
  2366. }
  2367. var userInfo;
  2368. try {
  2369. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  2370. } catch (error) {
  2371. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  2372. }
  2373. userInfo.tokenExpired = userInfo.exp * 1000;
  2374. delete userInfo.exp;
  2375. delete userInfo.iat;
  2376. return userInfo;
  2377. }
  2378. function uniIdMixin(Vue) {
  2379. Vue.prototype.uniIDHasRole = function (roleId) {
  2380. var _getCurrentUserInfo = getCurrentUserInfo(),
  2381. role = _getCurrentUserInfo.role;
  2382. return role.indexOf(roleId) > -1;
  2383. };
  2384. Vue.prototype.uniIDHasPermission = function (permissionId) {
  2385. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  2386. permission = _getCurrentUserInfo2.permission;
  2387. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  2388. };
  2389. Vue.prototype.uniIDTokenValid = function () {
  2390. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  2391. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  2392. return tokenExpired > Date.now();
  2393. };
  2394. }
  2395. var _toString = Object.prototype.toString;
  2396. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2397. function isFn(fn) {
  2398. return typeof fn === 'function';
  2399. }
  2400. function isStr(str) {
  2401. return typeof str === 'string';
  2402. }
  2403. function isObject(obj) {
  2404. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  2405. }
  2406. function isPlainObject(obj) {
  2407. return _toString.call(obj) === '[object Object]';
  2408. }
  2409. function hasOwn(obj, key) {
  2410. return hasOwnProperty.call(obj, key);
  2411. }
  2412. function noop() {}
  2413. /**
  2414. * Create a cached version of a pure function.
  2415. */
  2416. function cached(fn) {
  2417. var cache = Object.create(null);
  2418. return function cachedFn(str) {
  2419. var hit = cache[str];
  2420. return hit || (cache[str] = fn(str));
  2421. };
  2422. }
  2423. /**
  2424. * Camelize a hyphen-delimited string.
  2425. */
  2426. var camelizeRE = /-(\w)/g;
  2427. var camelize = cached(function (str) {
  2428. return str.replace(camelizeRE, function (_, c) {
  2429. return c ? c.toUpperCase() : '';
  2430. });
  2431. });
  2432. function sortObject(obj) {
  2433. var sortObj = {};
  2434. if (isPlainObject(obj)) {
  2435. Object.keys(obj).sort().forEach(function (key) {
  2436. sortObj[key] = obj[key];
  2437. });
  2438. }
  2439. return !Object.keys(sortObj) ? obj : sortObj;
  2440. }
  2441. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  2442. var globalInterceptors = {};
  2443. var scopedInterceptors = {};
  2444. function mergeHook(parentVal, childVal) {
  2445. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  2446. return res ? dedupeHooks(res) : res;
  2447. }
  2448. function dedupeHooks(hooks) {
  2449. var res = [];
  2450. for (var i = 0; i < hooks.length; i++) {
  2451. if (res.indexOf(hooks[i]) === -1) {
  2452. res.push(hooks[i]);
  2453. }
  2454. }
  2455. return res;
  2456. }
  2457. function removeHook(hooks, hook) {
  2458. var index = hooks.indexOf(hook);
  2459. if (index !== -1) {
  2460. hooks.splice(index, 1);
  2461. }
  2462. }
  2463. function mergeInterceptorHook(interceptor, option) {
  2464. Object.keys(option).forEach(function (hook) {
  2465. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  2466. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  2467. }
  2468. });
  2469. }
  2470. function removeInterceptorHook(interceptor, option) {
  2471. if (!interceptor || !option) {
  2472. return;
  2473. }
  2474. Object.keys(option).forEach(function (hook) {
  2475. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  2476. removeHook(interceptor[hook], option[hook]);
  2477. }
  2478. });
  2479. }
  2480. function addInterceptor(method, option) {
  2481. if (typeof method === 'string' && isPlainObject(option)) {
  2482. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  2483. } else if (isPlainObject(method)) {
  2484. mergeInterceptorHook(globalInterceptors, method);
  2485. }
  2486. }
  2487. function removeInterceptor(method, option) {
  2488. if (typeof method === 'string') {
  2489. if (isPlainObject(option)) {
  2490. removeInterceptorHook(scopedInterceptors[method], option);
  2491. } else {
  2492. delete scopedInterceptors[method];
  2493. }
  2494. } else if (isPlainObject(method)) {
  2495. removeInterceptorHook(globalInterceptors, method);
  2496. }
  2497. }
  2498. function wrapperHook(hook) {
  2499. return function (data) {
  2500. return hook(data) || data;
  2501. };
  2502. }
  2503. function isPromise(obj) {
  2504. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  2505. }
  2506. function queue(hooks, data) {
  2507. var promise = false;
  2508. for (var i = 0; i < hooks.length; i++) {
  2509. var hook = hooks[i];
  2510. if (promise) {
  2511. promise = Promise.resolve(wrapperHook(hook));
  2512. } else {
  2513. var res = hook(data);
  2514. if (isPromise(res)) {
  2515. promise = Promise.resolve(res);
  2516. }
  2517. if (res === false) {
  2518. return {
  2519. then: function then() {}
  2520. };
  2521. }
  2522. }
  2523. }
  2524. return promise || {
  2525. then: function then(callback) {
  2526. return callback(data);
  2527. }
  2528. };
  2529. }
  2530. function wrapperOptions(interceptor) {
  2531. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2532. ['success', 'fail', 'complete'].forEach(function (name) {
  2533. if (Array.isArray(interceptor[name])) {
  2534. var oldCallback = options[name];
  2535. options[name] = function callbackInterceptor(res) {
  2536. queue(interceptor[name], res).then(function (res) {
  2537. /* eslint-disable no-mixed-operators */
  2538. return isFn(oldCallback) && oldCallback(res) || res;
  2539. });
  2540. };
  2541. }
  2542. });
  2543. return options;
  2544. }
  2545. function wrapperReturnValue(method, returnValue) {
  2546. var returnValueHooks = [];
  2547. if (Array.isArray(globalInterceptors.returnValue)) {
  2548. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  2549. }
  2550. var interceptor = scopedInterceptors[method];
  2551. if (interceptor && Array.isArray(interceptor.returnValue)) {
  2552. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  2553. }
  2554. returnValueHooks.forEach(function (hook) {
  2555. returnValue = hook(returnValue) || returnValue;
  2556. });
  2557. return returnValue;
  2558. }
  2559. function getApiInterceptorHooks(method) {
  2560. var interceptor = Object.create(null);
  2561. Object.keys(globalInterceptors).forEach(function (hook) {
  2562. if (hook !== 'returnValue') {
  2563. interceptor[hook] = globalInterceptors[hook].slice();
  2564. }
  2565. });
  2566. var scopedInterceptor = scopedInterceptors[method];
  2567. if (scopedInterceptor) {
  2568. Object.keys(scopedInterceptor).forEach(function (hook) {
  2569. if (hook !== 'returnValue') {
  2570. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  2571. }
  2572. });
  2573. }
  2574. return interceptor;
  2575. }
  2576. function invokeApi(method, api, options) {
  2577. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  2578. params[_key - 3] = arguments[_key];
  2579. }
  2580. var interceptor = getApiInterceptorHooks(method);
  2581. if (interceptor && Object.keys(interceptor).length) {
  2582. if (Array.isArray(interceptor.invoke)) {
  2583. var res = queue(interceptor.invoke, options);
  2584. return res.then(function (options) {
  2585. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  2586. });
  2587. } else {
  2588. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  2589. }
  2590. }
  2591. return api.apply(void 0, [options].concat(params));
  2592. }
  2593. var promiseInterceptor = {
  2594. returnValue: function returnValue(res) {
  2595. if (!isPromise(res)) {
  2596. return res;
  2597. }
  2598. return new Promise(function (resolve, reject) {
  2599. res.then(function (res) {
  2600. if (res[0]) {
  2601. reject(res[0]);
  2602. } else {
  2603. resolve(res[1]);
  2604. }
  2605. });
  2606. });
  2607. }
  2608. };
  2609. 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/;
  2610. var CONTEXT_API_RE = /^create|Manager$/;
  2611. // Context例外情况
  2612. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  2613. // 同步例外情况
  2614. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  2615. var CALLBACK_API_RE = /^on|^off/;
  2616. function isContextApi(name) {
  2617. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  2618. }
  2619. function isSyncApi(name) {
  2620. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  2621. }
  2622. function isCallbackApi(name) {
  2623. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  2624. }
  2625. function handlePromise(promise) {
  2626. return promise.then(function (data) {
  2627. return [null, data];
  2628. }).catch(function (err) {
  2629. return [err];
  2630. });
  2631. }
  2632. function shouldPromise(name) {
  2633. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  2634. return false;
  2635. }
  2636. return true;
  2637. }
  2638. /* eslint-disable no-extend-native */
  2639. if (!Promise.prototype.finally) {
  2640. Promise.prototype.finally = function (callback) {
  2641. var promise = this.constructor;
  2642. return this.then(function (value) {
  2643. return promise.resolve(callback()).then(function () {
  2644. return value;
  2645. });
  2646. }, function (reason) {
  2647. return promise.resolve(callback()).then(function () {
  2648. throw reason;
  2649. });
  2650. });
  2651. };
  2652. }
  2653. function promisify(name, api) {
  2654. if (!shouldPromise(name) || !isFn(api)) {
  2655. return api;
  2656. }
  2657. return function promiseApi() {
  2658. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2659. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  2660. params[_key2 - 1] = arguments[_key2];
  2661. }
  2662. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  2663. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  2664. }
  2665. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  2666. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  2667. success: resolve,
  2668. fail: reject
  2669. })].concat(params));
  2670. })));
  2671. };
  2672. }
  2673. var EPS = 1e-4;
  2674. var BASE_DEVICE_WIDTH = 750;
  2675. var isIOS = false;
  2676. var deviceWidth = 0;
  2677. var deviceDPR = 0;
  2678. function checkDeviceWidth() {
  2679. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  2680. platform = _wx$getSystemInfoSync.platform,
  2681. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  2682. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  2683. deviceWidth = windowWidth;
  2684. deviceDPR = pixelRatio;
  2685. isIOS = platform === 'ios';
  2686. }
  2687. function upx2px(number, newDeviceWidth) {
  2688. if (deviceWidth === 0) {
  2689. checkDeviceWidth();
  2690. }
  2691. number = Number(number);
  2692. if (number === 0) {
  2693. return 0;
  2694. }
  2695. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  2696. if (result < 0) {
  2697. result = -result;
  2698. }
  2699. result = Math.floor(result + EPS);
  2700. if (result === 0) {
  2701. if (deviceDPR === 1 || !isIOS) {
  2702. result = 1;
  2703. } else {
  2704. result = 0.5;
  2705. }
  2706. }
  2707. return number < 0 ? -result : result;
  2708. }
  2709. var LOCALE_ZH_HANS = 'zh-Hans';
  2710. var LOCALE_ZH_HANT = 'zh-Hant';
  2711. var LOCALE_EN = 'en';
  2712. var LOCALE_FR = 'fr';
  2713. var LOCALE_ES = 'es';
  2714. var messages = {};
  2715. var locale;
  2716. {
  2717. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  2718. }
  2719. function initI18nMessages() {
  2720. if (!isEnableLocale()) {
  2721. return;
  2722. }
  2723. var localeKeys = Object.keys(__uniConfig.locales);
  2724. if (localeKeys.length) {
  2725. localeKeys.forEach(function (locale) {
  2726. var curMessages = messages[locale];
  2727. var userMessages = __uniConfig.locales[locale];
  2728. if (curMessages) {
  2729. Object.assign(curMessages, userMessages);
  2730. } else {
  2731. messages[locale] = userMessages;
  2732. }
  2733. });
  2734. }
  2735. }
  2736. initI18nMessages();
  2737. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  2738. var t = i18n.t;
  2739. var i18nMixin = i18n.mixin = {
  2740. beforeCreate: function beforeCreate() {
  2741. var _this = this;
  2742. var unwatch = i18n.i18n.watchLocale(function () {
  2743. _this.$forceUpdate();
  2744. });
  2745. this.$once('hook:beforeDestroy', function () {
  2746. unwatch();
  2747. });
  2748. },
  2749. methods: {
  2750. $$t: function $$t(key, values) {
  2751. return t(key, values);
  2752. }
  2753. }
  2754. };
  2755. var setLocale = i18n.setLocale;
  2756. var getLocale = i18n.getLocale;
  2757. function initAppLocale(Vue, appVm, locale) {
  2758. var state = Vue.observable({
  2759. locale: locale || i18n.getLocale()
  2760. });
  2761. var localeWatchers = [];
  2762. appVm.$watchLocale = function (fn) {
  2763. localeWatchers.push(fn);
  2764. };
  2765. Object.defineProperty(appVm, '$locale', {
  2766. get: function get() {
  2767. return state.locale;
  2768. },
  2769. set: function set(v) {
  2770. state.locale = v;
  2771. localeWatchers.forEach(function (watch) {
  2772. return watch(v);
  2773. });
  2774. }
  2775. });
  2776. }
  2777. function isEnableLocale() {
  2778. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  2779. }
  2780. function include(str, parts) {
  2781. return !!parts.find(function (part) {
  2782. return str.indexOf(part) !== -1;
  2783. });
  2784. }
  2785. function startsWith(str, parts) {
  2786. return parts.find(function (part) {
  2787. return str.indexOf(part) === 0;
  2788. });
  2789. }
  2790. function normalizeLocale(locale, messages) {
  2791. if (!locale) {
  2792. return;
  2793. }
  2794. locale = locale.trim().replace(/_/g, '-');
  2795. if (messages && messages[locale]) {
  2796. return locale;
  2797. }
  2798. locale = locale.toLowerCase();
  2799. if (locale === 'chinese') {
  2800. // 支付宝
  2801. return LOCALE_ZH_HANS;
  2802. }
  2803. if (locale.indexOf('zh') === 0) {
  2804. if (locale.indexOf('-hans') > -1) {
  2805. return LOCALE_ZH_HANS;
  2806. }
  2807. if (locale.indexOf('-hant') > -1) {
  2808. return LOCALE_ZH_HANT;
  2809. }
  2810. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2811. return LOCALE_ZH_HANT;
  2812. }
  2813. return LOCALE_ZH_HANS;
  2814. }
  2815. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2816. if (lang) {
  2817. return lang;
  2818. }
  2819. }
  2820. // export function initI18n() {
  2821. // const localeKeys = Object.keys(__uniConfig.locales || {})
  2822. // if (localeKeys.length) {
  2823. // localeKeys.forEach((locale) =>
  2824. // i18n.add(locale, __uniConfig.locales[locale])
  2825. // )
  2826. // }
  2827. // }
  2828. function getLocale$1() {
  2829. // 优先使用 $locale
  2830. if (isFn(getApp)) {
  2831. var app = getApp({
  2832. allowDefault: true
  2833. });
  2834. if (app && app.$vm) {
  2835. return app.$vm.$locale;
  2836. }
  2837. }
  2838. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  2839. }
  2840. function setLocale$1(locale) {
  2841. var app = isFn(getApp) ? getApp() : false;
  2842. if (!app) {
  2843. return false;
  2844. }
  2845. var oldLocale = app.$vm.$locale;
  2846. if (oldLocale !== locale) {
  2847. app.$vm.$locale = locale;
  2848. onLocaleChangeCallbacks.forEach(function (fn) {
  2849. return fn({
  2850. locale: locale
  2851. });
  2852. });
  2853. return true;
  2854. }
  2855. return false;
  2856. }
  2857. var onLocaleChangeCallbacks = [];
  2858. function onLocaleChange(fn) {
  2859. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  2860. onLocaleChangeCallbacks.push(fn);
  2861. }
  2862. }
  2863. if (typeof global !== 'undefined') {
  2864. global.getLocale = getLocale$1;
  2865. }
  2866. var interceptors = {
  2867. promiseInterceptor: promiseInterceptor
  2868. };
  2869. var baseApi = /*#__PURE__*/Object.freeze({
  2870. __proto__: null,
  2871. upx2px: upx2px,
  2872. getLocale: getLocale$1,
  2873. setLocale: setLocale$1,
  2874. onLocaleChange: onLocaleChange,
  2875. addInterceptor: addInterceptor,
  2876. removeInterceptor: removeInterceptor,
  2877. interceptors: interceptors
  2878. });
  2879. function findExistsPageIndex(url) {
  2880. var pages = getCurrentPages();
  2881. var len = pages.length;
  2882. while (len--) {
  2883. var page = pages[len];
  2884. if (page.$page && page.$page.fullPath === url) {
  2885. return len;
  2886. }
  2887. }
  2888. return -1;
  2889. }
  2890. var redirectTo = {
  2891. name: function name(fromArgs) {
  2892. if (fromArgs.exists === 'back' && fromArgs.delta) {
  2893. return 'navigateBack';
  2894. }
  2895. return 'redirectTo';
  2896. },
  2897. args: function args(fromArgs) {
  2898. if (fromArgs.exists === 'back' && fromArgs.url) {
  2899. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  2900. if (existsPageIndex !== -1) {
  2901. var delta = getCurrentPages().length - 1 - existsPageIndex;
  2902. if (delta > 0) {
  2903. fromArgs.delta = delta;
  2904. }
  2905. }
  2906. }
  2907. }
  2908. };
  2909. var previewImage = {
  2910. args: function args(fromArgs) {
  2911. var currentIndex = parseInt(fromArgs.current);
  2912. if (isNaN(currentIndex)) {
  2913. return;
  2914. }
  2915. var urls = fromArgs.urls;
  2916. if (!Array.isArray(urls)) {
  2917. return;
  2918. }
  2919. var len = urls.length;
  2920. if (!len) {
  2921. return;
  2922. }
  2923. if (currentIndex < 0) {
  2924. currentIndex = 0;
  2925. } else if (currentIndex >= len) {
  2926. currentIndex = len - 1;
  2927. }
  2928. if (currentIndex > 0) {
  2929. fromArgs.current = urls[currentIndex];
  2930. fromArgs.urls = urls.filter(function (item, index) {
  2931. return index < currentIndex ? item !== urls[currentIndex] : true;
  2932. });
  2933. } else {
  2934. fromArgs.current = urls[0];
  2935. }
  2936. return {
  2937. indicator: false,
  2938. loop: false
  2939. };
  2940. }
  2941. };
  2942. var UUID_KEY = '__DC_STAT_UUID';
  2943. var deviceId;
  2944. function useDeviceId(result) {
  2945. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  2946. if (!deviceId) {
  2947. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  2948. wx.setStorage({
  2949. key: UUID_KEY,
  2950. data: deviceId
  2951. });
  2952. }
  2953. result.deviceId = deviceId;
  2954. }
  2955. function addSafeAreaInsets(result) {
  2956. if (result.safeArea) {
  2957. var safeArea = result.safeArea;
  2958. result.safeAreaInsets = {
  2959. top: safeArea.top,
  2960. left: safeArea.left,
  2961. right: result.windowWidth - safeArea.right,
  2962. bottom: result.screenHeight - safeArea.bottom
  2963. };
  2964. }
  2965. }
  2966. function populateParameters(result) {
  2967. var _result$brand = result.brand,
  2968. brand = _result$brand === void 0 ? '' : _result$brand,
  2969. _result$model = result.model,
  2970. model = _result$model === void 0 ? '' : _result$model,
  2971. _result$system = result.system,
  2972. system = _result$system === void 0 ? '' : _result$system,
  2973. _result$language = result.language,
  2974. language = _result$language === void 0 ? '' : _result$language,
  2975. theme = result.theme,
  2976. version = result.version,
  2977. platform = result.platform,
  2978. fontSizeSetting = result.fontSizeSetting,
  2979. SDKVersion = result.SDKVersion,
  2980. pixelRatio = result.pixelRatio,
  2981. deviceOrientation = result.deviceOrientation;
  2982. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  2983. var extraParam = {};
  2984. // osName osVersion
  2985. var osName = '';
  2986. var osVersion = '';
  2987. {
  2988. osName = system.split(' ')[0] || '';
  2989. osVersion = system.split(' ')[1] || '';
  2990. }
  2991. var hostVersion = version;
  2992. // deviceType
  2993. var deviceType = getGetDeviceType(result, model);
  2994. // deviceModel
  2995. var deviceBrand = getDeviceBrand(brand);
  2996. // hostName
  2997. var _hostName = getHostName(result);
  2998. // deviceOrientation
  2999. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  3000. // devicePixelRatio
  3001. var _devicePixelRatio = pixelRatio;
  3002. // SDKVersion
  3003. var _SDKVersion = SDKVersion;
  3004. // hostLanguage
  3005. var hostLanguage = language.replace(/_/g, '-');
  3006. // wx.getAccountInfoSync
  3007. var parameters = {
  3008. appId: "__UNI__2080341",
  3009. appName: "益智游戏",
  3010. appVersion: "1.1.1",
  3011. appVersionCode: "111",
  3012. appLanguage: getAppLanguage(hostLanguage),
  3013. uniCompileVersion: "3.7.3",
  3014. uniRuntimeVersion: "3.7.3",
  3015. uniPlatform: undefined || "mp-weixin",
  3016. deviceBrand: deviceBrand,
  3017. deviceModel: model,
  3018. deviceType: deviceType,
  3019. devicePixelRatio: _devicePixelRatio,
  3020. deviceOrientation: _deviceOrientation,
  3021. osName: osName.toLocaleLowerCase(),
  3022. osVersion: osVersion,
  3023. hostTheme: theme,
  3024. hostVersion: hostVersion,
  3025. hostLanguage: hostLanguage,
  3026. hostName: _hostName,
  3027. hostSDKVersion: _SDKVersion,
  3028. hostFontSizeSetting: fontSizeSetting,
  3029. windowTop: 0,
  3030. windowBottom: 0,
  3031. // TODO
  3032. osLanguage: undefined,
  3033. osTheme: undefined,
  3034. ua: undefined,
  3035. hostPackageName: undefined,
  3036. browserName: undefined,
  3037. browserVersion: undefined
  3038. };
  3039. Object.assign(result, parameters, extraParam);
  3040. }
  3041. function getGetDeviceType(result, model) {
  3042. var deviceType = result.deviceType || 'phone';
  3043. {
  3044. var deviceTypeMaps = {
  3045. ipad: 'pad',
  3046. windows: 'pc',
  3047. mac: 'pc'
  3048. };
  3049. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  3050. var _model = model.toLocaleLowerCase();
  3051. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  3052. var _m = deviceTypeMapsKeys[index];
  3053. if (_model.indexOf(_m) !== -1) {
  3054. deviceType = deviceTypeMaps[_m];
  3055. break;
  3056. }
  3057. }
  3058. }
  3059. return deviceType;
  3060. }
  3061. function getDeviceBrand(brand) {
  3062. var deviceBrand = brand;
  3063. if (deviceBrand) {
  3064. deviceBrand = brand.toLocaleLowerCase();
  3065. }
  3066. return deviceBrand;
  3067. }
  3068. function getAppLanguage(defaultLanguage) {
  3069. return getLocale$1 ? getLocale$1() : defaultLanguage;
  3070. }
  3071. function getHostName(result) {
  3072. var _platform = 'WeChat';
  3073. var _hostName = result.hostName || _platform; // mp-jd
  3074. {
  3075. if (result.environment) {
  3076. _hostName = result.environment;
  3077. } else if (result.host && result.host.env) {
  3078. _hostName = result.host.env;
  3079. }
  3080. }
  3081. return _hostName;
  3082. }
  3083. var getSystemInfo = {
  3084. returnValue: function returnValue(result) {
  3085. useDeviceId(result);
  3086. addSafeAreaInsets(result);
  3087. populateParameters(result);
  3088. }
  3089. };
  3090. var showActionSheet = {
  3091. args: function args(fromArgs) {
  3092. if ((0, _typeof2.default)(fromArgs) === 'object') {
  3093. fromArgs.alertText = fromArgs.title;
  3094. }
  3095. }
  3096. };
  3097. var getAppBaseInfo = {
  3098. returnValue: function returnValue(result) {
  3099. var _result = result,
  3100. version = _result.version,
  3101. language = _result.language,
  3102. SDKVersion = _result.SDKVersion,
  3103. theme = _result.theme;
  3104. var _hostName = getHostName(result);
  3105. var hostLanguage = language.replace('_', '-');
  3106. result = sortObject(Object.assign(result, {
  3107. appId: "__UNI__2080341",
  3108. appName: "益智游戏",
  3109. appVersion: "1.1.1",
  3110. appVersionCode: "111",
  3111. appLanguage: getAppLanguage(hostLanguage),
  3112. hostVersion: version,
  3113. hostLanguage: hostLanguage,
  3114. hostName: _hostName,
  3115. hostSDKVersion: SDKVersion,
  3116. hostTheme: theme
  3117. }));
  3118. }
  3119. };
  3120. var getDeviceInfo = {
  3121. returnValue: function returnValue(result) {
  3122. var _result2 = result,
  3123. brand = _result2.brand,
  3124. model = _result2.model;
  3125. var deviceType = getGetDeviceType(result, model);
  3126. var deviceBrand = getDeviceBrand(brand);
  3127. useDeviceId(result);
  3128. result = sortObject(Object.assign(result, {
  3129. deviceType: deviceType,
  3130. deviceBrand: deviceBrand,
  3131. deviceModel: model
  3132. }));
  3133. }
  3134. };
  3135. var getWindowInfo = {
  3136. returnValue: function returnValue(result) {
  3137. addSafeAreaInsets(result);
  3138. result = sortObject(Object.assign(result, {
  3139. windowTop: 0,
  3140. windowBottom: 0
  3141. }));
  3142. }
  3143. };
  3144. var getAppAuthorizeSetting = {
  3145. returnValue: function returnValue(result) {
  3146. var locationReducedAccuracy = result.locationReducedAccuracy;
  3147. result.locationAccuracy = 'unsupported';
  3148. if (locationReducedAccuracy === true) {
  3149. result.locationAccuracy = 'reduced';
  3150. } else if (locationReducedAccuracy === false) {
  3151. result.locationAccuracy = 'full';
  3152. }
  3153. }
  3154. };
  3155. // import navigateTo from 'uni-helpers/navigate-to'
  3156. var compressImage = {
  3157. args: function args(fromArgs) {
  3158. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  3159. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  3160. fromArgs.compressHeight = fromArgs.compressedHeight;
  3161. }
  3162. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  3163. fromArgs.compressWidth = fromArgs.compressedWidth;
  3164. }
  3165. }
  3166. };
  3167. var protocols = {
  3168. redirectTo: redirectTo,
  3169. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  3170. previewImage: previewImage,
  3171. getSystemInfo: getSystemInfo,
  3172. getSystemInfoSync: getSystemInfo,
  3173. showActionSheet: showActionSheet,
  3174. getAppBaseInfo: getAppBaseInfo,
  3175. getDeviceInfo: getDeviceInfo,
  3176. getWindowInfo: getWindowInfo,
  3177. getAppAuthorizeSetting: getAppAuthorizeSetting,
  3178. compressImage: compressImage
  3179. };
  3180. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  3181. var canIUses = [];
  3182. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  3183. function processCallback(methodName, method, returnValue) {
  3184. return function (res) {
  3185. return method(processReturnValue(methodName, res, returnValue));
  3186. };
  3187. }
  3188. function processArgs(methodName, fromArgs) {
  3189. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  3190. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  3191. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  3192. if (isPlainObject(fromArgs)) {
  3193. // 一般 api 的参数解析
  3194. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  3195. if (isFn(argsOption)) {
  3196. argsOption = argsOption(fromArgs, toArgs) || {};
  3197. }
  3198. for (var key in fromArgs) {
  3199. if (hasOwn(argsOption, key)) {
  3200. var keyOption = argsOption[key];
  3201. if (isFn(keyOption)) {
  3202. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  3203. }
  3204. if (!keyOption) {
  3205. // 不支持的参数
  3206. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  3207. } else if (isStr(keyOption)) {
  3208. // 重写参数 key
  3209. toArgs[keyOption] = fromArgs[key];
  3210. } else if (isPlainObject(keyOption)) {
  3211. // {name:newName,value:value}可重新指定参数 key:value
  3212. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  3213. }
  3214. } else if (CALLBACKS.indexOf(key) !== -1) {
  3215. if (isFn(fromArgs[key])) {
  3216. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  3217. }
  3218. } else {
  3219. if (!keepFromArgs) {
  3220. toArgs[key] = fromArgs[key];
  3221. }
  3222. }
  3223. }
  3224. return toArgs;
  3225. } else if (isFn(fromArgs)) {
  3226. fromArgs = processCallback(methodName, fromArgs, returnValue);
  3227. }
  3228. return fromArgs;
  3229. }
  3230. function processReturnValue(methodName, res, returnValue) {
  3231. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  3232. if (isFn(protocols.returnValue)) {
  3233. // 处理通用 returnValue
  3234. res = protocols.returnValue(methodName, res);
  3235. }
  3236. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  3237. }
  3238. function wrapper(methodName, method) {
  3239. if (hasOwn(protocols, methodName)) {
  3240. var protocol = protocols[methodName];
  3241. if (!protocol) {
  3242. // 暂不支持的 api
  3243. return function () {
  3244. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  3245. };
  3246. }
  3247. return function (arg1, arg2) {
  3248. // 目前 api 最多两个参数
  3249. var options = protocol;
  3250. if (isFn(protocol)) {
  3251. options = protocol(arg1);
  3252. }
  3253. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  3254. var args = [arg1];
  3255. if (typeof arg2 !== 'undefined') {
  3256. args.push(arg2);
  3257. }
  3258. if (isFn(options.name)) {
  3259. methodName = options.name(arg1);
  3260. } else if (isStr(options.name)) {
  3261. methodName = options.name;
  3262. }
  3263. var returnValue = wx[methodName].apply(wx, args);
  3264. if (isSyncApi(methodName)) {
  3265. // 同步 api
  3266. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  3267. }
  3268. return returnValue;
  3269. };
  3270. }
  3271. return method;
  3272. }
  3273. var todoApis = Object.create(null);
  3274. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  3275. function createTodoApi(name) {
  3276. return function todoApi(_ref) {
  3277. var fail = _ref.fail,
  3278. complete = _ref.complete;
  3279. var res = {
  3280. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  3281. };
  3282. isFn(fail) && fail(res);
  3283. isFn(complete) && complete(res);
  3284. };
  3285. }
  3286. TODOS.forEach(function (name) {
  3287. todoApis[name] = createTodoApi(name);
  3288. });
  3289. var providers = {
  3290. oauth: ['weixin'],
  3291. share: ['weixin'],
  3292. payment: ['wxpay'],
  3293. push: ['weixin']
  3294. };
  3295. function getProvider(_ref2) {
  3296. var service = _ref2.service,
  3297. success = _ref2.success,
  3298. fail = _ref2.fail,
  3299. complete = _ref2.complete;
  3300. var res = false;
  3301. if (providers[service]) {
  3302. res = {
  3303. errMsg: 'getProvider:ok',
  3304. service: service,
  3305. provider: providers[service]
  3306. };
  3307. isFn(success) && success(res);
  3308. } else {
  3309. res = {
  3310. errMsg: 'getProvider:fail service not found'
  3311. };
  3312. isFn(fail) && fail(res);
  3313. }
  3314. isFn(complete) && complete(res);
  3315. }
  3316. var extraApi = /*#__PURE__*/Object.freeze({
  3317. __proto__: null,
  3318. getProvider: getProvider
  3319. });
  3320. var getEmitter = function () {
  3321. var Emitter;
  3322. return function getUniEmitter() {
  3323. if (!Emitter) {
  3324. Emitter = new _vue.default();
  3325. }
  3326. return Emitter;
  3327. };
  3328. }();
  3329. function apply(ctx, method, args) {
  3330. return ctx[method].apply(ctx, args);
  3331. }
  3332. function $on() {
  3333. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  3334. }
  3335. function $off() {
  3336. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  3337. }
  3338. function $once() {
  3339. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  3340. }
  3341. function $emit() {
  3342. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  3343. }
  3344. var eventApi = /*#__PURE__*/Object.freeze({
  3345. __proto__: null,
  3346. $on: $on,
  3347. $off: $off,
  3348. $once: $once,
  3349. $emit: $emit
  3350. });
  3351. /**
  3352. * 框架内 try-catch
  3353. */
  3354. /**
  3355. * 开发者 try-catch
  3356. */
  3357. function tryCatch(fn) {
  3358. return function () {
  3359. try {
  3360. return fn.apply(fn, arguments);
  3361. } catch (e) {
  3362. // TODO
  3363. console.error(e);
  3364. }
  3365. };
  3366. }
  3367. function getApiCallbacks(params) {
  3368. var apiCallbacks = {};
  3369. for (var name in params) {
  3370. var param = params[name];
  3371. if (isFn(param)) {
  3372. apiCallbacks[name] = tryCatch(param);
  3373. delete params[name];
  3374. }
  3375. }
  3376. return apiCallbacks;
  3377. }
  3378. var cid;
  3379. var cidErrMsg;
  3380. var enabled;
  3381. function normalizePushMessage(message) {
  3382. try {
  3383. return JSON.parse(message);
  3384. } catch (e) {}
  3385. return message;
  3386. }
  3387. function invokePushCallback(args) {
  3388. if (args.type === 'enabled') {
  3389. enabled = true;
  3390. } else if (args.type === 'clientId') {
  3391. cid = args.cid;
  3392. cidErrMsg = args.errMsg;
  3393. invokeGetPushCidCallbacks(cid, args.errMsg);
  3394. } else if (args.type === 'pushMsg') {
  3395. var message = {
  3396. type: 'receive',
  3397. data: normalizePushMessage(args.message)
  3398. };
  3399. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  3400. var callback = onPushMessageCallbacks[i];
  3401. callback(message);
  3402. // 该消息已被阻止
  3403. if (message.stopped) {
  3404. break;
  3405. }
  3406. }
  3407. } else if (args.type === 'click') {
  3408. onPushMessageCallbacks.forEach(function (callback) {
  3409. callback({
  3410. type: 'click',
  3411. data: normalizePushMessage(args.message)
  3412. });
  3413. });
  3414. }
  3415. }
  3416. var getPushCidCallbacks = [];
  3417. function invokeGetPushCidCallbacks(cid, errMsg) {
  3418. getPushCidCallbacks.forEach(function (callback) {
  3419. callback(cid, errMsg);
  3420. });
  3421. getPushCidCallbacks.length = 0;
  3422. }
  3423. function getPushClientId(args) {
  3424. if (!isPlainObject(args)) {
  3425. args = {};
  3426. }
  3427. var _getApiCallbacks = getApiCallbacks(args),
  3428. success = _getApiCallbacks.success,
  3429. fail = _getApiCallbacks.fail,
  3430. complete = _getApiCallbacks.complete;
  3431. var hasSuccess = isFn(success);
  3432. var hasFail = isFn(fail);
  3433. var hasComplete = isFn(complete);
  3434. Promise.resolve().then(function () {
  3435. if (typeof enabled === 'undefined') {
  3436. enabled = false;
  3437. cid = '';
  3438. cidErrMsg = 'uniPush is not enabled';
  3439. }
  3440. getPushCidCallbacks.push(function (cid, errMsg) {
  3441. var res;
  3442. if (cid) {
  3443. res = {
  3444. errMsg: 'getPushClientId:ok',
  3445. cid: cid
  3446. };
  3447. hasSuccess && success(res);
  3448. } else {
  3449. res = {
  3450. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  3451. };
  3452. hasFail && fail(res);
  3453. }
  3454. hasComplete && complete(res);
  3455. });
  3456. if (typeof cid !== 'undefined') {
  3457. invokeGetPushCidCallbacks(cid, cidErrMsg);
  3458. }
  3459. });
  3460. }
  3461. var onPushMessageCallbacks = [];
  3462. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  3463. var onPushMessage = function onPushMessage(fn) {
  3464. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  3465. onPushMessageCallbacks.push(fn);
  3466. }
  3467. };
  3468. var offPushMessage = function offPushMessage(fn) {
  3469. if (!fn) {
  3470. onPushMessageCallbacks.length = 0;
  3471. } else {
  3472. var index = onPushMessageCallbacks.indexOf(fn);
  3473. if (index > -1) {
  3474. onPushMessageCallbacks.splice(index, 1);
  3475. }
  3476. }
  3477. };
  3478. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  3479. if (!baseInfo) {
  3480. baseInfo = wx.getSystemInfoSync();
  3481. }
  3482. var host = baseInfo ? baseInfo.host : null;
  3483. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  3484. var api = /*#__PURE__*/Object.freeze({
  3485. __proto__: null,
  3486. shareVideoMessage: shareVideoMessage,
  3487. getPushClientId: getPushClientId,
  3488. onPushMessage: onPushMessage,
  3489. offPushMessage: offPushMessage,
  3490. invokePushCallback: invokePushCallback
  3491. });
  3492. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  3493. function findVmByVueId(vm, vuePid) {
  3494. var $children = vm.$children;
  3495. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  3496. for (var i = $children.length - 1; i >= 0; i--) {
  3497. var childVm = $children[i];
  3498. if (childVm.$scope._$vueId === vuePid) {
  3499. return childVm;
  3500. }
  3501. }
  3502. // 反向递归查找
  3503. var parentVm;
  3504. for (var _i = $children.length - 1; _i >= 0; _i--) {
  3505. parentVm = findVmByVueId($children[_i], vuePid);
  3506. if (parentVm) {
  3507. return parentVm;
  3508. }
  3509. }
  3510. }
  3511. function initBehavior(options) {
  3512. return Behavior(options);
  3513. }
  3514. function isPage() {
  3515. return !!this.route;
  3516. }
  3517. function initRelation(detail) {
  3518. this.triggerEvent('__l', detail);
  3519. }
  3520. function selectAllComponents(mpInstance, selector, $refs) {
  3521. var components = mpInstance.selectAllComponents(selector) || [];
  3522. components.forEach(function (component) {
  3523. var ref = component.dataset.ref;
  3524. $refs[ref] = component.$vm || toSkip(component);
  3525. {
  3526. if (component.dataset.vueGeneric === 'scoped') {
  3527. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  3528. selectAllComponents(scopedComponent, selector, $refs);
  3529. });
  3530. }
  3531. }
  3532. });
  3533. }
  3534. function syncRefs(refs, newRefs) {
  3535. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  3536. var newKeys = Object.keys(newRefs);
  3537. newKeys.forEach(function (key) {
  3538. var oldValue = refs[key];
  3539. var newValue = newRefs[key];
  3540. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  3541. return oldValue.includes(value);
  3542. })) {
  3543. return;
  3544. }
  3545. refs[key] = newValue;
  3546. oldKeys.delete(key);
  3547. });
  3548. oldKeys.forEach(function (key) {
  3549. delete refs[key];
  3550. });
  3551. return refs;
  3552. }
  3553. function initRefs(vm) {
  3554. var mpInstance = vm.$scope;
  3555. var refs = {};
  3556. Object.defineProperty(vm, '$refs', {
  3557. get: function get() {
  3558. var $refs = {};
  3559. selectAllComponents(mpInstance, '.vue-ref', $refs);
  3560. // TODO 暂不考虑 for 中的 scoped
  3561. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  3562. forComponents.forEach(function (component) {
  3563. var ref = component.dataset.ref;
  3564. if (!$refs[ref]) {
  3565. $refs[ref] = [];
  3566. }
  3567. $refs[ref].push(component.$vm || toSkip(component));
  3568. });
  3569. return syncRefs(refs, $refs);
  3570. }
  3571. });
  3572. }
  3573. function handleLink(event) {
  3574. var _ref3 = event.detail || event.value,
  3575. vuePid = _ref3.vuePid,
  3576. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  3577. var parentVm;
  3578. if (vuePid) {
  3579. parentVm = findVmByVueId(this.$vm, vuePid);
  3580. }
  3581. if (!parentVm) {
  3582. parentVm = this.$vm;
  3583. }
  3584. vueOptions.parent = parentVm;
  3585. }
  3586. function markMPComponent(component) {
  3587. // 在 Vue 中标记为小程序组件
  3588. var IS_MP = '__v_isMPComponent';
  3589. Object.defineProperty(component, IS_MP, {
  3590. configurable: true,
  3591. enumerable: false,
  3592. value: true
  3593. });
  3594. return component;
  3595. }
  3596. function toSkip(obj) {
  3597. var OB = '__ob__';
  3598. var SKIP = '__v_skip';
  3599. if (isObject(obj) && Object.isExtensible(obj)) {
  3600. // 避免被 @vue/composition-api 观测
  3601. Object.defineProperty(obj, OB, {
  3602. configurable: true,
  3603. enumerable: false,
  3604. value: (0, _defineProperty2.default)({}, SKIP, true)
  3605. });
  3606. }
  3607. return obj;
  3608. }
  3609. var MPPage = Page;
  3610. var MPComponent = Component;
  3611. var customizeRE = /:/g;
  3612. var customize = cached(function (str) {
  3613. return camelize(str.replace(customizeRE, '-'));
  3614. });
  3615. function initTriggerEvent(mpInstance) {
  3616. var oldTriggerEvent = mpInstance.triggerEvent;
  3617. var newTriggerEvent = function newTriggerEvent(event) {
  3618. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  3619. args[_key3 - 1] = arguments[_key3];
  3620. }
  3621. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  3622. if (this.$vm || this.dataset && this.dataset.comType) {
  3623. event = customize(event);
  3624. } else {
  3625. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  3626. var newEvent = customize(event);
  3627. if (newEvent !== event) {
  3628. oldTriggerEvent.apply(this, [newEvent].concat(args));
  3629. }
  3630. }
  3631. return oldTriggerEvent.apply(this, [event].concat(args));
  3632. };
  3633. try {
  3634. // 京东小程序 triggerEvent 为只读
  3635. mpInstance.triggerEvent = newTriggerEvent;
  3636. } catch (error) {
  3637. mpInstance._triggerEvent = newTriggerEvent;
  3638. }
  3639. }
  3640. function initHook(name, options, isComponent) {
  3641. var oldHook = options[name];
  3642. options[name] = function () {
  3643. markMPComponent(this);
  3644. initTriggerEvent(this);
  3645. if (oldHook) {
  3646. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  3647. args[_key4] = arguments[_key4];
  3648. }
  3649. return oldHook.apply(this, args);
  3650. }
  3651. };
  3652. }
  3653. if (!MPPage.__$wrappered) {
  3654. MPPage.__$wrappered = true;
  3655. Page = function Page() {
  3656. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3657. initHook('onLoad', options);
  3658. return MPPage(options);
  3659. };
  3660. Page.after = MPPage.after;
  3661. Component = function Component() {
  3662. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3663. initHook('created', options);
  3664. return MPComponent(options);
  3665. };
  3666. }
  3667. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  3668. function initMocks(vm, mocks) {
  3669. var mpInstance = vm.$mp[vm.mpType];
  3670. mocks.forEach(function (mock) {
  3671. if (hasOwn(mpInstance, mock)) {
  3672. vm[mock] = mpInstance[mock];
  3673. }
  3674. });
  3675. }
  3676. function hasHook(hook, vueOptions) {
  3677. if (!vueOptions) {
  3678. return true;
  3679. }
  3680. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  3681. return true;
  3682. }
  3683. vueOptions = vueOptions.default || vueOptions;
  3684. if (isFn(vueOptions)) {
  3685. if (isFn(vueOptions.extendOptions[hook])) {
  3686. return true;
  3687. }
  3688. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  3689. return true;
  3690. }
  3691. return false;
  3692. }
  3693. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  3694. return true;
  3695. }
  3696. var mixins = vueOptions.mixins;
  3697. if (Array.isArray(mixins)) {
  3698. return !!mixins.find(function (mixin) {
  3699. return hasHook(hook, mixin);
  3700. });
  3701. }
  3702. }
  3703. function initHooks(mpOptions, hooks, vueOptions) {
  3704. hooks.forEach(function (hook) {
  3705. if (hasHook(hook, vueOptions)) {
  3706. mpOptions[hook] = function (args) {
  3707. return this.$vm && this.$vm.__call_hook(hook, args);
  3708. };
  3709. }
  3710. });
  3711. }
  3712. function initUnknownHooks(mpOptions, vueOptions) {
  3713. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  3714. findHooks(vueOptions).forEach(function (hook) {
  3715. return initHook$1(mpOptions, hook, excludes);
  3716. });
  3717. }
  3718. function findHooks(vueOptions) {
  3719. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  3720. if (vueOptions) {
  3721. Object.keys(vueOptions).forEach(function (name) {
  3722. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  3723. hooks.push(name);
  3724. }
  3725. });
  3726. }
  3727. return hooks;
  3728. }
  3729. function initHook$1(mpOptions, hook, excludes) {
  3730. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  3731. mpOptions[hook] = function (args) {
  3732. return this.$vm && this.$vm.__call_hook(hook, args);
  3733. };
  3734. }
  3735. }
  3736. function initVueComponent(Vue, vueOptions) {
  3737. vueOptions = vueOptions.default || vueOptions;
  3738. var VueComponent;
  3739. if (isFn(vueOptions)) {
  3740. VueComponent = vueOptions;
  3741. } else {
  3742. VueComponent = Vue.extend(vueOptions);
  3743. }
  3744. vueOptions = VueComponent.options;
  3745. return [VueComponent, vueOptions];
  3746. }
  3747. function initSlots(vm, vueSlots) {
  3748. if (Array.isArray(vueSlots) && vueSlots.length) {
  3749. var $slots = Object.create(null);
  3750. vueSlots.forEach(function (slotName) {
  3751. $slots[slotName] = true;
  3752. });
  3753. vm.$scopedSlots = vm.$slots = $slots;
  3754. }
  3755. }
  3756. function initVueIds(vueIds, mpInstance) {
  3757. vueIds = (vueIds || '').split(',');
  3758. var len = vueIds.length;
  3759. if (len === 1) {
  3760. mpInstance._$vueId = vueIds[0];
  3761. } else if (len === 2) {
  3762. mpInstance._$vueId = vueIds[0];
  3763. mpInstance._$vuePid = vueIds[1];
  3764. }
  3765. }
  3766. function initData(vueOptions, context) {
  3767. var data = vueOptions.data || {};
  3768. var methods = vueOptions.methods || {};
  3769. if (typeof data === 'function') {
  3770. try {
  3771. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  3772. } catch (e) {
  3773. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  3774. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  3775. }
  3776. }
  3777. } else {
  3778. try {
  3779. // 对 data 格式化
  3780. data = JSON.parse(JSON.stringify(data));
  3781. } catch (e) {}
  3782. }
  3783. if (!isPlainObject(data)) {
  3784. data = {};
  3785. }
  3786. Object.keys(methods).forEach(function (methodName) {
  3787. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  3788. data[methodName] = methods[methodName];
  3789. }
  3790. });
  3791. return data;
  3792. }
  3793. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  3794. function createObserver(name) {
  3795. return function observer(newVal, oldVal) {
  3796. if (this.$vm) {
  3797. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  3798. }
  3799. };
  3800. }
  3801. function initBehaviors(vueOptions, initBehavior) {
  3802. var vueBehaviors = vueOptions.behaviors;
  3803. var vueExtends = vueOptions.extends;
  3804. var vueMixins = vueOptions.mixins;
  3805. var vueProps = vueOptions.props;
  3806. if (!vueProps) {
  3807. vueOptions.props = vueProps = [];
  3808. }
  3809. var behaviors = [];
  3810. if (Array.isArray(vueBehaviors)) {
  3811. vueBehaviors.forEach(function (behavior) {
  3812. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  3813. if (behavior === 'uni://form-field') {
  3814. if (Array.isArray(vueProps)) {
  3815. vueProps.push('name');
  3816. vueProps.push('value');
  3817. } else {
  3818. vueProps.name = {
  3819. type: String,
  3820. default: ''
  3821. };
  3822. vueProps.value = {
  3823. type: [String, Number, Boolean, Array, Object, Date],
  3824. default: ''
  3825. };
  3826. }
  3827. }
  3828. });
  3829. }
  3830. if (isPlainObject(vueExtends) && vueExtends.props) {
  3831. behaviors.push(initBehavior({
  3832. properties: initProperties(vueExtends.props, true)
  3833. }));
  3834. }
  3835. if (Array.isArray(vueMixins)) {
  3836. vueMixins.forEach(function (vueMixin) {
  3837. if (isPlainObject(vueMixin) && vueMixin.props) {
  3838. behaviors.push(initBehavior({
  3839. properties: initProperties(vueMixin.props, true)
  3840. }));
  3841. }
  3842. });
  3843. }
  3844. return behaviors;
  3845. }
  3846. function parsePropType(key, type, defaultValue, file) {
  3847. // [String]=>String
  3848. if (Array.isArray(type) && type.length === 1) {
  3849. return type[0];
  3850. }
  3851. return type;
  3852. }
  3853. function initProperties(props) {
  3854. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  3855. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  3856. var options = arguments.length > 3 ? arguments[3] : undefined;
  3857. var properties = {};
  3858. if (!isBehavior) {
  3859. properties.vueId = {
  3860. type: String,
  3861. value: ''
  3862. };
  3863. {
  3864. if (options.virtualHost) {
  3865. properties.virtualHostStyle = {
  3866. type: null,
  3867. value: ''
  3868. };
  3869. properties.virtualHostClass = {
  3870. type: null,
  3871. value: ''
  3872. };
  3873. }
  3874. }
  3875. // scopedSlotsCompiler auto
  3876. properties.scopedSlotsCompiler = {
  3877. type: String,
  3878. value: ''
  3879. };
  3880. properties.vueSlots = {
  3881. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  3882. type: null,
  3883. value: [],
  3884. observer: function observer(newVal, oldVal) {
  3885. var $slots = Object.create(null);
  3886. newVal.forEach(function (slotName) {
  3887. $slots[slotName] = true;
  3888. });
  3889. this.setData({
  3890. $slots: $slots
  3891. });
  3892. }
  3893. };
  3894. }
  3895. if (Array.isArray(props)) {
  3896. // ['title']
  3897. props.forEach(function (key) {
  3898. properties[key] = {
  3899. type: null,
  3900. observer: createObserver(key)
  3901. };
  3902. });
  3903. } else if (isPlainObject(props)) {
  3904. // {title:{type:String,default:''},content:String}
  3905. Object.keys(props).forEach(function (key) {
  3906. var opts = props[key];
  3907. if (isPlainObject(opts)) {
  3908. // title:{type:String,default:''}
  3909. var value = opts.default;
  3910. if (isFn(value)) {
  3911. value = value();
  3912. }
  3913. opts.type = parsePropType(key, opts.type);
  3914. properties[key] = {
  3915. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  3916. value: value,
  3917. observer: createObserver(key)
  3918. };
  3919. } else {
  3920. // content:String
  3921. var type = parsePropType(key, opts);
  3922. properties[key] = {
  3923. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  3924. observer: createObserver(key)
  3925. };
  3926. }
  3927. });
  3928. }
  3929. return properties;
  3930. }
  3931. function wrapper$1(event) {
  3932. // TODO 又得兼容 mpvue 的 mp 对象
  3933. try {
  3934. event.mp = JSON.parse(JSON.stringify(event));
  3935. } catch (e) {}
  3936. event.stopPropagation = noop;
  3937. event.preventDefault = noop;
  3938. event.target = event.target || {};
  3939. if (!hasOwn(event, 'detail')) {
  3940. event.detail = {};
  3941. }
  3942. if (hasOwn(event, 'markerId')) {
  3943. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  3944. event.detail.markerId = event.markerId;
  3945. }
  3946. if (isPlainObject(event.detail)) {
  3947. event.target = Object.assign({}, event.target, event.detail);
  3948. }
  3949. return event;
  3950. }
  3951. function getExtraValue(vm, dataPathsArray) {
  3952. var context = vm;
  3953. dataPathsArray.forEach(function (dataPathArray) {
  3954. var dataPath = dataPathArray[0];
  3955. var value = dataPathArray[2];
  3956. if (dataPath || typeof value !== 'undefined') {
  3957. // ['','',index,'disable']
  3958. var propPath = dataPathArray[1];
  3959. var valuePath = dataPathArray[3];
  3960. var vFor;
  3961. if (Number.isInteger(dataPath)) {
  3962. vFor = dataPath;
  3963. } else if (!dataPath) {
  3964. vFor = context;
  3965. } else if (typeof dataPath === 'string' && dataPath) {
  3966. if (dataPath.indexOf('#s#') === 0) {
  3967. vFor = dataPath.substr(3);
  3968. } else {
  3969. vFor = vm.__get_value(dataPath, context);
  3970. }
  3971. }
  3972. if (Number.isInteger(vFor)) {
  3973. context = value;
  3974. } else if (!propPath) {
  3975. context = vFor[value];
  3976. } else {
  3977. if (Array.isArray(vFor)) {
  3978. context = vFor.find(function (vForItem) {
  3979. return vm.__get_value(propPath, vForItem) === value;
  3980. });
  3981. } else if (isPlainObject(vFor)) {
  3982. context = Object.keys(vFor).find(function (vForKey) {
  3983. return vm.__get_value(propPath, vFor[vForKey]) === value;
  3984. });
  3985. } else {
  3986. console.error('v-for 暂不支持循环数据:', vFor);
  3987. }
  3988. }
  3989. if (valuePath) {
  3990. context = vm.__get_value(valuePath, context);
  3991. }
  3992. }
  3993. });
  3994. return context;
  3995. }
  3996. function processEventExtra(vm, extra, event, __args__) {
  3997. var extraObj = {};
  3998. if (Array.isArray(extra) && extra.length) {
  3999. /**
  4000. *[
  4001. * ['data.items', 'data.id', item.data.id],
  4002. * ['metas', 'id', meta.id]
  4003. *],
  4004. *[
  4005. * ['data.items', 'data.id', item.data.id],
  4006. * ['metas', 'id', meta.id]
  4007. *],
  4008. *'test'
  4009. */
  4010. extra.forEach(function (dataPath, index) {
  4011. if (typeof dataPath === 'string') {
  4012. if (!dataPath) {
  4013. // model,prop.sync
  4014. extraObj['$' + index] = vm;
  4015. } else {
  4016. if (dataPath === '$event') {
  4017. // $event
  4018. extraObj['$' + index] = event;
  4019. } else if (dataPath === 'arguments') {
  4020. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  4021. } else if (dataPath.indexOf('$event.') === 0) {
  4022. // $event.target.value
  4023. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  4024. } else {
  4025. extraObj['$' + index] = vm.__get_value(dataPath);
  4026. }
  4027. }
  4028. } else {
  4029. extraObj['$' + index] = getExtraValue(vm, dataPath);
  4030. }
  4031. });
  4032. }
  4033. return extraObj;
  4034. }
  4035. function getObjByArray(arr) {
  4036. var obj = {};
  4037. for (var i = 1; i < arr.length; i++) {
  4038. var element = arr[i];
  4039. obj[element[0]] = element[1];
  4040. }
  4041. return obj;
  4042. }
  4043. function processEventArgs(vm, event) {
  4044. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  4045. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  4046. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  4047. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  4048. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  4049. // fixed 用户直接触发 mpInstance.triggerEvent
  4050. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  4051. if (isCustom) {
  4052. // 自定义事件
  4053. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  4054. if (!args.length) {
  4055. // 无参数,直接传入 event 或 detail 数组
  4056. if (isCustomMPEvent) {
  4057. return [event];
  4058. }
  4059. return __args__;
  4060. }
  4061. }
  4062. var extraObj = processEventExtra(vm, extra, event, __args__);
  4063. var ret = [];
  4064. args.forEach(function (arg) {
  4065. if (arg === '$event') {
  4066. if (methodName === '__set_model' && !isCustom) {
  4067. // input v-model value
  4068. ret.push(event.target.value);
  4069. } else {
  4070. if (isCustom && !isCustomMPEvent) {
  4071. ret.push(__args__[0]);
  4072. } else {
  4073. // wxcomponent 组件或内置组件
  4074. ret.push(event);
  4075. }
  4076. }
  4077. } else {
  4078. if (Array.isArray(arg) && arg[0] === 'o') {
  4079. ret.push(getObjByArray(arg));
  4080. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  4081. ret.push(extraObj[arg]);
  4082. } else {
  4083. ret.push(arg);
  4084. }
  4085. }
  4086. });
  4087. return ret;
  4088. }
  4089. var ONCE = '~';
  4090. var CUSTOM = '^';
  4091. function isMatchEventType(eventType, optType) {
  4092. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  4093. }
  4094. function getContextVm(vm) {
  4095. var $parent = vm.$parent;
  4096. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  4097. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  4098. $parent = $parent.$parent;
  4099. }
  4100. return $parent && $parent.$parent;
  4101. }
  4102. function handleEvent(event) {
  4103. var _this2 = this;
  4104. event = wrapper$1(event);
  4105. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  4106. var dataset = (event.currentTarget || event.target).dataset;
  4107. if (!dataset) {
  4108. return console.warn('事件信息不存在');
  4109. }
  4110. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  4111. if (!eventOpts) {
  4112. return console.warn('事件信息不存在');
  4113. }
  4114. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  4115. var eventType = event.type;
  4116. var ret = [];
  4117. eventOpts.forEach(function (eventOpt) {
  4118. var type = eventOpt[0];
  4119. var eventsArray = eventOpt[1];
  4120. var isCustom = type.charAt(0) === CUSTOM;
  4121. type = isCustom ? type.slice(1) : type;
  4122. var isOnce = type.charAt(0) === ONCE;
  4123. type = isOnce ? type.slice(1) : type;
  4124. if (eventsArray && isMatchEventType(eventType, type)) {
  4125. eventsArray.forEach(function (eventArray) {
  4126. var methodName = eventArray[0];
  4127. if (methodName) {
  4128. var handlerCtx = _this2.$vm;
  4129. if (handlerCtx.$options.generic) {
  4130. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  4131. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  4132. }
  4133. if (methodName === '$emit') {
  4134. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  4135. return;
  4136. }
  4137. var handler = handlerCtx[methodName];
  4138. if (!isFn(handler)) {
  4139. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  4140. var path = _this2.route || _this2.is;
  4141. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  4142. }
  4143. if (isOnce) {
  4144. if (handler.once) {
  4145. return;
  4146. }
  4147. handler.once = true;
  4148. }
  4149. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  4150. params = Array.isArray(params) ? params : [];
  4151. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  4152. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  4153. // eslint-disable-next-line no-sparse-arrays
  4154. params = params.concat([,,,,,,,,,, event]);
  4155. }
  4156. ret.push(handler.apply(handlerCtx, params));
  4157. }
  4158. });
  4159. }
  4160. });
  4161. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  4162. return ret[0];
  4163. }
  4164. }
  4165. var eventChannels = {};
  4166. var eventChannelStack = [];
  4167. function getEventChannel(id) {
  4168. if (id) {
  4169. var eventChannel = eventChannels[id];
  4170. delete eventChannels[id];
  4171. return eventChannel;
  4172. }
  4173. return eventChannelStack.shift();
  4174. }
  4175. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  4176. function initEventChannel() {
  4177. _vue.default.prototype.getOpenerEventChannel = function () {
  4178. // 微信小程序使用自身getOpenerEventChannel
  4179. {
  4180. return this.$scope.getOpenerEventChannel();
  4181. }
  4182. };
  4183. var callHook = _vue.default.prototype.__call_hook;
  4184. _vue.default.prototype.__call_hook = function (hook, args) {
  4185. if (hook === 'onLoad' && args && args.__id__) {
  4186. this.__eventChannel__ = getEventChannel(args.__id__);
  4187. delete args.__id__;
  4188. }
  4189. return callHook.call(this, hook, args);
  4190. };
  4191. }
  4192. function initScopedSlotsParams() {
  4193. var center = {};
  4194. var parents = {};
  4195. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  4196. var has = center[vueId];
  4197. if (!has) {
  4198. parents[vueId] = this;
  4199. this.$on('hook:destroyed', function () {
  4200. delete parents[vueId];
  4201. });
  4202. }
  4203. return has;
  4204. };
  4205. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  4206. var data = center[vueId];
  4207. if (data) {
  4208. var object = data[name] || {};
  4209. return key ? object[key] : object;
  4210. } else {
  4211. parents[vueId] = this;
  4212. this.$on('hook:destroyed', function () {
  4213. delete parents[vueId];
  4214. });
  4215. }
  4216. };
  4217. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  4218. var vueIds = this.$options.propsData.vueId;
  4219. if (vueIds) {
  4220. var vueId = vueIds.split(',')[0];
  4221. var object = center[vueId] = center[vueId] || {};
  4222. object[name] = value;
  4223. if (parents[vueId]) {
  4224. parents[vueId].$forceUpdate();
  4225. }
  4226. }
  4227. };
  4228. _vue.default.mixin({
  4229. destroyed: function destroyed() {
  4230. var propsData = this.$options.propsData;
  4231. var vueId = propsData && propsData.vueId;
  4232. if (vueId) {
  4233. delete center[vueId];
  4234. delete parents[vueId];
  4235. }
  4236. }
  4237. });
  4238. }
  4239. function parseBaseApp(vm, _ref4) {
  4240. var mocks = _ref4.mocks,
  4241. initRefs = _ref4.initRefs;
  4242. initEventChannel();
  4243. {
  4244. initScopedSlotsParams();
  4245. }
  4246. if (vm.$options.store) {
  4247. _vue.default.prototype.$store = vm.$options.store;
  4248. }
  4249. uniIdMixin(_vue.default);
  4250. _vue.default.prototype.mpHost = "mp-weixin";
  4251. _vue.default.mixin({
  4252. beforeCreate: function beforeCreate() {
  4253. if (!this.$options.mpType) {
  4254. return;
  4255. }
  4256. this.mpType = this.$options.mpType;
  4257. this.$mp = (0, _defineProperty2.default)({
  4258. data: {}
  4259. }, this.mpType, this.$options.mpInstance);
  4260. this.$scope = this.$options.mpInstance;
  4261. delete this.$options.mpType;
  4262. delete this.$options.mpInstance;
  4263. if (this.mpType === 'page' && typeof getApp === 'function') {
  4264. // hack vue-i18n
  4265. var app = getApp();
  4266. if (app.$vm && app.$vm.$i18n) {
  4267. this._i18n = app.$vm.$i18n;
  4268. }
  4269. }
  4270. if (this.mpType !== 'app') {
  4271. initRefs(this);
  4272. initMocks(this, mocks);
  4273. }
  4274. }
  4275. });
  4276. var appOptions = {
  4277. onLaunch: function onLaunch(args) {
  4278. if (this.$vm) {
  4279. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  4280. return;
  4281. }
  4282. {
  4283. if (wx.canIUse && !wx.canIUse('nextTick')) {
  4284. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  4285. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  4286. }
  4287. }
  4288. this.$vm = vm;
  4289. this.$vm.$mp = {
  4290. app: this
  4291. };
  4292. this.$vm.$scope = this;
  4293. // vm 上也挂载 globalData
  4294. this.$vm.globalData = this.globalData;
  4295. this.$vm._isMounted = true;
  4296. this.$vm.__call_hook('mounted', args);
  4297. this.$vm.__call_hook('onLaunch', args);
  4298. }
  4299. };
  4300. // 兼容旧版本 globalData
  4301. appOptions.globalData = vm.$options.globalData || {};
  4302. // 将 methods 中的方法挂在 getApp() 中
  4303. var methods = vm.$options.methods;
  4304. if (methods) {
  4305. Object.keys(methods).forEach(function (name) {
  4306. appOptions[name] = methods[name];
  4307. });
  4308. }
  4309. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  4310. initHooks(appOptions, hooks);
  4311. initUnknownHooks(appOptions, vm.$options);
  4312. return appOptions;
  4313. }
  4314. function parseApp(vm) {
  4315. return parseBaseApp(vm, {
  4316. mocks: mocks,
  4317. initRefs: initRefs
  4318. });
  4319. }
  4320. function createApp(vm) {
  4321. App(parseApp(vm));
  4322. return vm;
  4323. }
  4324. var encodeReserveRE = /[!'()*]/g;
  4325. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  4326. return '%' + c.charCodeAt(0).toString(16);
  4327. };
  4328. var commaRE = /%2C/g;
  4329. // fixed encodeURIComponent which is more conformant to RFC3986:
  4330. // - escapes [!'()*]
  4331. // - preserve commas
  4332. var encode = function encode(str) {
  4333. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  4334. };
  4335. function stringifyQuery(obj) {
  4336. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  4337. var res = obj ? Object.keys(obj).map(function (key) {
  4338. var val = obj[key];
  4339. if (val === undefined) {
  4340. return '';
  4341. }
  4342. if (val === null) {
  4343. return encodeStr(key);
  4344. }
  4345. if (Array.isArray(val)) {
  4346. var result = [];
  4347. val.forEach(function (val2) {
  4348. if (val2 === undefined) {
  4349. return;
  4350. }
  4351. if (val2 === null) {
  4352. result.push(encodeStr(key));
  4353. } else {
  4354. result.push(encodeStr(key) + '=' + encodeStr(val2));
  4355. }
  4356. });
  4357. return result.join('&');
  4358. }
  4359. return encodeStr(key) + '=' + encodeStr(val);
  4360. }).filter(function (x) {
  4361. return x.length > 0;
  4362. }).join('&') : null;
  4363. return res ? "?".concat(res) : '';
  4364. }
  4365. function parseBaseComponent(vueComponentOptions) {
  4366. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  4367. isPage = _ref5.isPage,
  4368. initRelation = _ref5.initRelation;
  4369. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  4370. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  4371. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  4372. VueComponent = _initVueComponent2[0],
  4373. vueOptions = _initVueComponent2[1];
  4374. var options = _objectSpread({
  4375. multipleSlots: true,
  4376. addGlobalClass: true
  4377. }, vueOptions.options || {});
  4378. {
  4379. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  4380. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  4381. Object.assign(options, vueOptions['mp-weixin'].options);
  4382. }
  4383. }
  4384. var componentOptions = {
  4385. options: options,
  4386. data: initData(vueOptions, _vue.default.prototype),
  4387. behaviors: initBehaviors(vueOptions, initBehavior),
  4388. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  4389. lifetimes: {
  4390. attached: function attached() {
  4391. var properties = this.properties;
  4392. var options = {
  4393. mpType: isPage.call(this) ? 'page' : 'component',
  4394. mpInstance: this,
  4395. propsData: properties
  4396. };
  4397. initVueIds(properties.vueId, this);
  4398. // 处理父子关系
  4399. initRelation.call(this, {
  4400. vuePid: this._$vuePid,
  4401. vueOptions: options
  4402. });
  4403. // 初始化 vue 实例
  4404. this.$vm = new VueComponent(options);
  4405. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  4406. initSlots(this.$vm, properties.vueSlots);
  4407. // 触发首次 setData
  4408. this.$vm.$mount();
  4409. },
  4410. ready: function ready() {
  4411. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  4412. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  4413. if (this.$vm) {
  4414. this.$vm._isMounted = true;
  4415. this.$vm.__call_hook('mounted');
  4416. this.$vm.__call_hook('onReady');
  4417. }
  4418. },
  4419. detached: function detached() {
  4420. this.$vm && this.$vm.$destroy();
  4421. }
  4422. },
  4423. pageLifetimes: {
  4424. show: function show(args) {
  4425. this.$vm && this.$vm.__call_hook('onPageShow', args);
  4426. },
  4427. hide: function hide() {
  4428. this.$vm && this.$vm.__call_hook('onPageHide');
  4429. },
  4430. resize: function resize(size) {
  4431. this.$vm && this.$vm.__call_hook('onPageResize', size);
  4432. }
  4433. },
  4434. methods: {
  4435. __l: handleLink,
  4436. __e: handleEvent
  4437. }
  4438. };
  4439. // externalClasses
  4440. if (vueOptions.externalClasses) {
  4441. componentOptions.externalClasses = vueOptions.externalClasses;
  4442. }
  4443. if (Array.isArray(vueOptions.wxsCallMethods)) {
  4444. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  4445. componentOptions.methods[callMethod] = function (args) {
  4446. return this.$vm[callMethod](args);
  4447. };
  4448. });
  4449. }
  4450. if (needVueOptions) {
  4451. return [componentOptions, vueOptions, VueComponent];
  4452. }
  4453. if (isPage) {
  4454. return componentOptions;
  4455. }
  4456. return [componentOptions, VueComponent];
  4457. }
  4458. function parseComponent(vueComponentOptions, needVueOptions) {
  4459. return parseBaseComponent(vueComponentOptions, {
  4460. isPage: isPage,
  4461. initRelation: initRelation
  4462. }, needVueOptions);
  4463. }
  4464. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  4465. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  4466. function parseBasePage(vuePageOptions) {
  4467. var _parseComponent = parseComponent(vuePageOptions, true),
  4468. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  4469. pageOptions = _parseComponent2[0],
  4470. vueOptions = _parseComponent2[1];
  4471. initHooks(pageOptions.methods, hooks$1, vueOptions);
  4472. pageOptions.methods.onLoad = function (query) {
  4473. this.options = query;
  4474. var copyQuery = Object.assign({}, query);
  4475. delete copyQuery.__id__;
  4476. this.$page = {
  4477. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  4478. };
  4479. this.$vm.$mp.query = query; // 兼容 mpvue
  4480. this.$vm.__call_hook('onLoad', query);
  4481. };
  4482. {
  4483. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  4484. }
  4485. return pageOptions;
  4486. }
  4487. function parsePage(vuePageOptions) {
  4488. return parseBasePage(vuePageOptions);
  4489. }
  4490. function createPage(vuePageOptions) {
  4491. {
  4492. return Component(parsePage(vuePageOptions));
  4493. }
  4494. }
  4495. function createComponent(vueOptions) {
  4496. {
  4497. return Component(parseComponent(vueOptions));
  4498. }
  4499. }
  4500. function createSubpackageApp(vm) {
  4501. var appOptions = parseApp(vm);
  4502. var app = getApp({
  4503. allowDefault: true
  4504. });
  4505. vm.$scope = app;
  4506. var globalData = app.globalData;
  4507. if (globalData) {
  4508. Object.keys(appOptions.globalData).forEach(function (name) {
  4509. if (!hasOwn(globalData, name)) {
  4510. globalData[name] = appOptions.globalData[name];
  4511. }
  4512. });
  4513. }
  4514. Object.keys(appOptions).forEach(function (name) {
  4515. if (!hasOwn(app, name)) {
  4516. app[name] = appOptions[name];
  4517. }
  4518. });
  4519. if (isFn(appOptions.onShow) && wx.onAppShow) {
  4520. wx.onAppShow(function () {
  4521. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  4522. args[_key5] = arguments[_key5];
  4523. }
  4524. vm.__call_hook('onShow', args);
  4525. });
  4526. }
  4527. if (isFn(appOptions.onHide) && wx.onAppHide) {
  4528. wx.onAppHide(function () {
  4529. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  4530. args[_key6] = arguments[_key6];
  4531. }
  4532. vm.__call_hook('onHide', args);
  4533. });
  4534. }
  4535. if (isFn(appOptions.onLaunch)) {
  4536. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  4537. vm.__call_hook('onLaunch', args);
  4538. }
  4539. return vm;
  4540. }
  4541. function createPlugin(vm) {
  4542. var appOptions = parseApp(vm);
  4543. if (isFn(appOptions.onShow) && wx.onAppShow) {
  4544. wx.onAppShow(function () {
  4545. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  4546. args[_key7] = arguments[_key7];
  4547. }
  4548. vm.__call_hook('onShow', args);
  4549. });
  4550. }
  4551. if (isFn(appOptions.onHide) && wx.onAppHide) {
  4552. wx.onAppHide(function () {
  4553. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  4554. args[_key8] = arguments[_key8];
  4555. }
  4556. vm.__call_hook('onHide', args);
  4557. });
  4558. }
  4559. if (isFn(appOptions.onLaunch)) {
  4560. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  4561. vm.__call_hook('onLaunch', args);
  4562. }
  4563. return vm;
  4564. }
  4565. todos.forEach(function (todoApi) {
  4566. protocols[todoApi] = false;
  4567. });
  4568. canIUses.forEach(function (canIUseApi) {
  4569. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  4570. if (!wx.canIUse(apiName)) {
  4571. protocols[canIUseApi] = false;
  4572. }
  4573. });
  4574. var uni = {};
  4575. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  4576. uni = new Proxy({}, {
  4577. get: function get(target, name) {
  4578. if (hasOwn(target, name)) {
  4579. return target[name];
  4580. }
  4581. if (baseApi[name]) {
  4582. return baseApi[name];
  4583. }
  4584. if (api[name]) {
  4585. return promisify(name, api[name]);
  4586. }
  4587. {
  4588. if (extraApi[name]) {
  4589. return promisify(name, extraApi[name]);
  4590. }
  4591. if (todoApis[name]) {
  4592. return promisify(name, todoApis[name]);
  4593. }
  4594. }
  4595. if (eventApi[name]) {
  4596. return eventApi[name];
  4597. }
  4598. return promisify(name, wrapper(name, wx[name]));
  4599. },
  4600. set: function set(target, name, value) {
  4601. target[name] = value;
  4602. return true;
  4603. }
  4604. });
  4605. } else {
  4606. Object.keys(baseApi).forEach(function (name) {
  4607. uni[name] = baseApi[name];
  4608. });
  4609. {
  4610. Object.keys(todoApis).forEach(function (name) {
  4611. uni[name] = promisify(name, todoApis[name]);
  4612. });
  4613. Object.keys(extraApi).forEach(function (name) {
  4614. uni[name] = promisify(name, todoApis[name]);
  4615. });
  4616. }
  4617. Object.keys(eventApi).forEach(function (name) {
  4618. uni[name] = eventApi[name];
  4619. });
  4620. Object.keys(api).forEach(function (name) {
  4621. uni[name] = promisify(name, api[name]);
  4622. });
  4623. Object.keys(wx).forEach(function (name) {
  4624. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  4625. uni[name] = promisify(name, wrapper(name, wx[name]));
  4626. }
  4627. });
  4628. }
  4629. wx.createApp = createApp;
  4630. wx.createPage = createPage;
  4631. wx.createComponent = createComponent;
  4632. wx.createSubpackageApp = createSubpackageApp;
  4633. wx.createPlugin = createPlugin;
  4634. var uni$1 = uni;
  4635. var _default = uni$1;
  4636. exports.default = _default;
  4637. /* 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)))
  4638. /***/ }),
  4639. /***/ 20:
  4640. /*!****************************************************************!*\
  4641. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  4642. \****************************************************************/
  4643. /*! no static exports found */
  4644. /***/ (function(module, exports) {
  4645. function _iterableToArray(iter) {
  4646. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  4647. }
  4648. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4649. /***/ }),
  4650. /***/ 21:
  4651. /*!******************************************************************!*\
  4652. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  4653. \******************************************************************/
  4654. /*! no static exports found */
  4655. /***/ (function(module, exports) {
  4656. function _nonIterableSpread() {
  4657. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  4658. }
  4659. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4660. /***/ }),
  4661. /***/ 217:
  4662. /*!************************************************************************************!*\
  4663. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  4664. \************************************************************************************/
  4665. /*! no static exports found */
  4666. /***/ (function(module, exports, __webpack_require__) {
  4667. "use strict";
  4668. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  4669. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  4670. Object.defineProperty(exports, "__esModule", {
  4671. value: true
  4672. });
  4673. exports.default = void 0;
  4674. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  4675. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  4676. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  4677. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  4678. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  4679. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  4680. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  4681. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  4682. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 191));
  4683. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 192));
  4684. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 194));
  4685. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 218));
  4686. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  4687. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 220));
  4688. 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; } } }; }
  4689. 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); }
  4690. 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; }
  4691. 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; }
  4692. 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; }
  4693. 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); }; }
  4694. 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; } }
  4695. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  4696. function n(e) {
  4697. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  4698. }
  4699. function s(e, t, n) {
  4700. return e(n = {
  4701. path: t,
  4702. exports: {},
  4703. require: function require(e, t) {
  4704. return function () {
  4705. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  4706. }(null == t && n.path);
  4707. }
  4708. }, n.exports), n.exports;
  4709. }
  4710. var r = s(function (e, t) {
  4711. var n;
  4712. e.exports = (n = n || function (e, t) {
  4713. var n = Object.create || function () {
  4714. function e() {}
  4715. return function (t) {
  4716. var n;
  4717. return e.prototype = t, n = new e(), e.prototype = null, n;
  4718. };
  4719. }(),
  4720. s = {},
  4721. r = s.lib = {},
  4722. i = r.Base = {
  4723. extend: function extend(e) {
  4724. var t = n(this);
  4725. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  4726. t.$super.init.apply(this, arguments);
  4727. }), t.init.prototype = t, t.$super = this, t;
  4728. },
  4729. create: function create() {
  4730. var e = this.extend();
  4731. return e.init.apply(e, arguments), e;
  4732. },
  4733. init: function init() {},
  4734. mixIn: function mixIn(e) {
  4735. for (var t in e) {
  4736. e.hasOwnProperty(t) && (this[t] = e[t]);
  4737. }
  4738. e.hasOwnProperty("toString") && (this.toString = e.toString);
  4739. },
  4740. clone: function clone() {
  4741. return this.init.prototype.extend(this);
  4742. }
  4743. },
  4744. o = r.WordArray = i.extend({
  4745. init: function init(e, n) {
  4746. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  4747. },
  4748. toString: function toString(e) {
  4749. return (e || c).stringify(this);
  4750. },
  4751. concat: function concat(e) {
  4752. var t = this.words,
  4753. n = e.words,
  4754. s = this.sigBytes,
  4755. r = e.sigBytes;
  4756. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  4757. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  4758. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  4759. } else for (i = 0; i < r; i += 4) {
  4760. t[s + i >>> 2] = n[i >>> 2];
  4761. }
  4762. return this.sigBytes += r, this;
  4763. },
  4764. clamp: function clamp() {
  4765. var t = this.words,
  4766. n = this.sigBytes;
  4767. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  4768. },
  4769. clone: function clone() {
  4770. var e = i.clone.call(this);
  4771. return e.words = this.words.slice(0), e;
  4772. },
  4773. random: function random(t) {
  4774. for (var n, s = [], r = function r(t) {
  4775. t = t;
  4776. var n = 987654321,
  4777. s = 4294967295;
  4778. return function () {
  4779. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  4780. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  4781. };
  4782. }, i = 0; i < t; i += 4) {
  4783. var a = r(4294967296 * (n || e.random()));
  4784. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  4785. }
  4786. return new o.init(s, t);
  4787. }
  4788. }),
  4789. a = s.enc = {},
  4790. c = a.Hex = {
  4791. stringify: function stringify(e) {
  4792. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  4793. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  4794. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  4795. }
  4796. return s.join("");
  4797. },
  4798. parse: function parse(e) {
  4799. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  4800. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  4801. }
  4802. return new o.init(n, t / 2);
  4803. }
  4804. },
  4805. u = a.Latin1 = {
  4806. stringify: function stringify(e) {
  4807. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  4808. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  4809. s.push(String.fromCharCode(i));
  4810. }
  4811. return s.join("");
  4812. },
  4813. parse: function parse(e) {
  4814. for (var t = e.length, n = [], s = 0; s < t; s++) {
  4815. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  4816. }
  4817. return new o.init(n, t);
  4818. }
  4819. },
  4820. l = a.Utf8 = {
  4821. stringify: function stringify(e) {
  4822. try {
  4823. return decodeURIComponent(escape(u.stringify(e)));
  4824. } catch (e) {
  4825. throw new Error("Malformed UTF-8 data");
  4826. }
  4827. },
  4828. parse: function parse(e) {
  4829. return u.parse(unescape(encodeURIComponent(e)));
  4830. }
  4831. },
  4832. h = r.BufferedBlockAlgorithm = i.extend({
  4833. reset: function reset() {
  4834. this._data = new o.init(), this._nDataBytes = 0;
  4835. },
  4836. _append: function _append(e) {
  4837. "string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  4838. },
  4839. _process: function _process(t) {
  4840. var n = this._data,
  4841. s = n.words,
  4842. r = n.sigBytes,
  4843. i = this.blockSize,
  4844. a = r / (4 * i),
  4845. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  4846. u = e.min(4 * c, r);
  4847. if (c) {
  4848. for (var l = 0; l < c; l += i) {
  4849. this._doProcessBlock(s, l);
  4850. }
  4851. var h = s.splice(0, c);
  4852. n.sigBytes -= u;
  4853. }
  4854. return new o.init(h, u);
  4855. },
  4856. clone: function clone() {
  4857. var e = i.clone.call(this);
  4858. return e._data = this._data.clone(), e;
  4859. },
  4860. _minBufferSize: 0
  4861. });
  4862. r.Hasher = h.extend({
  4863. cfg: i.extend(),
  4864. init: function init(e) {
  4865. this.cfg = this.cfg.extend(e), this.reset();
  4866. },
  4867. reset: function reset() {
  4868. h.reset.call(this), this._doReset();
  4869. },
  4870. update: function update(e) {
  4871. return this._append(e), this._process(), this;
  4872. },
  4873. finalize: function finalize(e) {
  4874. return e && this._append(e), this._doFinalize();
  4875. },
  4876. blockSize: 16,
  4877. _createHelper: function _createHelper(e) {
  4878. return function (t, n) {
  4879. return new e.init(n).finalize(t);
  4880. };
  4881. },
  4882. _createHmacHelper: function _createHmacHelper(e) {
  4883. return function (t, n) {
  4884. return new d.HMAC.init(e, n).finalize(t);
  4885. };
  4886. }
  4887. });
  4888. var d = s.algo = {};
  4889. return s;
  4890. }(Math), n);
  4891. }),
  4892. i = r,
  4893. o = (s(function (e, t) {
  4894. var n;
  4895. e.exports = (n = i, function (e) {
  4896. var t = n,
  4897. s = t.lib,
  4898. r = s.WordArray,
  4899. i = s.Hasher,
  4900. o = t.algo,
  4901. a = [];
  4902. !function () {
  4903. for (var t = 0; t < 64; t++) {
  4904. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  4905. }
  4906. }();
  4907. var c = o.MD5 = i.extend({
  4908. _doReset: function _doReset() {
  4909. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  4910. },
  4911. _doProcessBlock: function _doProcessBlock(e, t) {
  4912. for (var n = 0; n < 16; n++) {
  4913. var s = t + n,
  4914. r = e[s];
  4915. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  4916. }
  4917. var i = this._hash.words,
  4918. o = e[t + 0],
  4919. c = e[t + 1],
  4920. f = e[t + 2],
  4921. p = e[t + 3],
  4922. g = e[t + 4],
  4923. m = e[t + 5],
  4924. y = e[t + 6],
  4925. _ = e[t + 7],
  4926. w = e[t + 8],
  4927. v = e[t + 9],
  4928. S = e[t + 10],
  4929. k = e[t + 11],
  4930. I = e[t + 12],
  4931. b = e[t + 13],
  4932. T = e[t + 14],
  4933. A = e[t + 15],
  4934. C = i[0],
  4935. P = i[1],
  4936. E = i[2],
  4937. O = i[3];
  4938. C = u(C, P, E, O, o, 7, a[0]), O = u(O, C, P, E, c, 12, a[1]), E = u(E, O, C, P, f, 17, a[2]), P = u(P, E, O, C, p, 22, a[3]), C = u(C, P, E, O, g, 7, a[4]), O = u(O, C, P, E, m, 12, a[5]), E = u(E, O, C, P, y, 17, a[6]), P = u(P, E, O, C, _, 22, a[7]), C = u(C, P, E, O, w, 7, a[8]), O = u(O, C, P, E, v, 12, a[9]), E = u(E, O, C, P, S, 17, a[10]), P = u(P, E, O, C, k, 22, a[11]), C = u(C, P, E, O, I, 7, a[12]), O = u(O, C, P, E, b, 12, a[13]), E = u(E, O, C, P, T, 17, a[14]), C = l(C, P = u(P, E, O, C, A, 22, a[15]), E, O, c, 5, a[16]), O = l(O, C, P, E, y, 9, a[17]), E = l(E, O, C, P, k, 14, a[18]), P = l(P, E, O, C, o, 20, a[19]), C = l(C, P, E, O, m, 5, a[20]), O = l(O, C, P, E, S, 9, a[21]), E = l(E, O, C, P, A, 14, a[22]), P = l(P, E, O, C, g, 20, a[23]), C = l(C, P, E, O, v, 5, a[24]), O = l(O, C, P, E, T, 9, a[25]), E = l(E, O, C, P, p, 14, a[26]), P = l(P, E, O, C, w, 20, a[27]), C = l(C, P, E, O, b, 5, a[28]), O = l(O, C, P, E, f, 9, a[29]), E = l(E, O, C, P, _, 14, a[30]), C = h(C, P = l(P, E, O, C, I, 20, a[31]), E, O, m, 4, a[32]), O = h(O, C, P, E, w, 11, a[33]), E = h(E, O, C, P, k, 16, a[34]), P = h(P, E, O, C, T, 23, a[35]), C = h(C, P, E, O, c, 4, a[36]), O = h(O, C, P, E, g, 11, a[37]), E = h(E, O, C, P, _, 16, a[38]), P = h(P, E, O, C, S, 23, a[39]), C = h(C, P, E, O, b, 4, a[40]), O = h(O, C, P, E, o, 11, a[41]), E = h(E, O, C, P, p, 16, a[42]), P = h(P, E, O, C, y, 23, a[43]), C = h(C, P, E, O, v, 4, a[44]), O = h(O, C, P, E, I, 11, a[45]), E = h(E, O, C, P, A, 16, a[46]), C = d(C, P = h(P, E, O, C, f, 23, a[47]), E, O, o, 6, a[48]), O = d(O, C, P, E, _, 10, a[49]), E = d(E, O, C, P, T, 15, a[50]), P = d(P, E, O, C, m, 21, a[51]), C = d(C, P, E, O, I, 6, a[52]), O = d(O, C, P, E, p, 10, a[53]), E = d(E, O, C, P, S, 15, a[54]), P = d(P, E, O, C, c, 21, a[55]), C = d(C, P, E, O, w, 6, a[56]), O = d(O, C, P, E, A, 10, a[57]), E = d(E, O, C, P, y, 15, a[58]), P = d(P, E, O, C, b, 21, a[59]), C = d(C, P, E, O, g, 6, a[60]), O = d(O, C, P, E, k, 10, a[61]), E = d(E, O, C, P, f, 15, a[62]), P = d(P, E, O, C, v, 21, a[63]), i[0] = i[0] + C | 0, i[1] = i[1] + P | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  4939. },
  4940. _doFinalize: function _doFinalize() {
  4941. var t = this._data,
  4942. n = t.words,
  4943. s = 8 * this._nDataBytes,
  4944. r = 8 * t.sigBytes;
  4945. n[r >>> 5] |= 128 << 24 - r % 32;
  4946. var i = e.floor(s / 4294967296),
  4947. o = s;
  4948. 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();
  4949. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  4950. var l = c[u];
  4951. c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
  4952. }
  4953. return a;
  4954. },
  4955. clone: function clone() {
  4956. var e = i.clone.call(this);
  4957. return e._hash = this._hash.clone(), e;
  4958. }
  4959. });
  4960. function u(e, t, n, s, r, i, o) {
  4961. var a = e + (t & n | ~t & s) + r + o;
  4962. return (a << i | a >>> 32 - i) + t;
  4963. }
  4964. function l(e, t, n, s, r, i, o) {
  4965. var a = e + (t & s | n & ~s) + r + o;
  4966. return (a << i | a >>> 32 - i) + t;
  4967. }
  4968. function h(e, t, n, s, r, i, o) {
  4969. var a = e + (t ^ n ^ s) + r + o;
  4970. return (a << i | a >>> 32 - i) + t;
  4971. }
  4972. function d(e, t, n, s, r, i, o) {
  4973. var a = e + (n ^ (t | ~s)) + r + o;
  4974. return (a << i | a >>> 32 - i) + t;
  4975. }
  4976. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  4977. }(Math), n.MD5);
  4978. }), s(function (e, t) {
  4979. var n;
  4980. e.exports = (n = i, void function () {
  4981. var e = n,
  4982. t = e.lib.Base,
  4983. s = e.enc.Utf8;
  4984. e.algo.HMAC = t.extend({
  4985. init: function init(e, t) {
  4986. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  4987. var n = e.blockSize,
  4988. r = 4 * n;
  4989. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  4990. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  4991. a[u] ^= 1549556828, c[u] ^= 909522486;
  4992. }
  4993. i.sigBytes = o.sigBytes = r, this.reset();
  4994. },
  4995. reset: function reset() {
  4996. var e = this._hasher;
  4997. e.reset(), e.update(this._iKey);
  4998. },
  4999. update: function update(e) {
  5000. return this._hasher.update(e), this;
  5001. },
  5002. finalize: function finalize(e) {
  5003. var t = this._hasher,
  5004. n = t.finalize(e);
  5005. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  5006. }
  5007. });
  5008. }());
  5009. }), s(function (e, t) {
  5010. e.exports = i.HmacMD5;
  5011. })),
  5012. a = s(function (e, t) {
  5013. e.exports = i.enc.Utf8;
  5014. }),
  5015. c = s(function (e, t) {
  5016. var n;
  5017. e.exports = (n = i, function () {
  5018. var e = n,
  5019. t = e.lib.WordArray;
  5020. function s(e, n, s) {
  5021. for (var r = [], i = 0, o = 0; o < n; o++) {
  5022. if (o % 4) {
  5023. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  5024. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  5025. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  5026. }
  5027. }
  5028. return t.create(r, i);
  5029. }
  5030. e.enc.Base64 = {
  5031. stringify: function stringify(e) {
  5032. var t = e.words,
  5033. n = e.sigBytes,
  5034. s = this._map;
  5035. e.clamp();
  5036. for (var r = [], i = 0; i < n; i += 3) {
  5037. 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++) {
  5038. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  5039. }
  5040. }
  5041. var c = s.charAt(64);
  5042. if (c) for (; r.length % 4;) {
  5043. r.push(c);
  5044. }
  5045. return r.join("");
  5046. },
  5047. parse: function parse(e) {
  5048. var t = e.length,
  5049. n = this._map,
  5050. r = this._reverseMap;
  5051. if (!r) {
  5052. r = this._reverseMap = [];
  5053. for (var i = 0; i < n.length; i++) {
  5054. r[n.charCodeAt(i)] = i;
  5055. }
  5056. }
  5057. var o = n.charAt(64);
  5058. if (o) {
  5059. var a = e.indexOf(o);
  5060. -1 !== a && (t = a);
  5061. }
  5062. return s(e, t, r);
  5063. },
  5064. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  5065. };
  5066. }(), n.enc.Base64);
  5067. });
  5068. var u = "FUNCTION",
  5069. l = "OBJECT",
  5070. h = "CLIENT_DB";
  5071. function d(e) {
  5072. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  5073. }
  5074. function f(e) {
  5075. return "object" === d(e);
  5076. }
  5077. function p(e) {
  5078. return "function" == typeof e;
  5079. }
  5080. function g(e) {
  5081. return function () {
  5082. try {
  5083. return e.apply(e, arguments);
  5084. } catch (e) {
  5085. console.error(e);
  5086. }
  5087. };
  5088. }
  5089. function m(e) {
  5090. return e && "string" == typeof e ? JSON.parse(e) : e;
  5091. }
  5092. var y = "development" === "development",
  5093. _ = "mp-weixin",
  5094. w = "true" === undefined || !0 === undefined,
  5095. v = m([]),
  5096. S = "h5" === _ ? "web" : "app-plus" === _ ? "app" : _,
  5097. k = m(undefined),
  5098. I = m([]) || [],
  5099. b = true;
  5100. var T = "";
  5101. try {
  5102. {
  5103. var _e2 = __webpack_require__(/*! uni-stat-config */ 221).default || __webpack_require__(/*! uni-stat-config */ 221);
  5104. T = _e2.appid;
  5105. }
  5106. } catch (e) {}
  5107. var A = {};
  5108. function C(e) {
  5109. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5110. var n, s;
  5111. return n = A, s = e, Object.prototype.hasOwnProperty.call(n, s) || (A[e] = t), A[e];
  5112. }
  5113. "app" === S && (A = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  5114. var P = ["invoke", "success", "fail", "complete"],
  5115. E = C("_globalUniCloudInterceptor");
  5116. function O(e, t) {
  5117. E[e] || (E[e] = {}), f(t) && Object.keys(t).forEach(function (n) {
  5118. P.indexOf(n) > -1 && function (e, t, n) {
  5119. var s = E[e][t];
  5120. s || (s = E[e][t] = []), -1 === s.indexOf(n) && p(n) && s.push(n);
  5121. }(e, n, t[n]);
  5122. });
  5123. }
  5124. function x(e, t) {
  5125. E[e] || (E[e] = {}), f(t) ? Object.keys(t).forEach(function (n) {
  5126. P.indexOf(n) > -1 && function (e, t, n) {
  5127. var s = E[e][t];
  5128. if (!s) return;
  5129. var r = s.indexOf(n);
  5130. r > -1 && s.splice(r, 1);
  5131. }(e, n, t[n]);
  5132. }) : delete E[e];
  5133. }
  5134. function U(e, t) {
  5135. return e && 0 !== e.length ? e.reduce(function (e, n) {
  5136. return e.then(function () {
  5137. return n(t);
  5138. });
  5139. }, Promise.resolve()) : Promise.resolve();
  5140. }
  5141. function R(e, t) {
  5142. return E[e] && E[e][t] || [];
  5143. }
  5144. function L(e) {
  5145. O("callObject", e);
  5146. }
  5147. var N = C("_globalUniCloudListener"),
  5148. D = "response",
  5149. F = "needLogin",
  5150. q = "refreshToken",
  5151. K = "clientdb",
  5152. j = "cloudfunction",
  5153. M = "cloudobject";
  5154. function B(e) {
  5155. return N[e] || (N[e] = []), N[e];
  5156. }
  5157. function $(e, t) {
  5158. var n = B(e);
  5159. n.includes(t) || n.push(t);
  5160. }
  5161. function W(e, t) {
  5162. var n = B(e),
  5163. s = n.indexOf(t);
  5164. -1 !== s && n.splice(s, 1);
  5165. }
  5166. function z(e, t) {
  5167. var n = B(e);
  5168. for (var _e3 = 0; _e3 < n.length; _e3++) {
  5169. (0, n[_e3])(t);
  5170. }
  5171. }
  5172. var J,
  5173. H = !1;
  5174. function G() {
  5175. return J || (J = new Promise(function (e) {
  5176. H && e(), function t() {
  5177. if ("function" == typeof getCurrentPages) {
  5178. var _t2 = getCurrentPages();
  5179. _t2 && _t2[0] && (H = !0, e());
  5180. }
  5181. H || setTimeout(function () {
  5182. t();
  5183. }, 30);
  5184. }();
  5185. }), J);
  5186. }
  5187. function V(e) {
  5188. var t = {};
  5189. for (var _n2 in e) {
  5190. var _s2 = e[_n2];
  5191. p(_s2) && (t[_n2] = g(_s2));
  5192. }
  5193. return t;
  5194. }
  5195. function Y(e, t) {
  5196. return t ? function (n) {
  5197. var _this = this;
  5198. var s = !1;
  5199. if ("callFunction" === t) {
  5200. var _e4 = n && n.type || u;
  5201. s = _e4 !== u;
  5202. }
  5203. var r = "callFunction" === t && !s;
  5204. var i;
  5205. i = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {};
  5206. var _V = V(n),
  5207. o = _V.success,
  5208. a = _V.fail,
  5209. c = _V.complete,
  5210. l = i.then(function () {
  5211. return s ? Promise.resolve() : U(R(t, "invoke"), n);
  5212. }).then(function () {
  5213. return e.call(_this, n);
  5214. }).then(function (e) {
  5215. return s ? Promise.resolve(e) : U(R(t, "success"), e).then(function () {
  5216. return U(R(t, "complete"), e);
  5217. }).then(function () {
  5218. return r && z(D, {
  5219. type: j,
  5220. content: e
  5221. }), Promise.resolve(e);
  5222. });
  5223. }, function (e) {
  5224. return s ? Promise.reject(e) : U(R(t, "fail"), e).then(function () {
  5225. return U(R(t, "complete"), e);
  5226. }).then(function () {
  5227. return z(D, {
  5228. type: j,
  5229. content: e
  5230. }), Promise.reject(e);
  5231. });
  5232. });
  5233. if (!(o || a || c)) return l;
  5234. l.then(function (e) {
  5235. o && o(e), c && c(e), r && z(D, {
  5236. type: j,
  5237. content: e
  5238. });
  5239. }, function (e) {
  5240. a && a(e), c && c(e), r && z(D, {
  5241. type: j,
  5242. content: e
  5243. });
  5244. });
  5245. } : function (t) {
  5246. t = t || {};
  5247. var _V2 = V(t),
  5248. n = _V2.success,
  5249. s = _V2.fail,
  5250. r = _V2.complete;
  5251. if (!(n || s || r)) return e.call(this, t);
  5252. e.call(this, t).then(function (e) {
  5253. n && n(e), r && r(e);
  5254. }, function (e) {
  5255. s && s(e), r && r(e);
  5256. });
  5257. };
  5258. }
  5259. var Q = /*#__PURE__*/function (_Error) {
  5260. (0, _inherits2.default)(Q, _Error);
  5261. var _super = _createSuper(Q);
  5262. function Q(e) {
  5263. var _this2;
  5264. (0, _classCallCheck2.default)(this, Q);
  5265. _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;
  5266. return _this2;
  5267. }
  5268. (0, _createClass2.default)(Q, [{
  5269. key: "toJson",
  5270. value: function toJson() {
  5271. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  5272. if (!(e >= 10)) return e++, {
  5273. errCode: this.errCode,
  5274. errMsg: this.errMsg,
  5275. errSubject: this.errSubject,
  5276. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  5277. };
  5278. }
  5279. }]);
  5280. return Q;
  5281. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  5282. var X = {
  5283. request: function request(e) {
  5284. return uni.request(e);
  5285. },
  5286. uploadFile: function uploadFile(e) {
  5287. return uni.uploadFile(e);
  5288. },
  5289. setStorageSync: function setStorageSync(e, t) {
  5290. return uni.setStorageSync(e, t);
  5291. },
  5292. getStorageSync: function getStorageSync(e) {
  5293. return uni.getStorageSync(e);
  5294. },
  5295. removeStorageSync: function removeStorageSync(e) {
  5296. return uni.removeStorageSync(e);
  5297. },
  5298. clearStorageSync: function clearStorageSync() {
  5299. return uni.clearStorageSync();
  5300. }
  5301. };
  5302. function Z() {
  5303. return {
  5304. token: X.getStorageSync("uni_id_token") || X.getStorageSync("uniIdToken"),
  5305. tokenExpired: X.getStorageSync("uni_id_token_expired")
  5306. };
  5307. }
  5308. function ee() {
  5309. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5310. e = _ref.token,
  5311. t = _ref.tokenExpired;
  5312. e && X.setStorageSync("uni_id_token", e), t && X.setStorageSync("uni_id_token_expired", t);
  5313. }
  5314. function te() {
  5315. if (!y || "web" !== S) return;
  5316. uni.getStorageSync("__LAST_DCLOUD_APPID") !== T && (uni.setStorageSync("__LAST_DCLOUD_APPID", T), console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"), X.removeStorageSync("uni_id_token"), X.removeStorageSync("uniIdToken"), X.removeStorageSync("uni_id_token_expired"));
  5317. }
  5318. var ne, se;
  5319. function re() {
  5320. return ne || (ne = uni.getSystemInfoSync()), ne;
  5321. }
  5322. function ie() {
  5323. var e, t;
  5324. try {
  5325. if (uni.getLaunchOptionsSync) {
  5326. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  5327. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  5328. _n3 = _uni$getLaunchOptions.scene,
  5329. _s3 = _uni$getLaunchOptions.channel;
  5330. e = _s3, t = _n3;
  5331. }
  5332. } catch (e) {}
  5333. return {
  5334. channel: e,
  5335. scene: t
  5336. };
  5337. }
  5338. function oe() {
  5339. var e = uni.getLocale && uni.getLocale() || "en";
  5340. if (se) return _objectSpread(_objectSpread({}, se), {}, {
  5341. locale: e,
  5342. LOCALE: e
  5343. });
  5344. var t = re(),
  5345. n = t.deviceId,
  5346. s = t.osName,
  5347. r = t.uniPlatform,
  5348. i = t.appId,
  5349. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  5350. for (var _e5 = 0; _e5 < o.length; _e5++) {
  5351. delete t[o[_e5]];
  5352. }
  5353. return se = _objectSpread(_objectSpread({
  5354. PLATFORM: r,
  5355. OS: s,
  5356. APPID: i,
  5357. DEVICEID: n
  5358. }, ie()), t), _objectSpread(_objectSpread({}, se), {}, {
  5359. locale: e,
  5360. LOCALE: e
  5361. });
  5362. }
  5363. var ae = {
  5364. sign: function sign(e, t) {
  5365. var n = "";
  5366. return Object.keys(e).sort().forEach(function (t) {
  5367. e[t] && (n = n + "&" + t + "=" + e[t]);
  5368. }), n = n.slice(1), o(n, t).toString();
  5369. },
  5370. wrappedRequest: function wrappedRequest(e, t) {
  5371. return new Promise(function (n, s) {
  5372. t(Object.assign(e, {
  5373. complete: function complete(e) {
  5374. e || (e = {}), y && "web" === S && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  5375. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  5376. if (!e.statusCode || e.statusCode >= 400) return s(new Q({
  5377. code: "SYS_ERR",
  5378. message: e.errMsg || "request:fail",
  5379. requestId: t
  5380. }));
  5381. var r = e.data;
  5382. if (r.error) return s(new Q({
  5383. code: r.error.code,
  5384. message: r.error.message,
  5385. requestId: t
  5386. }));
  5387. r.result = r.data, r.requestId = t, delete r.data, n(r);
  5388. }
  5389. }));
  5390. });
  5391. },
  5392. toBase64: function toBase64(e) {
  5393. return c.stringify(a.parse(e));
  5394. }
  5395. },
  5396. ce = {
  5397. "uniCloud.init.paramRequired": "{param} required",
  5398. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  5399. };
  5400. var _e6 = (0, _uniI18n.initVueI18n)({
  5401. "zh-Hans": {
  5402. "uniCloud.init.paramRequired": "缺少参数:{param}",
  5403. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  5404. },
  5405. "zh-Hant": {
  5406. "uniCloud.init.paramRequired": "缺少参数:{param}",
  5407. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  5408. },
  5409. en: ce,
  5410. fr: {
  5411. "uniCloud.init.paramRequired": "{param} required",
  5412. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  5413. },
  5414. es: {
  5415. "uniCloud.init.paramRequired": "{param} required",
  5416. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  5417. },
  5418. ja: ce
  5419. }, "zh-Hans"),
  5420. ue = _e6.t;
  5421. var le = /*#__PURE__*/function () {
  5422. function le(e) {
  5423. (0, _classCallCheck2.default)(this, le);
  5424. ["spaceId", "clientSecret"].forEach(function (t) {
  5425. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(ue("uniCloud.init.paramRequired", {
  5426. param: t
  5427. }));
  5428. }), this.config = Object.assign({}, {
  5429. endpoint: "https://api.bspapp.com"
  5430. }, 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 = X, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null;
  5431. }
  5432. (0, _createClass2.default)(le, [{
  5433. key: "hasAccessToken",
  5434. get: function get() {
  5435. return !!this.accessToken;
  5436. }
  5437. }, {
  5438. key: "setAccessToken",
  5439. value: function setAccessToken(e) {
  5440. this.accessToken = e;
  5441. }
  5442. }, {
  5443. key: "requestWrapped",
  5444. value: function requestWrapped(e) {
  5445. return ae.wrappedRequest(e, this.adapter.request);
  5446. }
  5447. }, {
  5448. key: "requestAuth",
  5449. value: function requestAuth(e) {
  5450. return this.requestWrapped(e);
  5451. }
  5452. }, {
  5453. key: "request",
  5454. value: function request(e, t) {
  5455. var _this3 = this;
  5456. return Promise.resolve().then(function () {
  5457. return _this3.hasAccessToken ? t ? _this3.requestWrapped(e) : _this3.requestWrapped(e).catch(function (t) {
  5458. return new Promise(function (e, n) {
  5459. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  5460. }).then(function () {
  5461. return _this3.getAccessToken();
  5462. }).then(function () {
  5463. var t = _this3.rebuildRequest(e);
  5464. return _this3.request(t, !0);
  5465. });
  5466. }) : _this3.getAccessToken().then(function () {
  5467. var t = _this3.rebuildRequest(e);
  5468. return _this3.request(t, !0);
  5469. });
  5470. });
  5471. }
  5472. }, {
  5473. key: "rebuildRequest",
  5474. value: function rebuildRequest(e) {
  5475. var t = Object.assign({}, e);
  5476. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = ae.sign(t.data, this.config.clientSecret), t;
  5477. }
  5478. }, {
  5479. key: "setupRequest",
  5480. value: function setupRequest(e, t) {
  5481. var n = Object.assign({}, e, {
  5482. spaceId: this.config.spaceId,
  5483. timestamp: Date.now()
  5484. }),
  5485. s = {
  5486. "Content-Type": "application/json"
  5487. };
  5488. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = ae.sign(n, this.config.clientSecret), {
  5489. url: this.config.requestUrl,
  5490. method: "POST",
  5491. data: n,
  5492. dataType: "json",
  5493. header: s
  5494. };
  5495. }
  5496. }, {
  5497. key: "getAccessToken",
  5498. value: function getAccessToken() {
  5499. var _this4 = this;
  5500. if ("pending" === this._getAccessTokenPromiseStatus) return this._getAccessTokenPromise;
  5501. this._getAccessTokenPromiseStatus = "pending";
  5502. return this._getAccessTokenPromise = this.requestAuth(this.setupRequest({
  5503. method: "serverless.auth.user.anonymousAuthorize",
  5504. params: "{}"
  5505. }, "auth")).then(function (e) {
  5506. return new Promise(function (t, n) {
  5507. e.result && e.result.accessToken ? (_this4.setAccessToken(e.result.accessToken), _this4._getAccessTokenPromiseStatus = "fulfilled", t(_this4.accessToken)) : (_this4._getAccessTokenPromiseStatus = "rejected", n(new Q({
  5508. code: "AUTH_FAILED",
  5509. message: "获取accessToken失败"
  5510. })));
  5511. });
  5512. }, function (e) {
  5513. return _this4._getAccessTokenPromiseStatus = "rejected", Promise.reject(e);
  5514. }), this._getAccessTokenPromise;
  5515. }
  5516. }, {
  5517. key: "authorize",
  5518. value: function authorize() {
  5519. this.getAccessToken();
  5520. }
  5521. }, {
  5522. key: "callFunction",
  5523. value: function callFunction(e) {
  5524. var t = {
  5525. method: "serverless.function.runtime.invoke",
  5526. params: JSON.stringify({
  5527. functionTarget: e.name,
  5528. functionArgs: e.data || {}
  5529. })
  5530. };
  5531. return this.request(this.setupRequest(t));
  5532. }
  5533. }, {
  5534. key: "getOSSUploadOptionsFromPath",
  5535. value: function getOSSUploadOptionsFromPath(e) {
  5536. var t = {
  5537. method: "serverless.file.resource.generateProximalSign",
  5538. params: JSON.stringify(e)
  5539. };
  5540. return this.request(this.setupRequest(t));
  5541. }
  5542. }, {
  5543. key: "uploadFileToOSS",
  5544. value: function uploadFileToOSS(_ref2) {
  5545. var _this5 = this;
  5546. var e = _ref2.url,
  5547. t = _ref2.formData,
  5548. n = _ref2.name,
  5549. s = _ref2.filePath,
  5550. r = _ref2.fileType,
  5551. i = _ref2.onUploadProgress;
  5552. return new Promise(function (o, a) {
  5553. var c = _this5.adapter.uploadFile({
  5554. url: e,
  5555. formData: t,
  5556. name: n,
  5557. filePath: s,
  5558. fileType: r,
  5559. header: {
  5560. "X-OSS-server-side-encrpytion": "AES256"
  5561. },
  5562. success: function success(e) {
  5563. e && e.statusCode < 400 ? o(e) : a(new Q({
  5564. code: "UPLOAD_FAILED",
  5565. message: "文件上传失败"
  5566. }));
  5567. },
  5568. fail: function fail(e) {
  5569. a(new Q({
  5570. code: e.code || "UPLOAD_FAILED",
  5571. message: e.message || e.errMsg || "文件上传失败"
  5572. }));
  5573. }
  5574. });
  5575. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  5576. i({
  5577. loaded: e.totalBytesSent,
  5578. total: e.totalBytesExpectedToSend
  5579. });
  5580. });
  5581. });
  5582. }
  5583. }, {
  5584. key: "reportOSSUpload",
  5585. value: function reportOSSUpload(e) {
  5586. var t = {
  5587. method: "serverless.file.resource.report",
  5588. params: JSON.stringify(e)
  5589. };
  5590. return this.request(this.setupRequest(t));
  5591. }
  5592. }, {
  5593. key: "uploadFile",
  5594. value: function () {
  5595. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref3) {
  5596. var e, t, _ref3$fileType, n, s, r, i, o, a, c, u, l, h, f, p, g, m, y, _e7, _;
  5597. return _regenerator.default.wrap(function _callee$(_context) {
  5598. while (1) {
  5599. switch (_context.prev = _context.next) {
  5600. case 0:
  5601. e = _ref3.filePath, t = _ref3.cloudPath, _ref3$fileType = _ref3.fileType, n = _ref3$fileType === void 0 ? "image" : _ref3$fileType, s = _ref3.onUploadProgress, r = _ref3.config;
  5602. if (!("string" !== d(t))) {
  5603. _context.next = 3;
  5604. break;
  5605. }
  5606. throw new Q({
  5607. code: "INVALID_PARAM",
  5608. message: "cloudPath必须为字符串类型"
  5609. });
  5610. case 3:
  5611. if (t = t.trim()) {
  5612. _context.next = 5;
  5613. break;
  5614. }
  5615. throw new Q({
  5616. code: "CLOUDPATH_REQUIRED",
  5617. message: "cloudPath不可为空"
  5618. });
  5619. case 5:
  5620. if (!/:\/\//.test(t)) {
  5621. _context.next = 7;
  5622. break;
  5623. }
  5624. throw new Q({
  5625. code: "INVALID_PARAM",
  5626. message: "cloudPath不合法"
  5627. });
  5628. case 7:
  5629. i = r && r.envType || this.config.envType;
  5630. _context.next = 10;
  5631. return this.getOSSUploadOptionsFromPath({
  5632. env: i,
  5633. filename: t
  5634. });
  5635. case 10:
  5636. o = _context.sent.result;
  5637. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  5638. c = o.securityToken;
  5639. u = o.accessKeyId;
  5640. l = o.signature;
  5641. h = o.host;
  5642. f = o.ossPath;
  5643. p = o.id;
  5644. g = o.policy;
  5645. m = o.ossCallbackUrl;
  5646. y = {
  5647. "Cache-Control": "max-age=2592000",
  5648. "Content-Disposition": "attachment",
  5649. OSSAccessKeyId: u,
  5650. Signature: l,
  5651. host: h,
  5652. id: p,
  5653. key: f,
  5654. policy: g,
  5655. success_action_status: 200
  5656. };
  5657. if (c && (y["x-oss-security-token"] = c), m) {
  5658. _e7 = JSON.stringify({
  5659. callbackUrl: m,
  5660. callbackBody: JSON.stringify({
  5661. fileId: p,
  5662. spaceId: this.config.spaceId
  5663. }),
  5664. callbackBodyType: "application/json"
  5665. });
  5666. y.callback = ae.toBase64(_e7);
  5667. }
  5668. _ = {
  5669. url: "https://" + o.host,
  5670. formData: y,
  5671. fileName: "file",
  5672. name: "file",
  5673. filePath: e,
  5674. fileType: n
  5675. };
  5676. _context.next = 25;
  5677. return this.uploadFileToOSS(Object.assign({}, _, {
  5678. onUploadProgress: s
  5679. }));
  5680. case 25:
  5681. if (!m) {
  5682. _context.next = 27;
  5683. break;
  5684. }
  5685. return _context.abrupt("return", {
  5686. success: !0,
  5687. filePath: e,
  5688. fileID: a
  5689. });
  5690. case 27:
  5691. _context.next = 29;
  5692. return this.reportOSSUpload({
  5693. id: p
  5694. });
  5695. case 29:
  5696. if (!_context.sent.success) {
  5697. _context.next = 31;
  5698. break;
  5699. }
  5700. return _context.abrupt("return", {
  5701. success: !0,
  5702. filePath: e,
  5703. fileID: a
  5704. });
  5705. case 31:
  5706. throw new Q({
  5707. code: "UPLOAD_FAILED",
  5708. message: "文件上传失败"
  5709. });
  5710. case 32:
  5711. case "end":
  5712. return _context.stop();
  5713. }
  5714. }
  5715. }, _callee, this);
  5716. }));
  5717. function uploadFile(_x) {
  5718. return _uploadFile.apply(this, arguments);
  5719. }
  5720. return uploadFile;
  5721. }()
  5722. }, {
  5723. key: "getTempFileURL",
  5724. value: function getTempFileURL() {
  5725. var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5726. e = _ref4.fileList;
  5727. return new Promise(function (t, n) {
  5728. Array.isArray(e) && 0 !== e.length || n(new Q({
  5729. code: "INVALID_PARAM",
  5730. message: "fileList的元素必须是非空的字符串"
  5731. })), t({
  5732. fileList: e.map(function (e) {
  5733. return {
  5734. fileID: e,
  5735. tempFileURL: e
  5736. };
  5737. })
  5738. });
  5739. });
  5740. }
  5741. }, {
  5742. key: "getFileInfo",
  5743. value: function () {
  5744. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  5745. var _ref5,
  5746. e,
  5747. t,
  5748. _args2 = arguments;
  5749. return _regenerator.default.wrap(function _callee2$(_context2) {
  5750. while (1) {
  5751. switch (_context2.prev = _context2.next) {
  5752. case 0:
  5753. _ref5 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref5.fileList;
  5754. if (!(!Array.isArray(e) || 0 === e.length)) {
  5755. _context2.next = 3;
  5756. break;
  5757. }
  5758. throw new Q({
  5759. code: "INVALID_PARAM",
  5760. message: "fileList的元素必须是非空的字符串"
  5761. });
  5762. case 3:
  5763. t = {
  5764. method: "serverless.file.resource.info",
  5765. params: JSON.stringify({
  5766. id: e.map(function (e) {
  5767. return e.split("?")[0];
  5768. }).join(",")
  5769. })
  5770. };
  5771. _context2.next = 6;
  5772. return this.request(this.setupRequest(t));
  5773. case 6:
  5774. _context2.t0 = _context2.sent.result;
  5775. return _context2.abrupt("return", {
  5776. fileList: _context2.t0
  5777. });
  5778. case 8:
  5779. case "end":
  5780. return _context2.stop();
  5781. }
  5782. }
  5783. }, _callee2, this);
  5784. }));
  5785. function getFileInfo() {
  5786. return _getFileInfo.apply(this, arguments);
  5787. }
  5788. return getFileInfo;
  5789. }()
  5790. }]);
  5791. return le;
  5792. }();
  5793. var he = {
  5794. init: function init(e) {
  5795. var t = new le(e),
  5796. n = {
  5797. signInAnonymously: function signInAnonymously() {
  5798. return t.authorize();
  5799. },
  5800. getLoginState: function getLoginState() {
  5801. return Promise.resolve(!1);
  5802. }
  5803. };
  5804. return t.auth = function () {
  5805. return n;
  5806. }, t.customAuth = t.auth, t;
  5807. }
  5808. };
  5809. var de = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  5810. var fe;
  5811. !function (e) {
  5812. e.local = "local", e.none = "none", e.session = "session";
  5813. }(fe || (fe = {}));
  5814. var pe = function pe() {};
  5815. var ge = function ge() {
  5816. var e;
  5817. if (!Promise) {
  5818. e = function e() {}, e.promise = {};
  5819. var _t3 = function _t3() {
  5820. throw new Q({
  5821. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  5822. });
  5823. };
  5824. return Object.defineProperty(e.promise, "then", {
  5825. get: _t3
  5826. }), Object.defineProperty(e.promise, "catch", {
  5827. get: _t3
  5828. }), e;
  5829. }
  5830. var t = new Promise(function (t, n) {
  5831. e = function e(_e8, s) {
  5832. return _e8 ? n(_e8) : t(s);
  5833. };
  5834. });
  5835. return e.promise = t, e;
  5836. };
  5837. function me(e) {
  5838. return void 0 === e;
  5839. }
  5840. function ye(e) {
  5841. return "[object Null]" === Object.prototype.toString.call(e);
  5842. }
  5843. var _e;
  5844. function we(e) {
  5845. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  5846. var n;
  5847. var _iterator = _createForOfIteratorHelper(t),
  5848. _step;
  5849. try {
  5850. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5851. var _e9 = _step.value;
  5852. var _t4 = _e9.isMatch,
  5853. _n4 = _e9.genAdapter,
  5854. _s4 = _e9.runtime;
  5855. if (_t4()) return {
  5856. adapter: _n4(),
  5857. runtime: _s4
  5858. };
  5859. }
  5860. } catch (err) {
  5861. _iterator.e(err);
  5862. } finally {
  5863. _iterator.f();
  5864. }
  5865. }
  5866. !function (e) {
  5867. e.WEB = "web", e.WX_MP = "wx_mp";
  5868. }(_e || (_e = {}));
  5869. var ve = {
  5870. adapter: null,
  5871. runtime: void 0
  5872. },
  5873. Se = ["anonymousUuidKey"];
  5874. var ke = /*#__PURE__*/function (_pe) {
  5875. (0, _inherits2.default)(ke, _pe);
  5876. var _super2 = _createSuper(ke);
  5877. function ke() {
  5878. var _this6;
  5879. (0, _classCallCheck2.default)(this, ke);
  5880. _this6 = _super2.call(this), ve.adapter.root.tcbObject || (ve.adapter.root.tcbObject = {});
  5881. return _this6;
  5882. }
  5883. (0, _createClass2.default)(ke, [{
  5884. key: "setItem",
  5885. value: function setItem(e, t) {
  5886. ve.adapter.root.tcbObject[e] = t;
  5887. }
  5888. }, {
  5889. key: "getItem",
  5890. value: function getItem(e) {
  5891. return ve.adapter.root.tcbObject[e];
  5892. }
  5893. }, {
  5894. key: "removeItem",
  5895. value: function removeItem(e) {
  5896. delete ve.adapter.root.tcbObject[e];
  5897. }
  5898. }, {
  5899. key: "clear",
  5900. value: function clear() {
  5901. delete ve.adapter.root.tcbObject;
  5902. }
  5903. }]);
  5904. return ke;
  5905. }(pe);
  5906. function Ie(e, t) {
  5907. switch (e) {
  5908. case "local":
  5909. return t.localStorage || new ke();
  5910. case "none":
  5911. return new ke();
  5912. default:
  5913. return t.sessionStorage || new ke();
  5914. }
  5915. }
  5916. var be = /*#__PURE__*/function () {
  5917. function be(e) {
  5918. (0, _classCallCheck2.default)(this, be);
  5919. if (!this._storage) {
  5920. this._persistence = ve.adapter.primaryStorage || e.persistence, this._storage = Ie(this._persistence, ve.adapter);
  5921. var _t5 = "access_token_".concat(e.env),
  5922. _n5 = "access_token_expire_".concat(e.env),
  5923. _s5 = "refresh_token_".concat(e.env),
  5924. _r = "anonymous_uuid_".concat(e.env),
  5925. _i = "login_type_".concat(e.env),
  5926. _o = "user_info_".concat(e.env);
  5927. this.keys = {
  5928. accessTokenKey: _t5,
  5929. accessTokenExpireKey: _n5,
  5930. refreshTokenKey: _s5,
  5931. anonymousUuidKey: _r,
  5932. loginTypeKey: _i,
  5933. userInfoKey: _o
  5934. };
  5935. }
  5936. }
  5937. (0, _createClass2.default)(be, [{
  5938. key: "updatePersistence",
  5939. value: function updatePersistence(e) {
  5940. if (e === this._persistence) return;
  5941. var t = "local" === this._persistence;
  5942. this._persistence = e;
  5943. var n = Ie(e, ve.adapter);
  5944. for (var _e10 in this.keys) {
  5945. var _s6 = this.keys[_e10];
  5946. if (t && Se.includes(_e10)) continue;
  5947. var _r2 = this._storage.getItem(_s6);
  5948. me(_r2) || ye(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  5949. }
  5950. this._storage = n;
  5951. }
  5952. }, {
  5953. key: "setStore",
  5954. value: function setStore(e, t, n) {
  5955. if (!this._storage) return;
  5956. var s = {
  5957. version: n || "localCachev1",
  5958. content: t
  5959. },
  5960. r = JSON.stringify(s);
  5961. try {
  5962. this._storage.setItem(e, r);
  5963. } catch (e) {
  5964. throw e;
  5965. }
  5966. }
  5967. }, {
  5968. key: "getStore",
  5969. value: function getStore(e, t) {
  5970. try {
  5971. if (!this._storage) return;
  5972. } catch (e) {
  5973. return "";
  5974. }
  5975. t = t || "localCachev1";
  5976. var n = this._storage.getItem(e);
  5977. if (!n) return "";
  5978. if (n.indexOf(t) >= 0) {
  5979. return JSON.parse(n).content;
  5980. }
  5981. return "";
  5982. }
  5983. }, {
  5984. key: "removeStore",
  5985. value: function removeStore(e) {
  5986. this._storage.removeItem(e);
  5987. }
  5988. }]);
  5989. return be;
  5990. }();
  5991. var Te = {},
  5992. Ae = {};
  5993. function Ce(e) {
  5994. return Te[e];
  5995. }
  5996. var Pe = /*#__PURE__*/(0, _createClass2.default)(function Pe(e, t) {
  5997. (0, _classCallCheck2.default)(this, Pe);
  5998. this.data = t || null, this.name = e;
  5999. });
  6000. var Ee = /*#__PURE__*/function (_Pe) {
  6001. (0, _inherits2.default)(Ee, _Pe);
  6002. var _super3 = _createSuper(Ee);
  6003. function Ee(e, t) {
  6004. var _this7;
  6005. (0, _classCallCheck2.default)(this, Ee);
  6006. _this7 = _super3.call(this, "error", {
  6007. error: e,
  6008. data: t
  6009. }), _this7.error = e;
  6010. return _this7;
  6011. }
  6012. return (0, _createClass2.default)(Ee);
  6013. }(Pe);
  6014. var Oe = new ( /*#__PURE__*/function () {
  6015. function _class() {
  6016. (0, _classCallCheck2.default)(this, _class);
  6017. this._listeners = {};
  6018. }
  6019. (0, _createClass2.default)(_class, [{
  6020. key: "on",
  6021. value: function on(e, t) {
  6022. return function (e, t, n) {
  6023. n[e] = n[e] || [], n[e].push(t);
  6024. }(e, t, this._listeners), this;
  6025. }
  6026. }, {
  6027. key: "off",
  6028. value: function off(e, t) {
  6029. return function (e, t, n) {
  6030. if (n && n[e]) {
  6031. var _s7 = n[e].indexOf(t);
  6032. -1 !== _s7 && n[e].splice(_s7, 1);
  6033. }
  6034. }(e, t, this._listeners), this;
  6035. }
  6036. }, {
  6037. key: "fire",
  6038. value: function fire(e, t) {
  6039. if (e instanceof Ee) return console.error(e.error), this;
  6040. var n = "string" == typeof e ? new Pe(e, t || {}) : e;
  6041. var s = n.name;
  6042. if (this._listens(s)) {
  6043. n.target = this;
  6044. var _e11 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  6045. var _iterator2 = _createForOfIteratorHelper(_e11),
  6046. _step2;
  6047. try {
  6048. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  6049. var _t6 = _step2.value;
  6050. _t6.call(this, n);
  6051. }
  6052. } catch (err) {
  6053. _iterator2.e(err);
  6054. } finally {
  6055. _iterator2.f();
  6056. }
  6057. }
  6058. return this;
  6059. }
  6060. }, {
  6061. key: "_listens",
  6062. value: function _listens(e) {
  6063. return this._listeners[e] && this._listeners[e].length > 0;
  6064. }
  6065. }]);
  6066. return _class;
  6067. }())();
  6068. function xe(e, t) {
  6069. Oe.on(e, t);
  6070. }
  6071. function Ue(e) {
  6072. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6073. Oe.fire(e, t);
  6074. }
  6075. function Re(e, t) {
  6076. Oe.off(e, t);
  6077. }
  6078. var Le = "loginStateChanged",
  6079. Ne = "loginStateExpire",
  6080. De = "loginTypeChanged",
  6081. Fe = "anonymousConverted",
  6082. qe = "refreshAccessToken";
  6083. var Ke;
  6084. !function (e) {
  6085. 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";
  6086. }(Ke || (Ke = {}));
  6087. var je = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  6088. Me = {
  6089. "X-SDK-Version": "1.3.5"
  6090. };
  6091. function Be(e, t, n) {
  6092. var s = e[t];
  6093. e[t] = function (t) {
  6094. var r = {},
  6095. i = {};
  6096. n.forEach(function (n) {
  6097. var _n$call = n.call(e, t),
  6098. s = _n$call.data,
  6099. o = _n$call.headers;
  6100. Object.assign(r, s), Object.assign(i, o);
  6101. });
  6102. var o = t.data;
  6103. return o && function () {
  6104. var e;
  6105. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e12 in r) {
  6106. o.append(_e12, r[_e12]);
  6107. }
  6108. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  6109. };
  6110. }
  6111. function $e() {
  6112. var e = Math.random().toString(16).slice(2);
  6113. return {
  6114. data: {
  6115. seqId: e
  6116. },
  6117. headers: _objectSpread(_objectSpread({}, Me), {}, {
  6118. "x-seqid": e
  6119. })
  6120. };
  6121. }
  6122. var We = /*#__PURE__*/function () {
  6123. function We() {
  6124. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6125. (0, _classCallCheck2.default)(this, We);
  6126. var t;
  6127. this.config = e, this._reqClass = new ve.adapter.reqClass({
  6128. timeout: this.config.timeout,
  6129. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  6130. restrictedMethods: ["post"]
  6131. }), this._cache = Ce(this.config.env), this._localCache = (t = this.config.env, Ae[t]), Be(this._reqClass, "post", [$e]), Be(this._reqClass, "upload", [$e]), Be(this._reqClass, "download", [$e]);
  6132. }
  6133. (0, _createClass2.default)(We, [{
  6134. key: "post",
  6135. value: function () {
  6136. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(e) {
  6137. return _regenerator.default.wrap(function _callee3$(_context3) {
  6138. while (1) {
  6139. switch (_context3.prev = _context3.next) {
  6140. case 0:
  6141. _context3.next = 2;
  6142. return this._reqClass.post(e);
  6143. case 2:
  6144. return _context3.abrupt("return", _context3.sent);
  6145. case 3:
  6146. case "end":
  6147. return _context3.stop();
  6148. }
  6149. }
  6150. }, _callee3, this);
  6151. }));
  6152. function post(_x2) {
  6153. return _post.apply(this, arguments);
  6154. }
  6155. return post;
  6156. }()
  6157. }, {
  6158. key: "upload",
  6159. value: function () {
  6160. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  6161. return _regenerator.default.wrap(function _callee4$(_context4) {
  6162. while (1) {
  6163. switch (_context4.prev = _context4.next) {
  6164. case 0:
  6165. _context4.next = 2;
  6166. return this._reqClass.upload(e);
  6167. case 2:
  6168. return _context4.abrupt("return", _context4.sent);
  6169. case 3:
  6170. case "end":
  6171. return _context4.stop();
  6172. }
  6173. }
  6174. }, _callee4, this);
  6175. }));
  6176. function upload(_x3) {
  6177. return _upload.apply(this, arguments);
  6178. }
  6179. return upload;
  6180. }()
  6181. }, {
  6182. key: "download",
  6183. value: function () {
  6184. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  6185. return _regenerator.default.wrap(function _callee5$(_context5) {
  6186. while (1) {
  6187. switch (_context5.prev = _context5.next) {
  6188. case 0:
  6189. _context5.next = 2;
  6190. return this._reqClass.download(e);
  6191. case 2:
  6192. return _context5.abrupt("return", _context5.sent);
  6193. case 3:
  6194. case "end":
  6195. return _context5.stop();
  6196. }
  6197. }
  6198. }, _callee5, this);
  6199. }));
  6200. function download(_x4) {
  6201. return _download.apply(this, arguments);
  6202. }
  6203. return download;
  6204. }()
  6205. }, {
  6206. key: "refreshAccessToken",
  6207. value: function () {
  6208. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
  6209. var e, t;
  6210. return _regenerator.default.wrap(function _callee6$(_context6) {
  6211. while (1) {
  6212. switch (_context6.prev = _context6.next) {
  6213. case 0:
  6214. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  6215. _context6.prev = 1;
  6216. _context6.next = 4;
  6217. return this._refreshAccessTokenPromise;
  6218. case 4:
  6219. e = _context6.sent;
  6220. _context6.next = 10;
  6221. break;
  6222. case 7:
  6223. _context6.prev = 7;
  6224. _context6.t0 = _context6["catch"](1);
  6225. t = _context6.t0;
  6226. case 10:
  6227. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  6228. _context6.next = 12;
  6229. break;
  6230. }
  6231. throw t;
  6232. case 12:
  6233. return _context6.abrupt("return", e);
  6234. case 13:
  6235. case "end":
  6236. return _context6.stop();
  6237. }
  6238. }
  6239. }, _callee6, this, [[1, 7]]);
  6240. }));
  6241. function refreshAccessToken() {
  6242. return _refreshAccessToken2.apply(this, arguments);
  6243. }
  6244. return refreshAccessToken;
  6245. }()
  6246. }, {
  6247. key: "_refreshAccessToken",
  6248. value: function () {
  6249. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  6250. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e13, _e14, _t7, _s8;
  6251. return _regenerator.default.wrap(function _callee7$(_context7) {
  6252. while (1) {
  6253. switch (_context7.prev = _context7.next) {
  6254. case 0:
  6255. _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;
  6256. this._cache.removeStore(e), this._cache.removeStore(t);
  6257. i = this._cache.getStore(n);
  6258. if (i) {
  6259. _context7.next = 5;
  6260. break;
  6261. }
  6262. throw new Q({
  6263. message: "未登录CloudBase"
  6264. });
  6265. case 5:
  6266. o = {
  6267. refresh_token: i
  6268. };
  6269. _context7.next = 8;
  6270. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  6271. case 8:
  6272. a = _context7.sent;
  6273. if (!a.data.code) {
  6274. _context7.next = 21;
  6275. break;
  6276. }
  6277. _e13 = a.data.code;
  6278. if (!("SIGN_PARAM_INVALID" === _e13 || "REFRESH_TOKEN_EXPIRED" === _e13 || "INVALID_REFRESH_TOKEN" === _e13)) {
  6279. _context7.next = 20;
  6280. break;
  6281. }
  6282. if (!(this._cache.getStore(s) === Ke.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e13)) {
  6283. _context7.next = 19;
  6284. break;
  6285. }
  6286. _e14 = this._cache.getStore(r);
  6287. _t7 = this._cache.getStore(n);
  6288. _context7.next = 17;
  6289. return this.send("auth.signInAnonymously", {
  6290. anonymous_uuid: _e14,
  6291. refresh_token: _t7
  6292. });
  6293. case 17:
  6294. _s8 = _context7.sent;
  6295. return _context7.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  6296. case 19:
  6297. Ue(Ne), this._cache.removeStore(n);
  6298. case 20:
  6299. throw new Q({
  6300. code: a.data.code,
  6301. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  6302. });
  6303. case 21:
  6304. if (!a.data.access_token) {
  6305. _context7.next = 23;
  6306. break;
  6307. }
  6308. return _context7.abrupt("return", (Ue(qe), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  6309. accessToken: a.data.access_token,
  6310. accessTokenExpire: a.data.access_token_expire
  6311. }));
  6312. case 23:
  6313. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  6314. case 24:
  6315. case "end":
  6316. return _context7.stop();
  6317. }
  6318. }
  6319. }, _callee7, this);
  6320. }));
  6321. function _refreshAccessToken() {
  6322. return _refreshAccessToken3.apply(this, arguments);
  6323. }
  6324. return _refreshAccessToken;
  6325. }()
  6326. }, {
  6327. key: "getAccessToken",
  6328. value: function () {
  6329. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  6330. var _this$_cache$keys2, e, t, n, s, r, i;
  6331. return _regenerator.default.wrap(function _callee8$(_context8) {
  6332. while (1) {
  6333. switch (_context8.prev = _context8.next) {
  6334. case 0:
  6335. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  6336. if (this._cache.getStore(n)) {
  6337. _context8.next = 3;
  6338. break;
  6339. }
  6340. throw new Q({
  6341. message: "refresh token不存在,登录状态异常"
  6342. });
  6343. case 3:
  6344. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  6345. _context8.t0 = this._shouldRefreshAccessTokenHook;
  6346. if (!_context8.t0) {
  6347. _context8.next = 9;
  6348. break;
  6349. }
  6350. _context8.next = 8;
  6351. return this._shouldRefreshAccessTokenHook(s, r);
  6352. case 8:
  6353. _context8.t0 = !_context8.sent;
  6354. case 9:
  6355. _context8.t1 = _context8.t0;
  6356. if (!_context8.t1) {
  6357. _context8.next = 12;
  6358. break;
  6359. }
  6360. i = !1;
  6361. case 12:
  6362. return _context8.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  6363. accessToken: s,
  6364. accessTokenExpire: r
  6365. });
  6366. case 13:
  6367. case "end":
  6368. return _context8.stop();
  6369. }
  6370. }
  6371. }, _callee8, this);
  6372. }));
  6373. function getAccessToken() {
  6374. return _getAccessToken.apply(this, arguments);
  6375. }
  6376. return getAccessToken;
  6377. }()
  6378. }, {
  6379. key: "request",
  6380. value: function () {
  6381. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(e, t, n) {
  6382. var s, r, i, _e15, o, _e16, _e17, a, c, u, l, h, d, f, p, g;
  6383. return _regenerator.default.wrap(function _callee9$(_context9) {
  6384. while (1) {
  6385. switch (_context9.prev = _context9.next) {
  6386. case 0:
  6387. s = "x-tcb-trace_".concat(this.config.env);
  6388. r = "application/x-www-form-urlencoded";
  6389. i = _objectSpread({
  6390. action: e,
  6391. env: this.config.env,
  6392. dataVersion: "2019-08-16"
  6393. }, t);
  6394. if (!(-1 === je.indexOf(e))) {
  6395. _context9.next = 10;
  6396. break;
  6397. }
  6398. _e15 = this._cache.keys.refreshTokenKey;
  6399. _context9.t0 = this._cache.getStore(_e15);
  6400. if (!_context9.t0) {
  6401. _context9.next = 10;
  6402. break;
  6403. }
  6404. _context9.next = 9;
  6405. return this.getAccessToken();
  6406. case 9:
  6407. i.access_token = _context9.sent.accessToken;
  6408. case 10:
  6409. if ("storage.uploadFile" === e) {
  6410. o = new FormData();
  6411. for (_e16 in o) {
  6412. o.hasOwnProperty(_e16) && void 0 !== o[_e16] && o.append(_e16, i[_e16]);
  6413. }
  6414. r = "multipart/form-data";
  6415. } else {
  6416. r = "application/json", o = {};
  6417. for (_e17 in i) {
  6418. void 0 !== i[_e17] && (o[_e17] = i[_e17]);
  6419. }
  6420. }
  6421. a = {
  6422. headers: {
  6423. "content-type": r
  6424. }
  6425. };
  6426. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  6427. c = this._localCache.getStore(s);
  6428. c && (a.headers["X-TCB-Trace"] = c);
  6429. u = t.parse, l = t.inQuery, h = t.search;
  6430. d = {
  6431. env: this.config.env
  6432. };
  6433. u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));
  6434. f = function (e, t) {
  6435. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  6436. var s = /\?/.test(t);
  6437. var r = "";
  6438. for (var _e18 in n) {
  6439. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e18, "=").concat(encodeURIComponent(n[_e18]));
  6440. }
  6441. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  6442. }(de, "//tcb-api.tencentcloudapi.com/web", d);
  6443. h && (f += h);
  6444. _context9.next = 22;
  6445. return this.post(_objectSpread({
  6446. url: f,
  6447. data: o
  6448. }, a));
  6449. case 22:
  6450. p = _context9.sent;
  6451. g = p.header && p.header["x-tcb-trace"];
  6452. if (!(g && this._localCache.setStore(s, g), 200 !== Number(p.status) && 200 !== Number(p.statusCode) || !p.data)) {
  6453. _context9.next = 26;
  6454. break;
  6455. }
  6456. throw new Q({
  6457. code: "NETWORK_ERROR",
  6458. message: "network request error"
  6459. });
  6460. case 26:
  6461. return _context9.abrupt("return", p);
  6462. case 27:
  6463. case "end":
  6464. return _context9.stop();
  6465. }
  6466. }
  6467. }, _callee9, this);
  6468. }));
  6469. function request(_x5, _x6, _x7) {
  6470. return _request.apply(this, arguments);
  6471. }
  6472. return request;
  6473. }()
  6474. }, {
  6475. key: "send",
  6476. value: function () {
  6477. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e) {
  6478. var t,
  6479. n,
  6480. _n6,
  6481. _args10 = arguments;
  6482. return _regenerator.default.wrap(function _callee10$(_context10) {
  6483. while (1) {
  6484. switch (_context10.prev = _context10.next) {
  6485. case 0:
  6486. t = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
  6487. _context10.next = 3;
  6488. return this.request(e, t, {
  6489. onUploadProgress: t.onUploadProgress
  6490. });
  6491. case 3:
  6492. n = _context10.sent;
  6493. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === je.indexOf(e))) {
  6494. _context10.next = 13;
  6495. break;
  6496. }
  6497. _context10.next = 7;
  6498. return this.refreshAccessToken();
  6499. case 7:
  6500. _context10.next = 9;
  6501. return this.request(e, t, {
  6502. onUploadProgress: t.onUploadProgress
  6503. });
  6504. case 9:
  6505. _n6 = _context10.sent;
  6506. if (!_n6.data.code) {
  6507. _context10.next = 12;
  6508. break;
  6509. }
  6510. throw new Q({
  6511. code: _n6.data.code,
  6512. message: _n6.data.message
  6513. });
  6514. case 12:
  6515. return _context10.abrupt("return", _n6.data);
  6516. case 13:
  6517. if (!n.data.code) {
  6518. _context10.next = 15;
  6519. break;
  6520. }
  6521. throw new Q({
  6522. code: n.data.code,
  6523. message: n.data.message
  6524. });
  6525. case 15:
  6526. return _context10.abrupt("return", n.data);
  6527. case 16:
  6528. case "end":
  6529. return _context10.stop();
  6530. }
  6531. }
  6532. }, _callee10, this);
  6533. }));
  6534. function send(_x8) {
  6535. return _send.apply(this, arguments);
  6536. }
  6537. return send;
  6538. }()
  6539. }, {
  6540. key: "setRefreshToken",
  6541. value: function setRefreshToken(e) {
  6542. var _this$_cache$keys3 = this._cache.keys,
  6543. t = _this$_cache$keys3.accessTokenKey,
  6544. n = _this$_cache$keys3.accessTokenExpireKey,
  6545. s = _this$_cache$keys3.refreshTokenKey;
  6546. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  6547. }
  6548. }]);
  6549. return We;
  6550. }();
  6551. var ze = {};
  6552. function Je(e) {
  6553. return ze[e];
  6554. }
  6555. var He = /*#__PURE__*/function () {
  6556. function He(e) {
  6557. (0, _classCallCheck2.default)(this, He);
  6558. this.config = e, this._cache = Ce(e.env), this._request = Je(e.env);
  6559. }
  6560. (0, _createClass2.default)(He, [{
  6561. key: "setRefreshToken",
  6562. value: function setRefreshToken(e) {
  6563. var _this$_cache$keys4 = this._cache.keys,
  6564. t = _this$_cache$keys4.accessTokenKey,
  6565. n = _this$_cache$keys4.accessTokenExpireKey,
  6566. s = _this$_cache$keys4.refreshTokenKey;
  6567. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  6568. }
  6569. }, {
  6570. key: "setAccessToken",
  6571. value: function setAccessToken(e, t) {
  6572. var _this$_cache$keys5 = this._cache.keys,
  6573. n = _this$_cache$keys5.accessTokenKey,
  6574. s = _this$_cache$keys5.accessTokenExpireKey;
  6575. this._cache.setStore(n, e), this._cache.setStore(s, t);
  6576. }
  6577. }, {
  6578. key: "refreshUserInfo",
  6579. value: function () {
  6580. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
  6581. var _yield$this$_request$, e;
  6582. return _regenerator.default.wrap(function _callee11$(_context11) {
  6583. while (1) {
  6584. switch (_context11.prev = _context11.next) {
  6585. case 0:
  6586. _context11.next = 2;
  6587. return this._request.send("auth.getUserInfo", {});
  6588. case 2:
  6589. _yield$this$_request$ = _context11.sent;
  6590. e = _yield$this$_request$.data;
  6591. return _context11.abrupt("return", (this.setLocalUserInfo(e), e));
  6592. case 5:
  6593. case "end":
  6594. return _context11.stop();
  6595. }
  6596. }
  6597. }, _callee11, this);
  6598. }));
  6599. function refreshUserInfo() {
  6600. return _refreshUserInfo.apply(this, arguments);
  6601. }
  6602. return refreshUserInfo;
  6603. }()
  6604. }, {
  6605. key: "setLocalUserInfo",
  6606. value: function setLocalUserInfo(e) {
  6607. var t = this._cache.keys.userInfoKey;
  6608. this._cache.setStore(t, e);
  6609. }
  6610. }]);
  6611. return He;
  6612. }();
  6613. var Ge = /*#__PURE__*/function () {
  6614. function Ge(e) {
  6615. (0, _classCallCheck2.default)(this, Ge);
  6616. if (!e) throw new Q({
  6617. code: "PARAM_ERROR",
  6618. message: "envId is not defined"
  6619. });
  6620. this._envId = e, this._cache = Ce(this._envId), this._request = Je(this._envId), this.setUserInfo();
  6621. }
  6622. (0, _createClass2.default)(Ge, [{
  6623. key: "linkWithTicket",
  6624. value: function linkWithTicket(e) {
  6625. if ("string" != typeof e) throw new Q({
  6626. code: "PARAM_ERROR",
  6627. message: "ticket must be string"
  6628. });
  6629. return this._request.send("auth.linkWithTicket", {
  6630. ticket: e
  6631. });
  6632. }
  6633. }, {
  6634. key: "linkWithRedirect",
  6635. value: function linkWithRedirect(e) {
  6636. e.signInWithRedirect();
  6637. }
  6638. }, {
  6639. key: "updatePassword",
  6640. value: function updatePassword(e, t) {
  6641. return this._request.send("auth.updatePassword", {
  6642. oldPassword: t,
  6643. newPassword: e
  6644. });
  6645. }
  6646. }, {
  6647. key: "updateEmail",
  6648. value: function updateEmail(e) {
  6649. return this._request.send("auth.updateEmail", {
  6650. newEmail: e
  6651. });
  6652. }
  6653. }, {
  6654. key: "updateUsername",
  6655. value: function updateUsername(e) {
  6656. if ("string" != typeof e) throw new Q({
  6657. code: "PARAM_ERROR",
  6658. message: "username must be a string"
  6659. });
  6660. return this._request.send("auth.updateUsername", {
  6661. username: e
  6662. });
  6663. }
  6664. }, {
  6665. key: "getLinkedUidList",
  6666. value: function () {
  6667. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  6668. var _yield$this$_request$2, e, t, n;
  6669. return _regenerator.default.wrap(function _callee12$(_context12) {
  6670. while (1) {
  6671. switch (_context12.prev = _context12.next) {
  6672. case 0:
  6673. _context12.next = 2;
  6674. return this._request.send("auth.getLinkedUidList", {});
  6675. case 2:
  6676. _yield$this$_request$2 = _context12.sent;
  6677. e = _yield$this$_request$2.data;
  6678. t = !1;
  6679. n = e.users;
  6680. return _context12.abrupt("return", (n.forEach(function (e) {
  6681. e.wxOpenId && e.wxPublicId && (t = !0);
  6682. }), {
  6683. users: n,
  6684. hasPrimaryUid: t
  6685. }));
  6686. case 7:
  6687. case "end":
  6688. return _context12.stop();
  6689. }
  6690. }
  6691. }, _callee12, this);
  6692. }));
  6693. function getLinkedUidList() {
  6694. return _getLinkedUidList.apply(this, arguments);
  6695. }
  6696. return getLinkedUidList;
  6697. }()
  6698. }, {
  6699. key: "setPrimaryUid",
  6700. value: function setPrimaryUid(e) {
  6701. return this._request.send("auth.setPrimaryUid", {
  6702. uid: e
  6703. });
  6704. }
  6705. }, {
  6706. key: "unlink",
  6707. value: function unlink(e) {
  6708. return this._request.send("auth.unlink", {
  6709. platform: e
  6710. });
  6711. }
  6712. }, {
  6713. key: "update",
  6714. value: function () {
  6715. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(e) {
  6716. var t, n, s, r, i, o, _yield$this$_request$3, a;
  6717. return _regenerator.default.wrap(function _callee13$(_context13) {
  6718. while (1) {
  6719. switch (_context13.prev = _context13.next) {
  6720. case 0:
  6721. t = e.nickName;
  6722. n = e.gender;
  6723. s = e.avatarUrl;
  6724. r = e.province;
  6725. i = e.country;
  6726. o = e.city;
  6727. _context13.next = 8;
  6728. return this._request.send("auth.updateUserInfo", {
  6729. nickName: t,
  6730. gender: n,
  6731. avatarUrl: s,
  6732. province: r,
  6733. country: i,
  6734. city: o
  6735. });
  6736. case 8:
  6737. _yield$this$_request$3 = _context13.sent;
  6738. a = _yield$this$_request$3.data;
  6739. this.setLocalUserInfo(a);
  6740. case 11:
  6741. case "end":
  6742. return _context13.stop();
  6743. }
  6744. }
  6745. }, _callee13, this);
  6746. }));
  6747. function update(_x9) {
  6748. return _update.apply(this, arguments);
  6749. }
  6750. return update;
  6751. }()
  6752. }, {
  6753. key: "refresh",
  6754. value: function () {
  6755. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
  6756. var _yield$this$_request$4, e;
  6757. return _regenerator.default.wrap(function _callee14$(_context14) {
  6758. while (1) {
  6759. switch (_context14.prev = _context14.next) {
  6760. case 0:
  6761. _context14.next = 2;
  6762. return this._request.send("auth.getUserInfo", {});
  6763. case 2:
  6764. _yield$this$_request$4 = _context14.sent;
  6765. e = _yield$this$_request$4.data;
  6766. return _context14.abrupt("return", (this.setLocalUserInfo(e), e));
  6767. case 5:
  6768. case "end":
  6769. return _context14.stop();
  6770. }
  6771. }
  6772. }, _callee14, this);
  6773. }));
  6774. function refresh() {
  6775. return _refresh.apply(this, arguments);
  6776. }
  6777. return refresh;
  6778. }()
  6779. }, {
  6780. key: "setUserInfo",
  6781. value: function setUserInfo() {
  6782. var _this8 = this;
  6783. var e = this._cache.keys.userInfoKey,
  6784. t = this._cache.getStore(e);
  6785. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  6786. _this8[e] = t[e];
  6787. }), this.location = {
  6788. country: t.country,
  6789. province: t.province,
  6790. city: t.city
  6791. };
  6792. }
  6793. }, {
  6794. key: "setLocalUserInfo",
  6795. value: function setLocalUserInfo(e) {
  6796. var t = this._cache.keys.userInfoKey;
  6797. this._cache.setStore(t, e), this.setUserInfo();
  6798. }
  6799. }]);
  6800. return Ge;
  6801. }();
  6802. var Ve = /*#__PURE__*/function () {
  6803. function Ve(e) {
  6804. (0, _classCallCheck2.default)(this, Ve);
  6805. if (!e) throw new Q({
  6806. code: "PARAM_ERROR",
  6807. message: "envId is not defined"
  6808. });
  6809. this._cache = Ce(e);
  6810. var _this$_cache$keys6 = this._cache.keys,
  6811. t = _this$_cache$keys6.refreshTokenKey,
  6812. n = _this$_cache$keys6.accessTokenKey,
  6813. s = _this$_cache$keys6.accessTokenExpireKey,
  6814. r = this._cache.getStore(t),
  6815. i = this._cache.getStore(n),
  6816. o = this._cache.getStore(s);
  6817. this.credential = {
  6818. refreshToken: r,
  6819. accessToken: i,
  6820. accessTokenExpire: o
  6821. }, this.user = new Ge(e);
  6822. }
  6823. (0, _createClass2.default)(Ve, [{
  6824. key: "isAnonymousAuth",
  6825. get: function get() {
  6826. return this.loginType === Ke.ANONYMOUS;
  6827. }
  6828. }, {
  6829. key: "isCustomAuth",
  6830. get: function get() {
  6831. return this.loginType === Ke.CUSTOM;
  6832. }
  6833. }, {
  6834. key: "isWeixinAuth",
  6835. get: function get() {
  6836. return this.loginType === Ke.WECHAT || this.loginType === Ke.WECHAT_OPEN || this.loginType === Ke.WECHAT_PUBLIC;
  6837. }
  6838. }, {
  6839. key: "loginType",
  6840. get: function get() {
  6841. return this._cache.getStore(this._cache.keys.loginTypeKey);
  6842. }
  6843. }]);
  6844. return Ve;
  6845. }();
  6846. var Ye = /*#__PURE__*/function (_He) {
  6847. (0, _inherits2.default)(Ye, _He);
  6848. var _super4 = _createSuper(Ye);
  6849. function Ye() {
  6850. (0, _classCallCheck2.default)(this, Ye);
  6851. return _super4.apply(this, arguments);
  6852. }
  6853. (0, _createClass2.default)(Ye, [{
  6854. key: "signIn",
  6855. value: function () {
  6856. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  6857. var _this$_cache$keys7, e, t, n, s, r, _e19;
  6858. return _regenerator.default.wrap(function _callee15$(_context15) {
  6859. while (1) {
  6860. switch (_context15.prev = _context15.next) {
  6861. case 0:
  6862. this._cache.updatePersistence("local");
  6863. _this$_cache$keys7 = this._cache.keys;
  6864. e = _this$_cache$keys7.anonymousUuidKey;
  6865. t = _this$_cache$keys7.refreshTokenKey;
  6866. n = this._cache.getStore(e) || void 0;
  6867. s = this._cache.getStore(t) || void 0;
  6868. _context15.next = 8;
  6869. return this._request.send("auth.signInAnonymously", {
  6870. anonymous_uuid: n,
  6871. refresh_token: s
  6872. });
  6873. case 8:
  6874. r = _context15.sent;
  6875. if (!(r.uuid && r.refresh_token)) {
  6876. _context15.next = 20;
  6877. break;
  6878. }
  6879. this._setAnonymousUUID(r.uuid);
  6880. this.setRefreshToken(r.refresh_token);
  6881. _context15.next = 14;
  6882. return this._request.refreshAccessToken();
  6883. case 14:
  6884. Ue(Le);
  6885. Ue(De, {
  6886. env: this.config.env,
  6887. loginType: Ke.ANONYMOUS,
  6888. persistence: "local"
  6889. });
  6890. _e19 = new Ve(this.config.env);
  6891. _context15.next = 19;
  6892. return _e19.user.refresh();
  6893. case 19:
  6894. return _context15.abrupt("return", _e19);
  6895. case 20:
  6896. throw new Q({
  6897. message: "匿名登录失败"
  6898. });
  6899. case 21:
  6900. case "end":
  6901. return _context15.stop();
  6902. }
  6903. }
  6904. }, _callee15, this);
  6905. }));
  6906. function signIn() {
  6907. return _signIn.apply(this, arguments);
  6908. }
  6909. return signIn;
  6910. }()
  6911. }, {
  6912. key: "linkAndRetrieveDataWithTicket",
  6913. value: function () {
  6914. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(e) {
  6915. var _this$_cache$keys8, t, n, s, r, i;
  6916. return _regenerator.default.wrap(function _callee16$(_context16) {
  6917. while (1) {
  6918. switch (_context16.prev = _context16.next) {
  6919. case 0:
  6920. _this$_cache$keys8 = this._cache.keys;
  6921. t = _this$_cache$keys8.anonymousUuidKey;
  6922. n = _this$_cache$keys8.refreshTokenKey;
  6923. s = this._cache.getStore(t);
  6924. r = this._cache.getStore(n);
  6925. _context16.next = 7;
  6926. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  6927. anonymous_uuid: s,
  6928. refresh_token: r,
  6929. ticket: e
  6930. });
  6931. case 7:
  6932. i = _context16.sent;
  6933. if (!i.refresh_token) {
  6934. _context16.next = 16;
  6935. break;
  6936. }
  6937. this._clearAnonymousUUID();
  6938. this.setRefreshToken(i.refresh_token);
  6939. _context16.next = 13;
  6940. return this._request.refreshAccessToken();
  6941. case 13:
  6942. Ue(Fe, {
  6943. env: this.config.env
  6944. });
  6945. Ue(De, {
  6946. loginType: Ke.CUSTOM,
  6947. persistence: "local"
  6948. });
  6949. return _context16.abrupt("return", {
  6950. credential: {
  6951. refreshToken: i.refresh_token
  6952. }
  6953. });
  6954. case 16:
  6955. throw new Q({
  6956. message: "匿名转化失败"
  6957. });
  6958. case 17:
  6959. case "end":
  6960. return _context16.stop();
  6961. }
  6962. }
  6963. }, _callee16, this);
  6964. }));
  6965. function linkAndRetrieveDataWithTicket(_x10) {
  6966. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  6967. }
  6968. return linkAndRetrieveDataWithTicket;
  6969. }()
  6970. }, {
  6971. key: "_setAnonymousUUID",
  6972. value: function _setAnonymousUUID(e) {
  6973. var _this$_cache$keys9 = this._cache.keys,
  6974. t = _this$_cache$keys9.anonymousUuidKey,
  6975. n = _this$_cache$keys9.loginTypeKey;
  6976. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, Ke.ANONYMOUS);
  6977. }
  6978. }, {
  6979. key: "_clearAnonymousUUID",
  6980. value: function _clearAnonymousUUID() {
  6981. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  6982. }
  6983. }]);
  6984. return Ye;
  6985. }(He);
  6986. var Qe = /*#__PURE__*/function (_He2) {
  6987. (0, _inherits2.default)(Qe, _He2);
  6988. var _super5 = _createSuper(Qe);
  6989. function Qe() {
  6990. (0, _classCallCheck2.default)(this, Qe);
  6991. return _super5.apply(this, arguments);
  6992. }
  6993. (0, _createClass2.default)(Qe, [{
  6994. key: "signIn",
  6995. value: function () {
  6996. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  6997. var t, n;
  6998. return _regenerator.default.wrap(function _callee17$(_context17) {
  6999. while (1) {
  7000. switch (_context17.prev = _context17.next) {
  7001. case 0:
  7002. if (!("string" != typeof e)) {
  7003. _context17.next = 2;
  7004. break;
  7005. }
  7006. throw new Q({
  7007. code: "PARAM_ERROR",
  7008. message: "ticket must be a string"
  7009. });
  7010. case 2:
  7011. t = this._cache.keys.refreshTokenKey;
  7012. _context17.next = 5;
  7013. return this._request.send("auth.signInWithTicket", {
  7014. ticket: e,
  7015. refresh_token: this._cache.getStore(t) || ""
  7016. });
  7017. case 5:
  7018. n = _context17.sent;
  7019. if (!n.refresh_token) {
  7020. _context17.next = 15;
  7021. break;
  7022. }
  7023. this.setRefreshToken(n.refresh_token);
  7024. _context17.next = 10;
  7025. return this._request.refreshAccessToken();
  7026. case 10:
  7027. Ue(Le);
  7028. Ue(De, {
  7029. env: this.config.env,
  7030. loginType: Ke.CUSTOM,
  7031. persistence: this.config.persistence
  7032. });
  7033. _context17.next = 14;
  7034. return this.refreshUserInfo();
  7035. case 14:
  7036. return _context17.abrupt("return", new Ve(this.config.env));
  7037. case 15:
  7038. throw new Q({
  7039. message: "自定义登录失败"
  7040. });
  7041. case 16:
  7042. case "end":
  7043. return _context17.stop();
  7044. }
  7045. }
  7046. }, _callee17, this);
  7047. }));
  7048. function signIn(_x11) {
  7049. return _signIn2.apply(this, arguments);
  7050. }
  7051. return signIn;
  7052. }()
  7053. }]);
  7054. return Qe;
  7055. }(He);
  7056. var Xe = /*#__PURE__*/function (_He3) {
  7057. (0, _inherits2.default)(Xe, _He3);
  7058. var _super6 = _createSuper(Xe);
  7059. function Xe() {
  7060. (0, _classCallCheck2.default)(this, Xe);
  7061. return _super6.apply(this, arguments);
  7062. }
  7063. (0, _createClass2.default)(Xe, [{
  7064. key: "signIn",
  7065. value: function () {
  7066. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e, t) {
  7067. var n, s, r, i, o;
  7068. return _regenerator.default.wrap(function _callee18$(_context18) {
  7069. while (1) {
  7070. switch (_context18.prev = _context18.next) {
  7071. case 0:
  7072. if (!("string" != typeof e)) {
  7073. _context18.next = 2;
  7074. break;
  7075. }
  7076. throw new Q({
  7077. code: "PARAM_ERROR",
  7078. message: "email must be a string"
  7079. });
  7080. case 2:
  7081. n = this._cache.keys.refreshTokenKey;
  7082. _context18.next = 5;
  7083. return this._request.send("auth.signIn", {
  7084. loginType: "EMAIL",
  7085. email: e,
  7086. password: t,
  7087. refresh_token: this._cache.getStore(n) || ""
  7088. });
  7089. case 5:
  7090. s = _context18.sent;
  7091. r = s.refresh_token;
  7092. i = s.access_token;
  7093. o = s.access_token_expire;
  7094. if (!r) {
  7095. _context18.next = 22;
  7096. break;
  7097. }
  7098. this.setRefreshToken(r);
  7099. if (!(i && o)) {
  7100. _context18.next = 15;
  7101. break;
  7102. }
  7103. this.setAccessToken(i, o);
  7104. _context18.next = 17;
  7105. break;
  7106. case 15:
  7107. _context18.next = 17;
  7108. return this._request.refreshAccessToken();
  7109. case 17:
  7110. _context18.next = 19;
  7111. return this.refreshUserInfo();
  7112. case 19:
  7113. Ue(Le);
  7114. Ue(De, {
  7115. env: this.config.env,
  7116. loginType: Ke.EMAIL,
  7117. persistence: this.config.persistence
  7118. });
  7119. return _context18.abrupt("return", new Ve(this.config.env));
  7120. case 22:
  7121. throw s.code ? new Q({
  7122. code: s.code,
  7123. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  7124. }) : new Q({
  7125. message: "邮箱登录失败"
  7126. });
  7127. case 23:
  7128. case "end":
  7129. return _context18.stop();
  7130. }
  7131. }
  7132. }, _callee18, this);
  7133. }));
  7134. function signIn(_x12, _x13) {
  7135. return _signIn3.apply(this, arguments);
  7136. }
  7137. return signIn;
  7138. }()
  7139. }, {
  7140. key: "activate",
  7141. value: function () {
  7142. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e) {
  7143. return _regenerator.default.wrap(function _callee19$(_context19) {
  7144. while (1) {
  7145. switch (_context19.prev = _context19.next) {
  7146. case 0:
  7147. return _context19.abrupt("return", this._request.send("auth.activateEndUserMail", {
  7148. token: e
  7149. }));
  7150. case 1:
  7151. case "end":
  7152. return _context19.stop();
  7153. }
  7154. }
  7155. }, _callee19, this);
  7156. }));
  7157. function activate(_x14) {
  7158. return _activate.apply(this, arguments);
  7159. }
  7160. return activate;
  7161. }()
  7162. }, {
  7163. key: "resetPasswordWithToken",
  7164. value: function () {
  7165. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e, t) {
  7166. return _regenerator.default.wrap(function _callee20$(_context20) {
  7167. while (1) {
  7168. switch (_context20.prev = _context20.next) {
  7169. case 0:
  7170. return _context20.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  7171. token: e,
  7172. newPassword: t
  7173. }));
  7174. case 1:
  7175. case "end":
  7176. return _context20.stop();
  7177. }
  7178. }
  7179. }, _callee20, this);
  7180. }));
  7181. function resetPasswordWithToken(_x15, _x16) {
  7182. return _resetPasswordWithToken.apply(this, arguments);
  7183. }
  7184. return resetPasswordWithToken;
  7185. }()
  7186. }]);
  7187. return Xe;
  7188. }(He);
  7189. var Ze = /*#__PURE__*/function (_He4) {
  7190. (0, _inherits2.default)(Ze, _He4);
  7191. var _super7 = _createSuper(Ze);
  7192. function Ze() {
  7193. (0, _classCallCheck2.default)(this, Ze);
  7194. return _super7.apply(this, arguments);
  7195. }
  7196. (0, _createClass2.default)(Ze, [{
  7197. key: "signIn",
  7198. value: function () {
  7199. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  7200. var n, s, r, i, o;
  7201. return _regenerator.default.wrap(function _callee21$(_context21) {
  7202. while (1) {
  7203. switch (_context21.prev = _context21.next) {
  7204. case 0:
  7205. if (!("string" != typeof e)) {
  7206. _context21.next = 2;
  7207. break;
  7208. }
  7209. throw new Q({
  7210. code: "PARAM_ERROR",
  7211. message: "username must be a string"
  7212. });
  7213. case 2:
  7214. "string" != typeof t && (t = "", console.warn("password is empty"));
  7215. n = this._cache.keys.refreshTokenKey;
  7216. _context21.next = 6;
  7217. return this._request.send("auth.signIn", {
  7218. loginType: Ke.USERNAME,
  7219. username: e,
  7220. password: t,
  7221. refresh_token: this._cache.getStore(n) || ""
  7222. });
  7223. case 6:
  7224. s = _context21.sent;
  7225. r = s.refresh_token;
  7226. i = s.access_token_expire;
  7227. o = s.access_token;
  7228. if (!r) {
  7229. _context21.next = 23;
  7230. break;
  7231. }
  7232. this.setRefreshToken(r);
  7233. if (!(o && i)) {
  7234. _context21.next = 16;
  7235. break;
  7236. }
  7237. this.setAccessToken(o, i);
  7238. _context21.next = 18;
  7239. break;
  7240. case 16:
  7241. _context21.next = 18;
  7242. return this._request.refreshAccessToken();
  7243. case 18:
  7244. _context21.next = 20;
  7245. return this.refreshUserInfo();
  7246. case 20:
  7247. Ue(Le);
  7248. Ue(De, {
  7249. env: this.config.env,
  7250. loginType: Ke.USERNAME,
  7251. persistence: this.config.persistence
  7252. });
  7253. return _context21.abrupt("return", new Ve(this.config.env));
  7254. case 23:
  7255. throw s.code ? new Q({
  7256. code: s.code,
  7257. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  7258. }) : new Q({
  7259. message: "用户名密码登录失败"
  7260. });
  7261. case 24:
  7262. case "end":
  7263. return _context21.stop();
  7264. }
  7265. }
  7266. }, _callee21, this);
  7267. }));
  7268. function signIn(_x17, _x18) {
  7269. return _signIn4.apply(this, arguments);
  7270. }
  7271. return signIn;
  7272. }()
  7273. }]);
  7274. return Ze;
  7275. }(He);
  7276. var et = /*#__PURE__*/function () {
  7277. function et(e) {
  7278. (0, _classCallCheck2.default)(this, et);
  7279. this.config = e, this._cache = Ce(e.env), this._request = Je(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), xe(De, this._onLoginTypeChanged);
  7280. }
  7281. (0, _createClass2.default)(et, [{
  7282. key: "currentUser",
  7283. get: function get() {
  7284. var e = this.hasLoginState();
  7285. return e && e.user || null;
  7286. }
  7287. }, {
  7288. key: "loginType",
  7289. get: function get() {
  7290. return this._cache.getStore(this._cache.keys.loginTypeKey);
  7291. }
  7292. }, {
  7293. key: "anonymousAuthProvider",
  7294. value: function anonymousAuthProvider() {
  7295. return new Ye(this.config);
  7296. }
  7297. }, {
  7298. key: "customAuthProvider",
  7299. value: function customAuthProvider() {
  7300. return new Qe(this.config);
  7301. }
  7302. }, {
  7303. key: "emailAuthProvider",
  7304. value: function emailAuthProvider() {
  7305. return new Xe(this.config);
  7306. }
  7307. }, {
  7308. key: "usernameAuthProvider",
  7309. value: function usernameAuthProvider() {
  7310. return new Ze(this.config);
  7311. }
  7312. }, {
  7313. key: "signInAnonymously",
  7314. value: function () {
  7315. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
  7316. return _regenerator.default.wrap(function _callee22$(_context22) {
  7317. while (1) {
  7318. switch (_context22.prev = _context22.next) {
  7319. case 0:
  7320. return _context22.abrupt("return", new Ye(this.config).signIn());
  7321. case 1:
  7322. case "end":
  7323. return _context22.stop();
  7324. }
  7325. }
  7326. }, _callee22, this);
  7327. }));
  7328. function signInAnonymously() {
  7329. return _signInAnonymously.apply(this, arguments);
  7330. }
  7331. return signInAnonymously;
  7332. }()
  7333. }, {
  7334. key: "signInWithEmailAndPassword",
  7335. value: function () {
  7336. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(e, t) {
  7337. return _regenerator.default.wrap(function _callee23$(_context23) {
  7338. while (1) {
  7339. switch (_context23.prev = _context23.next) {
  7340. case 0:
  7341. return _context23.abrupt("return", new Xe(this.config).signIn(e, t));
  7342. case 1:
  7343. case "end":
  7344. return _context23.stop();
  7345. }
  7346. }
  7347. }, _callee23, this);
  7348. }));
  7349. function signInWithEmailAndPassword(_x19, _x20) {
  7350. return _signInWithEmailAndPassword.apply(this, arguments);
  7351. }
  7352. return signInWithEmailAndPassword;
  7353. }()
  7354. }, {
  7355. key: "signInWithUsernameAndPassword",
  7356. value: function signInWithUsernameAndPassword(e, t) {
  7357. return new Ze(this.config).signIn(e, t);
  7358. }
  7359. }, {
  7360. key: "linkAndRetrieveDataWithTicket",
  7361. value: function () {
  7362. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e) {
  7363. return _regenerator.default.wrap(function _callee24$(_context24) {
  7364. while (1) {
  7365. switch (_context24.prev = _context24.next) {
  7366. case 0:
  7367. this._anonymousAuthProvider || (this._anonymousAuthProvider = new Ye(this.config)), xe(Fe, this._onAnonymousConverted);
  7368. _context24.next = 3;
  7369. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  7370. case 3:
  7371. return _context24.abrupt("return", _context24.sent);
  7372. case 4:
  7373. case "end":
  7374. return _context24.stop();
  7375. }
  7376. }
  7377. }, _callee24, this);
  7378. }));
  7379. function linkAndRetrieveDataWithTicket(_x21) {
  7380. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  7381. }
  7382. return linkAndRetrieveDataWithTicket;
  7383. }()
  7384. }, {
  7385. key: "signOut",
  7386. value: function () {
  7387. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
  7388. var _this$_cache$keys10, e, t, n, s, r;
  7389. return _regenerator.default.wrap(function _callee25$(_context25) {
  7390. while (1) {
  7391. switch (_context25.prev = _context25.next) {
  7392. case 0:
  7393. if (!(this.loginType === Ke.ANONYMOUS)) {
  7394. _context25.next = 2;
  7395. break;
  7396. }
  7397. throw new Q({
  7398. message: "匿名用户不支持登出操作"
  7399. });
  7400. case 2:
  7401. _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);
  7402. if (s) {
  7403. _context25.next = 5;
  7404. break;
  7405. }
  7406. return _context25.abrupt("return");
  7407. case 5:
  7408. _context25.next = 7;
  7409. return this._request.send("auth.logout", {
  7410. refresh_token: s
  7411. });
  7412. case 7:
  7413. r = _context25.sent;
  7414. return _context25.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Ue(Le), Ue(De, {
  7415. env: this.config.env,
  7416. loginType: Ke.NULL,
  7417. persistence: this.config.persistence
  7418. }), r));
  7419. case 9:
  7420. case "end":
  7421. return _context25.stop();
  7422. }
  7423. }
  7424. }, _callee25, this);
  7425. }));
  7426. function signOut() {
  7427. return _signOut.apply(this, arguments);
  7428. }
  7429. return signOut;
  7430. }()
  7431. }, {
  7432. key: "signUpWithEmailAndPassword",
  7433. value: function () {
  7434. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(e, t) {
  7435. return _regenerator.default.wrap(function _callee26$(_context26) {
  7436. while (1) {
  7437. switch (_context26.prev = _context26.next) {
  7438. case 0:
  7439. return _context26.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  7440. email: e,
  7441. password: t
  7442. }));
  7443. case 1:
  7444. case "end":
  7445. return _context26.stop();
  7446. }
  7447. }
  7448. }, _callee26, this);
  7449. }));
  7450. function signUpWithEmailAndPassword(_x22, _x23) {
  7451. return _signUpWithEmailAndPassword.apply(this, arguments);
  7452. }
  7453. return signUpWithEmailAndPassword;
  7454. }()
  7455. }, {
  7456. key: "sendPasswordResetEmail",
  7457. value: function () {
  7458. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e) {
  7459. return _regenerator.default.wrap(function _callee27$(_context27) {
  7460. while (1) {
  7461. switch (_context27.prev = _context27.next) {
  7462. case 0:
  7463. return _context27.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  7464. email: e
  7465. }));
  7466. case 1:
  7467. case "end":
  7468. return _context27.stop();
  7469. }
  7470. }
  7471. }, _callee27, this);
  7472. }));
  7473. function sendPasswordResetEmail(_x24) {
  7474. return _sendPasswordResetEmail.apply(this, arguments);
  7475. }
  7476. return sendPasswordResetEmail;
  7477. }()
  7478. }, {
  7479. key: "onLoginStateChanged",
  7480. value: function onLoginStateChanged(e) {
  7481. var _this9 = this;
  7482. xe(Le, function () {
  7483. var t = _this9.hasLoginState();
  7484. e.call(_this9, t);
  7485. });
  7486. var t = this.hasLoginState();
  7487. e.call(this, t);
  7488. }
  7489. }, {
  7490. key: "onLoginStateExpired",
  7491. value: function onLoginStateExpired(e) {
  7492. xe(Ne, e.bind(this));
  7493. }
  7494. }, {
  7495. key: "onAccessTokenRefreshed",
  7496. value: function onAccessTokenRefreshed(e) {
  7497. xe(qe, e.bind(this));
  7498. }
  7499. }, {
  7500. key: "onAnonymousConverted",
  7501. value: function onAnonymousConverted(e) {
  7502. xe(Fe, e.bind(this));
  7503. }
  7504. }, {
  7505. key: "onLoginTypeChanged",
  7506. value: function onLoginTypeChanged(e) {
  7507. var _this10 = this;
  7508. xe(De, function () {
  7509. var t = _this10.hasLoginState();
  7510. e.call(_this10, t);
  7511. });
  7512. }
  7513. }, {
  7514. key: "getAccessToken",
  7515. value: function () {
  7516. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
  7517. return _regenerator.default.wrap(function _callee28$(_context28) {
  7518. while (1) {
  7519. switch (_context28.prev = _context28.next) {
  7520. case 0:
  7521. _context28.next = 2;
  7522. return this._request.getAccessToken();
  7523. case 2:
  7524. _context28.t0 = _context28.sent.accessToken;
  7525. _context28.t1 = this.config.env;
  7526. return _context28.abrupt("return", {
  7527. accessToken: _context28.t0,
  7528. env: _context28.t1
  7529. });
  7530. case 5:
  7531. case "end":
  7532. return _context28.stop();
  7533. }
  7534. }
  7535. }, _callee28, this);
  7536. }));
  7537. function getAccessToken() {
  7538. return _getAccessToken2.apply(this, arguments);
  7539. }
  7540. return getAccessToken;
  7541. }()
  7542. }, {
  7543. key: "hasLoginState",
  7544. value: function hasLoginState() {
  7545. var e = this._cache.keys.refreshTokenKey;
  7546. return this._cache.getStore(e) ? new Ve(this.config.env) : null;
  7547. }
  7548. }, {
  7549. key: "isUsernameRegistered",
  7550. value: function () {
  7551. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(e) {
  7552. var _yield$this$_request$5, t;
  7553. return _regenerator.default.wrap(function _callee29$(_context29) {
  7554. while (1) {
  7555. switch (_context29.prev = _context29.next) {
  7556. case 0:
  7557. if (!("string" != typeof e)) {
  7558. _context29.next = 2;
  7559. break;
  7560. }
  7561. throw new Q({
  7562. code: "PARAM_ERROR",
  7563. message: "username must be a string"
  7564. });
  7565. case 2:
  7566. _context29.next = 4;
  7567. return this._request.send("auth.isUsernameRegistered", {
  7568. username: e
  7569. });
  7570. case 4:
  7571. _yield$this$_request$5 = _context29.sent;
  7572. t = _yield$this$_request$5.data;
  7573. return _context29.abrupt("return", t && t.isRegistered);
  7574. case 7:
  7575. case "end":
  7576. return _context29.stop();
  7577. }
  7578. }
  7579. }, _callee29, this);
  7580. }));
  7581. function isUsernameRegistered(_x25) {
  7582. return _isUsernameRegistered.apply(this, arguments);
  7583. }
  7584. return isUsernameRegistered;
  7585. }()
  7586. }, {
  7587. key: "getLoginState",
  7588. value: function getLoginState() {
  7589. return Promise.resolve(this.hasLoginState());
  7590. }
  7591. }, {
  7592. key: "signInWithTicket",
  7593. value: function () {
  7594. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  7595. return _regenerator.default.wrap(function _callee30$(_context30) {
  7596. while (1) {
  7597. switch (_context30.prev = _context30.next) {
  7598. case 0:
  7599. return _context30.abrupt("return", new Qe(this.config).signIn(e));
  7600. case 1:
  7601. case "end":
  7602. return _context30.stop();
  7603. }
  7604. }
  7605. }, _callee30, this);
  7606. }));
  7607. function signInWithTicket(_x26) {
  7608. return _signInWithTicket.apply(this, arguments);
  7609. }
  7610. return signInWithTicket;
  7611. }()
  7612. }, {
  7613. key: "shouldRefreshAccessToken",
  7614. value: function shouldRefreshAccessToken(e) {
  7615. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  7616. }
  7617. }, {
  7618. key: "getUserInfo",
  7619. value: function getUserInfo() {
  7620. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  7621. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  7622. requestId: e.seqId
  7623. });
  7624. });
  7625. }
  7626. }, {
  7627. key: "getAuthHeader",
  7628. value: function getAuthHeader() {
  7629. var _this$_cache$keys11 = this._cache.keys,
  7630. e = _this$_cache$keys11.refreshTokenKey,
  7631. t = _this$_cache$keys11.accessTokenKey,
  7632. n = this._cache.getStore(e);
  7633. return {
  7634. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  7635. };
  7636. }
  7637. }, {
  7638. key: "_onAnonymousConverted",
  7639. value: function _onAnonymousConverted(e) {
  7640. var t = e.data.env;
  7641. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  7642. }
  7643. }, {
  7644. key: "_onLoginTypeChanged",
  7645. value: function _onLoginTypeChanged(e) {
  7646. var _e$data = e.data,
  7647. t = _e$data.loginType,
  7648. n = _e$data.persistence,
  7649. s = _e$data.env;
  7650. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  7651. }
  7652. }]);
  7653. return et;
  7654. }();
  7655. var tt = function tt(e, t) {
  7656. t = t || ge();
  7657. var n = Je(this.config.env),
  7658. s = e.cloudPath,
  7659. r = e.filePath,
  7660. i = e.onUploadProgress,
  7661. _e$fileType = e.fileType,
  7662. o = _e$fileType === void 0 ? "image" : _e$fileType;
  7663. return n.send("storage.getUploadMetadata", {
  7664. path: s
  7665. }).then(function (e) {
  7666. var _e$data2 = e.data,
  7667. a = _e$data2.url,
  7668. c = _e$data2.authorization,
  7669. u = _e$data2.token,
  7670. l = _e$data2.fileId,
  7671. h = _e$data2.cosFileId,
  7672. d = e.requestId,
  7673. f = {
  7674. key: s,
  7675. signature: c,
  7676. "x-cos-meta-fileid": h,
  7677. success_action_status: "201",
  7678. "x-cos-security-token": u
  7679. };
  7680. n.upload({
  7681. url: a,
  7682. data: f,
  7683. file: r,
  7684. name: s,
  7685. fileType: o,
  7686. onUploadProgress: i
  7687. }).then(function (e) {
  7688. 201 === e.statusCode ? t(null, {
  7689. fileID: l,
  7690. requestId: d
  7691. }) : t(new Q({
  7692. code: "STORAGE_REQUEST_FAIL",
  7693. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  7694. }));
  7695. }).catch(function (e) {
  7696. t(e);
  7697. });
  7698. }).catch(function (e) {
  7699. t(e);
  7700. }), t.promise;
  7701. },
  7702. nt = function nt(e, t) {
  7703. t = t || ge();
  7704. var n = Je(this.config.env),
  7705. s = e.cloudPath;
  7706. return n.send("storage.getUploadMetadata", {
  7707. path: s
  7708. }).then(function (e) {
  7709. t(null, e);
  7710. }).catch(function (e) {
  7711. t(e);
  7712. }), t.promise;
  7713. },
  7714. st = function st(_ref6, t) {
  7715. var e = _ref6.fileList;
  7716. if (t = t || ge(), !e || !Array.isArray(e)) return {
  7717. code: "INVALID_PARAM",
  7718. message: "fileList必须是非空的数组"
  7719. };
  7720. var _iterator3 = _createForOfIteratorHelper(e),
  7721. _step3;
  7722. try {
  7723. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  7724. var _t8 = _step3.value;
  7725. if (!_t8 || "string" != typeof _t8) return {
  7726. code: "INVALID_PARAM",
  7727. message: "fileList的元素必须是非空的字符串"
  7728. };
  7729. }
  7730. } catch (err) {
  7731. _iterator3.e(err);
  7732. } finally {
  7733. _iterator3.f();
  7734. }
  7735. var n = {
  7736. fileid_list: e
  7737. };
  7738. return Je(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  7739. e.code ? t(null, e) : t(null, {
  7740. fileList: e.data.delete_list,
  7741. requestId: e.requestId
  7742. });
  7743. }).catch(function (e) {
  7744. t(e);
  7745. }), t.promise;
  7746. },
  7747. rt = function rt(_ref7, t) {
  7748. var e = _ref7.fileList;
  7749. t = t || ge(), e && Array.isArray(e) || t(null, {
  7750. code: "INVALID_PARAM",
  7751. message: "fileList必须是非空的数组"
  7752. });
  7753. var n = [];
  7754. var _iterator4 = _createForOfIteratorHelper(e),
  7755. _step4;
  7756. try {
  7757. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  7758. var _s9 = _step4.value;
  7759. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  7760. code: "INVALID_PARAM",
  7761. message: "fileList的元素必须是包含fileID和maxAge的对象"
  7762. }), n.push({
  7763. fileid: _s9.fileID,
  7764. max_age: _s9.maxAge
  7765. })) : "string" == typeof _s9 ? n.push({
  7766. fileid: _s9
  7767. }) : t(null, {
  7768. code: "INVALID_PARAM",
  7769. message: "fileList的元素必须是字符串"
  7770. });
  7771. }
  7772. } catch (err) {
  7773. _iterator4.e(err);
  7774. } finally {
  7775. _iterator4.f();
  7776. }
  7777. var s = {
  7778. file_list: n
  7779. };
  7780. return Je(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  7781. e.code ? t(null, e) : t(null, {
  7782. fileList: e.data.download_list,
  7783. requestId: e.requestId
  7784. });
  7785. }).catch(function (e) {
  7786. t(e);
  7787. }), t.promise;
  7788. },
  7789. it = /*#__PURE__*/function () {
  7790. var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(_ref8, t) {
  7791. var e, n, s, r;
  7792. return _regenerator.default.wrap(function _callee31$(_context31) {
  7793. while (1) {
  7794. switch (_context31.prev = _context31.next) {
  7795. case 0:
  7796. e = _ref8.fileID;
  7797. _context31.next = 3;
  7798. return rt.call(this, {
  7799. fileList: [{
  7800. fileID: e,
  7801. maxAge: 600
  7802. }]
  7803. });
  7804. case 3:
  7805. n = _context31.sent.fileList[0];
  7806. if (!("SUCCESS" !== n.code)) {
  7807. _context31.next = 6;
  7808. break;
  7809. }
  7810. return _context31.abrupt("return", t ? t(n) : new Promise(function (e) {
  7811. e(n);
  7812. }));
  7813. case 6:
  7814. s = Je(this.config.env);
  7815. r = n.download_url;
  7816. if (!(r = encodeURI(r), !t)) {
  7817. _context31.next = 10;
  7818. break;
  7819. }
  7820. return _context31.abrupt("return", s.download({
  7821. url: r
  7822. }));
  7823. case 10:
  7824. _context31.t0 = t;
  7825. _context31.next = 13;
  7826. return s.download({
  7827. url: r
  7828. });
  7829. case 13:
  7830. _context31.t1 = _context31.sent;
  7831. (0, _context31.t0)(_context31.t1);
  7832. case 15:
  7833. case "end":
  7834. return _context31.stop();
  7835. }
  7836. }
  7837. }, _callee31, this);
  7838. }));
  7839. return function it(_x27, _x28) {
  7840. return _ref9.apply(this, arguments);
  7841. };
  7842. }(),
  7843. ot = function ot(_ref10, i) {
  7844. var e = _ref10.name,
  7845. t = _ref10.data,
  7846. n = _ref10.query,
  7847. s = _ref10.parse,
  7848. r = _ref10.search;
  7849. var o = i || ge();
  7850. var a;
  7851. try {
  7852. a = t ? JSON.stringify(t) : "";
  7853. } catch (e) {
  7854. return Promise.reject(e);
  7855. }
  7856. if (!e) return Promise.reject(new Q({
  7857. code: "PARAM_ERROR",
  7858. message: "函数名不能为空"
  7859. }));
  7860. var c = {
  7861. inQuery: n,
  7862. parse: s,
  7863. search: r,
  7864. function_name: e,
  7865. request_data: a
  7866. };
  7867. return Je(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  7868. if (e.code) o(null, e);else {
  7869. var _t9 = e.data.response_data;
  7870. if (s) o(null, {
  7871. result: _t9,
  7872. requestId: e.requestId
  7873. });else try {
  7874. _t9 = JSON.parse(e.data.response_data), o(null, {
  7875. result: _t9,
  7876. requestId: e.requestId
  7877. });
  7878. } catch (e) {
  7879. o(new Q({
  7880. message: "response data must be json"
  7881. }));
  7882. }
  7883. }
  7884. return o.promise;
  7885. }).catch(function (e) {
  7886. o(e);
  7887. }), o.promise;
  7888. },
  7889. at = {
  7890. timeout: 15e3,
  7891. persistence: "session"
  7892. },
  7893. ct = {};
  7894. var ut = /*#__PURE__*/function () {
  7895. function ut(e) {
  7896. (0, _classCallCheck2.default)(this, ut);
  7897. this.config = e || this.config, this.authObj = void 0;
  7898. }
  7899. (0, _createClass2.default)(ut, [{
  7900. key: "init",
  7901. value: function init(e) {
  7902. switch (ve.adapter || (this.requestClient = new ve.adapter.reqClass({
  7903. timeout: e.timeout || 5e3,
  7904. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  7905. })), this.config = _objectSpread(_objectSpread({}, at), e), !0) {
  7906. case this.config.timeout > 6e5:
  7907. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  7908. break;
  7909. case this.config.timeout < 100:
  7910. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  7911. }
  7912. return new ut(this.config);
  7913. }
  7914. }, {
  7915. key: "auth",
  7916. value: function auth() {
  7917. var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7918. e = _ref11.persistence;
  7919. if (this.authObj) return this.authObj;
  7920. var t = e || ve.adapter.primaryStorage || at.persistence;
  7921. var n;
  7922. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  7923. var t = e.env;
  7924. Te[t] = new be(e), Ae[t] = new be(_objectSpread(_objectSpread({}, e), {}, {
  7925. persistence: "local"
  7926. }));
  7927. }(this.config), n = this.config, ze[n.env] = new We(n), this.authObj = new et(this.config), this.authObj;
  7928. }
  7929. }, {
  7930. key: "on",
  7931. value: function on(e, t) {
  7932. return xe.apply(this, [e, t]);
  7933. }
  7934. }, {
  7935. key: "off",
  7936. value: function off(e, t) {
  7937. return Re.apply(this, [e, t]);
  7938. }
  7939. }, {
  7940. key: "callFunction",
  7941. value: function callFunction(e, t) {
  7942. return ot.apply(this, [e, t]);
  7943. }
  7944. }, {
  7945. key: "deleteFile",
  7946. value: function deleteFile(e, t) {
  7947. return st.apply(this, [e, t]);
  7948. }
  7949. }, {
  7950. key: "getTempFileURL",
  7951. value: function getTempFileURL(e, t) {
  7952. return rt.apply(this, [e, t]);
  7953. }
  7954. }, {
  7955. key: "downloadFile",
  7956. value: function downloadFile(e, t) {
  7957. return it.apply(this, [e, t]);
  7958. }
  7959. }, {
  7960. key: "uploadFile",
  7961. value: function uploadFile(e, t) {
  7962. return tt.apply(this, [e, t]);
  7963. }
  7964. }, {
  7965. key: "getUploadMetadata",
  7966. value: function getUploadMetadata(e, t) {
  7967. return nt.apply(this, [e, t]);
  7968. }
  7969. }, {
  7970. key: "registerExtension",
  7971. value: function registerExtension(e) {
  7972. ct[e.name] = e;
  7973. }
  7974. }, {
  7975. key: "invokeExtension",
  7976. value: function () {
  7977. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(e, t) {
  7978. var n;
  7979. return _regenerator.default.wrap(function _callee32$(_context32) {
  7980. while (1) {
  7981. switch (_context32.prev = _context32.next) {
  7982. case 0:
  7983. n = ct[e];
  7984. if (n) {
  7985. _context32.next = 3;
  7986. break;
  7987. }
  7988. throw new Q({
  7989. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  7990. });
  7991. case 3:
  7992. _context32.next = 5;
  7993. return n.invoke(t, this);
  7994. case 5:
  7995. return _context32.abrupt("return", _context32.sent);
  7996. case 6:
  7997. case "end":
  7998. return _context32.stop();
  7999. }
  8000. }
  8001. }, _callee32, this);
  8002. }));
  8003. function invokeExtension(_x29, _x30) {
  8004. return _invokeExtension.apply(this, arguments);
  8005. }
  8006. return invokeExtension;
  8007. }()
  8008. }, {
  8009. key: "useAdapters",
  8010. value: function useAdapters(e) {
  8011. var _ref12 = we(e) || {},
  8012. t = _ref12.adapter,
  8013. n = _ref12.runtime;
  8014. t && (ve.adapter = t), n && (ve.runtime = n);
  8015. }
  8016. }]);
  8017. return ut;
  8018. }();
  8019. var lt = new ut();
  8020. function ht(e, t, n) {
  8021. void 0 === n && (n = {});
  8022. var s = /\?/.test(t),
  8023. r = "";
  8024. for (var i in n) {
  8025. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  8026. }
  8027. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  8028. }
  8029. var dt = /*#__PURE__*/function () {
  8030. function dt() {
  8031. (0, _classCallCheck2.default)(this, dt);
  8032. }
  8033. (0, _createClass2.default)(dt, [{
  8034. key: "post",
  8035. value: function post(e) {
  8036. var t = e.url,
  8037. n = e.data,
  8038. s = e.headers;
  8039. return new Promise(function (e, r) {
  8040. X.request({
  8041. url: ht("https:", t),
  8042. data: n,
  8043. method: "POST",
  8044. header: s,
  8045. success: function success(t) {
  8046. e(t);
  8047. },
  8048. fail: function fail(e) {
  8049. r(e);
  8050. }
  8051. });
  8052. });
  8053. }
  8054. }, {
  8055. key: "upload",
  8056. value: function upload(e) {
  8057. return new Promise(function (t, n) {
  8058. var s = e.url,
  8059. r = e.file,
  8060. i = e.data,
  8061. o = e.headers,
  8062. a = e.fileType,
  8063. c = X.uploadFile({
  8064. url: ht("https:", s),
  8065. name: "file",
  8066. formData: Object.assign({}, i),
  8067. filePath: r,
  8068. fileType: a,
  8069. header: o,
  8070. success: function success(e) {
  8071. var n = {
  8072. statusCode: e.statusCode,
  8073. data: e.data || {}
  8074. };
  8075. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  8076. },
  8077. fail: function fail(e) {
  8078. n(new Error(e.errMsg || "uploadFile:fail"));
  8079. }
  8080. });
  8081. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  8082. e.onUploadProgress({
  8083. loaded: t.totalBytesSent,
  8084. total: t.totalBytesExpectedToSend
  8085. });
  8086. });
  8087. });
  8088. }
  8089. }]);
  8090. return dt;
  8091. }();
  8092. var ft = {
  8093. setItem: function setItem(e, t) {
  8094. X.setStorageSync(e, t);
  8095. },
  8096. getItem: function getItem(e) {
  8097. return X.getStorageSync(e);
  8098. },
  8099. removeItem: function removeItem(e) {
  8100. X.removeStorageSync(e);
  8101. },
  8102. clear: function clear() {
  8103. X.clearStorageSync();
  8104. }
  8105. };
  8106. var pt = {
  8107. genAdapter: function genAdapter() {
  8108. return {
  8109. root: {},
  8110. reqClass: dt,
  8111. localStorage: ft,
  8112. primaryStorage: "local"
  8113. };
  8114. },
  8115. isMatch: function isMatch() {
  8116. return !0;
  8117. },
  8118. runtime: "uni_app"
  8119. };
  8120. lt.useAdapters(pt);
  8121. var gt = lt,
  8122. mt = gt.init;
  8123. gt.init = function (e) {
  8124. e.env = e.spaceId;
  8125. var t = mt.call(this, e);
  8126. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  8127. var n = t.auth;
  8128. return t.auth = function (e) {
  8129. var t = n.call(this, e);
  8130. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  8131. t[e] = Y(t[e]).bind(t);
  8132. }), t;
  8133. }, t.customAuth = t.auth, t;
  8134. };
  8135. var yt = gt;
  8136. var _t = /*#__PURE__*/function (_le) {
  8137. (0, _inherits2.default)(_t, _le);
  8138. var _super8 = _createSuper(_t);
  8139. function _t() {
  8140. (0, _classCallCheck2.default)(this, _t);
  8141. return _super8.apply(this, arguments);
  8142. }
  8143. (0, _createClass2.default)(_t, [{
  8144. key: "getAccessToken",
  8145. value: function getAccessToken() {
  8146. var _this11 = this;
  8147. return new Promise(function (e, t) {
  8148. var n = "Anonymous_Access_token";
  8149. _this11.setAccessToken(n), e(n);
  8150. });
  8151. }
  8152. }, {
  8153. key: "setupRequest",
  8154. value: function setupRequest(e, t) {
  8155. var n = Object.assign({}, e, {
  8156. spaceId: this.config.spaceId,
  8157. timestamp: Date.now()
  8158. }),
  8159. s = {
  8160. "Content-Type": "application/json"
  8161. };
  8162. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = ae.sign(n, this.config.clientSecret);
  8163. var r = oe();
  8164. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  8165. var _Z = Z(),
  8166. i = _Z.token;
  8167. return s["x-client-token"] = i, {
  8168. url: this.config.requestUrl,
  8169. method: "POST",
  8170. data: n,
  8171. dataType: "json",
  8172. header: JSON.parse(JSON.stringify(s))
  8173. };
  8174. }
  8175. }, {
  8176. key: "uploadFileToOSS",
  8177. value: function uploadFileToOSS(_ref13) {
  8178. var _this12 = this;
  8179. var e = _ref13.url,
  8180. t = _ref13.formData,
  8181. n = _ref13.name,
  8182. s = _ref13.filePath,
  8183. r = _ref13.fileType,
  8184. i = _ref13.onUploadProgress;
  8185. return new Promise(function (o, a) {
  8186. var c = _this12.adapter.uploadFile({
  8187. url: e,
  8188. formData: t,
  8189. name: n,
  8190. filePath: s,
  8191. fileType: r,
  8192. success: function success(e) {
  8193. e && e.statusCode < 400 ? o(e) : a(new Q({
  8194. code: "UPLOAD_FAILED",
  8195. message: "文件上传失败"
  8196. }));
  8197. },
  8198. fail: function fail(e) {
  8199. a(new Q({
  8200. code: e.code || "UPLOAD_FAILED",
  8201. message: e.message || e.errMsg || "文件上传失败"
  8202. }));
  8203. }
  8204. });
  8205. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  8206. i({
  8207. loaded: e.totalBytesSent,
  8208. total: e.totalBytesExpectedToSend
  8209. });
  8210. });
  8211. });
  8212. }
  8213. }, {
  8214. key: "uploadFile",
  8215. value: function uploadFile(_ref14) {
  8216. var _this13 = this;
  8217. var e = _ref14.filePath,
  8218. t = _ref14.cloudPath,
  8219. _ref14$fileType = _ref14.fileType,
  8220. n = _ref14$fileType === void 0 ? "image" : _ref14$fileType,
  8221. s = _ref14.onUploadProgress;
  8222. if (!t) throw new Q({
  8223. code: "CLOUDPATH_REQUIRED",
  8224. message: "cloudPath不可为空"
  8225. });
  8226. var r;
  8227. return this.getOSSUploadOptionsFromPath({
  8228. cloudPath: t
  8229. }).then(function (t) {
  8230. var _t$result = t.result,
  8231. i = _t$result.url,
  8232. o = _t$result.formData,
  8233. a = _t$result.name;
  8234. r = t.result.fileUrl;
  8235. var c = {
  8236. url: i,
  8237. formData: o,
  8238. name: a,
  8239. filePath: e,
  8240. fileType: n
  8241. };
  8242. return _this13.uploadFileToOSS(Object.assign({}, c, {
  8243. onUploadProgress: s
  8244. }));
  8245. }).then(function () {
  8246. return _this13.reportOSSUpload({
  8247. cloudPath: t
  8248. });
  8249. }).then(function (t) {
  8250. return new Promise(function (n, s) {
  8251. t.success ? n({
  8252. success: !0,
  8253. filePath: e,
  8254. fileID: r
  8255. }) : s(new Q({
  8256. code: "UPLOAD_FAILED",
  8257. message: "文件上传失败"
  8258. }));
  8259. });
  8260. });
  8261. }
  8262. }, {
  8263. key: "deleteFile",
  8264. value: function deleteFile(_ref15) {
  8265. var e = _ref15.fileList;
  8266. var t = {
  8267. method: "serverless.file.resource.delete",
  8268. params: JSON.stringify({
  8269. fileList: e
  8270. })
  8271. };
  8272. return this.request(this.setupRequest(t)).then(function (e) {
  8273. if (e.success) return e.result;
  8274. throw new Q({
  8275. code: "DELETE_FILE_FAILED",
  8276. message: "删除文件失败"
  8277. });
  8278. });
  8279. }
  8280. }, {
  8281. key: "getTempFileURL",
  8282. value: function getTempFileURL() {
  8283. var _ref16 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8284. e = _ref16.fileList;
  8285. if (!Array.isArray(e) || 0 === e.length) throw new Q({
  8286. code: "INVALID_PARAM",
  8287. message: "fileList的元素必须是非空的字符串"
  8288. });
  8289. var t = {
  8290. method: "serverless.file.resource.getTempFileURL",
  8291. params: JSON.stringify({
  8292. fileList: e
  8293. })
  8294. };
  8295. return this.request(this.setupRequest(t)).then(function (e) {
  8296. if (e.success) return {
  8297. fileList: e.result.fileList.map(function (e) {
  8298. return {
  8299. fileID: e.fileID,
  8300. tempFileURL: e.tempFileURL
  8301. };
  8302. })
  8303. };
  8304. throw new Q({
  8305. code: "GET_TEMP_FILE_URL_FAILED",
  8306. message: "获取临时文件链接失败"
  8307. });
  8308. });
  8309. }
  8310. }]);
  8311. return _t;
  8312. }(le);
  8313. var wt = {
  8314. init: function init(e) {
  8315. var t = new _t(e),
  8316. n = {
  8317. signInAnonymously: function signInAnonymously() {
  8318. return t.authorize();
  8319. },
  8320. getLoginState: function getLoginState() {
  8321. return Promise.resolve(!1);
  8322. }
  8323. };
  8324. return t.auth = function () {
  8325. return n;
  8326. }, t.customAuth = t.auth, t;
  8327. }
  8328. };
  8329. function vt(_ref17) {
  8330. var e = _ref17.data;
  8331. var t;
  8332. t = oe();
  8333. var n = JSON.parse(JSON.stringify(e || {}));
  8334. if (Object.assign(n, {
  8335. clientInfo: t
  8336. }), !n.uniIdToken) {
  8337. var _Z2 = Z(),
  8338. _e20 = _Z2.token;
  8339. _e20 && (n.uniIdToken = _e20);
  8340. }
  8341. return n;
  8342. }
  8343. function St() {
  8344. var _this14 = this;
  8345. var _ref18 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8346. e = _ref18.name,
  8347. t = _ref18.data;
  8348. var _this$__dev__ = this.__dev__,
  8349. n = _this$__dev__.localAddress,
  8350. s = _this$__dev__.localPort,
  8351. r = {
  8352. aliyun: "aliyun",
  8353. tencent: "tcb"
  8354. }[this.config.provider],
  8355. i = this.config.spaceId,
  8356. o = "http://".concat(n, ":").concat(s, "/system/check-function"),
  8357. a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  8358. return new Promise(function (t, n) {
  8359. X.request({
  8360. method: "POST",
  8361. url: o,
  8362. data: {
  8363. name: e,
  8364. platform: S,
  8365. provider: r,
  8366. spaceId: i
  8367. },
  8368. timeout: 3e3,
  8369. success: function success(e) {
  8370. t(e);
  8371. },
  8372. fail: function fail() {
  8373. t({
  8374. data: {
  8375. code: "NETWORK_ERROR",
  8376. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  8377. }
  8378. });
  8379. }
  8380. });
  8381. }).then(function () {
  8382. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8383. e = _ref19.data;
  8384. var _ref20 = e || {},
  8385. t = _ref20.code,
  8386. n = _ref20.message;
  8387. return {
  8388. code: 0 === t ? 0 : t || "SYS_ERR",
  8389. message: n || "SYS_ERR"
  8390. };
  8391. }).then(function (_ref21) {
  8392. var n = _ref21.code,
  8393. s = _ref21.message;
  8394. if (0 !== n) {
  8395. switch (n) {
  8396. case "MODULE_ENCRYPTED":
  8397. 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"));
  8398. break;
  8399. case "FUNCTION_ENCRYPTED":
  8400. 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"));
  8401. break;
  8402. case "ACTION_ENCRYPTED":
  8403. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  8404. break;
  8405. case "NETWORK_ERROR":
  8406. {
  8407. var _e21 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  8408. throw console.error(_e21), new Error(_e21);
  8409. }
  8410. case "SWITCH_TO_CLOUD":
  8411. break;
  8412. default:
  8413. {
  8414. var _e22 = "\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");
  8415. throw console.error(_e22), new Error(_e22);
  8416. }
  8417. }
  8418. return _this14._callCloudFunction({
  8419. name: e,
  8420. data: t
  8421. });
  8422. }
  8423. return new Promise(function (e, n) {
  8424. var s = vt.call(_this14, {
  8425. data: t
  8426. });
  8427. X.request({
  8428. method: "POST",
  8429. url: a,
  8430. data: {
  8431. provider: r,
  8432. platform: S,
  8433. param: s
  8434. },
  8435. success: function success() {
  8436. var _ref22 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8437. t = _ref22.statusCode,
  8438. s = _ref22.data;
  8439. return !t || t >= 400 ? n(new Q({
  8440. code: s.code || "SYS_ERR",
  8441. message: s.message || "request:fail"
  8442. })) : e({
  8443. result: s
  8444. });
  8445. },
  8446. fail: function fail(e) {
  8447. n(new Q({
  8448. code: e.code || e.errCode || "SYS_ERR",
  8449. message: e.message || e.errMsg || "request:fail"
  8450. }));
  8451. }
  8452. });
  8453. });
  8454. });
  8455. }
  8456. var kt = [{
  8457. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  8458. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  8459. mode: "append"
  8460. }];
  8461. var It = /[\\^$.*+?()[\]{}|]/g,
  8462. bt = RegExp(It.source);
  8463. function Tt(e, t, n) {
  8464. return e.replace(new RegExp((s = t) && bt.test(s) ? s.replace(It, "\\$&") : s, "g"), n);
  8465. var s;
  8466. }
  8467. var At = "none",
  8468. Ct = "request",
  8469. Pt = "response",
  8470. Et = "both";
  8471. var Ot = /*#__PURE__*/function () {
  8472. function Ot() {
  8473. var _ref23 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8474. e = _ref23.secretType,
  8475. t = _ref23.uniCloudIns;
  8476. (0, _classCallCheck2.default)(this, Ot);
  8477. this.secretType = e || At, this.uniCloudIns = t;
  8478. var _this$uniCloudIns$con = this.uniCloudIns.config,
  8479. n = _this$uniCloudIns$con.provider,
  8480. s = _this$uniCloudIns$con.spaceId;
  8481. var r;
  8482. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, C("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  8483. }
  8484. (0, _createClass2.default)(Ot, [{
  8485. key: "getSystemInfo",
  8486. value: function getSystemInfo() {
  8487. return this._systemInfo || (this._systemInfo = re()), this._systemInfo;
  8488. }
  8489. }, {
  8490. key: "appId",
  8491. get: function get() {
  8492. return this.getSystemInfo().appId;
  8493. }
  8494. }, {
  8495. key: "deviceId",
  8496. get: function get() {
  8497. return this.getSystemInfo().deviceId;
  8498. }
  8499. }, {
  8500. key: "encryptData",
  8501. value: function () {
  8502. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e) {
  8503. return _regenerator.default.wrap(function _callee33$(_context33) {
  8504. while (1) {
  8505. switch (_context33.prev = _context33.next) {
  8506. case 0:
  8507. return _context33.abrupt("return", this.secretType === At || this.secretType === At ? e : this.platformEncryptData(e));
  8508. case 1:
  8509. case "end":
  8510. return _context33.stop();
  8511. }
  8512. }
  8513. }, _callee33, this);
  8514. }));
  8515. function encryptData(_x31) {
  8516. return _encryptData.apply(this, arguments);
  8517. }
  8518. return encryptData;
  8519. }()
  8520. }, {
  8521. key: "decryptResult",
  8522. value: function () {
  8523. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  8524. var t;
  8525. return _regenerator.default.wrap(function _callee34$(_context34) {
  8526. while (1) {
  8527. switch (_context34.prev = _context34.next) {
  8528. case 0:
  8529. if (!(this.secretType === At)) {
  8530. _context34.next = 2;
  8531. break;
  8532. }
  8533. return _context34.abrupt("return", e);
  8534. case 2:
  8535. t = e.content;
  8536. return _context34.abrupt("return", t ? this.secretType === Ct ? t : this.platformDecryptResult(e) : e);
  8537. case 4:
  8538. case "end":
  8539. return _context34.stop();
  8540. }
  8541. }
  8542. }, _callee34, this);
  8543. }));
  8544. function decryptResult(_x32) {
  8545. return _decryptResult.apply(this, arguments);
  8546. }
  8547. return decryptResult;
  8548. }()
  8549. }, {
  8550. key: "wrapVerifyClientCallFunction",
  8551. value: function wrapVerifyClientCallFunction(e) {
  8552. var t = this;
  8553. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
  8554. var _ref25,
  8555. n,
  8556. _ref25$data,
  8557. s,
  8558. _args35 = arguments;
  8559. return _regenerator.default.wrap(function _callee35$(_context35) {
  8560. while (1) {
  8561. switch (_context35.prev = _context35.next) {
  8562. case 0:
  8563. _ref25 = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : {}, n = _ref25.name, _ref25$data = _ref25.data, s = _ref25$data === void 0 ? {} : _ref25$data;
  8564. _context35.next = 3;
  8565. return t.prepare();
  8566. case 3:
  8567. _context35.next = 5;
  8568. return t.platformGetSignOption();
  8569. case 5:
  8570. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context35.sent;
  8571. _context35.next = 8;
  8572. return e({
  8573. name: n,
  8574. data: s
  8575. });
  8576. case 8:
  8577. return _context35.abrupt("return", _context35.sent);
  8578. case 9:
  8579. case "end":
  8580. return _context35.stop();
  8581. }
  8582. }
  8583. }, _callee35);
  8584. }));
  8585. }
  8586. }, {
  8587. key: "wrapEncryptDataCallFunction",
  8588. value: function wrapEncryptDataCallFunction(e) {
  8589. var t = this;
  8590. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  8591. var _ref27,
  8592. n,
  8593. _ref27$data,
  8594. s,
  8595. r,
  8596. i,
  8597. _args36 = arguments;
  8598. return _regenerator.default.wrap(function _callee36$(_context36) {
  8599. while (1) {
  8600. switch (_context36.prev = _context36.next) {
  8601. case 0:
  8602. _ref27 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref27.name, _ref27$data = _ref27.data, s = _ref27$data === void 0 ? {} : _ref27$data;
  8603. _context36.next = 3;
  8604. return t.prepare();
  8605. case 3:
  8606. _context36.next = 5;
  8607. return t.encryptData(s);
  8608. case 5:
  8609. r = _context36.sent;
  8610. _context36.next = 8;
  8611. return e({
  8612. name: n,
  8613. data: r
  8614. });
  8615. case 8:
  8616. i = _context36.sent;
  8617. _context36.next = 11;
  8618. return t.decryptResult(i.result);
  8619. case 11:
  8620. i.result = _context36.sent;
  8621. return _context36.abrupt("return", i);
  8622. case 13:
  8623. case "end":
  8624. return _context36.stop();
  8625. }
  8626. }
  8627. }, _callee36);
  8628. }));
  8629. }
  8630. }]);
  8631. return Ot;
  8632. }();
  8633. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  8634. function xt(e) {
  8635. return parseInt(e) === e;
  8636. }
  8637. function Ut(e) {
  8638. if (!xt(e.length)) return !1;
  8639. for (var t = 0; t < e.length; t++) {
  8640. if (!xt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  8641. }
  8642. return !0;
  8643. }
  8644. function Rt(e, t) {
  8645. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  8646. if (Array.isArray(e)) {
  8647. if (!Ut(e)) throw new Error("Array contains invalid value: " + e);
  8648. return new Uint8Array(e);
  8649. }
  8650. if (xt(e.length) && Ut(e)) return new Uint8Array(e);
  8651. throw new Error("unsupported array-like object");
  8652. }
  8653. function Lt(e) {
  8654. return new Uint8Array(e);
  8655. }
  8656. function Nt(e, t, n, s, r) {
  8657. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  8658. }
  8659. var Dt,
  8660. Ft = {
  8661. toBytes: function toBytes(e) {
  8662. var t = [],
  8663. n = 0;
  8664. for (e = encodeURI(e); n < e.length;) {
  8665. var s = e.charCodeAt(n++);
  8666. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  8667. }
  8668. return Rt(t);
  8669. },
  8670. fromBytes: function fromBytes(e) {
  8671. for (var t = [], n = 0; n < e.length;) {
  8672. var s = e[n];
  8673. 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);
  8674. }
  8675. return t.join("");
  8676. }
  8677. },
  8678. qt = (Dt = "0123456789abcdef", {
  8679. toBytes: function toBytes(e) {
  8680. for (var t = [], n = 0; n < e.length; n += 2) {
  8681. t.push(parseInt(e.substr(n, 2), 16));
  8682. }
  8683. return t;
  8684. },
  8685. fromBytes: function fromBytes(e) {
  8686. for (var t = [], n = 0; n < e.length; n++) {
  8687. var s = e[n];
  8688. t.push(Dt[(240 & s) >> 4] + Dt[15 & s]);
  8689. }
  8690. return t.join("");
  8691. }
  8692. }),
  8693. Kt = {
  8694. 16: 10,
  8695. 24: 12,
  8696. 32: 14
  8697. },
  8698. jt = [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],
  8699. Mt = [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],
  8700. Bt = [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],
  8701. $t = [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],
  8702. Wt = [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],
  8703. zt = [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],
  8704. Jt = [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],
  8705. Ht = [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],
  8706. Gt = [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],
  8707. Vt = [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],
  8708. Yt = [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],
  8709. Qt = [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],
  8710. Xt = [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],
  8711. Zt = [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],
  8712. en = [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];
  8713. function tn(e) {
  8714. for (var t = [], n = 0; n < e.length; n += 4) {
  8715. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  8716. }
  8717. return t;
  8718. }
  8719. var nn = /*#__PURE__*/function () {
  8720. function nn(e) {
  8721. (0, _classCallCheck2.default)(this, nn);
  8722. if (!(this instanceof nn)) throw Error("AES must be instanitated with `new`");
  8723. Object.defineProperty(this, "key", {
  8724. value: Rt(e, !0)
  8725. }), this._prepare();
  8726. }
  8727. (0, _createClass2.default)(nn, [{
  8728. key: "_prepare",
  8729. value: function _prepare() {
  8730. var e = Kt[this.key.length];
  8731. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  8732. this._Ke = [], this._Kd = [];
  8733. for (var t = 0; t <= e; t++) {
  8734. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  8735. }
  8736. var n,
  8737. s = 4 * (e + 1),
  8738. r = this.key.length / 4,
  8739. i = tn(this.key);
  8740. for (t = 0; t < r; t++) {
  8741. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  8742. }
  8743. for (var o, a = 0, c = r; c < s;) {
  8744. if (o = i[r - 1], i[0] ^= Mt[o >> 16 & 255] << 24 ^ Mt[o >> 8 & 255] << 16 ^ Mt[255 & o] << 8 ^ Mt[o >> 24 & 255] ^ jt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  8745. i[t] ^= i[t - 1];
  8746. } else {
  8747. for (t = 1; t < r / 2; t++) {
  8748. i[t] ^= i[t - 1];
  8749. }
  8750. o = i[r / 2 - 1], i[r / 2] ^= Mt[255 & o] ^ Mt[o >> 8 & 255] << 8 ^ Mt[o >> 16 & 255] << 16 ^ Mt[o >> 24 & 255] << 24;
  8751. for (t = r / 2 + 1; t < r; t++) {
  8752. i[t] ^= i[t - 1];
  8753. }
  8754. }
  8755. for (t = 0; t < r && c < s;) {
  8756. u = c >> 2, l = c % 4, this._Ke[u][l] = i[t], this._Kd[e - u][l] = i[t++], c++;
  8757. }
  8758. }
  8759. for (var u = 1; u < e; u++) {
  8760. for (var l = 0; l < 4; l++) {
  8761. o = this._Kd[u][l], this._Kd[u][l] = Qt[o >> 24 & 255] ^ Xt[o >> 16 & 255] ^ Zt[o >> 8 & 255] ^ en[255 & o];
  8762. }
  8763. }
  8764. }
  8765. }, {
  8766. key: "encrypt",
  8767. value: function encrypt(e) {
  8768. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  8769. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = tn(e), r = 0; r < 4; r++) {
  8770. s[r] ^= this._Ke[0][r];
  8771. }
  8772. for (var i = 1; i < t; i++) {
  8773. for (r = 0; r < 4; r++) {
  8774. n[r] = $t[s[r] >> 24 & 255] ^ Wt[s[(r + 1) % 4] >> 16 & 255] ^ zt[s[(r + 2) % 4] >> 8 & 255] ^ Jt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  8775. }
  8776. s = n.slice();
  8777. }
  8778. var o,
  8779. a = Lt(16);
  8780. for (r = 0; r < 4; r++) {
  8781. o = this._Ke[t][r], a[4 * r] = 255 & (Mt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Mt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Mt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Mt[255 & s[(r + 3) % 4]] ^ o);
  8782. }
  8783. return a;
  8784. }
  8785. }, {
  8786. key: "decrypt",
  8787. value: function decrypt(e) {
  8788. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  8789. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = tn(e), r = 0; r < 4; r++) {
  8790. s[r] ^= this._Kd[0][r];
  8791. }
  8792. for (var i = 1; i < t; i++) {
  8793. for (r = 0; r < 4; r++) {
  8794. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 3) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  8795. }
  8796. s = n.slice();
  8797. }
  8798. var o,
  8799. a = Lt(16);
  8800. for (r = 0; r < 4; r++) {
  8801. o = this._Kd[t][r], a[4 * r] = 255 & (Bt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Bt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Bt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Bt[255 & s[(r + 1) % 4]] ^ o);
  8802. }
  8803. return a;
  8804. }
  8805. }]);
  8806. return nn;
  8807. }();
  8808. var sn = /*#__PURE__*/function () {
  8809. function sn(e) {
  8810. (0, _classCallCheck2.default)(this, sn);
  8811. if (!(this instanceof sn)) throw Error("AES must be instanitated with `new`");
  8812. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new nn(e);
  8813. }
  8814. (0, _createClass2.default)(sn, [{
  8815. key: "encrypt",
  8816. value: function encrypt(e) {
  8817. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  8818. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  8819. Nt(e, n, 0, s, s + 16), Nt(n = this._aes.encrypt(n), t, s);
  8820. }
  8821. return t;
  8822. }
  8823. }, {
  8824. key: "decrypt",
  8825. value: function decrypt(e) {
  8826. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  8827. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  8828. Nt(e, n, 0, s, s + 16), Nt(n = this._aes.decrypt(n), t, s);
  8829. }
  8830. return t;
  8831. }
  8832. }]);
  8833. return sn;
  8834. }();
  8835. var rn = /*#__PURE__*/function () {
  8836. function rn(e, t) {
  8837. (0, _classCallCheck2.default)(this, rn);
  8838. if (!(this instanceof rn)) throw Error("AES must be instanitated with `new`");
  8839. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  8840. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  8841. } else t = Lt(16);
  8842. this._lastCipherblock = Rt(t, !0), this._aes = new nn(e);
  8843. }
  8844. (0, _createClass2.default)(rn, [{
  8845. key: "encrypt",
  8846. value: function encrypt(e) {
  8847. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  8848. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  8849. Nt(e, n, 0, s, s + 16);
  8850. for (var r = 0; r < 16; r++) {
  8851. n[r] ^= this._lastCipherblock[r];
  8852. }
  8853. this._lastCipherblock = this._aes.encrypt(n), Nt(this._lastCipherblock, t, s);
  8854. }
  8855. return t;
  8856. }
  8857. }, {
  8858. key: "decrypt",
  8859. value: function decrypt(e) {
  8860. if ((e = Rt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  8861. for (var t = Lt(e.length), n = Lt(16), s = 0; s < e.length; s += 16) {
  8862. Nt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  8863. for (var r = 0; r < 16; r++) {
  8864. t[s + r] = n[r] ^ this._lastCipherblock[r];
  8865. }
  8866. Nt(e, this._lastCipherblock, 0, s, s + 16);
  8867. }
  8868. return t;
  8869. }
  8870. }]);
  8871. return rn;
  8872. }();
  8873. var on = /*#__PURE__*/function () {
  8874. function on(e, t, n) {
  8875. (0, _classCallCheck2.default)(this, on);
  8876. if (!(this instanceof on)) throw Error("AES must be instanitated with `new`");
  8877. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  8878. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  8879. } else t = Lt(16);
  8880. n || (n = 1), this.segmentSize = n, this._shiftRegister = Rt(t, !0), this._aes = new nn(e);
  8881. }
  8882. (0, _createClass2.default)(on, [{
  8883. key: "encrypt",
  8884. value: function encrypt(e) {
  8885. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  8886. for (var t, n = Rt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  8887. t = this._aes.encrypt(this._shiftRegister);
  8888. for (var r = 0; r < this.segmentSize; r++) {
  8889. n[s + r] ^= t[r];
  8890. }
  8891. Nt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Nt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  8892. }
  8893. return n;
  8894. }
  8895. }, {
  8896. key: "decrypt",
  8897. value: function decrypt(e) {
  8898. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  8899. for (var t, n = Rt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  8900. t = this._aes.encrypt(this._shiftRegister);
  8901. for (var r = 0; r < this.segmentSize; r++) {
  8902. n[s + r] ^= t[r];
  8903. }
  8904. Nt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Nt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  8905. }
  8906. return n;
  8907. }
  8908. }]);
  8909. return on;
  8910. }();
  8911. var an = /*#__PURE__*/function () {
  8912. function an(e, t) {
  8913. (0, _classCallCheck2.default)(this, an);
  8914. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  8915. if (this.description = "Output Feedback", this.name = "ofb", t) {
  8916. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  8917. } else t = Lt(16);
  8918. this._lastPrecipher = Rt(t, !0), this._lastPrecipherIndex = 16, this._aes = new nn(e);
  8919. }
  8920. (0, _createClass2.default)(an, [{
  8921. key: "encrypt",
  8922. value: function encrypt(e) {
  8923. for (var t = Rt(e, !0), n = 0; n < t.length; n++) {
  8924. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  8925. }
  8926. return t;
  8927. }
  8928. }, {
  8929. key: "decrypt",
  8930. value: function decrypt(e) {
  8931. return this.encrypt(e);
  8932. }
  8933. }]);
  8934. return an;
  8935. }();
  8936. var cn = /*#__PURE__*/function () {
  8937. function cn(e) {
  8938. (0, _classCallCheck2.default)(this, cn);
  8939. if (!(this instanceof cn)) throw Error("Counter must be instanitated with `new`");
  8940. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Lt(16), this.setValue(e)) : this.setBytes(e);
  8941. }
  8942. (0, _createClass2.default)(cn, [{
  8943. key: "setValue",
  8944. value: function setValue(e) {
  8945. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  8946. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  8947. for (var t = 15; t >= 0; --t) {
  8948. this._counter[t] = e % 256, e = parseInt(e / 256);
  8949. }
  8950. }
  8951. }, {
  8952. key: "setBytes",
  8953. value: function setBytes(e) {
  8954. if (16 != (e = Rt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  8955. this._counter = e;
  8956. }
  8957. }, {
  8958. key: "increment",
  8959. value: function increment() {
  8960. for (var e = 15; e >= 0; e--) {
  8961. if (255 !== this._counter[e]) {
  8962. this._counter[e]++;
  8963. break;
  8964. }
  8965. this._counter[e] = 0;
  8966. }
  8967. }
  8968. }]);
  8969. return cn;
  8970. }();
  8971. var un = /*#__PURE__*/function () {
  8972. function un(e, t) {
  8973. (0, _classCallCheck2.default)(this, un);
  8974. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  8975. this.description = "Counter", this.name = "ctr", t instanceof cn || (t = new cn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new nn(e);
  8976. }
  8977. (0, _createClass2.default)(un, [{
  8978. key: "encrypt",
  8979. value: function encrypt(e) {
  8980. for (var t = Rt(e, !0), n = 0; n < t.length; n++) {
  8981. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  8982. }
  8983. return t;
  8984. }
  8985. }, {
  8986. key: "decrypt",
  8987. value: function decrypt(e) {
  8988. return this.encrypt(e);
  8989. }
  8990. }]);
  8991. return un;
  8992. }();
  8993. var ln = {
  8994. AES: nn,
  8995. Counter: cn,
  8996. ModeOfOperation: {
  8997. ecb: sn,
  8998. cbc: rn,
  8999. cfb: on,
  9000. ofb: an,
  9001. ctr: un
  9002. },
  9003. utils: {
  9004. hex: qt,
  9005. utf8: Ft
  9006. },
  9007. padding: {
  9008. pkcs7: {
  9009. pad: function pad(e) {
  9010. var t = 16 - (e = Rt(e, !0)).length % 16,
  9011. n = Lt(e.length + t);
  9012. Nt(e, n);
  9013. for (var s = e.length; s < n.length; s++) {
  9014. n[s] = t;
  9015. }
  9016. return n;
  9017. },
  9018. strip: function strip(e) {
  9019. if ((e = Rt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  9020. var t = e[e.length - 1];
  9021. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  9022. for (var n = e.length - t, s = 0; s < t; s++) {
  9023. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  9024. }
  9025. var r = Lt(n);
  9026. return Nt(e, r, 0, 0, n), r;
  9027. }
  9028. }
  9029. },
  9030. _arrayTest: {
  9031. coerceArray: Rt,
  9032. createArray: Lt,
  9033. copyArray: Nt
  9034. }
  9035. };
  9036. function hn(e, t, n) {
  9037. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  9038. r = ln.utils.utf8.toBytes(n),
  9039. i = ln.utils.utf8.toBytes(e),
  9040. o = new ln.ModeOfOperation.cbc(s, r),
  9041. a = ln.padding.pkcs7.pad(i),
  9042. c = o.encrypt(a);
  9043. return uni.arrayBufferToBase64(c);
  9044. }
  9045. var dn = {
  9046. code: 2e4,
  9047. message: "System error"
  9048. },
  9049. fn = {
  9050. code: 20101,
  9051. message: "Invalid client"
  9052. },
  9053. pn = {
  9054. code: 20102,
  9055. message: "Get encrypt key failed"
  9056. },
  9057. gn = {
  9058. 10001: "Secure network is not supported on current playground or unimpsdk",
  9059. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  9060. 10009: "Encrypt payload failed",
  9061. 10010: "Decrypt response failed"
  9062. };
  9063. function mn(e) {
  9064. var _ref28 = e || {},
  9065. t = _ref28.errSubject,
  9066. n = _ref28.subject,
  9067. s = _ref28.errCode,
  9068. r = _ref28.errMsg,
  9069. i = _ref28.code,
  9070. o = _ref28.message,
  9071. a = _ref28.cause;
  9072. return new Q({
  9073. subject: t || n || "uni-secure-network",
  9074. code: s || i || dn.code,
  9075. message: r || o,
  9076. cause: a
  9077. });
  9078. }
  9079. var yn,
  9080. _n,
  9081. wn = null;
  9082. var vn = /*#__PURE__*/function (_Ot) {
  9083. (0, _inherits2.default)(vn, _Ot);
  9084. var _super9 = _createSuper(vn);
  9085. function vn(e) {
  9086. var _this15;
  9087. (0, _classCallCheck2.default)(this, vn);
  9088. _this15 = _super9.call(this, e), _this15.userEncryptKey = null;
  9089. return _this15;
  9090. }
  9091. (0, _createClass2.default)(vn, [{
  9092. key: "isLogin",
  9093. value: function isLogin() {
  9094. return !!this.scopedGlobalCache.mpWeixinCode;
  9095. }
  9096. }, {
  9097. key: "prepare",
  9098. value: function () {
  9099. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  9100. return _regenerator.default.wrap(function _callee37$(_context37) {
  9101. while (1) {
  9102. switch (_context37.prev = _context37.next) {
  9103. case 0:
  9104. if (this.isLogin()) {
  9105. _context37.next = 7;
  9106. break;
  9107. }
  9108. if (this.scopedGlobalCache.initPromise) {
  9109. _context37.next = 3;
  9110. break;
  9111. }
  9112. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  9113. case 3:
  9114. _context37.next = 5;
  9115. return this.scopedGlobalCache.initPromise;
  9116. case 5:
  9117. if (this.scopedGlobalCache.mpWeixinCode) {
  9118. _context37.next = 7;
  9119. break;
  9120. }
  9121. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  9122. case 7:
  9123. case "end":
  9124. return _context37.stop();
  9125. }
  9126. }
  9127. }, _callee37, this);
  9128. }));
  9129. function prepare() {
  9130. return _prepare2.apply(this, arguments);
  9131. }
  9132. return prepare;
  9133. }()
  9134. }, {
  9135. key: "getUserEncryptKey",
  9136. value: function () {
  9137. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  9138. var _this16 = this;
  9139. var e;
  9140. return _regenerator.default.wrap(function _callee38$(_context38) {
  9141. while (1) {
  9142. switch (_context38.prev = _context38.next) {
  9143. case 0:
  9144. if (!this.userEncryptKey) {
  9145. _context38.next = 2;
  9146. break;
  9147. }
  9148. return _context38.abrupt("return", this.userEncryptKey);
  9149. case 2:
  9150. if (!(wn && wn.expireTime)) {
  9151. _context38.next = 6;
  9152. break;
  9153. }
  9154. e = Date.now();
  9155. if (!(wn.expireTime - e > 0)) {
  9156. _context38.next = 6;
  9157. break;
  9158. }
  9159. return _context38.abrupt("return", (this.userEncryptKey = wn, this.userEncryptKey));
  9160. case 6:
  9161. return _context38.abrupt("return", new Promise(function (e, t) {
  9162. uni.getUserCryptoManager().getLatestUserKey({
  9163. success: function success(t) {
  9164. wn = t, _this16.userEncryptKey = t, e(_this16.userEncryptKey);
  9165. },
  9166. fail: function fail(e) {
  9167. t(mn(_objectSpread(_objectSpread({}, pn), {}, {
  9168. cause: e
  9169. })));
  9170. }
  9171. });
  9172. }));
  9173. case 7:
  9174. case "end":
  9175. return _context38.stop();
  9176. }
  9177. }
  9178. }, _callee38, this);
  9179. }));
  9180. function getUserEncryptKey() {
  9181. return _getUserEncryptKey.apply(this, arguments);
  9182. }
  9183. return getUserEncryptKey;
  9184. }()
  9185. }, {
  9186. key: "getWxAppId",
  9187. value: function getWxAppId() {
  9188. return wx.getAccountInfoSync().miniProgram.appId;
  9189. }
  9190. }, {
  9191. key: "platformGetSignOption",
  9192. value: function () {
  9193. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  9194. var _yield$this$getUserEn, e, t, n;
  9195. return _regenerator.default.wrap(function _callee39$(_context39) {
  9196. while (1) {
  9197. switch (_context39.prev = _context39.next) {
  9198. case 0:
  9199. _context39.next = 2;
  9200. return this.getUserEncryptKey();
  9201. case 2:
  9202. _yield$this$getUserEn = _context39.sent;
  9203. e = _yield$this$getUserEn.encryptKey;
  9204. t = _yield$this$getUserEn.iv;
  9205. n = _yield$this$getUserEn.version;
  9206. return _context39.abrupt("return", {
  9207. verifyClientSign: hn(JSON.stringify({
  9208. data: JSON.stringify({}),
  9209. appId: this.appId,
  9210. deviceId: this.deviceId,
  9211. wxAppId: this.getWxAppId(),
  9212. simulator: "devtools" === re().platform,
  9213. timestamp: Date.now()
  9214. }), e, t),
  9215. encryptKeyId: n,
  9216. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode
  9217. });
  9218. case 7:
  9219. case "end":
  9220. return _context39.stop();
  9221. }
  9222. }
  9223. }, _callee39, this);
  9224. }));
  9225. function platformGetSignOption() {
  9226. return _platformGetSignOption.apply(this, arguments);
  9227. }
  9228. return platformGetSignOption;
  9229. }()
  9230. }, {
  9231. key: "platformEncryptData",
  9232. value: function () {
  9233. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(e) {
  9234. var _yield$this$getUserEn2, t, n, s, r;
  9235. return _regenerator.default.wrap(function _callee40$(_context40) {
  9236. while (1) {
  9237. switch (_context40.prev = _context40.next) {
  9238. case 0:
  9239. _context40.next = 2;
  9240. return this.getUserEncryptKey();
  9241. case 2:
  9242. _yield$this$getUserEn2 = _context40.sent;
  9243. t = _yield$this$getUserEn2.encryptKey;
  9244. n = _yield$this$getUserEn2.iv;
  9245. s = _yield$this$getUserEn2.version;
  9246. r = {
  9247. secretType: this.secretType,
  9248. encryptKeyId: s,
  9249. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode
  9250. };
  9251. return _context40.abrupt("return", this.secretType === Pt ? {
  9252. content: e,
  9253. _uniCloudOptions: r
  9254. } : {
  9255. content: hn(JSON.stringify({
  9256. data: JSON.stringify(e),
  9257. appId: this.appId,
  9258. deviceId: this.deviceId,
  9259. wxAppId: this.getWxAppId(),
  9260. simulator: "devtools" === re().platform,
  9261. timestamp: Date.now()
  9262. }), t, n),
  9263. _uniCloudOptions: r
  9264. });
  9265. case 8:
  9266. case "end":
  9267. return _context40.stop();
  9268. }
  9269. }
  9270. }, _callee40, this);
  9271. }));
  9272. function platformEncryptData(_x33) {
  9273. return _platformEncryptData.apply(this, arguments);
  9274. }
  9275. return platformEncryptData;
  9276. }()
  9277. }, {
  9278. key: "platformDecryptResult",
  9279. value: function () {
  9280. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  9281. var t, _yield$this$getUserEn3, n, s;
  9282. return _regenerator.default.wrap(function _callee41$(_context41) {
  9283. while (1) {
  9284. switch (_context41.prev = _context41.next) {
  9285. case 0:
  9286. t = e.content;
  9287. _context41.next = 3;
  9288. return this.getUserEncryptKey();
  9289. case 3:
  9290. _yield$this$getUserEn3 = _context41.sent;
  9291. n = _yield$this$getUserEn3.encryptKey;
  9292. s = _yield$this$getUserEn3.iv;
  9293. return _context41.abrupt("return", JSON.parse(function (e, t, n) {
  9294. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  9295. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  9296. i = ln.utils.utf8.toBytes(n),
  9297. o = new ln.ModeOfOperation.cbc(r, i),
  9298. a = ln.padding.pkcs7.strip(o.decrypt(s));
  9299. return ln.utils.utf8.fromBytes(a);
  9300. }(t, n, s)));
  9301. case 7:
  9302. case "end":
  9303. return _context41.stop();
  9304. }
  9305. }
  9306. }, _callee41, this);
  9307. }));
  9308. function platformDecryptResult(_x34) {
  9309. return _platformDecryptResult.apply(this, arguments);
  9310. }
  9311. return platformDecryptResult;
  9312. }()
  9313. }]);
  9314. return vn;
  9315. }(Ot);
  9316. function Sn(e) {
  9317. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  9318. n = {};
  9319. var _loop = function _loop(_s10) {
  9320. var r = t[_s10];
  9321. n[r] = function () {
  9322. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  9323. t[_key] = arguments[_key];
  9324. }
  9325. return new Promise(function (n, s) {
  9326. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  9327. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9328. e = _ref29.type,
  9329. t = _ref29.data,
  9330. r = _ref29.errCode,
  9331. i = _ref29.errMsg,
  9332. o = _ref29.errSubject,
  9333. a = _ref29.message;
  9334. "success" === e ? n(t) : s(mn({
  9335. errCode: r,
  9336. errMsg: gn[r] || i || a,
  9337. errSubject: o
  9338. }));
  9339. }])) : s(mn({
  9340. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  9341. }));
  9342. });
  9343. };
  9344. };
  9345. for (var _s10 = 0; _s10 < t.length; _s10++) {
  9346. _loop(_s10);
  9347. }
  9348. return n;
  9349. }
  9350. var kn = /*#__PURE__*/function (_Ot2) {
  9351. (0, _inherits2.default)(kn, _Ot2);
  9352. var _super10 = _createSuper(kn);
  9353. function kn(e) {
  9354. var _this17;
  9355. (0, _classCallCheck2.default)(this, kn);
  9356. _this17 = _super10.call(this, e), _this17.appUtils = _objectSpread({}, Sn(uni.requireNativePlugin("plus"))), _this17.systemInfo = yn || (yn = re());
  9357. return _this17;
  9358. }
  9359. (0, _createClass2.default)(kn, [{
  9360. key: "hasClientKey",
  9361. value: function () {
  9362. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
  9363. return _regenerator.default.wrap(function _callee42$(_context42) {
  9364. while (1) {
  9365. switch (_context42.prev = _context42.next) {
  9366. case 0:
  9367. _context42.next = 2;
  9368. return this.appUtils.hasClientKey({
  9369. provider: this.provider,
  9370. spaceId: this.spaceId
  9371. });
  9372. case 2:
  9373. this._hasClientKey = _context42.sent;
  9374. return _context42.abrupt("return", this._hasClientKey);
  9375. case 4:
  9376. case "end":
  9377. return _context42.stop();
  9378. }
  9379. }
  9380. }, _callee42, this);
  9381. }));
  9382. function hasClientKey() {
  9383. return _hasClientKey.apply(this, arguments);
  9384. }
  9385. return hasClientKey;
  9386. }()
  9387. }, {
  9388. key: "getAppClientKey",
  9389. value: function () {
  9390. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  9391. var _yield$this$appUtils$, e, t, n, s, r;
  9392. return _regenerator.default.wrap(function _callee43$(_context43) {
  9393. while (1) {
  9394. switch (_context43.prev = _context43.next) {
  9395. case 0:
  9396. _context43.next = 2;
  9397. return this.appUtils.encryptGetClientKeyPayload({
  9398. data: JSON.stringify({})
  9399. });
  9400. case 2:
  9401. _yield$this$appUtils$ = _context43.sent;
  9402. e = _yield$this$appUtils$.data;
  9403. t = _yield$this$appUtils$.key;
  9404. _context43.next = 7;
  9405. return this.uniCloudIns.callFunction({
  9406. name: "DCloud-clientDB",
  9407. data: {
  9408. redirectTo: "encryption",
  9409. action: "getAppClientKey",
  9410. data: e,
  9411. key: t
  9412. }
  9413. });
  9414. case 7:
  9415. _context43.t0 = _context43.sent.result;
  9416. if (_context43.t0) {
  9417. _context43.next = 10;
  9418. break;
  9419. }
  9420. _context43.t0 = {};
  9421. case 10:
  9422. n = _context43.t0;
  9423. if (!(0 !== n.errCode)) {
  9424. _context43.next = 13;
  9425. break;
  9426. }
  9427. throw function (e) {
  9428. return new Q({
  9429. subject: e.errSubject || "uni-secure-network",
  9430. code: e.errCode || e.code || dn.code,
  9431. message: e.errMsg || e.message
  9432. });
  9433. }(n);
  9434. case 13:
  9435. s = n.clientKey, r = n.key;
  9436. _context43.next = 16;
  9437. return this.appUtils.setClientKey({
  9438. provider: this.provider,
  9439. spaceId: this.spaceId,
  9440. clientKey: s,
  9441. key: r
  9442. });
  9443. case 16:
  9444. case "end":
  9445. return _context43.stop();
  9446. }
  9447. }
  9448. }, _callee43, this);
  9449. }));
  9450. function getAppClientKey() {
  9451. return _getAppClientKey.apply(this, arguments);
  9452. }
  9453. return getAppClientKey;
  9454. }()
  9455. }, {
  9456. key: "ensureClientKey",
  9457. value: function () {
  9458. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  9459. var _this18 = this;
  9460. return _regenerator.default.wrap(function _callee44$(_context44) {
  9461. while (1) {
  9462. switch (_context44.prev = _context44.next) {
  9463. case 0:
  9464. _context44.t0 = !0;
  9465. _context44.next = 3;
  9466. return this.hasClientKey();
  9467. case 3:
  9468. _context44.t1 = _context44.sent;
  9469. if (!(_context44.t0 !== _context44.t1)) {
  9470. _context44.next = 6;
  9471. break;
  9472. }
  9473. return _context44.abrupt("return", (this.scopedGlobalCache.initPromise && "rejected" !== this.scopedGlobalCache.initStatus || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  9474. _this18.scopedGlobalCache.initStatus = "fullfilled";
  9475. }).catch(function (e) {
  9476. throw _this18.scopedGlobalCache.initStatus = "rejected", e;
  9477. })), this.scopedGlobalCache.initPromise));
  9478. case 6:
  9479. case "end":
  9480. return _context44.stop();
  9481. }
  9482. }
  9483. }, _callee44, this);
  9484. }));
  9485. function ensureClientKey() {
  9486. return _ensureClientKey.apply(this, arguments);
  9487. }
  9488. return ensureClientKey;
  9489. }()
  9490. }, {
  9491. key: "prepare",
  9492. value: function () {
  9493. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  9494. return _regenerator.default.wrap(function _callee45$(_context45) {
  9495. while (1) {
  9496. switch (_context45.prev = _context45.next) {
  9497. case 0:
  9498. _context45.next = 2;
  9499. return this.ensureClientKey();
  9500. case 2:
  9501. case "end":
  9502. return _context45.stop();
  9503. }
  9504. }
  9505. }, _callee45, this);
  9506. }));
  9507. function prepare() {
  9508. return _prepare3.apply(this, arguments);
  9509. }
  9510. return prepare;
  9511. }()
  9512. }, {
  9513. key: "platformGetSignOption",
  9514. value: function () {
  9515. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  9516. var _yield$this$appUtils$2, e, t;
  9517. return _regenerator.default.wrap(function _callee46$(_context46) {
  9518. while (1) {
  9519. switch (_context46.prev = _context46.next) {
  9520. case 0:
  9521. _context46.next = 2;
  9522. return this.appUtils.encrypt({
  9523. provider: this.provider,
  9524. spaceId: this.spaceId,
  9525. data: JSON.stringify({})
  9526. });
  9527. case 2:
  9528. _yield$this$appUtils$2 = _context46.sent;
  9529. e = _yield$this$appUtils$2.data;
  9530. t = _yield$this$appUtils$2.key;
  9531. return _context46.abrupt("return", {
  9532. verifyClientSign: e,
  9533. encryptKeyId: t
  9534. });
  9535. case 6:
  9536. case "end":
  9537. return _context46.stop();
  9538. }
  9539. }
  9540. }, _callee46, this);
  9541. }));
  9542. function platformGetSignOption() {
  9543. return _platformGetSignOption2.apply(this, arguments);
  9544. }
  9545. return platformGetSignOption;
  9546. }()
  9547. }, {
  9548. key: "platformEncryptData",
  9549. value: function () {
  9550. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(e) {
  9551. var _yield$this$appUtils$3, t, n, s;
  9552. return _regenerator.default.wrap(function _callee47$(_context47) {
  9553. while (1) {
  9554. switch (_context47.prev = _context47.next) {
  9555. case 0:
  9556. _context47.next = 2;
  9557. return this.appUtils.encrypt({
  9558. provider: this.provider,
  9559. spaceId: this.spaceId,
  9560. data: JSON.stringify(e)
  9561. });
  9562. case 2:
  9563. _yield$this$appUtils$3 = _context47.sent;
  9564. t = _yield$this$appUtils$3.data;
  9565. n = _yield$this$appUtils$3.key;
  9566. s = {
  9567. secretType: this.secretType,
  9568. encryptKeyId: n
  9569. };
  9570. return _context47.abrupt("return", this.secretType === Pt ? {
  9571. content: e,
  9572. _uniCloudOptions: s
  9573. } : {
  9574. content: t,
  9575. _uniCloudOptions: s
  9576. });
  9577. case 7:
  9578. case "end":
  9579. return _context47.stop();
  9580. }
  9581. }
  9582. }, _callee47, this);
  9583. }));
  9584. function platformEncryptData(_x35) {
  9585. return _platformEncryptData2.apply(this, arguments);
  9586. }
  9587. return platformEncryptData;
  9588. }()
  9589. }, {
  9590. key: "platformDecryptResult",
  9591. value: function () {
  9592. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  9593. var t, _e$_uniCloudOptions, n, s, r;
  9594. return _regenerator.default.wrap(function _callee48$(_context48) {
  9595. while (1) {
  9596. switch (_context48.prev = _context48.next) {
  9597. case 0:
  9598. t = e.content;
  9599. _e$_uniCloudOptions = e._uniCloudOptions;
  9600. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  9601. s = n.encryptKeyId;
  9602. _context48.next = 6;
  9603. return this.appUtils.decrypt({
  9604. provider: this.provider,
  9605. spaceId: this.spaceId,
  9606. data: t,
  9607. key: s
  9608. });
  9609. case 6:
  9610. r = _context48.sent;
  9611. return _context48.abrupt("return", JSON.parse(r.data));
  9612. case 8:
  9613. case "end":
  9614. return _context48.stop();
  9615. }
  9616. }
  9617. }, _callee48, this);
  9618. }));
  9619. function platformDecryptResult(_x36) {
  9620. return _platformDecryptResult2.apply(this, arguments);
  9621. }
  9622. return platformDecryptResult;
  9623. }()
  9624. }]);
  9625. return kn;
  9626. }(Ot);
  9627. function In() {
  9628. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9629. e = _ref30.secretType;
  9630. return e === Ct || e === Pt || e === Et;
  9631. }
  9632. function bn() {
  9633. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9634. e = _ref31.name,
  9635. _ref31$data = _ref31.data,
  9636. t = _ref31$data === void 0 ? {} : _ref31$data;
  9637. return "app" === S && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  9638. }
  9639. function Tn() {
  9640. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9641. e = _ref32.provider,
  9642. t = _ref32.spaceId,
  9643. n = _ref32.functionName;
  9644. var _re = re(),
  9645. s = _re.appId,
  9646. r = _re.uniPlatform,
  9647. i = _re.osName;
  9648. var o = r;
  9649. "app" === r && (o = i);
  9650. var a = function () {
  9651. var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9652. e = _ref33.provider,
  9653. t = _ref33.spaceId;
  9654. var n = v;
  9655. if (!n) return {};
  9656. e = function (e) {
  9657. return "tencent" === e ? "tcb" : e;
  9658. }(e);
  9659. var s = n.find(function (n) {
  9660. return n.provider === e && n.spaceId === t;
  9661. });
  9662. return s && s.config;
  9663. }({
  9664. provider: e,
  9665. spaceId: t
  9666. });
  9667. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  9668. var c = a.accessControl.function || {},
  9669. u = Object.keys(c);
  9670. if (0 === u.length) return !0;
  9671. var l = function (e, t) {
  9672. var n, s, r;
  9673. for (var _i2 = 0; _i2 < e.length; _i2++) {
  9674. var _o2 = e[_i2];
  9675. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  9676. return e.trim();
  9677. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  9678. }
  9679. return n || s || r;
  9680. }(u, n);
  9681. if (!l) return !1;
  9682. if ((c[l] || []).find(function () {
  9683. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9684. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  9685. })) return !0;
  9686. 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")), mn(fn);
  9687. }
  9688. function An(_ref34) {
  9689. var e = _ref34.functionName,
  9690. t = _ref34.result,
  9691. n = _ref34.logPvd;
  9692. if (this.__dev__.debugLog && t && t.requestId) {
  9693. var _s11 = JSON.stringify({
  9694. spaceId: this.config.spaceId,
  9695. functionName: e,
  9696. requestId: t.requestId
  9697. });
  9698. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  9699. }
  9700. }
  9701. function Cn(e) {
  9702. var t = e.callFunction,
  9703. n = function n(_n7) {
  9704. var _this19 = this;
  9705. var s = _n7.name;
  9706. _n7.data = vt.call(e, {
  9707. data: _n7.data
  9708. });
  9709. var r = {
  9710. aliyun: "aliyun",
  9711. tencent: "tcb",
  9712. tcb: "tcb"
  9713. }[this.config.provider],
  9714. i = In(_n7),
  9715. o = bn(_n7),
  9716. a = i || o;
  9717. return t.call(this, _n7).then(function (e) {
  9718. return e.errCode = 0, !a && An.call(_this19, {
  9719. functionName: s,
  9720. result: e,
  9721. logPvd: r
  9722. }), Promise.resolve(e);
  9723. }, function (e) {
  9724. return !a && An.call(_this19, {
  9725. functionName: s,
  9726. result: e,
  9727. logPvd: r
  9728. }), e && e.message && (e.message = function () {
  9729. var _ref35 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9730. _ref35$message = _ref35.message,
  9731. e = _ref35$message === void 0 ? "" : _ref35$message,
  9732. _ref35$extraInfo = _ref35.extraInfo,
  9733. t = _ref35$extraInfo === void 0 ? {} : _ref35$extraInfo,
  9734. _ref35$formatter = _ref35.formatter,
  9735. n = _ref35$formatter === void 0 ? [] : _ref35$formatter;
  9736. for (var _s12 = 0; _s12 < n.length; _s12++) {
  9737. var _n$_s = n[_s12],
  9738. _r3 = _n$_s.rule,
  9739. _i3 = _n$_s.content,
  9740. _o3 = _n$_s.mode,
  9741. _a = e.match(_r3);
  9742. if (!_a) continue;
  9743. var _c = _i3;
  9744. for (var _e23 = 1; _e23 < _a.length; _e23++) {
  9745. _c = Tt(_c, "{$".concat(_e23, "}"), _a[_e23]);
  9746. }
  9747. for (var _e24 in t) {
  9748. _c = Tt(_c, "{".concat(_e24, "}"), t[_e24]);
  9749. }
  9750. return "replace" === _o3 ? _c : e + _c;
  9751. }
  9752. return e;
  9753. }({
  9754. message: "[".concat(_n7.name, "]: ").concat(e.message),
  9755. formatter: kt,
  9756. extraInfo: {
  9757. functionName: s
  9758. }
  9759. })), Promise.reject(e);
  9760. });
  9761. };
  9762. e.callFunction = function (t) {
  9763. var _e$config = e.config,
  9764. s = _e$config.provider,
  9765. r = _e$config.spaceId,
  9766. i = t.name;
  9767. var o, a;
  9768. if (t.data = t.data || {}, y && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && I ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = St), o = St) : o = n, o = o.bind(e), bn(t)) a = n.call(e, t);else if (function (_ref36) {
  9769. var e = _ref36.name,
  9770. _ref36$data = _ref36.data,
  9771. t = _ref36$data === void 0 ? {} : _ref36$data;
  9772. return "mp-weixin" === S && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  9773. }(t)) a = o.call(e, t);else if (In(t)) {
  9774. a = new _n({
  9775. secretType: t.secretType,
  9776. uniCloudIns: e
  9777. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  9778. } else if (Tn({
  9779. provider: s,
  9780. spaceId: r,
  9781. functionName: i
  9782. })) {
  9783. a = new _n({
  9784. secretType: t.secretType,
  9785. uniCloudIns: e
  9786. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  9787. } else a = o(t);
  9788. return Object.defineProperty(a, "result", {
  9789. get: function get() {
  9790. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  9791. }
  9792. }), a;
  9793. };
  9794. }
  9795. _n = "mp-weixin" !== S && "app" !== S ? /*#__PURE__*/function () {
  9796. function _class2() {
  9797. (0, _classCallCheck2.default)(this, _class2);
  9798. throw mn({
  9799. message: "Platform ".concat(S, " is not supported by secure network")
  9800. });
  9801. }
  9802. return (0, _createClass2.default)(_class2);
  9803. }() : w ? "mp-weixin" === S ? vn : kn : /*#__PURE__*/function () {
  9804. function _class3() {
  9805. (0, _classCallCheck2.default)(this, _class3);
  9806. throw mn({
  9807. message: "Platform ".concat(S, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  9808. });
  9809. }
  9810. return (0, _createClass2.default)(_class3);
  9811. }();
  9812. var Pn = Symbol("CLIENT_DB_INTERNAL");
  9813. function En(e, t) {
  9814. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Pn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  9815. get: function get(e, n, s) {
  9816. if ("_uniClient" === n) return null;
  9817. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  9818. if (n in e || "string" != typeof n) {
  9819. var _t10 = e[n];
  9820. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  9821. }
  9822. return t.get(e, n, s);
  9823. }
  9824. });
  9825. }
  9826. function On(e) {
  9827. return {
  9828. on: function on(t, n) {
  9829. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  9830. },
  9831. off: function off(t, n) {
  9832. e[t] = e[t] || [];
  9833. var s = e[t].indexOf(n);
  9834. -1 !== s && e[t].splice(s, 1);
  9835. }
  9836. };
  9837. }
  9838. var xn = ["db.Geo", "db.command", "command.aggregate"];
  9839. function Un(e, t) {
  9840. return xn.indexOf("".concat(e, ".").concat(t)) > -1;
  9841. }
  9842. function Rn(e) {
  9843. switch (d(e)) {
  9844. case "array":
  9845. return e.map(function (e) {
  9846. return Rn(e);
  9847. });
  9848. case "object":
  9849. return e._internalType === Pn || Object.keys(e).forEach(function (t) {
  9850. e[t] = Rn(e[t]);
  9851. }), e;
  9852. case "regexp":
  9853. return {
  9854. $regexp: {
  9855. source: e.source,
  9856. flags: e.flags
  9857. }
  9858. };
  9859. case "date":
  9860. return {
  9861. $date: e.toISOString()
  9862. };
  9863. default:
  9864. return e;
  9865. }
  9866. }
  9867. function Ln(e) {
  9868. return e && e.content && e.content.$method;
  9869. }
  9870. var Nn = /*#__PURE__*/function () {
  9871. function Nn(e, t, n) {
  9872. (0, _classCallCheck2.default)(this, Nn);
  9873. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  9874. }
  9875. (0, _createClass2.default)(Nn, [{
  9876. key: "toJSON",
  9877. value: function toJSON() {
  9878. var e = this;
  9879. var t = [e.content];
  9880. for (; e.prevStage;) {
  9881. e = e.prevStage, t.push(e.content);
  9882. }
  9883. return {
  9884. $db: t.reverse().map(function (e) {
  9885. return {
  9886. $method: e.$method,
  9887. $param: Rn(e.$param)
  9888. };
  9889. })
  9890. };
  9891. }
  9892. }, {
  9893. key: "getAction",
  9894. value: function getAction() {
  9895. var e = this.toJSON().$db.find(function (e) {
  9896. return "action" === e.$method;
  9897. });
  9898. return e && e.$param && e.$param[0];
  9899. }
  9900. }, {
  9901. key: "getCommand",
  9902. value: function getCommand() {
  9903. return {
  9904. $db: this.toJSON().$db.filter(function (e) {
  9905. return "action" !== e.$method;
  9906. })
  9907. };
  9908. }
  9909. }, {
  9910. key: "isAggregate",
  9911. get: function get() {
  9912. var e = this;
  9913. for (; e;) {
  9914. var t = Ln(e),
  9915. _n8 = Ln(e.prevStage);
  9916. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  9917. e = e.prevStage;
  9918. }
  9919. return !1;
  9920. }
  9921. }, {
  9922. key: "isCommand",
  9923. get: function get() {
  9924. var e = this;
  9925. for (; e;) {
  9926. if ("command" === Ln(e)) return !0;
  9927. e = e.prevStage;
  9928. }
  9929. return !1;
  9930. }
  9931. }, {
  9932. key: "isAggregateCommand",
  9933. get: function get() {
  9934. var e = this;
  9935. for (; e;) {
  9936. var t = Ln(e),
  9937. _n9 = Ln(e.prevStage);
  9938. if ("aggregate" === t && "command" === _n9) return !0;
  9939. e = e.prevStage;
  9940. }
  9941. return !1;
  9942. }
  9943. }, {
  9944. key: "getNextStageFn",
  9945. value: function getNextStageFn(e) {
  9946. var t = this;
  9947. return function () {
  9948. return Dn({
  9949. $method: e,
  9950. $param: Rn(Array.from(arguments))
  9951. }, t, t._database);
  9952. };
  9953. }
  9954. }, {
  9955. key: "count",
  9956. get: function get() {
  9957. return this.isAggregate ? this.getNextStageFn("count") : function () {
  9958. return this._send("count", Array.from(arguments));
  9959. };
  9960. }
  9961. }, {
  9962. key: "remove",
  9963. get: function get() {
  9964. return this.isCommand ? this.getNextStageFn("remove") : function () {
  9965. return this._send("remove", Array.from(arguments));
  9966. };
  9967. }
  9968. }, {
  9969. key: "get",
  9970. value: function get() {
  9971. return this._send("get", Array.from(arguments));
  9972. }
  9973. }, {
  9974. key: "add",
  9975. get: function get() {
  9976. return this.isCommand ? this.getNextStageFn("add") : function () {
  9977. return this._send("add", Array.from(arguments));
  9978. };
  9979. }
  9980. }, {
  9981. key: "update",
  9982. value: function update() {
  9983. return this._send("update", Array.from(arguments));
  9984. }
  9985. }, {
  9986. key: "end",
  9987. value: function end() {
  9988. return this._send("end", Array.from(arguments));
  9989. }
  9990. }, {
  9991. key: "set",
  9992. get: function get() {
  9993. return this.isCommand ? this.getNextStageFn("set") : function () {
  9994. throw new Error("JQL禁止使用set方法");
  9995. };
  9996. }
  9997. }, {
  9998. key: "_send",
  9999. value: function _send(e, t) {
  10000. var n = this.getAction(),
  10001. s = this.getCommand();
  10002. if (s.$db.push({
  10003. $method: e,
  10004. $param: Rn(t)
  10005. }), y) {
  10006. var _e25 = s.$db.find(function (e) {
  10007. return "collection" === e.$method;
  10008. }),
  10009. _t11 = _e25 && _e25.$param;
  10010. _t11 && 1 === _t11.length && "string" == typeof _e25.$param[0] && _e25.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  10011. }
  10012. return this._database._callCloudFunction({
  10013. action: n,
  10014. command: s
  10015. });
  10016. }
  10017. }]);
  10018. return Nn;
  10019. }();
  10020. function Dn(e, t, n) {
  10021. return En(new Nn(e, t, n), {
  10022. get: function get(e, t) {
  10023. var s = "db";
  10024. return e && e.content && (s = e.content.$method), Un(s, t) ? Dn({
  10025. $method: t
  10026. }, e, n) : function () {
  10027. return Dn({
  10028. $method: t,
  10029. $param: Rn(Array.from(arguments))
  10030. }, e, n);
  10031. };
  10032. }
  10033. });
  10034. }
  10035. function Fn(_ref37) {
  10036. var e = _ref37.path,
  10037. t = _ref37.method;
  10038. return /*#__PURE__*/function () {
  10039. function _class4() {
  10040. (0, _classCallCheck2.default)(this, _class4);
  10041. this.param = Array.from(arguments);
  10042. }
  10043. (0, _createClass2.default)(_class4, [{
  10044. key: "toJSON",
  10045. value: function toJSON() {
  10046. return {
  10047. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  10048. return {
  10049. $method: e
  10050. };
  10051. })), [{
  10052. $method: t,
  10053. $param: this.param
  10054. }])
  10055. };
  10056. }
  10057. }]);
  10058. return _class4;
  10059. }();
  10060. }
  10061. function qn(e) {
  10062. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10063. return En(new e(t), {
  10064. get: function get(e, t) {
  10065. return Un("db", t) ? Dn({
  10066. $method: t
  10067. }, null, e) : function () {
  10068. return Dn({
  10069. $method: t,
  10070. $param: Rn(Array.from(arguments))
  10071. }, null, e);
  10072. };
  10073. }
  10074. });
  10075. }
  10076. var Kn = /*#__PURE__*/function (_ref38) {
  10077. (0, _inherits2.default)(Kn, _ref38);
  10078. var _super11 = _createSuper(Kn);
  10079. function Kn() {
  10080. (0, _classCallCheck2.default)(this, Kn);
  10081. return _super11.apply(this, arguments);
  10082. }
  10083. (0, _createClass2.default)(Kn, [{
  10084. key: "_parseResult",
  10085. value: function _parseResult(e) {
  10086. return this._isJQL ? e.result : e;
  10087. }
  10088. }, {
  10089. key: "_callCloudFunction",
  10090. value: function _callCloudFunction(_ref39) {
  10091. var _this20 = this;
  10092. var e = _ref39.action,
  10093. t = _ref39.command,
  10094. n = _ref39.multiCommand,
  10095. s = _ref39.queryList;
  10096. function r(e, t) {
  10097. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  10098. var _r4 = s[_n10];
  10099. _r4.udb && "function" == typeof _r4.udb.setResult && (t ? _r4.udb.setResult(t) : _r4.udb.setResult(e.result.dataList[_n10]));
  10100. }
  10101. }
  10102. var i = this,
  10103. o = this._isJQL ? "databaseForJQL" : "database";
  10104. function a(e) {
  10105. return i._callback("error", [e]), U(R(o, "fail"), e).then(function () {
  10106. return U(R(o, "complete"), e);
  10107. }).then(function () {
  10108. return r(null, e), z(D, {
  10109. type: K,
  10110. content: e
  10111. }), Promise.reject(e);
  10112. });
  10113. }
  10114. var c = U(R(o, "invoke")),
  10115. u = this._uniClient;
  10116. return c.then(function () {
  10117. return u.callFunction({
  10118. name: "DCloud-clientDB",
  10119. type: h,
  10120. data: {
  10121. action: e,
  10122. command: t,
  10123. multiCommand: n
  10124. }
  10125. });
  10126. }).then(function (e) {
  10127. var _e$result = e.result,
  10128. t = _e$result.code,
  10129. n = _e$result.message,
  10130. s = _e$result.token,
  10131. c = _e$result.tokenExpired,
  10132. _e$result$systemInfo = _e$result.systemInfo,
  10133. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  10134. if (u) for (var _e26 = 0; _e26 < u.length; _e26++) {
  10135. var _u$_e = u[_e26],
  10136. _t12 = _u$_e.level,
  10137. _n11 = _u$_e.message,
  10138. _s13 = _u$_e.detail,
  10139. _r5 = console["app" === S && "warn" === _t12 ? "error" : _t12] || console.log;
  10140. var _i4 = "[System Info]" + _n11;
  10141. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r5(_i4);
  10142. }
  10143. if (t) {
  10144. return a(new Q({
  10145. code: t,
  10146. message: n,
  10147. requestId: e.requestId
  10148. }));
  10149. }
  10150. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ee({
  10151. token: s,
  10152. tokenExpired: c
  10153. }), _this20._callbackAuth("refreshToken", [{
  10154. token: s,
  10155. tokenExpired: c
  10156. }]), _this20._callback("refreshToken", [{
  10157. token: s,
  10158. tokenExpired: c
  10159. }]), z(q, {
  10160. token: s,
  10161. tokenExpired: c
  10162. }));
  10163. var l = [{
  10164. prop: "affectedDocs",
  10165. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  10166. }, {
  10167. prop: "code",
  10168. tips: "code不再推荐使用,请使用errCode替代"
  10169. }, {
  10170. prop: "message",
  10171. tips: "message不再推荐使用,请使用errMsg替代"
  10172. }];
  10173. var _loop2 = function _loop2(_t13) {
  10174. var _l$_t = l[_t13],
  10175. n = _l$_t.prop,
  10176. s = _l$_t.tips;
  10177. if (n in e.result) {
  10178. var _t14 = e.result[n];
  10179. Object.defineProperty(e.result, n, {
  10180. get: function get() {
  10181. return console.warn(s), _t14;
  10182. }
  10183. });
  10184. }
  10185. };
  10186. for (var _t13 = 0; _t13 < l.length; _t13++) {
  10187. _loop2(_t13);
  10188. }
  10189. return function (e) {
  10190. return U(R(o, "success"), e).then(function () {
  10191. return U(R(o, "complete"), e);
  10192. }).then(function () {
  10193. r(e, null);
  10194. var t = i._parseResult(e);
  10195. return z(D, {
  10196. type: K,
  10197. content: t
  10198. }), Promise.resolve(t);
  10199. });
  10200. }(e);
  10201. }, function (e) {
  10202. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  10203. return a(new Q({
  10204. code: e.code || "SYSTEM_ERROR",
  10205. message: e.message,
  10206. requestId: e.requestId
  10207. }));
  10208. });
  10209. }
  10210. }]);
  10211. return Kn;
  10212. }( /*#__PURE__*/function () {
  10213. function _class5() {
  10214. var _ref40 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10215. _ref40$uniClient = _ref40.uniClient,
  10216. e = _ref40$uniClient === void 0 ? {} : _ref40$uniClient,
  10217. _ref40$isJQL = _ref40.isJQL,
  10218. t = _ref40$isJQL === void 0 ? !1 : _ref40$isJQL;
  10219. (0, _classCallCheck2.default)(this, _class5);
  10220. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e.isDefault && (this._dbCallBacks = C("_globalUniCloudDatabaseCallback")), t || (this.auth = On(this._authCallBacks)), this._isJQL = t, Object.assign(this, On(this._dbCallBacks)), this.env = En({}, {
  10221. get: function get(e, t) {
  10222. return {
  10223. $env: t
  10224. };
  10225. }
  10226. }), this.Geo = En({}, {
  10227. get: function get(e, t) {
  10228. return Fn({
  10229. path: ["Geo"],
  10230. method: t
  10231. });
  10232. }
  10233. }), this.serverDate = Fn({
  10234. path: [],
  10235. method: "serverDate"
  10236. }), this.RegExp = Fn({
  10237. path: [],
  10238. method: "RegExp"
  10239. });
  10240. }
  10241. (0, _createClass2.default)(_class5, [{
  10242. key: "getCloudEnv",
  10243. value: function getCloudEnv(e) {
  10244. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  10245. return {
  10246. $env: e.replace("$cloudEnv_", "")
  10247. };
  10248. }
  10249. }, {
  10250. key: "_callback",
  10251. value: function _callback(e, t) {
  10252. var n = this._dbCallBacks;
  10253. n[e] && n[e].forEach(function (e) {
  10254. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  10255. });
  10256. }
  10257. }, {
  10258. key: "_callbackAuth",
  10259. value: function _callbackAuth(e, t) {
  10260. var n = this._authCallBacks;
  10261. n[e] && n[e].forEach(function (e) {
  10262. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  10263. });
  10264. }
  10265. }, {
  10266. key: "multiSend",
  10267. value: function multiSend() {
  10268. var e = Array.from(arguments),
  10269. t = e.map(function (e) {
  10270. var t = e.getAction(),
  10271. n = e.getCommand();
  10272. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  10273. return {
  10274. action: t,
  10275. command: n
  10276. };
  10277. });
  10278. return this._callCloudFunction({
  10279. multiCommand: t,
  10280. queryList: e
  10281. });
  10282. }
  10283. }]);
  10284. return _class5;
  10285. }());
  10286. var jn = "token无效,跳转登录页面",
  10287. Mn = "token过期,跳转登录页面",
  10288. Bn = {
  10289. TOKEN_INVALID_TOKEN_EXPIRED: Mn,
  10290. TOKEN_INVALID_INVALID_CLIENTID: jn,
  10291. TOKEN_INVALID: jn,
  10292. TOKEN_INVALID_WRONG_TOKEN: jn,
  10293. TOKEN_INVALID_ANONYMOUS_USER: jn
  10294. },
  10295. $n = {
  10296. "uni-id-token-expired": Mn,
  10297. "uni-id-check-token-failed": jn,
  10298. "uni-id-token-not-exist": jn,
  10299. "uni-id-check-device-feature-failed": jn
  10300. };
  10301. function Wn(e, t) {
  10302. var n = "";
  10303. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  10304. }
  10305. function zn() {
  10306. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  10307. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  10308. var n = [],
  10309. s = [];
  10310. return e.forEach(function (e) {
  10311. !0 === e.needLogin ? n.push(Wn(t, e.path)) : !1 === e.needLogin && s.push(Wn(t, e.path));
  10312. }), {
  10313. needLoginPage: n,
  10314. notNeedLoginPage: s
  10315. };
  10316. }
  10317. function Jn(e) {
  10318. return e.split("?")[0].replace(/^\//, "");
  10319. }
  10320. function Hn() {
  10321. return function (e) {
  10322. var t = e && e.$page && e.$page.fullPath || "";
  10323. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  10324. }(function () {
  10325. var e = getCurrentPages();
  10326. return e[e.length - 1];
  10327. }());
  10328. }
  10329. function Gn() {
  10330. return Jn(Hn());
  10331. }
  10332. function Vn() {
  10333. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  10334. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10335. if (!e) return !1;
  10336. if (!(t && t.list && t.list.length)) return !1;
  10337. var n = t.list,
  10338. s = Jn(e);
  10339. return n.some(function (e) {
  10340. return e.pagePath === s;
  10341. });
  10342. }
  10343. var Yn = !!_pages.default.uniIdRouter;
  10344. var _ref41 = function () {
  10345. var _ref24 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  10346. _ref24$pages = _ref24.pages,
  10347. e = _ref24$pages === void 0 ? [] : _ref24$pages,
  10348. _ref24$subPackages = _ref24.subPackages,
  10349. n = _ref24$subPackages === void 0 ? [] : _ref24$subPackages,
  10350. _ref24$uniIdRouter = _ref24.uniIdRouter,
  10351. s = _ref24$uniIdRouter === void 0 ? {} : _ref24$uniIdRouter,
  10352. _ref24$tabBar = _ref24.tabBar,
  10353. r = _ref24$tabBar === void 0 ? {} : _ref24$tabBar;
  10354. var i = s.loginPage,
  10355. _s$needLogin = s.needLogin,
  10356. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  10357. _s$resToLogin = s.resToLogin,
  10358. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  10359. _zn = zn(e),
  10360. c = _zn.needLoginPage,
  10361. u = _zn.notNeedLoginPage,
  10362. _ref26 = function () {
  10363. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  10364. var t = [],
  10365. n = [];
  10366. return e.forEach(function (e) {
  10367. var s = e.root,
  10368. _e$pages = e.pages,
  10369. r = _e$pages === void 0 ? [] : _e$pages,
  10370. _zn2 = zn(r, s),
  10371. i = _zn2.needLoginPage,
  10372. o = _zn2.notNeedLoginPage;
  10373. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  10374. }), {
  10375. needLoginPage: t,
  10376. notNeedLoginPage: n
  10377. };
  10378. }(n),
  10379. l = _ref26.needLoginPage,
  10380. h = _ref26.notNeedLoginPage;
  10381. return {
  10382. loginPage: i,
  10383. routerNeedLogin: o,
  10384. resToLogin: a,
  10385. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(l)),
  10386. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(h)),
  10387. loginPageInTabBar: Vn(i, r)
  10388. };
  10389. }(),
  10390. Qn = _ref41.loginPage,
  10391. Xn = _ref41.routerNeedLogin,
  10392. Zn = _ref41.resToLogin,
  10393. es = _ref41.needLoginPage,
  10394. ts = _ref41.notNeedLoginPage,
  10395. ns = _ref41.loginPageInTabBar;
  10396. if (es.indexOf(Qn) > -1) throw new Error("Login page [".concat(Qn, "] should not be \"needLogin\", please check your pages.json"));
  10397. function ss(e) {
  10398. var t = Gn();
  10399. if ("/" === e.charAt(0)) return e;
  10400. var _e$split = e.split("?"),
  10401. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  10402. n = _e$split2[0],
  10403. s = _e$split2[1],
  10404. r = n.replace(/^\//, "").split("/"),
  10405. i = t.split("/");
  10406. i.pop();
  10407. for (var _e27 = 0; _e27 < r.length; _e27++) {
  10408. var _t15 = r[_e27];
  10409. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  10410. }
  10411. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  10412. }
  10413. function rs(e) {
  10414. var t = Jn(ss(e));
  10415. return !(ts.indexOf(t) > -1) && (es.indexOf(t) > -1 || Xn.some(function (t) {
  10416. return function (e, t) {
  10417. return new RegExp(t).test(e);
  10418. }(e, t);
  10419. }));
  10420. }
  10421. function is(_ref42) {
  10422. var e = _ref42.redirect;
  10423. var t = Jn(e),
  10424. n = Jn(Qn);
  10425. return Gn() !== n && t !== n;
  10426. }
  10427. function os() {
  10428. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10429. e = _ref43.api,
  10430. t = _ref43.redirect;
  10431. if (!t || !is({
  10432. redirect: t
  10433. })) return;
  10434. var n = function (e, t) {
  10435. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  10436. }(Qn, t);
  10437. ns ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  10438. var s = {
  10439. navigateTo: uni.navigateTo,
  10440. redirectTo: uni.redirectTo,
  10441. switchTab: uni.switchTab,
  10442. reLaunch: uni.reLaunch
  10443. };
  10444. setTimeout(function () {
  10445. s[e]({
  10446. url: n
  10447. });
  10448. });
  10449. }
  10450. function as() {
  10451. var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10452. e = _ref44.url;
  10453. var t = {
  10454. abortLoginPageJump: !1,
  10455. autoToLoginPage: !1
  10456. },
  10457. n = function () {
  10458. var _Z3 = Z(),
  10459. e = _Z3.token,
  10460. t = _Z3.tokenExpired;
  10461. var n;
  10462. if (e) {
  10463. if (t < Date.now()) {
  10464. var _e28 = "uni-id-token-expired";
  10465. n = {
  10466. errCode: _e28,
  10467. errMsg: $n[_e28]
  10468. };
  10469. }
  10470. } else {
  10471. var _e29 = "uni-id-check-token-failed";
  10472. n = {
  10473. errCode: _e29,
  10474. errMsg: $n[_e29]
  10475. };
  10476. }
  10477. return n;
  10478. }();
  10479. if (rs(e) && n) {
  10480. n.uniIdRedirectUrl = e;
  10481. if (B(F).length > 0) return setTimeout(function () {
  10482. z(F, n);
  10483. }, 0), t.abortLoginPageJump = !0, t;
  10484. t.autoToLoginPage = !0;
  10485. }
  10486. return t;
  10487. }
  10488. function cs() {
  10489. !function () {
  10490. var e = Hn(),
  10491. _as = as({
  10492. url: e
  10493. }),
  10494. t = _as.abortLoginPageJump,
  10495. n = _as.autoToLoginPage;
  10496. t || n && os({
  10497. api: "redirectTo",
  10498. redirect: e
  10499. });
  10500. }();
  10501. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  10502. var _loop3 = function _loop3(_t16) {
  10503. var n = e[_t16];
  10504. uni.addInterceptor(n, {
  10505. invoke: function invoke(e) {
  10506. var _as2 = as({
  10507. url: e.url
  10508. }),
  10509. t = _as2.abortLoginPageJump,
  10510. s = _as2.autoToLoginPage;
  10511. return t ? e : s ? (os({
  10512. api: n,
  10513. redirect: ss(e.url)
  10514. }), !1) : e;
  10515. }
  10516. });
  10517. };
  10518. for (var _t16 = 0; _t16 < e.length; _t16++) {
  10519. _loop3(_t16);
  10520. }
  10521. }
  10522. function us() {
  10523. this.onResponse(function (e) {
  10524. var t = e.type,
  10525. n = e.content;
  10526. var s = !1;
  10527. switch (t) {
  10528. case "cloudobject":
  10529. s = function (e) {
  10530. if ("object" != (0, _typeof2.default)(e)) return !1;
  10531. var _ref45 = e || {},
  10532. t = _ref45.errCode;
  10533. return t in $n;
  10534. }(n);
  10535. break;
  10536. case "clientdb":
  10537. s = function (e) {
  10538. if ("object" != (0, _typeof2.default)(e)) return !1;
  10539. var _ref46 = e || {},
  10540. t = _ref46.errCode;
  10541. return t in Bn;
  10542. }(n);
  10543. }
  10544. s && function () {
  10545. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10546. var t = B(F);
  10547. G().then(function () {
  10548. var n = Hn();
  10549. if (n && is({
  10550. redirect: n
  10551. })) return t.length > 0 ? z(F, Object.assign({
  10552. uniIdRedirectUrl: n
  10553. }, e)) : void (Qn && os({
  10554. api: "navigateTo",
  10555. redirect: n
  10556. }));
  10557. });
  10558. }(n);
  10559. });
  10560. }
  10561. function ls(e) {
  10562. !function (e) {
  10563. e.onResponse = function (e) {
  10564. $(D, e);
  10565. }, e.offResponse = function (e) {
  10566. W(D, e);
  10567. };
  10568. }(e), function (e) {
  10569. e.onNeedLogin = function (e) {
  10570. $(F, e);
  10571. }, e.offNeedLogin = function (e) {
  10572. W(F, e);
  10573. }, Yn && (C("_globalUniCloudStatus").needLoginInit || (C("_globalUniCloudStatus").needLoginInit = !0, G().then(function () {
  10574. cs.call(e);
  10575. }), Zn && us.call(e)));
  10576. }(e), function (e) {
  10577. e.onRefreshToken = function (e) {
  10578. $(q, e);
  10579. }, e.offRefreshToken = function (e) {
  10580. W(q, e);
  10581. };
  10582. }(e);
  10583. }
  10584. var hs;
  10585. var ds = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  10586. fs = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  10587. function ps() {
  10588. var e = Z().token || "",
  10589. t = e.split(".");
  10590. if (!e || 3 !== t.length) return {
  10591. uid: null,
  10592. role: [],
  10593. permission: [],
  10594. tokenExpired: 0
  10595. };
  10596. var n;
  10597. try {
  10598. n = JSON.parse((s = t[1], decodeURIComponent(hs(s).split("").map(function (e) {
  10599. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  10600. }).join(""))));
  10601. } catch (e) {
  10602. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  10603. }
  10604. var s;
  10605. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  10606. }
  10607. hs = "function" != typeof atob ? function (e) {
  10608. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !fs.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  10609. var t;
  10610. e += "==".slice(2 - (3 & e.length));
  10611. for (var n, s, r = "", i = 0; i < e.length;) {
  10612. t = ds.indexOf(e.charAt(i++)) << 18 | ds.indexOf(e.charAt(i++)) << 12 | (n = ds.indexOf(e.charAt(i++))) << 6 | (s = ds.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);
  10613. }
  10614. return r;
  10615. } : atob;
  10616. var gs = s(function (e, t) {
  10617. Object.defineProperty(t, "__esModule", {
  10618. value: !0
  10619. });
  10620. var n = "chooseAndUploadFile:ok",
  10621. s = "chooseAndUploadFile:fail";
  10622. function r(e, t) {
  10623. return e.tempFiles.forEach(function (e, n) {
  10624. 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("."));
  10625. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  10626. return e.path;
  10627. })), e;
  10628. }
  10629. function i(e, t, _ref47) {
  10630. var s = _ref47.onChooseFile,
  10631. r = _ref47.onUploadProgress;
  10632. return t.then(function (e) {
  10633. if (s) {
  10634. var _t17 = s(e);
  10635. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  10636. return void 0 === t ? e : t;
  10637. });
  10638. }
  10639. return e;
  10640. }).then(function (t) {
  10641. return !1 === t ? {
  10642. errMsg: n,
  10643. tempFilePaths: [],
  10644. tempFiles: []
  10645. } : function (e, t) {
  10646. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  10647. var r = arguments.length > 3 ? arguments[3] : undefined;
  10648. (t = Object.assign({}, t)).errMsg = n;
  10649. var i = t.tempFiles,
  10650. o = i.length;
  10651. var a = 0;
  10652. return new Promise(function (n) {
  10653. for (; a < s;) {
  10654. c();
  10655. }
  10656. function c() {
  10657. var s = a++;
  10658. if (s >= o) return void (!i.find(function (e) {
  10659. return !e.url && !e.errMsg;
  10660. }) && n(t));
  10661. var u = i[s];
  10662. e.uploadFile({
  10663. filePath: u.path,
  10664. cloudPath: u.cloudPath,
  10665. fileType: u.fileType,
  10666. onUploadProgress: function onUploadProgress(e) {
  10667. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  10668. }
  10669. }).then(function (e) {
  10670. u.url = e.fileID, s < o && c();
  10671. }).catch(function (e) {
  10672. u.errMsg = e.errMsg || e.message, s < o && c();
  10673. });
  10674. }
  10675. });
  10676. }(e, t, 5, r);
  10677. });
  10678. }
  10679. t.initChooseAndUploadFile = function (e) {
  10680. return function () {
  10681. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  10682. type: "all"
  10683. };
  10684. return "image" === t.type ? i(e, function (e) {
  10685. var t = e.count,
  10686. n = e.sizeType,
  10687. _e$sourceType = e.sourceType,
  10688. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  10689. o = e.extension;
  10690. return new Promise(function (e, a) {
  10691. uni.chooseImage({
  10692. count: t,
  10693. sizeType: n,
  10694. sourceType: i,
  10695. extension: o,
  10696. success: function success(t) {
  10697. e(r(t, "image"));
  10698. },
  10699. fail: function fail(e) {
  10700. a({
  10701. errMsg: e.errMsg.replace("chooseImage:fail", s)
  10702. });
  10703. }
  10704. });
  10705. });
  10706. }(t), t) : "video" === t.type ? i(e, function (e) {
  10707. var t = e.camera,
  10708. n = e.compressed,
  10709. i = e.maxDuration,
  10710. _e$sourceType2 = e.sourceType,
  10711. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  10712. a = e.extension;
  10713. return new Promise(function (e, c) {
  10714. uni.chooseVideo({
  10715. camera: t,
  10716. compressed: n,
  10717. maxDuration: i,
  10718. sourceType: o,
  10719. extension: a,
  10720. success: function success(t) {
  10721. var n = t.tempFilePath,
  10722. s = t.duration,
  10723. i = t.size,
  10724. o = t.height,
  10725. a = t.width;
  10726. e(r({
  10727. errMsg: "chooseVideo:ok",
  10728. tempFilePaths: [n],
  10729. tempFiles: [{
  10730. name: t.tempFile && t.tempFile.name || "",
  10731. path: n,
  10732. size: i,
  10733. type: t.tempFile && t.tempFile.type || "",
  10734. width: a,
  10735. height: o,
  10736. duration: s,
  10737. fileType: "video",
  10738. cloudPath: ""
  10739. }]
  10740. }, "video"));
  10741. },
  10742. fail: function fail(e) {
  10743. c({
  10744. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  10745. });
  10746. }
  10747. });
  10748. });
  10749. }(t), t) : i(e, function (e) {
  10750. var t = e.count,
  10751. n = e.extension;
  10752. return new Promise(function (e, i) {
  10753. var o = uni.chooseFile;
  10754. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  10755. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  10756. });
  10757. o({
  10758. type: "all",
  10759. count: t,
  10760. extension: n,
  10761. success: function success(t) {
  10762. e(r(t));
  10763. },
  10764. fail: function fail(e) {
  10765. i({
  10766. errMsg: e.errMsg.replace("chooseFile:fail", s)
  10767. });
  10768. }
  10769. });
  10770. });
  10771. }(t), t);
  10772. };
  10773. };
  10774. }),
  10775. ms = n(gs);
  10776. var ys = "manual";
  10777. function _s(e) {
  10778. return {
  10779. props: {
  10780. localdata: {
  10781. type: Array,
  10782. default: function _default() {
  10783. return [];
  10784. }
  10785. },
  10786. options: {
  10787. type: [Object, Array],
  10788. default: function _default() {
  10789. return {};
  10790. }
  10791. },
  10792. spaceInfo: {
  10793. type: Object,
  10794. default: function _default() {
  10795. return {};
  10796. }
  10797. },
  10798. collection: {
  10799. type: [String, Array],
  10800. default: ""
  10801. },
  10802. action: {
  10803. type: String,
  10804. default: ""
  10805. },
  10806. field: {
  10807. type: String,
  10808. default: ""
  10809. },
  10810. orderby: {
  10811. type: String,
  10812. default: ""
  10813. },
  10814. where: {
  10815. type: [String, Object],
  10816. default: ""
  10817. },
  10818. pageData: {
  10819. type: String,
  10820. default: "add"
  10821. },
  10822. pageCurrent: {
  10823. type: Number,
  10824. default: 1
  10825. },
  10826. pageSize: {
  10827. type: Number,
  10828. default: 20
  10829. },
  10830. getcount: {
  10831. type: [Boolean, String],
  10832. default: !1
  10833. },
  10834. gettree: {
  10835. type: [Boolean, String],
  10836. default: !1
  10837. },
  10838. gettreepath: {
  10839. type: [Boolean, String],
  10840. default: !1
  10841. },
  10842. startwith: {
  10843. type: String,
  10844. default: ""
  10845. },
  10846. limitlevel: {
  10847. type: Number,
  10848. default: 10
  10849. },
  10850. groupby: {
  10851. type: String,
  10852. default: ""
  10853. },
  10854. groupField: {
  10855. type: String,
  10856. default: ""
  10857. },
  10858. distinct: {
  10859. type: [Boolean, String],
  10860. default: !1
  10861. },
  10862. foreignKey: {
  10863. type: String,
  10864. default: ""
  10865. },
  10866. loadtime: {
  10867. type: String,
  10868. default: "auto"
  10869. },
  10870. manual: {
  10871. type: Boolean,
  10872. default: !1
  10873. }
  10874. },
  10875. data: function data() {
  10876. return {
  10877. mixinDatacomLoading: !1,
  10878. mixinDatacomHasMore: !1,
  10879. mixinDatacomResData: [],
  10880. mixinDatacomErrorMessage: "",
  10881. mixinDatacomPage: {}
  10882. };
  10883. },
  10884. created: function created() {
  10885. var _this21 = this;
  10886. this.mixinDatacomPage = {
  10887. current: this.pageCurrent,
  10888. size: this.pageSize,
  10889. count: 0
  10890. }, this.$watch(function () {
  10891. var e = [];
  10892. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  10893. e.push(_this21[t]);
  10894. }), e;
  10895. }, function (e, t) {
  10896. if (_this21.loadtime === ys) return;
  10897. var n = !1;
  10898. var s = [];
  10899. for (var _r6 = 2; _r6 < e.length; _r6++) {
  10900. e[_r6] !== t[_r6] && (s.push(e[_r6]), n = !0);
  10901. }
  10902. e[0] !== t[0] && (_this21.mixinDatacomPage.current = _this21.pageCurrent), _this21.mixinDatacomPage.size = _this21.pageSize, _this21.onMixinDatacomPropsChange(n, s);
  10903. });
  10904. },
  10905. methods: {
  10906. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  10907. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  10908. var _this22 = this;
  10909. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10910. _ref48$getone = _ref48.getone,
  10911. e = _ref48$getone === void 0 ? !1 : _ref48$getone,
  10912. t = _ref48.success,
  10913. n = _ref48.fail;
  10914. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  10915. _this22.mixinDatacomLoading = !1;
  10916. var _n$result = n.result,
  10917. s = _n$result.data,
  10918. r = _n$result.count;
  10919. _this22.getcount && (_this22.mixinDatacomPage.count = r), _this22.mixinDatacomHasMore = s.length < _this22.pageSize;
  10920. var i = e ? s.length ? s[0] : void 0 : s;
  10921. _this22.mixinDatacomResData = i, t && t(i);
  10922. }).catch(function (e) {
  10923. _this22.mixinDatacomLoading = !1, _this22.mixinDatacomErrorMessage = e, n && n(e);
  10924. }));
  10925. },
  10926. mixinDatacomGet: function mixinDatacomGet() {
  10927. var _n12;
  10928. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10929. var n = e.database(this.spaceInfo);
  10930. var s = t.action || this.action;
  10931. s && (n = n.action(s));
  10932. var r = t.collection || this.collection;
  10933. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  10934. var i = t.where || this.where;
  10935. i && Object.keys(i).length && (n = n.where(i));
  10936. var o = t.field || this.field;
  10937. o && (n = n.field(o));
  10938. var a = t.foreignKey || this.foreignKey;
  10939. a && (n = n.foreignKey(a));
  10940. var c = t.groupby || this.groupby;
  10941. c && (n = n.groupBy(c));
  10942. var u = t.groupField || this.groupField;
  10943. u && (n = n.groupField(u));
  10944. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  10945. var l = t.orderby || this.orderby;
  10946. l && (n = n.orderBy(l));
  10947. var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  10948. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  10949. f = void 0 !== t.getcount ? t.getcount : this.getcount,
  10950. p = void 0 !== t.gettree ? t.gettree : this.gettree,
  10951. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  10952. m = {
  10953. getCount: f
  10954. },
  10955. y = {
  10956. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  10957. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  10958. };
  10959. return p && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;
  10960. }
  10961. }
  10962. };
  10963. }
  10964. function ws(e) {
  10965. return function (t) {
  10966. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10967. n = function (e) {
  10968. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10969. 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;
  10970. }({
  10971. customUI: !1,
  10972. loadingOptions: {
  10973. title: "加载中...",
  10974. mask: !0
  10975. },
  10976. errorOptions: {
  10977. type: "modal",
  10978. retry: !1
  10979. }
  10980. }, n);
  10981. var _n13 = n,
  10982. s = _n13.customUI,
  10983. r = _n13.loadingOptions,
  10984. i = _n13.errorOptions,
  10985. o = _n13.parseSystemError,
  10986. a = !s;
  10987. return new Proxy({}, {
  10988. get: function get(s, c) {
  10989. return function () {
  10990. var _ref49 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10991. e = _ref49.fn,
  10992. t = _ref49.interceptorName,
  10993. n = _ref49.getCallbackArgs;
  10994. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
  10995. var _len2,
  10996. s,
  10997. _key2,
  10998. r,
  10999. i,
  11000. o,
  11001. _args = arguments;
  11002. return _regenerator.default.wrap(function _callee49$(_context49) {
  11003. while (1) {
  11004. switch (_context49.prev = _context49.next) {
  11005. case 0:
  11006. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  11007. s[_key2] = _args[_key2];
  11008. }
  11009. r = n ? n({
  11010. params: s
  11011. }) : {};
  11012. _context49.prev = 2;
  11013. _context49.next = 5;
  11014. return U(R(t, "invoke"), _objectSpread({}, r));
  11015. case 5:
  11016. _context49.next = 7;
  11017. return e.apply(void 0, s);
  11018. case 7:
  11019. i = _context49.sent;
  11020. _context49.next = 10;
  11021. return U(R(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  11022. result: i
  11023. }));
  11024. case 10:
  11025. return _context49.abrupt("return", i);
  11026. case 13:
  11027. _context49.prev = 13;
  11028. _context49.t0 = _context49["catch"](2);
  11029. o = _context49.t0;
  11030. _context49.next = 18;
  11031. return U(R(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  11032. error: o
  11033. }));
  11034. case 18:
  11035. throw o;
  11036. case 19:
  11037. _context49.prev = 19;
  11038. _context49.next = 22;
  11039. return U(R(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  11040. error: o
  11041. }) : _objectSpread(_objectSpread({}, r), {}, {
  11042. result: i
  11043. }));
  11044. case 22:
  11045. return _context49.finish(19);
  11046. case 23:
  11047. case "end":
  11048. return _context49.stop();
  11049. }
  11050. }
  11051. }, _callee49, null, [[2, 13, 19, 23]]);
  11052. }));
  11053. }({
  11054. fn: function () {
  11055. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  11056. var h,
  11057. _len3,
  11058. u,
  11059. _key3,
  11060. d,
  11061. f,
  11062. _ref51,
  11063. p,
  11064. g,
  11065. m,
  11066. y,
  11067. _e30,
  11068. _yield,
  11069. _t18,
  11070. _n14,
  11071. _args4 = arguments;
  11072. return _regenerator.default.wrap(function _callee51$(_context51) {
  11073. while (1) {
  11074. switch (_context51.prev = _context51.next) {
  11075. case 0:
  11076. a && uni.showLoading({
  11077. title: r.title,
  11078. mask: r.mask
  11079. });
  11080. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  11081. u[_key3] = _args4[_key3];
  11082. }
  11083. d = {
  11084. name: t,
  11085. type: l,
  11086. data: {
  11087. method: c,
  11088. params: u
  11089. }
  11090. };
  11091. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  11092. var n = t.data.method,
  11093. s = e.secretMethods || {},
  11094. r = s[n] || s["*"];
  11095. r && (t.secretType = r);
  11096. }(n, d);
  11097. f = !1;
  11098. _context51.prev = 5;
  11099. _context51.next = 8;
  11100. return e.callFunction(d);
  11101. case 8:
  11102. h = _context51.sent;
  11103. _context51.next = 14;
  11104. break;
  11105. case 11:
  11106. _context51.prev = 11;
  11107. _context51.t0 = _context51["catch"](5);
  11108. f = !0, h = {
  11109. result: new Q(_context51.t0)
  11110. };
  11111. case 14:
  11112. _ref51 = h.result || {}, p = _ref51.errSubject, g = _ref51.errCode, m = _ref51.errMsg, y = _ref51.newToken;
  11113. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ee(y), z(q, _objectSpread({}, y))), g)) {
  11114. _context51.next = 39;
  11115. break;
  11116. }
  11117. _e30 = m;
  11118. if (!(f && o)) {
  11119. _context51.next = 24;
  11120. break;
  11121. }
  11122. _context51.next = 20;
  11123. return o({
  11124. objectName: t,
  11125. methodName: c,
  11126. params: u,
  11127. errSubject: p,
  11128. errCode: g,
  11129. errMsg: m
  11130. });
  11131. case 20:
  11132. _context51.t1 = _context51.sent.errMsg;
  11133. if (_context51.t1) {
  11134. _context51.next = 23;
  11135. break;
  11136. }
  11137. _context51.t1 = m;
  11138. case 23:
  11139. _e30 = _context51.t1;
  11140. case 24:
  11141. if (!a) {
  11142. _context51.next = 37;
  11143. break;
  11144. }
  11145. if (!("toast" === i.type)) {
  11146. _context51.next = 29;
  11147. break;
  11148. }
  11149. uni.showToast({
  11150. title: _e30,
  11151. icon: "none"
  11152. });
  11153. _context51.next = 37;
  11154. break;
  11155. case 29:
  11156. if (!("modal" !== i.type)) {
  11157. _context51.next = 31;
  11158. break;
  11159. }
  11160. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  11161. case 31:
  11162. _context51.next = 33;
  11163. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  11164. var _ref53,
  11165. e,
  11166. t,
  11167. n,
  11168. s,
  11169. r,
  11170. _args3 = arguments;
  11171. return _regenerator.default.wrap(function _callee50$(_context50) {
  11172. while (1) {
  11173. switch (_context50.prev = _context50.next) {
  11174. case 0:
  11175. _ref53 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref53.title, t = _ref53.content, n = _ref53.showCancel, s = _ref53.cancelText, r = _ref53.confirmText;
  11176. return _context50.abrupt("return", new Promise(function (i, o) {
  11177. uni.showModal({
  11178. title: e,
  11179. content: t,
  11180. showCancel: n,
  11181. cancelText: s,
  11182. confirmText: r,
  11183. success: function success(e) {
  11184. i(e);
  11185. },
  11186. fail: function fail() {
  11187. i({
  11188. confirm: !1,
  11189. cancel: !0
  11190. });
  11191. }
  11192. });
  11193. }));
  11194. case 2:
  11195. case "end":
  11196. return _context50.stop();
  11197. }
  11198. }
  11199. }, _callee50);
  11200. }))({
  11201. title: "提示",
  11202. content: _e30,
  11203. showCancel: i.retry,
  11204. cancelText: "取消",
  11205. confirmText: i.retry ? "重试" : "确定"
  11206. });
  11207. case 33:
  11208. _yield = _context51.sent;
  11209. _t18 = _yield.confirm;
  11210. if (!(i.retry && _t18)) {
  11211. _context51.next = 37;
  11212. break;
  11213. }
  11214. return _context51.abrupt("return", s.apply(void 0, u));
  11215. case 37:
  11216. _n14 = new Q({
  11217. subject: p,
  11218. code: g,
  11219. message: m,
  11220. requestId: h.requestId
  11221. });
  11222. throw _n14.detail = h.result, z(D, {
  11223. type: M,
  11224. content: _n14
  11225. }), _n14;
  11226. case 39:
  11227. return _context51.abrupt("return", (z(D, {
  11228. type: M,
  11229. content: h.result
  11230. }), h.result));
  11231. case 40:
  11232. case "end":
  11233. return _context51.stop();
  11234. }
  11235. }
  11236. }, _callee51, null, [[5, 11]]);
  11237. }));
  11238. function s() {
  11239. return _s14.apply(this, arguments);
  11240. }
  11241. return s;
  11242. }(),
  11243. interceptorName: "callObject",
  11244. getCallbackArgs: function getCallbackArgs() {
  11245. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11246. e = _ref54.params;
  11247. return {
  11248. objectName: t,
  11249. methodName: c,
  11250. params: e
  11251. };
  11252. }
  11253. });
  11254. }
  11255. });
  11256. };
  11257. }
  11258. function vs(e) {
  11259. return C("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  11260. }
  11261. function Ss() {
  11262. return _Ss.apply(this, arguments);
  11263. }
  11264. function _Ss() {
  11265. _Ss = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  11266. var _ref58,
  11267. _ref58$callLoginByWei,
  11268. e,
  11269. t,
  11270. n,
  11271. s,
  11272. _args6 = arguments;
  11273. return _regenerator.default.wrap(function _callee53$(_context53) {
  11274. while (1) {
  11275. switch (_context53.prev = _context53.next) {
  11276. case 0:
  11277. _ref58 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref58$callLoginByWei = _ref58.callLoginByWeixin, e = _ref58$callLoginByWei === void 0 ? !1 : _ref58$callLoginByWei;
  11278. t = vs(this);
  11279. if (!("mp-weixin" !== S)) {
  11280. _context53.next = 4;
  11281. break;
  11282. }
  11283. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(S, "`"));
  11284. case 4:
  11285. _context53.next = 6;
  11286. return new Promise(function (e, t) {
  11287. uni.login({
  11288. success: function success(t) {
  11289. e(t.code);
  11290. },
  11291. fail: function fail(e) {
  11292. t(new Error(e.errMsg));
  11293. }
  11294. });
  11295. });
  11296. case 6:
  11297. n = _context53.sent;
  11298. s = this.importObject("uni-id-co", {
  11299. customUI: !0
  11300. });
  11301. _context53.next = 10;
  11302. return s.secureNetworkHandshakeByWeixin({
  11303. code: n,
  11304. callLoginByWeixin: e
  11305. });
  11306. case 10:
  11307. t.mpWeixinCode = n;
  11308. return _context53.abrupt("return", {
  11309. code: n
  11310. });
  11311. case 12:
  11312. case "end":
  11313. return _context53.stop();
  11314. }
  11315. }
  11316. }, _callee53, this);
  11317. }));
  11318. return _Ss.apply(this, arguments);
  11319. }
  11320. function ks(_x37) {
  11321. return _ks.apply(this, arguments);
  11322. }
  11323. function _ks() {
  11324. _ks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(e) {
  11325. var t;
  11326. return _regenerator.default.wrap(function _callee54$(_context54) {
  11327. while (1) {
  11328. switch (_context54.prev = _context54.next) {
  11329. case 0:
  11330. t = vs(this);
  11331. return _context54.abrupt("return", (t.initPromise || (t.initPromise = Ss.call(this, e)), t.initPromise));
  11332. case 2:
  11333. case "end":
  11334. return _context54.stop();
  11335. }
  11336. }
  11337. }, _callee54, this);
  11338. }));
  11339. return _ks.apply(this, arguments);
  11340. }
  11341. function Is(e) {
  11342. return function () {
  11343. var _ref55 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11344. _ref55$callLoginByWei = _ref55.callLoginByWeixin,
  11345. t = _ref55$callLoginByWei === void 0 ? !1 : _ref55$callLoginByWei;
  11346. return ks.call(e, {
  11347. callLoginByWeixin: t
  11348. });
  11349. };
  11350. }
  11351. function bs(_x38, _x39) {
  11352. return _bs.apply(this, arguments);
  11353. }
  11354. function _bs() {
  11355. _bs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(e, t) {
  11356. var n, _e32, s;
  11357. return _regenerator.default.wrap(function _callee55$(_context55) {
  11358. while (1) {
  11359. switch (_context55.prev = _context55.next) {
  11360. case 0:
  11361. n = "http://".concat(e, ":").concat(t, "/system/ping");
  11362. _context55.prev = 1;
  11363. _context55.next = 4;
  11364. return s = {
  11365. url: n,
  11366. timeout: 500
  11367. }, new Promise(function (e, t) {
  11368. X.request(_objectSpread(_objectSpread({}, s), {}, {
  11369. success: function success(t) {
  11370. e(t);
  11371. },
  11372. fail: function fail(e) {
  11373. t(e);
  11374. }
  11375. }));
  11376. });
  11377. case 4:
  11378. _e32 = _context55.sent;
  11379. return _context55.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  11380. case 8:
  11381. _context55.prev = 8;
  11382. _context55.t0 = _context55["catch"](1);
  11383. return _context55.abrupt("return", !1);
  11384. case 11:
  11385. case "end":
  11386. return _context55.stop();
  11387. }
  11388. }
  11389. }, _callee55, null, [[1, 8]]);
  11390. }));
  11391. return _bs.apply(this, arguments);
  11392. }
  11393. function Ts(e) {
  11394. if (e.initUniCloudStatus && "rejected" !== e.initUniCloudStatus) return;
  11395. var t = Promise.resolve();
  11396. var n;
  11397. n = 1, t = new Promise(function (e) {
  11398. setTimeout(function () {
  11399. e();
  11400. }, n);
  11401. }), e.isReady = !1, e.isDefault = !1;
  11402. var s = e.auth();
  11403. e.initUniCloudStatus = "pending", e.initUniCloud = t.then(function () {
  11404. return s.getLoginState();
  11405. }).then(function (e) {
  11406. return e ? Promise.resolve() : s.signInAnonymously();
  11407. }).then(function () {
  11408. if (!y) return Promise.resolve();
  11409. if ("app" === S) {
  11410. var _re2 = re(),
  11411. _e31 = _re2.osName,
  11412. _t19 = _re2.osVersion;
  11413. "ios" === _e31 && function (e) {
  11414. if (!e || "string" != typeof e) return 0;
  11415. var t = e.match(/^(\d+)./);
  11416. return t && t[1] ? parseInt(t[1]) : 0;
  11417. }(_t19) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  11418. }
  11419. if (y && e.__dev__.debugInfo) {
  11420. var _e$__dev__$debugInfo = e.__dev__.debugInfo,
  11421. _t20 = _e$__dev__$debugInfo.address,
  11422. _n15 = _e$__dev__$debugInfo.servePort;
  11423. return function () {
  11424. var _ref56 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(e, t) {
  11425. var n, _s15, _r7;
  11426. return _regenerator.default.wrap(function _callee52$(_context52) {
  11427. while (1) {
  11428. switch (_context52.prev = _context52.next) {
  11429. case 0:
  11430. _s15 = 0;
  11431. case 1:
  11432. if (!(_s15 < e.length)) {
  11433. _context52.next = 11;
  11434. break;
  11435. }
  11436. _r7 = e[_s15];
  11437. _context52.next = 5;
  11438. return bs(_r7, t);
  11439. case 5:
  11440. if (!_context52.sent) {
  11441. _context52.next = 8;
  11442. break;
  11443. }
  11444. n = _r7;
  11445. return _context52.abrupt("break", 11);
  11446. case 8:
  11447. _s15++;
  11448. _context52.next = 1;
  11449. break;
  11450. case 11:
  11451. return _context52.abrupt("return", {
  11452. address: n,
  11453. port: t
  11454. });
  11455. case 12:
  11456. case "end":
  11457. return _context52.stop();
  11458. }
  11459. }
  11460. }, _callee52);
  11461. }));
  11462. return function (_x40, _x41) {
  11463. return _ref56.apply(this, arguments);
  11464. };
  11465. }()(_t20, _n15);
  11466. }
  11467. }).then(function () {
  11468. var _ref57 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11469. t = _ref57.address,
  11470. n = _ref57.port;
  11471. if (!y) return Promise.resolve();
  11472. var s = console["app" === S ? "error" : "warn"];
  11473. if (t) e.__dev__.localAddress = t, e.__dev__.localPort = n;else if (e.__dev__.debugInfo) {
  11474. var _t21 = "";
  11475. "remote" === e.__dev__.debugInfo.initialLaunchType ? (e.__dev__.debugInfo.forceRemote = !0, _t21 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : _t21 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", _t21 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === S && (_t21 += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === S.indexOf("mp-") && (_t21 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), s(_t21);
  11476. }
  11477. }).then(function () {
  11478. te(), e.isReady = !0, e.initUniCloudStatus = "fulfilled";
  11479. }).catch(function (t) {
  11480. console.error(t), e.initUniCloudStatus = "rejected";
  11481. });
  11482. }
  11483. var As = {
  11484. tcb: yt,
  11485. tencent: yt,
  11486. aliyun: he,
  11487. private: wt
  11488. };
  11489. var Cs = new ( /*#__PURE__*/function () {
  11490. function _class6() {
  11491. (0, _classCallCheck2.default)(this, _class6);
  11492. }
  11493. (0, _createClass2.default)(_class6, [{
  11494. key: "init",
  11495. value: function init(e) {
  11496. var t = {};
  11497. var n = As[e.provider];
  11498. if (!n) throw new Error("未提供正确的provider参数");
  11499. t = n.init(e), t.__dev__ = {}, t.__dev__.debugLog = y && ("web" === S && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === S);
  11500. var s = k;
  11501. y && s && !s.code && (t.__dev__.debugInfo = s), Ts(t), t.reInit = function () {
  11502. Ts(this);
  11503. }, Cn(t), function (e) {
  11504. var t = e.uploadFile;
  11505. e.uploadFile = function (e) {
  11506. return t.call(this, e);
  11507. };
  11508. }(t), function (e) {
  11509. e.database = function (t) {
  11510. if (t && Object.keys(t).length > 0) return e.init(t).database();
  11511. if (this._database) return this._database;
  11512. var n = qn(Kn, {
  11513. uniClient: e
  11514. });
  11515. return this._database = n, n;
  11516. }, e.databaseForJQL = function (t) {
  11517. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  11518. if (this._databaseForJQL) return this._databaseForJQL;
  11519. var n = qn(Kn, {
  11520. uniClient: e,
  11521. isJQL: !0
  11522. });
  11523. return this._databaseForJQL = n, n;
  11524. };
  11525. }(t), function (e) {
  11526. e.getCurrentUserInfo = ps, e.chooseAndUploadFile = ms.initChooseAndUploadFile(e), Object.assign(e, {
  11527. get mixinDatacom() {
  11528. return _s(e);
  11529. }
  11530. }), e.importObject = ws(e), e.initSecureNetworkByWeixin = Is(e);
  11531. }(t);
  11532. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  11533. if (!t[e]) return;
  11534. var n = t[e];
  11535. t[e] = function () {
  11536. return t.reInit(), n.apply(t, Array.from(arguments));
  11537. }, t[e] = Y(t[e], e).bind(t);
  11538. }), t.init = this.init, t;
  11539. }
  11540. }]);
  11541. return _class6;
  11542. }())();
  11543. (function () {
  11544. var e = I;
  11545. var t = {};
  11546. if (e && 1 === e.length) t = e[0], Cs = Cs.init(t), Cs.isDefault = !0;else {
  11547. var _t22 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  11548. var _n16;
  11549. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : b ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t22.forEach(function (e) {
  11550. Cs[e] = function () {
  11551. return console.error(_n16), Promise.reject(new Q({
  11552. code: "SYS_ERR",
  11553. message: _n16
  11554. }));
  11555. };
  11556. });
  11557. }
  11558. Object.assign(Cs, {
  11559. get mixinDatacom() {
  11560. return _s(Cs);
  11561. }
  11562. }), ls(Cs), Cs.addInterceptor = O, Cs.removeInterceptor = x, Cs.interceptObject = L, y && "web" === S && (window.uniCloud = Cs);
  11563. })();
  11564. var Ps = Cs;
  11565. exports.default = Ps;
  11566. /* 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"]))
  11567. /***/ }),
  11568. /***/ 218:
  11569. /*!****************************************************************!*\
  11570. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  11571. \****************************************************************/
  11572. /*! no static exports found */
  11573. /***/ (function(module, exports, __webpack_require__) {
  11574. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 194);
  11575. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  11576. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 219);
  11577. var construct = __webpack_require__(/*! ./construct.js */ 15);
  11578. function _wrapNativeSuper(Class) {
  11579. var _cache = typeof Map === "function" ? new Map() : undefined;
  11580. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  11581. if (Class === null || !isNativeFunction(Class)) return Class;
  11582. if (typeof Class !== "function") {
  11583. throw new TypeError("Super expression must either be null or a function");
  11584. }
  11585. if (typeof _cache !== "undefined") {
  11586. if (_cache.has(Class)) return _cache.get(Class);
  11587. _cache.set(Class, Wrapper);
  11588. }
  11589. function Wrapper() {
  11590. return construct(Class, arguments, getPrototypeOf(this).constructor);
  11591. }
  11592. Wrapper.prototype = Object.create(Class.prototype, {
  11593. constructor: {
  11594. value: Wrapper,
  11595. enumerable: false,
  11596. writable: true,
  11597. configurable: true
  11598. }
  11599. });
  11600. return setPrototypeOf(Wrapper, Class);
  11601. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11602. return _wrapNativeSuper(Class);
  11603. }
  11604. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11605. /***/ }),
  11606. /***/ 219:
  11607. /*!*****************************************************************!*\
  11608. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  11609. \*****************************************************************/
  11610. /*! no static exports found */
  11611. /***/ (function(module, exports) {
  11612. function _isNativeFunction(fn) {
  11613. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  11614. }
  11615. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11616. /***/ }),
  11617. /***/ 22:
  11618. /*!*************************************************************!*\
  11619. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  11620. \*************************************************************/
  11621. /*! no static exports found */
  11622. /***/ (function(module, exports, __webpack_require__) {
  11623. "use strict";
  11624. /* WEBPACK VAR INJECTION */(function(uni, global) {
  11625. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11626. Object.defineProperty(exports, "__esModule", {
  11627. value: true
  11628. });
  11629. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  11630. exports.compileI18nJsonStr = compileI18nJsonStr;
  11631. exports.hasI18nJson = hasI18nJson;
  11632. exports.initVueI18n = initVueI18n;
  11633. exports.isI18nStr = isI18nStr;
  11634. exports.isString = void 0;
  11635. exports.normalizeLocale = normalizeLocale;
  11636. exports.parseI18nJson = parseI18nJson;
  11637. exports.resolveLocale = resolveLocale;
  11638. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  11639. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11640. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11641. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11642. var isArray = Array.isArray;
  11643. var isObject = function isObject(val) {
  11644. return val !== null && (0, _typeof2.default)(val) === 'object';
  11645. };
  11646. var defaultDelimiters = ['{', '}'];
  11647. var BaseFormatter = /*#__PURE__*/function () {
  11648. function BaseFormatter() {
  11649. (0, _classCallCheck2.default)(this, BaseFormatter);
  11650. this._caches = Object.create(null);
  11651. }
  11652. (0, _createClass2.default)(BaseFormatter, [{
  11653. key: "interpolate",
  11654. value: function interpolate(message, values) {
  11655. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  11656. if (!values) {
  11657. return [message];
  11658. }
  11659. var tokens = this._caches[message];
  11660. if (!tokens) {
  11661. tokens = parse(message, delimiters);
  11662. this._caches[message] = tokens;
  11663. }
  11664. return compile(tokens, values);
  11665. }
  11666. }]);
  11667. return BaseFormatter;
  11668. }();
  11669. exports.Formatter = BaseFormatter;
  11670. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  11671. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  11672. function parse(format, _ref) {
  11673. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  11674. startDelimiter = _ref2[0],
  11675. endDelimiter = _ref2[1];
  11676. var tokens = [];
  11677. var position = 0;
  11678. var text = '';
  11679. while (position < format.length) {
  11680. var char = format[position++];
  11681. if (char === startDelimiter) {
  11682. if (text) {
  11683. tokens.push({
  11684. type: 'text',
  11685. value: text
  11686. });
  11687. }
  11688. text = '';
  11689. var sub = '';
  11690. char = format[position++];
  11691. while (char !== undefined && char !== endDelimiter) {
  11692. sub += char;
  11693. char = format[position++];
  11694. }
  11695. var isClosed = char === endDelimiter;
  11696. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  11697. tokens.push({
  11698. value: sub,
  11699. type: type
  11700. });
  11701. }
  11702. // else if (char === '%') {
  11703. // // when found rails i18n syntax, skip text capture
  11704. // if (format[position] !== '{') {
  11705. // text += char
  11706. // }
  11707. // }
  11708. else {
  11709. text += char;
  11710. }
  11711. }
  11712. text && tokens.push({
  11713. type: 'text',
  11714. value: text
  11715. });
  11716. return tokens;
  11717. }
  11718. function compile(tokens, values) {
  11719. var compiled = [];
  11720. var index = 0;
  11721. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  11722. if (mode === 'unknown') {
  11723. return compiled;
  11724. }
  11725. while (index < tokens.length) {
  11726. var token = tokens[index];
  11727. switch (token.type) {
  11728. case 'text':
  11729. compiled.push(token.value);
  11730. break;
  11731. case 'list':
  11732. compiled.push(values[parseInt(token.value, 10)]);
  11733. break;
  11734. case 'named':
  11735. if (mode === 'named') {
  11736. compiled.push(values[token.value]);
  11737. } else {
  11738. if (true) {
  11739. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  11740. }
  11741. }
  11742. break;
  11743. case 'unknown':
  11744. if (true) {
  11745. console.warn("Detect 'unknown' type of token!");
  11746. }
  11747. break;
  11748. }
  11749. index++;
  11750. }
  11751. return compiled;
  11752. }
  11753. var LOCALE_ZH_HANS = 'zh-Hans';
  11754. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  11755. var LOCALE_ZH_HANT = 'zh-Hant';
  11756. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  11757. var LOCALE_EN = 'en';
  11758. exports.LOCALE_EN = LOCALE_EN;
  11759. var LOCALE_FR = 'fr';
  11760. exports.LOCALE_FR = LOCALE_FR;
  11761. var LOCALE_ES = 'es';
  11762. exports.LOCALE_ES = LOCALE_ES;
  11763. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11764. var hasOwn = function hasOwn(val, key) {
  11765. return hasOwnProperty.call(val, key);
  11766. };
  11767. var defaultFormatter = new BaseFormatter();
  11768. function include(str, parts) {
  11769. return !!parts.find(function (part) {
  11770. return str.indexOf(part) !== -1;
  11771. });
  11772. }
  11773. function startsWith(str, parts) {
  11774. return parts.find(function (part) {
  11775. return str.indexOf(part) === 0;
  11776. });
  11777. }
  11778. function normalizeLocale(locale, messages) {
  11779. if (!locale) {
  11780. return;
  11781. }
  11782. locale = locale.trim().replace(/_/g, '-');
  11783. if (messages && messages[locale]) {
  11784. return locale;
  11785. }
  11786. locale = locale.toLowerCase();
  11787. if (locale.indexOf('zh') === 0) {
  11788. if (locale.indexOf('-hans') > -1) {
  11789. return LOCALE_ZH_HANS;
  11790. }
  11791. if (locale.indexOf('-hant') > -1) {
  11792. return LOCALE_ZH_HANT;
  11793. }
  11794. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  11795. return LOCALE_ZH_HANT;
  11796. }
  11797. return LOCALE_ZH_HANS;
  11798. }
  11799. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  11800. if (lang) {
  11801. return lang;
  11802. }
  11803. }
  11804. var I18n = /*#__PURE__*/function () {
  11805. function I18n(_ref3) {
  11806. var locale = _ref3.locale,
  11807. fallbackLocale = _ref3.fallbackLocale,
  11808. messages = _ref3.messages,
  11809. watcher = _ref3.watcher,
  11810. formater = _ref3.formater;
  11811. (0, _classCallCheck2.default)(this, I18n);
  11812. this.locale = LOCALE_EN;
  11813. this.fallbackLocale = LOCALE_EN;
  11814. this.message = {};
  11815. this.messages = {};
  11816. this.watchers = [];
  11817. if (fallbackLocale) {
  11818. this.fallbackLocale = fallbackLocale;
  11819. }
  11820. this.formater = formater || defaultFormatter;
  11821. this.messages = messages || {};
  11822. this.setLocale(locale || LOCALE_EN);
  11823. if (watcher) {
  11824. this.watchLocale(watcher);
  11825. }
  11826. }
  11827. (0, _createClass2.default)(I18n, [{
  11828. key: "setLocale",
  11829. value: function setLocale(locale) {
  11830. var _this = this;
  11831. var oldLocale = this.locale;
  11832. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  11833. if (!this.messages[this.locale]) {
  11834. // 可能初始化时不存在
  11835. this.messages[this.locale] = {};
  11836. }
  11837. this.message = this.messages[this.locale];
  11838. // 仅发生变化时,通知
  11839. if (oldLocale !== this.locale) {
  11840. this.watchers.forEach(function (watcher) {
  11841. watcher(_this.locale, oldLocale);
  11842. });
  11843. }
  11844. }
  11845. }, {
  11846. key: "getLocale",
  11847. value: function getLocale() {
  11848. return this.locale;
  11849. }
  11850. }, {
  11851. key: "watchLocale",
  11852. value: function watchLocale(fn) {
  11853. var _this2 = this;
  11854. var index = this.watchers.push(fn) - 1;
  11855. return function () {
  11856. _this2.watchers.splice(index, 1);
  11857. };
  11858. }
  11859. }, {
  11860. key: "add",
  11861. value: function add(locale, message) {
  11862. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11863. var curMessages = this.messages[locale];
  11864. if (curMessages) {
  11865. if (override) {
  11866. Object.assign(curMessages, message);
  11867. } else {
  11868. Object.keys(message).forEach(function (key) {
  11869. if (!hasOwn(curMessages, key)) {
  11870. curMessages[key] = message[key];
  11871. }
  11872. });
  11873. }
  11874. } else {
  11875. this.messages[locale] = message;
  11876. }
  11877. }
  11878. }, {
  11879. key: "f",
  11880. value: function f(message, values, delimiters) {
  11881. return this.formater.interpolate(message, values, delimiters).join('');
  11882. }
  11883. }, {
  11884. key: "t",
  11885. value: function t(key, locale, values) {
  11886. var message = this.message;
  11887. if (typeof locale === 'string') {
  11888. locale = normalizeLocale(locale, this.messages);
  11889. locale && (message = this.messages[locale]);
  11890. } else {
  11891. values = locale;
  11892. }
  11893. if (!hasOwn(message, key)) {
  11894. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  11895. return key;
  11896. }
  11897. return this.formater.interpolate(message[key], values).join('');
  11898. }
  11899. }]);
  11900. return I18n;
  11901. }();
  11902. exports.I18n = I18n;
  11903. function watchAppLocale(appVm, i18n) {
  11904. // 需要保证 watch 的触发在组件渲染之前
  11905. if (appVm.$watchLocale) {
  11906. // vue2
  11907. appVm.$watchLocale(function (newLocale) {
  11908. i18n.setLocale(newLocale);
  11909. });
  11910. } else {
  11911. appVm.$watch(function () {
  11912. return appVm.$locale;
  11913. }, function (newLocale) {
  11914. i18n.setLocale(newLocale);
  11915. });
  11916. }
  11917. }
  11918. function getDefaultLocale() {
  11919. if (typeof uni !== 'undefined' && uni.getLocale) {
  11920. return uni.getLocale();
  11921. }
  11922. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  11923. if (typeof global !== 'undefined' && global.getLocale) {
  11924. return global.getLocale();
  11925. }
  11926. return LOCALE_EN;
  11927. }
  11928. function initVueI18n(locale) {
  11929. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11930. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  11931. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  11932. // 兼容旧版本入参
  11933. if (typeof locale !== 'string') {
  11934. var _ref4 = [messages, locale];
  11935. locale = _ref4[0];
  11936. messages = _ref4[1];
  11937. }
  11938. if (typeof locale !== 'string') {
  11939. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  11940. locale = getDefaultLocale();
  11941. }
  11942. if (typeof fallbackLocale !== 'string') {
  11943. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  11944. }
  11945. var i18n = new I18n({
  11946. locale: locale,
  11947. fallbackLocale: fallbackLocale,
  11948. messages: messages,
  11949. watcher: watcher
  11950. });
  11951. var _t = function t(key, values) {
  11952. if (typeof getApp !== 'function') {
  11953. // app view
  11954. /* eslint-disable no-func-assign */
  11955. _t = function t(key, values) {
  11956. return i18n.t(key, values);
  11957. };
  11958. } else {
  11959. var isWatchedAppLocale = false;
  11960. _t = function t(key, values) {
  11961. var appVm = getApp().$vm;
  11962. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  11963. // options: {
  11964. // type: Array,
  11965. // default () {
  11966. // return [{
  11967. // icon: 'shop',
  11968. // text: t("uni-goods-nav.options.shop"),
  11969. // }, {
  11970. // icon: 'cart',
  11971. // text: t("uni-goods-nav.options.cart")
  11972. // }]
  11973. // }
  11974. // },
  11975. if (appVm) {
  11976. // 触发响应式
  11977. appVm.$locale;
  11978. if (!isWatchedAppLocale) {
  11979. isWatchedAppLocale = true;
  11980. watchAppLocale(appVm, i18n);
  11981. }
  11982. }
  11983. return i18n.t(key, values);
  11984. };
  11985. }
  11986. return _t(key, values);
  11987. };
  11988. return {
  11989. i18n: i18n,
  11990. f: function f(message, values, delimiters) {
  11991. return i18n.f(message, values, delimiters);
  11992. },
  11993. t: function t(key, values) {
  11994. return _t(key, values);
  11995. },
  11996. add: function add(locale, message) {
  11997. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11998. return i18n.add(locale, message, override);
  11999. },
  12000. watch: function watch(fn) {
  12001. return i18n.watchLocale(fn);
  12002. },
  12003. getLocale: function getLocale() {
  12004. return i18n.getLocale();
  12005. },
  12006. setLocale: function setLocale(newLocale) {
  12007. return i18n.setLocale(newLocale);
  12008. }
  12009. };
  12010. }
  12011. var isString = function isString(val) {
  12012. return typeof val === 'string';
  12013. };
  12014. exports.isString = isString;
  12015. var formater;
  12016. function hasI18nJson(jsonObj, delimiters) {
  12017. if (!formater) {
  12018. formater = new BaseFormatter();
  12019. }
  12020. return walkJsonObj(jsonObj, function (jsonObj, key) {
  12021. var value = jsonObj[key];
  12022. if (isString(value)) {
  12023. if (isI18nStr(value, delimiters)) {
  12024. return true;
  12025. }
  12026. } else {
  12027. return hasI18nJson(value, delimiters);
  12028. }
  12029. });
  12030. }
  12031. function parseI18nJson(jsonObj, values, delimiters) {
  12032. if (!formater) {
  12033. formater = new BaseFormatter();
  12034. }
  12035. walkJsonObj(jsonObj, function (jsonObj, key) {
  12036. var value = jsonObj[key];
  12037. if (isString(value)) {
  12038. if (isI18nStr(value, delimiters)) {
  12039. jsonObj[key] = compileStr(value, values, delimiters);
  12040. }
  12041. } else {
  12042. parseI18nJson(value, values, delimiters);
  12043. }
  12044. });
  12045. return jsonObj;
  12046. }
  12047. function compileI18nJsonStr(jsonStr, _ref5) {
  12048. var locale = _ref5.locale,
  12049. locales = _ref5.locales,
  12050. delimiters = _ref5.delimiters;
  12051. if (!isI18nStr(jsonStr, delimiters)) {
  12052. return jsonStr;
  12053. }
  12054. if (!formater) {
  12055. formater = new BaseFormatter();
  12056. }
  12057. var localeValues = [];
  12058. Object.keys(locales).forEach(function (name) {
  12059. if (name !== locale) {
  12060. localeValues.push({
  12061. locale: name,
  12062. values: locales[name]
  12063. });
  12064. }
  12065. });
  12066. localeValues.unshift({
  12067. locale: locale,
  12068. values: locales[locale]
  12069. });
  12070. try {
  12071. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  12072. } catch (e) {}
  12073. return jsonStr;
  12074. }
  12075. function isI18nStr(value, delimiters) {
  12076. return value.indexOf(delimiters[0]) > -1;
  12077. }
  12078. function compileStr(value, values, delimiters) {
  12079. return formater.interpolate(value, values, delimiters).join('');
  12080. }
  12081. function compileValue(jsonObj, key, localeValues, delimiters) {
  12082. var value = jsonObj[key];
  12083. if (isString(value)) {
  12084. // 存在国际化
  12085. if (isI18nStr(value, delimiters)) {
  12086. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  12087. if (localeValues.length > 1) {
  12088. // 格式化国际化语言
  12089. var valueLocales = jsonObj[key + 'Locales'] = {};
  12090. localeValues.forEach(function (localValue) {
  12091. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  12092. });
  12093. }
  12094. }
  12095. } else {
  12096. compileJsonObj(value, localeValues, delimiters);
  12097. }
  12098. }
  12099. function compileJsonObj(jsonObj, localeValues, delimiters) {
  12100. walkJsonObj(jsonObj, function (jsonObj, key) {
  12101. compileValue(jsonObj, key, localeValues, delimiters);
  12102. });
  12103. return jsonObj;
  12104. }
  12105. function walkJsonObj(jsonObj, walk) {
  12106. if (isArray(jsonObj)) {
  12107. for (var i = 0; i < jsonObj.length; i++) {
  12108. if (walk(jsonObj, i)) {
  12109. return true;
  12110. }
  12111. }
  12112. } else if (isObject(jsonObj)) {
  12113. for (var key in jsonObj) {
  12114. if (walk(jsonObj, key)) {
  12115. return true;
  12116. }
  12117. }
  12118. }
  12119. return false;
  12120. }
  12121. function resolveLocale(locales) {
  12122. return function (locale) {
  12123. if (!locale) {
  12124. return locale;
  12125. }
  12126. locale = normalizeLocale(locale) || locale;
  12127. return resolveLocaleChain(locale).find(function (locale) {
  12128. return locales.indexOf(locale) > -1;
  12129. });
  12130. };
  12131. }
  12132. function resolveLocaleChain(locale) {
  12133. var chain = [];
  12134. var tokens = locale.split('-');
  12135. while (tokens.length) {
  12136. chain.push(tokens.join('-'));
  12137. tokens.pop();
  12138. }
  12139. return chain;
  12140. }
  12141. /* 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)))
  12142. /***/ }),
  12143. /***/ 220:
  12144. /*!**********************************************************************!*\
  12145. !*** D:/project/项目模板/uniapp/pages.json?{"type":"origin-pages-json"} ***!
  12146. \**********************************************************************/
  12147. /*! no static exports found */
  12148. /***/ (function(module, exports, __webpack_require__) {
  12149. "use strict";
  12150. Object.defineProperty(exports, "__esModule", {
  12151. value: true
  12152. });
  12153. exports.default = void 0;
  12154. var _default = {
  12155. "pages": [{
  12156. "path": "pages/index/index",
  12157. "style": {
  12158. "navigationBarTitleText": "首页"
  12159. }
  12160. }],
  12161. "subPackages": [{
  12162. "root": "pagesCommon",
  12163. "pages": [{
  12164. "path": "test/index",
  12165. "style": {
  12166. "navigationBarTitleText": "测试一",
  12167. "enablePullDownRefresh": true
  12168. }
  12169. }]
  12170. }, {
  12171. "root": "pagesHome",
  12172. "pages": [{
  12173. "path": "home/index",
  12174. "style": {
  12175. "navigationBarTitleText": "首页",
  12176. "enablePullDownRefresh": false
  12177. }
  12178. }, {
  12179. "path": "hot/index",
  12180. "style": {
  12181. "navigationBarTitleText": "热播",
  12182. "enablePullDownRefresh": false
  12183. }
  12184. }, {
  12185. "path": "app/index",
  12186. "style": {
  12187. "navigationBarTitleText": "应用",
  12188. "enablePullDownRefresh": false
  12189. }
  12190. }, {
  12191. "path": "find/index",
  12192. "style": {
  12193. "navigationBarTitleText": "发现",
  12194. "enablePullDownRefresh": false
  12195. }
  12196. }, {
  12197. "path": "account/index",
  12198. "style": {
  12199. "navigationBarTitleText": "账户",
  12200. "enablePullDownRefresh": false
  12201. }
  12202. }]
  12203. }, {
  12204. "root": "pagesAccount",
  12205. "pages": [{
  12206. "path": "login/index",
  12207. "style": {
  12208. "navigationBarTitleText": "账号登录",
  12209. "enablePullDownRefresh": false
  12210. }
  12211. }, {
  12212. "path": "register/index",
  12213. "style": {
  12214. "navigationBarTitleText": "账号注册",
  12215. "enablePullDownRefresh": false
  12216. }
  12217. }, {
  12218. "path": "other/agree",
  12219. "style": {
  12220. "navigationBarTitleText": "用户协议",
  12221. "enablePullDownRefresh": false
  12222. }
  12223. }, {
  12224. "path": "like/index",
  12225. "style": {
  12226. "navigationBarTitleText": "我的喜欢",
  12227. "enablePullDownRefresh": true
  12228. }
  12229. }, {
  12230. "path": "collect/index",
  12231. "style": {
  12232. "navigationBarTitleText": "我的收藏",
  12233. "enablePullDownRefresh": true
  12234. }
  12235. }, {
  12236. "path": "basic/index",
  12237. "style": {
  12238. "navigationBarTitleText": "账号信息",
  12239. "enablePullDownRefresh": false
  12240. }
  12241. }]
  12242. }, {
  12243. "root": "pagesVideo",
  12244. "pages": [{
  12245. "path": "video/index",
  12246. "style": {
  12247. "navigationBarTitleText": "详细信息",
  12248. "enablePullDownRefresh": true
  12249. }
  12250. }, {
  12251. "path": "search/index",
  12252. "style": {
  12253. "navigationBarTitleText": "视频筛选",
  12254. "enablePullDownRefresh": true
  12255. }
  12256. }, {
  12257. "path": "more/index",
  12258. "style": {
  12259. "navigationBarTitleText": "更多",
  12260. "enablePullDownRefresh": true
  12261. }
  12262. }]
  12263. }],
  12264. "globalStyle": {
  12265. "navigationBarTextStyle": "white",
  12266. "navigationBarTitleText": "益智游戏",
  12267. "navigationBarBackgroundColor": "#111111",
  12268. "backgroundColor": "#000000"
  12269. },
  12270. "uniIdRouter": {}
  12271. };
  12272. exports.default = _default;
  12273. /***/ }),
  12274. /***/ 221:
  12275. /*!*********************************************************!*\
  12276. !*** D:/project/项目模板/uniapp/pages.json?{"type":"stat"} ***!
  12277. \*********************************************************/
  12278. /*! no static exports found */
  12279. /***/ (function(module, exports, __webpack_require__) {
  12280. "use strict";
  12281. Object.defineProperty(exports, "__esModule", {
  12282. value: true
  12283. });
  12284. exports.default = void 0;
  12285. var _default = {
  12286. "appid": "__UNI__2080341"
  12287. };
  12288. exports.default = _default;
  12289. /***/ }),
  12290. /***/ 23:
  12291. /*!***************************************************************!*\
  12292. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  12293. \***************************************************************/
  12294. /*! no static exports found */
  12295. /***/ (function(module, exports) {
  12296. function _classCallCheck(instance, Constructor) {
  12297. if (!(instance instanceof Constructor)) {
  12298. throw new TypeError("Cannot call a class as a function");
  12299. }
  12300. }
  12301. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12302. /***/ }),
  12303. /***/ 236:
  12304. /*!***********************************************************************************************!*\
  12305. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  12306. \***********************************************************************************************/
  12307. /*! no static exports found */
  12308. /***/ (function(module, exports, __webpack_require__) {
  12309. "use strict";
  12310. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12311. Object.defineProperty(exports, "__esModule", {
  12312. value: true
  12313. });
  12314. exports.default = void 0;
  12315. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 237));
  12316. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 238));
  12317. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 239));
  12318. var _default = {
  12319. en: _en.default,
  12320. 'zh-Hans': _zhHans.default,
  12321. 'zh-Hant': _zhHant.default
  12322. };
  12323. exports.default = _default;
  12324. /***/ }),
  12325. /***/ 237:
  12326. /*!**********************************************************************************************!*\
  12327. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  12328. \**********************************************************************************************/
  12329. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  12330. /***/ (function(module) {
  12331. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"Pull up to show more\",\"uni-load-more.contentrefresh\":\"loading...\",\"uni-load-more.contentnomore\":\"No more data\"}");
  12332. /***/ }),
  12333. /***/ 238:
  12334. /*!***************************************************************************************************!*\
  12335. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  12336. \***************************************************************************************************/
  12337. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  12338. /***/ (function(module) {
  12339. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  12340. /***/ }),
  12341. /***/ 239:
  12342. /*!***************************************************************************************************!*\
  12343. !*** D:/project/项目模板/uniapp/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  12344. \***************************************************************************************************/
  12345. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  12346. /***/ (function(module) {
  12347. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  12348. /***/ }),
  12349. /***/ 24:
  12350. /*!************************************************************!*\
  12351. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  12352. \************************************************************/
  12353. /*! no static exports found */
  12354. /***/ (function(module, exports, __webpack_require__) {
  12355. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  12356. function _defineProperties(target, props) {
  12357. for (var i = 0; i < props.length; i++) {
  12358. var descriptor = props[i];
  12359. descriptor.enumerable = descriptor.enumerable || false;
  12360. descriptor.configurable = true;
  12361. if ("value" in descriptor) descriptor.writable = true;
  12362. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  12363. }
  12364. }
  12365. function _createClass(Constructor, protoProps, staticProps) {
  12366. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  12367. if (staticProps) _defineProperties(Constructor, staticProps);
  12368. Object.defineProperty(Constructor, "prototype", {
  12369. writable: false
  12370. });
  12371. return Constructor;
  12372. }
  12373. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12374. /***/ }),
  12375. /***/ 25:
  12376. /*!******************************************************************************************!*\
  12377. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  12378. \******************************************************************************************/
  12379. /*! exports provided: default */
  12380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12381. "use strict";
  12382. __webpack_require__.r(__webpack_exports__);
  12383. /* WEBPACK VAR INJECTION */(function(global) {/*!
  12384. * Vue.js v2.6.11
  12385. * (c) 2014-2022 Evan You
  12386. * Released under the MIT License.
  12387. */
  12388. /* */
  12389. var emptyObject = Object.freeze({});
  12390. // These helpers produce better VM code in JS engines due to their
  12391. // explicitness and function inlining.
  12392. function isUndef (v) {
  12393. return v === undefined || v === null
  12394. }
  12395. function isDef (v) {
  12396. return v !== undefined && v !== null
  12397. }
  12398. function isTrue (v) {
  12399. return v === true
  12400. }
  12401. function isFalse (v) {
  12402. return v === false
  12403. }
  12404. /**
  12405. * Check if value is primitive.
  12406. */
  12407. function isPrimitive (value) {
  12408. return (
  12409. typeof value === 'string' ||
  12410. typeof value === 'number' ||
  12411. // $flow-disable-line
  12412. typeof value === 'symbol' ||
  12413. typeof value === 'boolean'
  12414. )
  12415. }
  12416. /**
  12417. * Quick object check - this is primarily used to tell
  12418. * Objects from primitive values when we know the value
  12419. * is a JSON-compliant type.
  12420. */
  12421. function isObject (obj) {
  12422. return obj !== null && typeof obj === 'object'
  12423. }
  12424. /**
  12425. * Get the raw type string of a value, e.g., [object Object].
  12426. */
  12427. var _toString = Object.prototype.toString;
  12428. function toRawType (value) {
  12429. return _toString.call(value).slice(8, -1)
  12430. }
  12431. /**
  12432. * Strict object type check. Only returns true
  12433. * for plain JavaScript objects.
  12434. */
  12435. function isPlainObject (obj) {
  12436. return _toString.call(obj) === '[object Object]'
  12437. }
  12438. function isRegExp (v) {
  12439. return _toString.call(v) === '[object RegExp]'
  12440. }
  12441. /**
  12442. * Check if val is a valid array index.
  12443. */
  12444. function isValidArrayIndex (val) {
  12445. var n = parseFloat(String(val));
  12446. return n >= 0 && Math.floor(n) === n && isFinite(val)
  12447. }
  12448. function isPromise (val) {
  12449. return (
  12450. isDef(val) &&
  12451. typeof val.then === 'function' &&
  12452. typeof val.catch === 'function'
  12453. )
  12454. }
  12455. /**
  12456. * Convert a value to a string that is actually rendered.
  12457. */
  12458. function toString (val) {
  12459. return val == null
  12460. ? ''
  12461. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  12462. ? JSON.stringify(val, null, 2)
  12463. : String(val)
  12464. }
  12465. /**
  12466. * Convert an input value to a number for persistence.
  12467. * If the conversion fails, return original string.
  12468. */
  12469. function toNumber (val) {
  12470. var n = parseFloat(val);
  12471. return isNaN(n) ? val : n
  12472. }
  12473. /**
  12474. * Make a map and return a function for checking if a key
  12475. * is in that map.
  12476. */
  12477. function makeMap (
  12478. str,
  12479. expectsLowerCase
  12480. ) {
  12481. var map = Object.create(null);
  12482. var list = str.split(',');
  12483. for (var i = 0; i < list.length; i++) {
  12484. map[list[i]] = true;
  12485. }
  12486. return expectsLowerCase
  12487. ? function (val) { return map[val.toLowerCase()]; }
  12488. : function (val) { return map[val]; }
  12489. }
  12490. /**
  12491. * Check if a tag is a built-in tag.
  12492. */
  12493. var isBuiltInTag = makeMap('slot,component', true);
  12494. /**
  12495. * Check if an attribute is a reserved attribute.
  12496. */
  12497. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  12498. /**
  12499. * Remove an item from an array.
  12500. */
  12501. function remove (arr, item) {
  12502. if (arr.length) {
  12503. var index = arr.indexOf(item);
  12504. if (index > -1) {
  12505. return arr.splice(index, 1)
  12506. }
  12507. }
  12508. }
  12509. /**
  12510. * Check whether an object has the property.
  12511. */
  12512. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12513. function hasOwn (obj, key) {
  12514. return hasOwnProperty.call(obj, key)
  12515. }
  12516. /**
  12517. * Create a cached version of a pure function.
  12518. */
  12519. function cached (fn) {
  12520. var cache = Object.create(null);
  12521. return (function cachedFn (str) {
  12522. var hit = cache[str];
  12523. return hit || (cache[str] = fn(str))
  12524. })
  12525. }
  12526. /**
  12527. * Camelize a hyphen-delimited string.
  12528. */
  12529. var camelizeRE = /-(\w)/g;
  12530. var camelize = cached(function (str) {
  12531. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  12532. });
  12533. /**
  12534. * Capitalize a string.
  12535. */
  12536. var capitalize = cached(function (str) {
  12537. return str.charAt(0).toUpperCase() + str.slice(1)
  12538. });
  12539. /**
  12540. * Hyphenate a camelCase string.
  12541. */
  12542. var hyphenateRE = /\B([A-Z])/g;
  12543. var hyphenate = cached(function (str) {
  12544. return str.replace(hyphenateRE, '-$1').toLowerCase()
  12545. });
  12546. /**
  12547. * Simple bind polyfill for environments that do not support it,
  12548. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  12549. * since native bind is now performant enough in most browsers.
  12550. * But removing it would mean breaking code that was able to run in
  12551. * PhantomJS 1.x, so this must be kept for backward compatibility.
  12552. */
  12553. /* istanbul ignore next */
  12554. function polyfillBind (fn, ctx) {
  12555. function boundFn (a) {
  12556. var l = arguments.length;
  12557. return l
  12558. ? l > 1
  12559. ? fn.apply(ctx, arguments)
  12560. : fn.call(ctx, a)
  12561. : fn.call(ctx)
  12562. }
  12563. boundFn._length = fn.length;
  12564. return boundFn
  12565. }
  12566. function nativeBind (fn, ctx) {
  12567. return fn.bind(ctx)
  12568. }
  12569. var bind = Function.prototype.bind
  12570. ? nativeBind
  12571. : polyfillBind;
  12572. /**
  12573. * Convert an Array-like object to a real Array.
  12574. */
  12575. function toArray (list, start) {
  12576. start = start || 0;
  12577. var i = list.length - start;
  12578. var ret = new Array(i);
  12579. while (i--) {
  12580. ret[i] = list[i + start];
  12581. }
  12582. return ret
  12583. }
  12584. /**
  12585. * Mix properties into target object.
  12586. */
  12587. function extend (to, _from) {
  12588. for (var key in _from) {
  12589. to[key] = _from[key];
  12590. }
  12591. return to
  12592. }
  12593. /**
  12594. * Merge an Array of Objects into a single Object.
  12595. */
  12596. function toObject (arr) {
  12597. var res = {};
  12598. for (var i = 0; i < arr.length; i++) {
  12599. if (arr[i]) {
  12600. extend(res, arr[i]);
  12601. }
  12602. }
  12603. return res
  12604. }
  12605. /* eslint-disable no-unused-vars */
  12606. /**
  12607. * Perform no operation.
  12608. * Stubbing args to make Flow happy without leaving useless transpiled code
  12609. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  12610. */
  12611. function noop (a, b, c) {}
  12612. /**
  12613. * Always return false.
  12614. */
  12615. var no = function (a, b, c) { return false; };
  12616. /* eslint-enable no-unused-vars */
  12617. /**
  12618. * Return the same value.
  12619. */
  12620. var identity = function (_) { return _; };
  12621. /**
  12622. * Check if two values are loosely equal - that is,
  12623. * if they are plain objects, do they have the same shape?
  12624. */
  12625. function looseEqual (a, b) {
  12626. if (a === b) { return true }
  12627. var isObjectA = isObject(a);
  12628. var isObjectB = isObject(b);
  12629. if (isObjectA && isObjectB) {
  12630. try {
  12631. var isArrayA = Array.isArray(a);
  12632. var isArrayB = Array.isArray(b);
  12633. if (isArrayA && isArrayB) {
  12634. return a.length === b.length && a.every(function (e, i) {
  12635. return looseEqual(e, b[i])
  12636. })
  12637. } else if (a instanceof Date && b instanceof Date) {
  12638. return a.getTime() === b.getTime()
  12639. } else if (!isArrayA && !isArrayB) {
  12640. var keysA = Object.keys(a);
  12641. var keysB = Object.keys(b);
  12642. return keysA.length === keysB.length && keysA.every(function (key) {
  12643. return looseEqual(a[key], b[key])
  12644. })
  12645. } else {
  12646. /* istanbul ignore next */
  12647. return false
  12648. }
  12649. } catch (e) {
  12650. /* istanbul ignore next */
  12651. return false
  12652. }
  12653. } else if (!isObjectA && !isObjectB) {
  12654. return String(a) === String(b)
  12655. } else {
  12656. return false
  12657. }
  12658. }
  12659. /**
  12660. * Return the first index at which a loosely equal value can be
  12661. * found in the array (if value is a plain object, the array must
  12662. * contain an object of the same shape), or -1 if it is not present.
  12663. */
  12664. function looseIndexOf (arr, val) {
  12665. for (var i = 0; i < arr.length; i++) {
  12666. if (looseEqual(arr[i], val)) { return i }
  12667. }
  12668. return -1
  12669. }
  12670. /**
  12671. * Ensure a function is called only once.
  12672. */
  12673. function once (fn) {
  12674. var called = false;
  12675. return function () {
  12676. if (!called) {
  12677. called = true;
  12678. fn.apply(this, arguments);
  12679. }
  12680. }
  12681. }
  12682. var ASSET_TYPES = [
  12683. 'component',
  12684. 'directive',
  12685. 'filter'
  12686. ];
  12687. var LIFECYCLE_HOOKS = [
  12688. 'beforeCreate',
  12689. 'created',
  12690. 'beforeMount',
  12691. 'mounted',
  12692. 'beforeUpdate',
  12693. 'updated',
  12694. 'beforeDestroy',
  12695. 'destroyed',
  12696. 'activated',
  12697. 'deactivated',
  12698. 'errorCaptured',
  12699. 'serverPrefetch'
  12700. ];
  12701. /* */
  12702. var config = ({
  12703. /**
  12704. * Option merge strategies (used in core/util/options)
  12705. */
  12706. // $flow-disable-line
  12707. optionMergeStrategies: Object.create(null),
  12708. /**
  12709. * Whether to suppress warnings.
  12710. */
  12711. silent: false,
  12712. /**
  12713. * Show production mode tip message on boot?
  12714. */
  12715. productionTip: "development" !== 'production',
  12716. /**
  12717. * Whether to enable devtools
  12718. */
  12719. devtools: "development" !== 'production',
  12720. /**
  12721. * Whether to record perf
  12722. */
  12723. performance: false,
  12724. /**
  12725. * Error handler for watcher errors
  12726. */
  12727. errorHandler: null,
  12728. /**
  12729. * Warn handler for watcher warns
  12730. */
  12731. warnHandler: null,
  12732. /**
  12733. * Ignore certain custom elements
  12734. */
  12735. ignoredElements: [],
  12736. /**
  12737. * Custom user key aliases for v-on
  12738. */
  12739. // $flow-disable-line
  12740. keyCodes: Object.create(null),
  12741. /**
  12742. * Check if a tag is reserved so that it cannot be registered as a
  12743. * component. This is platform-dependent and may be overwritten.
  12744. */
  12745. isReservedTag: no,
  12746. /**
  12747. * Check if an attribute is reserved so that it cannot be used as a component
  12748. * prop. This is platform-dependent and may be overwritten.
  12749. */
  12750. isReservedAttr: no,
  12751. /**
  12752. * Check if a tag is an unknown element.
  12753. * Platform-dependent.
  12754. */
  12755. isUnknownElement: no,
  12756. /**
  12757. * Get the namespace of an element
  12758. */
  12759. getTagNamespace: noop,
  12760. /**
  12761. * Parse the real tag name for the specific platform.
  12762. */
  12763. parsePlatformTagName: identity,
  12764. /**
  12765. * Check if an attribute must be bound using property, e.g. value
  12766. * Platform-dependent.
  12767. */
  12768. mustUseProp: no,
  12769. /**
  12770. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  12771. * This will significantly reduce performance if set to false.
  12772. */
  12773. async: true,
  12774. /**
  12775. * Exposed for legacy reasons
  12776. */
  12777. _lifecycleHooks: LIFECYCLE_HOOKS
  12778. });
  12779. /* */
  12780. /**
  12781. * unicode letters used for parsing html tags, component names and property paths.
  12782. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  12783. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  12784. */
  12785. 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/;
  12786. /**
  12787. * Check if a string starts with $ or _
  12788. */
  12789. function isReserved (str) {
  12790. var c = (str + '').charCodeAt(0);
  12791. return c === 0x24 || c === 0x5F
  12792. }
  12793. /**
  12794. * Define a property.
  12795. */
  12796. function def (obj, key, val, enumerable) {
  12797. Object.defineProperty(obj, key, {
  12798. value: val,
  12799. enumerable: !!enumerable,
  12800. writable: true,
  12801. configurable: true
  12802. });
  12803. }
  12804. /**
  12805. * Parse simple path.
  12806. */
  12807. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  12808. function parsePath (path) {
  12809. if (bailRE.test(path)) {
  12810. return
  12811. }
  12812. var segments = path.split('.');
  12813. return function (obj) {
  12814. for (var i = 0; i < segments.length; i++) {
  12815. if (!obj) { return }
  12816. obj = obj[segments[i]];
  12817. }
  12818. return obj
  12819. }
  12820. }
  12821. /* */
  12822. // can we use __proto__?
  12823. var hasProto = '__proto__' in {};
  12824. // Browser environment sniffing
  12825. var inBrowser = typeof window !== 'undefined';
  12826. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  12827. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  12828. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  12829. var isIE = UA && /msie|trident/.test(UA);
  12830. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  12831. var isEdge = UA && UA.indexOf('edge/') > 0;
  12832. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  12833. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  12834. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  12835. var isPhantomJS = UA && /phantomjs/.test(UA);
  12836. var isFF = UA && UA.match(/firefox\/(\d+)/);
  12837. // Firefox has a "watch" function on Object.prototype...
  12838. var nativeWatch = ({}).watch;
  12839. if (inBrowser) {
  12840. try {
  12841. var opts = {};
  12842. Object.defineProperty(opts, 'passive', ({
  12843. get: function get () {
  12844. }
  12845. })); // https://github.com/facebook/flow/issues/285
  12846. window.addEventListener('test-passive', null, opts);
  12847. } catch (e) {}
  12848. }
  12849. // this needs to be lazy-evaled because vue may be required before
  12850. // vue-server-renderer can set VUE_ENV
  12851. var _isServer;
  12852. var isServerRendering = function () {
  12853. if (_isServer === undefined) {
  12854. /* istanbul ignore if */
  12855. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  12856. // detect presence of vue-server-renderer and avoid
  12857. // Webpack shimming the process
  12858. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  12859. } else {
  12860. _isServer = false;
  12861. }
  12862. }
  12863. return _isServer
  12864. };
  12865. // detect devtools
  12866. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  12867. /* istanbul ignore next */
  12868. function isNative (Ctor) {
  12869. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  12870. }
  12871. var hasSymbol =
  12872. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  12873. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  12874. var _Set;
  12875. /* istanbul ignore if */ // $flow-disable-line
  12876. if (typeof Set !== 'undefined' && isNative(Set)) {
  12877. // use native Set when available.
  12878. _Set = Set;
  12879. } else {
  12880. // a non-standard Set polyfill that only works with primitive keys.
  12881. _Set = /*@__PURE__*/(function () {
  12882. function Set () {
  12883. this.set = Object.create(null);
  12884. }
  12885. Set.prototype.has = function has (key) {
  12886. return this.set[key] === true
  12887. };
  12888. Set.prototype.add = function add (key) {
  12889. this.set[key] = true;
  12890. };
  12891. Set.prototype.clear = function clear () {
  12892. this.set = Object.create(null);
  12893. };
  12894. return Set;
  12895. }());
  12896. }
  12897. /* */
  12898. var warn = noop;
  12899. var tip = noop;
  12900. var generateComponentTrace = (noop); // work around flow check
  12901. var formatComponentName = (noop);
  12902. if (true) {
  12903. var hasConsole = typeof console !== 'undefined';
  12904. var classifyRE = /(?:^|[-_])(\w)/g;
  12905. var classify = function (str) { return str
  12906. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  12907. .replace(/[-_]/g, ''); };
  12908. warn = function (msg, vm) {
  12909. var trace = vm ? generateComponentTrace(vm) : '';
  12910. if (config.warnHandler) {
  12911. config.warnHandler.call(null, msg, vm, trace);
  12912. } else if (hasConsole && (!config.silent)) {
  12913. console.error(("[Vue warn]: " + msg + trace));
  12914. }
  12915. };
  12916. tip = function (msg, vm) {
  12917. if (hasConsole && (!config.silent)) {
  12918. console.warn("[Vue tip]: " + msg + (
  12919. vm ? generateComponentTrace(vm) : ''
  12920. ));
  12921. }
  12922. };
  12923. formatComponentName = function (vm, includeFile) {
  12924. if (vm.$root === vm) {
  12925. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  12926. return ('') + vm.$options.__file
  12927. }
  12928. return '<Root>'
  12929. }
  12930. var options = typeof vm === 'function' && vm.cid != null
  12931. ? vm.options
  12932. : vm._isVue
  12933. ? vm.$options || vm.constructor.options
  12934. : vm;
  12935. var name = options.name || options._componentTag;
  12936. var file = options.__file;
  12937. if (!name && file) {
  12938. var match = file.match(/([^/\\]+)\.vue$/);
  12939. name = match && match[1];
  12940. }
  12941. return (
  12942. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  12943. (file && includeFile !== false ? (" at " + file) : '')
  12944. )
  12945. };
  12946. var repeat = function (str, n) {
  12947. var res = '';
  12948. while (n) {
  12949. if (n % 2 === 1) { res += str; }
  12950. if (n > 1) { str += str; }
  12951. n >>= 1;
  12952. }
  12953. return res
  12954. };
  12955. generateComponentTrace = function (vm) {
  12956. if (vm._isVue && vm.$parent) {
  12957. var tree = [];
  12958. var currentRecursiveSequence = 0;
  12959. while (vm && vm.$options.name !== 'PageBody') {
  12960. if (tree.length > 0) {
  12961. var last = tree[tree.length - 1];
  12962. if (last.constructor === vm.constructor) {
  12963. currentRecursiveSequence++;
  12964. vm = vm.$parent;
  12965. continue
  12966. } else if (currentRecursiveSequence > 0) {
  12967. tree[tree.length - 1] = [last, currentRecursiveSequence];
  12968. currentRecursiveSequence = 0;
  12969. }
  12970. }
  12971. !vm.$options.isReserved && tree.push(vm);
  12972. vm = vm.$parent;
  12973. }
  12974. return '\n\nfound in\n\n' + tree
  12975. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  12976. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  12977. : formatComponentName(vm))); })
  12978. .join('\n')
  12979. } else {
  12980. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  12981. }
  12982. };
  12983. }
  12984. /* */
  12985. var uid = 0;
  12986. /**
  12987. * A dep is an observable that can have multiple
  12988. * directives subscribing to it.
  12989. */
  12990. var Dep = function Dep () {
  12991. this.id = uid++;
  12992. this.subs = [];
  12993. };
  12994. Dep.prototype.addSub = function addSub (sub) {
  12995. this.subs.push(sub);
  12996. };
  12997. Dep.prototype.removeSub = function removeSub (sub) {
  12998. remove(this.subs, sub);
  12999. };
  13000. Dep.prototype.depend = function depend () {
  13001. if (Dep.SharedObject.target) {
  13002. Dep.SharedObject.target.addDep(this);
  13003. }
  13004. };
  13005. Dep.prototype.notify = function notify () {
  13006. // stabilize the subscriber list first
  13007. var subs = this.subs.slice();
  13008. if ( true && !config.async) {
  13009. // subs aren't sorted in scheduler if not running async
  13010. // we need to sort them now to make sure they fire in correct
  13011. // order
  13012. subs.sort(function (a, b) { return a.id - b.id; });
  13013. }
  13014. for (var i = 0, l = subs.length; i < l; i++) {
  13015. subs[i].update();
  13016. }
  13017. };
  13018. // The current target watcher being evaluated.
  13019. // This is globally unique because only one watcher
  13020. // can be evaluated at a time.
  13021. // fixed by xxxxxx (nvue shared vuex)
  13022. /* eslint-disable no-undef */
  13023. Dep.SharedObject = {};
  13024. Dep.SharedObject.target = null;
  13025. Dep.SharedObject.targetStack = [];
  13026. function pushTarget (target) {
  13027. Dep.SharedObject.targetStack.push(target);
  13028. Dep.SharedObject.target = target;
  13029. Dep.target = target;
  13030. }
  13031. function popTarget () {
  13032. Dep.SharedObject.targetStack.pop();
  13033. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  13034. Dep.target = Dep.SharedObject.target;
  13035. }
  13036. /* */
  13037. var VNode = function VNode (
  13038. tag,
  13039. data,
  13040. children,
  13041. text,
  13042. elm,
  13043. context,
  13044. componentOptions,
  13045. asyncFactory
  13046. ) {
  13047. this.tag = tag;
  13048. this.data = data;
  13049. this.children = children;
  13050. this.text = text;
  13051. this.elm = elm;
  13052. this.ns = undefined;
  13053. this.context = context;
  13054. this.fnContext = undefined;
  13055. this.fnOptions = undefined;
  13056. this.fnScopeId = undefined;
  13057. this.key = data && data.key;
  13058. this.componentOptions = componentOptions;
  13059. this.componentInstance = undefined;
  13060. this.parent = undefined;
  13061. this.raw = false;
  13062. this.isStatic = false;
  13063. this.isRootInsert = true;
  13064. this.isComment = false;
  13065. this.isCloned = false;
  13066. this.isOnce = false;
  13067. this.asyncFactory = asyncFactory;
  13068. this.asyncMeta = undefined;
  13069. this.isAsyncPlaceholder = false;
  13070. };
  13071. var prototypeAccessors = { child: { configurable: true } };
  13072. // DEPRECATED: alias for componentInstance for backwards compat.
  13073. /* istanbul ignore next */
  13074. prototypeAccessors.child.get = function () {
  13075. return this.componentInstance
  13076. };
  13077. Object.defineProperties( VNode.prototype, prototypeAccessors );
  13078. var createEmptyVNode = function (text) {
  13079. if ( text === void 0 ) text = '';
  13080. var node = new VNode();
  13081. node.text = text;
  13082. node.isComment = true;
  13083. return node
  13084. };
  13085. function createTextVNode (val) {
  13086. return new VNode(undefined, undefined, undefined, String(val))
  13087. }
  13088. // optimized shallow clone
  13089. // used for static nodes and slot nodes because they may be reused across
  13090. // multiple renders, cloning them avoids errors when DOM manipulations rely
  13091. // on their elm reference.
  13092. function cloneVNode (vnode) {
  13093. var cloned = new VNode(
  13094. vnode.tag,
  13095. vnode.data,
  13096. // #7975
  13097. // clone children array to avoid mutating original in case of cloning
  13098. // a child.
  13099. vnode.children && vnode.children.slice(),
  13100. vnode.text,
  13101. vnode.elm,
  13102. vnode.context,
  13103. vnode.componentOptions,
  13104. vnode.asyncFactory
  13105. );
  13106. cloned.ns = vnode.ns;
  13107. cloned.isStatic = vnode.isStatic;
  13108. cloned.key = vnode.key;
  13109. cloned.isComment = vnode.isComment;
  13110. cloned.fnContext = vnode.fnContext;
  13111. cloned.fnOptions = vnode.fnOptions;
  13112. cloned.fnScopeId = vnode.fnScopeId;
  13113. cloned.asyncMeta = vnode.asyncMeta;
  13114. cloned.isCloned = true;
  13115. return cloned
  13116. }
  13117. /*
  13118. * not type checking this file because flow doesn't play well with
  13119. * dynamically accessing methods on Array prototype
  13120. */
  13121. var arrayProto = Array.prototype;
  13122. var arrayMethods = Object.create(arrayProto);
  13123. var methodsToPatch = [
  13124. 'push',
  13125. 'pop',
  13126. 'shift',
  13127. 'unshift',
  13128. 'splice',
  13129. 'sort',
  13130. 'reverse'
  13131. ];
  13132. /**
  13133. * Intercept mutating methods and emit events
  13134. */
  13135. methodsToPatch.forEach(function (method) {
  13136. // cache original method
  13137. var original = arrayProto[method];
  13138. def(arrayMethods, method, function mutator () {
  13139. var args = [], len = arguments.length;
  13140. while ( len-- ) args[ len ] = arguments[ len ];
  13141. var result = original.apply(this, args);
  13142. var ob = this.__ob__;
  13143. var inserted;
  13144. switch (method) {
  13145. case 'push':
  13146. case 'unshift':
  13147. inserted = args;
  13148. break
  13149. case 'splice':
  13150. inserted = args.slice(2);
  13151. break
  13152. }
  13153. if (inserted) { ob.observeArray(inserted); }
  13154. // notify change
  13155. ob.dep.notify();
  13156. return result
  13157. });
  13158. });
  13159. /* */
  13160. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  13161. /**
  13162. * In some cases we may want to disable observation inside a component's
  13163. * update computation.
  13164. */
  13165. var shouldObserve = true;
  13166. function toggleObserving (value) {
  13167. shouldObserve = value;
  13168. }
  13169. /**
  13170. * Observer class that is attached to each observed
  13171. * object. Once attached, the observer converts the target
  13172. * object's property keys into getter/setters that
  13173. * collect dependencies and dispatch updates.
  13174. */
  13175. var Observer = function Observer (value) {
  13176. this.value = value;
  13177. this.dep = new Dep();
  13178. this.vmCount = 0;
  13179. def(value, '__ob__', this);
  13180. if (Array.isArray(value)) {
  13181. if (hasProto) {
  13182. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  13183. if(value.push !== value.__proto__.push){
  13184. copyAugment(value, arrayMethods, arrayKeys);
  13185. } else {
  13186. protoAugment(value, arrayMethods);
  13187. }
  13188. }
  13189. } else {
  13190. copyAugment(value, arrayMethods, arrayKeys);
  13191. }
  13192. this.observeArray(value);
  13193. } else {
  13194. this.walk(value);
  13195. }
  13196. };
  13197. /**
  13198. * Walk through all properties and convert them into
  13199. * getter/setters. This method should only be called when
  13200. * value type is Object.
  13201. */
  13202. Observer.prototype.walk = function walk (obj) {
  13203. var keys = Object.keys(obj);
  13204. for (var i = 0; i < keys.length; i++) {
  13205. defineReactive$$1(obj, keys[i]);
  13206. }
  13207. };
  13208. /**
  13209. * Observe a list of Array items.
  13210. */
  13211. Observer.prototype.observeArray = function observeArray (items) {
  13212. for (var i = 0, l = items.length; i < l; i++) {
  13213. observe(items[i]);
  13214. }
  13215. };
  13216. // helpers
  13217. /**
  13218. * Augment a target Object or Array by intercepting
  13219. * the prototype chain using __proto__
  13220. */
  13221. function protoAugment (target, src) {
  13222. /* eslint-disable no-proto */
  13223. target.__proto__ = src;
  13224. /* eslint-enable no-proto */
  13225. }
  13226. /**
  13227. * Augment a target Object or Array by defining
  13228. * hidden properties.
  13229. */
  13230. /* istanbul ignore next */
  13231. function copyAugment (target, src, keys) {
  13232. for (var i = 0, l = keys.length; i < l; i++) {
  13233. var key = keys[i];
  13234. def(target, key, src[key]);
  13235. }
  13236. }
  13237. /**
  13238. * Attempt to create an observer instance for a value,
  13239. * returns the new observer if successfully observed,
  13240. * or the existing observer if the value already has one.
  13241. */
  13242. function observe (value, asRootData) {
  13243. if (!isObject(value) || value instanceof VNode) {
  13244. return
  13245. }
  13246. var ob;
  13247. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  13248. ob = value.__ob__;
  13249. } else if (
  13250. shouldObserve &&
  13251. !isServerRendering() &&
  13252. (Array.isArray(value) || isPlainObject(value)) &&
  13253. Object.isExtensible(value) &&
  13254. !value._isVue &&
  13255. !value.__v_isMPComponent
  13256. ) {
  13257. ob = new Observer(value);
  13258. }
  13259. if (asRootData && ob) {
  13260. ob.vmCount++;
  13261. }
  13262. return ob
  13263. }
  13264. /**
  13265. * Define a reactive property on an Object.
  13266. */
  13267. function defineReactive$$1 (
  13268. obj,
  13269. key,
  13270. val,
  13271. customSetter,
  13272. shallow
  13273. ) {
  13274. var dep = new Dep();
  13275. var property = Object.getOwnPropertyDescriptor(obj, key);
  13276. if (property && property.configurable === false) {
  13277. return
  13278. }
  13279. // cater for pre-defined getter/setters
  13280. var getter = property && property.get;
  13281. var setter = property && property.set;
  13282. if ((!getter || setter) && arguments.length === 2) {
  13283. val = obj[key];
  13284. }
  13285. var childOb = !shallow && observe(val);
  13286. Object.defineProperty(obj, key, {
  13287. enumerable: true,
  13288. configurable: true,
  13289. get: function reactiveGetter () {
  13290. var value = getter ? getter.call(obj) : val;
  13291. if (Dep.SharedObject.target) { // fixed by xxxxxx
  13292. dep.depend();
  13293. if (childOb) {
  13294. childOb.dep.depend();
  13295. if (Array.isArray(value)) {
  13296. dependArray(value);
  13297. }
  13298. }
  13299. }
  13300. return value
  13301. },
  13302. set: function reactiveSetter (newVal) {
  13303. var value = getter ? getter.call(obj) : val;
  13304. /* eslint-disable no-self-compare */
  13305. if (newVal === value || (newVal !== newVal && value !== value)) {
  13306. return
  13307. }
  13308. /* eslint-enable no-self-compare */
  13309. if ( true && customSetter) {
  13310. customSetter();
  13311. }
  13312. // #7981: for accessor properties without setter
  13313. if (getter && !setter) { return }
  13314. if (setter) {
  13315. setter.call(obj, newVal);
  13316. } else {
  13317. val = newVal;
  13318. }
  13319. childOb = !shallow && observe(newVal);
  13320. dep.notify();
  13321. }
  13322. });
  13323. }
  13324. /**
  13325. * Set a property on an object. Adds the new property and
  13326. * triggers change notification if the property doesn't
  13327. * already exist.
  13328. */
  13329. function set (target, key, val) {
  13330. if ( true &&
  13331. (isUndef(target) || isPrimitive(target))
  13332. ) {
  13333. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  13334. }
  13335. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13336. target.length = Math.max(target.length, key);
  13337. target.splice(key, 1, val);
  13338. return val
  13339. }
  13340. if (key in target && !(key in Object.prototype)) {
  13341. target[key] = val;
  13342. return val
  13343. }
  13344. var ob = (target).__ob__;
  13345. if (target._isVue || (ob && ob.vmCount)) {
  13346. true && warn(
  13347. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  13348. 'at runtime - declare it upfront in the data option.'
  13349. );
  13350. return val
  13351. }
  13352. if (!ob) {
  13353. target[key] = val;
  13354. return val
  13355. }
  13356. defineReactive$$1(ob.value, key, val);
  13357. ob.dep.notify();
  13358. return val
  13359. }
  13360. /**
  13361. * Delete a property and trigger change if necessary.
  13362. */
  13363. function del (target, key) {
  13364. if ( true &&
  13365. (isUndef(target) || isPrimitive(target))
  13366. ) {
  13367. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  13368. }
  13369. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13370. target.splice(key, 1);
  13371. return
  13372. }
  13373. var ob = (target).__ob__;
  13374. if (target._isVue || (ob && ob.vmCount)) {
  13375. true && warn(
  13376. 'Avoid deleting properties on a Vue instance or its root $data ' +
  13377. '- just set it to null.'
  13378. );
  13379. return
  13380. }
  13381. if (!hasOwn(target, key)) {
  13382. return
  13383. }
  13384. delete target[key];
  13385. if (!ob) {
  13386. return
  13387. }
  13388. ob.dep.notify();
  13389. }
  13390. /**
  13391. * Collect dependencies on array elements when the array is touched, since
  13392. * we cannot intercept array element access like property getters.
  13393. */
  13394. function dependArray (value) {
  13395. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  13396. e = value[i];
  13397. e && e.__ob__ && e.__ob__.dep.depend();
  13398. if (Array.isArray(e)) {
  13399. dependArray(e);
  13400. }
  13401. }
  13402. }
  13403. /* */
  13404. /**
  13405. * Option overwriting strategies are functions that handle
  13406. * how to merge a parent option value and a child option
  13407. * value into the final value.
  13408. */
  13409. var strats = config.optionMergeStrategies;
  13410. /**
  13411. * Options with restrictions
  13412. */
  13413. if (true) {
  13414. strats.el = strats.propsData = function (parent, child, vm, key) {
  13415. if (!vm) {
  13416. warn(
  13417. "option \"" + key + "\" can only be used during instance " +
  13418. 'creation with the `new` keyword.'
  13419. );
  13420. }
  13421. return defaultStrat(parent, child)
  13422. };
  13423. }
  13424. /**
  13425. * Helper that recursively merges two data objects together.
  13426. */
  13427. function mergeData (to, from) {
  13428. if (!from) { return to }
  13429. var key, toVal, fromVal;
  13430. var keys = hasSymbol
  13431. ? Reflect.ownKeys(from)
  13432. : Object.keys(from);
  13433. for (var i = 0; i < keys.length; i++) {
  13434. key = keys[i];
  13435. // in case the object is already observed...
  13436. if (key === '__ob__') { continue }
  13437. toVal = to[key];
  13438. fromVal = from[key];
  13439. if (!hasOwn(to, key)) {
  13440. set(to, key, fromVal);
  13441. } else if (
  13442. toVal !== fromVal &&
  13443. isPlainObject(toVal) &&
  13444. isPlainObject(fromVal)
  13445. ) {
  13446. mergeData(toVal, fromVal);
  13447. }
  13448. }
  13449. return to
  13450. }
  13451. /**
  13452. * Data
  13453. */
  13454. function mergeDataOrFn (
  13455. parentVal,
  13456. childVal,
  13457. vm
  13458. ) {
  13459. if (!vm) {
  13460. // in a Vue.extend merge, both should be functions
  13461. if (!childVal) {
  13462. return parentVal
  13463. }
  13464. if (!parentVal) {
  13465. return childVal
  13466. }
  13467. // when parentVal & childVal are both present,
  13468. // we need to return a function that returns the
  13469. // merged result of both functions... no need to
  13470. // check if parentVal is a function here because
  13471. // it has to be a function to pass previous merges.
  13472. return function mergedDataFn () {
  13473. return mergeData(
  13474. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  13475. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  13476. )
  13477. }
  13478. } else {
  13479. return function mergedInstanceDataFn () {
  13480. // instance merge
  13481. var instanceData = typeof childVal === 'function'
  13482. ? childVal.call(vm, vm)
  13483. : childVal;
  13484. var defaultData = typeof parentVal === 'function'
  13485. ? parentVal.call(vm, vm)
  13486. : parentVal;
  13487. if (instanceData) {
  13488. return mergeData(instanceData, defaultData)
  13489. } else {
  13490. return defaultData
  13491. }
  13492. }
  13493. }
  13494. }
  13495. strats.data = function (
  13496. parentVal,
  13497. childVal,
  13498. vm
  13499. ) {
  13500. if (!vm) {
  13501. if (childVal && typeof childVal !== 'function') {
  13502. true && warn(
  13503. 'The "data" option should be a function ' +
  13504. 'that returns a per-instance value in component ' +
  13505. 'definitions.',
  13506. vm
  13507. );
  13508. return parentVal
  13509. }
  13510. return mergeDataOrFn(parentVal, childVal)
  13511. }
  13512. return mergeDataOrFn(parentVal, childVal, vm)
  13513. };
  13514. /**
  13515. * Hooks and props are merged as arrays.
  13516. */
  13517. function mergeHook (
  13518. parentVal,
  13519. childVal
  13520. ) {
  13521. var res = childVal
  13522. ? parentVal
  13523. ? parentVal.concat(childVal)
  13524. : Array.isArray(childVal)
  13525. ? childVal
  13526. : [childVal]
  13527. : parentVal;
  13528. return res
  13529. ? dedupeHooks(res)
  13530. : res
  13531. }
  13532. function dedupeHooks (hooks) {
  13533. var res = [];
  13534. for (var i = 0; i < hooks.length; i++) {
  13535. if (res.indexOf(hooks[i]) === -1) {
  13536. res.push(hooks[i]);
  13537. }
  13538. }
  13539. return res
  13540. }
  13541. LIFECYCLE_HOOKS.forEach(function (hook) {
  13542. strats[hook] = mergeHook;
  13543. });
  13544. /**
  13545. * Assets
  13546. *
  13547. * When a vm is present (instance creation), we need to do
  13548. * a three-way merge between constructor options, instance
  13549. * options and parent options.
  13550. */
  13551. function mergeAssets (
  13552. parentVal,
  13553. childVal,
  13554. vm,
  13555. key
  13556. ) {
  13557. var res = Object.create(parentVal || null);
  13558. if (childVal) {
  13559. true && assertObjectType(key, childVal, vm);
  13560. return extend(res, childVal)
  13561. } else {
  13562. return res
  13563. }
  13564. }
  13565. ASSET_TYPES.forEach(function (type) {
  13566. strats[type + 's'] = mergeAssets;
  13567. });
  13568. /**
  13569. * Watchers.
  13570. *
  13571. * Watchers hashes should not overwrite one
  13572. * another, so we merge them as arrays.
  13573. */
  13574. strats.watch = function (
  13575. parentVal,
  13576. childVal,
  13577. vm,
  13578. key
  13579. ) {
  13580. // work around Firefox's Object.prototype.watch...
  13581. if (parentVal === nativeWatch) { parentVal = undefined; }
  13582. if (childVal === nativeWatch) { childVal = undefined; }
  13583. /* istanbul ignore if */
  13584. if (!childVal) { return Object.create(parentVal || null) }
  13585. if (true) {
  13586. assertObjectType(key, childVal, vm);
  13587. }
  13588. if (!parentVal) { return childVal }
  13589. var ret = {};
  13590. extend(ret, parentVal);
  13591. for (var key$1 in childVal) {
  13592. var parent = ret[key$1];
  13593. var child = childVal[key$1];
  13594. if (parent && !Array.isArray(parent)) {
  13595. parent = [parent];
  13596. }
  13597. ret[key$1] = parent
  13598. ? parent.concat(child)
  13599. : Array.isArray(child) ? child : [child];
  13600. }
  13601. return ret
  13602. };
  13603. /**
  13604. * Other object hashes.
  13605. */
  13606. strats.props =
  13607. strats.methods =
  13608. strats.inject =
  13609. strats.computed = function (
  13610. parentVal,
  13611. childVal,
  13612. vm,
  13613. key
  13614. ) {
  13615. if (childVal && "development" !== 'production') {
  13616. assertObjectType(key, childVal, vm);
  13617. }
  13618. if (!parentVal) { return childVal }
  13619. var ret = Object.create(null);
  13620. extend(ret, parentVal);
  13621. if (childVal) { extend(ret, childVal); }
  13622. return ret
  13623. };
  13624. strats.provide = mergeDataOrFn;
  13625. /**
  13626. * Default strategy.
  13627. */
  13628. var defaultStrat = function (parentVal, childVal) {
  13629. return childVal === undefined
  13630. ? parentVal
  13631. : childVal
  13632. };
  13633. /**
  13634. * Validate component names
  13635. */
  13636. function checkComponents (options) {
  13637. for (var key in options.components) {
  13638. validateComponentName(key);
  13639. }
  13640. }
  13641. function validateComponentName (name) {
  13642. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  13643. warn(
  13644. 'Invalid component name: "' + name + '". Component names ' +
  13645. 'should conform to valid custom element name in html5 specification.'
  13646. );
  13647. }
  13648. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  13649. warn(
  13650. 'Do not use built-in or reserved HTML elements as component ' +
  13651. 'id: ' + name
  13652. );
  13653. }
  13654. }
  13655. /**
  13656. * Ensure all props option syntax are normalized into the
  13657. * Object-based format.
  13658. */
  13659. function normalizeProps (options, vm) {
  13660. var props = options.props;
  13661. if (!props) { return }
  13662. var res = {};
  13663. var i, val, name;
  13664. if (Array.isArray(props)) {
  13665. i = props.length;
  13666. while (i--) {
  13667. val = props[i];
  13668. if (typeof val === 'string') {
  13669. name = camelize(val);
  13670. res[name] = { type: null };
  13671. } else if (true) {
  13672. warn('props must be strings when using array syntax.');
  13673. }
  13674. }
  13675. } else if (isPlainObject(props)) {
  13676. for (var key in props) {
  13677. val = props[key];
  13678. name = camelize(key);
  13679. res[name] = isPlainObject(val)
  13680. ? val
  13681. : { type: val };
  13682. }
  13683. } else if (true) {
  13684. warn(
  13685. "Invalid value for option \"props\": expected an Array or an Object, " +
  13686. "but got " + (toRawType(props)) + ".",
  13687. vm
  13688. );
  13689. }
  13690. options.props = res;
  13691. }
  13692. /**
  13693. * Normalize all injections into Object-based format
  13694. */
  13695. function normalizeInject (options, vm) {
  13696. var inject = options.inject;
  13697. if (!inject) { return }
  13698. var normalized = options.inject = {};
  13699. if (Array.isArray(inject)) {
  13700. for (var i = 0; i < inject.length; i++) {
  13701. normalized[inject[i]] = { from: inject[i] };
  13702. }
  13703. } else if (isPlainObject(inject)) {
  13704. for (var key in inject) {
  13705. var val = inject[key];
  13706. normalized[key] = isPlainObject(val)
  13707. ? extend({ from: key }, val)
  13708. : { from: val };
  13709. }
  13710. } else if (true) {
  13711. warn(
  13712. "Invalid value for option \"inject\": expected an Array or an Object, " +
  13713. "but got " + (toRawType(inject)) + ".",
  13714. vm
  13715. );
  13716. }
  13717. }
  13718. /**
  13719. * Normalize raw function directives into object format.
  13720. */
  13721. function normalizeDirectives (options) {
  13722. var dirs = options.directives;
  13723. if (dirs) {
  13724. for (var key in dirs) {
  13725. var def$$1 = dirs[key];
  13726. if (typeof def$$1 === 'function') {
  13727. dirs[key] = { bind: def$$1, update: def$$1 };
  13728. }
  13729. }
  13730. }
  13731. }
  13732. function assertObjectType (name, value, vm) {
  13733. if (!isPlainObject(value)) {
  13734. warn(
  13735. "Invalid value for option \"" + name + "\": expected an Object, " +
  13736. "but got " + (toRawType(value)) + ".",
  13737. vm
  13738. );
  13739. }
  13740. }
  13741. /**
  13742. * Merge two option objects into a new one.
  13743. * Core utility used in both instantiation and inheritance.
  13744. */
  13745. function mergeOptions (
  13746. parent,
  13747. child,
  13748. vm
  13749. ) {
  13750. if (true) {
  13751. checkComponents(child);
  13752. }
  13753. if (typeof child === 'function') {
  13754. child = child.options;
  13755. }
  13756. normalizeProps(child, vm);
  13757. normalizeInject(child, vm);
  13758. normalizeDirectives(child);
  13759. // Apply extends and mixins on the child options,
  13760. // but only if it is a raw options object that isn't
  13761. // the result of another mergeOptions call.
  13762. // Only merged options has the _base property.
  13763. if (!child._base) {
  13764. if (child.extends) {
  13765. parent = mergeOptions(parent, child.extends, vm);
  13766. }
  13767. if (child.mixins) {
  13768. for (var i = 0, l = child.mixins.length; i < l; i++) {
  13769. parent = mergeOptions(parent, child.mixins[i], vm);
  13770. }
  13771. }
  13772. }
  13773. var options = {};
  13774. var key;
  13775. for (key in parent) {
  13776. mergeField(key);
  13777. }
  13778. for (key in child) {
  13779. if (!hasOwn(parent, key)) {
  13780. mergeField(key);
  13781. }
  13782. }
  13783. function mergeField (key) {
  13784. var strat = strats[key] || defaultStrat;
  13785. options[key] = strat(parent[key], child[key], vm, key);
  13786. }
  13787. return options
  13788. }
  13789. /**
  13790. * Resolve an asset.
  13791. * This function is used because child instances need access
  13792. * to assets defined in its ancestor chain.
  13793. */
  13794. function resolveAsset (
  13795. options,
  13796. type,
  13797. id,
  13798. warnMissing
  13799. ) {
  13800. /* istanbul ignore if */
  13801. if (typeof id !== 'string') {
  13802. return
  13803. }
  13804. var assets = options[type];
  13805. // check local registration variations first
  13806. if (hasOwn(assets, id)) { return assets[id] }
  13807. var camelizedId = camelize(id);
  13808. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  13809. var PascalCaseId = capitalize(camelizedId);
  13810. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  13811. // fallback to prototype chain
  13812. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  13813. if ( true && warnMissing && !res) {
  13814. warn(
  13815. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  13816. options
  13817. );
  13818. }
  13819. return res
  13820. }
  13821. /* */
  13822. function validateProp (
  13823. key,
  13824. propOptions,
  13825. propsData,
  13826. vm
  13827. ) {
  13828. var prop = propOptions[key];
  13829. var absent = !hasOwn(propsData, key);
  13830. var value = propsData[key];
  13831. // boolean casting
  13832. var booleanIndex = getTypeIndex(Boolean, prop.type);
  13833. if (booleanIndex > -1) {
  13834. if (absent && !hasOwn(prop, 'default')) {
  13835. value = false;
  13836. } else if (value === '' || value === hyphenate(key)) {
  13837. // only cast empty string / same name to boolean if
  13838. // boolean has higher priority
  13839. var stringIndex = getTypeIndex(String, prop.type);
  13840. if (stringIndex < 0 || booleanIndex < stringIndex) {
  13841. value = true;
  13842. }
  13843. }
  13844. }
  13845. // check default value
  13846. if (value === undefined) {
  13847. value = getPropDefaultValue(vm, prop, key);
  13848. // since the default value is a fresh copy,
  13849. // make sure to observe it.
  13850. var prevShouldObserve = shouldObserve;
  13851. toggleObserving(true);
  13852. observe(value);
  13853. toggleObserving(prevShouldObserve);
  13854. }
  13855. if (
  13856. true
  13857. ) {
  13858. assertProp(prop, key, value, vm, absent);
  13859. }
  13860. return value
  13861. }
  13862. /**
  13863. * Get the default value of a prop.
  13864. */
  13865. function getPropDefaultValue (vm, prop, key) {
  13866. // no default, return undefined
  13867. if (!hasOwn(prop, 'default')) {
  13868. return undefined
  13869. }
  13870. var def = prop.default;
  13871. // warn against non-factory defaults for Object & Array
  13872. if ( true && isObject(def)) {
  13873. warn(
  13874. 'Invalid default value for prop "' + key + '": ' +
  13875. 'Props with type Object/Array must use a factory function ' +
  13876. 'to return the default value.',
  13877. vm
  13878. );
  13879. }
  13880. // the raw prop value was also undefined from previous render,
  13881. // return previous default value to avoid unnecessary watcher trigger
  13882. if (vm && vm.$options.propsData &&
  13883. vm.$options.propsData[key] === undefined &&
  13884. vm._props[key] !== undefined
  13885. ) {
  13886. return vm._props[key]
  13887. }
  13888. // call factory function for non-Function types
  13889. // a value is Function if its prototype is function even across different execution context
  13890. return typeof def === 'function' && getType(prop.type) !== 'Function'
  13891. ? def.call(vm)
  13892. : def
  13893. }
  13894. /**
  13895. * Assert whether a prop is valid.
  13896. */
  13897. function assertProp (
  13898. prop,
  13899. name,
  13900. value,
  13901. vm,
  13902. absent
  13903. ) {
  13904. if (prop.required && absent) {
  13905. warn(
  13906. 'Missing required prop: "' + name + '"',
  13907. vm
  13908. );
  13909. return
  13910. }
  13911. if (value == null && !prop.required) {
  13912. return
  13913. }
  13914. var type = prop.type;
  13915. var valid = !type || type === true;
  13916. var expectedTypes = [];
  13917. if (type) {
  13918. if (!Array.isArray(type)) {
  13919. type = [type];
  13920. }
  13921. for (var i = 0; i < type.length && !valid; i++) {
  13922. var assertedType = assertType(value, type[i]);
  13923. expectedTypes.push(assertedType.expectedType || '');
  13924. valid = assertedType.valid;
  13925. }
  13926. }
  13927. if (!valid) {
  13928. warn(
  13929. getInvalidTypeMessage(name, value, expectedTypes),
  13930. vm
  13931. );
  13932. return
  13933. }
  13934. var validator = prop.validator;
  13935. if (validator) {
  13936. if (!validator(value)) {
  13937. warn(
  13938. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  13939. vm
  13940. );
  13941. }
  13942. }
  13943. }
  13944. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  13945. function assertType (value, type) {
  13946. var valid;
  13947. var expectedType = getType(type);
  13948. if (simpleCheckRE.test(expectedType)) {
  13949. var t = typeof value;
  13950. valid = t === expectedType.toLowerCase();
  13951. // for primitive wrapper objects
  13952. if (!valid && t === 'object') {
  13953. valid = value instanceof type;
  13954. }
  13955. } else if (expectedType === 'Object') {
  13956. valid = isPlainObject(value);
  13957. } else if (expectedType === 'Array') {
  13958. valid = Array.isArray(value);
  13959. } else {
  13960. valid = value instanceof type;
  13961. }
  13962. return {
  13963. valid: valid,
  13964. expectedType: expectedType
  13965. }
  13966. }
  13967. /**
  13968. * Use function string name to check built-in types,
  13969. * because a simple equality check will fail when running
  13970. * across different vms / iframes.
  13971. */
  13972. function getType (fn) {
  13973. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  13974. return match ? match[1] : ''
  13975. }
  13976. function isSameType (a, b) {
  13977. return getType(a) === getType(b)
  13978. }
  13979. function getTypeIndex (type, expectedTypes) {
  13980. if (!Array.isArray(expectedTypes)) {
  13981. return isSameType(expectedTypes, type) ? 0 : -1
  13982. }
  13983. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  13984. if (isSameType(expectedTypes[i], type)) {
  13985. return i
  13986. }
  13987. }
  13988. return -1
  13989. }
  13990. function getInvalidTypeMessage (name, value, expectedTypes) {
  13991. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  13992. " Expected " + (expectedTypes.map(capitalize).join(', '));
  13993. var expectedType = expectedTypes[0];
  13994. var receivedType = toRawType(value);
  13995. var expectedValue = styleValue(value, expectedType);
  13996. var receivedValue = styleValue(value, receivedType);
  13997. // check if we need to specify expected value
  13998. if (expectedTypes.length === 1 &&
  13999. isExplicable(expectedType) &&
  14000. !isBoolean(expectedType, receivedType)) {
  14001. message += " with value " + expectedValue;
  14002. }
  14003. message += ", got " + receivedType + " ";
  14004. // check if we need to specify received value
  14005. if (isExplicable(receivedType)) {
  14006. message += "with value " + receivedValue + ".";
  14007. }
  14008. return message
  14009. }
  14010. function styleValue (value, type) {
  14011. if (type === 'String') {
  14012. return ("\"" + value + "\"")
  14013. } else if (type === 'Number') {
  14014. return ("" + (Number(value)))
  14015. } else {
  14016. return ("" + value)
  14017. }
  14018. }
  14019. function isExplicable (value) {
  14020. var explicitTypes = ['string', 'number', 'boolean'];
  14021. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  14022. }
  14023. function isBoolean () {
  14024. var args = [], len = arguments.length;
  14025. while ( len-- ) args[ len ] = arguments[ len ];
  14026. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  14027. }
  14028. /* */
  14029. function handleError (err, vm, info) {
  14030. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  14031. // See: https://github.com/vuejs/vuex/issues/1505
  14032. pushTarget();
  14033. try {
  14034. if (vm) {
  14035. var cur = vm;
  14036. while ((cur = cur.$parent)) {
  14037. var hooks = cur.$options.errorCaptured;
  14038. if (hooks) {
  14039. for (var i = 0; i < hooks.length; i++) {
  14040. try {
  14041. var capture = hooks[i].call(cur, err, vm, info) === false;
  14042. if (capture) { return }
  14043. } catch (e) {
  14044. globalHandleError(e, cur, 'errorCaptured hook');
  14045. }
  14046. }
  14047. }
  14048. }
  14049. }
  14050. globalHandleError(err, vm, info);
  14051. } finally {
  14052. popTarget();
  14053. }
  14054. }
  14055. function invokeWithErrorHandling (
  14056. handler,
  14057. context,
  14058. args,
  14059. vm,
  14060. info
  14061. ) {
  14062. var res;
  14063. try {
  14064. res = args ? handler.apply(context, args) : handler.call(context);
  14065. if (res && !res._isVue && isPromise(res) && !res._handled) {
  14066. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  14067. // issue #9511
  14068. // avoid catch triggering multiple times when nested calls
  14069. res._handled = true;
  14070. }
  14071. } catch (e) {
  14072. handleError(e, vm, info);
  14073. }
  14074. return res
  14075. }
  14076. function globalHandleError (err, vm, info) {
  14077. if (config.errorHandler) {
  14078. try {
  14079. return config.errorHandler.call(null, err, vm, info)
  14080. } catch (e) {
  14081. // if the user intentionally throws the original error in the handler,
  14082. // do not log it twice
  14083. if (e !== err) {
  14084. logError(e, null, 'config.errorHandler');
  14085. }
  14086. }
  14087. }
  14088. logError(err, vm, info);
  14089. }
  14090. function logError (err, vm, info) {
  14091. if (true) {
  14092. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  14093. }
  14094. /* istanbul ignore else */
  14095. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  14096. console.error(err);
  14097. } else {
  14098. throw err
  14099. }
  14100. }
  14101. /* */
  14102. var callbacks = [];
  14103. var pending = false;
  14104. function flushCallbacks () {
  14105. pending = false;
  14106. var copies = callbacks.slice(0);
  14107. callbacks.length = 0;
  14108. for (var i = 0; i < copies.length; i++) {
  14109. copies[i]();
  14110. }
  14111. }
  14112. // Here we have async deferring wrappers using microtasks.
  14113. // In 2.5 we used (macro) tasks (in combination with microtasks).
  14114. // However, it has subtle problems when state is changed right before repaint
  14115. // (e.g. #6813, out-in transitions).
  14116. // Also, using (macro) tasks in event handler would cause some weird behaviors
  14117. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  14118. // So we now use microtasks everywhere, again.
  14119. // A major drawback of this tradeoff is that there are some scenarios
  14120. // where microtasks have too high a priority and fire in between supposedly
  14121. // sequential events (e.g. #4521, #6690, which have workarounds)
  14122. // or even between bubbling of the same event (#6566).
  14123. var timerFunc;
  14124. // The nextTick behavior leverages the microtask queue, which can be accessed
  14125. // via either native Promise.then or MutationObserver.
  14126. // MutationObserver has wider support, however it is seriously bugged in
  14127. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  14128. // completely stops working after triggering a few times... so, if native
  14129. // Promise is available, we will use it:
  14130. /* istanbul ignore next, $flow-disable-line */
  14131. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  14132. var p = Promise.resolve();
  14133. timerFunc = function () {
  14134. p.then(flushCallbacks);
  14135. // In problematic UIWebViews, Promise.then doesn't completely break, but
  14136. // it can get stuck in a weird state where callbacks are pushed into the
  14137. // microtask queue but the queue isn't being flushed, until the browser
  14138. // needs to do some other work, e.g. handle a timer. Therefore we can
  14139. // "force" the microtask queue to be flushed by adding an empty timer.
  14140. if (isIOS) { setTimeout(noop); }
  14141. };
  14142. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  14143. isNative(MutationObserver) ||
  14144. // PhantomJS and iOS 7.x
  14145. MutationObserver.toString() === '[object MutationObserverConstructor]'
  14146. )) {
  14147. // Use MutationObserver where native Promise is not available,
  14148. // e.g. PhantomJS, iOS7, Android 4.4
  14149. // (#6466 MutationObserver is unreliable in IE11)
  14150. var counter = 1;
  14151. var observer = new MutationObserver(flushCallbacks);
  14152. var textNode = document.createTextNode(String(counter));
  14153. observer.observe(textNode, {
  14154. characterData: true
  14155. });
  14156. timerFunc = function () {
  14157. counter = (counter + 1) % 2;
  14158. textNode.data = String(counter);
  14159. };
  14160. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  14161. // Fallback to setImmediate.
  14162. // Technically it leverages the (macro) task queue,
  14163. // but it is still a better choice than setTimeout.
  14164. timerFunc = function () {
  14165. setImmediate(flushCallbacks);
  14166. };
  14167. } else {
  14168. // Fallback to setTimeout.
  14169. timerFunc = function () {
  14170. setTimeout(flushCallbacks, 0);
  14171. };
  14172. }
  14173. function nextTick (cb, ctx) {
  14174. var _resolve;
  14175. callbacks.push(function () {
  14176. if (cb) {
  14177. try {
  14178. cb.call(ctx);
  14179. } catch (e) {
  14180. handleError(e, ctx, 'nextTick');
  14181. }
  14182. } else if (_resolve) {
  14183. _resolve(ctx);
  14184. }
  14185. });
  14186. if (!pending) {
  14187. pending = true;
  14188. timerFunc();
  14189. }
  14190. // $flow-disable-line
  14191. if (!cb && typeof Promise !== 'undefined') {
  14192. return new Promise(function (resolve) {
  14193. _resolve = resolve;
  14194. })
  14195. }
  14196. }
  14197. /* */
  14198. /* not type checking this file because flow doesn't play well with Proxy */
  14199. var initProxy;
  14200. if (true) {
  14201. var allowedGlobals = makeMap(
  14202. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  14203. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  14204. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  14205. 'require' // for Webpack/Browserify
  14206. );
  14207. var warnNonPresent = function (target, key) {
  14208. warn(
  14209. "Property or method \"" + key + "\" is not defined on the instance but " +
  14210. 'referenced during render. Make sure that this property is reactive, ' +
  14211. 'either in the data option, or for class-based components, by ' +
  14212. 'initializing the property. ' +
  14213. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  14214. target
  14215. );
  14216. };
  14217. var warnReservedPrefix = function (target, key) {
  14218. warn(
  14219. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  14220. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  14221. 'prevent conflicts with Vue internals. ' +
  14222. 'See: https://vuejs.org/v2/api/#data',
  14223. target
  14224. );
  14225. };
  14226. var hasProxy =
  14227. typeof Proxy !== 'undefined' && isNative(Proxy);
  14228. if (hasProxy) {
  14229. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  14230. config.keyCodes = new Proxy(config.keyCodes, {
  14231. set: function set (target, key, value) {
  14232. if (isBuiltInModifier(key)) {
  14233. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  14234. return false
  14235. } else {
  14236. target[key] = value;
  14237. return true
  14238. }
  14239. }
  14240. });
  14241. }
  14242. var hasHandler = {
  14243. has: function has (target, key) {
  14244. var has = key in target;
  14245. var isAllowed = allowedGlobals(key) ||
  14246. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  14247. if (!has && !isAllowed) {
  14248. if (key in target.$data) { warnReservedPrefix(target, key); }
  14249. else { warnNonPresent(target, key); }
  14250. }
  14251. return has || !isAllowed
  14252. }
  14253. };
  14254. var getHandler = {
  14255. get: function get (target, key) {
  14256. if (typeof key === 'string' && !(key in target)) {
  14257. if (key in target.$data) { warnReservedPrefix(target, key); }
  14258. else { warnNonPresent(target, key); }
  14259. }
  14260. return target[key]
  14261. }
  14262. };
  14263. initProxy = function initProxy (vm) {
  14264. if (hasProxy) {
  14265. // determine which proxy handler to use
  14266. var options = vm.$options;
  14267. var handlers = options.render && options.render._withStripped
  14268. ? getHandler
  14269. : hasHandler;
  14270. vm._renderProxy = new Proxy(vm, handlers);
  14271. } else {
  14272. vm._renderProxy = vm;
  14273. }
  14274. };
  14275. }
  14276. /* */
  14277. var seenObjects = new _Set();
  14278. /**
  14279. * Recursively traverse an object to evoke all converted
  14280. * getters, so that every nested property inside the object
  14281. * is collected as a "deep" dependency.
  14282. */
  14283. function traverse (val) {
  14284. _traverse(val, seenObjects);
  14285. seenObjects.clear();
  14286. }
  14287. function _traverse (val, seen) {
  14288. var i, keys;
  14289. var isA = Array.isArray(val);
  14290. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  14291. return
  14292. }
  14293. if (val.__ob__) {
  14294. var depId = val.__ob__.dep.id;
  14295. if (seen.has(depId)) {
  14296. return
  14297. }
  14298. seen.add(depId);
  14299. }
  14300. if (isA) {
  14301. i = val.length;
  14302. while (i--) { _traverse(val[i], seen); }
  14303. } else {
  14304. keys = Object.keys(val);
  14305. i = keys.length;
  14306. while (i--) { _traverse(val[keys[i]], seen); }
  14307. }
  14308. }
  14309. var mark;
  14310. var measure;
  14311. if (true) {
  14312. var perf = inBrowser && window.performance;
  14313. /* istanbul ignore if */
  14314. if (
  14315. perf &&
  14316. perf.mark &&
  14317. perf.measure &&
  14318. perf.clearMarks &&
  14319. perf.clearMeasures
  14320. ) {
  14321. mark = function (tag) { return perf.mark(tag); };
  14322. measure = function (name, startTag, endTag) {
  14323. perf.measure(name, startTag, endTag);
  14324. perf.clearMarks(startTag);
  14325. perf.clearMarks(endTag);
  14326. // perf.clearMeasures(name)
  14327. };
  14328. }
  14329. }
  14330. /* */
  14331. var normalizeEvent = cached(function (name) {
  14332. var passive = name.charAt(0) === '&';
  14333. name = passive ? name.slice(1) : name;
  14334. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  14335. name = once$$1 ? name.slice(1) : name;
  14336. var capture = name.charAt(0) === '!';
  14337. name = capture ? name.slice(1) : name;
  14338. return {
  14339. name: name,
  14340. once: once$$1,
  14341. capture: capture,
  14342. passive: passive
  14343. }
  14344. });
  14345. function createFnInvoker (fns, vm) {
  14346. function invoker () {
  14347. var arguments$1 = arguments;
  14348. var fns = invoker.fns;
  14349. if (Array.isArray(fns)) {
  14350. var cloned = fns.slice();
  14351. for (var i = 0; i < cloned.length; i++) {
  14352. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  14353. }
  14354. } else {
  14355. // return handler return value for single handlers
  14356. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  14357. }
  14358. }
  14359. invoker.fns = fns;
  14360. return invoker
  14361. }
  14362. function updateListeners (
  14363. on,
  14364. oldOn,
  14365. add,
  14366. remove$$1,
  14367. createOnceHandler,
  14368. vm
  14369. ) {
  14370. var name, def$$1, cur, old, event;
  14371. for (name in on) {
  14372. def$$1 = cur = on[name];
  14373. old = oldOn[name];
  14374. event = normalizeEvent(name);
  14375. if (isUndef(cur)) {
  14376. true && warn(
  14377. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  14378. vm
  14379. );
  14380. } else if (isUndef(old)) {
  14381. if (isUndef(cur.fns)) {
  14382. cur = on[name] = createFnInvoker(cur, vm);
  14383. }
  14384. if (isTrue(event.once)) {
  14385. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  14386. }
  14387. add(event.name, cur, event.capture, event.passive, event.params);
  14388. } else if (cur !== old) {
  14389. old.fns = cur;
  14390. on[name] = old;
  14391. }
  14392. }
  14393. for (name in oldOn) {
  14394. if (isUndef(on[name])) {
  14395. event = normalizeEvent(name);
  14396. remove$$1(event.name, oldOn[name], event.capture);
  14397. }
  14398. }
  14399. }
  14400. /* */
  14401. /* */
  14402. // fixed by xxxxxx (mp properties)
  14403. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  14404. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  14405. if (isUndef(propOptions)) {
  14406. return res
  14407. }
  14408. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  14409. var attrs = data.attrs;
  14410. var props = data.props;
  14411. if (isDef(attrs) || isDef(props)) {
  14412. for (var key in propOptions) {
  14413. var altKey = hyphenate(key);
  14414. var result = checkProp(res, props, key, altKey, true) ||
  14415. checkProp(res, attrs, key, altKey, false);
  14416. // externalClass
  14417. if (
  14418. result &&
  14419. res[key] &&
  14420. externalClasses.indexOf(altKey) !== -1 &&
  14421. context[camelize(res[key])]
  14422. ) {
  14423. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  14424. res[key] = context[camelize(res[key])];
  14425. }
  14426. }
  14427. }
  14428. return res
  14429. }
  14430. function extractPropsFromVNodeData (
  14431. data,
  14432. Ctor,
  14433. tag,
  14434. context// fixed by xxxxxx
  14435. ) {
  14436. // we are only extracting raw values here.
  14437. // validation and default values are handled in the child
  14438. // component itself.
  14439. var propOptions = Ctor.options.props;
  14440. if (isUndef(propOptions)) {
  14441. // fixed by xxxxxx
  14442. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  14443. }
  14444. var res = {};
  14445. var attrs = data.attrs;
  14446. var props = data.props;
  14447. if (isDef(attrs) || isDef(props)) {
  14448. for (var key in propOptions) {
  14449. var altKey = hyphenate(key);
  14450. if (true) {
  14451. var keyInLowerCase = key.toLowerCase();
  14452. if (
  14453. key !== keyInLowerCase &&
  14454. attrs && hasOwn(attrs, keyInLowerCase)
  14455. ) {
  14456. tip(
  14457. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  14458. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  14459. " \"" + key + "\". " +
  14460. "Note that HTML attributes are case-insensitive and camelCased " +
  14461. "props need to use their kebab-case equivalents when using in-DOM " +
  14462. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  14463. );
  14464. }
  14465. }
  14466. checkProp(res, props, key, altKey, true) ||
  14467. checkProp(res, attrs, key, altKey, false);
  14468. }
  14469. }
  14470. // fixed by xxxxxx
  14471. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  14472. }
  14473. function checkProp (
  14474. res,
  14475. hash,
  14476. key,
  14477. altKey,
  14478. preserve
  14479. ) {
  14480. if (isDef(hash)) {
  14481. if (hasOwn(hash, key)) {
  14482. res[key] = hash[key];
  14483. if (!preserve) {
  14484. delete hash[key];
  14485. }
  14486. return true
  14487. } else if (hasOwn(hash, altKey)) {
  14488. res[key] = hash[altKey];
  14489. if (!preserve) {
  14490. delete hash[altKey];
  14491. }
  14492. return true
  14493. }
  14494. }
  14495. return false
  14496. }
  14497. /* */
  14498. // The template compiler attempts to minimize the need for normalization by
  14499. // statically analyzing the template at compile time.
  14500. //
  14501. // For plain HTML markup, normalization can be completely skipped because the
  14502. // generated render function is guaranteed to return Array<VNode>. There are
  14503. // two cases where extra normalization is needed:
  14504. // 1. When the children contains components - because a functional component
  14505. // may return an Array instead of a single root. In this case, just a simple
  14506. // normalization is needed - if any child is an Array, we flatten the whole
  14507. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  14508. // because functional components already normalize their own children.
  14509. function simpleNormalizeChildren (children) {
  14510. for (var i = 0; i < children.length; i++) {
  14511. if (Array.isArray(children[i])) {
  14512. return Array.prototype.concat.apply([], children)
  14513. }
  14514. }
  14515. return children
  14516. }
  14517. // 2. When the children contains constructs that always generated nested Arrays,
  14518. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  14519. // with hand-written render functions / JSX. In such cases a full normalization
  14520. // is needed to cater to all possible types of children values.
  14521. function normalizeChildren (children) {
  14522. return isPrimitive(children)
  14523. ? [createTextVNode(children)]
  14524. : Array.isArray(children)
  14525. ? normalizeArrayChildren(children)
  14526. : undefined
  14527. }
  14528. function isTextNode (node) {
  14529. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  14530. }
  14531. function normalizeArrayChildren (children, nestedIndex) {
  14532. var res = [];
  14533. var i, c, lastIndex, last;
  14534. for (i = 0; i < children.length; i++) {
  14535. c = children[i];
  14536. if (isUndef(c) || typeof c === 'boolean') { continue }
  14537. lastIndex = res.length - 1;
  14538. last = res[lastIndex];
  14539. // nested
  14540. if (Array.isArray(c)) {
  14541. if (c.length > 0) {
  14542. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  14543. // merge adjacent text nodes
  14544. if (isTextNode(c[0]) && isTextNode(last)) {
  14545. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  14546. c.shift();
  14547. }
  14548. res.push.apply(res, c);
  14549. }
  14550. } else if (isPrimitive(c)) {
  14551. if (isTextNode(last)) {
  14552. // merge adjacent text nodes
  14553. // this is necessary for SSR hydration because text nodes are
  14554. // essentially merged when rendered to HTML strings
  14555. res[lastIndex] = createTextVNode(last.text + c);
  14556. } else if (c !== '') {
  14557. // convert primitive to vnode
  14558. res.push(createTextVNode(c));
  14559. }
  14560. } else {
  14561. if (isTextNode(c) && isTextNode(last)) {
  14562. // merge adjacent text nodes
  14563. res[lastIndex] = createTextVNode(last.text + c.text);
  14564. } else {
  14565. // default key for nested array children (likely generated by v-for)
  14566. if (isTrue(children._isVList) &&
  14567. isDef(c.tag) &&
  14568. isUndef(c.key) &&
  14569. isDef(nestedIndex)) {
  14570. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  14571. }
  14572. res.push(c);
  14573. }
  14574. }
  14575. }
  14576. return res
  14577. }
  14578. /* */
  14579. function initProvide (vm) {
  14580. var provide = vm.$options.provide;
  14581. if (provide) {
  14582. vm._provided = typeof provide === 'function'
  14583. ? provide.call(vm)
  14584. : provide;
  14585. }
  14586. }
  14587. function initInjections (vm) {
  14588. var result = resolveInject(vm.$options.inject, vm);
  14589. if (result) {
  14590. toggleObserving(false);
  14591. Object.keys(result).forEach(function (key) {
  14592. /* istanbul ignore else */
  14593. if (true) {
  14594. defineReactive$$1(vm, key, result[key], function () {
  14595. warn(
  14596. "Avoid mutating an injected value directly since the changes will be " +
  14597. "overwritten whenever the provided component re-renders. " +
  14598. "injection being mutated: \"" + key + "\"",
  14599. vm
  14600. );
  14601. });
  14602. } else {}
  14603. });
  14604. toggleObserving(true);
  14605. }
  14606. }
  14607. function resolveInject (inject, vm) {
  14608. if (inject) {
  14609. // inject is :any because flow is not smart enough to figure out cached
  14610. var result = Object.create(null);
  14611. var keys = hasSymbol
  14612. ? Reflect.ownKeys(inject)
  14613. : Object.keys(inject);
  14614. for (var i = 0; i < keys.length; i++) {
  14615. var key = keys[i];
  14616. // #6574 in case the inject object is observed...
  14617. if (key === '__ob__') { continue }
  14618. var provideKey = inject[key].from;
  14619. var source = vm;
  14620. while (source) {
  14621. if (source._provided && hasOwn(source._provided, provideKey)) {
  14622. result[key] = source._provided[provideKey];
  14623. break
  14624. }
  14625. source = source.$parent;
  14626. }
  14627. if (!source) {
  14628. if ('default' in inject[key]) {
  14629. var provideDefault = inject[key].default;
  14630. result[key] = typeof provideDefault === 'function'
  14631. ? provideDefault.call(vm)
  14632. : provideDefault;
  14633. } else if (true) {
  14634. warn(("Injection \"" + key + "\" not found"), vm);
  14635. }
  14636. }
  14637. }
  14638. return result
  14639. }
  14640. }
  14641. /* */
  14642. /**
  14643. * Runtime helper for resolving raw children VNodes into a slot object.
  14644. */
  14645. function resolveSlots (
  14646. children,
  14647. context
  14648. ) {
  14649. if (!children || !children.length) {
  14650. return {}
  14651. }
  14652. var slots = {};
  14653. for (var i = 0, l = children.length; i < l; i++) {
  14654. var child = children[i];
  14655. var data = child.data;
  14656. // remove slot attribute if the node is resolved as a Vue slot node
  14657. if (data && data.attrs && data.attrs.slot) {
  14658. delete data.attrs.slot;
  14659. }
  14660. // named slots should only be respected if the vnode was rendered in the
  14661. // same context.
  14662. if ((child.context === context || child.fnContext === context) &&
  14663. data && data.slot != null
  14664. ) {
  14665. var name = data.slot;
  14666. var slot = (slots[name] || (slots[name] = []));
  14667. if (child.tag === 'template') {
  14668. slot.push.apply(slot, child.children || []);
  14669. } else {
  14670. slot.push(child);
  14671. }
  14672. } else {
  14673. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  14674. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  14675. (slots['page'] || (slots['page'] = [])).push(child);
  14676. }else{
  14677. (slots.default || (slots.default = [])).push(child);
  14678. }
  14679. }
  14680. }
  14681. // ignore slots that contains only whitespace
  14682. for (var name$1 in slots) {
  14683. if (slots[name$1].every(isWhitespace)) {
  14684. delete slots[name$1];
  14685. }
  14686. }
  14687. return slots
  14688. }
  14689. function isWhitespace (node) {
  14690. return (node.isComment && !node.asyncFactory) || node.text === ' '
  14691. }
  14692. /* */
  14693. function normalizeScopedSlots (
  14694. slots,
  14695. normalSlots,
  14696. prevSlots
  14697. ) {
  14698. var res;
  14699. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  14700. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  14701. var key = slots && slots.$key;
  14702. if (!slots) {
  14703. res = {};
  14704. } else if (slots._normalized) {
  14705. // fast path 1: child component re-render only, parent did not change
  14706. return slots._normalized
  14707. } else if (
  14708. isStable &&
  14709. prevSlots &&
  14710. prevSlots !== emptyObject &&
  14711. key === prevSlots.$key &&
  14712. !hasNormalSlots &&
  14713. !prevSlots.$hasNormal
  14714. ) {
  14715. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  14716. // only need to normalize once
  14717. return prevSlots
  14718. } else {
  14719. res = {};
  14720. for (var key$1 in slots) {
  14721. if (slots[key$1] && key$1[0] !== '$') {
  14722. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  14723. }
  14724. }
  14725. }
  14726. // expose normal slots on scopedSlots
  14727. for (var key$2 in normalSlots) {
  14728. if (!(key$2 in res)) {
  14729. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  14730. }
  14731. }
  14732. // avoriaz seems to mock a non-extensible $scopedSlots object
  14733. // and when that is passed down this would cause an error
  14734. if (slots && Object.isExtensible(slots)) {
  14735. (slots)._normalized = res;
  14736. }
  14737. def(res, '$stable', isStable);
  14738. def(res, '$key', key);
  14739. def(res, '$hasNormal', hasNormalSlots);
  14740. return res
  14741. }
  14742. function normalizeScopedSlot(normalSlots, key, fn) {
  14743. var normalized = function () {
  14744. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  14745. res = res && typeof res === 'object' && !Array.isArray(res)
  14746. ? [res] // single vnode
  14747. : normalizeChildren(res);
  14748. return res && (
  14749. res.length === 0 ||
  14750. (res.length === 1 && res[0].isComment) // #9658
  14751. ) ? undefined
  14752. : res
  14753. };
  14754. // this is a slot using the new v-slot syntax without scope. although it is
  14755. // compiled as a scoped slot, render fn users would expect it to be present
  14756. // on this.$slots because the usage is semantically a normal slot.
  14757. if (fn.proxy) {
  14758. Object.defineProperty(normalSlots, key, {
  14759. get: normalized,
  14760. enumerable: true,
  14761. configurable: true
  14762. });
  14763. }
  14764. return normalized
  14765. }
  14766. function proxyNormalSlot(slots, key) {
  14767. return function () { return slots[key]; }
  14768. }
  14769. /* */
  14770. /**
  14771. * Runtime helper for rendering v-for lists.
  14772. */
  14773. function renderList (
  14774. val,
  14775. render
  14776. ) {
  14777. var ret, i, l, keys, key;
  14778. if (Array.isArray(val) || typeof val === 'string') {
  14779. ret = new Array(val.length);
  14780. for (i = 0, l = val.length; i < l; i++) {
  14781. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  14782. }
  14783. } else if (typeof val === 'number') {
  14784. ret = new Array(val);
  14785. for (i = 0; i < val; i++) {
  14786. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  14787. }
  14788. } else if (isObject(val)) {
  14789. if (hasSymbol && val[Symbol.iterator]) {
  14790. ret = [];
  14791. var iterator = val[Symbol.iterator]();
  14792. var result = iterator.next();
  14793. while (!result.done) {
  14794. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  14795. result = iterator.next();
  14796. }
  14797. } else {
  14798. keys = Object.keys(val);
  14799. ret = new Array(keys.length);
  14800. for (i = 0, l = keys.length; i < l; i++) {
  14801. key = keys[i];
  14802. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  14803. }
  14804. }
  14805. }
  14806. if (!isDef(ret)) {
  14807. ret = [];
  14808. }
  14809. (ret)._isVList = true;
  14810. return ret
  14811. }
  14812. /* */
  14813. /**
  14814. * Runtime helper for rendering <slot>
  14815. */
  14816. function renderSlot (
  14817. name,
  14818. fallback,
  14819. props,
  14820. bindObject
  14821. ) {
  14822. var scopedSlotFn = this.$scopedSlots[name];
  14823. var nodes;
  14824. if (scopedSlotFn) { // scoped slot
  14825. props = props || {};
  14826. if (bindObject) {
  14827. if ( true && !isObject(bindObject)) {
  14828. warn(
  14829. 'slot v-bind without argument expects an Object',
  14830. this
  14831. );
  14832. }
  14833. props = extend(extend({}, bindObject), props);
  14834. }
  14835. // fixed by xxxxxx app-plus scopedSlot
  14836. nodes = scopedSlotFn(props, this, props._i) || fallback;
  14837. } else {
  14838. nodes = this.$slots[name] || fallback;
  14839. }
  14840. var target = props && props.slot;
  14841. if (target) {
  14842. return this.$createElement('template', { slot: target }, nodes)
  14843. } else {
  14844. return nodes
  14845. }
  14846. }
  14847. /* */
  14848. /**
  14849. * Runtime helper for resolving filters
  14850. */
  14851. function resolveFilter (id) {
  14852. return resolveAsset(this.$options, 'filters', id, true) || identity
  14853. }
  14854. /* */
  14855. function isKeyNotMatch (expect, actual) {
  14856. if (Array.isArray(expect)) {
  14857. return expect.indexOf(actual) === -1
  14858. } else {
  14859. return expect !== actual
  14860. }
  14861. }
  14862. /**
  14863. * Runtime helper for checking keyCodes from config.
  14864. * exposed as Vue.prototype._k
  14865. * passing in eventKeyName as last argument separately for backwards compat
  14866. */
  14867. function checkKeyCodes (
  14868. eventKeyCode,
  14869. key,
  14870. builtInKeyCode,
  14871. eventKeyName,
  14872. builtInKeyName
  14873. ) {
  14874. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  14875. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  14876. return isKeyNotMatch(builtInKeyName, eventKeyName)
  14877. } else if (mappedKeyCode) {
  14878. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  14879. } else if (eventKeyName) {
  14880. return hyphenate(eventKeyName) !== key
  14881. }
  14882. }
  14883. /* */
  14884. /**
  14885. * Runtime helper for merging v-bind="object" into a VNode's data.
  14886. */
  14887. function bindObjectProps (
  14888. data,
  14889. tag,
  14890. value,
  14891. asProp,
  14892. isSync
  14893. ) {
  14894. if (value) {
  14895. if (!isObject(value)) {
  14896. true && warn(
  14897. 'v-bind without argument expects an Object or Array value',
  14898. this
  14899. );
  14900. } else {
  14901. if (Array.isArray(value)) {
  14902. value = toObject(value);
  14903. }
  14904. var hash;
  14905. var loop = function ( key ) {
  14906. if (
  14907. key === 'class' ||
  14908. key === 'style' ||
  14909. isReservedAttribute(key)
  14910. ) {
  14911. hash = data;
  14912. } else {
  14913. var type = data.attrs && data.attrs.type;
  14914. hash = asProp || config.mustUseProp(tag, type, key)
  14915. ? data.domProps || (data.domProps = {})
  14916. : data.attrs || (data.attrs = {});
  14917. }
  14918. var camelizedKey = camelize(key);
  14919. var hyphenatedKey = hyphenate(key);
  14920. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  14921. hash[key] = value[key];
  14922. if (isSync) {
  14923. var on = data.on || (data.on = {});
  14924. on[("update:" + key)] = function ($event) {
  14925. value[key] = $event;
  14926. };
  14927. }
  14928. }
  14929. };
  14930. for (var key in value) loop( key );
  14931. }
  14932. }
  14933. return data
  14934. }
  14935. /* */
  14936. /**
  14937. * Runtime helper for rendering static trees.
  14938. */
  14939. function renderStatic (
  14940. index,
  14941. isInFor
  14942. ) {
  14943. var cached = this._staticTrees || (this._staticTrees = []);
  14944. var tree = cached[index];
  14945. // if has already-rendered static tree and not inside v-for,
  14946. // we can reuse the same tree.
  14947. if (tree && !isInFor) {
  14948. return tree
  14949. }
  14950. // otherwise, render a fresh tree.
  14951. tree = cached[index] = this.$options.staticRenderFns[index].call(
  14952. this._renderProxy,
  14953. null,
  14954. this // for render fns generated for functional component templates
  14955. );
  14956. markStatic(tree, ("__static__" + index), false);
  14957. return tree
  14958. }
  14959. /**
  14960. * Runtime helper for v-once.
  14961. * Effectively it means marking the node as static with a unique key.
  14962. */
  14963. function markOnce (
  14964. tree,
  14965. index,
  14966. key
  14967. ) {
  14968. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  14969. return tree
  14970. }
  14971. function markStatic (
  14972. tree,
  14973. key,
  14974. isOnce
  14975. ) {
  14976. if (Array.isArray(tree)) {
  14977. for (var i = 0; i < tree.length; i++) {
  14978. if (tree[i] && typeof tree[i] !== 'string') {
  14979. markStaticNode(tree[i], (key + "_" + i), isOnce);
  14980. }
  14981. }
  14982. } else {
  14983. markStaticNode(tree, key, isOnce);
  14984. }
  14985. }
  14986. function markStaticNode (node, key, isOnce) {
  14987. node.isStatic = true;
  14988. node.key = key;
  14989. node.isOnce = isOnce;
  14990. }
  14991. /* */
  14992. function bindObjectListeners (data, value) {
  14993. if (value) {
  14994. if (!isPlainObject(value)) {
  14995. true && warn(
  14996. 'v-on without argument expects an Object value',
  14997. this
  14998. );
  14999. } else {
  15000. var on = data.on = data.on ? extend({}, data.on) : {};
  15001. for (var key in value) {
  15002. var existing = on[key];
  15003. var ours = value[key];
  15004. on[key] = existing ? [].concat(existing, ours) : ours;
  15005. }
  15006. }
  15007. }
  15008. return data
  15009. }
  15010. /* */
  15011. function resolveScopedSlots (
  15012. fns, // see flow/vnode
  15013. res,
  15014. // the following are added in 2.6
  15015. hasDynamicKeys,
  15016. contentHashKey
  15017. ) {
  15018. res = res || { $stable: !hasDynamicKeys };
  15019. for (var i = 0; i < fns.length; i++) {
  15020. var slot = fns[i];
  15021. if (Array.isArray(slot)) {
  15022. resolveScopedSlots(slot, res, hasDynamicKeys);
  15023. } else if (slot) {
  15024. // marker for reverse proxying v-slot without scope on this.$slots
  15025. if (slot.proxy) {
  15026. slot.fn.proxy = true;
  15027. }
  15028. res[slot.key] = slot.fn;
  15029. }
  15030. }
  15031. if (contentHashKey) {
  15032. (res).$key = contentHashKey;
  15033. }
  15034. return res
  15035. }
  15036. /* */
  15037. function bindDynamicKeys (baseObj, values) {
  15038. for (var i = 0; i < values.length; i += 2) {
  15039. var key = values[i];
  15040. if (typeof key === 'string' && key) {
  15041. baseObj[values[i]] = values[i + 1];
  15042. } else if ( true && key !== '' && key !== null) {
  15043. // null is a special value for explicitly removing a binding
  15044. warn(
  15045. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  15046. this
  15047. );
  15048. }
  15049. }
  15050. return baseObj
  15051. }
  15052. // helper to dynamically append modifier runtime markers to event names.
  15053. // ensure only append when value is already string, otherwise it will be cast
  15054. // to string and cause the type check to miss.
  15055. function prependModifier (value, symbol) {
  15056. return typeof value === 'string' ? symbol + value : value
  15057. }
  15058. /* */
  15059. function installRenderHelpers (target) {
  15060. target._o = markOnce;
  15061. target._n = toNumber;
  15062. target._s = toString;
  15063. target._l = renderList;
  15064. target._t = renderSlot;
  15065. target._q = looseEqual;
  15066. target._i = looseIndexOf;
  15067. target._m = renderStatic;
  15068. target._f = resolveFilter;
  15069. target._k = checkKeyCodes;
  15070. target._b = bindObjectProps;
  15071. target._v = createTextVNode;
  15072. target._e = createEmptyVNode;
  15073. target._u = resolveScopedSlots;
  15074. target._g = bindObjectListeners;
  15075. target._d = bindDynamicKeys;
  15076. target._p = prependModifier;
  15077. }
  15078. /* */
  15079. function FunctionalRenderContext (
  15080. data,
  15081. props,
  15082. children,
  15083. parent,
  15084. Ctor
  15085. ) {
  15086. var this$1 = this;
  15087. var options = Ctor.options;
  15088. // ensure the createElement function in functional components
  15089. // gets a unique context - this is necessary for correct named slot check
  15090. var contextVm;
  15091. if (hasOwn(parent, '_uid')) {
  15092. contextVm = Object.create(parent);
  15093. // $flow-disable-line
  15094. contextVm._original = parent;
  15095. } else {
  15096. // the context vm passed in is a functional context as well.
  15097. // in this case we want to make sure we are able to get a hold to the
  15098. // real context instance.
  15099. contextVm = parent;
  15100. // $flow-disable-line
  15101. parent = parent._original;
  15102. }
  15103. var isCompiled = isTrue(options._compiled);
  15104. var needNormalization = !isCompiled;
  15105. this.data = data;
  15106. this.props = props;
  15107. this.children = children;
  15108. this.parent = parent;
  15109. this.listeners = data.on || emptyObject;
  15110. this.injections = resolveInject(options.inject, parent);
  15111. this.slots = function () {
  15112. if (!this$1.$slots) {
  15113. normalizeScopedSlots(
  15114. data.scopedSlots,
  15115. this$1.$slots = resolveSlots(children, parent)
  15116. );
  15117. }
  15118. return this$1.$slots
  15119. };
  15120. Object.defineProperty(this, 'scopedSlots', ({
  15121. enumerable: true,
  15122. get: function get () {
  15123. return normalizeScopedSlots(data.scopedSlots, this.slots())
  15124. }
  15125. }));
  15126. // support for compiled functional template
  15127. if (isCompiled) {
  15128. // exposing $options for renderStatic()
  15129. this.$options = options;
  15130. // pre-resolve slots for renderSlot()
  15131. this.$slots = this.slots();
  15132. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  15133. }
  15134. if (options._scopeId) {
  15135. this._c = function (a, b, c, d) {
  15136. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  15137. if (vnode && !Array.isArray(vnode)) {
  15138. vnode.fnScopeId = options._scopeId;
  15139. vnode.fnContext = parent;
  15140. }
  15141. return vnode
  15142. };
  15143. } else {
  15144. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  15145. }
  15146. }
  15147. installRenderHelpers(FunctionalRenderContext.prototype);
  15148. function createFunctionalComponent (
  15149. Ctor,
  15150. propsData,
  15151. data,
  15152. contextVm,
  15153. children
  15154. ) {
  15155. var options = Ctor.options;
  15156. var props = {};
  15157. var propOptions = options.props;
  15158. if (isDef(propOptions)) {
  15159. for (var key in propOptions) {
  15160. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  15161. }
  15162. } else {
  15163. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  15164. if (isDef(data.props)) { mergeProps(props, data.props); }
  15165. }
  15166. var renderContext = new FunctionalRenderContext(
  15167. data,
  15168. props,
  15169. children,
  15170. contextVm,
  15171. Ctor
  15172. );
  15173. var vnode = options.render.call(null, renderContext._c, renderContext);
  15174. if (vnode instanceof VNode) {
  15175. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  15176. } else if (Array.isArray(vnode)) {
  15177. var vnodes = normalizeChildren(vnode) || [];
  15178. var res = new Array(vnodes.length);
  15179. for (var i = 0; i < vnodes.length; i++) {
  15180. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  15181. }
  15182. return res
  15183. }
  15184. }
  15185. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  15186. // #7817 clone node before setting fnContext, otherwise if the node is reused
  15187. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  15188. // that should not be matched to match.
  15189. var clone = cloneVNode(vnode);
  15190. clone.fnContext = contextVm;
  15191. clone.fnOptions = options;
  15192. if (true) {
  15193. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  15194. }
  15195. if (data.slot) {
  15196. (clone.data || (clone.data = {})).slot = data.slot;
  15197. }
  15198. return clone
  15199. }
  15200. function mergeProps (to, from) {
  15201. for (var key in from) {
  15202. to[camelize(key)] = from[key];
  15203. }
  15204. }
  15205. /* */
  15206. /* */
  15207. /* */
  15208. /* */
  15209. // inline hooks to be invoked on component VNodes during patch
  15210. var componentVNodeHooks = {
  15211. init: function init (vnode, hydrating) {
  15212. if (
  15213. vnode.componentInstance &&
  15214. !vnode.componentInstance._isDestroyed &&
  15215. vnode.data.keepAlive
  15216. ) {
  15217. // kept-alive components, treat as a patch
  15218. var mountedNode = vnode; // work around flow
  15219. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  15220. } else {
  15221. var child = vnode.componentInstance = createComponentInstanceForVnode(
  15222. vnode,
  15223. activeInstance
  15224. );
  15225. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  15226. }
  15227. },
  15228. prepatch: function prepatch (oldVnode, vnode) {
  15229. var options = vnode.componentOptions;
  15230. var child = vnode.componentInstance = oldVnode.componentInstance;
  15231. updateChildComponent(
  15232. child,
  15233. options.propsData, // updated props
  15234. options.listeners, // updated listeners
  15235. vnode, // new parent vnode
  15236. options.children // new children
  15237. );
  15238. },
  15239. insert: function insert (vnode) {
  15240. var context = vnode.context;
  15241. var componentInstance = vnode.componentInstance;
  15242. if (!componentInstance._isMounted) {
  15243. callHook(componentInstance, 'onServiceCreated');
  15244. callHook(componentInstance, 'onServiceAttached');
  15245. componentInstance._isMounted = true;
  15246. callHook(componentInstance, 'mounted');
  15247. }
  15248. if (vnode.data.keepAlive) {
  15249. if (context._isMounted) {
  15250. // vue-router#1212
  15251. // During updates, a kept-alive component's child components may
  15252. // change, so directly walking the tree here may call activated hooks
  15253. // on incorrect children. Instead we push them into a queue which will
  15254. // be processed after the whole patch process ended.
  15255. queueActivatedComponent(componentInstance);
  15256. } else {
  15257. activateChildComponent(componentInstance, true /* direct */);
  15258. }
  15259. }
  15260. },
  15261. destroy: function destroy (vnode) {
  15262. var componentInstance = vnode.componentInstance;
  15263. if (!componentInstance._isDestroyed) {
  15264. if (!vnode.data.keepAlive) {
  15265. componentInstance.$destroy();
  15266. } else {
  15267. deactivateChildComponent(componentInstance, true /* direct */);
  15268. }
  15269. }
  15270. }
  15271. };
  15272. var hooksToMerge = Object.keys(componentVNodeHooks);
  15273. function createComponent (
  15274. Ctor,
  15275. data,
  15276. context,
  15277. children,
  15278. tag
  15279. ) {
  15280. if (isUndef(Ctor)) {
  15281. return
  15282. }
  15283. var baseCtor = context.$options._base;
  15284. // plain options object: turn it into a constructor
  15285. if (isObject(Ctor)) {
  15286. Ctor = baseCtor.extend(Ctor);
  15287. }
  15288. // if at this stage it's not a constructor or an async component factory,
  15289. // reject.
  15290. if (typeof Ctor !== 'function') {
  15291. if (true) {
  15292. warn(("Invalid Component definition: " + (String(Ctor))), context);
  15293. }
  15294. return
  15295. }
  15296. // async component
  15297. var asyncFactory;
  15298. if (isUndef(Ctor.cid)) {
  15299. asyncFactory = Ctor;
  15300. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  15301. if (Ctor === undefined) {
  15302. // return a placeholder node for async component, which is rendered
  15303. // as a comment node but preserves all the raw information for the node.
  15304. // the information will be used for async server-rendering and hydration.
  15305. return createAsyncPlaceholder(
  15306. asyncFactory,
  15307. data,
  15308. context,
  15309. children,
  15310. tag
  15311. )
  15312. }
  15313. }
  15314. data = data || {};
  15315. // resolve constructor options in case global mixins are applied after
  15316. // component constructor creation
  15317. resolveConstructorOptions(Ctor);
  15318. // transform component v-model data into props & events
  15319. if (isDef(data.model)) {
  15320. transformModel(Ctor.options, data);
  15321. }
  15322. // extract props
  15323. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  15324. // functional component
  15325. if (isTrue(Ctor.options.functional)) {
  15326. return createFunctionalComponent(Ctor, propsData, data, context, children)
  15327. }
  15328. // extract listeners, since these needs to be treated as
  15329. // child component listeners instead of DOM listeners
  15330. var listeners = data.on;
  15331. // replace with listeners with .native modifier
  15332. // so it gets processed during parent component patch.
  15333. data.on = data.nativeOn;
  15334. if (isTrue(Ctor.options.abstract)) {
  15335. // abstract components do not keep anything
  15336. // other than props & listeners & slot
  15337. // work around flow
  15338. var slot = data.slot;
  15339. data = {};
  15340. if (slot) {
  15341. data.slot = slot;
  15342. }
  15343. }
  15344. // install component management hooks onto the placeholder node
  15345. installComponentHooks(data);
  15346. // return a placeholder vnode
  15347. var name = Ctor.options.name || tag;
  15348. var vnode = new VNode(
  15349. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  15350. data, undefined, undefined, undefined, context,
  15351. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  15352. asyncFactory
  15353. );
  15354. return vnode
  15355. }
  15356. function createComponentInstanceForVnode (
  15357. vnode, // we know it's MountedComponentVNode but flow doesn't
  15358. parent // activeInstance in lifecycle state
  15359. ) {
  15360. var options = {
  15361. _isComponent: true,
  15362. _parentVnode: vnode,
  15363. parent: parent
  15364. };
  15365. // check inline-template render functions
  15366. var inlineTemplate = vnode.data.inlineTemplate;
  15367. if (isDef(inlineTemplate)) {
  15368. options.render = inlineTemplate.render;
  15369. options.staticRenderFns = inlineTemplate.staticRenderFns;
  15370. }
  15371. return new vnode.componentOptions.Ctor(options)
  15372. }
  15373. function installComponentHooks (data) {
  15374. var hooks = data.hook || (data.hook = {});
  15375. for (var i = 0; i < hooksToMerge.length; i++) {
  15376. var key = hooksToMerge[i];
  15377. var existing = hooks[key];
  15378. var toMerge = componentVNodeHooks[key];
  15379. if (existing !== toMerge && !(existing && existing._merged)) {
  15380. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  15381. }
  15382. }
  15383. }
  15384. function mergeHook$1 (f1, f2) {
  15385. var merged = function (a, b) {
  15386. // flow complains about extra args which is why we use any
  15387. f1(a, b);
  15388. f2(a, b);
  15389. };
  15390. merged._merged = true;
  15391. return merged
  15392. }
  15393. // transform component v-model info (value and callback) into
  15394. // prop and event handler respectively.
  15395. function transformModel (options, data) {
  15396. var prop = (options.model && options.model.prop) || 'value';
  15397. var event = (options.model && options.model.event) || 'input'
  15398. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  15399. var on = data.on || (data.on = {});
  15400. var existing = on[event];
  15401. var callback = data.model.callback;
  15402. if (isDef(existing)) {
  15403. if (
  15404. Array.isArray(existing)
  15405. ? existing.indexOf(callback) === -1
  15406. : existing !== callback
  15407. ) {
  15408. on[event] = [callback].concat(existing);
  15409. }
  15410. } else {
  15411. on[event] = callback;
  15412. }
  15413. }
  15414. /* */
  15415. var SIMPLE_NORMALIZE = 1;
  15416. var ALWAYS_NORMALIZE = 2;
  15417. // wrapper function for providing a more flexible interface
  15418. // without getting yelled at by flow
  15419. function createElement (
  15420. context,
  15421. tag,
  15422. data,
  15423. children,
  15424. normalizationType,
  15425. alwaysNormalize
  15426. ) {
  15427. if (Array.isArray(data) || isPrimitive(data)) {
  15428. normalizationType = children;
  15429. children = data;
  15430. data = undefined;
  15431. }
  15432. if (isTrue(alwaysNormalize)) {
  15433. normalizationType = ALWAYS_NORMALIZE;
  15434. }
  15435. return _createElement(context, tag, data, children, normalizationType)
  15436. }
  15437. function _createElement (
  15438. context,
  15439. tag,
  15440. data,
  15441. children,
  15442. normalizationType
  15443. ) {
  15444. if (isDef(data) && isDef((data).__ob__)) {
  15445. true && warn(
  15446. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  15447. 'Always create fresh vnode data objects in each render!',
  15448. context
  15449. );
  15450. return createEmptyVNode()
  15451. }
  15452. // object syntax in v-bind
  15453. if (isDef(data) && isDef(data.is)) {
  15454. tag = data.is;
  15455. }
  15456. if (!tag) {
  15457. // in case of component :is set to falsy value
  15458. return createEmptyVNode()
  15459. }
  15460. // warn against non-primitive key
  15461. if ( true &&
  15462. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  15463. ) {
  15464. {
  15465. warn(
  15466. 'Avoid using non-primitive value as key, ' +
  15467. 'use string/number value instead.',
  15468. context
  15469. );
  15470. }
  15471. }
  15472. // support single function children as default scoped slot
  15473. if (Array.isArray(children) &&
  15474. typeof children[0] === 'function'
  15475. ) {
  15476. data = data || {};
  15477. data.scopedSlots = { default: children[0] };
  15478. children.length = 0;
  15479. }
  15480. if (normalizationType === ALWAYS_NORMALIZE) {
  15481. children = normalizeChildren(children);
  15482. } else if (normalizationType === SIMPLE_NORMALIZE) {
  15483. children = simpleNormalizeChildren(children);
  15484. }
  15485. var vnode, ns;
  15486. if (typeof tag === 'string') {
  15487. var Ctor;
  15488. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  15489. if (config.isReservedTag(tag)) {
  15490. // platform built-in elements
  15491. if ( true && isDef(data) && isDef(data.nativeOn)) {
  15492. warn(
  15493. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  15494. context
  15495. );
  15496. }
  15497. vnode = new VNode(
  15498. config.parsePlatformTagName(tag), data, children,
  15499. undefined, undefined, context
  15500. );
  15501. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  15502. // component
  15503. vnode = createComponent(Ctor, data, context, children, tag);
  15504. } else {
  15505. // unknown or unlisted namespaced elements
  15506. // check at runtime because it may get assigned a namespace when its
  15507. // parent normalizes children
  15508. vnode = new VNode(
  15509. tag, data, children,
  15510. undefined, undefined, context
  15511. );
  15512. }
  15513. } else {
  15514. // direct component options / constructor
  15515. vnode = createComponent(tag, data, context, children);
  15516. }
  15517. if (Array.isArray(vnode)) {
  15518. return vnode
  15519. } else if (isDef(vnode)) {
  15520. if (isDef(ns)) { applyNS(vnode, ns); }
  15521. if (isDef(data)) { registerDeepBindings(data); }
  15522. return vnode
  15523. } else {
  15524. return createEmptyVNode()
  15525. }
  15526. }
  15527. function applyNS (vnode, ns, force) {
  15528. vnode.ns = ns;
  15529. if (vnode.tag === 'foreignObject') {
  15530. // use default namespace inside foreignObject
  15531. ns = undefined;
  15532. force = true;
  15533. }
  15534. if (isDef(vnode.children)) {
  15535. for (var i = 0, l = vnode.children.length; i < l; i++) {
  15536. var child = vnode.children[i];
  15537. if (isDef(child.tag) && (
  15538. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  15539. applyNS(child, ns, force);
  15540. }
  15541. }
  15542. }
  15543. }
  15544. // ref #5318
  15545. // necessary to ensure parent re-render when deep bindings like :style and
  15546. // :class are used on slot nodes
  15547. function registerDeepBindings (data) {
  15548. if (isObject(data.style)) {
  15549. traverse(data.style);
  15550. }
  15551. if (isObject(data.class)) {
  15552. traverse(data.class);
  15553. }
  15554. }
  15555. /* */
  15556. function initRender (vm) {
  15557. vm._vnode = null; // the root of the child tree
  15558. vm._staticTrees = null; // v-once cached trees
  15559. var options = vm.$options;
  15560. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  15561. var renderContext = parentVnode && parentVnode.context;
  15562. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  15563. vm.$scopedSlots = emptyObject;
  15564. // bind the createElement fn to this instance
  15565. // so that we get proper render context inside it.
  15566. // args order: tag, data, children, normalizationType, alwaysNormalize
  15567. // internal version is used by render functions compiled from templates
  15568. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  15569. // normalization is always applied for the public version, used in
  15570. // user-written render functions.
  15571. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  15572. // $attrs & $listeners are exposed for easier HOC creation.
  15573. // they need to be reactive so that HOCs using them are always updated
  15574. var parentData = parentVnode && parentVnode.data;
  15575. /* istanbul ignore else */
  15576. if (true) {
  15577. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  15578. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  15579. }, true);
  15580. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  15581. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  15582. }, true);
  15583. } else {}
  15584. }
  15585. var currentRenderingInstance = null;
  15586. function renderMixin (Vue) {
  15587. // install runtime convenience helpers
  15588. installRenderHelpers(Vue.prototype);
  15589. Vue.prototype.$nextTick = function (fn) {
  15590. return nextTick(fn, this)
  15591. };
  15592. Vue.prototype._render = function () {
  15593. var vm = this;
  15594. var ref = vm.$options;
  15595. var render = ref.render;
  15596. var _parentVnode = ref._parentVnode;
  15597. if (_parentVnode) {
  15598. vm.$scopedSlots = normalizeScopedSlots(
  15599. _parentVnode.data.scopedSlots,
  15600. vm.$slots,
  15601. vm.$scopedSlots
  15602. );
  15603. }
  15604. // set parent vnode. this allows render functions to have access
  15605. // to the data on the placeholder node.
  15606. vm.$vnode = _parentVnode;
  15607. // render self
  15608. var vnode;
  15609. try {
  15610. // There's no need to maintain a stack because all render fns are called
  15611. // separately from one another. Nested component's render fns are called
  15612. // when parent component is patched.
  15613. currentRenderingInstance = vm;
  15614. vnode = render.call(vm._renderProxy, vm.$createElement);
  15615. } catch (e) {
  15616. handleError(e, vm, "render");
  15617. // return error render result,
  15618. // or previous vnode to prevent render error causing blank component
  15619. /* istanbul ignore else */
  15620. if ( true && vm.$options.renderError) {
  15621. try {
  15622. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  15623. } catch (e) {
  15624. handleError(e, vm, "renderError");
  15625. vnode = vm._vnode;
  15626. }
  15627. } else {
  15628. vnode = vm._vnode;
  15629. }
  15630. } finally {
  15631. currentRenderingInstance = null;
  15632. }
  15633. // if the returned array contains only a single node, allow it
  15634. if (Array.isArray(vnode) && vnode.length === 1) {
  15635. vnode = vnode[0];
  15636. }
  15637. // return empty vnode in case the render function errored out
  15638. if (!(vnode instanceof VNode)) {
  15639. if ( true && Array.isArray(vnode)) {
  15640. warn(
  15641. 'Multiple root nodes returned from render function. Render function ' +
  15642. 'should return a single root node.',
  15643. vm
  15644. );
  15645. }
  15646. vnode = createEmptyVNode();
  15647. }
  15648. // set parent
  15649. vnode.parent = _parentVnode;
  15650. return vnode
  15651. };
  15652. }
  15653. /* */
  15654. function ensureCtor (comp, base) {
  15655. if (
  15656. comp.__esModule ||
  15657. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  15658. ) {
  15659. comp = comp.default;
  15660. }
  15661. return isObject(comp)
  15662. ? base.extend(comp)
  15663. : comp
  15664. }
  15665. function createAsyncPlaceholder (
  15666. factory,
  15667. data,
  15668. context,
  15669. children,
  15670. tag
  15671. ) {
  15672. var node = createEmptyVNode();
  15673. node.asyncFactory = factory;
  15674. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  15675. return node
  15676. }
  15677. function resolveAsyncComponent (
  15678. factory,
  15679. baseCtor
  15680. ) {
  15681. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  15682. return factory.errorComp
  15683. }
  15684. if (isDef(factory.resolved)) {
  15685. return factory.resolved
  15686. }
  15687. var owner = currentRenderingInstance;
  15688. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  15689. // already pending
  15690. factory.owners.push(owner);
  15691. }
  15692. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  15693. return factory.loadingComp
  15694. }
  15695. if (owner && !isDef(factory.owners)) {
  15696. var owners = factory.owners = [owner];
  15697. var sync = true;
  15698. var timerLoading = null;
  15699. var timerTimeout = null
  15700. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  15701. var forceRender = function (renderCompleted) {
  15702. for (var i = 0, l = owners.length; i < l; i++) {
  15703. (owners[i]).$forceUpdate();
  15704. }
  15705. if (renderCompleted) {
  15706. owners.length = 0;
  15707. if (timerLoading !== null) {
  15708. clearTimeout(timerLoading);
  15709. timerLoading = null;
  15710. }
  15711. if (timerTimeout !== null) {
  15712. clearTimeout(timerTimeout);
  15713. timerTimeout = null;
  15714. }
  15715. }
  15716. };
  15717. var resolve = once(function (res) {
  15718. // cache resolved
  15719. factory.resolved = ensureCtor(res, baseCtor);
  15720. // invoke callbacks only if this is not a synchronous resolve
  15721. // (async resolves are shimmed as synchronous during SSR)
  15722. if (!sync) {
  15723. forceRender(true);
  15724. } else {
  15725. owners.length = 0;
  15726. }
  15727. });
  15728. var reject = once(function (reason) {
  15729. true && warn(
  15730. "Failed to resolve async component: " + (String(factory)) +
  15731. (reason ? ("\nReason: " + reason) : '')
  15732. );
  15733. if (isDef(factory.errorComp)) {
  15734. factory.error = true;
  15735. forceRender(true);
  15736. }
  15737. });
  15738. var res = factory(resolve, reject);
  15739. if (isObject(res)) {
  15740. if (isPromise(res)) {
  15741. // () => Promise
  15742. if (isUndef(factory.resolved)) {
  15743. res.then(resolve, reject);
  15744. }
  15745. } else if (isPromise(res.component)) {
  15746. res.component.then(resolve, reject);
  15747. if (isDef(res.error)) {
  15748. factory.errorComp = ensureCtor(res.error, baseCtor);
  15749. }
  15750. if (isDef(res.loading)) {
  15751. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  15752. if (res.delay === 0) {
  15753. factory.loading = true;
  15754. } else {
  15755. timerLoading = setTimeout(function () {
  15756. timerLoading = null;
  15757. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  15758. factory.loading = true;
  15759. forceRender(false);
  15760. }
  15761. }, res.delay || 200);
  15762. }
  15763. }
  15764. if (isDef(res.timeout)) {
  15765. timerTimeout = setTimeout(function () {
  15766. timerTimeout = null;
  15767. if (isUndef(factory.resolved)) {
  15768. reject(
  15769. true
  15770. ? ("timeout (" + (res.timeout) + "ms)")
  15771. : undefined
  15772. );
  15773. }
  15774. }, res.timeout);
  15775. }
  15776. }
  15777. }
  15778. sync = false;
  15779. // return in case resolved synchronously
  15780. return factory.loading
  15781. ? factory.loadingComp
  15782. : factory.resolved
  15783. }
  15784. }
  15785. /* */
  15786. function isAsyncPlaceholder (node) {
  15787. return node.isComment && node.asyncFactory
  15788. }
  15789. /* */
  15790. function getFirstComponentChild (children) {
  15791. if (Array.isArray(children)) {
  15792. for (var i = 0; i < children.length; i++) {
  15793. var c = children[i];
  15794. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  15795. return c
  15796. }
  15797. }
  15798. }
  15799. }
  15800. /* */
  15801. /* */
  15802. function initEvents (vm) {
  15803. vm._events = Object.create(null);
  15804. vm._hasHookEvent = false;
  15805. // init parent attached events
  15806. var listeners = vm.$options._parentListeners;
  15807. if (listeners) {
  15808. updateComponentListeners(vm, listeners);
  15809. }
  15810. }
  15811. var target;
  15812. function add (event, fn) {
  15813. target.$on(event, fn);
  15814. }
  15815. function remove$1 (event, fn) {
  15816. target.$off(event, fn);
  15817. }
  15818. function createOnceHandler (event, fn) {
  15819. var _target = target;
  15820. return function onceHandler () {
  15821. var res = fn.apply(null, arguments);
  15822. if (res !== null) {
  15823. _target.$off(event, onceHandler);
  15824. }
  15825. }
  15826. }
  15827. function updateComponentListeners (
  15828. vm,
  15829. listeners,
  15830. oldListeners
  15831. ) {
  15832. target = vm;
  15833. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  15834. target = undefined;
  15835. }
  15836. function eventsMixin (Vue) {
  15837. var hookRE = /^hook:/;
  15838. Vue.prototype.$on = function (event, fn) {
  15839. var vm = this;
  15840. if (Array.isArray(event)) {
  15841. for (var i = 0, l = event.length; i < l; i++) {
  15842. vm.$on(event[i], fn);
  15843. }
  15844. } else {
  15845. (vm._events[event] || (vm._events[event] = [])).push(fn);
  15846. // optimize hook:event cost by using a boolean flag marked at registration
  15847. // instead of a hash lookup
  15848. if (hookRE.test(event)) {
  15849. vm._hasHookEvent = true;
  15850. }
  15851. }
  15852. return vm
  15853. };
  15854. Vue.prototype.$once = function (event, fn) {
  15855. var vm = this;
  15856. function on () {
  15857. vm.$off(event, on);
  15858. fn.apply(vm, arguments);
  15859. }
  15860. on.fn = fn;
  15861. vm.$on(event, on);
  15862. return vm
  15863. };
  15864. Vue.prototype.$off = function (event, fn) {
  15865. var vm = this;
  15866. // all
  15867. if (!arguments.length) {
  15868. vm._events = Object.create(null);
  15869. return vm
  15870. }
  15871. // array of events
  15872. if (Array.isArray(event)) {
  15873. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  15874. vm.$off(event[i$1], fn);
  15875. }
  15876. return vm
  15877. }
  15878. // specific event
  15879. var cbs = vm._events[event];
  15880. if (!cbs) {
  15881. return vm
  15882. }
  15883. if (!fn) {
  15884. vm._events[event] = null;
  15885. return vm
  15886. }
  15887. // specific handler
  15888. var cb;
  15889. var i = cbs.length;
  15890. while (i--) {
  15891. cb = cbs[i];
  15892. if (cb === fn || cb.fn === fn) {
  15893. cbs.splice(i, 1);
  15894. break
  15895. }
  15896. }
  15897. return vm
  15898. };
  15899. Vue.prototype.$emit = function (event) {
  15900. var vm = this;
  15901. if (true) {
  15902. var lowerCaseEvent = event.toLowerCase();
  15903. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  15904. tip(
  15905. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  15906. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  15907. "Note that HTML attributes are case-insensitive and you cannot use " +
  15908. "v-on to listen to camelCase events when using in-DOM templates. " +
  15909. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  15910. );
  15911. }
  15912. }
  15913. var cbs = vm._events[event];
  15914. if (cbs) {
  15915. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  15916. var args = toArray(arguments, 1);
  15917. var info = "event handler for \"" + event + "\"";
  15918. for (var i = 0, l = cbs.length; i < l; i++) {
  15919. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  15920. }
  15921. }
  15922. return vm
  15923. };
  15924. }
  15925. /* */
  15926. var activeInstance = null;
  15927. var isUpdatingChildComponent = false;
  15928. function setActiveInstance(vm) {
  15929. var prevActiveInstance = activeInstance;
  15930. activeInstance = vm;
  15931. return function () {
  15932. activeInstance = prevActiveInstance;
  15933. }
  15934. }
  15935. function initLifecycle (vm) {
  15936. var options = vm.$options;
  15937. // locate first non-abstract parent
  15938. var parent = options.parent;
  15939. if (parent && !options.abstract) {
  15940. while (parent.$options.abstract && parent.$parent) {
  15941. parent = parent.$parent;
  15942. }
  15943. parent.$children.push(vm);
  15944. }
  15945. vm.$parent = parent;
  15946. vm.$root = parent ? parent.$root : vm;
  15947. vm.$children = [];
  15948. vm.$refs = {};
  15949. vm._watcher = null;
  15950. vm._inactive = null;
  15951. vm._directInactive = false;
  15952. vm._isMounted = false;
  15953. vm._isDestroyed = false;
  15954. vm._isBeingDestroyed = false;
  15955. }
  15956. function lifecycleMixin (Vue) {
  15957. Vue.prototype._update = function (vnode, hydrating) {
  15958. var vm = this;
  15959. var prevEl = vm.$el;
  15960. var prevVnode = vm._vnode;
  15961. var restoreActiveInstance = setActiveInstance(vm);
  15962. vm._vnode = vnode;
  15963. // Vue.prototype.__patch__ is injected in entry points
  15964. // based on the rendering backend used.
  15965. if (!prevVnode) {
  15966. // initial render
  15967. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  15968. } else {
  15969. // updates
  15970. vm.$el = vm.__patch__(prevVnode, vnode);
  15971. }
  15972. restoreActiveInstance();
  15973. // update __vue__ reference
  15974. if (prevEl) {
  15975. prevEl.__vue__ = null;
  15976. }
  15977. if (vm.$el) {
  15978. vm.$el.__vue__ = vm;
  15979. }
  15980. // if parent is an HOC, update its $el as well
  15981. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  15982. vm.$parent.$el = vm.$el;
  15983. }
  15984. // updated hook is called by the scheduler to ensure that children are
  15985. // updated in a parent's updated hook.
  15986. };
  15987. Vue.prototype.$forceUpdate = function () {
  15988. var vm = this;
  15989. if (vm._watcher) {
  15990. vm._watcher.update();
  15991. }
  15992. };
  15993. Vue.prototype.$destroy = function () {
  15994. var vm = this;
  15995. if (vm._isBeingDestroyed) {
  15996. return
  15997. }
  15998. callHook(vm, 'beforeDestroy');
  15999. vm._isBeingDestroyed = true;
  16000. // remove self from parent
  16001. var parent = vm.$parent;
  16002. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  16003. remove(parent.$children, vm);
  16004. }
  16005. // teardown watchers
  16006. if (vm._watcher) {
  16007. vm._watcher.teardown();
  16008. }
  16009. var i = vm._watchers.length;
  16010. while (i--) {
  16011. vm._watchers[i].teardown();
  16012. }
  16013. // remove reference from data ob
  16014. // frozen object may not have observer.
  16015. if (vm._data.__ob__) {
  16016. vm._data.__ob__.vmCount--;
  16017. }
  16018. // call the last hook...
  16019. vm._isDestroyed = true;
  16020. // invoke destroy hooks on current rendered tree
  16021. vm.__patch__(vm._vnode, null);
  16022. // fire destroyed hook
  16023. callHook(vm, 'destroyed');
  16024. // turn off all instance listeners.
  16025. vm.$off();
  16026. // remove __vue__ reference
  16027. if (vm.$el) {
  16028. vm.$el.__vue__ = null;
  16029. }
  16030. // release circular reference (#6759)
  16031. if (vm.$vnode) {
  16032. vm.$vnode.parent = null;
  16033. }
  16034. };
  16035. }
  16036. function updateChildComponent (
  16037. vm,
  16038. propsData,
  16039. listeners,
  16040. parentVnode,
  16041. renderChildren
  16042. ) {
  16043. if (true) {
  16044. isUpdatingChildComponent = true;
  16045. }
  16046. // determine whether component has slot children
  16047. // we need to do this before overwriting $options._renderChildren.
  16048. // check if there are dynamic scopedSlots (hand-written or compiled but with
  16049. // dynamic slot names). Static scoped slots compiled from template has the
  16050. // "$stable" marker.
  16051. var newScopedSlots = parentVnode.data.scopedSlots;
  16052. var oldScopedSlots = vm.$scopedSlots;
  16053. var hasDynamicScopedSlot = !!(
  16054. (newScopedSlots && !newScopedSlots.$stable) ||
  16055. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  16056. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  16057. );
  16058. // Any static slot children from the parent may have changed during parent's
  16059. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  16060. // update is necessary to ensure correctness.
  16061. var needsForceUpdate = !!(
  16062. renderChildren || // has new static slots
  16063. vm.$options._renderChildren || // has old static slots
  16064. hasDynamicScopedSlot
  16065. );
  16066. vm.$options._parentVnode = parentVnode;
  16067. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  16068. if (vm._vnode) { // update child tree's parent
  16069. vm._vnode.parent = parentVnode;
  16070. }
  16071. vm.$options._renderChildren = renderChildren;
  16072. // update $attrs and $listeners hash
  16073. // these are also reactive so they may trigger child update if the child
  16074. // used them during render
  16075. vm.$attrs = parentVnode.data.attrs || emptyObject;
  16076. vm.$listeners = listeners || emptyObject;
  16077. // update props
  16078. if (propsData && vm.$options.props) {
  16079. toggleObserving(false);
  16080. var props = vm._props;
  16081. var propKeys = vm.$options._propKeys || [];
  16082. for (var i = 0; i < propKeys.length; i++) {
  16083. var key = propKeys[i];
  16084. var propOptions = vm.$options.props; // wtf flow?
  16085. props[key] = validateProp(key, propOptions, propsData, vm);
  16086. }
  16087. toggleObserving(true);
  16088. // keep a copy of raw propsData
  16089. vm.$options.propsData = propsData;
  16090. }
  16091. // fixed by xxxxxx update properties(mp runtime)
  16092. vm._$updateProperties && vm._$updateProperties(vm);
  16093. // update listeners
  16094. listeners = listeners || emptyObject;
  16095. var oldListeners = vm.$options._parentListeners;
  16096. vm.$options._parentListeners = listeners;
  16097. updateComponentListeners(vm, listeners, oldListeners);
  16098. // resolve slots + force update if has children
  16099. if (needsForceUpdate) {
  16100. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  16101. vm.$forceUpdate();
  16102. }
  16103. if (true) {
  16104. isUpdatingChildComponent = false;
  16105. }
  16106. }
  16107. function isInInactiveTree (vm) {
  16108. while (vm && (vm = vm.$parent)) {
  16109. if (vm._inactive) { return true }
  16110. }
  16111. return false
  16112. }
  16113. function activateChildComponent (vm, direct) {
  16114. if (direct) {
  16115. vm._directInactive = false;
  16116. if (isInInactiveTree(vm)) {
  16117. return
  16118. }
  16119. } else if (vm._directInactive) {
  16120. return
  16121. }
  16122. if (vm._inactive || vm._inactive === null) {
  16123. vm._inactive = false;
  16124. for (var i = 0; i < vm.$children.length; i++) {
  16125. activateChildComponent(vm.$children[i]);
  16126. }
  16127. callHook(vm, 'activated');
  16128. }
  16129. }
  16130. function deactivateChildComponent (vm, direct) {
  16131. if (direct) {
  16132. vm._directInactive = true;
  16133. if (isInInactiveTree(vm)) {
  16134. return
  16135. }
  16136. }
  16137. if (!vm._inactive) {
  16138. vm._inactive = true;
  16139. for (var i = 0; i < vm.$children.length; i++) {
  16140. deactivateChildComponent(vm.$children[i]);
  16141. }
  16142. callHook(vm, 'deactivated');
  16143. }
  16144. }
  16145. function callHook (vm, hook) {
  16146. // #7573 disable dep collection when invoking lifecycle hooks
  16147. pushTarget();
  16148. var handlers = vm.$options[hook];
  16149. var info = hook + " hook";
  16150. if (handlers) {
  16151. for (var i = 0, j = handlers.length; i < j; i++) {
  16152. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  16153. }
  16154. }
  16155. if (vm._hasHookEvent) {
  16156. vm.$emit('hook:' + hook);
  16157. }
  16158. popTarget();
  16159. }
  16160. /* */
  16161. var MAX_UPDATE_COUNT = 100;
  16162. var queue = [];
  16163. var activatedChildren = [];
  16164. var has = {};
  16165. var circular = {};
  16166. var waiting = false;
  16167. var flushing = false;
  16168. var index = 0;
  16169. /**
  16170. * Reset the scheduler's state.
  16171. */
  16172. function resetSchedulerState () {
  16173. index = queue.length = activatedChildren.length = 0;
  16174. has = {};
  16175. if (true) {
  16176. circular = {};
  16177. }
  16178. waiting = flushing = false;
  16179. }
  16180. // Async edge case #6566 requires saving the timestamp when event listeners are
  16181. // attached. However, calling performance.now() has a perf overhead especially
  16182. // if the page has thousands of event listeners. Instead, we take a timestamp
  16183. // every time the scheduler flushes and use that for all event listeners
  16184. // attached during that flush.
  16185. var currentFlushTimestamp = 0;
  16186. // Async edge case fix requires storing an event listener's attach timestamp.
  16187. var getNow = Date.now;
  16188. // Determine what event timestamp the browser is using. Annoyingly, the
  16189. // timestamp can either be hi-res (relative to page load) or low-res
  16190. // (relative to UNIX epoch), so in order to compare time we have to use the
  16191. // same timestamp type when saving the flush timestamp.
  16192. // All IE versions use low-res event timestamps, and have problematic clock
  16193. // implementations (#9632)
  16194. if (inBrowser && !isIE) {
  16195. var performance = window.performance;
  16196. if (
  16197. performance &&
  16198. typeof performance.now === 'function' &&
  16199. getNow() > document.createEvent('Event').timeStamp
  16200. ) {
  16201. // if the event timestamp, although evaluated AFTER the Date.now(), is
  16202. // smaller than it, it means the event is using a hi-res timestamp,
  16203. // and we need to use the hi-res version for event listener timestamps as
  16204. // well.
  16205. getNow = function () { return performance.now(); };
  16206. }
  16207. }
  16208. /**
  16209. * Flush both queues and run the watchers.
  16210. */
  16211. function flushSchedulerQueue () {
  16212. currentFlushTimestamp = getNow();
  16213. flushing = true;
  16214. var watcher, id;
  16215. // Sort queue before flush.
  16216. // This ensures that:
  16217. // 1. Components are updated from parent to child. (because parent is always
  16218. // created before the child)
  16219. // 2. A component's user watchers are run before its render watcher (because
  16220. // user watchers are created before the render watcher)
  16221. // 3. If a component is destroyed during a parent component's watcher run,
  16222. // its watchers can be skipped.
  16223. queue.sort(function (a, b) { return a.id - b.id; });
  16224. // do not cache length because more watchers might be pushed
  16225. // as we run existing watchers
  16226. for (index = 0; index < queue.length; index++) {
  16227. watcher = queue[index];
  16228. if (watcher.before) {
  16229. watcher.before();
  16230. }
  16231. id = watcher.id;
  16232. has[id] = null;
  16233. watcher.run();
  16234. // in dev build, check and stop circular updates.
  16235. if ( true && has[id] != null) {
  16236. circular[id] = (circular[id] || 0) + 1;
  16237. if (circular[id] > MAX_UPDATE_COUNT) {
  16238. warn(
  16239. 'You may have an infinite update loop ' + (
  16240. watcher.user
  16241. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  16242. : "in a component render function."
  16243. ),
  16244. watcher.vm
  16245. );
  16246. break
  16247. }
  16248. }
  16249. }
  16250. // keep copies of post queues before resetting state
  16251. var activatedQueue = activatedChildren.slice();
  16252. var updatedQueue = queue.slice();
  16253. resetSchedulerState();
  16254. // call component updated and activated hooks
  16255. callActivatedHooks(activatedQueue);
  16256. callUpdatedHooks(updatedQueue);
  16257. // devtool hook
  16258. /* istanbul ignore if */
  16259. if (devtools && config.devtools) {
  16260. devtools.emit('flush');
  16261. }
  16262. }
  16263. function callUpdatedHooks (queue) {
  16264. var i = queue.length;
  16265. while (i--) {
  16266. var watcher = queue[i];
  16267. var vm = watcher.vm;
  16268. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  16269. callHook(vm, 'updated');
  16270. }
  16271. }
  16272. }
  16273. /**
  16274. * Queue a kept-alive component that was activated during patch.
  16275. * The queue will be processed after the entire tree has been patched.
  16276. */
  16277. function queueActivatedComponent (vm) {
  16278. // setting _inactive to false here so that a render function can
  16279. // rely on checking whether it's in an inactive tree (e.g. router-view)
  16280. vm._inactive = false;
  16281. activatedChildren.push(vm);
  16282. }
  16283. function callActivatedHooks (queue) {
  16284. for (var i = 0; i < queue.length; i++) {
  16285. queue[i]._inactive = true;
  16286. activateChildComponent(queue[i], true /* true */);
  16287. }
  16288. }
  16289. /**
  16290. * Push a watcher into the watcher queue.
  16291. * Jobs with duplicate IDs will be skipped unless it's
  16292. * pushed when the queue is being flushed.
  16293. */
  16294. function queueWatcher (watcher) {
  16295. var id = watcher.id;
  16296. if (has[id] == null) {
  16297. has[id] = true;
  16298. if (!flushing) {
  16299. queue.push(watcher);
  16300. } else {
  16301. // if already flushing, splice the watcher based on its id
  16302. // if already past its id, it will be run next immediately.
  16303. var i = queue.length - 1;
  16304. while (i > index && queue[i].id > watcher.id) {
  16305. i--;
  16306. }
  16307. queue.splice(i + 1, 0, watcher);
  16308. }
  16309. // queue the flush
  16310. if (!waiting) {
  16311. waiting = true;
  16312. if ( true && !config.async) {
  16313. flushSchedulerQueue();
  16314. return
  16315. }
  16316. nextTick(flushSchedulerQueue);
  16317. }
  16318. }
  16319. }
  16320. /* */
  16321. var uid$2 = 0;
  16322. /**
  16323. * A watcher parses an expression, collects dependencies,
  16324. * and fires callback when the expression value changes.
  16325. * This is used for both the $watch() api and directives.
  16326. */
  16327. var Watcher = function Watcher (
  16328. vm,
  16329. expOrFn,
  16330. cb,
  16331. options,
  16332. isRenderWatcher
  16333. ) {
  16334. this.vm = vm;
  16335. if (isRenderWatcher) {
  16336. vm._watcher = this;
  16337. }
  16338. vm._watchers.push(this);
  16339. // options
  16340. if (options) {
  16341. this.deep = !!options.deep;
  16342. this.user = !!options.user;
  16343. this.lazy = !!options.lazy;
  16344. this.sync = !!options.sync;
  16345. this.before = options.before;
  16346. } else {
  16347. this.deep = this.user = this.lazy = this.sync = false;
  16348. }
  16349. this.cb = cb;
  16350. this.id = ++uid$2; // uid for batching
  16351. this.active = true;
  16352. this.dirty = this.lazy; // for lazy watchers
  16353. this.deps = [];
  16354. this.newDeps = [];
  16355. this.depIds = new _Set();
  16356. this.newDepIds = new _Set();
  16357. this.expression = true
  16358. ? expOrFn.toString()
  16359. : undefined;
  16360. // parse expression for getter
  16361. if (typeof expOrFn === 'function') {
  16362. this.getter = expOrFn;
  16363. } else {
  16364. this.getter = parsePath(expOrFn);
  16365. if (!this.getter) {
  16366. this.getter = noop;
  16367. true && warn(
  16368. "Failed watching path: \"" + expOrFn + "\" " +
  16369. 'Watcher only accepts simple dot-delimited paths. ' +
  16370. 'For full control, use a function instead.',
  16371. vm
  16372. );
  16373. }
  16374. }
  16375. this.value = this.lazy
  16376. ? undefined
  16377. : this.get();
  16378. };
  16379. /**
  16380. * Evaluate the getter, and re-collect dependencies.
  16381. */
  16382. Watcher.prototype.get = function get () {
  16383. pushTarget(this);
  16384. var value;
  16385. var vm = this.vm;
  16386. try {
  16387. value = this.getter.call(vm, vm);
  16388. } catch (e) {
  16389. if (this.user) {
  16390. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  16391. } else {
  16392. throw e
  16393. }
  16394. } finally {
  16395. // "touch" every property so they are all tracked as
  16396. // dependencies for deep watching
  16397. if (this.deep) {
  16398. traverse(value);
  16399. }
  16400. popTarget();
  16401. this.cleanupDeps();
  16402. }
  16403. return value
  16404. };
  16405. /**
  16406. * Add a dependency to this directive.
  16407. */
  16408. Watcher.prototype.addDep = function addDep (dep) {
  16409. var id = dep.id;
  16410. if (!this.newDepIds.has(id)) {
  16411. this.newDepIds.add(id);
  16412. this.newDeps.push(dep);
  16413. if (!this.depIds.has(id)) {
  16414. dep.addSub(this);
  16415. }
  16416. }
  16417. };
  16418. /**
  16419. * Clean up for dependency collection.
  16420. */
  16421. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  16422. var i = this.deps.length;
  16423. while (i--) {
  16424. var dep = this.deps[i];
  16425. if (!this.newDepIds.has(dep.id)) {
  16426. dep.removeSub(this);
  16427. }
  16428. }
  16429. var tmp = this.depIds;
  16430. this.depIds = this.newDepIds;
  16431. this.newDepIds = tmp;
  16432. this.newDepIds.clear();
  16433. tmp = this.deps;
  16434. this.deps = this.newDeps;
  16435. this.newDeps = tmp;
  16436. this.newDeps.length = 0;
  16437. };
  16438. /**
  16439. * Subscriber interface.
  16440. * Will be called when a dependency changes.
  16441. */
  16442. Watcher.prototype.update = function update () {
  16443. /* istanbul ignore else */
  16444. if (this.lazy) {
  16445. this.dirty = true;
  16446. } else if (this.sync) {
  16447. this.run();
  16448. } else {
  16449. queueWatcher(this);
  16450. }
  16451. };
  16452. /**
  16453. * Scheduler job interface.
  16454. * Will be called by the scheduler.
  16455. */
  16456. Watcher.prototype.run = function run () {
  16457. if (this.active) {
  16458. var value = this.get();
  16459. if (
  16460. value !== this.value ||
  16461. // Deep watchers and watchers on Object/Arrays should fire even
  16462. // when the value is the same, because the value may
  16463. // have mutated.
  16464. isObject(value) ||
  16465. this.deep
  16466. ) {
  16467. // set new value
  16468. var oldValue = this.value;
  16469. this.value = value;
  16470. if (this.user) {
  16471. try {
  16472. this.cb.call(this.vm, value, oldValue);
  16473. } catch (e) {
  16474. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  16475. }
  16476. } else {
  16477. this.cb.call(this.vm, value, oldValue);
  16478. }
  16479. }
  16480. }
  16481. };
  16482. /**
  16483. * Evaluate the value of the watcher.
  16484. * This only gets called for lazy watchers.
  16485. */
  16486. Watcher.prototype.evaluate = function evaluate () {
  16487. this.value = this.get();
  16488. this.dirty = false;
  16489. };
  16490. /**
  16491. * Depend on all deps collected by this watcher.
  16492. */
  16493. Watcher.prototype.depend = function depend () {
  16494. var i = this.deps.length;
  16495. while (i--) {
  16496. this.deps[i].depend();
  16497. }
  16498. };
  16499. /**
  16500. * Remove self from all dependencies' subscriber list.
  16501. */
  16502. Watcher.prototype.teardown = function teardown () {
  16503. if (this.active) {
  16504. // remove self from vm's watcher list
  16505. // this is a somewhat expensive operation so we skip it
  16506. // if the vm is being destroyed.
  16507. if (!this.vm._isBeingDestroyed) {
  16508. remove(this.vm._watchers, this);
  16509. }
  16510. var i = this.deps.length;
  16511. while (i--) {
  16512. this.deps[i].removeSub(this);
  16513. }
  16514. this.active = false;
  16515. }
  16516. };
  16517. /* */
  16518. var sharedPropertyDefinition = {
  16519. enumerable: true,
  16520. configurable: true,
  16521. get: noop,
  16522. set: noop
  16523. };
  16524. function proxy (target, sourceKey, key) {
  16525. sharedPropertyDefinition.get = function proxyGetter () {
  16526. return this[sourceKey][key]
  16527. };
  16528. sharedPropertyDefinition.set = function proxySetter (val) {
  16529. this[sourceKey][key] = val;
  16530. };
  16531. Object.defineProperty(target, key, sharedPropertyDefinition);
  16532. }
  16533. function initState (vm) {
  16534. vm._watchers = [];
  16535. var opts = vm.$options;
  16536. if (opts.props) { initProps(vm, opts.props); }
  16537. if (opts.methods) { initMethods(vm, opts.methods); }
  16538. if (opts.data) {
  16539. initData(vm);
  16540. } else {
  16541. observe(vm._data = {}, true /* asRootData */);
  16542. }
  16543. if (opts.computed) { initComputed(vm, opts.computed); }
  16544. if (opts.watch && opts.watch !== nativeWatch) {
  16545. initWatch(vm, opts.watch);
  16546. }
  16547. }
  16548. function initProps (vm, propsOptions) {
  16549. var propsData = vm.$options.propsData || {};
  16550. var props = vm._props = {};
  16551. // cache prop keys so that future props updates can iterate using Array
  16552. // instead of dynamic object key enumeration.
  16553. var keys = vm.$options._propKeys = [];
  16554. var isRoot = !vm.$parent;
  16555. // root instance props should be converted
  16556. if (!isRoot) {
  16557. toggleObserving(false);
  16558. }
  16559. var loop = function ( key ) {
  16560. keys.push(key);
  16561. var value = validateProp(key, propsOptions, propsData, vm);
  16562. /* istanbul ignore else */
  16563. if (true) {
  16564. var hyphenatedKey = hyphenate(key);
  16565. if (isReservedAttribute(hyphenatedKey) ||
  16566. config.isReservedAttr(hyphenatedKey)) {
  16567. warn(
  16568. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  16569. vm
  16570. );
  16571. }
  16572. defineReactive$$1(props, key, value, function () {
  16573. if (!isRoot && !isUpdatingChildComponent) {
  16574. {
  16575. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  16576. return
  16577. }
  16578. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  16579. if(
  16580. key === 'value' &&
  16581. Array.isArray(vm.$options.behaviors) &&
  16582. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  16583. ){
  16584. return
  16585. }
  16586. if(vm._getFormData){
  16587. return
  16588. }
  16589. var $parent = vm.$parent;
  16590. while($parent){
  16591. if($parent.__next_tick_pending){
  16592. return
  16593. }
  16594. $parent = $parent.$parent;
  16595. }
  16596. }
  16597. warn(
  16598. "Avoid mutating a prop directly since the value will be " +
  16599. "overwritten whenever the parent component re-renders. " +
  16600. "Instead, use a data or computed property based on the prop's " +
  16601. "value. Prop being mutated: \"" + key + "\"",
  16602. vm
  16603. );
  16604. }
  16605. });
  16606. } else {}
  16607. // static props are already proxied on the component's prototype
  16608. // during Vue.extend(). We only need to proxy props defined at
  16609. // instantiation here.
  16610. if (!(key in vm)) {
  16611. proxy(vm, "_props", key);
  16612. }
  16613. };
  16614. for (var key in propsOptions) loop( key );
  16615. toggleObserving(true);
  16616. }
  16617. function initData (vm) {
  16618. var data = vm.$options.data;
  16619. data = vm._data = typeof data === 'function'
  16620. ? getData(data, vm)
  16621. : data || {};
  16622. if (!isPlainObject(data)) {
  16623. data = {};
  16624. true && warn(
  16625. 'data functions should return an object:\n' +
  16626. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  16627. vm
  16628. );
  16629. }
  16630. // proxy data on instance
  16631. var keys = Object.keys(data);
  16632. var props = vm.$options.props;
  16633. var methods = vm.$options.methods;
  16634. var i = keys.length;
  16635. while (i--) {
  16636. var key = keys[i];
  16637. if (true) {
  16638. if (methods && hasOwn(methods, key)) {
  16639. warn(
  16640. ("Method \"" + key + "\" has already been defined as a data property."),
  16641. vm
  16642. );
  16643. }
  16644. }
  16645. if (props && hasOwn(props, key)) {
  16646. true && warn(
  16647. "The data property \"" + key + "\" is already declared as a prop. " +
  16648. "Use prop default value instead.",
  16649. vm
  16650. );
  16651. } else if (!isReserved(key)) {
  16652. proxy(vm, "_data", key);
  16653. }
  16654. }
  16655. // observe data
  16656. observe(data, true /* asRootData */);
  16657. }
  16658. function getData (data, vm) {
  16659. // #7573 disable dep collection when invoking data getters
  16660. pushTarget();
  16661. try {
  16662. return data.call(vm, vm)
  16663. } catch (e) {
  16664. handleError(e, vm, "data()");
  16665. return {}
  16666. } finally {
  16667. popTarget();
  16668. }
  16669. }
  16670. var computedWatcherOptions = { lazy: true };
  16671. function initComputed (vm, computed) {
  16672. // $flow-disable-line
  16673. var watchers = vm._computedWatchers = Object.create(null);
  16674. // computed properties are just getters during SSR
  16675. var isSSR = isServerRendering();
  16676. for (var key in computed) {
  16677. var userDef = computed[key];
  16678. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  16679. if ( true && getter == null) {
  16680. warn(
  16681. ("Getter is missing for computed property \"" + key + "\"."),
  16682. vm
  16683. );
  16684. }
  16685. if (!isSSR) {
  16686. // create internal watcher for the computed property.
  16687. watchers[key] = new Watcher(
  16688. vm,
  16689. getter || noop,
  16690. noop,
  16691. computedWatcherOptions
  16692. );
  16693. }
  16694. // component-defined computed properties are already defined on the
  16695. // component prototype. We only need to define computed properties defined
  16696. // at instantiation here.
  16697. if (!(key in vm)) {
  16698. defineComputed(vm, key, userDef);
  16699. } else if (true) {
  16700. if (key in vm.$data) {
  16701. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  16702. } else if (vm.$options.props && key in vm.$options.props) {
  16703. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  16704. }
  16705. }
  16706. }
  16707. }
  16708. function defineComputed (
  16709. target,
  16710. key,
  16711. userDef
  16712. ) {
  16713. var shouldCache = !isServerRendering();
  16714. if (typeof userDef === 'function') {
  16715. sharedPropertyDefinition.get = shouldCache
  16716. ? createComputedGetter(key)
  16717. : createGetterInvoker(userDef);
  16718. sharedPropertyDefinition.set = noop;
  16719. } else {
  16720. sharedPropertyDefinition.get = userDef.get
  16721. ? shouldCache && userDef.cache !== false
  16722. ? createComputedGetter(key)
  16723. : createGetterInvoker(userDef.get)
  16724. : noop;
  16725. sharedPropertyDefinition.set = userDef.set || noop;
  16726. }
  16727. if ( true &&
  16728. sharedPropertyDefinition.set === noop) {
  16729. sharedPropertyDefinition.set = function () {
  16730. warn(
  16731. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  16732. this
  16733. );
  16734. };
  16735. }
  16736. Object.defineProperty(target, key, sharedPropertyDefinition);
  16737. }
  16738. function createComputedGetter (key) {
  16739. return function computedGetter () {
  16740. var watcher = this._computedWatchers && this._computedWatchers[key];
  16741. if (watcher) {
  16742. if (watcher.dirty) {
  16743. watcher.evaluate();
  16744. }
  16745. if (Dep.SharedObject.target) {// fixed by xxxxxx
  16746. watcher.depend();
  16747. }
  16748. return watcher.value
  16749. }
  16750. }
  16751. }
  16752. function createGetterInvoker(fn) {
  16753. return function computedGetter () {
  16754. return fn.call(this, this)
  16755. }
  16756. }
  16757. function initMethods (vm, methods) {
  16758. var props = vm.$options.props;
  16759. for (var key in methods) {
  16760. if (true) {
  16761. if (typeof methods[key] !== 'function') {
  16762. warn(
  16763. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  16764. "Did you reference the function correctly?",
  16765. vm
  16766. );
  16767. }
  16768. if (props && hasOwn(props, key)) {
  16769. warn(
  16770. ("Method \"" + key + "\" has already been defined as a prop."),
  16771. vm
  16772. );
  16773. }
  16774. if ((key in vm) && isReserved(key)) {
  16775. warn(
  16776. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  16777. "Avoid defining component methods that start with _ or $."
  16778. );
  16779. }
  16780. }
  16781. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  16782. }
  16783. }
  16784. function initWatch (vm, watch) {
  16785. for (var key in watch) {
  16786. var handler = watch[key];
  16787. if (Array.isArray(handler)) {
  16788. for (var i = 0; i < handler.length; i++) {
  16789. createWatcher(vm, key, handler[i]);
  16790. }
  16791. } else {
  16792. createWatcher(vm, key, handler);
  16793. }
  16794. }
  16795. }
  16796. function createWatcher (
  16797. vm,
  16798. expOrFn,
  16799. handler,
  16800. options
  16801. ) {
  16802. if (isPlainObject(handler)) {
  16803. options = handler;
  16804. handler = handler.handler;
  16805. }
  16806. if (typeof handler === 'string') {
  16807. handler = vm[handler];
  16808. }
  16809. return vm.$watch(expOrFn, handler, options)
  16810. }
  16811. function stateMixin (Vue) {
  16812. // flow somehow has problems with directly declared definition object
  16813. // when using Object.defineProperty, so we have to procedurally build up
  16814. // the object here.
  16815. var dataDef = {};
  16816. dataDef.get = function () { return this._data };
  16817. var propsDef = {};
  16818. propsDef.get = function () { return this._props };
  16819. if (true) {
  16820. dataDef.set = function () {
  16821. warn(
  16822. 'Avoid replacing instance root $data. ' +
  16823. 'Use nested data properties instead.',
  16824. this
  16825. );
  16826. };
  16827. propsDef.set = function () {
  16828. warn("$props is readonly.", this);
  16829. };
  16830. }
  16831. Object.defineProperty(Vue.prototype, '$data', dataDef);
  16832. Object.defineProperty(Vue.prototype, '$props', propsDef);
  16833. Vue.prototype.$set = set;
  16834. Vue.prototype.$delete = del;
  16835. Vue.prototype.$watch = function (
  16836. expOrFn,
  16837. cb,
  16838. options
  16839. ) {
  16840. var vm = this;
  16841. if (isPlainObject(cb)) {
  16842. return createWatcher(vm, expOrFn, cb, options)
  16843. }
  16844. options = options || {};
  16845. options.user = true;
  16846. var watcher = new Watcher(vm, expOrFn, cb, options);
  16847. if (options.immediate) {
  16848. try {
  16849. cb.call(vm, watcher.value);
  16850. } catch (error) {
  16851. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  16852. }
  16853. }
  16854. return function unwatchFn () {
  16855. watcher.teardown();
  16856. }
  16857. };
  16858. }
  16859. /* */
  16860. var uid$3 = 0;
  16861. function initMixin (Vue) {
  16862. Vue.prototype._init = function (options) {
  16863. var vm = this;
  16864. // a uid
  16865. vm._uid = uid$3++;
  16866. var startTag, endTag;
  16867. /* istanbul ignore if */
  16868. if ( true && config.performance && mark) {
  16869. startTag = "vue-perf-start:" + (vm._uid);
  16870. endTag = "vue-perf-end:" + (vm._uid);
  16871. mark(startTag);
  16872. }
  16873. // a flag to avoid this being observed
  16874. vm._isVue = true;
  16875. // merge options
  16876. if (options && options._isComponent) {
  16877. // optimize internal component instantiation
  16878. // since dynamic options merging is pretty slow, and none of the
  16879. // internal component options needs special treatment.
  16880. initInternalComponent(vm, options);
  16881. } else {
  16882. vm.$options = mergeOptions(
  16883. resolveConstructorOptions(vm.constructor),
  16884. options || {},
  16885. vm
  16886. );
  16887. }
  16888. /* istanbul ignore else */
  16889. if (true) {
  16890. initProxy(vm);
  16891. } else {}
  16892. // expose real self
  16893. vm._self = vm;
  16894. initLifecycle(vm);
  16895. initEvents(vm);
  16896. initRender(vm);
  16897. callHook(vm, 'beforeCreate');
  16898. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  16899. initState(vm);
  16900. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  16901. !vm._$fallback && callHook(vm, 'created');
  16902. /* istanbul ignore if */
  16903. if ( true && config.performance && mark) {
  16904. vm._name = formatComponentName(vm, false);
  16905. mark(endTag);
  16906. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  16907. }
  16908. if (vm.$options.el) {
  16909. vm.$mount(vm.$options.el);
  16910. }
  16911. };
  16912. }
  16913. function initInternalComponent (vm, options) {
  16914. var opts = vm.$options = Object.create(vm.constructor.options);
  16915. // doing this because it's faster than dynamic enumeration.
  16916. var parentVnode = options._parentVnode;
  16917. opts.parent = options.parent;
  16918. opts._parentVnode = parentVnode;
  16919. var vnodeComponentOptions = parentVnode.componentOptions;
  16920. opts.propsData = vnodeComponentOptions.propsData;
  16921. opts._parentListeners = vnodeComponentOptions.listeners;
  16922. opts._renderChildren = vnodeComponentOptions.children;
  16923. opts._componentTag = vnodeComponentOptions.tag;
  16924. if (options.render) {
  16925. opts.render = options.render;
  16926. opts.staticRenderFns = options.staticRenderFns;
  16927. }
  16928. }
  16929. function resolveConstructorOptions (Ctor) {
  16930. var options = Ctor.options;
  16931. if (Ctor.super) {
  16932. var superOptions = resolveConstructorOptions(Ctor.super);
  16933. var cachedSuperOptions = Ctor.superOptions;
  16934. if (superOptions !== cachedSuperOptions) {
  16935. // super option changed,
  16936. // need to resolve new options.
  16937. Ctor.superOptions = superOptions;
  16938. // check if there are any late-modified/attached options (#4976)
  16939. var modifiedOptions = resolveModifiedOptions(Ctor);
  16940. // update base extend options
  16941. if (modifiedOptions) {
  16942. extend(Ctor.extendOptions, modifiedOptions);
  16943. }
  16944. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  16945. if (options.name) {
  16946. options.components[options.name] = Ctor;
  16947. }
  16948. }
  16949. }
  16950. return options
  16951. }
  16952. function resolveModifiedOptions (Ctor) {
  16953. var modified;
  16954. var latest = Ctor.options;
  16955. var sealed = Ctor.sealedOptions;
  16956. for (var key in latest) {
  16957. if (latest[key] !== sealed[key]) {
  16958. if (!modified) { modified = {}; }
  16959. modified[key] = latest[key];
  16960. }
  16961. }
  16962. return modified
  16963. }
  16964. function Vue (options) {
  16965. if ( true &&
  16966. !(this instanceof Vue)
  16967. ) {
  16968. warn('Vue is a constructor and should be called with the `new` keyword');
  16969. }
  16970. this._init(options);
  16971. }
  16972. initMixin(Vue);
  16973. stateMixin(Vue);
  16974. eventsMixin(Vue);
  16975. lifecycleMixin(Vue);
  16976. renderMixin(Vue);
  16977. /* */
  16978. function initUse (Vue) {
  16979. Vue.use = function (plugin) {
  16980. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  16981. if (installedPlugins.indexOf(plugin) > -1) {
  16982. return this
  16983. }
  16984. // additional parameters
  16985. var args = toArray(arguments, 1);
  16986. args.unshift(this);
  16987. if (typeof plugin.install === 'function') {
  16988. plugin.install.apply(plugin, args);
  16989. } else if (typeof plugin === 'function') {
  16990. plugin.apply(null, args);
  16991. }
  16992. installedPlugins.push(plugin);
  16993. return this
  16994. };
  16995. }
  16996. /* */
  16997. function initMixin$1 (Vue) {
  16998. Vue.mixin = function (mixin) {
  16999. this.options = mergeOptions(this.options, mixin);
  17000. return this
  17001. };
  17002. }
  17003. /* */
  17004. function initExtend (Vue) {
  17005. /**
  17006. * Each instance constructor, including Vue, has a unique
  17007. * cid. This enables us to create wrapped "child
  17008. * constructors" for prototypal inheritance and cache them.
  17009. */
  17010. Vue.cid = 0;
  17011. var cid = 1;
  17012. /**
  17013. * Class inheritance
  17014. */
  17015. Vue.extend = function (extendOptions) {
  17016. extendOptions = extendOptions || {};
  17017. var Super = this;
  17018. var SuperId = Super.cid;
  17019. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  17020. if (cachedCtors[SuperId]) {
  17021. return cachedCtors[SuperId]
  17022. }
  17023. var name = extendOptions.name || Super.options.name;
  17024. if ( true && name) {
  17025. validateComponentName(name);
  17026. }
  17027. var Sub = function VueComponent (options) {
  17028. this._init(options);
  17029. };
  17030. Sub.prototype = Object.create(Super.prototype);
  17031. Sub.prototype.constructor = Sub;
  17032. Sub.cid = cid++;
  17033. Sub.options = mergeOptions(
  17034. Super.options,
  17035. extendOptions
  17036. );
  17037. Sub['super'] = Super;
  17038. // For props and computed properties, we define the proxy getters on
  17039. // the Vue instances at extension time, on the extended prototype. This
  17040. // avoids Object.defineProperty calls for each instance created.
  17041. if (Sub.options.props) {
  17042. initProps$1(Sub);
  17043. }
  17044. if (Sub.options.computed) {
  17045. initComputed$1(Sub);
  17046. }
  17047. // allow further extension/mixin/plugin usage
  17048. Sub.extend = Super.extend;
  17049. Sub.mixin = Super.mixin;
  17050. Sub.use = Super.use;
  17051. // create asset registers, so extended classes
  17052. // can have their private assets too.
  17053. ASSET_TYPES.forEach(function (type) {
  17054. Sub[type] = Super[type];
  17055. });
  17056. // enable recursive self-lookup
  17057. if (name) {
  17058. Sub.options.components[name] = Sub;
  17059. }
  17060. // keep a reference to the super options at extension time.
  17061. // later at instantiation we can check if Super's options have
  17062. // been updated.
  17063. Sub.superOptions = Super.options;
  17064. Sub.extendOptions = extendOptions;
  17065. Sub.sealedOptions = extend({}, Sub.options);
  17066. // cache constructor
  17067. cachedCtors[SuperId] = Sub;
  17068. return Sub
  17069. };
  17070. }
  17071. function initProps$1 (Comp) {
  17072. var props = Comp.options.props;
  17073. for (var key in props) {
  17074. proxy(Comp.prototype, "_props", key);
  17075. }
  17076. }
  17077. function initComputed$1 (Comp) {
  17078. var computed = Comp.options.computed;
  17079. for (var key in computed) {
  17080. defineComputed(Comp.prototype, key, computed[key]);
  17081. }
  17082. }
  17083. /* */
  17084. function initAssetRegisters (Vue) {
  17085. /**
  17086. * Create asset registration methods.
  17087. */
  17088. ASSET_TYPES.forEach(function (type) {
  17089. Vue[type] = function (
  17090. id,
  17091. definition
  17092. ) {
  17093. if (!definition) {
  17094. return this.options[type + 's'][id]
  17095. } else {
  17096. /* istanbul ignore if */
  17097. if ( true && type === 'component') {
  17098. validateComponentName(id);
  17099. }
  17100. if (type === 'component' && isPlainObject(definition)) {
  17101. definition.name = definition.name || id;
  17102. definition = this.options._base.extend(definition);
  17103. }
  17104. if (type === 'directive' && typeof definition === 'function') {
  17105. definition = { bind: definition, update: definition };
  17106. }
  17107. this.options[type + 's'][id] = definition;
  17108. return definition
  17109. }
  17110. };
  17111. });
  17112. }
  17113. /* */
  17114. function getComponentName (opts) {
  17115. return opts && (opts.Ctor.options.name || opts.tag)
  17116. }
  17117. function matches (pattern, name) {
  17118. if (Array.isArray(pattern)) {
  17119. return pattern.indexOf(name) > -1
  17120. } else if (typeof pattern === 'string') {
  17121. return pattern.split(',').indexOf(name) > -1
  17122. } else if (isRegExp(pattern)) {
  17123. return pattern.test(name)
  17124. }
  17125. /* istanbul ignore next */
  17126. return false
  17127. }
  17128. function pruneCache (keepAliveInstance, filter) {
  17129. var cache = keepAliveInstance.cache;
  17130. var keys = keepAliveInstance.keys;
  17131. var _vnode = keepAliveInstance._vnode;
  17132. for (var key in cache) {
  17133. var cachedNode = cache[key];
  17134. if (cachedNode) {
  17135. var name = getComponentName(cachedNode.componentOptions);
  17136. if (name && !filter(name)) {
  17137. pruneCacheEntry(cache, key, keys, _vnode);
  17138. }
  17139. }
  17140. }
  17141. }
  17142. function pruneCacheEntry (
  17143. cache,
  17144. key,
  17145. keys,
  17146. current
  17147. ) {
  17148. var cached$$1 = cache[key];
  17149. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  17150. cached$$1.componentInstance.$destroy();
  17151. }
  17152. cache[key] = null;
  17153. remove(keys, key);
  17154. }
  17155. var patternTypes = [String, RegExp, Array];
  17156. var KeepAlive = {
  17157. name: 'keep-alive',
  17158. abstract: true,
  17159. props: {
  17160. include: patternTypes,
  17161. exclude: patternTypes,
  17162. max: [String, Number]
  17163. },
  17164. created: function created () {
  17165. this.cache = Object.create(null);
  17166. this.keys = [];
  17167. },
  17168. destroyed: function destroyed () {
  17169. for (var key in this.cache) {
  17170. pruneCacheEntry(this.cache, key, this.keys);
  17171. }
  17172. },
  17173. mounted: function mounted () {
  17174. var this$1 = this;
  17175. this.$watch('include', function (val) {
  17176. pruneCache(this$1, function (name) { return matches(val, name); });
  17177. });
  17178. this.$watch('exclude', function (val) {
  17179. pruneCache(this$1, function (name) { return !matches(val, name); });
  17180. });
  17181. },
  17182. render: function render () {
  17183. var slot = this.$slots.default;
  17184. var vnode = getFirstComponentChild(slot);
  17185. var componentOptions = vnode && vnode.componentOptions;
  17186. if (componentOptions) {
  17187. // check pattern
  17188. var name = getComponentName(componentOptions);
  17189. var ref = this;
  17190. var include = ref.include;
  17191. var exclude = ref.exclude;
  17192. if (
  17193. // not included
  17194. (include && (!name || !matches(include, name))) ||
  17195. // excluded
  17196. (exclude && name && matches(exclude, name))
  17197. ) {
  17198. return vnode
  17199. }
  17200. var ref$1 = this;
  17201. var cache = ref$1.cache;
  17202. var keys = ref$1.keys;
  17203. var key = vnode.key == null
  17204. // same constructor may get registered as different local components
  17205. // so cid alone is not enough (#3269)
  17206. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  17207. : vnode.key;
  17208. if (cache[key]) {
  17209. vnode.componentInstance = cache[key].componentInstance;
  17210. // make current key freshest
  17211. remove(keys, key);
  17212. keys.push(key);
  17213. } else {
  17214. cache[key] = vnode;
  17215. keys.push(key);
  17216. // prune oldest entry
  17217. if (this.max && keys.length > parseInt(this.max)) {
  17218. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  17219. }
  17220. }
  17221. vnode.data.keepAlive = true;
  17222. }
  17223. return vnode || (slot && slot[0])
  17224. }
  17225. };
  17226. var builtInComponents = {
  17227. KeepAlive: KeepAlive
  17228. };
  17229. /* */
  17230. function initGlobalAPI (Vue) {
  17231. // config
  17232. var configDef = {};
  17233. configDef.get = function () { return config; };
  17234. if (true) {
  17235. configDef.set = function () {
  17236. warn(
  17237. 'Do not replace the Vue.config object, set individual fields instead.'
  17238. );
  17239. };
  17240. }
  17241. Object.defineProperty(Vue, 'config', configDef);
  17242. // exposed util methods.
  17243. // NOTE: these are not considered part of the public API - avoid relying on
  17244. // them unless you are aware of the risk.
  17245. Vue.util = {
  17246. warn: warn,
  17247. extend: extend,
  17248. mergeOptions: mergeOptions,
  17249. defineReactive: defineReactive$$1
  17250. };
  17251. Vue.set = set;
  17252. Vue.delete = del;
  17253. Vue.nextTick = nextTick;
  17254. // 2.6 explicit observable API
  17255. Vue.observable = function (obj) {
  17256. observe(obj);
  17257. return obj
  17258. };
  17259. Vue.options = Object.create(null);
  17260. ASSET_TYPES.forEach(function (type) {
  17261. Vue.options[type + 's'] = Object.create(null);
  17262. });
  17263. // this is used to identify the "base" constructor to extend all plain-object
  17264. // components with in Weex's multi-instance scenarios.
  17265. Vue.options._base = Vue;
  17266. extend(Vue.options.components, builtInComponents);
  17267. initUse(Vue);
  17268. initMixin$1(Vue);
  17269. initExtend(Vue);
  17270. initAssetRegisters(Vue);
  17271. }
  17272. initGlobalAPI(Vue);
  17273. Object.defineProperty(Vue.prototype, '$isServer', {
  17274. get: isServerRendering
  17275. });
  17276. Object.defineProperty(Vue.prototype, '$ssrContext', {
  17277. get: function get () {
  17278. /* istanbul ignore next */
  17279. return this.$vnode && this.$vnode.ssrContext
  17280. }
  17281. });
  17282. // expose FunctionalRenderContext for ssr runtime helper installation
  17283. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  17284. value: FunctionalRenderContext
  17285. });
  17286. Vue.version = '2.6.11';
  17287. /**
  17288. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  17289. */
  17290. var ARRAYTYPE = '[object Array]';
  17291. var OBJECTTYPE = '[object Object]';
  17292. var NULLTYPE = '[object Null]';
  17293. var UNDEFINEDTYPE = '[object Undefined]';
  17294. // const FUNCTIONTYPE = '[object Function]'
  17295. function diff(current, pre) {
  17296. var result = {};
  17297. syncKeys(current, pre);
  17298. _diff(current, pre, '', result);
  17299. return result
  17300. }
  17301. function syncKeys(current, pre) {
  17302. if (current === pre) { return }
  17303. var rootCurrentType = type(current);
  17304. var rootPreType = type(pre);
  17305. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  17306. if(Object.keys(current).length >= Object.keys(pre).length){
  17307. for (var key in pre) {
  17308. var currentValue = current[key];
  17309. if (currentValue === undefined) {
  17310. current[key] = null;
  17311. } else {
  17312. syncKeys(currentValue, pre[key]);
  17313. }
  17314. }
  17315. }
  17316. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  17317. if (current.length >= pre.length) {
  17318. pre.forEach(function (item, index) {
  17319. syncKeys(current[index], item);
  17320. });
  17321. }
  17322. }
  17323. }
  17324. function nullOrUndefined(currentType, preType) {
  17325. if(
  17326. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  17327. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  17328. ) {
  17329. return false
  17330. }
  17331. return true
  17332. }
  17333. function _diff(current, pre, path, result) {
  17334. if (current === pre) { return }
  17335. var rootCurrentType = type(current);
  17336. var rootPreType = type(pre);
  17337. if (rootCurrentType == OBJECTTYPE) {
  17338. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  17339. setResult(result, path, current);
  17340. } else {
  17341. var loop = function ( key ) {
  17342. var currentValue = current[key];
  17343. var preValue = pre[key];
  17344. var currentType = type(currentValue);
  17345. var preType = type(preValue);
  17346. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  17347. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  17348. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17349. }
  17350. } else if (currentType == ARRAYTYPE) {
  17351. if (preType != ARRAYTYPE) {
  17352. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17353. } else {
  17354. if (currentValue.length < preValue.length) {
  17355. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17356. } else {
  17357. currentValue.forEach(function (item, index) {
  17358. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  17359. });
  17360. }
  17361. }
  17362. } else if (currentType == OBJECTTYPE) {
  17363. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  17364. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17365. } else {
  17366. for (var subKey in currentValue) {
  17367. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  17368. }
  17369. }
  17370. }
  17371. };
  17372. for (var key in current) loop( key );
  17373. }
  17374. } else if (rootCurrentType == ARRAYTYPE) {
  17375. if (rootPreType != ARRAYTYPE) {
  17376. setResult(result, path, current);
  17377. } else {
  17378. if (current.length < pre.length) {
  17379. setResult(result, path, current);
  17380. } else {
  17381. current.forEach(function (item, index) {
  17382. _diff(item, pre[index], path + '[' + index + ']', result);
  17383. });
  17384. }
  17385. }
  17386. } else {
  17387. setResult(result, path, current);
  17388. }
  17389. }
  17390. function setResult(result, k, v) {
  17391. // if (type(v) != FUNCTIONTYPE) {
  17392. result[k] = v;
  17393. // }
  17394. }
  17395. function type(obj) {
  17396. return Object.prototype.toString.call(obj)
  17397. }
  17398. /* */
  17399. function flushCallbacks$1(vm) {
  17400. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  17401. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17402. var mpInstance = vm.$scope;
  17403. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17404. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  17405. }
  17406. var copies = vm.__next_tick_callbacks.slice(0);
  17407. vm.__next_tick_callbacks.length = 0;
  17408. for (var i = 0; i < copies.length; i++) {
  17409. copies[i]();
  17410. }
  17411. }
  17412. }
  17413. function hasRenderWatcher(vm) {
  17414. return queue.find(function (watcher) { return vm._watcher === watcher; })
  17415. }
  17416. function nextTick$1(vm, cb) {
  17417. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  17418. //2.nextTick 之前存在 render watcher
  17419. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  17420. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  17421. var mpInstance = vm.$scope;
  17422. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17423. ']:nextVueTick');
  17424. }
  17425. return nextTick(cb, vm)
  17426. }else{
  17427. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  17428. var mpInstance$1 = vm.$scope;
  17429. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  17430. ']:nextMPTick');
  17431. }
  17432. }
  17433. var _resolve;
  17434. if (!vm.__next_tick_callbacks) {
  17435. vm.__next_tick_callbacks = [];
  17436. }
  17437. vm.__next_tick_callbacks.push(function () {
  17438. if (cb) {
  17439. try {
  17440. cb.call(vm);
  17441. } catch (e) {
  17442. handleError(e, vm, 'nextTick');
  17443. }
  17444. } else if (_resolve) {
  17445. _resolve(vm);
  17446. }
  17447. });
  17448. // $flow-disable-line
  17449. if (!cb && typeof Promise !== 'undefined') {
  17450. return new Promise(function (resolve) {
  17451. _resolve = resolve;
  17452. })
  17453. }
  17454. }
  17455. /* */
  17456. function clearInstance(key, value) {
  17457. // 简易去除 Vue 和小程序组件实例
  17458. if (value) {
  17459. if (value._isVue || value.__v_isMPComponent) {
  17460. return {}
  17461. }
  17462. }
  17463. return value
  17464. }
  17465. function cloneWithData(vm) {
  17466. // 确保当前 vm 所有数据被同步
  17467. var ret = Object.create(null);
  17468. var dataKeys = [].concat(
  17469. Object.keys(vm._data || {}),
  17470. Object.keys(vm._computedWatchers || {}));
  17471. dataKeys.reduce(function(ret, key) {
  17472. ret[key] = vm[key];
  17473. return ret
  17474. }, ret);
  17475. // vue-composition-api
  17476. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  17477. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  17478. if (rawBindings) {
  17479. Object.keys(rawBindings).forEach(function (key) {
  17480. ret[key] = vm[key];
  17481. });
  17482. }
  17483. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  17484. Object.assign(ret, vm.$mp.data || {});
  17485. if (
  17486. Array.isArray(vm.$options.behaviors) &&
  17487. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  17488. ) { //form-field
  17489. ret['name'] = vm.name;
  17490. ret['value'] = vm.value;
  17491. }
  17492. return JSON.parse(JSON.stringify(ret, clearInstance))
  17493. }
  17494. var patch = function(oldVnode, vnode) {
  17495. var this$1 = this;
  17496. if (vnode === null) { //destroy
  17497. return
  17498. }
  17499. if (this.mpType === 'page' || this.mpType === 'component') {
  17500. var mpInstance = this.$scope;
  17501. var data = Object.create(null);
  17502. try {
  17503. data = cloneWithData(this);
  17504. } catch (err) {
  17505. console.error(err);
  17506. }
  17507. data.__webviewId__ = mpInstance.data.__webviewId__;
  17508. var mpData = Object.create(null);
  17509. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  17510. mpData[key] = mpInstance.data[key];
  17511. });
  17512. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  17513. if (Object.keys(diffData).length) {
  17514. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17515. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  17516. ']差量更新',
  17517. JSON.stringify(diffData));
  17518. }
  17519. this.__next_tick_pending = true;
  17520. mpInstance.setData(diffData, function () {
  17521. this$1.__next_tick_pending = false;
  17522. flushCallbacks$1(this$1);
  17523. });
  17524. } else {
  17525. flushCallbacks$1(this);
  17526. }
  17527. }
  17528. };
  17529. /* */
  17530. function createEmptyRender() {
  17531. }
  17532. function mountComponent$1(
  17533. vm,
  17534. el,
  17535. hydrating
  17536. ) {
  17537. if (!vm.mpType) {//main.js 中的 new Vue
  17538. return vm
  17539. }
  17540. if (vm.mpType === 'app') {
  17541. vm.$options.render = createEmptyRender;
  17542. }
  17543. if (!vm.$options.render) {
  17544. vm.$options.render = createEmptyRender;
  17545. if (true) {
  17546. /* istanbul ignore if */
  17547. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  17548. vm.$options.el || el) {
  17549. warn(
  17550. 'You are using the runtime-only build of Vue where the template ' +
  17551. 'compiler is not available. Either pre-compile the templates into ' +
  17552. 'render functions, or use the compiler-included build.',
  17553. vm
  17554. );
  17555. } else {
  17556. warn(
  17557. 'Failed to mount component: template or render function not defined.',
  17558. vm
  17559. );
  17560. }
  17561. }
  17562. }
  17563. !vm._$fallback && callHook(vm, 'beforeMount');
  17564. var updateComponent = function () {
  17565. vm._update(vm._render(), hydrating);
  17566. };
  17567. // we set this to vm._watcher inside the watcher's constructor
  17568. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  17569. // component's mounted hook), which relies on vm._watcher being already defined
  17570. new Watcher(vm, updateComponent, noop, {
  17571. before: function before() {
  17572. if (vm._isMounted && !vm._isDestroyed) {
  17573. callHook(vm, 'beforeUpdate');
  17574. }
  17575. }
  17576. }, true /* isRenderWatcher */);
  17577. hydrating = false;
  17578. return vm
  17579. }
  17580. /* */
  17581. function renderClass (
  17582. staticClass,
  17583. dynamicClass
  17584. ) {
  17585. if (isDef(staticClass) || isDef(dynamicClass)) {
  17586. return concat(staticClass, stringifyClass(dynamicClass))
  17587. }
  17588. /* istanbul ignore next */
  17589. return ''
  17590. }
  17591. function concat (a, b) {
  17592. return a ? b ? (a + ' ' + b) : a : (b || '')
  17593. }
  17594. function stringifyClass (value) {
  17595. if (Array.isArray(value)) {
  17596. return stringifyArray(value)
  17597. }
  17598. if (isObject(value)) {
  17599. return stringifyObject(value)
  17600. }
  17601. if (typeof value === 'string') {
  17602. return value
  17603. }
  17604. /* istanbul ignore next */
  17605. return ''
  17606. }
  17607. function stringifyArray (value) {
  17608. var res = '';
  17609. var stringified;
  17610. for (var i = 0, l = value.length; i < l; i++) {
  17611. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  17612. if (res) { res += ' '; }
  17613. res += stringified;
  17614. }
  17615. }
  17616. return res
  17617. }
  17618. function stringifyObject (value) {
  17619. var res = '';
  17620. for (var key in value) {
  17621. if (value[key]) {
  17622. if (res) { res += ' '; }
  17623. res += key;
  17624. }
  17625. }
  17626. return res
  17627. }
  17628. /* */
  17629. var parseStyleText = cached(function (cssText) {
  17630. var res = {};
  17631. var listDelimiter = /;(?![^(]*\))/g;
  17632. var propertyDelimiter = /:(.+)/;
  17633. cssText.split(listDelimiter).forEach(function (item) {
  17634. if (item) {
  17635. var tmp = item.split(propertyDelimiter);
  17636. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  17637. }
  17638. });
  17639. return res
  17640. });
  17641. // normalize possible array / string values into Object
  17642. function normalizeStyleBinding (bindingStyle) {
  17643. if (Array.isArray(bindingStyle)) {
  17644. return toObject(bindingStyle)
  17645. }
  17646. if (typeof bindingStyle === 'string') {
  17647. return parseStyleText(bindingStyle)
  17648. }
  17649. return bindingStyle
  17650. }
  17651. /* */
  17652. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  17653. function getTarget(obj, path) {
  17654. var parts = path.split('.');
  17655. var key = parts[0];
  17656. if (key.indexOf('__$n') === 0) { //number index
  17657. key = parseInt(key.replace('__$n', ''));
  17658. }
  17659. if (parts.length === 1) {
  17660. return obj[key]
  17661. }
  17662. return getTarget(obj[key], parts.slice(1).join('.'))
  17663. }
  17664. function internalMixin(Vue) {
  17665. Vue.config.errorHandler = function(err, vm, info) {
  17666. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  17667. console.error(err);
  17668. /* eslint-disable no-undef */
  17669. var app = typeof getApp === 'function' && getApp();
  17670. if (app && app.onError) {
  17671. app.onError(err);
  17672. }
  17673. };
  17674. var oldEmit = Vue.prototype.$emit;
  17675. Vue.prototype.$emit = function(event) {
  17676. if (this.$scope && event) {
  17677. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  17678. if (triggerEvent) {
  17679. try {
  17680. triggerEvent.call(this.$scope, event, {
  17681. __args__: toArray(arguments, 1)
  17682. });
  17683. } catch (error) {
  17684. }
  17685. }
  17686. }
  17687. return oldEmit.apply(this, arguments)
  17688. };
  17689. Vue.prototype.$nextTick = function(fn) {
  17690. return nextTick$1(this, fn)
  17691. };
  17692. MP_METHODS.forEach(function (method) {
  17693. Vue.prototype[method] = function(args) {
  17694. if (this.$scope && this.$scope[method]) {
  17695. return this.$scope[method](args)
  17696. }
  17697. // mp-alipay
  17698. if (typeof my === 'undefined') {
  17699. return
  17700. }
  17701. if (method === 'createSelectorQuery') {
  17702. /* eslint-disable no-undef */
  17703. return my.createSelectorQuery(args)
  17704. } else if (method === 'createIntersectionObserver') {
  17705. /* eslint-disable no-undef */
  17706. return my.createIntersectionObserver(args)
  17707. }
  17708. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  17709. };
  17710. });
  17711. Vue.prototype.__init_provide = initProvide;
  17712. Vue.prototype.__init_injections = initInjections;
  17713. Vue.prototype.__call_hook = function(hook, args) {
  17714. var vm = this;
  17715. // #7573 disable dep collection when invoking lifecycle hooks
  17716. pushTarget();
  17717. var handlers = vm.$options[hook];
  17718. var info = hook + " hook";
  17719. var ret;
  17720. if (handlers) {
  17721. for (var i = 0, j = handlers.length; i < j; i++) {
  17722. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  17723. }
  17724. }
  17725. if (vm._hasHookEvent) {
  17726. vm.$emit('hook:' + hook, args);
  17727. }
  17728. popTarget();
  17729. return ret
  17730. };
  17731. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  17732. if (Array.isArray(modifiers)) {
  17733. if (modifiers.indexOf('trim') !== -1) {
  17734. value = value.trim();
  17735. }
  17736. if (modifiers.indexOf('number') !== -1) {
  17737. value = this._n(value);
  17738. }
  17739. }
  17740. if (!target) {
  17741. target = this;
  17742. }
  17743. // 解决动态属性添加
  17744. Vue.set(target, key, value);
  17745. };
  17746. Vue.prototype.__set_sync = function(target, key, value) {
  17747. if (!target) {
  17748. target = this;
  17749. }
  17750. // 解决动态属性添加
  17751. Vue.set(target, key, value);
  17752. };
  17753. Vue.prototype.__get_orig = function(item) {
  17754. if (isPlainObject(item)) {
  17755. return item['$orig'] || item
  17756. }
  17757. return item
  17758. };
  17759. Vue.prototype.__get_value = function(dataPath, target) {
  17760. return getTarget(target || this, dataPath)
  17761. };
  17762. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  17763. return renderClass(staticClass, dynamicClass)
  17764. };
  17765. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  17766. if (!dynamicStyle && !staticStyle) {
  17767. return ''
  17768. }
  17769. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  17770. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  17771. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  17772. };
  17773. Vue.prototype.__map = function(val, iteratee) {
  17774. //TODO 暂不考虑 string
  17775. var ret, i, l, keys, key;
  17776. if (Array.isArray(val)) {
  17777. ret = new Array(val.length);
  17778. for (i = 0, l = val.length; i < l; i++) {
  17779. ret[i] = iteratee(val[i], i);
  17780. }
  17781. return ret
  17782. } else if (isObject(val)) {
  17783. keys = Object.keys(val);
  17784. ret = Object.create(null);
  17785. for (i = 0, l = keys.length; i < l; i++) {
  17786. key = keys[i];
  17787. ret[key] = iteratee(val[key], key, i);
  17788. }
  17789. return ret
  17790. } else if (typeof val === 'number') {
  17791. ret = new Array(val);
  17792. for (i = 0, l = val; i < l; i++) {
  17793. // 第一个参数暂时仍和小程序一致
  17794. ret[i] = iteratee(i, i);
  17795. }
  17796. return ret
  17797. }
  17798. return []
  17799. };
  17800. }
  17801. /* */
  17802. var LIFECYCLE_HOOKS$1 = [
  17803. //App
  17804. 'onLaunch',
  17805. 'onShow',
  17806. 'onHide',
  17807. 'onUniNViewMessage',
  17808. 'onPageNotFound',
  17809. 'onThemeChange',
  17810. 'onError',
  17811. 'onUnhandledRejection',
  17812. //Page
  17813. 'onInit',
  17814. 'onLoad',
  17815. // 'onShow',
  17816. 'onReady',
  17817. // 'onHide',
  17818. 'onUnload',
  17819. 'onPullDownRefresh',
  17820. 'onReachBottom',
  17821. 'onTabItemTap',
  17822. 'onAddToFavorites',
  17823. 'onShareTimeline',
  17824. 'onShareAppMessage',
  17825. 'onResize',
  17826. 'onPageScroll',
  17827. 'onNavigationBarButtonTap',
  17828. 'onBackPress',
  17829. 'onNavigationBarSearchInputChanged',
  17830. 'onNavigationBarSearchInputConfirmed',
  17831. 'onNavigationBarSearchInputClicked',
  17832. //Component
  17833. // 'onReady', // 兼容旧版本,应该移除该事件
  17834. 'onPageShow',
  17835. 'onPageHide',
  17836. 'onPageResize',
  17837. 'onUploadDouyinVideo'
  17838. ];
  17839. function lifecycleMixin$1(Vue) {
  17840. //fixed vue-class-component
  17841. var oldExtend = Vue.extend;
  17842. Vue.extend = function(extendOptions) {
  17843. extendOptions = extendOptions || {};
  17844. var methods = extendOptions.methods;
  17845. if (methods) {
  17846. Object.keys(methods).forEach(function (methodName) {
  17847. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  17848. extendOptions[methodName] = methods[methodName];
  17849. delete methods[methodName];
  17850. }
  17851. });
  17852. }
  17853. return oldExtend.call(this, extendOptions)
  17854. };
  17855. var strategies = Vue.config.optionMergeStrategies;
  17856. var mergeHook = strategies.created;
  17857. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  17858. strategies[hook] = mergeHook;
  17859. });
  17860. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  17861. }
  17862. /* */
  17863. // install platform patch function
  17864. Vue.prototype.__patch__ = patch;
  17865. // public mount method
  17866. Vue.prototype.$mount = function(
  17867. el ,
  17868. hydrating
  17869. ) {
  17870. return mountComponent$1(this, el, hydrating)
  17871. };
  17872. lifecycleMixin$1(Vue);
  17873. internalMixin(Vue);
  17874. /* */
  17875. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  17876. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  17877. /***/ }),
  17878. /***/ 26:
  17879. /*!*****************************************!*\
  17880. !*** D:/project/项目模板/uniapp/pages.json ***!
  17881. \*****************************************/
  17882. /*! no static exports found */
  17883. /***/ (function(module, exports) {
  17884. /***/ }),
  17885. /***/ 3:
  17886. /*!***********************************!*\
  17887. !*** (webpack)/buildin/global.js ***!
  17888. \***********************************/
  17889. /*! no static exports found */
  17890. /***/ (function(module, exports) {
  17891. var g;
  17892. // This works in non-strict mode
  17893. g = (function() {
  17894. return this;
  17895. })();
  17896. try {
  17897. // This works if eval is allowed (see CSP)
  17898. g = g || new Function("return this")();
  17899. } catch (e) {
  17900. // This works if the window reference is available
  17901. if (typeof window === "object") g = window;
  17902. }
  17903. // g can still be undefined, but nothing to do about it...
  17904. // We return undefined, instead of nothing here, so it's
  17905. // easier to handle this case. if(!global) { ...}
  17906. module.exports = g;
  17907. /***/ }),
  17908. /***/ 32:
  17909. /*!**********************************************************************************************************!*\
  17910. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  17911. \**********************************************************************************************************/
  17912. /*! exports provided: default */
  17913. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17914. "use strict";
  17915. __webpack_require__.r(__webpack_exports__);
  17916. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  17917. /* globals __VUE_SSR_CONTEXT__ */
  17918. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  17919. // This module is a runtime utility for cleaner component module output and will
  17920. // be included in the final webpack user bundle.
  17921. function normalizeComponent (
  17922. scriptExports,
  17923. render,
  17924. staticRenderFns,
  17925. functionalTemplate,
  17926. injectStyles,
  17927. scopeId,
  17928. moduleIdentifier, /* server only */
  17929. shadowMode, /* vue-cli only */
  17930. components, // fixed by xxxxxx auto components
  17931. renderjs // fixed by xxxxxx renderjs
  17932. ) {
  17933. // Vue.extend constructor export interop
  17934. var options = typeof scriptExports === 'function'
  17935. ? scriptExports.options
  17936. : scriptExports
  17937. // fixed by xxxxxx auto components
  17938. if (components) {
  17939. if (!options.components) {
  17940. options.components = {}
  17941. }
  17942. var hasOwn = Object.prototype.hasOwnProperty
  17943. for (var name in components) {
  17944. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  17945. options.components[name] = components[name]
  17946. }
  17947. }
  17948. }
  17949. // fixed by xxxxxx renderjs
  17950. if (renderjs) {
  17951. if(typeof renderjs.beforeCreate === 'function'){
  17952. renderjs.beforeCreate = [renderjs.beforeCreate]
  17953. }
  17954. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  17955. this[renderjs.__module] = this
  17956. });
  17957. (options.mixins || (options.mixins = [])).push(renderjs)
  17958. }
  17959. // render functions
  17960. if (render) {
  17961. options.render = render
  17962. options.staticRenderFns = staticRenderFns
  17963. options._compiled = true
  17964. }
  17965. // functional template
  17966. if (functionalTemplate) {
  17967. options.functional = true
  17968. }
  17969. // scopedId
  17970. if (scopeId) {
  17971. options._scopeId = 'data-v-' + scopeId
  17972. }
  17973. var hook
  17974. if (moduleIdentifier) { // server build
  17975. hook = function (context) {
  17976. // 2.3 injection
  17977. context =
  17978. context || // cached call
  17979. (this.$vnode && this.$vnode.ssrContext) || // stateful
  17980. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  17981. // 2.2 with runInNewContext: true
  17982. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  17983. context = __VUE_SSR_CONTEXT__
  17984. }
  17985. // inject component styles
  17986. if (injectStyles) {
  17987. injectStyles.call(this, context)
  17988. }
  17989. // register component module identifier for async chunk inferrence
  17990. if (context && context._registeredComponents) {
  17991. context._registeredComponents.add(moduleIdentifier)
  17992. }
  17993. }
  17994. // used by ssr in case component is cached and beforeCreate
  17995. // never gets called
  17996. options._ssrRegister = hook
  17997. } else if (injectStyles) {
  17998. hook = shadowMode
  17999. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  18000. : injectStyles
  18001. }
  18002. if (hook) {
  18003. if (options.functional) {
  18004. // for template-only hot-reload because in that case the render fn doesn't
  18005. // go through the normalizer
  18006. options._injectStyles = hook
  18007. // register for functioal component in vue file
  18008. var originalRender = options.render
  18009. options.render = function renderWithStyleInjection (h, context) {
  18010. hook.call(context)
  18011. return originalRender(h, context)
  18012. }
  18013. } else {
  18014. // inject component registration as beforeCreate hook
  18015. var existing = options.beforeCreate
  18016. options.beforeCreate = existing
  18017. ? [].concat(existing, hook)
  18018. : [hook]
  18019. }
  18020. }
  18021. return {
  18022. exports: scriptExports,
  18023. options: options
  18024. }
  18025. }
  18026. /***/ }),
  18027. /***/ 33:
  18028. /*!***********************************************!*\
  18029. !*** D:/project/项目模板/uniapp/common/config.js ***!
  18030. \***********************************************/
  18031. /*! no static exports found */
  18032. /***/ (function(module, exports, __webpack_require__) {
  18033. "use strict";
  18034. /* WEBPACK VAR INJECTION */(function(uni) {
  18035. Object.defineProperty(exports, "__esModule", {
  18036. value: true
  18037. });
  18038. exports.default = void 0;
  18039. var _default = {
  18040. // 接口地址
  18041. serverUrl: "http://broadcast.waityou24.cn",
  18042. //http://47.93.34.200 http://www.freeskyghw.cn http://192.168.1.144:10102
  18043. fileserverUrl: 'http://broadcast.waityou24.cn',
  18044. wechatUrl: "http://broadcast.waityou24.cn",
  18045. // 设备信息
  18046. system: uni.getSystemInfoSync(),
  18047. // 节目类型
  18048. pro_type: [
  18049. //
  18050. {
  18051. dict_label: '电视节目',
  18052. dict_value: '0'
  18053. }, {
  18054. dict_label: '电影节目',
  18055. dict_value: '1'
  18056. }]
  18057. };
  18058. exports.default = _default;
  18059. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18060. /***/ }),
  18061. /***/ 34:
  18062. /*!********************************************!*\
  18063. !*** D:/project/项目模板/uniapp/common/api.js ***!
  18064. \********************************************/
  18065. /*! no static exports found */
  18066. /***/ (function(module, exports, __webpack_require__) {
  18067. "use strict";
  18068. /* WEBPACK VAR INJECTION */(function(uni) {
  18069. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18070. Object.defineProperty(exports, "__esModule", {
  18071. value: true
  18072. });
  18073. exports.requestFile = exports.requestBase = void 0;
  18074. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  18075. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  18076. var _config = _interopRequireDefault(__webpack_require__(/*! ../common/config */ 33));
  18077. var getDomain = function getDomain(uri, type) {
  18078. var serverUrl = _config.default.serverUrl,
  18079. fileserverUrl = _config.default.fileserverUrl,
  18080. wechatUrl = _config.default.wechatUrl;
  18081. // 自定义
  18082. if (uri.includes("http")) return uri;
  18083. // 微信
  18084. if (uri.startsWith("/wechat/api")) return wechatUrl + uri;
  18085. // 地址前缀
  18086. else if (type) return serverUrl + "/projectadmin/".concat(type, "/api/") + uri;
  18087. // 常规
  18088. return serverUrl + "/projectadmin/api/" + uri;
  18089. };
  18090. // 常规请求
  18091. var requestBase = /*#__PURE__*/function () {
  18092. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(uri) {
  18093. var method,
  18094. data,
  18095. type,
  18096. baseUrl,
  18097. header,
  18098. token,
  18099. _args = arguments;
  18100. return _regenerator.default.wrap(function _callee$(_context) {
  18101. while (1) {
  18102. switch (_context.prev = _context.next) {
  18103. case 0:
  18104. method = _args.length > 1 && _args[1] !== undefined ? _args[1] : "GET";
  18105. data = _args.length > 2 ? _args[2] : undefined;
  18106. type = _args.length > 3 ? _args[3] : undefined;
  18107. // 请求地址
  18108. baseUrl = getDomain(uri, type); // 请求头
  18109. header = {}; // 用户信息
  18110. token = "";
  18111. if (token) header.token = token;
  18112. return _context.abrupt("return", new Promise(function (resolve, reject) {
  18113. uni.request({
  18114. url: baseUrl,
  18115. method: method,
  18116. data: data,
  18117. header: header,
  18118. success: function success(res) {
  18119. return toResolve(resolve, res);
  18120. },
  18121. fail: function fail(err) {
  18122. console.log(err);
  18123. }
  18124. });
  18125. }));
  18126. case 8:
  18127. case "end":
  18128. return _context.stop();
  18129. }
  18130. }
  18131. }, _callee);
  18132. }));
  18133. return function requestBase(_x) {
  18134. return _ref.apply(this, arguments);
  18135. };
  18136. }();
  18137. // 图片请求
  18138. exports.requestBase = requestBase;
  18139. var requestFile = function requestFile(uri, method, data, type) {
  18140. // 请求地址
  18141. // let baseUrl = getDomain(uri, type);
  18142. return new Promise(function (resolve, reject) {
  18143. uni.uploadFile({
  18144. url: "".concat(_config.default.fileserverUrl, "/").concat(uri),
  18145. filePath: data,
  18146. name: 'file',
  18147. formData: {},
  18148. success: function success(res) {
  18149. return toResolve(resolve, res);
  18150. },
  18151. error: function error(e) {
  18152. return toReject(reject, e);
  18153. }
  18154. });
  18155. });
  18156. };
  18157. exports.requestFile = requestFile;
  18158. var toResolve = function toResolve(resolve, result) {
  18159. if (result.statusCode === 200) resolve(result.data);
  18160. };
  18161. var toReject = function toReject(reject, result) {
  18162. reject(result);
  18163. };
  18164. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18165. /***/ }),
  18166. /***/ 35:
  18167. /*!************************************************************************************************!*\
  18168. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  18169. \************************************************************************************************/
  18170. /*! no static exports found */
  18171. /***/ (function(module, exports, __webpack_require__) {
  18172. // TODO(Babel 8): Remove this file.
  18173. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 36)();
  18174. module.exports = runtime;
  18175. /***/ }),
  18176. /***/ 36:
  18177. /*!*******************************************************************!*\
  18178. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  18179. \*******************************************************************/
  18180. /*! no static exports found */
  18181. /***/ (function(module, exports, __webpack_require__) {
  18182. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  18183. function _regeneratorRuntime() {
  18184. "use strict";
  18185. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  18186. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  18187. return exports;
  18188. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18189. var exports = {},
  18190. Op = Object.prototype,
  18191. hasOwn = Op.hasOwnProperty,
  18192. defineProperty = Object.defineProperty || function (obj, key, desc) {
  18193. obj[key] = desc.value;
  18194. },
  18195. $Symbol = "function" == typeof Symbol ? Symbol : {},
  18196. iteratorSymbol = $Symbol.iterator || "@@iterator",
  18197. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  18198. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  18199. function define(obj, key, value) {
  18200. return Object.defineProperty(obj, key, {
  18201. value: value,
  18202. enumerable: !0,
  18203. configurable: !0,
  18204. writable: !0
  18205. }), obj[key];
  18206. }
  18207. try {
  18208. define({}, "");
  18209. } catch (err) {
  18210. define = function define(obj, key, value) {
  18211. return obj[key] = value;
  18212. };
  18213. }
  18214. function wrap(innerFn, outerFn, self, tryLocsList) {
  18215. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  18216. generator = Object.create(protoGenerator.prototype),
  18217. context = new Context(tryLocsList || []);
  18218. return defineProperty(generator, "_invoke", {
  18219. value: makeInvokeMethod(innerFn, self, context)
  18220. }), generator;
  18221. }
  18222. function tryCatch(fn, obj, arg) {
  18223. try {
  18224. return {
  18225. type: "normal",
  18226. arg: fn.call(obj, arg)
  18227. };
  18228. } catch (err) {
  18229. return {
  18230. type: "throw",
  18231. arg: err
  18232. };
  18233. }
  18234. }
  18235. exports.wrap = wrap;
  18236. var ContinueSentinel = {};
  18237. function Generator() {}
  18238. function GeneratorFunction() {}
  18239. function GeneratorFunctionPrototype() {}
  18240. var IteratorPrototype = {};
  18241. define(IteratorPrototype, iteratorSymbol, function () {
  18242. return this;
  18243. });
  18244. var getProto = Object.getPrototypeOf,
  18245. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  18246. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  18247. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  18248. function defineIteratorMethods(prototype) {
  18249. ["next", "throw", "return"].forEach(function (method) {
  18250. define(prototype, method, function (arg) {
  18251. return this._invoke(method, arg);
  18252. });
  18253. });
  18254. }
  18255. function AsyncIterator(generator, PromiseImpl) {
  18256. function invoke(method, arg, resolve, reject) {
  18257. var record = tryCatch(generator[method], generator, arg);
  18258. if ("throw" !== record.type) {
  18259. var result = record.arg,
  18260. value = result.value;
  18261. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  18262. invoke("next", value, resolve, reject);
  18263. }, function (err) {
  18264. invoke("throw", err, resolve, reject);
  18265. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  18266. result.value = unwrapped, resolve(result);
  18267. }, function (error) {
  18268. return invoke("throw", error, resolve, reject);
  18269. });
  18270. }
  18271. reject(record.arg);
  18272. }
  18273. var previousPromise;
  18274. defineProperty(this, "_invoke", {
  18275. value: function value(method, arg) {
  18276. function callInvokeWithMethodAndArg() {
  18277. return new PromiseImpl(function (resolve, reject) {
  18278. invoke(method, arg, resolve, reject);
  18279. });
  18280. }
  18281. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  18282. }
  18283. });
  18284. }
  18285. function makeInvokeMethod(innerFn, self, context) {
  18286. var state = "suspendedStart";
  18287. return function (method, arg) {
  18288. if ("executing" === state) throw new Error("Generator is already running");
  18289. if ("completed" === state) {
  18290. if ("throw" === method) throw arg;
  18291. return doneResult();
  18292. }
  18293. for (context.method = method, context.arg = arg;;) {
  18294. var delegate = context.delegate;
  18295. if (delegate) {
  18296. var delegateResult = maybeInvokeDelegate(delegate, context);
  18297. if (delegateResult) {
  18298. if (delegateResult === ContinueSentinel) continue;
  18299. return delegateResult;
  18300. }
  18301. }
  18302. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  18303. if ("suspendedStart" === state) throw state = "completed", context.arg;
  18304. context.dispatchException(context.arg);
  18305. } else "return" === context.method && context.abrupt("return", context.arg);
  18306. state = "executing";
  18307. var record = tryCatch(innerFn, self, context);
  18308. if ("normal" === record.type) {
  18309. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  18310. return {
  18311. value: record.arg,
  18312. done: context.done
  18313. };
  18314. }
  18315. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  18316. }
  18317. };
  18318. }
  18319. function maybeInvokeDelegate(delegate, context) {
  18320. var methodName = context.method,
  18321. method = delegate.iterator[methodName];
  18322. 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;
  18323. var record = tryCatch(method, delegate.iterator, context.arg);
  18324. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  18325. var info = record.arg;
  18326. 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);
  18327. }
  18328. function pushTryEntry(locs) {
  18329. var entry = {
  18330. tryLoc: locs[0]
  18331. };
  18332. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  18333. }
  18334. function resetTryEntry(entry) {
  18335. var record = entry.completion || {};
  18336. record.type = "normal", delete record.arg, entry.completion = record;
  18337. }
  18338. function Context(tryLocsList) {
  18339. this.tryEntries = [{
  18340. tryLoc: "root"
  18341. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  18342. }
  18343. function values(iterable) {
  18344. if (iterable) {
  18345. var iteratorMethod = iterable[iteratorSymbol];
  18346. if (iteratorMethod) return iteratorMethod.call(iterable);
  18347. if ("function" == typeof iterable.next) return iterable;
  18348. if (!isNaN(iterable.length)) {
  18349. var i = -1,
  18350. next = function next() {
  18351. for (; ++i < iterable.length;) {
  18352. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  18353. }
  18354. return next.value = undefined, next.done = !0, next;
  18355. };
  18356. return next.next = next;
  18357. }
  18358. }
  18359. return {
  18360. next: doneResult
  18361. };
  18362. }
  18363. function doneResult() {
  18364. return {
  18365. value: undefined,
  18366. done: !0
  18367. };
  18368. }
  18369. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  18370. value: GeneratorFunctionPrototype,
  18371. configurable: !0
  18372. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  18373. value: GeneratorFunction,
  18374. configurable: !0
  18375. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  18376. var ctor = "function" == typeof genFun && genFun.constructor;
  18377. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  18378. }, exports.mark = function (genFun) {
  18379. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  18380. }, exports.awrap = function (arg) {
  18381. return {
  18382. __await: arg
  18383. };
  18384. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  18385. return this;
  18386. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  18387. void 0 === PromiseImpl && (PromiseImpl = Promise);
  18388. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  18389. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  18390. return result.done ? result.value : iter.next();
  18391. });
  18392. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  18393. return this;
  18394. }), define(Gp, "toString", function () {
  18395. return "[object Generator]";
  18396. }), exports.keys = function (val) {
  18397. var object = Object(val),
  18398. keys = [];
  18399. for (var key in object) {
  18400. keys.push(key);
  18401. }
  18402. return keys.reverse(), function next() {
  18403. for (; keys.length;) {
  18404. var key = keys.pop();
  18405. if (key in object) return next.value = key, next.done = !1, next;
  18406. }
  18407. return next.done = !0, next;
  18408. };
  18409. }, exports.values = values, Context.prototype = {
  18410. constructor: Context,
  18411. reset: function reset(skipTempReset) {
  18412. 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) {
  18413. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  18414. }
  18415. },
  18416. stop: function stop() {
  18417. this.done = !0;
  18418. var rootRecord = this.tryEntries[0].completion;
  18419. if ("throw" === rootRecord.type) throw rootRecord.arg;
  18420. return this.rval;
  18421. },
  18422. dispatchException: function dispatchException(exception) {
  18423. if (this.done) throw exception;
  18424. var context = this;
  18425. function handle(loc, caught) {
  18426. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  18427. }
  18428. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18429. var entry = this.tryEntries[i],
  18430. record = entry.completion;
  18431. if ("root" === entry.tryLoc) return handle("end");
  18432. if (entry.tryLoc <= this.prev) {
  18433. var hasCatch = hasOwn.call(entry, "catchLoc"),
  18434. hasFinally = hasOwn.call(entry, "finallyLoc");
  18435. if (hasCatch && hasFinally) {
  18436. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  18437. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  18438. } else if (hasCatch) {
  18439. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  18440. } else {
  18441. if (!hasFinally) throw new Error("try statement without catch or finally");
  18442. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  18443. }
  18444. }
  18445. }
  18446. },
  18447. abrupt: function abrupt(type, arg) {
  18448. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18449. var entry = this.tryEntries[i];
  18450. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  18451. var finallyEntry = entry;
  18452. break;
  18453. }
  18454. }
  18455. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  18456. var record = finallyEntry ? finallyEntry.completion : {};
  18457. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  18458. },
  18459. complete: function complete(record, afterLoc) {
  18460. if ("throw" === record.type) throw record.arg;
  18461. 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;
  18462. },
  18463. finish: function finish(finallyLoc) {
  18464. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18465. var entry = this.tryEntries[i];
  18466. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  18467. }
  18468. },
  18469. "catch": function _catch(tryLoc) {
  18470. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  18471. var entry = this.tryEntries[i];
  18472. if (entry.tryLoc === tryLoc) {
  18473. var record = entry.completion;
  18474. if ("throw" === record.type) {
  18475. var thrown = record.arg;
  18476. resetTryEntry(entry);
  18477. }
  18478. return thrown;
  18479. }
  18480. }
  18481. throw new Error("illegal catch attempt");
  18482. },
  18483. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  18484. return this.delegate = {
  18485. iterator: values(iterable),
  18486. resultName: resultName,
  18487. nextLoc: nextLoc
  18488. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  18489. }
  18490. }, exports;
  18491. }
  18492. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18493. /***/ }),
  18494. /***/ 37:
  18495. /*!*****************************************************************!*\
  18496. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  18497. \*****************************************************************/
  18498. /*! no static exports found */
  18499. /***/ (function(module, exports) {
  18500. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  18501. try {
  18502. var info = gen[key](arg);
  18503. var value = info.value;
  18504. } catch (error) {
  18505. reject(error);
  18506. return;
  18507. }
  18508. if (info.done) {
  18509. resolve(value);
  18510. } else {
  18511. Promise.resolve(value).then(_next, _throw);
  18512. }
  18513. }
  18514. function _asyncToGenerator(fn) {
  18515. return function () {
  18516. var self = this,
  18517. args = arguments;
  18518. return new Promise(function (resolve, reject) {
  18519. var gen = fn.apply(self, args);
  18520. function _next(value) {
  18521. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  18522. }
  18523. function _throw(err) {
  18524. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  18525. }
  18526. _next(undefined);
  18527. });
  18528. };
  18529. }
  18530. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18531. /***/ }),
  18532. /***/ 38:
  18533. /*!**************************************************!*\
  18534. !*** D:/project/项目模板/uniapp/common/weapp-jwt.js ***!
  18535. \**************************************************/
  18536. /*! no static exports found */
  18537. /***/ (function(module, exports, __webpack_require__) {
  18538. "use strict";
  18539. Object.defineProperty(exports, "__esModule", {
  18540. value: true
  18541. });
  18542. var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  18543. var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
  18544. exports.weBtoa = function (string) {
  18545. string = String(string);
  18546. var bitmap,
  18547. a,
  18548. b,
  18549. c,
  18550. result = "",
  18551. i = 0,
  18552. rest = string.length % 3;
  18553. for (; i < string.length;) {
  18554. if ((a = string.charCodeAt(i++)) > 255 || (b = string.charCodeAt(i++)) > 255 || (c = string.charCodeAt(i++)) > 255) throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");
  18555. bitmap = a << 16 | b << 8 | c;
  18556. result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
  18557. }
  18558. return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
  18559. };
  18560. exports.weAtob = function (string) {
  18561. string = String(string).replace(/[\t\n\f\r ]+/g, "");
  18562. if (!b64re.test(string)) throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  18563. string += "==".slice(2 - (string.length & 3));
  18564. var bitmap,
  18565. result = "",
  18566. r1,
  18567. r2,
  18568. i = 0;
  18569. for (; i < string.length;) {
  18570. bitmap = b64.indexOf(string.charAt(i++)) << 18 | b64.indexOf(string.charAt(i++)) << 12 | (r1 = b64.indexOf(string.charAt(i++))) << 6 | (r2 = b64.indexOf(string.charAt(i++)));
  18571. 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);
  18572. }
  18573. return result;
  18574. };
  18575. function b64DecodeUnicode(str) {
  18576. return decodeURIComponent(exports.weAtob(str).replace(/(.)/g, function (p) {
  18577. var code = p.charCodeAt(0).toString(16).toUpperCase();
  18578. if (code.length < 2) {
  18579. code = "0" + code;
  18580. }
  18581. return "%" + code;
  18582. }));
  18583. }
  18584. function base64_url_decode(str) {
  18585. var output = str.replace(/-/g, "+").replace(/_/g, "/");
  18586. switch (output.length % 4) {
  18587. case 0:
  18588. break;
  18589. case 2:
  18590. output += "==";
  18591. break;
  18592. case 3:
  18593. output += "=";
  18594. break;
  18595. default:
  18596. throw "Illegal base64url string!";
  18597. }
  18598. try {
  18599. return b64DecodeUnicode(output);
  18600. } catch (err) {
  18601. return exports.weAtob(output);
  18602. }
  18603. }
  18604. function weappJwtDecode(token, options) {
  18605. if (typeof token !== "string") {
  18606. throw "Invalid token specified";
  18607. }
  18608. options = options || {};
  18609. var pos = options.header === true ? 0 : 1;
  18610. try {
  18611. return JSON.parse(base64_url_decode(token.split(".")[pos]));
  18612. } catch (e) {
  18613. throw "Invalid token specified: " + e.message;
  18614. }
  18615. }
  18616. exports.default = weappJwtDecode;
  18617. /***/ }),
  18618. /***/ 4:
  18619. /*!**********************************************************************!*\
  18620. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  18621. \**********************************************************************/
  18622. /*! no static exports found */
  18623. /***/ (function(module, exports) {
  18624. function _interopRequireDefault(obj) {
  18625. return obj && obj.__esModule ? obj : {
  18626. "default": obj
  18627. };
  18628. }
  18629. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18630. /***/ }),
  18631. /***/ 5:
  18632. /*!**************************************************************!*\
  18633. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  18634. \**************************************************************/
  18635. /*! no static exports found */
  18636. /***/ (function(module, exports, __webpack_require__) {
  18637. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  18638. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  18639. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  18640. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  18641. function _slicedToArray(arr, i) {
  18642. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  18643. }
  18644. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18645. /***/ }),
  18646. /***/ 6:
  18647. /*!***************************************************************!*\
  18648. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  18649. \***************************************************************/
  18650. /*! no static exports found */
  18651. /***/ (function(module, exports) {
  18652. function _arrayWithHoles(arr) {
  18653. if (Array.isArray(arr)) return arr;
  18654. }
  18655. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18656. /***/ }),
  18657. /***/ 7:
  18658. /*!*********************************************************************!*\
  18659. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  18660. \*********************************************************************/
  18661. /*! no static exports found */
  18662. /***/ (function(module, exports) {
  18663. function _iterableToArrayLimit(arr, i) {
  18664. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  18665. if (null != _i) {
  18666. var _s,
  18667. _e,
  18668. _x,
  18669. _r,
  18670. _arr = [],
  18671. _n = !0,
  18672. _d = !1;
  18673. try {
  18674. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  18675. if (Object(_i) !== _i) return;
  18676. _n = !1;
  18677. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  18678. ;
  18679. }
  18680. } catch (err) {
  18681. _d = !0, _e = err;
  18682. } finally {
  18683. try {
  18684. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  18685. } finally {
  18686. if (_d) throw _e;
  18687. }
  18688. }
  18689. return _arr;
  18690. }
  18691. }
  18692. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18693. /***/ }),
  18694. /***/ 8:
  18695. /*!***************************************************************************!*\
  18696. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  18697. \***************************************************************************/
  18698. /*! no static exports found */
  18699. /***/ (function(module, exports, __webpack_require__) {
  18700. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  18701. function _unsupportedIterableToArray(o, minLen) {
  18702. if (!o) return;
  18703. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  18704. var n = Object.prototype.toString.call(o).slice(8, -1);
  18705. if (n === "Object" && o.constructor) n = o.constructor.name;
  18706. if (n === "Map" || n === "Set") return Array.from(o);
  18707. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  18708. }
  18709. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18710. /***/ }),
  18711. /***/ 9:
  18712. /*!*****************************************************************!*\
  18713. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  18714. \*****************************************************************/
  18715. /*! no static exports found */
  18716. /***/ (function(module, exports) {
  18717. function _arrayLikeToArray(arr, len) {
  18718. if (len == null || len > arr.length) len = arr.length;
  18719. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  18720. arr2[i] = arr[i];
  18721. }
  18722. return arr2;
  18723. }
  18724. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  18725. /***/ })
  18726. }]);
  18727. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map