vendor.js 554 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!*********************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  6. \*********************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.default = void 0;
  14. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  15. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  16. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  17. return this;
  18. }();
  19. var key = ['w', 'x'].join('');
  20. var oldWx = target[key];
  21. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  22. function isWxKey(key) {
  23. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  24. return false;
  25. }
  26. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  27. }
  28. function initWx() {
  29. var newWx = {};
  30. for (var _key in oldWx) {
  31. if (isWxKey(_key)) {
  32. // TODO wrapper function
  33. newWx[_key] = oldWx[_key];
  34. }
  35. }
  36. return newWx;
  37. }
  38. target[key] = initWx();
  39. if (!target[key].canIUse('getAppBaseInfo')) {
  40. target[key].getAppBaseInfo = target[key].getSystemInfoSync;
  41. }
  42. if (!target[key].canIUse('getWindowInfo')) {
  43. target[key].getWindowInfo = target[key].getSystemInfoSync;
  44. }
  45. if (!target[key].canIUse('getDeviceInfo')) {
  46. target[key].getDeviceInfo = target[key].getSystemInfoSync;
  47. }
  48. var _default = target[key];
  49. exports.default = _default;
  50. /***/ }),
  51. /* 2 */
  52. /*!************************************************************!*\
  53. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  54. \************************************************************/
  55. /*! no static exports found */
  56. /***/ (function(module, exports, __webpack_require__) {
  57. "use strict";
  58. /* WEBPACK VAR INJECTION */(function(wx, global) {
  59. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  60. Object.defineProperty(exports, "__esModule", {
  61. value: true
  62. });
  63. exports.createApp = createApp;
  64. exports.createComponent = createComponent;
  65. exports.createPage = createPage;
  66. exports.createPlugin = createPlugin;
  67. exports.createSubpackageApp = createSubpackageApp;
  68. exports.default = void 0;
  69. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  70. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  71. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  72. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  73. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  74. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  75. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  76. 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; }
  77. 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; }
  78. var realAtob;
  79. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  80. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  81. if (typeof atob !== 'function') {
  82. realAtob = function realAtob(str) {
  83. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  84. if (!b64re.test(str)) {
  85. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  86. }
  87. // Adding the padding if missing, for semplicity
  88. str += '=='.slice(2 - (str.length & 3));
  89. var bitmap;
  90. var result = '';
  91. var r1;
  92. var r2;
  93. var i = 0;
  94. for (; i < str.length;) {
  95. 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++)));
  96. 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);
  97. }
  98. return result;
  99. };
  100. } else {
  101. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  102. realAtob = atob;
  103. }
  104. function b64DecodeUnicode(str) {
  105. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  106. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  107. }).join(''));
  108. }
  109. function getCurrentUserInfo() {
  110. var token = wx.getStorageSync('uni_id_token') || '';
  111. var tokenArr = token.split('.');
  112. if (!token || tokenArr.length !== 3) {
  113. return {
  114. uid: null,
  115. role: [],
  116. permission: [],
  117. tokenExpired: 0
  118. };
  119. }
  120. var userInfo;
  121. try {
  122. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  123. } catch (error) {
  124. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  125. }
  126. userInfo.tokenExpired = userInfo.exp * 1000;
  127. delete userInfo.exp;
  128. delete userInfo.iat;
  129. return userInfo;
  130. }
  131. function uniIdMixin(Vue) {
  132. Vue.prototype.uniIDHasRole = function (roleId) {
  133. var _getCurrentUserInfo = getCurrentUserInfo(),
  134. role = _getCurrentUserInfo.role;
  135. return role.indexOf(roleId) > -1;
  136. };
  137. Vue.prototype.uniIDHasPermission = function (permissionId) {
  138. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  139. permission = _getCurrentUserInfo2.permission;
  140. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  141. };
  142. Vue.prototype.uniIDTokenValid = function () {
  143. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  144. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  145. return tokenExpired > Date.now();
  146. };
  147. }
  148. var _toString = Object.prototype.toString;
  149. var hasOwnProperty = Object.prototype.hasOwnProperty;
  150. function isFn(fn) {
  151. return typeof fn === 'function';
  152. }
  153. function isStr(str) {
  154. return typeof str === 'string';
  155. }
  156. function isObject(obj) {
  157. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  158. }
  159. function isPlainObject(obj) {
  160. return _toString.call(obj) === '[object Object]';
  161. }
  162. function hasOwn(obj, key) {
  163. return hasOwnProperty.call(obj, key);
  164. }
  165. function noop() {}
  166. /**
  167. * Create a cached version of a pure function.
  168. */
  169. function cached(fn) {
  170. var cache = Object.create(null);
  171. return function cachedFn(str) {
  172. var hit = cache[str];
  173. return hit || (cache[str] = fn(str));
  174. };
  175. }
  176. /**
  177. * Camelize a hyphen-delimited string.
  178. */
  179. var camelizeRE = /-(\w)/g;
  180. var camelize = cached(function (str) {
  181. return str.replace(camelizeRE, function (_, c) {
  182. return c ? c.toUpperCase() : '';
  183. });
  184. });
  185. function sortObject(obj) {
  186. var sortObj = {};
  187. if (isPlainObject(obj)) {
  188. Object.keys(obj).sort().forEach(function (key) {
  189. sortObj[key] = obj[key];
  190. });
  191. }
  192. return !Object.keys(sortObj) ? obj : sortObj;
  193. }
  194. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  195. var globalInterceptors = {};
  196. var scopedInterceptors = {};
  197. function mergeHook(parentVal, childVal) {
  198. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  199. return res ? dedupeHooks(res) : res;
  200. }
  201. function dedupeHooks(hooks) {
  202. var res = [];
  203. for (var i = 0; i < hooks.length; i++) {
  204. if (res.indexOf(hooks[i]) === -1) {
  205. res.push(hooks[i]);
  206. }
  207. }
  208. return res;
  209. }
  210. function removeHook(hooks, hook) {
  211. var index = hooks.indexOf(hook);
  212. if (index !== -1) {
  213. hooks.splice(index, 1);
  214. }
  215. }
  216. function mergeInterceptorHook(interceptor, option) {
  217. Object.keys(option).forEach(function (hook) {
  218. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  219. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  220. }
  221. });
  222. }
  223. function removeInterceptorHook(interceptor, option) {
  224. if (!interceptor || !option) {
  225. return;
  226. }
  227. Object.keys(option).forEach(function (hook) {
  228. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  229. removeHook(interceptor[hook], option[hook]);
  230. }
  231. });
  232. }
  233. function addInterceptor(method, option) {
  234. if (typeof method === 'string' && isPlainObject(option)) {
  235. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  236. } else if (isPlainObject(method)) {
  237. mergeInterceptorHook(globalInterceptors, method);
  238. }
  239. }
  240. function removeInterceptor(method, option) {
  241. if (typeof method === 'string') {
  242. if (isPlainObject(option)) {
  243. removeInterceptorHook(scopedInterceptors[method], option);
  244. } else {
  245. delete scopedInterceptors[method];
  246. }
  247. } else if (isPlainObject(method)) {
  248. removeInterceptorHook(globalInterceptors, method);
  249. }
  250. }
  251. function wrapperHook(hook, params) {
  252. return function (data) {
  253. return hook(data, params) || data;
  254. };
  255. }
  256. function isPromise(obj) {
  257. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  258. }
  259. function queue(hooks, data, params) {
  260. var promise = false;
  261. for (var i = 0; i < hooks.length; i++) {
  262. var hook = hooks[i];
  263. if (promise) {
  264. promise = Promise.resolve(wrapperHook(hook, params));
  265. } else {
  266. var res = hook(data, params);
  267. if (isPromise(res)) {
  268. promise = Promise.resolve(res);
  269. }
  270. if (res === false) {
  271. return {
  272. then: function then() {}
  273. };
  274. }
  275. }
  276. }
  277. return promise || {
  278. then: function then(callback) {
  279. return callback(data);
  280. }
  281. };
  282. }
  283. function wrapperOptions(interceptor) {
  284. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  285. ['success', 'fail', 'complete'].forEach(function (name) {
  286. if (Array.isArray(interceptor[name])) {
  287. var oldCallback = options[name];
  288. options[name] = function callbackInterceptor(res) {
  289. queue(interceptor[name], res, options).then(function (res) {
  290. /* eslint-disable no-mixed-operators */
  291. return isFn(oldCallback) && oldCallback(res) || res;
  292. });
  293. };
  294. }
  295. });
  296. return options;
  297. }
  298. function wrapperReturnValue(method, returnValue) {
  299. var returnValueHooks = [];
  300. if (Array.isArray(globalInterceptors.returnValue)) {
  301. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  302. }
  303. var interceptor = scopedInterceptors[method];
  304. if (interceptor && Array.isArray(interceptor.returnValue)) {
  305. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  306. }
  307. returnValueHooks.forEach(function (hook) {
  308. returnValue = hook(returnValue) || returnValue;
  309. });
  310. return returnValue;
  311. }
  312. function getApiInterceptorHooks(method) {
  313. var interceptor = Object.create(null);
  314. Object.keys(globalInterceptors).forEach(function (hook) {
  315. if (hook !== 'returnValue') {
  316. interceptor[hook] = globalInterceptors[hook].slice();
  317. }
  318. });
  319. var scopedInterceptor = scopedInterceptors[method];
  320. if (scopedInterceptor) {
  321. Object.keys(scopedInterceptor).forEach(function (hook) {
  322. if (hook !== 'returnValue') {
  323. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  324. }
  325. });
  326. }
  327. return interceptor;
  328. }
  329. function invokeApi(method, api, options) {
  330. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  331. params[_key - 3] = arguments[_key];
  332. }
  333. var interceptor = getApiInterceptorHooks(method);
  334. if (interceptor && Object.keys(interceptor).length) {
  335. if (Array.isArray(interceptor.invoke)) {
  336. var res = queue(interceptor.invoke, options);
  337. return res.then(function (options) {
  338. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  339. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  340. });
  341. } else {
  342. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  343. }
  344. }
  345. return api.apply(void 0, [options].concat(params));
  346. }
  347. var promiseInterceptor = {
  348. returnValue: function returnValue(res) {
  349. if (!isPromise(res)) {
  350. return res;
  351. }
  352. return new Promise(function (resolve, reject) {
  353. res.then(function (res) {
  354. if (!res) {
  355. resolve(res);
  356. return;
  357. }
  358. if (res[0]) {
  359. reject(res[0]);
  360. } else {
  361. resolve(res[1]);
  362. }
  363. });
  364. });
  365. }
  366. };
  367. var SYNC_API_RE = /^\$|__f__|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|rpx2px|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  368. var CONTEXT_API_RE = /^create|Manager$/;
  369. // Context例外情况
  370. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  371. // 同步例外情况
  372. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  373. var CALLBACK_API_RE = /^on|^off/;
  374. function isContextApi(name) {
  375. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  376. }
  377. function isSyncApi(name) {
  378. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  379. }
  380. function isCallbackApi(name) {
  381. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  382. }
  383. function handlePromise(promise) {
  384. return promise.then(function (data) {
  385. return [null, data];
  386. }).catch(function (err) {
  387. return [err];
  388. });
  389. }
  390. function shouldPromise(name) {
  391. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  392. return false;
  393. }
  394. return true;
  395. }
  396. /* eslint-disable no-extend-native */
  397. if (!Promise.prototype.finally) {
  398. Promise.prototype.finally = function (callback) {
  399. var promise = this.constructor;
  400. return this.then(function (value) {
  401. return promise.resolve(callback()).then(function () {
  402. return value;
  403. });
  404. }, function (reason) {
  405. return promise.resolve(callback()).then(function () {
  406. throw reason;
  407. });
  408. });
  409. };
  410. }
  411. function promisify(name, api) {
  412. if (!shouldPromise(name) || !isFn(api)) {
  413. return api;
  414. }
  415. return function promiseApi() {
  416. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  417. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  418. params[_key2 - 1] = arguments[_key2];
  419. }
  420. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  421. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  422. }
  423. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  424. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  425. success: resolve,
  426. fail: reject
  427. })].concat(params));
  428. })));
  429. };
  430. }
  431. var EPS = 1e-4;
  432. var BASE_DEVICE_WIDTH = 750;
  433. var isIOS = false;
  434. var deviceWidth = 0;
  435. var deviceDPR = 0;
  436. function checkDeviceWidth() {
  437. var windowWidth, pixelRatio, platform;
  438. {
  439. var windowInfo = typeof wx.getWindowInfo === 'function' && wx.getWindowInfo() ? wx.getWindowInfo() : wx.getSystemInfoSync();
  440. var deviceInfo = typeof wx.getDeviceInfo === 'function' && wx.getDeviceInfo() ? wx.getDeviceInfo() : wx.getSystemInfoSync();
  441. windowWidth = windowInfo.windowWidth;
  442. pixelRatio = windowInfo.pixelRatio;
  443. platform = deviceInfo.platform;
  444. }
  445. deviceWidth = windowWidth;
  446. deviceDPR = pixelRatio;
  447. isIOS = platform === 'ios';
  448. }
  449. function upx2px(number, newDeviceWidth) {
  450. if (deviceWidth === 0) {
  451. checkDeviceWidth();
  452. }
  453. number = Number(number);
  454. if (number === 0) {
  455. return 0;
  456. }
  457. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  458. if (result < 0) {
  459. result = -result;
  460. }
  461. result = Math.floor(result + EPS);
  462. if (result === 0) {
  463. if (deviceDPR === 1 || !isIOS) {
  464. result = 1;
  465. } else {
  466. result = 0.5;
  467. }
  468. }
  469. return number < 0 ? -result : result;
  470. }
  471. var LOCALE_ZH_HANS = 'zh-Hans';
  472. var LOCALE_ZH_HANT = 'zh-Hant';
  473. var LOCALE_EN = 'en';
  474. var LOCALE_FR = 'fr';
  475. var LOCALE_ES = 'es';
  476. var messages = {};
  477. function getLocaleLanguage() {
  478. var localeLanguage = '';
  479. {
  480. var appBaseInfo = typeof wx.getAppBaseInfo === 'function' && wx.getAppBaseInfo() ? wx.getAppBaseInfo() : wx.getSystemInfoSync();
  481. var language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
  482. localeLanguage = normalizeLocale(language) || LOCALE_EN;
  483. }
  484. return localeLanguage;
  485. }
  486. var locale;
  487. {
  488. locale = getLocaleLanguage();
  489. }
  490. function initI18nMessages() {
  491. if (!isEnableLocale()) {
  492. return;
  493. }
  494. var localeKeys = Object.keys(__uniConfig.locales);
  495. if (localeKeys.length) {
  496. localeKeys.forEach(function (locale) {
  497. var curMessages = messages[locale];
  498. var userMessages = __uniConfig.locales[locale];
  499. if (curMessages) {
  500. Object.assign(curMessages, userMessages);
  501. } else {
  502. messages[locale] = userMessages;
  503. }
  504. });
  505. }
  506. }
  507. initI18nMessages();
  508. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  509. var t = i18n.t;
  510. var i18nMixin = i18n.mixin = {
  511. beforeCreate: function beforeCreate() {
  512. var _this = this;
  513. var unwatch = i18n.i18n.watchLocale(function () {
  514. _this.$forceUpdate();
  515. });
  516. this.$once('hook:beforeDestroy', function () {
  517. unwatch();
  518. });
  519. },
  520. methods: {
  521. $$t: function $$t(key, values) {
  522. return t(key, values);
  523. }
  524. }
  525. };
  526. var setLocale = i18n.setLocale;
  527. var getLocale = i18n.getLocale;
  528. function initAppLocale(Vue, appVm, locale) {
  529. var state = Vue.observable({
  530. locale: locale || i18n.getLocale()
  531. });
  532. var localeWatchers = [];
  533. appVm.$watchLocale = function (fn) {
  534. localeWatchers.push(fn);
  535. };
  536. Object.defineProperty(appVm, '$locale', {
  537. get: function get() {
  538. return state.locale;
  539. },
  540. set: function set(v) {
  541. state.locale = v;
  542. localeWatchers.forEach(function (watch) {
  543. return watch(v);
  544. });
  545. }
  546. });
  547. }
  548. function isEnableLocale() {
  549. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  550. }
  551. function include(str, parts) {
  552. return !!parts.find(function (part) {
  553. return str.indexOf(part) !== -1;
  554. });
  555. }
  556. function startsWith(str, parts) {
  557. return parts.find(function (part) {
  558. return str.indexOf(part) === 0;
  559. });
  560. }
  561. function normalizeLocale(locale, messages) {
  562. if (!locale) {
  563. return;
  564. }
  565. locale = locale.trim().replace(/_/g, '-');
  566. if (messages && messages[locale]) {
  567. return locale;
  568. }
  569. locale = locale.toLowerCase();
  570. if (locale === 'chinese') {
  571. // 支付宝
  572. return LOCALE_ZH_HANS;
  573. }
  574. if (locale.indexOf('zh') === 0) {
  575. if (locale.indexOf('-hans') > -1) {
  576. return LOCALE_ZH_HANS;
  577. }
  578. if (locale.indexOf('-hant') > -1) {
  579. return LOCALE_ZH_HANT;
  580. }
  581. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  582. return LOCALE_ZH_HANT;
  583. }
  584. return LOCALE_ZH_HANS;
  585. }
  586. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  587. if (lang) {
  588. return lang;
  589. }
  590. }
  591. // export function initI18n() {
  592. // const localeKeys = Object.keys(__uniConfig.locales || {})
  593. // if (localeKeys.length) {
  594. // localeKeys.forEach((locale) =>
  595. // i18n.add(locale, __uniConfig.locales[locale])
  596. // )
  597. // }
  598. // }
  599. function getLocale$1() {
  600. // 优先使用 $locale
  601. if (isFn(getApp)) {
  602. var app = getApp({
  603. allowDefault: true
  604. });
  605. if (app && app.$vm) {
  606. return app.$vm.$locale;
  607. }
  608. }
  609. return getLocaleLanguage();
  610. }
  611. function setLocale$1(locale) {
  612. var app = isFn(getApp) ? getApp() : false;
  613. if (!app) {
  614. return false;
  615. }
  616. var oldLocale = app.$vm.$locale;
  617. if (oldLocale !== locale) {
  618. app.$vm.$locale = locale;
  619. onLocaleChangeCallbacks.forEach(function (fn) {
  620. return fn({
  621. locale: locale
  622. });
  623. });
  624. return true;
  625. }
  626. return false;
  627. }
  628. var onLocaleChangeCallbacks = [];
  629. function onLocaleChange(fn) {
  630. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  631. onLocaleChangeCallbacks.push(fn);
  632. }
  633. }
  634. if (typeof global !== 'undefined') {
  635. global.getLocale = getLocale$1;
  636. }
  637. var interceptors = {
  638. promiseInterceptor: promiseInterceptor
  639. };
  640. var baseApi = /*#__PURE__*/Object.freeze({
  641. __proto__: null,
  642. upx2px: upx2px,
  643. rpx2px: upx2px,
  644. getLocale: getLocale$1,
  645. setLocale: setLocale$1,
  646. onLocaleChange: onLocaleChange,
  647. addInterceptor: addInterceptor,
  648. removeInterceptor: removeInterceptor,
  649. interceptors: interceptors
  650. });
  651. function findExistsPageIndex(url) {
  652. var pages = getCurrentPages();
  653. var len = pages.length;
  654. while (len--) {
  655. var page = pages[len];
  656. if (page.$page && page.$page.fullPath === url) {
  657. return len;
  658. }
  659. }
  660. return -1;
  661. }
  662. var redirectTo = {
  663. name: function name(fromArgs) {
  664. if (fromArgs.exists === 'back' && fromArgs.delta) {
  665. return 'navigateBack';
  666. }
  667. return 'redirectTo';
  668. },
  669. args: function args(fromArgs) {
  670. if (fromArgs.exists === 'back' && fromArgs.url) {
  671. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  672. if (existsPageIndex !== -1) {
  673. var delta = getCurrentPages().length - 1 - existsPageIndex;
  674. if (delta > 0) {
  675. fromArgs.delta = delta;
  676. }
  677. }
  678. }
  679. }
  680. };
  681. var previewImage = {
  682. args: function args(fromArgs) {
  683. var currentIndex = parseInt(fromArgs.current);
  684. if (isNaN(currentIndex)) {
  685. return;
  686. }
  687. var urls = fromArgs.urls;
  688. if (!Array.isArray(urls)) {
  689. return;
  690. }
  691. var len = urls.length;
  692. if (!len) {
  693. return;
  694. }
  695. if (currentIndex < 0) {
  696. currentIndex = 0;
  697. } else if (currentIndex >= len) {
  698. currentIndex = len - 1;
  699. }
  700. if (currentIndex > 0) {
  701. fromArgs.current = urls[currentIndex];
  702. fromArgs.urls = urls.filter(function (item, index) {
  703. return index < currentIndex ? item !== urls[currentIndex] : true;
  704. });
  705. } else {
  706. fromArgs.current = urls[0];
  707. }
  708. return {
  709. indicator: false,
  710. loop: false
  711. };
  712. }
  713. };
  714. var UUID_KEY = '__DC_STAT_UUID';
  715. var deviceId;
  716. function useDeviceId(result) {
  717. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  718. if (!deviceId) {
  719. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  720. wx.setStorage({
  721. key: UUID_KEY,
  722. data: deviceId
  723. });
  724. }
  725. result.deviceId = deviceId;
  726. }
  727. function addSafeAreaInsets(result) {
  728. if (result.safeArea) {
  729. var safeArea = result.safeArea;
  730. result.safeAreaInsets = {
  731. top: safeArea.top,
  732. left: safeArea.left,
  733. right: result.windowWidth - safeArea.right,
  734. bottom: result.screenHeight - safeArea.bottom
  735. };
  736. }
  737. }
  738. function getOSInfo(system, platform) {
  739. var osName = '';
  740. var osVersion = '';
  741. if (platform && "mp-weixin" === 'mp-baidu') {
  742. osName = platform;
  743. osVersion = system;
  744. } else {
  745. osName = system.split(' ')[0] || platform;
  746. osVersion = system.split(' ')[1] || '';
  747. }
  748. osName = osName.toLocaleLowerCase();
  749. switch (osName) {
  750. case 'harmony': // alipay
  751. case 'ohos': // weixin
  752. case 'openharmony':
  753. // feishu
  754. osName = 'harmonyos';
  755. break;
  756. case 'iphone os':
  757. // alipay
  758. osName = 'ios';
  759. break;
  760. case 'mac': // weixin qq
  761. case 'darwin':
  762. // feishu
  763. osName = 'macos';
  764. break;
  765. case 'windows_nt':
  766. // feishu
  767. osName = 'windows';
  768. break;
  769. }
  770. return {
  771. osName: osName,
  772. osVersion: osVersion
  773. };
  774. }
  775. function populateParameters(result) {
  776. var _result$brand = result.brand,
  777. brand = _result$brand === void 0 ? '' : _result$brand,
  778. _result$model = result.model,
  779. model = _result$model === void 0 ? '' : _result$model,
  780. _result$system = result.system,
  781. system = _result$system === void 0 ? '' : _result$system,
  782. _result$language = result.language,
  783. language = _result$language === void 0 ? '' : _result$language,
  784. theme = result.theme,
  785. version = result.version,
  786. platform = result.platform,
  787. fontSizeSetting = result.fontSizeSetting,
  788. SDKVersion = result.SDKVersion,
  789. pixelRatio = result.pixelRatio,
  790. deviceOrientation = result.deviceOrientation;
  791. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  792. var extraParam = {};
  793. // osName osVersion
  794. var _getOSInfo = getOSInfo(system, platform),
  795. osName = _getOSInfo.osName,
  796. osVersion = _getOSInfo.osVersion;
  797. var hostVersion = version;
  798. // deviceType
  799. var deviceType = getGetDeviceType(result, model);
  800. // deviceModel
  801. var deviceBrand = getDeviceBrand(brand);
  802. // hostName
  803. var _hostName = getHostName(result);
  804. // deviceOrientation
  805. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  806. // devicePixelRatio
  807. var _devicePixelRatio = pixelRatio;
  808. // SDKVersion
  809. var _SDKVersion = SDKVersion;
  810. // hostLanguage
  811. var hostLanguage = (language || '').replace(/_/g, '-');
  812. // wx.getAccountInfoSync
  813. var parameters = {
  814. appId: "",
  815. appName: "project2",
  816. appVersion: "1.0.0",
  817. appVersionCode: "100",
  818. appLanguage: getAppLanguage(hostLanguage),
  819. uniCompileVersion: "4.66",
  820. uniCompilerVersion: "4.66",
  821. uniRuntimeVersion: "4.66",
  822. uniPlatform: undefined || "mp-weixin",
  823. deviceBrand: deviceBrand,
  824. deviceModel: model,
  825. deviceType: deviceType,
  826. devicePixelRatio: _devicePixelRatio,
  827. deviceOrientation: _deviceOrientation,
  828. osName: osName.toLocaleLowerCase(),
  829. osVersion: osVersion,
  830. hostTheme: theme,
  831. hostVersion: hostVersion,
  832. hostLanguage: hostLanguage,
  833. hostName: _hostName,
  834. hostSDKVersion: _SDKVersion,
  835. hostFontSizeSetting: fontSizeSetting,
  836. windowTop: 0,
  837. windowBottom: 0,
  838. // TODO
  839. osLanguage: undefined,
  840. osTheme: undefined,
  841. ua: undefined,
  842. hostPackageName: undefined,
  843. browserName: undefined,
  844. browserVersion: undefined,
  845. isUniAppX: false
  846. };
  847. Object.assign(result, parameters, extraParam);
  848. }
  849. function getGetDeviceType(result, model) {
  850. var deviceType = result.deviceType || 'phone';
  851. {
  852. var deviceTypeMaps = {
  853. ipad: 'pad',
  854. windows: 'pc',
  855. mac: 'pc'
  856. };
  857. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  858. var _model = model.toLocaleLowerCase();
  859. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  860. var _m = deviceTypeMapsKeys[index];
  861. if (_model.indexOf(_m) !== -1) {
  862. deviceType = deviceTypeMaps[_m];
  863. break;
  864. }
  865. }
  866. }
  867. return deviceType;
  868. }
  869. function getDeviceBrand(brand) {
  870. var deviceBrand = brand;
  871. if (deviceBrand) {
  872. deviceBrand = brand.toLocaleLowerCase();
  873. }
  874. return deviceBrand;
  875. }
  876. function getAppLanguage(defaultLanguage) {
  877. return getLocale$1 ? getLocale$1() : defaultLanguage;
  878. }
  879. function getHostName(result) {
  880. var _platform = 'WeChat';
  881. var _hostName = result.hostName || _platform; // mp-jd
  882. {
  883. if (result.environment) {
  884. _hostName = result.environment;
  885. } else if (result.host && result.host.env) {
  886. _hostName = result.host.env;
  887. }
  888. }
  889. return _hostName;
  890. }
  891. var getSystemInfo = {
  892. returnValue: function returnValue(result) {
  893. useDeviceId(result);
  894. addSafeAreaInsets(result);
  895. populateParameters(result);
  896. }
  897. };
  898. var showActionSheet = {
  899. args: function args(fromArgs) {
  900. if ((0, _typeof2.default)(fromArgs) === 'object') {
  901. fromArgs.alertText = fromArgs.title;
  902. }
  903. }
  904. };
  905. var getAppBaseInfo = {
  906. returnValue: function returnValue(result) {
  907. var _result = result,
  908. version = _result.version,
  909. language = _result.language,
  910. SDKVersion = _result.SDKVersion,
  911. theme = _result.theme;
  912. var _hostName = getHostName(result);
  913. var hostLanguage = (language || '').replace('_', '-');
  914. result = sortObject(Object.assign(result, {
  915. appId: "",
  916. appName: "project2",
  917. appVersion: "1.0.0",
  918. appVersionCode: "100",
  919. appLanguage: getAppLanguage(hostLanguage),
  920. hostVersion: version,
  921. hostLanguage: hostLanguage,
  922. hostName: _hostName,
  923. hostSDKVersion: SDKVersion,
  924. hostTheme: theme,
  925. isUniAppX: false,
  926. uniPlatform: undefined || "mp-weixin",
  927. uniCompileVersion: "4.66",
  928. uniCompilerVersion: "4.66",
  929. uniRuntimeVersion: "4.66"
  930. }));
  931. }
  932. };
  933. var getDeviceInfo = {
  934. returnValue: function returnValue(result) {
  935. var _result2 = result,
  936. brand = _result2.brand,
  937. model = _result2.model,
  938. _result2$system = _result2.system,
  939. system = _result2$system === void 0 ? '' : _result2$system,
  940. _result2$platform = _result2.platform,
  941. platform = _result2$platform === void 0 ? '' : _result2$platform;
  942. var deviceType = getGetDeviceType(result, model);
  943. var deviceBrand = getDeviceBrand(brand);
  944. useDeviceId(result);
  945. var _getOSInfo2 = getOSInfo(system, platform),
  946. osName = _getOSInfo2.osName,
  947. osVersion = _getOSInfo2.osVersion;
  948. result = sortObject(Object.assign(result, {
  949. deviceType: deviceType,
  950. deviceBrand: deviceBrand,
  951. deviceModel: model,
  952. osName: osName,
  953. osVersion: osVersion
  954. }));
  955. }
  956. };
  957. var getWindowInfo = {
  958. returnValue: function returnValue(result) {
  959. addSafeAreaInsets(result);
  960. result = sortObject(Object.assign(result, {
  961. windowTop: 0,
  962. windowBottom: 0
  963. }));
  964. }
  965. };
  966. var getAppAuthorizeSetting = {
  967. returnValue: function returnValue(result) {
  968. var locationReducedAccuracy = result.locationReducedAccuracy;
  969. result.locationAccuracy = 'unsupported';
  970. if (locationReducedAccuracy === true) {
  971. result.locationAccuracy = 'reduced';
  972. } else if (locationReducedAccuracy === false) {
  973. result.locationAccuracy = 'full';
  974. }
  975. }
  976. };
  977. // import navigateTo from 'uni-helpers/navigate-to'
  978. var compressImage = {
  979. args: function args(fromArgs) {
  980. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  981. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  982. fromArgs.compressHeight = fromArgs.compressedHeight;
  983. }
  984. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  985. fromArgs.compressWidth = fromArgs.compressedWidth;
  986. }
  987. }
  988. };
  989. var protocols = {
  990. redirectTo: redirectTo,
  991. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  992. previewImage: previewImage,
  993. getSystemInfo: getSystemInfo,
  994. getSystemInfoSync: getSystemInfo,
  995. showActionSheet: showActionSheet,
  996. getAppBaseInfo: getAppBaseInfo,
  997. getDeviceInfo: getDeviceInfo,
  998. getWindowInfo: getWindowInfo,
  999. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1000. compressImage: compressImage
  1001. };
  1002. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1003. var canIUses = [];
  1004. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1005. function processCallback(methodName, method, returnValue) {
  1006. return function (res) {
  1007. return method(processReturnValue(methodName, res, returnValue));
  1008. };
  1009. }
  1010. function processArgs(methodName, fromArgs) {
  1011. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1012. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1013. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1014. if (isPlainObject(fromArgs)) {
  1015. // 一般 api 的参数解析
  1016. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1017. if (isFn(argsOption)) {
  1018. argsOption = argsOption(fromArgs, toArgs) || {};
  1019. }
  1020. for (var key in fromArgs) {
  1021. if (hasOwn(argsOption, key)) {
  1022. var keyOption = argsOption[key];
  1023. if (isFn(keyOption)) {
  1024. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1025. }
  1026. if (!keyOption) {
  1027. // 不支持的参数
  1028. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1029. } else if (isStr(keyOption)) {
  1030. // 重写参数 key
  1031. toArgs[keyOption] = fromArgs[key];
  1032. } else if (isPlainObject(keyOption)) {
  1033. // {name:newName,value:value}可重新指定参数 key:value
  1034. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1035. }
  1036. } else if (CALLBACKS.indexOf(key) !== -1) {
  1037. if (isFn(fromArgs[key])) {
  1038. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1039. }
  1040. } else {
  1041. if (!keepFromArgs) {
  1042. toArgs[key] = fromArgs[key];
  1043. }
  1044. }
  1045. }
  1046. return toArgs;
  1047. } else if (isFn(fromArgs)) {
  1048. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1049. }
  1050. return fromArgs;
  1051. }
  1052. function processReturnValue(methodName, res, returnValue) {
  1053. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1054. if (isFn(protocols.returnValue)) {
  1055. // 处理通用 returnValue
  1056. res = protocols.returnValue(methodName, res);
  1057. }
  1058. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1059. }
  1060. function wrapper(methodName, method) {
  1061. if (hasOwn(protocols, methodName)) {
  1062. var protocol = protocols[methodName];
  1063. if (!protocol) {
  1064. // 暂不支持的 api
  1065. return function () {
  1066. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1067. };
  1068. }
  1069. return function (arg1, arg2) {
  1070. // 目前 api 最多两个参数
  1071. var options = protocol;
  1072. if (isFn(protocol)) {
  1073. options = protocol(arg1);
  1074. }
  1075. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1076. var args = [arg1];
  1077. if (typeof arg2 !== 'undefined') {
  1078. args.push(arg2);
  1079. }
  1080. if (isFn(options.name)) {
  1081. methodName = options.name(arg1);
  1082. } else if (isStr(options.name)) {
  1083. methodName = options.name;
  1084. }
  1085. var returnValue = wx[methodName].apply(wx, args);
  1086. if (isSyncApi(methodName)) {
  1087. // 同步 api
  1088. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1089. }
  1090. return returnValue;
  1091. };
  1092. }
  1093. return method;
  1094. }
  1095. var todoApis = Object.create(null);
  1096. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1097. function createTodoApi(name) {
  1098. return function todoApi(_ref) {
  1099. var fail = _ref.fail,
  1100. complete = _ref.complete;
  1101. var res = {
  1102. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1103. };
  1104. isFn(fail) && fail(res);
  1105. isFn(complete) && complete(res);
  1106. };
  1107. }
  1108. TODOS.forEach(function (name) {
  1109. todoApis[name] = createTodoApi(name);
  1110. });
  1111. var providers = {
  1112. oauth: ['weixin'],
  1113. share: ['weixin'],
  1114. payment: ['wxpay'],
  1115. push: ['weixin']
  1116. };
  1117. function getProvider(_ref2) {
  1118. var service = _ref2.service,
  1119. success = _ref2.success,
  1120. fail = _ref2.fail,
  1121. complete = _ref2.complete;
  1122. var res = false;
  1123. if (providers[service]) {
  1124. res = {
  1125. errMsg: 'getProvider:ok',
  1126. service: service,
  1127. provider: providers[service]
  1128. };
  1129. isFn(success) && success(res);
  1130. } else {
  1131. res = {
  1132. errMsg: 'getProvider:fail service not found'
  1133. };
  1134. isFn(fail) && fail(res);
  1135. }
  1136. isFn(complete) && complete(res);
  1137. }
  1138. var extraApi = /*#__PURE__*/Object.freeze({
  1139. __proto__: null,
  1140. getProvider: getProvider
  1141. });
  1142. var getEmitter = function () {
  1143. var Emitter;
  1144. return function getUniEmitter() {
  1145. if (!Emitter) {
  1146. Emitter = new _vue.default();
  1147. }
  1148. return Emitter;
  1149. };
  1150. }();
  1151. function apply(ctx, method, args) {
  1152. return ctx[method].apply(ctx, args);
  1153. }
  1154. function $on() {
  1155. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1156. }
  1157. function $off() {
  1158. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1159. }
  1160. function $once() {
  1161. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1162. }
  1163. function $emit() {
  1164. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1165. }
  1166. var eventApi = /*#__PURE__*/Object.freeze({
  1167. __proto__: null,
  1168. $on: $on,
  1169. $off: $off,
  1170. $once: $once,
  1171. $emit: $emit
  1172. });
  1173. /**
  1174. * 框架内 try-catch
  1175. */
  1176. /**
  1177. * 开发者 try-catch
  1178. */
  1179. function tryCatch(fn) {
  1180. return function () {
  1181. try {
  1182. return fn.apply(fn, arguments);
  1183. } catch (e) {
  1184. // TODO
  1185. console.error(e);
  1186. }
  1187. };
  1188. }
  1189. function getApiCallbacks(params) {
  1190. var apiCallbacks = {};
  1191. for (var name in params) {
  1192. var param = params[name];
  1193. if (isFn(param)) {
  1194. apiCallbacks[name] = tryCatch(param);
  1195. delete params[name];
  1196. }
  1197. }
  1198. return apiCallbacks;
  1199. }
  1200. var cid;
  1201. var cidErrMsg;
  1202. var enabled;
  1203. function normalizePushMessage(message) {
  1204. try {
  1205. return JSON.parse(message);
  1206. } catch (e) {}
  1207. return message;
  1208. }
  1209. function invokePushCallback(args) {
  1210. if (args.type === 'enabled') {
  1211. enabled = true;
  1212. } else if (args.type === 'clientId') {
  1213. cid = args.cid;
  1214. cidErrMsg = args.errMsg;
  1215. invokeGetPushCidCallbacks(cid, args.errMsg);
  1216. } else if (args.type === 'pushMsg') {
  1217. var message = {
  1218. type: 'receive',
  1219. data: normalizePushMessage(args.message)
  1220. };
  1221. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1222. var callback = onPushMessageCallbacks[i];
  1223. callback(message);
  1224. // 该消息已被阻止
  1225. if (message.stopped) {
  1226. break;
  1227. }
  1228. }
  1229. } else if (args.type === 'click') {
  1230. onPushMessageCallbacks.forEach(function (callback) {
  1231. callback({
  1232. type: 'click',
  1233. data: normalizePushMessage(args.message)
  1234. });
  1235. });
  1236. }
  1237. }
  1238. var getPushCidCallbacks = [];
  1239. function invokeGetPushCidCallbacks(cid, errMsg) {
  1240. getPushCidCallbacks.forEach(function (callback) {
  1241. callback(cid, errMsg);
  1242. });
  1243. getPushCidCallbacks.length = 0;
  1244. }
  1245. function getPushClientId(args) {
  1246. if (!isPlainObject(args)) {
  1247. args = {};
  1248. }
  1249. var _getApiCallbacks = getApiCallbacks(args),
  1250. success = _getApiCallbacks.success,
  1251. fail = _getApiCallbacks.fail,
  1252. complete = _getApiCallbacks.complete;
  1253. var hasSuccess = isFn(success);
  1254. var hasFail = isFn(fail);
  1255. var hasComplete = isFn(complete);
  1256. Promise.resolve().then(function () {
  1257. if (typeof enabled === 'undefined') {
  1258. enabled = false;
  1259. cid = '';
  1260. cidErrMsg = 'uniPush is not enabled';
  1261. }
  1262. getPushCidCallbacks.push(function (cid, errMsg) {
  1263. var res;
  1264. if (cid) {
  1265. res = {
  1266. errMsg: 'getPushClientId:ok',
  1267. cid: cid
  1268. };
  1269. hasSuccess && success(res);
  1270. } else {
  1271. res = {
  1272. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1273. };
  1274. hasFail && fail(res);
  1275. }
  1276. hasComplete && complete(res);
  1277. });
  1278. if (typeof cid !== 'undefined') {
  1279. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1280. }
  1281. });
  1282. }
  1283. var onPushMessageCallbacks = [];
  1284. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1285. var onPushMessage = function onPushMessage(fn) {
  1286. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1287. onPushMessageCallbacks.push(fn);
  1288. }
  1289. };
  1290. var offPushMessage = function offPushMessage(fn) {
  1291. if (!fn) {
  1292. onPushMessageCallbacks.length = 0;
  1293. } else {
  1294. var index = onPushMessageCallbacks.indexOf(fn);
  1295. if (index > -1) {
  1296. onPushMessageCallbacks.splice(index, 1);
  1297. }
  1298. }
  1299. };
  1300. function __f__(type) {
  1301. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1302. args[_key3 - 1] = arguments[_key3];
  1303. }
  1304. console[type].apply(console, args);
  1305. }
  1306. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1307. if (!baseInfo) {
  1308. baseInfo = wx.getSystemInfoSync();
  1309. }
  1310. var host = baseInfo ? baseInfo.host : null;
  1311. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1312. var api = /*#__PURE__*/Object.freeze({
  1313. __proto__: null,
  1314. shareVideoMessage: shareVideoMessage,
  1315. getPushClientId: getPushClientId,
  1316. onPushMessage: onPushMessage,
  1317. offPushMessage: offPushMessage,
  1318. invokePushCallback: invokePushCallback,
  1319. __f__: __f__
  1320. });
  1321. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1322. function findVmByVueId(vm, vuePid) {
  1323. var $children = vm.$children;
  1324. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1325. for (var i = $children.length - 1; i >= 0; i--) {
  1326. var childVm = $children[i];
  1327. if (childVm.$scope._$vueId === vuePid) {
  1328. return childVm;
  1329. }
  1330. }
  1331. // 反向递归查找
  1332. var parentVm;
  1333. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1334. parentVm = findVmByVueId($children[_i], vuePid);
  1335. if (parentVm) {
  1336. return parentVm;
  1337. }
  1338. }
  1339. }
  1340. function initBehavior(options) {
  1341. return Behavior(options);
  1342. }
  1343. function isPage() {
  1344. return !!this.route;
  1345. }
  1346. function initRelation(detail) {
  1347. this.triggerEvent('__l', detail);
  1348. }
  1349. function selectAllComponents(mpInstance, selector, $refs) {
  1350. var components = mpInstance.selectAllComponents(selector) || [];
  1351. components.forEach(function (component) {
  1352. var ref = component.dataset.ref;
  1353. $refs[ref] = component.$vm || toSkip(component);
  1354. {
  1355. if (component.dataset.vueGeneric === 'scoped') {
  1356. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1357. selectAllComponents(scopedComponent, selector, $refs);
  1358. });
  1359. }
  1360. }
  1361. });
  1362. }
  1363. function syncRefs(refs, newRefs) {
  1364. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1365. var newKeys = Object.keys(newRefs);
  1366. newKeys.forEach(function (key) {
  1367. var oldValue = refs[key];
  1368. var newValue = newRefs[key];
  1369. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1370. return oldValue.includes(value);
  1371. })) {
  1372. return;
  1373. }
  1374. refs[key] = newValue;
  1375. oldKeys.delete(key);
  1376. });
  1377. oldKeys.forEach(function (key) {
  1378. delete refs[key];
  1379. });
  1380. return refs;
  1381. }
  1382. function initRefs(vm) {
  1383. var mpInstance = vm.$scope;
  1384. var refs = {};
  1385. Object.defineProperty(vm, '$refs', {
  1386. get: function get() {
  1387. var $refs = {};
  1388. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1389. // TODO 暂不考虑 for 中的 scoped
  1390. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1391. forComponents.forEach(function (component) {
  1392. var ref = component.dataset.ref;
  1393. if (!$refs[ref]) {
  1394. $refs[ref] = [];
  1395. }
  1396. $refs[ref].push(component.$vm || toSkip(component));
  1397. });
  1398. return syncRefs(refs, $refs);
  1399. }
  1400. });
  1401. }
  1402. function handleLink(event) {
  1403. var _ref3 = event.detail || event.value,
  1404. vuePid = _ref3.vuePid,
  1405. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1406. var parentVm;
  1407. if (vuePid) {
  1408. parentVm = findVmByVueId(this.$vm, vuePid);
  1409. }
  1410. if (!parentVm) {
  1411. parentVm = this.$vm;
  1412. }
  1413. vueOptions.parent = parentVm;
  1414. }
  1415. function markMPComponent(component) {
  1416. // 在 Vue 中标记为小程序组件
  1417. var IS_MP = '__v_isMPComponent';
  1418. Object.defineProperty(component, IS_MP, {
  1419. configurable: true,
  1420. enumerable: false,
  1421. value: true
  1422. });
  1423. return component;
  1424. }
  1425. function toSkip(obj) {
  1426. var OB = '__ob__';
  1427. var SKIP = '__v_skip';
  1428. if (isObject(obj) && Object.isExtensible(obj)) {
  1429. // 避免被 @vue/composition-api 观测
  1430. Object.defineProperty(obj, OB, {
  1431. configurable: true,
  1432. enumerable: false,
  1433. value: (0, _defineProperty2.default)({}, SKIP, true)
  1434. });
  1435. }
  1436. return obj;
  1437. }
  1438. var WORKLET_RE = /_(.*)_worklet_factory_/;
  1439. function initWorkletMethods(mpMethods, vueMethods) {
  1440. if (vueMethods) {
  1441. Object.keys(vueMethods).forEach(function (name) {
  1442. var matches = name.match(WORKLET_RE);
  1443. if (matches) {
  1444. var workletName = matches[1];
  1445. mpMethods[name] = vueMethods[name];
  1446. mpMethods[workletName] = vueMethods[workletName];
  1447. }
  1448. });
  1449. }
  1450. }
  1451. var MPPage = Page;
  1452. var MPComponent = Component;
  1453. var customizeRE = /:/g;
  1454. var customize = cached(function (str) {
  1455. return camelize(str.replace(customizeRE, '-'));
  1456. });
  1457. function initTriggerEvent(mpInstance) {
  1458. var oldTriggerEvent = mpInstance.triggerEvent;
  1459. var newTriggerEvent = function newTriggerEvent(event) {
  1460. for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  1461. args[_key4 - 1] = arguments[_key4];
  1462. }
  1463. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1464. if (this.$vm || this.dataset && this.dataset.comType) {
  1465. event = customize(event);
  1466. } else {
  1467. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1468. var newEvent = customize(event);
  1469. if (newEvent !== event) {
  1470. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1471. }
  1472. }
  1473. return oldTriggerEvent.apply(this, [event].concat(args));
  1474. };
  1475. try {
  1476. // 京东小程序 triggerEvent 为只读
  1477. mpInstance.triggerEvent = newTriggerEvent;
  1478. } catch (error) {
  1479. mpInstance._triggerEvent = newTriggerEvent;
  1480. }
  1481. }
  1482. function initHook(name, options, isComponent) {
  1483. var oldHook = options[name];
  1484. options[name] = function () {
  1485. markMPComponent(this);
  1486. initTriggerEvent(this);
  1487. if (oldHook) {
  1488. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  1489. args[_key5] = arguments[_key5];
  1490. }
  1491. return oldHook.apply(this, args);
  1492. }
  1493. };
  1494. }
  1495. if (!MPPage.__$wrappered) {
  1496. MPPage.__$wrappered = true;
  1497. Page = function Page() {
  1498. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1499. initHook('onLoad', options);
  1500. return MPPage(options);
  1501. };
  1502. Page.after = MPPage.after;
  1503. Component = function Component() {
  1504. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1505. initHook('created', options);
  1506. return MPComponent(options);
  1507. };
  1508. }
  1509. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1510. function initMocks(vm, mocks) {
  1511. var mpInstance = vm.$mp[vm.mpType];
  1512. mocks.forEach(function (mock) {
  1513. if (hasOwn(mpInstance, mock)) {
  1514. vm[mock] = mpInstance[mock];
  1515. }
  1516. });
  1517. }
  1518. function hasHook(hook, vueOptions) {
  1519. if (!vueOptions) {
  1520. return true;
  1521. }
  1522. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1523. return true;
  1524. }
  1525. vueOptions = vueOptions.default || vueOptions;
  1526. if (isFn(vueOptions)) {
  1527. if (isFn(vueOptions.extendOptions[hook])) {
  1528. return true;
  1529. }
  1530. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1531. return true;
  1532. }
  1533. return false;
  1534. }
  1535. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1536. return true;
  1537. }
  1538. var mixins = vueOptions.mixins;
  1539. if (Array.isArray(mixins)) {
  1540. return !!mixins.find(function (mixin) {
  1541. return hasHook(hook, mixin);
  1542. });
  1543. }
  1544. }
  1545. function initHooks(mpOptions, hooks, vueOptions) {
  1546. hooks.forEach(function (hook) {
  1547. if (hasHook(hook, vueOptions)) {
  1548. mpOptions[hook] = function (args) {
  1549. return this.$vm && this.$vm.__call_hook(hook, args);
  1550. };
  1551. }
  1552. });
  1553. }
  1554. function initUnknownHooks(mpOptions, vueOptions) {
  1555. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1556. findHooks(vueOptions).forEach(function (hook) {
  1557. return initHook$1(mpOptions, hook, excludes);
  1558. });
  1559. }
  1560. function findHooks(vueOptions) {
  1561. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1562. if (vueOptions) {
  1563. Object.keys(vueOptions).forEach(function (name) {
  1564. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1565. hooks.push(name);
  1566. }
  1567. });
  1568. }
  1569. return hooks;
  1570. }
  1571. function initHook$1(mpOptions, hook, excludes) {
  1572. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1573. mpOptions[hook] = function (args) {
  1574. return this.$vm && this.$vm.__call_hook(hook, args);
  1575. };
  1576. }
  1577. }
  1578. function initVueComponent(Vue, vueOptions) {
  1579. vueOptions = vueOptions.default || vueOptions;
  1580. var VueComponent;
  1581. if (isFn(vueOptions)) {
  1582. VueComponent = vueOptions;
  1583. } else {
  1584. VueComponent = Vue.extend(vueOptions);
  1585. }
  1586. vueOptions = VueComponent.options;
  1587. return [VueComponent, vueOptions];
  1588. }
  1589. function initSlots(vm, vueSlots) {
  1590. if (Array.isArray(vueSlots) && vueSlots.length) {
  1591. var $slots = Object.create(null);
  1592. vueSlots.forEach(function (slotName) {
  1593. $slots[slotName] = true;
  1594. });
  1595. vm.$scopedSlots = vm.$slots = $slots;
  1596. }
  1597. }
  1598. function initVueIds(vueIds, mpInstance) {
  1599. vueIds = (vueIds || '').split(',');
  1600. var len = vueIds.length;
  1601. if (len === 1) {
  1602. mpInstance._$vueId = vueIds[0];
  1603. } else if (len === 2) {
  1604. mpInstance._$vueId = vueIds[0];
  1605. mpInstance._$vuePid = vueIds[1];
  1606. }
  1607. }
  1608. function initData(vueOptions, context) {
  1609. var data = vueOptions.data || {};
  1610. var methods = vueOptions.methods || {};
  1611. if (typeof data === 'function') {
  1612. try {
  1613. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1614. } catch (e) {
  1615. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"project2","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1616. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1617. }
  1618. }
  1619. } else {
  1620. try {
  1621. // 对 data 格式化
  1622. data = JSON.parse(JSON.stringify(data));
  1623. } catch (e) {}
  1624. }
  1625. if (!isPlainObject(data)) {
  1626. data = {};
  1627. }
  1628. Object.keys(methods).forEach(function (methodName) {
  1629. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1630. data[methodName] = methods[methodName];
  1631. }
  1632. });
  1633. return data;
  1634. }
  1635. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1636. function createObserver(name) {
  1637. return function observer(newVal, oldVal) {
  1638. if (this.$vm) {
  1639. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1640. }
  1641. };
  1642. }
  1643. function initBehaviors(vueOptions, initBehavior) {
  1644. var vueBehaviors = vueOptions.behaviors;
  1645. var vueExtends = vueOptions.extends;
  1646. var vueMixins = vueOptions.mixins;
  1647. var vueProps = vueOptions.props;
  1648. if (!vueProps) {
  1649. vueOptions.props = vueProps = [];
  1650. }
  1651. var behaviors = [];
  1652. if (Array.isArray(vueBehaviors)) {
  1653. vueBehaviors.forEach(function (behavior) {
  1654. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1655. if (behavior === 'uni://form-field') {
  1656. if (Array.isArray(vueProps)) {
  1657. vueProps.push('name');
  1658. vueProps.push('value');
  1659. } else {
  1660. vueProps.name = {
  1661. type: String,
  1662. default: ''
  1663. };
  1664. vueProps.value = {
  1665. type: [String, Number, Boolean, Array, Object, Date],
  1666. default: ''
  1667. };
  1668. }
  1669. }
  1670. });
  1671. }
  1672. if (isPlainObject(vueExtends) && vueExtends.props) {
  1673. behaviors.push(initBehavior({
  1674. properties: initProperties(vueExtends.props, true)
  1675. }));
  1676. }
  1677. if (Array.isArray(vueMixins)) {
  1678. vueMixins.forEach(function (vueMixin) {
  1679. if (isPlainObject(vueMixin) && vueMixin.props) {
  1680. behaviors.push(initBehavior({
  1681. properties: initProperties(vueMixin.props, true)
  1682. }));
  1683. }
  1684. });
  1685. }
  1686. return behaviors;
  1687. }
  1688. function parsePropType(key, type, defaultValue, file) {
  1689. // [String]=>String
  1690. if (Array.isArray(type) && type.length === 1) {
  1691. return type[0];
  1692. }
  1693. return type;
  1694. }
  1695. function initProperties(props) {
  1696. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1697. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1698. var options = arguments.length > 3 ? arguments[3] : undefined;
  1699. var properties = {};
  1700. if (!isBehavior) {
  1701. properties.vueId = {
  1702. type: String,
  1703. value: ''
  1704. };
  1705. {
  1706. if (options.virtualHost) {
  1707. properties.virtualHostStyle = {
  1708. type: null,
  1709. value: ''
  1710. };
  1711. properties.virtualHostClass = {
  1712. type: null,
  1713. value: ''
  1714. };
  1715. }
  1716. }
  1717. // scopedSlotsCompiler auto
  1718. properties.scopedSlotsCompiler = {
  1719. type: String,
  1720. value: ''
  1721. };
  1722. properties.vueSlots = {
  1723. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1724. type: null,
  1725. value: [],
  1726. observer: function observer(newVal, oldVal) {
  1727. var $slots = Object.create(null);
  1728. newVal.forEach(function (slotName) {
  1729. $slots[slotName] = true;
  1730. });
  1731. this.setData({
  1732. $slots: $slots
  1733. });
  1734. }
  1735. };
  1736. }
  1737. if (Array.isArray(props)) {
  1738. // ['title']
  1739. props.forEach(function (key) {
  1740. properties[key] = {
  1741. type: null,
  1742. observer: createObserver(key)
  1743. };
  1744. });
  1745. } else if (isPlainObject(props)) {
  1746. // {title:{type:String,default:''},content:String}
  1747. Object.keys(props).forEach(function (key) {
  1748. var opts = props[key];
  1749. if (isPlainObject(opts)) {
  1750. // title:{type:String,default:''}
  1751. var value = opts.default;
  1752. if (isFn(value)) {
  1753. value = value();
  1754. }
  1755. opts.type = parsePropType(key, opts.type);
  1756. properties[key] = {
  1757. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1758. value: value,
  1759. observer: createObserver(key)
  1760. };
  1761. } else {
  1762. // content:String
  1763. var type = parsePropType(key, opts);
  1764. properties[key] = {
  1765. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1766. observer: createObserver(key)
  1767. };
  1768. }
  1769. });
  1770. }
  1771. return properties;
  1772. }
  1773. function wrapper$1(event) {
  1774. // TODO 又得兼容 mpvue 的 mp 对象
  1775. try {
  1776. event.mp = JSON.parse(JSON.stringify(event));
  1777. } catch (e) {}
  1778. event.stopPropagation = noop;
  1779. event.preventDefault = noop;
  1780. event.target = event.target || {};
  1781. if (!hasOwn(event, 'detail')) {
  1782. event.detail = {};
  1783. }
  1784. if (hasOwn(event, 'markerId')) {
  1785. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1786. event.detail.markerId = event.markerId;
  1787. }
  1788. if (isPlainObject(event.detail)) {
  1789. event.target = Object.assign({}, event.target, event.detail);
  1790. }
  1791. return event;
  1792. }
  1793. function getExtraValue(vm, dataPathsArray) {
  1794. var context = vm;
  1795. dataPathsArray.forEach(function (dataPathArray) {
  1796. var dataPath = dataPathArray[0];
  1797. var value = dataPathArray[2];
  1798. if (dataPath || typeof value !== 'undefined') {
  1799. // ['','',index,'disable']
  1800. var propPath = dataPathArray[1];
  1801. var valuePath = dataPathArray[3];
  1802. var vFor;
  1803. if (Number.isInteger(dataPath)) {
  1804. vFor = dataPath;
  1805. } else if (!dataPath) {
  1806. vFor = context;
  1807. } else if (typeof dataPath === 'string' && dataPath) {
  1808. if (dataPath.indexOf('#s#') === 0) {
  1809. vFor = dataPath.substr(3);
  1810. } else {
  1811. vFor = vm.__get_value(dataPath, context);
  1812. }
  1813. }
  1814. if (Number.isInteger(vFor)) {
  1815. context = value;
  1816. } else if (!propPath) {
  1817. context = vFor[value];
  1818. } else {
  1819. if (Array.isArray(vFor)) {
  1820. context = vFor.find(function (vForItem) {
  1821. return vm.__get_value(propPath, vForItem) === value;
  1822. });
  1823. } else if (isPlainObject(vFor)) {
  1824. context = Object.keys(vFor).find(function (vForKey) {
  1825. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1826. });
  1827. } else {
  1828. console.error('v-for 暂不支持循环数据:', vFor);
  1829. }
  1830. }
  1831. if (valuePath) {
  1832. context = vm.__get_value(valuePath, context);
  1833. }
  1834. }
  1835. });
  1836. return context;
  1837. }
  1838. function processEventExtra(vm, extra, event, __args__) {
  1839. var extraObj = {};
  1840. if (Array.isArray(extra) && extra.length) {
  1841. /**
  1842. *[
  1843. * ['data.items', 'data.id', item.data.id],
  1844. * ['metas', 'id', meta.id]
  1845. *],
  1846. *[
  1847. * ['data.items', 'data.id', item.data.id],
  1848. * ['metas', 'id', meta.id]
  1849. *],
  1850. *'test'
  1851. */
  1852. extra.forEach(function (dataPath, index) {
  1853. if (typeof dataPath === 'string') {
  1854. if (!dataPath) {
  1855. // model,prop.sync
  1856. extraObj['$' + index] = vm;
  1857. } else {
  1858. if (dataPath === '$event') {
  1859. // $event
  1860. extraObj['$' + index] = event;
  1861. } else if (dataPath === 'arguments') {
  1862. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1863. } else if (dataPath.indexOf('$event.') === 0) {
  1864. // $event.target.value
  1865. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1866. } else {
  1867. extraObj['$' + index] = vm.__get_value(dataPath);
  1868. }
  1869. }
  1870. } else {
  1871. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1872. }
  1873. });
  1874. }
  1875. return extraObj;
  1876. }
  1877. function getObjByArray(arr) {
  1878. var obj = {};
  1879. for (var i = 1; i < arr.length; i++) {
  1880. var element = arr[i];
  1881. obj[element[0]] = element[1];
  1882. }
  1883. return obj;
  1884. }
  1885. function processEventArgs(vm, event) {
  1886. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1887. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1888. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1889. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1890. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1891. // fixed 用户直接触发 mpInstance.triggerEvent
  1892. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1893. if (isCustom) {
  1894. // 自定义事件
  1895. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1896. if (!args.length) {
  1897. // 无参数,直接传入 event 或 detail 数组
  1898. if (isCustomMPEvent) {
  1899. return [event];
  1900. }
  1901. return __args__;
  1902. }
  1903. }
  1904. var extraObj = processEventExtra(vm, extra, event, __args__);
  1905. var ret = [];
  1906. args.forEach(function (arg) {
  1907. if (arg === '$event') {
  1908. if (methodName === '__set_model' && !isCustom) {
  1909. // input v-model value
  1910. ret.push(event.target.value);
  1911. } else {
  1912. if (isCustom && !isCustomMPEvent) {
  1913. ret.push(__args__[0]);
  1914. } else {
  1915. // wxcomponent 组件或内置组件
  1916. ret.push(event);
  1917. }
  1918. }
  1919. } else {
  1920. if (Array.isArray(arg) && arg[0] === 'o') {
  1921. ret.push(getObjByArray(arg));
  1922. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1923. ret.push(extraObj[arg]);
  1924. } else {
  1925. ret.push(arg);
  1926. }
  1927. }
  1928. });
  1929. return ret;
  1930. }
  1931. var ONCE = '~';
  1932. var CUSTOM = '^';
  1933. function isMatchEventType(eventType, optType) {
  1934. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1935. }
  1936. function getContextVm(vm) {
  1937. var $parent = vm.$parent;
  1938. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1939. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1940. $parent = $parent.$parent;
  1941. }
  1942. return $parent && $parent.$parent;
  1943. }
  1944. function handleEvent(event) {
  1945. var _this2 = this;
  1946. event = wrapper$1(event);
  1947. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1948. var dataset = (event.currentTarget || event.target).dataset;
  1949. if (!dataset) {
  1950. return console.warn('事件信息不存在');
  1951. }
  1952. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1953. if (!eventOpts) {
  1954. return console.warn('事件信息不存在');
  1955. }
  1956. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1957. var eventType = event.type;
  1958. var ret = [];
  1959. eventOpts.forEach(function (eventOpt) {
  1960. var type = eventOpt[0];
  1961. var eventsArray = eventOpt[1];
  1962. var isCustom = type.charAt(0) === CUSTOM;
  1963. type = isCustom ? type.slice(1) : type;
  1964. var isOnce = type.charAt(0) === ONCE;
  1965. type = isOnce ? type.slice(1) : type;
  1966. if (eventsArray && isMatchEventType(eventType, type)) {
  1967. eventsArray.forEach(function (eventArray) {
  1968. var methodName = eventArray[0];
  1969. if (methodName) {
  1970. var handlerCtx = _this2.$vm;
  1971. if (handlerCtx.$options.generic) {
  1972. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1973. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1974. }
  1975. if (methodName === '$emit') {
  1976. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1977. return;
  1978. }
  1979. var handler = handlerCtx[methodName];
  1980. if (!isFn(handler)) {
  1981. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1982. var path = _this2.route || _this2.is;
  1983. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1984. }
  1985. if (isOnce) {
  1986. if (handler.once) {
  1987. return;
  1988. }
  1989. handler.once = true;
  1990. }
  1991. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1992. params = Array.isArray(params) ? params : [];
  1993. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1994. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1995. // eslint-disable-next-line no-sparse-arrays
  1996. params = params.concat([,,,,,,,,,, event]);
  1997. }
  1998. ret.push(handler.apply(handlerCtx, params));
  1999. }
  2000. });
  2001. }
  2002. });
  2003. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2004. return ret[0];
  2005. }
  2006. }
  2007. var eventChannels = {};
  2008. function getEventChannel(id) {
  2009. var eventChannel = eventChannels[id];
  2010. delete eventChannels[id];
  2011. return eventChannel;
  2012. }
  2013. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2014. function initEventChannel() {
  2015. _vue.default.prototype.getOpenerEventChannel = function () {
  2016. // 微信小程序使用自身getOpenerEventChannel
  2017. {
  2018. return this.$scope.getOpenerEventChannel();
  2019. }
  2020. };
  2021. var callHook = _vue.default.prototype.__call_hook;
  2022. _vue.default.prototype.__call_hook = function (hook, args) {
  2023. if (hook === 'onLoad' && args && args.__id__) {
  2024. this.__eventChannel__ = getEventChannel(args.__id__);
  2025. delete args.__id__;
  2026. }
  2027. return callHook.call(this, hook, args);
  2028. };
  2029. }
  2030. function initScopedSlotsParams() {
  2031. var center = {};
  2032. var parents = {};
  2033. function currentId(fn) {
  2034. var vueIds = this.$options.propsData.vueId;
  2035. if (vueIds) {
  2036. var vueId = vueIds.split(',')[0];
  2037. fn(vueId);
  2038. }
  2039. }
  2040. _vue.default.prototype.$hasSSP = function (vueId) {
  2041. var slot = center[vueId];
  2042. if (!slot) {
  2043. parents[vueId] = this;
  2044. this.$on('hook:destroyed', function () {
  2045. delete parents[vueId];
  2046. });
  2047. }
  2048. return slot;
  2049. };
  2050. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  2051. var slot = center[vueId];
  2052. if (slot) {
  2053. var params = slot[name] || [];
  2054. if (needAll) {
  2055. return params;
  2056. }
  2057. return params[0];
  2058. }
  2059. };
  2060. _vue.default.prototype.$setSSP = function (name, value) {
  2061. var index = 0;
  2062. currentId.call(this, function (vueId) {
  2063. var slot = center[vueId];
  2064. var params = slot[name] = slot[name] || [];
  2065. params.push(value);
  2066. index = params.length - 1;
  2067. });
  2068. return index;
  2069. };
  2070. _vue.default.prototype.$initSSP = function () {
  2071. currentId.call(this, function (vueId) {
  2072. center[vueId] = {};
  2073. });
  2074. };
  2075. _vue.default.prototype.$callSSP = function () {
  2076. currentId.call(this, function (vueId) {
  2077. if (parents[vueId]) {
  2078. parents[vueId].$forceUpdate();
  2079. }
  2080. });
  2081. };
  2082. _vue.default.mixin({
  2083. destroyed: function destroyed() {
  2084. var propsData = this.$options.propsData;
  2085. var vueId = propsData && propsData.vueId;
  2086. if (vueId) {
  2087. delete center[vueId];
  2088. delete parents[vueId];
  2089. }
  2090. }
  2091. });
  2092. }
  2093. function parseBaseApp(vm, _ref4) {
  2094. var mocks = _ref4.mocks,
  2095. initRefs = _ref4.initRefs;
  2096. initEventChannel();
  2097. {
  2098. initScopedSlotsParams();
  2099. }
  2100. if (vm.$options.store) {
  2101. _vue.default.prototype.$store = vm.$options.store;
  2102. }
  2103. uniIdMixin(_vue.default);
  2104. _vue.default.prototype.mpHost = "mp-weixin";
  2105. _vue.default.mixin({
  2106. beforeCreate: function beforeCreate() {
  2107. if (!this.$options.mpType) {
  2108. return;
  2109. }
  2110. this.mpType = this.$options.mpType;
  2111. this.$mp = (0, _defineProperty2.default)({
  2112. data: {}
  2113. }, this.mpType, this.$options.mpInstance);
  2114. this.$scope = this.$options.mpInstance;
  2115. delete this.$options.mpType;
  2116. delete this.$options.mpInstance;
  2117. if (this.mpType === 'page' && typeof getApp === 'function') {
  2118. // hack vue-i18n
  2119. var app = getApp();
  2120. if (app.$vm && app.$vm.$i18n) {
  2121. this._i18n = app.$vm.$i18n;
  2122. }
  2123. }
  2124. if (this.mpType !== 'app') {
  2125. initRefs(this);
  2126. initMocks(this, mocks);
  2127. }
  2128. }
  2129. });
  2130. var appOptions = {
  2131. onLaunch: function onLaunch(args) {
  2132. if (this.$vm) {
  2133. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2134. return;
  2135. }
  2136. {
  2137. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2138. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2139. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2140. }
  2141. }
  2142. this.$vm = vm;
  2143. this.$vm.$mp = {
  2144. app: this
  2145. };
  2146. this.$vm.$scope = this;
  2147. // vm 上也挂载 globalData
  2148. this.$vm.globalData = this.globalData;
  2149. this.$vm._isMounted = true;
  2150. this.$vm.__call_hook('mounted', args);
  2151. this.$vm.__call_hook('onLaunch', args);
  2152. }
  2153. };
  2154. // 兼容旧版本 globalData
  2155. appOptions.globalData = vm.$options.globalData || {};
  2156. // 将 methods 中的方法挂在 getApp() 中
  2157. var methods = vm.$options.methods;
  2158. if (methods) {
  2159. Object.keys(methods).forEach(function (name) {
  2160. appOptions[name] = methods[name];
  2161. });
  2162. }
  2163. initAppLocale(_vue.default, vm, getLocaleLanguage$1());
  2164. initHooks(appOptions, hooks);
  2165. initUnknownHooks(appOptions, vm.$options);
  2166. return appOptions;
  2167. }
  2168. function getLocaleLanguage$1() {
  2169. var localeLanguage = '';
  2170. {
  2171. var appBaseInfo = wx.getAppBaseInfo();
  2172. var language = appBaseInfo && appBaseInfo.language ? appBaseInfo.language : LOCALE_EN;
  2173. localeLanguage = normalizeLocale(language) || LOCALE_EN;
  2174. }
  2175. return localeLanguage;
  2176. }
  2177. function parseApp(vm) {
  2178. return parseBaseApp(vm, {
  2179. mocks: mocks,
  2180. initRefs: initRefs
  2181. });
  2182. }
  2183. function createApp(vm) {
  2184. App(parseApp(vm));
  2185. return vm;
  2186. }
  2187. var encodeReserveRE = /[!'()*]/g;
  2188. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2189. return '%' + c.charCodeAt(0).toString(16);
  2190. };
  2191. var commaRE = /%2C/g;
  2192. // fixed encodeURIComponent which is more conformant to RFC3986:
  2193. // - escapes [!'()*]
  2194. // - preserve commas
  2195. var encode = function encode(str) {
  2196. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2197. };
  2198. function stringifyQuery(obj) {
  2199. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2200. var res = obj ? Object.keys(obj).map(function (key) {
  2201. var val = obj[key];
  2202. if (val === undefined) {
  2203. return '';
  2204. }
  2205. if (val === null) {
  2206. return encodeStr(key);
  2207. }
  2208. if (Array.isArray(val)) {
  2209. var result = [];
  2210. val.forEach(function (val2) {
  2211. if (val2 === undefined) {
  2212. return;
  2213. }
  2214. if (val2 === null) {
  2215. result.push(encodeStr(key));
  2216. } else {
  2217. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2218. }
  2219. });
  2220. return result.join('&');
  2221. }
  2222. return encodeStr(key) + '=' + encodeStr(val);
  2223. }).filter(function (x) {
  2224. return x.length > 0;
  2225. }).join('&') : null;
  2226. return res ? "?".concat(res) : '';
  2227. }
  2228. function parseBaseComponent(vueComponentOptions) {
  2229. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2230. isPage = _ref5.isPage,
  2231. initRelation = _ref5.initRelation;
  2232. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2233. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2234. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2235. VueComponent = _initVueComponent2[0],
  2236. vueOptions = _initVueComponent2[1];
  2237. var options = _objectSpread({
  2238. multipleSlots: true,
  2239. // styleIsolation: 'apply-shared',
  2240. addGlobalClass: true
  2241. }, vueOptions.options || {});
  2242. {
  2243. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2244. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2245. Object.assign(options, vueOptions['mp-weixin'].options);
  2246. }
  2247. }
  2248. var componentOptions = {
  2249. options: options,
  2250. data: initData(vueOptions, _vue.default.prototype),
  2251. behaviors: initBehaviors(vueOptions, initBehavior),
  2252. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2253. lifetimes: {
  2254. attached: function attached() {
  2255. var properties = this.properties;
  2256. var options = {
  2257. mpType: isPage.call(this) ? 'page' : 'component',
  2258. mpInstance: this,
  2259. propsData: properties
  2260. };
  2261. initVueIds(properties.vueId, this);
  2262. // 处理父子关系
  2263. initRelation.call(this, {
  2264. vuePid: this._$vuePid,
  2265. vueOptions: options
  2266. });
  2267. // 初始化 vue 实例
  2268. this.$vm = new VueComponent(options);
  2269. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2270. initSlots(this.$vm, properties.vueSlots);
  2271. // 触发首次 setData
  2272. this.$vm.$mount();
  2273. },
  2274. ready: function ready() {
  2275. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2276. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2277. if (this.$vm) {
  2278. this.$vm._isMounted = true;
  2279. this.$vm.__call_hook('mounted');
  2280. this.$vm.__call_hook('onReady');
  2281. }
  2282. },
  2283. detached: function detached() {
  2284. this.$vm && this.$vm.$destroy();
  2285. }
  2286. },
  2287. pageLifetimes: {
  2288. show: function show(args) {
  2289. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2290. },
  2291. hide: function hide() {
  2292. this.$vm && this.$vm.__call_hook('onPageHide');
  2293. },
  2294. resize: function resize(size) {
  2295. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2296. }
  2297. },
  2298. methods: {
  2299. __l: handleLink,
  2300. __e: handleEvent
  2301. }
  2302. };
  2303. // externalClasses
  2304. if (vueOptions.externalClasses) {
  2305. componentOptions.externalClasses = vueOptions.externalClasses;
  2306. }
  2307. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2308. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2309. componentOptions.methods[callMethod] = function (args) {
  2310. return this.$vm[callMethod](args);
  2311. };
  2312. });
  2313. }
  2314. if (needVueOptions) {
  2315. return [componentOptions, vueOptions, VueComponent];
  2316. }
  2317. if (isPage) {
  2318. return componentOptions;
  2319. }
  2320. return [componentOptions, VueComponent];
  2321. }
  2322. function parseComponent(vueComponentOptions, needVueOptions) {
  2323. return parseBaseComponent(vueComponentOptions, {
  2324. isPage: isPage,
  2325. initRelation: initRelation
  2326. }, needVueOptions);
  2327. }
  2328. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2329. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2330. function parseBasePage(vuePageOptions) {
  2331. var _parseComponent = parseComponent(vuePageOptions, true),
  2332. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2333. pageOptions = _parseComponent2[0],
  2334. vueOptions = _parseComponent2[1];
  2335. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2336. pageOptions.methods.onLoad = function (query) {
  2337. this.options = query;
  2338. var copyQuery = Object.assign({}, query);
  2339. delete copyQuery.__id__;
  2340. this.$page = {
  2341. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2342. };
  2343. this.$vm.$mp.query = query; // 兼容 mpvue
  2344. this.$vm.__call_hook('onLoad', query);
  2345. };
  2346. {
  2347. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2348. }
  2349. {
  2350. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2351. }
  2352. return pageOptions;
  2353. }
  2354. function parsePage(vuePageOptions) {
  2355. return parseBasePage(vuePageOptions);
  2356. }
  2357. function createPage(vuePageOptions) {
  2358. {
  2359. return Component(parsePage(vuePageOptions));
  2360. }
  2361. }
  2362. function createComponent(vueOptions) {
  2363. {
  2364. return Component(parseComponent(vueOptions));
  2365. }
  2366. }
  2367. function createSubpackageApp(vm) {
  2368. var appOptions = parseApp(vm);
  2369. var app = getApp({
  2370. allowDefault: true
  2371. });
  2372. vm.$scope = app;
  2373. var globalData = app.globalData;
  2374. if (globalData) {
  2375. Object.keys(appOptions.globalData).forEach(function (name) {
  2376. if (!hasOwn(globalData, name)) {
  2377. globalData[name] = appOptions.globalData[name];
  2378. }
  2379. });
  2380. }
  2381. Object.keys(appOptions).forEach(function (name) {
  2382. if (!hasOwn(app, name)) {
  2383. app[name] = appOptions[name];
  2384. }
  2385. });
  2386. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2387. wx.onAppShow(function () {
  2388. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2389. args[_key6] = arguments[_key6];
  2390. }
  2391. vm.__call_hook('onShow', args);
  2392. });
  2393. }
  2394. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2395. wx.onAppHide(function () {
  2396. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2397. args[_key7] = arguments[_key7];
  2398. }
  2399. vm.__call_hook('onHide', args);
  2400. });
  2401. }
  2402. if (isFn(appOptions.onLaunch)) {
  2403. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2404. vm.__call_hook('onLaunch', args);
  2405. }
  2406. return vm;
  2407. }
  2408. function createPlugin(vm) {
  2409. var appOptions = parseApp(vm);
  2410. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2411. wx.onAppShow(function () {
  2412. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2413. args[_key8] = arguments[_key8];
  2414. }
  2415. vm.__call_hook('onShow', args);
  2416. });
  2417. }
  2418. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2419. wx.onAppHide(function () {
  2420. for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
  2421. args[_key9] = arguments[_key9];
  2422. }
  2423. vm.__call_hook('onHide', args);
  2424. });
  2425. }
  2426. if (isFn(appOptions.onLaunch)) {
  2427. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2428. vm.__call_hook('onLaunch', args);
  2429. }
  2430. return vm;
  2431. }
  2432. todos.forEach(function (todoApi) {
  2433. protocols[todoApi] = false;
  2434. });
  2435. canIUses.forEach(function (canIUseApi) {
  2436. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2437. if (!wx.canIUse(apiName)) {
  2438. protocols[canIUseApi] = false;
  2439. }
  2440. });
  2441. var uni = {};
  2442. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2443. uni = new Proxy({}, {
  2444. get: function get(target, name) {
  2445. if (hasOwn(target, name)) {
  2446. return target[name];
  2447. }
  2448. if (baseApi[name]) {
  2449. return baseApi[name];
  2450. }
  2451. if (api[name]) {
  2452. return promisify(name, api[name]);
  2453. }
  2454. {
  2455. if (extraApi[name]) {
  2456. return promisify(name, extraApi[name]);
  2457. }
  2458. if (todoApis[name]) {
  2459. return promisify(name, todoApis[name]);
  2460. }
  2461. }
  2462. if (eventApi[name]) {
  2463. return eventApi[name];
  2464. }
  2465. return promisify(name, wrapper(name, wx[name]));
  2466. },
  2467. set: function set(target, name, value) {
  2468. target[name] = value;
  2469. return true;
  2470. }
  2471. });
  2472. } else {
  2473. Object.keys(baseApi).forEach(function (name) {
  2474. uni[name] = baseApi[name];
  2475. });
  2476. {
  2477. Object.keys(todoApis).forEach(function (name) {
  2478. uni[name] = promisify(name, todoApis[name]);
  2479. });
  2480. Object.keys(extraApi).forEach(function (name) {
  2481. uni[name] = promisify(name, extraApi[name]);
  2482. });
  2483. }
  2484. Object.keys(eventApi).forEach(function (name) {
  2485. uni[name] = eventApi[name];
  2486. });
  2487. Object.keys(api).forEach(function (name) {
  2488. uni[name] = promisify(name, api[name]);
  2489. });
  2490. Object.keys(wx).forEach(function (name) {
  2491. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2492. uni[name] = promisify(name, wrapper(name, wx[name]));
  2493. }
  2494. });
  2495. }
  2496. wx.createApp = createApp;
  2497. wx.createPage = createPage;
  2498. wx.createComponent = createComponent;
  2499. wx.createSubpackageApp = createSubpackageApp;
  2500. wx.createPlugin = createPlugin;
  2501. var uni$1 = uni;
  2502. var _default = uni$1;
  2503. exports.default = _default;
  2504. /* 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)))
  2505. /***/ }),
  2506. /* 3 */
  2507. /*!***********************************!*\
  2508. !*** (webpack)/buildin/global.js ***!
  2509. \***********************************/
  2510. /*! no static exports found */
  2511. /***/ (function(module, exports) {
  2512. var g;
  2513. // This works in non-strict mode
  2514. g = (function() {
  2515. return this;
  2516. })();
  2517. try {
  2518. // This works if eval is allowed (see CSP)
  2519. g = g || new Function("return this")();
  2520. } catch (e) {
  2521. // This works if the window reference is available
  2522. if (typeof window === "object") g = window;
  2523. }
  2524. // g can still be undefined, but nothing to do about it...
  2525. // We return undefined, instead of nothing here, so it's
  2526. // easier to handle this case. if(!global) { ...}
  2527. module.exports = g;
  2528. /***/ }),
  2529. /* 4 */
  2530. /*!**********************************************************************!*\
  2531. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  2532. \**********************************************************************/
  2533. /*! no static exports found */
  2534. /***/ (function(module, exports) {
  2535. function _interopRequireDefault(obj) {
  2536. return obj && obj.__esModule ? obj : {
  2537. "default": obj
  2538. };
  2539. }
  2540. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2541. /***/ }),
  2542. /* 5 */
  2543. /*!**************************************************************!*\
  2544. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  2545. \**************************************************************/
  2546. /*! no static exports found */
  2547. /***/ (function(module, exports, __webpack_require__) {
  2548. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  2549. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  2550. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2551. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  2552. function _slicedToArray(arr, i) {
  2553. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  2554. }
  2555. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2556. /***/ }),
  2557. /* 6 */
  2558. /*!***************************************************************!*\
  2559. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  2560. \***************************************************************/
  2561. /*! no static exports found */
  2562. /***/ (function(module, exports) {
  2563. function _arrayWithHoles(arr) {
  2564. if (Array.isArray(arr)) return arr;
  2565. }
  2566. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2567. /***/ }),
  2568. /* 7 */
  2569. /*!*********************************************************************!*\
  2570. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  2571. \*********************************************************************/
  2572. /*! no static exports found */
  2573. /***/ (function(module, exports) {
  2574. function _iterableToArrayLimit(r, l) {
  2575. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  2576. if (null != t) {
  2577. var e,
  2578. n,
  2579. i,
  2580. u,
  2581. a = [],
  2582. f = !0,
  2583. o = !1;
  2584. try {
  2585. if (i = (t = t.call(r)).next, 0 === l) {
  2586. if (Object(t) !== t) return;
  2587. f = !1;
  2588. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
  2589. ;
  2590. }
  2591. } catch (r) {
  2592. o = !0, n = r;
  2593. } finally {
  2594. try {
  2595. if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
  2596. } finally {
  2597. if (o) throw n;
  2598. }
  2599. }
  2600. return a;
  2601. }
  2602. }
  2603. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2604. /***/ }),
  2605. /* 8 */
  2606. /*!***************************************************************************!*\
  2607. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  2608. \***************************************************************************/
  2609. /*! no static exports found */
  2610. /***/ (function(module, exports, __webpack_require__) {
  2611. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2612. function _unsupportedIterableToArray(o, minLen) {
  2613. if (!o) return;
  2614. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  2615. var n = Object.prototype.toString.call(o).slice(8, -1);
  2616. if (n === "Object" && o.constructor) n = o.constructor.name;
  2617. if (n === "Map" || n === "Set") return Array.from(o);
  2618. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  2619. }
  2620. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2621. /***/ }),
  2622. /* 9 */
  2623. /*!*****************************************************************!*\
  2624. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  2625. \*****************************************************************/
  2626. /*! no static exports found */
  2627. /***/ (function(module, exports) {
  2628. function _arrayLikeToArray(arr, len) {
  2629. if (len == null || len > arr.length) len = arr.length;
  2630. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2631. arr2[i] = arr[i];
  2632. }
  2633. return arr2;
  2634. }
  2635. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2636. /***/ }),
  2637. /* 10 */
  2638. /*!****************************************************************!*\
  2639. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  2640. \****************************************************************/
  2641. /*! no static exports found */
  2642. /***/ (function(module, exports) {
  2643. function _nonIterableRest() {
  2644. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2645. }
  2646. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2647. /***/ }),
  2648. /* 11 */
  2649. /*!***************************************************************!*\
  2650. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2651. \***************************************************************/
  2652. /*! no static exports found */
  2653. /***/ (function(module, exports, __webpack_require__) {
  2654. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  2655. function _defineProperty(obj, key, value) {
  2656. key = toPropertyKey(key);
  2657. if (key in obj) {
  2658. Object.defineProperty(obj, key, {
  2659. value: value,
  2660. enumerable: true,
  2661. configurable: true,
  2662. writable: true
  2663. });
  2664. } else {
  2665. obj[key] = value;
  2666. }
  2667. return obj;
  2668. }
  2669. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2670. /***/ }),
  2671. /* 12 */
  2672. /*!**************************************************************!*\
  2673. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2674. \**************************************************************/
  2675. /*! no static exports found */
  2676. /***/ (function(module, exports, __webpack_require__) {
  2677. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2678. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  2679. function toPropertyKey(t) {
  2680. var i = toPrimitive(t, "string");
  2681. return "symbol" == _typeof(i) ? i : i + "";
  2682. }
  2683. module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2684. /***/ }),
  2685. /* 13 */
  2686. /*!*******************************************************!*\
  2687. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2688. \*******************************************************/
  2689. /*! no static exports found */
  2690. /***/ (function(module, exports) {
  2691. function _typeof(o) {
  2692. "@babel/helpers - typeof";
  2693. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  2694. return typeof o;
  2695. } : function (o) {
  2696. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  2697. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
  2698. }
  2699. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2700. /***/ }),
  2701. /* 14 */
  2702. /*!************************************************************!*\
  2703. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2704. \************************************************************/
  2705. /*! no static exports found */
  2706. /***/ (function(module, exports, __webpack_require__) {
  2707. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2708. function toPrimitive(t, r) {
  2709. if ("object" != _typeof(t) || !t) return t;
  2710. var e = t[Symbol.toPrimitive];
  2711. if (void 0 !== e) {
  2712. var i = e.call(t, r || "default");
  2713. if ("object" != _typeof(i)) return i;
  2714. throw new TypeError("@@toPrimitive must return a primitive value.");
  2715. }
  2716. return ("string" === r ? String : Number)(t);
  2717. }
  2718. module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2719. /***/ }),
  2720. /* 15 */
  2721. /*!**********************************************************!*\
  2722. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2723. \**********************************************************/
  2724. /*! no static exports found */
  2725. /***/ (function(module, exports, __webpack_require__) {
  2726. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  2727. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  2728. function _construct(t, e, r) {
  2729. if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
  2730. var o = [null];
  2731. o.push.apply(o, e);
  2732. var p = new (t.bind.apply(t, o))();
  2733. return r && setPrototypeOf(p, r.prototype), p;
  2734. }
  2735. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2736. /***/ }),
  2737. /* 16 */
  2738. /*!***************************************************************!*\
  2739. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2740. \***************************************************************/
  2741. /*! no static exports found */
  2742. /***/ (function(module, exports) {
  2743. function _setPrototypeOf(o, p) {
  2744. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2745. o.__proto__ = p;
  2746. return o;
  2747. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2748. return _setPrototypeOf(o, p);
  2749. }
  2750. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2751. /***/ }),
  2752. /* 17 */
  2753. /*!*************************************************************************!*\
  2754. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2755. \*************************************************************************/
  2756. /*! no static exports found */
  2757. /***/ (function(module, exports) {
  2758. function _isNativeReflectConstruct() {
  2759. try {
  2760. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2761. } catch (t) {}
  2762. return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
  2763. return !!t;
  2764. }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
  2765. }
  2766. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2767. /***/ }),
  2768. /* 18 */
  2769. /*!******************************************************************!*\
  2770. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2771. \******************************************************************/
  2772. /*! no static exports found */
  2773. /***/ (function(module, exports, __webpack_require__) {
  2774. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2775. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2776. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2777. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2778. function _toConsumableArray(arr) {
  2779. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2780. }
  2781. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2782. /***/ }),
  2783. /* 19 */
  2784. /*!******************************************************************!*\
  2785. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2786. \******************************************************************/
  2787. /*! no static exports found */
  2788. /***/ (function(module, exports, __webpack_require__) {
  2789. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2790. function _arrayWithoutHoles(arr) {
  2791. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2792. }
  2793. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2794. /***/ }),
  2795. /* 20 */
  2796. /*!****************************************************************!*\
  2797. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2798. \****************************************************************/
  2799. /*! no static exports found */
  2800. /***/ (function(module, exports) {
  2801. function _iterableToArray(iter) {
  2802. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2803. }
  2804. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2805. /***/ }),
  2806. /* 21 */
  2807. /*!******************************************************************!*\
  2808. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2809. \******************************************************************/
  2810. /*! no static exports found */
  2811. /***/ (function(module, exports) {
  2812. function _nonIterableSpread() {
  2813. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2814. }
  2815. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2816. /***/ }),
  2817. /* 22 */
  2818. /*!*************************************************************!*\
  2819. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2820. \*************************************************************/
  2821. /*! no static exports found */
  2822. /***/ (function(module, exports, __webpack_require__) {
  2823. "use strict";
  2824. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2825. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2826. Object.defineProperty(exports, "__esModule", {
  2827. value: true
  2828. });
  2829. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2830. exports.compileI18nJsonStr = compileI18nJsonStr;
  2831. exports.hasI18nJson = hasI18nJson;
  2832. exports.initVueI18n = initVueI18n;
  2833. exports.isI18nStr = isI18nStr;
  2834. exports.isString = void 0;
  2835. exports.normalizeLocale = normalizeLocale;
  2836. exports.parseI18nJson = parseI18nJson;
  2837. exports.resolveLocale = resolveLocale;
  2838. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2839. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2840. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2841. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2842. var isObject = function isObject(val) {
  2843. return val !== null && (0, _typeof2.default)(val) === 'object';
  2844. };
  2845. var defaultDelimiters = ['{', '}'];
  2846. var BaseFormatter = /*#__PURE__*/function () {
  2847. function BaseFormatter() {
  2848. (0, _classCallCheck2.default)(this, BaseFormatter);
  2849. this._caches = Object.create(null);
  2850. }
  2851. (0, _createClass2.default)(BaseFormatter, [{
  2852. key: "interpolate",
  2853. value: function interpolate(message, values) {
  2854. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2855. if (!values) {
  2856. return [message];
  2857. }
  2858. var tokens = this._caches[message];
  2859. if (!tokens) {
  2860. tokens = parse(message, delimiters);
  2861. this._caches[message] = tokens;
  2862. }
  2863. return compile(tokens, values);
  2864. }
  2865. }]);
  2866. return BaseFormatter;
  2867. }();
  2868. exports.Formatter = BaseFormatter;
  2869. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2870. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2871. function parse(format, _ref) {
  2872. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2873. startDelimiter = _ref2[0],
  2874. endDelimiter = _ref2[1];
  2875. var tokens = [];
  2876. var position = 0;
  2877. var text = '';
  2878. while (position < format.length) {
  2879. var char = format[position++];
  2880. if (char === startDelimiter) {
  2881. if (text) {
  2882. tokens.push({
  2883. type: 'text',
  2884. value: text
  2885. });
  2886. }
  2887. text = '';
  2888. var sub = '';
  2889. char = format[position++];
  2890. while (char !== undefined && char !== endDelimiter) {
  2891. sub += char;
  2892. char = format[position++];
  2893. }
  2894. var isClosed = char === endDelimiter;
  2895. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2896. tokens.push({
  2897. value: sub,
  2898. type: type
  2899. });
  2900. }
  2901. // else if (char === '%') {
  2902. // // when found rails i18n syntax, skip text capture
  2903. // if (format[position] !== '{') {
  2904. // text += char
  2905. // }
  2906. // }
  2907. else {
  2908. text += char;
  2909. }
  2910. }
  2911. text && tokens.push({
  2912. type: 'text',
  2913. value: text
  2914. });
  2915. return tokens;
  2916. }
  2917. function compile(tokens, values) {
  2918. var compiled = [];
  2919. var index = 0;
  2920. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2921. if (mode === 'unknown') {
  2922. return compiled;
  2923. }
  2924. while (index < tokens.length) {
  2925. var token = tokens[index];
  2926. switch (token.type) {
  2927. case 'text':
  2928. compiled.push(token.value);
  2929. break;
  2930. case 'list':
  2931. compiled.push(values[parseInt(token.value, 10)]);
  2932. break;
  2933. case 'named':
  2934. if (mode === 'named') {
  2935. compiled.push(values[token.value]);
  2936. } else {
  2937. if (true) {
  2938. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2939. }
  2940. }
  2941. break;
  2942. case 'unknown':
  2943. if (true) {
  2944. console.warn("Detect 'unknown' type of token!");
  2945. }
  2946. break;
  2947. }
  2948. index++;
  2949. }
  2950. return compiled;
  2951. }
  2952. var LOCALE_ZH_HANS = 'zh-Hans';
  2953. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2954. var LOCALE_ZH_HANT = 'zh-Hant';
  2955. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2956. var LOCALE_EN = 'en';
  2957. exports.LOCALE_EN = LOCALE_EN;
  2958. var LOCALE_FR = 'fr';
  2959. exports.LOCALE_FR = LOCALE_FR;
  2960. var LOCALE_ES = 'es';
  2961. exports.LOCALE_ES = LOCALE_ES;
  2962. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2963. var hasOwn = function hasOwn(val, key) {
  2964. return hasOwnProperty.call(val, key);
  2965. };
  2966. var defaultFormatter = new BaseFormatter();
  2967. function include(str, parts) {
  2968. return !!parts.find(function (part) {
  2969. return str.indexOf(part) !== -1;
  2970. });
  2971. }
  2972. function startsWith(str, parts) {
  2973. return parts.find(function (part) {
  2974. return str.indexOf(part) === 0;
  2975. });
  2976. }
  2977. function normalizeLocale(locale, messages) {
  2978. if (!locale) {
  2979. return;
  2980. }
  2981. locale = locale.trim().replace(/_/g, '-');
  2982. if (messages && messages[locale]) {
  2983. return locale;
  2984. }
  2985. locale = locale.toLowerCase();
  2986. if (locale === 'chinese') {
  2987. // 支付宝
  2988. return LOCALE_ZH_HANS;
  2989. }
  2990. if (locale.indexOf('zh') === 0) {
  2991. if (locale.indexOf('-hans') > -1) {
  2992. return LOCALE_ZH_HANS;
  2993. }
  2994. if (locale.indexOf('-hant') > -1) {
  2995. return LOCALE_ZH_HANT;
  2996. }
  2997. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2998. return LOCALE_ZH_HANT;
  2999. }
  3000. return LOCALE_ZH_HANS;
  3001. }
  3002. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  3003. if (messages && Object.keys(messages).length > 0) {
  3004. locales = Object.keys(messages);
  3005. }
  3006. var lang = startsWith(locale, locales);
  3007. if (lang) {
  3008. return lang;
  3009. }
  3010. }
  3011. var I18n = /*#__PURE__*/function () {
  3012. function I18n(_ref3) {
  3013. var locale = _ref3.locale,
  3014. fallbackLocale = _ref3.fallbackLocale,
  3015. messages = _ref3.messages,
  3016. watcher = _ref3.watcher,
  3017. formater = _ref3.formater;
  3018. (0, _classCallCheck2.default)(this, I18n);
  3019. this.locale = LOCALE_EN;
  3020. this.fallbackLocale = LOCALE_EN;
  3021. this.message = {};
  3022. this.messages = {};
  3023. this.watchers = [];
  3024. if (fallbackLocale) {
  3025. this.fallbackLocale = fallbackLocale;
  3026. }
  3027. this.formater = formater || defaultFormatter;
  3028. this.messages = messages || {};
  3029. this.setLocale(locale || LOCALE_EN);
  3030. if (watcher) {
  3031. this.watchLocale(watcher);
  3032. }
  3033. }
  3034. (0, _createClass2.default)(I18n, [{
  3035. key: "setLocale",
  3036. value: function setLocale(locale) {
  3037. var _this = this;
  3038. var oldLocale = this.locale;
  3039. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3040. if (!this.messages[this.locale]) {
  3041. // 可能初始化时不存在
  3042. this.messages[this.locale] = {};
  3043. }
  3044. this.message = this.messages[this.locale];
  3045. // 仅发生变化时,通知
  3046. if (oldLocale !== this.locale) {
  3047. this.watchers.forEach(function (watcher) {
  3048. watcher(_this.locale, oldLocale);
  3049. });
  3050. }
  3051. }
  3052. }, {
  3053. key: "getLocale",
  3054. value: function getLocale() {
  3055. return this.locale;
  3056. }
  3057. }, {
  3058. key: "watchLocale",
  3059. value: function watchLocale(fn) {
  3060. var _this2 = this;
  3061. var index = this.watchers.push(fn) - 1;
  3062. return function () {
  3063. _this2.watchers.splice(index, 1);
  3064. };
  3065. }
  3066. }, {
  3067. key: "add",
  3068. value: function add(locale, message) {
  3069. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3070. var curMessages = this.messages[locale];
  3071. if (curMessages) {
  3072. if (override) {
  3073. Object.assign(curMessages, message);
  3074. } else {
  3075. Object.keys(message).forEach(function (key) {
  3076. if (!hasOwn(curMessages, key)) {
  3077. curMessages[key] = message[key];
  3078. }
  3079. });
  3080. }
  3081. } else {
  3082. this.messages[locale] = message;
  3083. }
  3084. }
  3085. }, {
  3086. key: "f",
  3087. value: function f(message, values, delimiters) {
  3088. return this.formater.interpolate(message, values, delimiters).join('');
  3089. }
  3090. }, {
  3091. key: "t",
  3092. value: function t(key, locale, values) {
  3093. var message = this.message;
  3094. if (typeof locale === 'string') {
  3095. locale = normalizeLocale(locale, this.messages);
  3096. locale && (message = this.messages[locale]);
  3097. } else {
  3098. values = locale;
  3099. }
  3100. if (!hasOwn(message, key)) {
  3101. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3102. return key;
  3103. }
  3104. return this.formater.interpolate(message[key], values).join('');
  3105. }
  3106. }]);
  3107. return I18n;
  3108. }();
  3109. exports.I18n = I18n;
  3110. function watchAppLocale(appVm, i18n) {
  3111. // 需要保证 watch 的触发在组件渲染之前
  3112. if (appVm.$watchLocale) {
  3113. // vue2
  3114. appVm.$watchLocale(function (newLocale) {
  3115. i18n.setLocale(newLocale);
  3116. });
  3117. } else {
  3118. appVm.$watch(function () {
  3119. return appVm.$locale;
  3120. }, function (newLocale) {
  3121. i18n.setLocale(newLocale);
  3122. });
  3123. }
  3124. }
  3125. function getDefaultLocale() {
  3126. if (typeof uni !== 'undefined' && uni.getLocale) {
  3127. return uni.getLocale();
  3128. }
  3129. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3130. if (typeof global !== 'undefined' && global.getLocale) {
  3131. return global.getLocale();
  3132. }
  3133. return LOCALE_EN;
  3134. }
  3135. function initVueI18n(locale) {
  3136. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3137. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3138. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3139. // 兼容旧版本入参
  3140. if (typeof locale !== 'string') {
  3141. var _ref4 = [messages, locale];
  3142. locale = _ref4[0];
  3143. messages = _ref4[1];
  3144. }
  3145. if (typeof locale !== 'string') {
  3146. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3147. locale = getDefaultLocale();
  3148. }
  3149. if (typeof fallbackLocale !== 'string') {
  3150. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3151. }
  3152. var i18n = new I18n({
  3153. locale: locale,
  3154. fallbackLocale: fallbackLocale,
  3155. messages: messages,
  3156. watcher: watcher
  3157. });
  3158. var _t = function t(key, values) {
  3159. if (typeof getApp !== 'function') {
  3160. // app view
  3161. /* eslint-disable no-func-assign */
  3162. _t = function t(key, values) {
  3163. return i18n.t(key, values);
  3164. };
  3165. } else {
  3166. var isWatchedAppLocale = false;
  3167. _t = function t(key, values) {
  3168. var appVm = getApp().$vm;
  3169. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3170. // options: {
  3171. // type: Array,
  3172. // default () {
  3173. // return [{
  3174. // icon: 'shop',
  3175. // text: t("uni-goods-nav.options.shop"),
  3176. // }, {
  3177. // icon: 'cart',
  3178. // text: t("uni-goods-nav.options.cart")
  3179. // }]
  3180. // }
  3181. // },
  3182. if (appVm) {
  3183. // 触发响应式
  3184. appVm.$locale;
  3185. if (!isWatchedAppLocale) {
  3186. isWatchedAppLocale = true;
  3187. watchAppLocale(appVm, i18n);
  3188. }
  3189. }
  3190. return i18n.t(key, values);
  3191. };
  3192. }
  3193. return _t(key, values);
  3194. };
  3195. return {
  3196. i18n: i18n,
  3197. f: function f(message, values, delimiters) {
  3198. return i18n.f(message, values, delimiters);
  3199. },
  3200. t: function t(key, values) {
  3201. return _t(key, values);
  3202. },
  3203. add: function add(locale, message) {
  3204. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3205. return i18n.add(locale, message, override);
  3206. },
  3207. watch: function watch(fn) {
  3208. return i18n.watchLocale(fn);
  3209. },
  3210. getLocale: function getLocale() {
  3211. return i18n.getLocale();
  3212. },
  3213. setLocale: function setLocale(newLocale) {
  3214. return i18n.setLocale(newLocale);
  3215. }
  3216. };
  3217. }
  3218. var isString = function isString(val) {
  3219. return typeof val === 'string';
  3220. };
  3221. exports.isString = isString;
  3222. var formater;
  3223. function hasI18nJson(jsonObj, delimiters) {
  3224. if (!formater) {
  3225. formater = new BaseFormatter();
  3226. }
  3227. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3228. var value = jsonObj[key];
  3229. if (isString(value)) {
  3230. if (isI18nStr(value, delimiters)) {
  3231. return true;
  3232. }
  3233. } else {
  3234. return hasI18nJson(value, delimiters);
  3235. }
  3236. });
  3237. }
  3238. function parseI18nJson(jsonObj, values, delimiters) {
  3239. if (!formater) {
  3240. formater = new BaseFormatter();
  3241. }
  3242. walkJsonObj(jsonObj, function (jsonObj, key) {
  3243. var value = jsonObj[key];
  3244. if (isString(value)) {
  3245. if (isI18nStr(value, delimiters)) {
  3246. jsonObj[key] = compileStr(value, values, delimiters);
  3247. }
  3248. } else {
  3249. parseI18nJson(value, values, delimiters);
  3250. }
  3251. });
  3252. return jsonObj;
  3253. }
  3254. function compileI18nJsonStr(jsonStr, _ref5) {
  3255. var locale = _ref5.locale,
  3256. locales = _ref5.locales,
  3257. delimiters = _ref5.delimiters;
  3258. if (!isI18nStr(jsonStr, delimiters)) {
  3259. return jsonStr;
  3260. }
  3261. if (!formater) {
  3262. formater = new BaseFormatter();
  3263. }
  3264. var localeValues = [];
  3265. Object.keys(locales).forEach(function (name) {
  3266. if (name !== locale) {
  3267. localeValues.push({
  3268. locale: name,
  3269. values: locales[name]
  3270. });
  3271. }
  3272. });
  3273. localeValues.unshift({
  3274. locale: locale,
  3275. values: locales[locale]
  3276. });
  3277. try {
  3278. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3279. } catch (e) {}
  3280. return jsonStr;
  3281. }
  3282. function isI18nStr(value, delimiters) {
  3283. return value.indexOf(delimiters[0]) > -1;
  3284. }
  3285. function compileStr(value, values, delimiters) {
  3286. return formater.interpolate(value, values, delimiters).join('');
  3287. }
  3288. function compileValue(jsonObj, key, localeValues, delimiters) {
  3289. var value = jsonObj[key];
  3290. if (isString(value)) {
  3291. // 存在国际化
  3292. if (isI18nStr(value, delimiters)) {
  3293. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3294. if (localeValues.length > 1) {
  3295. // 格式化国际化语言
  3296. var valueLocales = jsonObj[key + 'Locales'] = {};
  3297. localeValues.forEach(function (localValue) {
  3298. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3299. });
  3300. }
  3301. }
  3302. } else {
  3303. compileJsonObj(value, localeValues, delimiters);
  3304. }
  3305. }
  3306. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3307. walkJsonObj(jsonObj, function (jsonObj, key) {
  3308. compileValue(jsonObj, key, localeValues, delimiters);
  3309. });
  3310. return jsonObj;
  3311. }
  3312. function walkJsonObj(jsonObj, walk) {
  3313. if (Array.isArray(jsonObj)) {
  3314. for (var i = 0; i < jsonObj.length; i++) {
  3315. if (walk(jsonObj, i)) {
  3316. return true;
  3317. }
  3318. }
  3319. } else if (isObject(jsonObj)) {
  3320. for (var key in jsonObj) {
  3321. if (walk(jsonObj, key)) {
  3322. return true;
  3323. }
  3324. }
  3325. }
  3326. return false;
  3327. }
  3328. function resolveLocale(locales) {
  3329. return function (locale) {
  3330. if (!locale) {
  3331. return locale;
  3332. }
  3333. locale = normalizeLocale(locale) || locale;
  3334. return resolveLocaleChain(locale).find(function (locale) {
  3335. return locales.indexOf(locale) > -1;
  3336. });
  3337. };
  3338. }
  3339. function resolveLocaleChain(locale) {
  3340. var chain = [];
  3341. var tokens = locale.split('-');
  3342. while (tokens.length) {
  3343. chain.push(tokens.join('-'));
  3344. tokens.pop();
  3345. }
  3346. return chain;
  3347. }
  3348. /* 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)))
  3349. /***/ }),
  3350. /* 23 */
  3351. /*!***************************************************************!*\
  3352. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3353. \***************************************************************/
  3354. /*! no static exports found */
  3355. /***/ (function(module, exports) {
  3356. function _classCallCheck(instance, Constructor) {
  3357. if (!(instance instanceof Constructor)) {
  3358. throw new TypeError("Cannot call a class as a function");
  3359. }
  3360. }
  3361. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3362. /***/ }),
  3363. /* 24 */
  3364. /*!************************************************************!*\
  3365. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3366. \************************************************************/
  3367. /*! no static exports found */
  3368. /***/ (function(module, exports, __webpack_require__) {
  3369. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3370. function _defineProperties(target, props) {
  3371. for (var i = 0; i < props.length; i++) {
  3372. var descriptor = props[i];
  3373. descriptor.enumerable = descriptor.enumerable || false;
  3374. descriptor.configurable = true;
  3375. if ("value" in descriptor) descriptor.writable = true;
  3376. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3377. }
  3378. }
  3379. function _createClass(Constructor, protoProps, staticProps) {
  3380. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3381. if (staticProps) _defineProperties(Constructor, staticProps);
  3382. Object.defineProperty(Constructor, "prototype", {
  3383. writable: false
  3384. });
  3385. return Constructor;
  3386. }
  3387. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3388. /***/ }),
  3389. /* 25 */
  3390. /*!******************************************************************************************!*\
  3391. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3392. \******************************************************************************************/
  3393. /*! exports provided: default */
  3394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3395. "use strict";
  3396. __webpack_require__.r(__webpack_exports__);
  3397. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3398. * Vue.js v2.6.11
  3399. * (c) 2014-2024 Evan You
  3400. * Released under the MIT License.
  3401. */
  3402. /* */
  3403. var emptyObject = Object.freeze({});
  3404. // These helpers produce better VM code in JS engines due to their
  3405. // explicitness and function inlining.
  3406. function isUndef (v) {
  3407. return v === undefined || v === null
  3408. }
  3409. function isDef (v) {
  3410. return v !== undefined && v !== null
  3411. }
  3412. function isTrue (v) {
  3413. return v === true
  3414. }
  3415. function isFalse (v) {
  3416. return v === false
  3417. }
  3418. /**
  3419. * Check if value is primitive.
  3420. */
  3421. function isPrimitive (value) {
  3422. return (
  3423. typeof value === 'string' ||
  3424. typeof value === 'number' ||
  3425. // $flow-disable-line
  3426. typeof value === 'symbol' ||
  3427. typeof value === 'boolean'
  3428. )
  3429. }
  3430. /**
  3431. * Quick object check - this is primarily used to tell
  3432. * Objects from primitive values when we know the value
  3433. * is a JSON-compliant type.
  3434. */
  3435. function isObject (obj) {
  3436. return obj !== null && typeof obj === 'object'
  3437. }
  3438. /**
  3439. * Get the raw type string of a value, e.g., [object Object].
  3440. */
  3441. var _toString = Object.prototype.toString;
  3442. function toRawType (value) {
  3443. return _toString.call(value).slice(8, -1)
  3444. }
  3445. /**
  3446. * Strict object type check. Only returns true
  3447. * for plain JavaScript objects.
  3448. */
  3449. function isPlainObject (obj) {
  3450. return _toString.call(obj) === '[object Object]'
  3451. }
  3452. function isRegExp (v) {
  3453. return _toString.call(v) === '[object RegExp]'
  3454. }
  3455. /**
  3456. * Check if val is a valid array index.
  3457. */
  3458. function isValidArrayIndex (val) {
  3459. var n = parseFloat(String(val));
  3460. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3461. }
  3462. function isPromise (val) {
  3463. return (
  3464. isDef(val) &&
  3465. typeof val.then === 'function' &&
  3466. typeof val.catch === 'function'
  3467. )
  3468. }
  3469. /**
  3470. * Convert a value to a string that is actually rendered.
  3471. */
  3472. function toString (val) {
  3473. return val == null
  3474. ? ''
  3475. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3476. ? JSON.stringify(val, null, 2)
  3477. : String(val)
  3478. }
  3479. /**
  3480. * Convert an input value to a number for persistence.
  3481. * If the conversion fails, return original string.
  3482. */
  3483. function toNumber (val) {
  3484. var n = parseFloat(val);
  3485. return isNaN(n) ? val : n
  3486. }
  3487. /**
  3488. * Make a map and return a function for checking if a key
  3489. * is in that map.
  3490. */
  3491. function makeMap (
  3492. str,
  3493. expectsLowerCase
  3494. ) {
  3495. var map = Object.create(null);
  3496. var list = str.split(',');
  3497. for (var i = 0; i < list.length; i++) {
  3498. map[list[i]] = true;
  3499. }
  3500. return expectsLowerCase
  3501. ? function (val) { return map[val.toLowerCase()]; }
  3502. : function (val) { return map[val]; }
  3503. }
  3504. /**
  3505. * Check if a tag is a built-in tag.
  3506. */
  3507. var isBuiltInTag = makeMap('slot,component', true);
  3508. /**
  3509. * Check if an attribute is a reserved attribute.
  3510. */
  3511. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3512. /**
  3513. * Remove an item from an array.
  3514. */
  3515. function remove (arr, item) {
  3516. if (arr.length) {
  3517. var index = arr.indexOf(item);
  3518. if (index > -1) {
  3519. return arr.splice(index, 1)
  3520. }
  3521. }
  3522. }
  3523. /**
  3524. * Check whether an object has the property.
  3525. */
  3526. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3527. function hasOwn (obj, key) {
  3528. return hasOwnProperty.call(obj, key)
  3529. }
  3530. /**
  3531. * Create a cached version of a pure function.
  3532. */
  3533. function cached (fn) {
  3534. var cache = Object.create(null);
  3535. return (function cachedFn (str) {
  3536. var hit = cache[str];
  3537. return hit || (cache[str] = fn(str))
  3538. })
  3539. }
  3540. /**
  3541. * Camelize a hyphen-delimited string.
  3542. */
  3543. var camelizeRE = /-(\w)/g;
  3544. var camelize = cached(function (str) {
  3545. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3546. });
  3547. /**
  3548. * Capitalize a string.
  3549. */
  3550. var capitalize = cached(function (str) {
  3551. return str.charAt(0).toUpperCase() + str.slice(1)
  3552. });
  3553. /**
  3554. * Hyphenate a camelCase string.
  3555. */
  3556. var hyphenateRE = /\B([A-Z])/g;
  3557. var hyphenate = cached(function (str) {
  3558. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3559. });
  3560. /**
  3561. * Simple bind polyfill for environments that do not support it,
  3562. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3563. * since native bind is now performant enough in most browsers.
  3564. * But removing it would mean breaking code that was able to run in
  3565. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3566. */
  3567. /* istanbul ignore next */
  3568. function polyfillBind (fn, ctx) {
  3569. function boundFn (a) {
  3570. var l = arguments.length;
  3571. return l
  3572. ? l > 1
  3573. ? fn.apply(ctx, arguments)
  3574. : fn.call(ctx, a)
  3575. : fn.call(ctx)
  3576. }
  3577. boundFn._length = fn.length;
  3578. return boundFn
  3579. }
  3580. function nativeBind (fn, ctx) {
  3581. return fn.bind(ctx)
  3582. }
  3583. var bind = Function.prototype.bind
  3584. ? nativeBind
  3585. : polyfillBind;
  3586. /**
  3587. * Convert an Array-like object to a real Array.
  3588. */
  3589. function toArray (list, start) {
  3590. start = start || 0;
  3591. var i = list.length - start;
  3592. var ret = new Array(i);
  3593. while (i--) {
  3594. ret[i] = list[i + start];
  3595. }
  3596. return ret
  3597. }
  3598. /**
  3599. * Mix properties into target object.
  3600. */
  3601. function extend (to, _from) {
  3602. for (var key in _from) {
  3603. to[key] = _from[key];
  3604. }
  3605. return to
  3606. }
  3607. /**
  3608. * Merge an Array of Objects into a single Object.
  3609. */
  3610. function toObject (arr) {
  3611. var res = {};
  3612. for (var i = 0; i < arr.length; i++) {
  3613. if (arr[i]) {
  3614. extend(res, arr[i]);
  3615. }
  3616. }
  3617. return res
  3618. }
  3619. /* eslint-disable no-unused-vars */
  3620. /**
  3621. * Perform no operation.
  3622. * Stubbing args to make Flow happy without leaving useless transpiled code
  3623. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3624. */
  3625. function noop (a, b, c) {}
  3626. /**
  3627. * Always return false.
  3628. */
  3629. var no = function (a, b, c) { return false; };
  3630. /* eslint-enable no-unused-vars */
  3631. /**
  3632. * Return the same value.
  3633. */
  3634. var identity = function (_) { return _; };
  3635. /**
  3636. * Check if two values are loosely equal - that is,
  3637. * if they are plain objects, do they have the same shape?
  3638. */
  3639. function looseEqual (a, b) {
  3640. if (a === b) { return true }
  3641. var isObjectA = isObject(a);
  3642. var isObjectB = isObject(b);
  3643. if (isObjectA && isObjectB) {
  3644. try {
  3645. var isArrayA = Array.isArray(a);
  3646. var isArrayB = Array.isArray(b);
  3647. if (isArrayA && isArrayB) {
  3648. return a.length === b.length && a.every(function (e, i) {
  3649. return looseEqual(e, b[i])
  3650. })
  3651. } else if (a instanceof Date && b instanceof Date) {
  3652. return a.getTime() === b.getTime()
  3653. } else if (!isArrayA && !isArrayB) {
  3654. var keysA = Object.keys(a);
  3655. var keysB = Object.keys(b);
  3656. return keysA.length === keysB.length && keysA.every(function (key) {
  3657. return looseEqual(a[key], b[key])
  3658. })
  3659. } else {
  3660. /* istanbul ignore next */
  3661. return false
  3662. }
  3663. } catch (e) {
  3664. /* istanbul ignore next */
  3665. return false
  3666. }
  3667. } else if (!isObjectA && !isObjectB) {
  3668. return String(a) === String(b)
  3669. } else {
  3670. return false
  3671. }
  3672. }
  3673. /**
  3674. * Return the first index at which a loosely equal value can be
  3675. * found in the array (if value is a plain object, the array must
  3676. * contain an object of the same shape), or -1 if it is not present.
  3677. */
  3678. function looseIndexOf (arr, val) {
  3679. for (var i = 0; i < arr.length; i++) {
  3680. if (looseEqual(arr[i], val)) { return i }
  3681. }
  3682. return -1
  3683. }
  3684. /**
  3685. * Ensure a function is called only once.
  3686. */
  3687. function once (fn) {
  3688. var called = false;
  3689. return function () {
  3690. if (!called) {
  3691. called = true;
  3692. fn.apply(this, arguments);
  3693. }
  3694. }
  3695. }
  3696. var ASSET_TYPES = [
  3697. 'component',
  3698. 'directive',
  3699. 'filter'
  3700. ];
  3701. var LIFECYCLE_HOOKS = [
  3702. 'beforeCreate',
  3703. 'created',
  3704. 'beforeMount',
  3705. 'mounted',
  3706. 'beforeUpdate',
  3707. 'updated',
  3708. 'beforeDestroy',
  3709. 'destroyed',
  3710. 'activated',
  3711. 'deactivated',
  3712. 'errorCaptured',
  3713. 'serverPrefetch'
  3714. ];
  3715. /* */
  3716. var config = ({
  3717. /**
  3718. * Option merge strategies (used in core/util/options)
  3719. */
  3720. // $flow-disable-line
  3721. optionMergeStrategies: Object.create(null),
  3722. /**
  3723. * Whether to suppress warnings.
  3724. */
  3725. silent: false,
  3726. /**
  3727. * Show production mode tip message on boot?
  3728. */
  3729. productionTip: "development" !== 'production',
  3730. /**
  3731. * Whether to enable devtools
  3732. */
  3733. devtools: "development" !== 'production',
  3734. /**
  3735. * Whether to record perf
  3736. */
  3737. performance: false,
  3738. /**
  3739. * Error handler for watcher errors
  3740. */
  3741. errorHandler: null,
  3742. /**
  3743. * Warn handler for watcher warns
  3744. */
  3745. warnHandler: null,
  3746. /**
  3747. * Ignore certain custom elements
  3748. */
  3749. ignoredElements: [],
  3750. /**
  3751. * Custom user key aliases for v-on
  3752. */
  3753. // $flow-disable-line
  3754. keyCodes: Object.create(null),
  3755. /**
  3756. * Check if a tag is reserved so that it cannot be registered as a
  3757. * component. This is platform-dependent and may be overwritten.
  3758. */
  3759. isReservedTag: no,
  3760. /**
  3761. * Check if an attribute is reserved so that it cannot be used as a component
  3762. * prop. This is platform-dependent and may be overwritten.
  3763. */
  3764. isReservedAttr: no,
  3765. /**
  3766. * Check if a tag is an unknown element.
  3767. * Platform-dependent.
  3768. */
  3769. isUnknownElement: no,
  3770. /**
  3771. * Get the namespace of an element
  3772. */
  3773. getTagNamespace: noop,
  3774. /**
  3775. * Parse the real tag name for the specific platform.
  3776. */
  3777. parsePlatformTagName: identity,
  3778. /**
  3779. * Check if an attribute must be bound using property, e.g. value
  3780. * Platform-dependent.
  3781. */
  3782. mustUseProp: no,
  3783. /**
  3784. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3785. * This will significantly reduce performance if set to false.
  3786. */
  3787. async: true,
  3788. /**
  3789. * Exposed for legacy reasons
  3790. */
  3791. _lifecycleHooks: LIFECYCLE_HOOKS
  3792. });
  3793. /* */
  3794. /**
  3795. * unicode letters used for parsing html tags, component names and property paths.
  3796. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3797. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3798. */
  3799. 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/;
  3800. /**
  3801. * Check if a string starts with $ or _
  3802. */
  3803. function isReserved (str) {
  3804. var c = (str + '').charCodeAt(0);
  3805. return c === 0x24 || c === 0x5F
  3806. }
  3807. /**
  3808. * Define a property.
  3809. */
  3810. function def (obj, key, val, enumerable) {
  3811. Object.defineProperty(obj, key, {
  3812. value: val,
  3813. enumerable: !!enumerable,
  3814. writable: true,
  3815. configurable: true
  3816. });
  3817. }
  3818. /**
  3819. * Parse simple path.
  3820. */
  3821. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3822. function parsePath (path) {
  3823. if (bailRE.test(path)) {
  3824. return
  3825. }
  3826. var segments = path.split('.');
  3827. return function (obj) {
  3828. for (var i = 0; i < segments.length; i++) {
  3829. if (!obj) { return }
  3830. obj = obj[segments[i]];
  3831. }
  3832. return obj
  3833. }
  3834. }
  3835. /* */
  3836. // can we use __proto__?
  3837. var hasProto = '__proto__' in {};
  3838. // Browser environment sniffing
  3839. var inBrowser = typeof window !== 'undefined';
  3840. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3841. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3842. var UA = inBrowser && window.navigator && window.navigator.userAgent.toLowerCase();
  3843. var isIE = UA && /msie|trident/.test(UA);
  3844. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3845. var isEdge = UA && UA.indexOf('edge/') > 0;
  3846. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3847. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3848. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3849. var isPhantomJS = UA && /phantomjs/.test(UA);
  3850. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3851. // Firefox has a "watch" function on Object.prototype...
  3852. var nativeWatch = ({}).watch;
  3853. if (inBrowser) {
  3854. try {
  3855. var opts = {};
  3856. Object.defineProperty(opts, 'passive', ({
  3857. get: function get () {
  3858. }
  3859. })); // https://github.com/facebook/flow/issues/285
  3860. window.addEventListener('test-passive', null, opts);
  3861. } catch (e) {}
  3862. }
  3863. // this needs to be lazy-evaled because vue may be required before
  3864. // vue-server-renderer can set VUE_ENV
  3865. var _isServer;
  3866. var isServerRendering = function () {
  3867. if (_isServer === undefined) {
  3868. /* istanbul ignore if */
  3869. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3870. // detect presence of vue-server-renderer and avoid
  3871. // Webpack shimming the process
  3872. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3873. } else {
  3874. _isServer = false;
  3875. }
  3876. }
  3877. return _isServer
  3878. };
  3879. // detect devtools
  3880. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3881. /* istanbul ignore next */
  3882. function isNative (Ctor) {
  3883. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3884. }
  3885. var hasSymbol =
  3886. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3887. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3888. var _Set;
  3889. /* istanbul ignore if */ // $flow-disable-line
  3890. if (typeof Set !== 'undefined' && isNative(Set)) {
  3891. // use native Set when available.
  3892. _Set = Set;
  3893. } else {
  3894. // a non-standard Set polyfill that only works with primitive keys.
  3895. _Set = /*@__PURE__*/(function () {
  3896. function Set () {
  3897. this.set = Object.create(null);
  3898. }
  3899. Set.prototype.has = function has (key) {
  3900. return this.set[key] === true
  3901. };
  3902. Set.prototype.add = function add (key) {
  3903. this.set[key] = true;
  3904. };
  3905. Set.prototype.clear = function clear () {
  3906. this.set = Object.create(null);
  3907. };
  3908. return Set;
  3909. }());
  3910. }
  3911. /* */
  3912. var warn = noop;
  3913. var tip = noop;
  3914. var generateComponentTrace = (noop); // work around flow check
  3915. var formatComponentName = (noop);
  3916. if (true) {
  3917. var hasConsole = typeof console !== 'undefined';
  3918. var classifyRE = /(?:^|[-_])(\w)/g;
  3919. var classify = function (str) { return str
  3920. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3921. .replace(/[-_]/g, ''); };
  3922. warn = function (msg, vm) {
  3923. var trace = vm ? generateComponentTrace(vm) : '';
  3924. if (config.warnHandler) {
  3925. config.warnHandler.call(null, msg, vm, trace);
  3926. } else if (hasConsole && (!config.silent)) {
  3927. console.error(("[Vue warn]: " + msg + trace));
  3928. }
  3929. };
  3930. tip = function (msg, vm) {
  3931. if (hasConsole && (!config.silent)) {
  3932. console.warn("[Vue tip]: " + msg + (
  3933. vm ? generateComponentTrace(vm) : ''
  3934. ));
  3935. }
  3936. };
  3937. formatComponentName = function (vm, includeFile) {
  3938. if (vm.$root === vm) {
  3939. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3940. return ('') + vm.$options.__file
  3941. }
  3942. return '<Root>'
  3943. }
  3944. var options = typeof vm === 'function' && vm.cid != null
  3945. ? vm.options
  3946. : vm._isVue
  3947. ? vm.$options || vm.constructor.options
  3948. : vm;
  3949. var name = options.name || options._componentTag;
  3950. var file = options.__file;
  3951. if (!name && file) {
  3952. var match = file.match(/([^/\\]+)\.vue$/);
  3953. name = match && match[1];
  3954. }
  3955. return (
  3956. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3957. (file && includeFile !== false ? (" at " + file) : '')
  3958. )
  3959. };
  3960. var repeat = function (str, n) {
  3961. var res = '';
  3962. while (n) {
  3963. if (n % 2 === 1) { res += str; }
  3964. if (n > 1) { str += str; }
  3965. n >>= 1;
  3966. }
  3967. return res
  3968. };
  3969. generateComponentTrace = function (vm) {
  3970. if (vm._isVue && vm.$parent) {
  3971. var tree = [];
  3972. var currentRecursiveSequence = 0;
  3973. while (vm && vm.$options.name !== 'PageBody') {
  3974. if (tree.length > 0) {
  3975. var last = tree[tree.length - 1];
  3976. if (last.constructor === vm.constructor) {
  3977. currentRecursiveSequence++;
  3978. vm = vm.$parent;
  3979. continue
  3980. } else if (currentRecursiveSequence > 0) {
  3981. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3982. currentRecursiveSequence = 0;
  3983. }
  3984. }
  3985. !vm.$options.isReserved && tree.push(vm);
  3986. vm = vm.$parent;
  3987. }
  3988. return '\n\nfound in\n\n' + tree
  3989. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3990. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3991. : formatComponentName(vm))); })
  3992. .join('\n')
  3993. } else {
  3994. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3995. }
  3996. };
  3997. }
  3998. /* */
  3999. var uid = 0;
  4000. /**
  4001. * A dep is an observable that can have multiple
  4002. * directives subscribing to it.
  4003. */
  4004. var Dep = function Dep () {
  4005. this.id = uid++;
  4006. this.subs = [];
  4007. };
  4008. Dep.prototype.addSub = function addSub (sub) {
  4009. this.subs.push(sub);
  4010. };
  4011. Dep.prototype.removeSub = function removeSub (sub) {
  4012. remove(this.subs, sub);
  4013. };
  4014. Dep.prototype.depend = function depend () {
  4015. if (Dep.SharedObject.target) {
  4016. Dep.SharedObject.target.addDep(this);
  4017. }
  4018. };
  4019. Dep.prototype.notify = function notify () {
  4020. // stabilize the subscriber list first
  4021. var subs = this.subs.slice();
  4022. if ( true && !config.async) {
  4023. // subs aren't sorted in scheduler if not running async
  4024. // we need to sort them now to make sure they fire in correct
  4025. // order
  4026. subs.sort(function (a, b) { return a.id - b.id; });
  4027. }
  4028. for (var i = 0, l = subs.length; i < l; i++) {
  4029. subs[i].update();
  4030. }
  4031. };
  4032. // The current target watcher being evaluated.
  4033. // This is globally unique because only one watcher
  4034. // can be evaluated at a time.
  4035. // fixed by xxxxxx (nvue shared vuex)
  4036. /* eslint-disable no-undef */
  4037. Dep.SharedObject = {};
  4038. Dep.SharedObject.target = null;
  4039. Dep.SharedObject.targetStack = [];
  4040. function pushTarget (target) {
  4041. Dep.SharedObject.targetStack.push(target);
  4042. Dep.SharedObject.target = target;
  4043. Dep.target = target;
  4044. }
  4045. function popTarget () {
  4046. Dep.SharedObject.targetStack.pop();
  4047. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4048. Dep.target = Dep.SharedObject.target;
  4049. }
  4050. /* */
  4051. var VNode = function VNode (
  4052. tag,
  4053. data,
  4054. children,
  4055. text,
  4056. elm,
  4057. context,
  4058. componentOptions,
  4059. asyncFactory
  4060. ) {
  4061. this.tag = tag;
  4062. this.data = data;
  4063. this.children = children;
  4064. this.text = text;
  4065. this.elm = elm;
  4066. this.ns = undefined;
  4067. this.context = context;
  4068. this.fnContext = undefined;
  4069. this.fnOptions = undefined;
  4070. this.fnScopeId = undefined;
  4071. this.key = data && data.key;
  4072. this.componentOptions = componentOptions;
  4073. this.componentInstance = undefined;
  4074. this.parent = undefined;
  4075. this.raw = false;
  4076. this.isStatic = false;
  4077. this.isRootInsert = true;
  4078. this.isComment = false;
  4079. this.isCloned = false;
  4080. this.isOnce = false;
  4081. this.asyncFactory = asyncFactory;
  4082. this.asyncMeta = undefined;
  4083. this.isAsyncPlaceholder = false;
  4084. };
  4085. var prototypeAccessors = { child: { configurable: true } };
  4086. // DEPRECATED: alias for componentInstance for backwards compat.
  4087. /* istanbul ignore next */
  4088. prototypeAccessors.child.get = function () {
  4089. return this.componentInstance
  4090. };
  4091. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4092. var createEmptyVNode = function (text) {
  4093. if ( text === void 0 ) text = '';
  4094. var node = new VNode();
  4095. node.text = text;
  4096. node.isComment = true;
  4097. return node
  4098. };
  4099. function createTextVNode (val) {
  4100. return new VNode(undefined, undefined, undefined, String(val))
  4101. }
  4102. // optimized shallow clone
  4103. // used for static nodes and slot nodes because they may be reused across
  4104. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4105. // on their elm reference.
  4106. function cloneVNode (vnode) {
  4107. var cloned = new VNode(
  4108. vnode.tag,
  4109. vnode.data,
  4110. // #7975
  4111. // clone children array to avoid mutating original in case of cloning
  4112. // a child.
  4113. vnode.children && vnode.children.slice(),
  4114. vnode.text,
  4115. vnode.elm,
  4116. vnode.context,
  4117. vnode.componentOptions,
  4118. vnode.asyncFactory
  4119. );
  4120. cloned.ns = vnode.ns;
  4121. cloned.isStatic = vnode.isStatic;
  4122. cloned.key = vnode.key;
  4123. cloned.isComment = vnode.isComment;
  4124. cloned.fnContext = vnode.fnContext;
  4125. cloned.fnOptions = vnode.fnOptions;
  4126. cloned.fnScopeId = vnode.fnScopeId;
  4127. cloned.asyncMeta = vnode.asyncMeta;
  4128. cloned.isCloned = true;
  4129. return cloned
  4130. }
  4131. /*
  4132. * not type checking this file because flow doesn't play well with
  4133. * dynamically accessing methods on Array prototype
  4134. */
  4135. var arrayProto = Array.prototype;
  4136. var arrayMethods = Object.create(arrayProto);
  4137. var methodsToPatch = [
  4138. 'push',
  4139. 'pop',
  4140. 'shift',
  4141. 'unshift',
  4142. 'splice',
  4143. 'sort',
  4144. 'reverse'
  4145. ];
  4146. /**
  4147. * Intercept mutating methods and emit events
  4148. */
  4149. methodsToPatch.forEach(function (method) {
  4150. // cache original method
  4151. var original = arrayProto[method];
  4152. def(arrayMethods, method, function mutator () {
  4153. var args = [], len = arguments.length;
  4154. while ( len-- ) args[ len ] = arguments[ len ];
  4155. var result = original.apply(this, args);
  4156. var ob = this.__ob__;
  4157. var inserted;
  4158. switch (method) {
  4159. case 'push':
  4160. case 'unshift':
  4161. inserted = args;
  4162. break
  4163. case 'splice':
  4164. inserted = args.slice(2);
  4165. break
  4166. }
  4167. if (inserted) { ob.observeArray(inserted); }
  4168. // notify change
  4169. ob.dep.notify();
  4170. return result
  4171. });
  4172. });
  4173. /* */
  4174. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4175. /**
  4176. * In some cases we may want to disable observation inside a component's
  4177. * update computation.
  4178. */
  4179. var shouldObserve = true;
  4180. function toggleObserving (value) {
  4181. shouldObserve = value;
  4182. }
  4183. /**
  4184. * Observer class that is attached to each observed
  4185. * object. Once attached, the observer converts the target
  4186. * object's property keys into getter/setters that
  4187. * collect dependencies and dispatch updates.
  4188. */
  4189. var Observer = function Observer (value) {
  4190. this.value = value;
  4191. this.dep = new Dep();
  4192. this.vmCount = 0;
  4193. def(value, '__ob__', this);
  4194. if (Array.isArray(value)) {
  4195. if (hasProto) {
  4196. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4197. if(value.push !== value.__proto__.push){
  4198. copyAugment(value, arrayMethods, arrayKeys);
  4199. } else {
  4200. protoAugment(value, arrayMethods);
  4201. }
  4202. }
  4203. } else {
  4204. copyAugment(value, arrayMethods, arrayKeys);
  4205. }
  4206. this.observeArray(value);
  4207. } else {
  4208. this.walk(value);
  4209. }
  4210. };
  4211. /**
  4212. * Walk through all properties and convert them into
  4213. * getter/setters. This method should only be called when
  4214. * value type is Object.
  4215. */
  4216. Observer.prototype.walk = function walk (obj) {
  4217. var keys = Object.keys(obj);
  4218. for (var i = 0; i < keys.length; i++) {
  4219. defineReactive$$1(obj, keys[i]);
  4220. }
  4221. };
  4222. /**
  4223. * Observe a list of Array items.
  4224. */
  4225. Observer.prototype.observeArray = function observeArray (items) {
  4226. for (var i = 0, l = items.length; i < l; i++) {
  4227. observe(items[i]);
  4228. }
  4229. };
  4230. // helpers
  4231. /**
  4232. * Augment a target Object or Array by intercepting
  4233. * the prototype chain using __proto__
  4234. */
  4235. function protoAugment (target, src) {
  4236. /* eslint-disable no-proto */
  4237. target.__proto__ = src;
  4238. /* eslint-enable no-proto */
  4239. }
  4240. /**
  4241. * Augment a target Object or Array by defining
  4242. * hidden properties.
  4243. */
  4244. /* istanbul ignore next */
  4245. function copyAugment (target, src, keys) {
  4246. for (var i = 0, l = keys.length; i < l; i++) {
  4247. var key = keys[i];
  4248. def(target, key, src[key]);
  4249. }
  4250. }
  4251. /**
  4252. * Attempt to create an observer instance for a value,
  4253. * returns the new observer if successfully observed,
  4254. * or the existing observer if the value already has one.
  4255. */
  4256. function observe (value, asRootData) {
  4257. if (!isObject(value) || value instanceof VNode) {
  4258. return
  4259. }
  4260. var ob;
  4261. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4262. ob = value.__ob__;
  4263. } else if (
  4264. shouldObserve &&
  4265. !isServerRendering() &&
  4266. (Array.isArray(value) || isPlainObject(value)) &&
  4267. Object.isExtensible(value) &&
  4268. !value._isVue &&
  4269. !value.__v_isMPComponent
  4270. ) {
  4271. ob = new Observer(value);
  4272. }
  4273. if (asRootData && ob) {
  4274. ob.vmCount++;
  4275. }
  4276. return ob
  4277. }
  4278. /**
  4279. * Define a reactive property on an Object.
  4280. */
  4281. function defineReactive$$1 (
  4282. obj,
  4283. key,
  4284. val,
  4285. customSetter,
  4286. shallow
  4287. ) {
  4288. var dep = new Dep();
  4289. var property = Object.getOwnPropertyDescriptor(obj, key);
  4290. if (property && property.configurable === false) {
  4291. return
  4292. }
  4293. // cater for pre-defined getter/setters
  4294. var getter = property && property.get;
  4295. var setter = property && property.set;
  4296. if ((!getter || setter) && arguments.length === 2) {
  4297. val = obj[key];
  4298. }
  4299. var childOb = !shallow && observe(val);
  4300. Object.defineProperty(obj, key, {
  4301. enumerable: true,
  4302. configurable: true,
  4303. get: function reactiveGetter () {
  4304. var value = getter ? getter.call(obj) : val;
  4305. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4306. dep.depend();
  4307. if (childOb) {
  4308. childOb.dep.depend();
  4309. if (Array.isArray(value)) {
  4310. dependArray(value);
  4311. }
  4312. }
  4313. }
  4314. return value
  4315. },
  4316. set: function reactiveSetter (newVal) {
  4317. var value = getter ? getter.call(obj) : val;
  4318. /* eslint-disable no-self-compare */
  4319. if (newVal === value || (newVal !== newVal && value !== value)) {
  4320. return
  4321. }
  4322. /* eslint-enable no-self-compare */
  4323. if ( true && customSetter) {
  4324. customSetter();
  4325. }
  4326. // #7981: for accessor properties without setter
  4327. if (getter && !setter) { return }
  4328. if (setter) {
  4329. setter.call(obj, newVal);
  4330. } else {
  4331. val = newVal;
  4332. }
  4333. childOb = !shallow && observe(newVal);
  4334. dep.notify();
  4335. }
  4336. });
  4337. }
  4338. /**
  4339. * Set a property on an object. Adds the new property and
  4340. * triggers change notification if the property doesn't
  4341. * already exist.
  4342. */
  4343. function set (target, key, val) {
  4344. if ( true &&
  4345. (isUndef(target) || isPrimitive(target))
  4346. ) {
  4347. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4348. }
  4349. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4350. target.length = Math.max(target.length, key);
  4351. target.splice(key, 1, val);
  4352. return val
  4353. }
  4354. if (key in target && !(key in Object.prototype)) {
  4355. target[key] = val;
  4356. return val
  4357. }
  4358. var ob = (target).__ob__;
  4359. if (target._isVue || (ob && ob.vmCount)) {
  4360. true && warn(
  4361. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4362. 'at runtime - declare it upfront in the data option.'
  4363. );
  4364. return val
  4365. }
  4366. if (!ob) {
  4367. target[key] = val;
  4368. return val
  4369. }
  4370. defineReactive$$1(ob.value, key, val);
  4371. ob.dep.notify();
  4372. return val
  4373. }
  4374. /**
  4375. * Delete a property and trigger change if necessary.
  4376. */
  4377. function del (target, key) {
  4378. if ( true &&
  4379. (isUndef(target) || isPrimitive(target))
  4380. ) {
  4381. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4382. }
  4383. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4384. target.splice(key, 1);
  4385. return
  4386. }
  4387. var ob = (target).__ob__;
  4388. if (target._isVue || (ob && ob.vmCount)) {
  4389. true && warn(
  4390. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4391. '- just set it to null.'
  4392. );
  4393. return
  4394. }
  4395. if (!hasOwn(target, key)) {
  4396. return
  4397. }
  4398. delete target[key];
  4399. if (!ob) {
  4400. return
  4401. }
  4402. ob.dep.notify();
  4403. }
  4404. /**
  4405. * Collect dependencies on array elements when the array is touched, since
  4406. * we cannot intercept array element access like property getters.
  4407. */
  4408. function dependArray (value) {
  4409. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4410. e = value[i];
  4411. e && e.__ob__ && e.__ob__.dep.depend();
  4412. if (Array.isArray(e)) {
  4413. dependArray(e);
  4414. }
  4415. }
  4416. }
  4417. /* */
  4418. /**
  4419. * Option overwriting strategies are functions that handle
  4420. * how to merge a parent option value and a child option
  4421. * value into the final value.
  4422. */
  4423. var strats = config.optionMergeStrategies;
  4424. /**
  4425. * Options with restrictions
  4426. */
  4427. if (true) {
  4428. strats.el = strats.propsData = function (parent, child, vm, key) {
  4429. if (!vm) {
  4430. warn(
  4431. "option \"" + key + "\" can only be used during instance " +
  4432. 'creation with the `new` keyword.'
  4433. );
  4434. }
  4435. return defaultStrat(parent, child)
  4436. };
  4437. }
  4438. /**
  4439. * Helper that recursively merges two data objects together.
  4440. */
  4441. function mergeData (to, from) {
  4442. if (!from) { return to }
  4443. var key, toVal, fromVal;
  4444. var keys = hasSymbol
  4445. ? Reflect.ownKeys(from)
  4446. : Object.keys(from);
  4447. for (var i = 0; i < keys.length; i++) {
  4448. key = keys[i];
  4449. // in case the object is already observed...
  4450. if (key === '__ob__') { continue }
  4451. toVal = to[key];
  4452. fromVal = from[key];
  4453. if (!hasOwn(to, key)) {
  4454. set(to, key, fromVal);
  4455. } else if (
  4456. toVal !== fromVal &&
  4457. isPlainObject(toVal) &&
  4458. isPlainObject(fromVal)
  4459. ) {
  4460. mergeData(toVal, fromVal);
  4461. }
  4462. }
  4463. return to
  4464. }
  4465. /**
  4466. * Data
  4467. */
  4468. function mergeDataOrFn (
  4469. parentVal,
  4470. childVal,
  4471. vm
  4472. ) {
  4473. if (!vm) {
  4474. // in a Vue.extend merge, both should be functions
  4475. if (!childVal) {
  4476. return parentVal
  4477. }
  4478. if (!parentVal) {
  4479. return childVal
  4480. }
  4481. // when parentVal & childVal are both present,
  4482. // we need to return a function that returns the
  4483. // merged result of both functions... no need to
  4484. // check if parentVal is a function here because
  4485. // it has to be a function to pass previous merges.
  4486. return function mergedDataFn () {
  4487. return mergeData(
  4488. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4489. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4490. )
  4491. }
  4492. } else {
  4493. return function mergedInstanceDataFn () {
  4494. // instance merge
  4495. var instanceData = typeof childVal === 'function'
  4496. ? childVal.call(vm, vm)
  4497. : childVal;
  4498. var defaultData = typeof parentVal === 'function'
  4499. ? parentVal.call(vm, vm)
  4500. : parentVal;
  4501. if (instanceData) {
  4502. return mergeData(instanceData, defaultData)
  4503. } else {
  4504. return defaultData
  4505. }
  4506. }
  4507. }
  4508. }
  4509. strats.data = function (
  4510. parentVal,
  4511. childVal,
  4512. vm
  4513. ) {
  4514. if (!vm) {
  4515. if (childVal && typeof childVal !== 'function') {
  4516. true && warn(
  4517. 'The "data" option should be a function ' +
  4518. 'that returns a per-instance value in component ' +
  4519. 'definitions.',
  4520. vm
  4521. );
  4522. return parentVal
  4523. }
  4524. return mergeDataOrFn(parentVal, childVal)
  4525. }
  4526. return mergeDataOrFn(parentVal, childVal, vm)
  4527. };
  4528. /**
  4529. * Hooks and props are merged as arrays.
  4530. */
  4531. function mergeHook (
  4532. parentVal,
  4533. childVal
  4534. ) {
  4535. var res = childVal
  4536. ? parentVal
  4537. ? parentVal.concat(childVal)
  4538. : Array.isArray(childVal)
  4539. ? childVal
  4540. : [childVal]
  4541. : parentVal;
  4542. return res
  4543. ? dedupeHooks(res)
  4544. : res
  4545. }
  4546. function dedupeHooks (hooks) {
  4547. var res = [];
  4548. for (var i = 0; i < hooks.length; i++) {
  4549. if (res.indexOf(hooks[i]) === -1) {
  4550. res.push(hooks[i]);
  4551. }
  4552. }
  4553. return res
  4554. }
  4555. LIFECYCLE_HOOKS.forEach(function (hook) {
  4556. strats[hook] = mergeHook;
  4557. });
  4558. /**
  4559. * Assets
  4560. *
  4561. * When a vm is present (instance creation), we need to do
  4562. * a three-way merge between constructor options, instance
  4563. * options and parent options.
  4564. */
  4565. function mergeAssets (
  4566. parentVal,
  4567. childVal,
  4568. vm,
  4569. key
  4570. ) {
  4571. var res = Object.create(parentVal || null);
  4572. if (childVal) {
  4573. true && assertObjectType(key, childVal, vm);
  4574. return extend(res, childVal)
  4575. } else {
  4576. return res
  4577. }
  4578. }
  4579. ASSET_TYPES.forEach(function (type) {
  4580. strats[type + 's'] = mergeAssets;
  4581. });
  4582. /**
  4583. * Watchers.
  4584. *
  4585. * Watchers hashes should not overwrite one
  4586. * another, so we merge them as arrays.
  4587. */
  4588. strats.watch = function (
  4589. parentVal,
  4590. childVal,
  4591. vm,
  4592. key
  4593. ) {
  4594. // work around Firefox's Object.prototype.watch...
  4595. if (parentVal === nativeWatch) { parentVal = undefined; }
  4596. if (childVal === nativeWatch) { childVal = undefined; }
  4597. /* istanbul ignore if */
  4598. if (!childVal) { return Object.create(parentVal || null) }
  4599. if (true) {
  4600. assertObjectType(key, childVal, vm);
  4601. }
  4602. if (!parentVal) { return childVal }
  4603. var ret = {};
  4604. extend(ret, parentVal);
  4605. for (var key$1 in childVal) {
  4606. var parent = ret[key$1];
  4607. var child = childVal[key$1];
  4608. if (parent && !Array.isArray(parent)) {
  4609. parent = [parent];
  4610. }
  4611. ret[key$1] = parent
  4612. ? parent.concat(child)
  4613. : Array.isArray(child) ? child : [child];
  4614. }
  4615. return ret
  4616. };
  4617. /**
  4618. * Other object hashes.
  4619. */
  4620. strats.props =
  4621. strats.methods =
  4622. strats.inject =
  4623. strats.computed = function (
  4624. parentVal,
  4625. childVal,
  4626. vm,
  4627. key
  4628. ) {
  4629. if (childVal && "development" !== 'production') {
  4630. assertObjectType(key, childVal, vm);
  4631. }
  4632. if (!parentVal) { return childVal }
  4633. var ret = Object.create(null);
  4634. extend(ret, parentVal);
  4635. if (childVal) { extend(ret, childVal); }
  4636. return ret
  4637. };
  4638. strats.provide = mergeDataOrFn;
  4639. /**
  4640. * Default strategy.
  4641. */
  4642. var defaultStrat = function (parentVal, childVal) {
  4643. return childVal === undefined
  4644. ? parentVal
  4645. : childVal
  4646. };
  4647. /**
  4648. * Validate component names
  4649. */
  4650. function checkComponents (options) {
  4651. for (var key in options.components) {
  4652. validateComponentName(key);
  4653. }
  4654. }
  4655. function validateComponentName (name) {
  4656. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4657. warn(
  4658. 'Invalid component name: "' + name + '". Component names ' +
  4659. 'should conform to valid custom element name in html5 specification.'
  4660. );
  4661. }
  4662. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4663. warn(
  4664. 'Do not use built-in or reserved HTML elements as component ' +
  4665. 'id: ' + name
  4666. );
  4667. }
  4668. }
  4669. /**
  4670. * Ensure all props option syntax are normalized into the
  4671. * Object-based format.
  4672. */
  4673. function normalizeProps (options, vm) {
  4674. var props = options.props;
  4675. if (!props) { return }
  4676. var res = {};
  4677. var i, val, name;
  4678. if (Array.isArray(props)) {
  4679. i = props.length;
  4680. while (i--) {
  4681. val = props[i];
  4682. if (typeof val === 'string') {
  4683. name = camelize(val);
  4684. res[name] = { type: null };
  4685. } else if (true) {
  4686. warn('props must be strings when using array syntax.');
  4687. }
  4688. }
  4689. } else if (isPlainObject(props)) {
  4690. for (var key in props) {
  4691. val = props[key];
  4692. name = camelize(key);
  4693. res[name] = isPlainObject(val)
  4694. ? val
  4695. : { type: val };
  4696. }
  4697. } else if (true) {
  4698. warn(
  4699. "Invalid value for option \"props\": expected an Array or an Object, " +
  4700. "but got " + (toRawType(props)) + ".",
  4701. vm
  4702. );
  4703. }
  4704. options.props = res;
  4705. }
  4706. /**
  4707. * Normalize all injections into Object-based format
  4708. */
  4709. function normalizeInject (options, vm) {
  4710. var inject = options.inject;
  4711. if (!inject) { return }
  4712. var normalized = options.inject = {};
  4713. if (Array.isArray(inject)) {
  4714. for (var i = 0; i < inject.length; i++) {
  4715. normalized[inject[i]] = { from: inject[i] };
  4716. }
  4717. } else if (isPlainObject(inject)) {
  4718. for (var key in inject) {
  4719. var val = inject[key];
  4720. normalized[key] = isPlainObject(val)
  4721. ? extend({ from: key }, val)
  4722. : { from: val };
  4723. }
  4724. } else if (true) {
  4725. warn(
  4726. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4727. "but got " + (toRawType(inject)) + ".",
  4728. vm
  4729. );
  4730. }
  4731. }
  4732. /**
  4733. * Normalize raw function directives into object format.
  4734. */
  4735. function normalizeDirectives (options) {
  4736. var dirs = options.directives;
  4737. if (dirs) {
  4738. for (var key in dirs) {
  4739. var def$$1 = dirs[key];
  4740. if (typeof def$$1 === 'function') {
  4741. dirs[key] = { bind: def$$1, update: def$$1 };
  4742. }
  4743. }
  4744. }
  4745. }
  4746. function assertObjectType (name, value, vm) {
  4747. if (!isPlainObject(value)) {
  4748. warn(
  4749. "Invalid value for option \"" + name + "\": expected an Object, " +
  4750. "but got " + (toRawType(value)) + ".",
  4751. vm
  4752. );
  4753. }
  4754. }
  4755. /**
  4756. * Merge two option objects into a new one.
  4757. * Core utility used in both instantiation and inheritance.
  4758. */
  4759. function mergeOptions (
  4760. parent,
  4761. child,
  4762. vm
  4763. ) {
  4764. if (true) {
  4765. checkComponents(child);
  4766. }
  4767. if (typeof child === 'function') {
  4768. child = child.options;
  4769. }
  4770. normalizeProps(child, vm);
  4771. normalizeInject(child, vm);
  4772. normalizeDirectives(child);
  4773. // Apply extends and mixins on the child options,
  4774. // but only if it is a raw options object that isn't
  4775. // the result of another mergeOptions call.
  4776. // Only merged options has the _base property.
  4777. if (!child._base) {
  4778. if (child.extends) {
  4779. parent = mergeOptions(parent, child.extends, vm);
  4780. }
  4781. if (child.mixins) {
  4782. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4783. parent = mergeOptions(parent, child.mixins[i], vm);
  4784. }
  4785. }
  4786. }
  4787. var options = {};
  4788. var key;
  4789. for (key in parent) {
  4790. mergeField(key);
  4791. }
  4792. for (key in child) {
  4793. if (!hasOwn(parent, key)) {
  4794. mergeField(key);
  4795. }
  4796. }
  4797. function mergeField (key) {
  4798. var strat = strats[key] || defaultStrat;
  4799. options[key] = strat(parent[key], child[key], vm, key);
  4800. }
  4801. return options
  4802. }
  4803. /**
  4804. * Resolve an asset.
  4805. * This function is used because child instances need access
  4806. * to assets defined in its ancestor chain.
  4807. */
  4808. function resolveAsset (
  4809. options,
  4810. type,
  4811. id,
  4812. warnMissing
  4813. ) {
  4814. /* istanbul ignore if */
  4815. if (typeof id !== 'string') {
  4816. return
  4817. }
  4818. var assets = options[type];
  4819. // check local registration variations first
  4820. if (hasOwn(assets, id)) { return assets[id] }
  4821. var camelizedId = camelize(id);
  4822. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4823. var PascalCaseId = capitalize(camelizedId);
  4824. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4825. // fallback to prototype chain
  4826. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4827. if ( true && warnMissing && !res) {
  4828. warn(
  4829. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4830. options
  4831. );
  4832. }
  4833. return res
  4834. }
  4835. /* */
  4836. function validateProp (
  4837. key,
  4838. propOptions,
  4839. propsData,
  4840. vm
  4841. ) {
  4842. var prop = propOptions[key];
  4843. var absent = !hasOwn(propsData, key);
  4844. var value = propsData[key];
  4845. // boolean casting
  4846. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4847. if (booleanIndex > -1) {
  4848. if (absent && !hasOwn(prop, 'default')) {
  4849. value = false;
  4850. } else if (value === '' || value === hyphenate(key)) {
  4851. // only cast empty string / same name to boolean if
  4852. // boolean has higher priority
  4853. var stringIndex = getTypeIndex(String, prop.type);
  4854. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4855. value = true;
  4856. }
  4857. }
  4858. }
  4859. // check default value
  4860. if (value === undefined) {
  4861. value = getPropDefaultValue(vm, prop, key);
  4862. // since the default value is a fresh copy,
  4863. // make sure to observe it.
  4864. var prevShouldObserve = shouldObserve;
  4865. toggleObserving(true);
  4866. observe(value);
  4867. toggleObserving(prevShouldObserve);
  4868. }
  4869. if (
  4870. true
  4871. ) {
  4872. assertProp(prop, key, value, vm, absent);
  4873. }
  4874. return value
  4875. }
  4876. /**
  4877. * Get the default value of a prop.
  4878. */
  4879. function getPropDefaultValue (vm, prop, key) {
  4880. // no default, return undefined
  4881. if (!hasOwn(prop, 'default')) {
  4882. return undefined
  4883. }
  4884. var def = prop.default;
  4885. // warn against non-factory defaults for Object & Array
  4886. if ( true && isObject(def)) {
  4887. warn(
  4888. 'Invalid default value for prop "' + key + '": ' +
  4889. 'Props with type Object/Array must use a factory function ' +
  4890. 'to return the default value.',
  4891. vm
  4892. );
  4893. }
  4894. // the raw prop value was also undefined from previous render,
  4895. // return previous default value to avoid unnecessary watcher trigger
  4896. if (vm && vm.$options.propsData &&
  4897. vm.$options.propsData[key] === undefined &&
  4898. vm._props[key] !== undefined
  4899. ) {
  4900. return vm._props[key]
  4901. }
  4902. // call factory function for non-Function types
  4903. // a value is Function if its prototype is function even across different execution context
  4904. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4905. ? def.call(vm)
  4906. : def
  4907. }
  4908. /**
  4909. * Assert whether a prop is valid.
  4910. */
  4911. function assertProp (
  4912. prop,
  4913. name,
  4914. value,
  4915. vm,
  4916. absent
  4917. ) {
  4918. if (prop.required && absent) {
  4919. warn(
  4920. 'Missing required prop: "' + name + '"',
  4921. vm
  4922. );
  4923. return
  4924. }
  4925. if (value == null && !prop.required) {
  4926. return
  4927. }
  4928. var type = prop.type;
  4929. var valid = !type || type === true;
  4930. var expectedTypes = [];
  4931. if (type) {
  4932. if (!Array.isArray(type)) {
  4933. type = [type];
  4934. }
  4935. for (var i = 0; i < type.length && !valid; i++) {
  4936. var assertedType = assertType(value, type[i]);
  4937. expectedTypes.push(assertedType.expectedType || '');
  4938. valid = assertedType.valid;
  4939. }
  4940. }
  4941. if (!valid) {
  4942. warn(
  4943. getInvalidTypeMessage(name, value, expectedTypes),
  4944. vm
  4945. );
  4946. return
  4947. }
  4948. var validator = prop.validator;
  4949. if (validator) {
  4950. if (!validator(value)) {
  4951. warn(
  4952. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4953. vm
  4954. );
  4955. }
  4956. }
  4957. }
  4958. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4959. function assertType (value, type) {
  4960. var valid;
  4961. var expectedType = getType(type);
  4962. if (simpleCheckRE.test(expectedType)) {
  4963. var t = typeof value;
  4964. valid = t === expectedType.toLowerCase();
  4965. // for primitive wrapper objects
  4966. if (!valid && t === 'object') {
  4967. valid = value instanceof type;
  4968. }
  4969. } else if (expectedType === 'Object') {
  4970. valid = isPlainObject(value);
  4971. } else if (expectedType === 'Array') {
  4972. valid = Array.isArray(value);
  4973. } else {
  4974. valid = value instanceof type;
  4975. }
  4976. return {
  4977. valid: valid,
  4978. expectedType: expectedType
  4979. }
  4980. }
  4981. /**
  4982. * Use function string name to check built-in types,
  4983. * because a simple equality check will fail when running
  4984. * across different vms / iframes.
  4985. */
  4986. function getType (fn) {
  4987. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4988. return match ? match[1] : ''
  4989. }
  4990. function isSameType (a, b) {
  4991. return getType(a) === getType(b)
  4992. }
  4993. function getTypeIndex (type, expectedTypes) {
  4994. if (!Array.isArray(expectedTypes)) {
  4995. return isSameType(expectedTypes, type) ? 0 : -1
  4996. }
  4997. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4998. if (isSameType(expectedTypes[i], type)) {
  4999. return i
  5000. }
  5001. }
  5002. return -1
  5003. }
  5004. function getInvalidTypeMessage (name, value, expectedTypes) {
  5005. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5006. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5007. var expectedType = expectedTypes[0];
  5008. var receivedType = toRawType(value);
  5009. var expectedValue = styleValue(value, expectedType);
  5010. var receivedValue = styleValue(value, receivedType);
  5011. // check if we need to specify expected value
  5012. if (expectedTypes.length === 1 &&
  5013. isExplicable(expectedType) &&
  5014. !isBoolean(expectedType, receivedType)) {
  5015. message += " with value " + expectedValue;
  5016. }
  5017. message += ", got " + receivedType + " ";
  5018. // check if we need to specify received value
  5019. if (isExplicable(receivedType)) {
  5020. message += "with value " + receivedValue + ".";
  5021. }
  5022. return message
  5023. }
  5024. function styleValue (value, type) {
  5025. if (type === 'String') {
  5026. return ("\"" + value + "\"")
  5027. } else if (type === 'Number') {
  5028. return ("" + (Number(value)))
  5029. } else {
  5030. return ("" + value)
  5031. }
  5032. }
  5033. function isExplicable (value) {
  5034. var explicitTypes = ['string', 'number', 'boolean'];
  5035. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5036. }
  5037. function isBoolean () {
  5038. var args = [], len = arguments.length;
  5039. while ( len-- ) args[ len ] = arguments[ len ];
  5040. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5041. }
  5042. /* */
  5043. function handleError (err, vm, info) {
  5044. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5045. // See: https://github.com/vuejs/vuex/issues/1505
  5046. pushTarget();
  5047. try {
  5048. if (vm) {
  5049. var cur = vm;
  5050. while ((cur = cur.$parent)) {
  5051. var hooks = cur.$options.errorCaptured;
  5052. if (hooks) {
  5053. for (var i = 0; i < hooks.length; i++) {
  5054. try {
  5055. var capture = hooks[i].call(cur, err, vm, info) === false;
  5056. if (capture) { return }
  5057. } catch (e) {
  5058. globalHandleError(e, cur, 'errorCaptured hook');
  5059. }
  5060. }
  5061. }
  5062. }
  5063. }
  5064. globalHandleError(err, vm, info);
  5065. } finally {
  5066. popTarget();
  5067. }
  5068. }
  5069. function invokeWithErrorHandling (
  5070. handler,
  5071. context,
  5072. args,
  5073. vm,
  5074. info
  5075. ) {
  5076. var res;
  5077. try {
  5078. res = args ? handler.apply(context, args) : handler.call(context);
  5079. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5080. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5081. // issue #9511
  5082. // avoid catch triggering multiple times when nested calls
  5083. res._handled = true;
  5084. }
  5085. } catch (e) {
  5086. handleError(e, vm, info);
  5087. }
  5088. return res
  5089. }
  5090. function globalHandleError (err, vm, info) {
  5091. if (config.errorHandler) {
  5092. try {
  5093. return config.errorHandler.call(null, err, vm, info)
  5094. } catch (e) {
  5095. // if the user intentionally throws the original error in the handler,
  5096. // do not log it twice
  5097. if (e !== err) {
  5098. logError(e, null, 'config.errorHandler');
  5099. }
  5100. }
  5101. }
  5102. logError(err, vm, info);
  5103. }
  5104. function logError (err, vm, info) {
  5105. if (true) {
  5106. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5107. }
  5108. /* istanbul ignore else */
  5109. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5110. console.error(err);
  5111. } else {
  5112. throw err
  5113. }
  5114. }
  5115. /* */
  5116. var callbacks = [];
  5117. var pending = false;
  5118. function flushCallbacks () {
  5119. pending = false;
  5120. var copies = callbacks.slice(0);
  5121. callbacks.length = 0;
  5122. for (var i = 0; i < copies.length; i++) {
  5123. copies[i]();
  5124. }
  5125. }
  5126. // Here we have async deferring wrappers using microtasks.
  5127. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5128. // However, it has subtle problems when state is changed right before repaint
  5129. // (e.g. #6813, out-in transitions).
  5130. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5131. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5132. // So we now use microtasks everywhere, again.
  5133. // A major drawback of this tradeoff is that there are some scenarios
  5134. // where microtasks have too high a priority and fire in between supposedly
  5135. // sequential events (e.g. #4521, #6690, which have workarounds)
  5136. // or even between bubbling of the same event (#6566).
  5137. var timerFunc;
  5138. // The nextTick behavior leverages the microtask queue, which can be accessed
  5139. // via either native Promise.then or MutationObserver.
  5140. // MutationObserver has wider support, however it is seriously bugged in
  5141. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5142. // completely stops working after triggering a few times... so, if native
  5143. // Promise is available, we will use it:
  5144. /* istanbul ignore next, $flow-disable-line */
  5145. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5146. var p = Promise.resolve();
  5147. timerFunc = function () {
  5148. p.then(flushCallbacks);
  5149. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5150. // it can get stuck in a weird state where callbacks are pushed into the
  5151. // microtask queue but the queue isn't being flushed, until the browser
  5152. // needs to do some other work, e.g. handle a timer. Therefore we can
  5153. // "force" the microtask queue to be flushed by adding an empty timer.
  5154. if (isIOS) { setTimeout(noop); }
  5155. };
  5156. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5157. isNative(MutationObserver) ||
  5158. // PhantomJS and iOS 7.x
  5159. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5160. )) {
  5161. // Use MutationObserver where native Promise is not available,
  5162. // e.g. PhantomJS, iOS7, Android 4.4
  5163. // (#6466 MutationObserver is unreliable in IE11)
  5164. var counter = 1;
  5165. var observer = new MutationObserver(flushCallbacks);
  5166. var textNode = document.createTextNode(String(counter));
  5167. observer.observe(textNode, {
  5168. characterData: true
  5169. });
  5170. timerFunc = function () {
  5171. counter = (counter + 1) % 2;
  5172. textNode.data = String(counter);
  5173. };
  5174. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5175. // Fallback to setImmediate.
  5176. // Technically it leverages the (macro) task queue,
  5177. // but it is still a better choice than setTimeout.
  5178. timerFunc = function () {
  5179. setImmediate(flushCallbacks);
  5180. };
  5181. } else {
  5182. // Fallback to setTimeout.
  5183. timerFunc = function () {
  5184. setTimeout(flushCallbacks, 0);
  5185. };
  5186. }
  5187. function nextTick (cb, ctx) {
  5188. var _resolve;
  5189. callbacks.push(function () {
  5190. if (cb) {
  5191. try {
  5192. cb.call(ctx);
  5193. } catch (e) {
  5194. handleError(e, ctx, 'nextTick');
  5195. }
  5196. } else if (_resolve) {
  5197. _resolve(ctx);
  5198. }
  5199. });
  5200. if (!pending) {
  5201. pending = true;
  5202. timerFunc();
  5203. }
  5204. // $flow-disable-line
  5205. if (!cb && typeof Promise !== 'undefined') {
  5206. return new Promise(function (resolve) {
  5207. _resolve = resolve;
  5208. })
  5209. }
  5210. }
  5211. /* */
  5212. /* not type checking this file because flow doesn't play well with Proxy */
  5213. var initProxy;
  5214. if (true) {
  5215. var allowedGlobals = makeMap(
  5216. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5217. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5218. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5219. 'require' // for Webpack/Browserify
  5220. );
  5221. var warnNonPresent = function (target, key) {
  5222. warn(
  5223. "Property or method \"" + key + "\" is not defined on the instance but " +
  5224. 'referenced during render. Make sure that this property is reactive, ' +
  5225. 'either in the data option, or for class-based components, by ' +
  5226. 'initializing the property. ' +
  5227. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5228. target
  5229. );
  5230. };
  5231. var warnReservedPrefix = function (target, key) {
  5232. warn(
  5233. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5234. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5235. 'prevent conflicts with Vue internals. ' +
  5236. 'See: https://vuejs.org/v2/api/#data',
  5237. target
  5238. );
  5239. };
  5240. var hasProxy =
  5241. typeof Proxy !== 'undefined' && isNative(Proxy);
  5242. if (hasProxy) {
  5243. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5244. config.keyCodes = new Proxy(config.keyCodes, {
  5245. set: function set (target, key, value) {
  5246. if (isBuiltInModifier(key)) {
  5247. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5248. return false
  5249. } else {
  5250. target[key] = value;
  5251. return true
  5252. }
  5253. }
  5254. });
  5255. }
  5256. var hasHandler = {
  5257. has: function has (target, key) {
  5258. var has = key in target;
  5259. var isAllowed = allowedGlobals(key) ||
  5260. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5261. if (!has && !isAllowed) {
  5262. if (key in target.$data) { warnReservedPrefix(target, key); }
  5263. else { warnNonPresent(target, key); }
  5264. }
  5265. return has || !isAllowed
  5266. }
  5267. };
  5268. var getHandler = {
  5269. get: function get (target, key) {
  5270. if (typeof key === 'string' && !(key in target)) {
  5271. if (key in target.$data) { warnReservedPrefix(target, key); }
  5272. else { warnNonPresent(target, key); }
  5273. }
  5274. return target[key]
  5275. }
  5276. };
  5277. initProxy = function initProxy (vm) {
  5278. if (hasProxy) {
  5279. // determine which proxy handler to use
  5280. var options = vm.$options;
  5281. var handlers = options.render && options.render._withStripped
  5282. ? getHandler
  5283. : hasHandler;
  5284. vm._renderProxy = new Proxy(vm, handlers);
  5285. } else {
  5286. vm._renderProxy = vm;
  5287. }
  5288. };
  5289. }
  5290. /* */
  5291. var seenObjects = new _Set();
  5292. /**
  5293. * Recursively traverse an object to evoke all converted
  5294. * getters, so that every nested property inside the object
  5295. * is collected as a "deep" dependency.
  5296. */
  5297. function traverse (val) {
  5298. _traverse(val, seenObjects);
  5299. seenObjects.clear();
  5300. }
  5301. function _traverse (val, seen) {
  5302. var i, keys;
  5303. var isA = Array.isArray(val);
  5304. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5305. return
  5306. }
  5307. if (val.__ob__) {
  5308. var depId = val.__ob__.dep.id;
  5309. if (seen.has(depId)) {
  5310. return
  5311. }
  5312. seen.add(depId);
  5313. }
  5314. if (isA) {
  5315. i = val.length;
  5316. while (i--) { _traverse(val[i], seen); }
  5317. } else {
  5318. keys = Object.keys(val);
  5319. i = keys.length;
  5320. while (i--) { _traverse(val[keys[i]], seen); }
  5321. }
  5322. }
  5323. var mark;
  5324. var measure;
  5325. if (true) {
  5326. var perf = inBrowser && window.performance;
  5327. /* istanbul ignore if */
  5328. if (
  5329. perf &&
  5330. perf.mark &&
  5331. perf.measure &&
  5332. perf.clearMarks &&
  5333. perf.clearMeasures
  5334. ) {
  5335. mark = function (tag) { return perf.mark(tag); };
  5336. measure = function (name, startTag, endTag) {
  5337. perf.measure(name, startTag, endTag);
  5338. perf.clearMarks(startTag);
  5339. perf.clearMarks(endTag);
  5340. // perf.clearMeasures(name)
  5341. };
  5342. }
  5343. }
  5344. /* */
  5345. var normalizeEvent = cached(function (name) {
  5346. var passive = name.charAt(0) === '&';
  5347. name = passive ? name.slice(1) : name;
  5348. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5349. name = once$$1 ? name.slice(1) : name;
  5350. var capture = name.charAt(0) === '!';
  5351. name = capture ? name.slice(1) : name;
  5352. return {
  5353. name: name,
  5354. once: once$$1,
  5355. capture: capture,
  5356. passive: passive
  5357. }
  5358. });
  5359. function createFnInvoker (fns, vm) {
  5360. function invoker () {
  5361. var arguments$1 = arguments;
  5362. var fns = invoker.fns;
  5363. if (Array.isArray(fns)) {
  5364. var cloned = fns.slice();
  5365. for (var i = 0; i < cloned.length; i++) {
  5366. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5367. }
  5368. } else {
  5369. // return handler return value for single handlers
  5370. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5371. }
  5372. }
  5373. invoker.fns = fns;
  5374. return invoker
  5375. }
  5376. function updateListeners (
  5377. on,
  5378. oldOn,
  5379. add,
  5380. remove$$1,
  5381. createOnceHandler,
  5382. vm
  5383. ) {
  5384. var name, def$$1, cur, old, event;
  5385. for (name in on) {
  5386. def$$1 = cur = on[name];
  5387. old = oldOn[name];
  5388. event = normalizeEvent(name);
  5389. if (isUndef(cur)) {
  5390. true && warn(
  5391. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5392. vm
  5393. );
  5394. } else if (isUndef(old)) {
  5395. if (isUndef(cur.fns)) {
  5396. cur = on[name] = createFnInvoker(cur, vm);
  5397. }
  5398. if (isTrue(event.once)) {
  5399. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5400. }
  5401. add(event.name, cur, event.capture, event.passive, event.params);
  5402. } else if (cur !== old) {
  5403. old.fns = cur;
  5404. on[name] = old;
  5405. }
  5406. }
  5407. for (name in oldOn) {
  5408. if (isUndef(on[name])) {
  5409. event = normalizeEvent(name);
  5410. remove$$1(event.name, oldOn[name], event.capture);
  5411. }
  5412. }
  5413. }
  5414. /* */
  5415. /* */
  5416. // fixed by xxxxxx (mp properties)
  5417. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5418. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5419. if (isUndef(propOptions)) {
  5420. return res
  5421. }
  5422. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5423. var attrs = data.attrs;
  5424. var props = data.props;
  5425. if (isDef(attrs) || isDef(props)) {
  5426. for (var key in propOptions) {
  5427. var altKey = hyphenate(key);
  5428. var result = checkProp(res, props, key, altKey, true) ||
  5429. checkProp(res, attrs, key, altKey, false);
  5430. // externalClass
  5431. if (
  5432. result &&
  5433. res[key] &&
  5434. externalClasses.indexOf(altKey) !== -1 &&
  5435. context[camelize(res[key])]
  5436. ) {
  5437. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5438. res[key] = context[camelize(res[key])];
  5439. }
  5440. }
  5441. }
  5442. return res
  5443. }
  5444. function extractPropsFromVNodeData (
  5445. data,
  5446. Ctor,
  5447. tag,
  5448. context// fixed by xxxxxx
  5449. ) {
  5450. // we are only extracting raw values here.
  5451. // validation and default values are handled in the child
  5452. // component itself.
  5453. var propOptions = Ctor.options.props;
  5454. if (isUndef(propOptions)) {
  5455. // fixed by xxxxxx
  5456. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5457. }
  5458. var res = {};
  5459. var attrs = data.attrs;
  5460. var props = data.props;
  5461. if (isDef(attrs) || isDef(props)) {
  5462. for (var key in propOptions) {
  5463. var altKey = hyphenate(key);
  5464. if (true) {
  5465. var keyInLowerCase = key.toLowerCase();
  5466. if (
  5467. key !== keyInLowerCase &&
  5468. attrs && hasOwn(attrs, keyInLowerCase)
  5469. ) {
  5470. tip(
  5471. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5472. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5473. " \"" + key + "\". " +
  5474. "Note that HTML attributes are case-insensitive and camelCased " +
  5475. "props need to use their kebab-case equivalents when using in-DOM " +
  5476. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5477. );
  5478. }
  5479. }
  5480. checkProp(res, props, key, altKey, true) ||
  5481. checkProp(res, attrs, key, altKey, false);
  5482. }
  5483. }
  5484. // fixed by xxxxxx
  5485. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5486. }
  5487. function checkProp (
  5488. res,
  5489. hash,
  5490. key,
  5491. altKey,
  5492. preserve
  5493. ) {
  5494. if (isDef(hash)) {
  5495. if (hasOwn(hash, key)) {
  5496. res[key] = hash[key];
  5497. if (!preserve) {
  5498. delete hash[key];
  5499. }
  5500. return true
  5501. } else if (hasOwn(hash, altKey)) {
  5502. res[key] = hash[altKey];
  5503. if (!preserve) {
  5504. delete hash[altKey];
  5505. }
  5506. return true
  5507. }
  5508. }
  5509. return false
  5510. }
  5511. /* */
  5512. // The template compiler attempts to minimize the need for normalization by
  5513. // statically analyzing the template at compile time.
  5514. //
  5515. // For plain HTML markup, normalization can be completely skipped because the
  5516. // generated render function is guaranteed to return Array<VNode>. There are
  5517. // two cases where extra normalization is needed:
  5518. // 1. When the children contains components - because a functional component
  5519. // may return an Array instead of a single root. In this case, just a simple
  5520. // normalization is needed - if any child is an Array, we flatten the whole
  5521. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5522. // because functional components already normalize their own children.
  5523. function simpleNormalizeChildren (children) {
  5524. for (var i = 0; i < children.length; i++) {
  5525. if (Array.isArray(children[i])) {
  5526. return Array.prototype.concat.apply([], children)
  5527. }
  5528. }
  5529. return children
  5530. }
  5531. // 2. When the children contains constructs that always generated nested Arrays,
  5532. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5533. // with hand-written render functions / JSX. In such cases a full normalization
  5534. // is needed to cater to all possible types of children values.
  5535. function normalizeChildren (children) {
  5536. return isPrimitive(children)
  5537. ? [createTextVNode(children)]
  5538. : Array.isArray(children)
  5539. ? normalizeArrayChildren(children)
  5540. : undefined
  5541. }
  5542. function isTextNode (node) {
  5543. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5544. }
  5545. function normalizeArrayChildren (children, nestedIndex) {
  5546. var res = [];
  5547. var i, c, lastIndex, last;
  5548. for (i = 0; i < children.length; i++) {
  5549. c = children[i];
  5550. if (isUndef(c) || typeof c === 'boolean') { continue }
  5551. lastIndex = res.length - 1;
  5552. last = res[lastIndex];
  5553. // nested
  5554. if (Array.isArray(c)) {
  5555. if (c.length > 0) {
  5556. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5557. // merge adjacent text nodes
  5558. if (isTextNode(c[0]) && isTextNode(last)) {
  5559. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5560. c.shift();
  5561. }
  5562. res.push.apply(res, c);
  5563. }
  5564. } else if (isPrimitive(c)) {
  5565. if (isTextNode(last)) {
  5566. // merge adjacent text nodes
  5567. // this is necessary for SSR hydration because text nodes are
  5568. // essentially merged when rendered to HTML strings
  5569. res[lastIndex] = createTextVNode(last.text + c);
  5570. } else if (c !== '') {
  5571. // convert primitive to vnode
  5572. res.push(createTextVNode(c));
  5573. }
  5574. } else {
  5575. if (isTextNode(c) && isTextNode(last)) {
  5576. // merge adjacent text nodes
  5577. res[lastIndex] = createTextVNode(last.text + c.text);
  5578. } else {
  5579. // default key for nested array children (likely generated by v-for)
  5580. if (isTrue(children._isVList) &&
  5581. isDef(c.tag) &&
  5582. isUndef(c.key) &&
  5583. isDef(nestedIndex)) {
  5584. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5585. }
  5586. res.push(c);
  5587. }
  5588. }
  5589. }
  5590. return res
  5591. }
  5592. /* */
  5593. function initProvide (vm) {
  5594. var provide = vm.$options.provide;
  5595. if (provide) {
  5596. vm._provided = typeof provide === 'function'
  5597. ? provide.call(vm)
  5598. : provide;
  5599. }
  5600. }
  5601. function initInjections (vm) {
  5602. var result = resolveInject(vm.$options.inject, vm);
  5603. if (result) {
  5604. toggleObserving(false);
  5605. Object.keys(result).forEach(function (key) {
  5606. /* istanbul ignore else */
  5607. if (true) {
  5608. defineReactive$$1(vm, key, result[key], function () {
  5609. warn(
  5610. "Avoid mutating an injected value directly since the changes will be " +
  5611. "overwritten whenever the provided component re-renders. " +
  5612. "injection being mutated: \"" + key + "\"",
  5613. vm
  5614. );
  5615. });
  5616. } else {}
  5617. });
  5618. toggleObserving(true);
  5619. }
  5620. }
  5621. function resolveInject (inject, vm) {
  5622. if (inject) {
  5623. // inject is :any because flow is not smart enough to figure out cached
  5624. var result = Object.create(null);
  5625. var keys = hasSymbol
  5626. ? Reflect.ownKeys(inject)
  5627. : Object.keys(inject);
  5628. for (var i = 0; i < keys.length; i++) {
  5629. var key = keys[i];
  5630. // #6574 in case the inject object is observed...
  5631. if (key === '__ob__') { continue }
  5632. var provideKey = inject[key].from;
  5633. var source = vm;
  5634. while (source) {
  5635. if (source._provided && hasOwn(source._provided, provideKey)) {
  5636. result[key] = source._provided[provideKey];
  5637. break
  5638. }
  5639. source = source.$parent;
  5640. }
  5641. if (!source) {
  5642. if ('default' in inject[key]) {
  5643. var provideDefault = inject[key].default;
  5644. result[key] = typeof provideDefault === 'function'
  5645. ? provideDefault.call(vm)
  5646. : provideDefault;
  5647. } else if (true) {
  5648. warn(("Injection \"" + key + "\" not found"), vm);
  5649. }
  5650. }
  5651. }
  5652. return result
  5653. }
  5654. }
  5655. /* */
  5656. /**
  5657. * Runtime helper for resolving raw children VNodes into a slot object.
  5658. */
  5659. function resolveSlots (
  5660. children,
  5661. context
  5662. ) {
  5663. if (!children || !children.length) {
  5664. return {}
  5665. }
  5666. var slots = {};
  5667. for (var i = 0, l = children.length; i < l; i++) {
  5668. var child = children[i];
  5669. var data = child.data;
  5670. // remove slot attribute if the node is resolved as a Vue slot node
  5671. if (data && data.attrs && data.attrs.slot) {
  5672. delete data.attrs.slot;
  5673. }
  5674. // named slots should only be respected if the vnode was rendered in the
  5675. // same context.
  5676. if ((child.context === context || child.fnContext === context) &&
  5677. data && data.slot != null
  5678. ) {
  5679. var name = data.slot;
  5680. var slot = (slots[name] || (slots[name] = []));
  5681. if (child.tag === 'template') {
  5682. slot.push.apply(slot, child.children || []);
  5683. } else {
  5684. slot.push(child);
  5685. }
  5686. } else {
  5687. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5688. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5689. (slots['page'] || (slots['page'] = [])).push(child);
  5690. }else{
  5691. (slots.default || (slots.default = [])).push(child);
  5692. }
  5693. }
  5694. }
  5695. // ignore slots that contains only whitespace
  5696. for (var name$1 in slots) {
  5697. if (slots[name$1].every(isWhitespace)) {
  5698. delete slots[name$1];
  5699. }
  5700. }
  5701. return slots
  5702. }
  5703. function isWhitespace (node) {
  5704. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5705. }
  5706. /* */
  5707. function normalizeScopedSlots (
  5708. slots,
  5709. normalSlots,
  5710. prevSlots
  5711. ) {
  5712. var res;
  5713. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5714. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5715. var key = slots && slots.$key;
  5716. if (!slots) {
  5717. res = {};
  5718. } else if (slots._normalized) {
  5719. // fast path 1: child component re-render only, parent did not change
  5720. return slots._normalized
  5721. } else if (
  5722. isStable &&
  5723. prevSlots &&
  5724. prevSlots !== emptyObject &&
  5725. key === prevSlots.$key &&
  5726. !hasNormalSlots &&
  5727. !prevSlots.$hasNormal
  5728. ) {
  5729. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5730. // only need to normalize once
  5731. return prevSlots
  5732. } else {
  5733. res = {};
  5734. for (var key$1 in slots) {
  5735. if (slots[key$1] && key$1[0] !== '$') {
  5736. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5737. }
  5738. }
  5739. }
  5740. // expose normal slots on scopedSlots
  5741. for (var key$2 in normalSlots) {
  5742. if (!(key$2 in res)) {
  5743. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5744. }
  5745. }
  5746. // avoriaz seems to mock a non-extensible $scopedSlots object
  5747. // and when that is passed down this would cause an error
  5748. if (slots && Object.isExtensible(slots)) {
  5749. (slots)._normalized = res;
  5750. }
  5751. def(res, '$stable', isStable);
  5752. def(res, '$key', key);
  5753. def(res, '$hasNormal', hasNormalSlots);
  5754. return res
  5755. }
  5756. function normalizeScopedSlot(normalSlots, key, fn) {
  5757. var normalized = function () {
  5758. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5759. res = res && typeof res === 'object' && !Array.isArray(res)
  5760. ? [res] // single vnode
  5761. : normalizeChildren(res);
  5762. return res && (
  5763. res.length === 0 ||
  5764. (res.length === 1 && res[0].isComment) // #9658
  5765. ) ? undefined
  5766. : res
  5767. };
  5768. // this is a slot using the new v-slot syntax without scope. although it is
  5769. // compiled as a scoped slot, render fn users would expect it to be present
  5770. // on this.$slots because the usage is semantically a normal slot.
  5771. if (fn.proxy) {
  5772. Object.defineProperty(normalSlots, key, {
  5773. get: normalized,
  5774. enumerable: true,
  5775. configurable: true
  5776. });
  5777. }
  5778. return normalized
  5779. }
  5780. function proxyNormalSlot(slots, key) {
  5781. return function () { return slots[key]; }
  5782. }
  5783. /* */
  5784. /**
  5785. * Runtime helper for rendering v-for lists.
  5786. */
  5787. function renderList (
  5788. val,
  5789. render
  5790. ) {
  5791. var ret, i, l, keys, key;
  5792. if (Array.isArray(val) || typeof val === 'string') {
  5793. ret = new Array(val.length);
  5794. for (i = 0, l = val.length; i < l; i++) {
  5795. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5796. }
  5797. } else if (typeof val === 'number') {
  5798. ret = new Array(val);
  5799. for (i = 0; i < val; i++) {
  5800. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5801. }
  5802. } else if (isObject(val)) {
  5803. if (hasSymbol && val[Symbol.iterator]) {
  5804. ret = [];
  5805. var iterator = val[Symbol.iterator]();
  5806. var result = iterator.next();
  5807. while (!result.done) {
  5808. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5809. result = iterator.next();
  5810. }
  5811. } else {
  5812. keys = Object.keys(val);
  5813. ret = new Array(keys.length);
  5814. for (i = 0, l = keys.length; i < l; i++) {
  5815. key = keys[i];
  5816. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5817. }
  5818. }
  5819. }
  5820. if (!isDef(ret)) {
  5821. ret = [];
  5822. }
  5823. (ret)._isVList = true;
  5824. return ret
  5825. }
  5826. /* */
  5827. /**
  5828. * Runtime helper for rendering <slot>
  5829. */
  5830. function renderSlot (
  5831. name,
  5832. fallback,
  5833. props,
  5834. bindObject
  5835. ) {
  5836. var scopedSlotFn = this.$scopedSlots[name];
  5837. var nodes;
  5838. if (scopedSlotFn) { // scoped slot
  5839. props = props || {};
  5840. if (bindObject) {
  5841. if ( true && !isObject(bindObject)) {
  5842. warn(
  5843. 'slot v-bind without argument expects an Object',
  5844. this
  5845. );
  5846. }
  5847. props = extend(extend({}, bindObject), props);
  5848. }
  5849. // fixed by xxxxxx app-plus scopedSlot
  5850. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5851. } else {
  5852. nodes = this.$slots[name] || fallback;
  5853. }
  5854. var target = props && props.slot;
  5855. if (target) {
  5856. return this.$createElement('template', { slot: target }, nodes)
  5857. } else {
  5858. return nodes
  5859. }
  5860. }
  5861. /* */
  5862. /**
  5863. * Runtime helper for resolving filters
  5864. */
  5865. function resolveFilter (id) {
  5866. return resolveAsset(this.$options, 'filters', id, true) || identity
  5867. }
  5868. /* */
  5869. function isKeyNotMatch (expect, actual) {
  5870. if (Array.isArray(expect)) {
  5871. return expect.indexOf(actual) === -1
  5872. } else {
  5873. return expect !== actual
  5874. }
  5875. }
  5876. /**
  5877. * Runtime helper for checking keyCodes from config.
  5878. * exposed as Vue.prototype._k
  5879. * passing in eventKeyName as last argument separately for backwards compat
  5880. */
  5881. function checkKeyCodes (
  5882. eventKeyCode,
  5883. key,
  5884. builtInKeyCode,
  5885. eventKeyName,
  5886. builtInKeyName
  5887. ) {
  5888. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5889. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5890. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5891. } else if (mappedKeyCode) {
  5892. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5893. } else if (eventKeyName) {
  5894. return hyphenate(eventKeyName) !== key
  5895. }
  5896. }
  5897. /* */
  5898. /**
  5899. * Runtime helper for merging v-bind="object" into a VNode's data.
  5900. */
  5901. function bindObjectProps (
  5902. data,
  5903. tag,
  5904. value,
  5905. asProp,
  5906. isSync
  5907. ) {
  5908. if (value) {
  5909. if (!isObject(value)) {
  5910. true && warn(
  5911. 'v-bind without argument expects an Object or Array value',
  5912. this
  5913. );
  5914. } else {
  5915. if (Array.isArray(value)) {
  5916. value = toObject(value);
  5917. }
  5918. var hash;
  5919. var loop = function ( key ) {
  5920. if (
  5921. key === 'class' ||
  5922. key === 'style' ||
  5923. isReservedAttribute(key)
  5924. ) {
  5925. hash = data;
  5926. } else {
  5927. var type = data.attrs && data.attrs.type;
  5928. hash = asProp || config.mustUseProp(tag, type, key)
  5929. ? data.domProps || (data.domProps = {})
  5930. : data.attrs || (data.attrs = {});
  5931. }
  5932. var camelizedKey = camelize(key);
  5933. var hyphenatedKey = hyphenate(key);
  5934. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5935. hash[key] = value[key];
  5936. if (isSync) {
  5937. var on = data.on || (data.on = {});
  5938. on[("update:" + key)] = function ($event) {
  5939. value[key] = $event;
  5940. };
  5941. }
  5942. }
  5943. };
  5944. for (var key in value) loop( key );
  5945. }
  5946. }
  5947. return data
  5948. }
  5949. /* */
  5950. /**
  5951. * Runtime helper for rendering static trees.
  5952. */
  5953. function renderStatic (
  5954. index,
  5955. isInFor
  5956. ) {
  5957. var cached = this._staticTrees || (this._staticTrees = []);
  5958. var tree = cached[index];
  5959. // if has already-rendered static tree and not inside v-for,
  5960. // we can reuse the same tree.
  5961. if (tree && !isInFor) {
  5962. return tree
  5963. }
  5964. // otherwise, render a fresh tree.
  5965. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5966. this._renderProxy,
  5967. null,
  5968. this // for render fns generated for functional component templates
  5969. );
  5970. markStatic(tree, ("__static__" + index), false);
  5971. return tree
  5972. }
  5973. /**
  5974. * Runtime helper for v-once.
  5975. * Effectively it means marking the node as static with a unique key.
  5976. */
  5977. function markOnce (
  5978. tree,
  5979. index,
  5980. key
  5981. ) {
  5982. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5983. return tree
  5984. }
  5985. function markStatic (
  5986. tree,
  5987. key,
  5988. isOnce
  5989. ) {
  5990. if (Array.isArray(tree)) {
  5991. for (var i = 0; i < tree.length; i++) {
  5992. if (tree[i] && typeof tree[i] !== 'string') {
  5993. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5994. }
  5995. }
  5996. } else {
  5997. markStaticNode(tree, key, isOnce);
  5998. }
  5999. }
  6000. function markStaticNode (node, key, isOnce) {
  6001. node.isStatic = true;
  6002. node.key = key;
  6003. node.isOnce = isOnce;
  6004. }
  6005. /* */
  6006. function bindObjectListeners (data, value) {
  6007. if (value) {
  6008. if (!isPlainObject(value)) {
  6009. true && warn(
  6010. 'v-on without argument expects an Object value',
  6011. this
  6012. );
  6013. } else {
  6014. var on = data.on = data.on ? extend({}, data.on) : {};
  6015. for (var key in value) {
  6016. var existing = on[key];
  6017. var ours = value[key];
  6018. on[key] = existing ? [].concat(existing, ours) : ours;
  6019. }
  6020. }
  6021. }
  6022. return data
  6023. }
  6024. /* */
  6025. function resolveScopedSlots (
  6026. fns, // see flow/vnode
  6027. res,
  6028. // the following are added in 2.6
  6029. hasDynamicKeys,
  6030. contentHashKey
  6031. ) {
  6032. res = res || { $stable: !hasDynamicKeys };
  6033. for (var i = 0; i < fns.length; i++) {
  6034. var slot = fns[i];
  6035. if (Array.isArray(slot)) {
  6036. resolveScopedSlots(slot, res, hasDynamicKeys);
  6037. } else if (slot) {
  6038. // marker for reverse proxying v-slot without scope on this.$slots
  6039. if (slot.proxy) {
  6040. slot.fn.proxy = true;
  6041. }
  6042. res[slot.key] = slot.fn;
  6043. }
  6044. }
  6045. if (contentHashKey) {
  6046. (res).$key = contentHashKey;
  6047. }
  6048. return res
  6049. }
  6050. /* */
  6051. function bindDynamicKeys (baseObj, values) {
  6052. for (var i = 0; i < values.length; i += 2) {
  6053. var key = values[i];
  6054. if (typeof key === 'string' && key) {
  6055. baseObj[values[i]] = values[i + 1];
  6056. } else if ( true && key !== '' && key !== null) {
  6057. // null is a special value for explicitly removing a binding
  6058. warn(
  6059. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6060. this
  6061. );
  6062. }
  6063. }
  6064. return baseObj
  6065. }
  6066. // helper to dynamically append modifier runtime markers to event names.
  6067. // ensure only append when value is already string, otherwise it will be cast
  6068. // to string and cause the type check to miss.
  6069. function prependModifier (value, symbol) {
  6070. return typeof value === 'string' ? symbol + value : value
  6071. }
  6072. /* */
  6073. function installRenderHelpers (target) {
  6074. target._o = markOnce;
  6075. target._n = toNumber;
  6076. target._s = toString;
  6077. target._l = renderList;
  6078. target._t = renderSlot;
  6079. target._q = looseEqual;
  6080. target._i = looseIndexOf;
  6081. target._m = renderStatic;
  6082. target._f = resolveFilter;
  6083. target._k = checkKeyCodes;
  6084. target._b = bindObjectProps;
  6085. target._v = createTextVNode;
  6086. target._e = createEmptyVNode;
  6087. target._u = resolveScopedSlots;
  6088. target._g = bindObjectListeners;
  6089. target._d = bindDynamicKeys;
  6090. target._p = prependModifier;
  6091. }
  6092. /* */
  6093. function FunctionalRenderContext (
  6094. data,
  6095. props,
  6096. children,
  6097. parent,
  6098. Ctor
  6099. ) {
  6100. var this$1 = this;
  6101. var options = Ctor.options;
  6102. // ensure the createElement function in functional components
  6103. // gets a unique context - this is necessary for correct named slot check
  6104. var contextVm;
  6105. if (hasOwn(parent, '_uid')) {
  6106. contextVm = Object.create(parent);
  6107. // $flow-disable-line
  6108. contextVm._original = parent;
  6109. } else {
  6110. // the context vm passed in is a functional context as well.
  6111. // in this case we want to make sure we are able to get a hold to the
  6112. // real context instance.
  6113. contextVm = parent;
  6114. // $flow-disable-line
  6115. parent = parent._original;
  6116. }
  6117. var isCompiled = isTrue(options._compiled);
  6118. var needNormalization = !isCompiled;
  6119. this.data = data;
  6120. this.props = props;
  6121. this.children = children;
  6122. this.parent = parent;
  6123. this.listeners = data.on || emptyObject;
  6124. this.injections = resolveInject(options.inject, parent);
  6125. this.slots = function () {
  6126. if (!this$1.$slots) {
  6127. normalizeScopedSlots(
  6128. data.scopedSlots,
  6129. this$1.$slots = resolveSlots(children, parent)
  6130. );
  6131. }
  6132. return this$1.$slots
  6133. };
  6134. Object.defineProperty(this, 'scopedSlots', ({
  6135. enumerable: true,
  6136. get: function get () {
  6137. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6138. }
  6139. }));
  6140. // support for compiled functional template
  6141. if (isCompiled) {
  6142. // exposing $options for renderStatic()
  6143. this.$options = options;
  6144. // pre-resolve slots for renderSlot()
  6145. this.$slots = this.slots();
  6146. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6147. }
  6148. if (options._scopeId) {
  6149. this._c = function (a, b, c, d) {
  6150. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6151. if (vnode && !Array.isArray(vnode)) {
  6152. vnode.fnScopeId = options._scopeId;
  6153. vnode.fnContext = parent;
  6154. }
  6155. return vnode
  6156. };
  6157. } else {
  6158. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6159. }
  6160. }
  6161. installRenderHelpers(FunctionalRenderContext.prototype);
  6162. function createFunctionalComponent (
  6163. Ctor,
  6164. propsData,
  6165. data,
  6166. contextVm,
  6167. children
  6168. ) {
  6169. var options = Ctor.options;
  6170. var props = {};
  6171. var propOptions = options.props;
  6172. if (isDef(propOptions)) {
  6173. for (var key in propOptions) {
  6174. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6175. }
  6176. } else {
  6177. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6178. if (isDef(data.props)) { mergeProps(props, data.props); }
  6179. }
  6180. var renderContext = new FunctionalRenderContext(
  6181. data,
  6182. props,
  6183. children,
  6184. contextVm,
  6185. Ctor
  6186. );
  6187. var vnode = options.render.call(null, renderContext._c, renderContext);
  6188. if (vnode instanceof VNode) {
  6189. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6190. } else if (Array.isArray(vnode)) {
  6191. var vnodes = normalizeChildren(vnode) || [];
  6192. var res = new Array(vnodes.length);
  6193. for (var i = 0; i < vnodes.length; i++) {
  6194. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6195. }
  6196. return res
  6197. }
  6198. }
  6199. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6200. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6201. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6202. // that should not be matched to match.
  6203. var clone = cloneVNode(vnode);
  6204. clone.fnContext = contextVm;
  6205. clone.fnOptions = options;
  6206. if (true) {
  6207. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6208. }
  6209. if (data.slot) {
  6210. (clone.data || (clone.data = {})).slot = data.slot;
  6211. }
  6212. return clone
  6213. }
  6214. function mergeProps (to, from) {
  6215. for (var key in from) {
  6216. to[camelize(key)] = from[key];
  6217. }
  6218. }
  6219. /* */
  6220. /* */
  6221. /* */
  6222. /* */
  6223. // inline hooks to be invoked on component VNodes during patch
  6224. var componentVNodeHooks = {
  6225. init: function init (vnode, hydrating) {
  6226. if (
  6227. vnode.componentInstance &&
  6228. !vnode.componentInstance._isDestroyed &&
  6229. vnode.data.keepAlive
  6230. ) {
  6231. // kept-alive components, treat as a patch
  6232. var mountedNode = vnode; // work around flow
  6233. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6234. } else {
  6235. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6236. vnode,
  6237. activeInstance
  6238. );
  6239. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6240. }
  6241. },
  6242. prepatch: function prepatch (oldVnode, vnode) {
  6243. var options = vnode.componentOptions;
  6244. var child = vnode.componentInstance = oldVnode.componentInstance;
  6245. updateChildComponent(
  6246. child,
  6247. options.propsData, // updated props
  6248. options.listeners, // updated listeners
  6249. vnode, // new parent vnode
  6250. options.children // new children
  6251. );
  6252. },
  6253. insert: function insert (vnode) {
  6254. var context = vnode.context;
  6255. var componentInstance = vnode.componentInstance;
  6256. if (!componentInstance._isMounted) {
  6257. callHook(componentInstance, 'onServiceCreated');
  6258. callHook(componentInstance, 'onServiceAttached');
  6259. componentInstance._isMounted = true;
  6260. callHook(componentInstance, 'mounted');
  6261. }
  6262. if (vnode.data.keepAlive) {
  6263. if (context._isMounted) {
  6264. // vue-router#1212
  6265. // During updates, a kept-alive component's child components may
  6266. // change, so directly walking the tree here may call activated hooks
  6267. // on incorrect children. Instead we push them into a queue which will
  6268. // be processed after the whole patch process ended.
  6269. queueActivatedComponent(componentInstance);
  6270. } else {
  6271. activateChildComponent(componentInstance, true /* direct */);
  6272. }
  6273. }
  6274. },
  6275. destroy: function destroy (vnode) {
  6276. var componentInstance = vnode.componentInstance;
  6277. if (!componentInstance._isDestroyed) {
  6278. if (!vnode.data.keepAlive) {
  6279. componentInstance.$destroy();
  6280. } else {
  6281. deactivateChildComponent(componentInstance, true /* direct */);
  6282. }
  6283. }
  6284. }
  6285. };
  6286. var hooksToMerge = Object.keys(componentVNodeHooks);
  6287. function createComponent (
  6288. Ctor,
  6289. data,
  6290. context,
  6291. children,
  6292. tag
  6293. ) {
  6294. if (isUndef(Ctor)) {
  6295. return
  6296. }
  6297. var baseCtor = context.$options._base;
  6298. // plain options object: turn it into a constructor
  6299. if (isObject(Ctor)) {
  6300. Ctor = baseCtor.extend(Ctor);
  6301. }
  6302. // if at this stage it's not a constructor or an async component factory,
  6303. // reject.
  6304. if (typeof Ctor !== 'function') {
  6305. if (true) {
  6306. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6307. }
  6308. return
  6309. }
  6310. // async component
  6311. var asyncFactory;
  6312. if (isUndef(Ctor.cid)) {
  6313. asyncFactory = Ctor;
  6314. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6315. if (Ctor === undefined) {
  6316. // return a placeholder node for async component, which is rendered
  6317. // as a comment node but preserves all the raw information for the node.
  6318. // the information will be used for async server-rendering and hydration.
  6319. return createAsyncPlaceholder(
  6320. asyncFactory,
  6321. data,
  6322. context,
  6323. children,
  6324. tag
  6325. )
  6326. }
  6327. }
  6328. data = data || {};
  6329. // resolve constructor options in case global mixins are applied after
  6330. // component constructor creation
  6331. resolveConstructorOptions(Ctor);
  6332. // transform component v-model data into props & events
  6333. if (isDef(data.model)) {
  6334. transformModel(Ctor.options, data);
  6335. }
  6336. // extract props
  6337. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6338. // functional component
  6339. if (isTrue(Ctor.options.functional)) {
  6340. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6341. }
  6342. // extract listeners, since these needs to be treated as
  6343. // child component listeners instead of DOM listeners
  6344. var listeners = data.on;
  6345. // replace with listeners with .native modifier
  6346. // so it gets processed during parent component patch.
  6347. data.on = data.nativeOn;
  6348. if (isTrue(Ctor.options.abstract)) {
  6349. // abstract components do not keep anything
  6350. // other than props & listeners & slot
  6351. // work around flow
  6352. var slot = data.slot;
  6353. data = {};
  6354. if (slot) {
  6355. data.slot = slot;
  6356. }
  6357. }
  6358. // install component management hooks onto the placeholder node
  6359. installComponentHooks(data);
  6360. // return a placeholder vnode
  6361. var name = Ctor.options.name || tag;
  6362. var vnode = new VNode(
  6363. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6364. data, undefined, undefined, undefined, context,
  6365. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6366. asyncFactory
  6367. );
  6368. return vnode
  6369. }
  6370. function createComponentInstanceForVnode (
  6371. vnode, // we know it's MountedComponentVNode but flow doesn't
  6372. parent // activeInstance in lifecycle state
  6373. ) {
  6374. var options = {
  6375. _isComponent: true,
  6376. _parentVnode: vnode,
  6377. parent: parent
  6378. };
  6379. // check inline-template render functions
  6380. var inlineTemplate = vnode.data.inlineTemplate;
  6381. if (isDef(inlineTemplate)) {
  6382. options.render = inlineTemplate.render;
  6383. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6384. }
  6385. return new vnode.componentOptions.Ctor(options)
  6386. }
  6387. function installComponentHooks (data) {
  6388. var hooks = data.hook || (data.hook = {});
  6389. for (var i = 0; i < hooksToMerge.length; i++) {
  6390. var key = hooksToMerge[i];
  6391. var existing = hooks[key];
  6392. var toMerge = componentVNodeHooks[key];
  6393. if (existing !== toMerge && !(existing && existing._merged)) {
  6394. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6395. }
  6396. }
  6397. }
  6398. function mergeHook$1 (f1, f2) {
  6399. var merged = function (a, b) {
  6400. // flow complains about extra args which is why we use any
  6401. f1(a, b);
  6402. f2(a, b);
  6403. };
  6404. merged._merged = true;
  6405. return merged
  6406. }
  6407. // transform component v-model info (value and callback) into
  6408. // prop and event handler respectively.
  6409. function transformModel (options, data) {
  6410. var prop = (options.model && options.model.prop) || 'value';
  6411. var event = (options.model && options.model.event) || 'input'
  6412. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6413. var on = data.on || (data.on = {});
  6414. var existing = on[event];
  6415. var callback = data.model.callback;
  6416. if (isDef(existing)) {
  6417. if (
  6418. Array.isArray(existing)
  6419. ? existing.indexOf(callback) === -1
  6420. : existing !== callback
  6421. ) {
  6422. on[event] = [callback].concat(existing);
  6423. }
  6424. } else {
  6425. on[event] = callback;
  6426. }
  6427. }
  6428. /* */
  6429. var SIMPLE_NORMALIZE = 1;
  6430. var ALWAYS_NORMALIZE = 2;
  6431. // wrapper function for providing a more flexible interface
  6432. // without getting yelled at by flow
  6433. function createElement (
  6434. context,
  6435. tag,
  6436. data,
  6437. children,
  6438. normalizationType,
  6439. alwaysNormalize
  6440. ) {
  6441. if (Array.isArray(data) || isPrimitive(data)) {
  6442. normalizationType = children;
  6443. children = data;
  6444. data = undefined;
  6445. }
  6446. if (isTrue(alwaysNormalize)) {
  6447. normalizationType = ALWAYS_NORMALIZE;
  6448. }
  6449. return _createElement(context, tag, data, children, normalizationType)
  6450. }
  6451. function _createElement (
  6452. context,
  6453. tag,
  6454. data,
  6455. children,
  6456. normalizationType
  6457. ) {
  6458. if (isDef(data) && isDef((data).__ob__)) {
  6459. true && warn(
  6460. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6461. 'Always create fresh vnode data objects in each render!',
  6462. context
  6463. );
  6464. return createEmptyVNode()
  6465. }
  6466. // object syntax in v-bind
  6467. if (isDef(data) && isDef(data.is)) {
  6468. tag = data.is;
  6469. }
  6470. if (!tag) {
  6471. // in case of component :is set to falsy value
  6472. return createEmptyVNode()
  6473. }
  6474. // warn against non-primitive key
  6475. if ( true &&
  6476. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6477. ) {
  6478. {
  6479. warn(
  6480. 'Avoid using non-primitive value as key, ' +
  6481. 'use string/number value instead.',
  6482. context
  6483. );
  6484. }
  6485. }
  6486. // support single function children as default scoped slot
  6487. if (Array.isArray(children) &&
  6488. typeof children[0] === 'function'
  6489. ) {
  6490. data = data || {};
  6491. data.scopedSlots = { default: children[0] };
  6492. children.length = 0;
  6493. }
  6494. if (normalizationType === ALWAYS_NORMALIZE) {
  6495. children = normalizeChildren(children);
  6496. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6497. children = simpleNormalizeChildren(children);
  6498. }
  6499. var vnode, ns;
  6500. if (typeof tag === 'string') {
  6501. var Ctor;
  6502. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6503. if (config.isReservedTag(tag)) {
  6504. // platform built-in elements
  6505. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6506. warn(
  6507. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6508. context
  6509. );
  6510. }
  6511. vnode = new VNode(
  6512. config.parsePlatformTagName(tag), data, children,
  6513. undefined, undefined, context
  6514. );
  6515. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6516. // component
  6517. vnode = createComponent(Ctor, data, context, children, tag);
  6518. } else {
  6519. // unknown or unlisted namespaced elements
  6520. // check at runtime because it may get assigned a namespace when its
  6521. // parent normalizes children
  6522. vnode = new VNode(
  6523. tag, data, children,
  6524. undefined, undefined, context
  6525. );
  6526. }
  6527. } else {
  6528. // direct component options / constructor
  6529. vnode = createComponent(tag, data, context, children);
  6530. }
  6531. if (Array.isArray(vnode)) {
  6532. return vnode
  6533. } else if (isDef(vnode)) {
  6534. if (isDef(ns)) { applyNS(vnode, ns); }
  6535. if (isDef(data)) { registerDeepBindings(data); }
  6536. return vnode
  6537. } else {
  6538. return createEmptyVNode()
  6539. }
  6540. }
  6541. function applyNS (vnode, ns, force) {
  6542. vnode.ns = ns;
  6543. if (vnode.tag === 'foreignObject') {
  6544. // use default namespace inside foreignObject
  6545. ns = undefined;
  6546. force = true;
  6547. }
  6548. if (isDef(vnode.children)) {
  6549. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6550. var child = vnode.children[i];
  6551. if (isDef(child.tag) && (
  6552. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6553. applyNS(child, ns, force);
  6554. }
  6555. }
  6556. }
  6557. }
  6558. // ref #5318
  6559. // necessary to ensure parent re-render when deep bindings like :style and
  6560. // :class are used on slot nodes
  6561. function registerDeepBindings (data) {
  6562. if (isObject(data.style)) {
  6563. traverse(data.style);
  6564. }
  6565. if (isObject(data.class)) {
  6566. traverse(data.class);
  6567. }
  6568. }
  6569. /* */
  6570. function initRender (vm) {
  6571. vm._vnode = null; // the root of the child tree
  6572. vm._staticTrees = null; // v-once cached trees
  6573. var options = vm.$options;
  6574. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6575. var renderContext = parentVnode && parentVnode.context;
  6576. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6577. vm.$scopedSlots = emptyObject;
  6578. // bind the createElement fn to this instance
  6579. // so that we get proper render context inside it.
  6580. // args order: tag, data, children, normalizationType, alwaysNormalize
  6581. // internal version is used by render functions compiled from templates
  6582. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6583. // normalization is always applied for the public version, used in
  6584. // user-written render functions.
  6585. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6586. // $attrs & $listeners are exposed for easier HOC creation.
  6587. // they need to be reactive so that HOCs using them are always updated
  6588. var parentData = parentVnode && parentVnode.data;
  6589. /* istanbul ignore else */
  6590. if (true) {
  6591. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6592. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6593. }, true);
  6594. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6595. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6596. }, true);
  6597. } else {}
  6598. }
  6599. var currentRenderingInstance = null;
  6600. function renderMixin (Vue) {
  6601. // install runtime convenience helpers
  6602. installRenderHelpers(Vue.prototype);
  6603. Vue.prototype.$nextTick = function (fn) {
  6604. return nextTick(fn, this)
  6605. };
  6606. Vue.prototype._render = function () {
  6607. var vm = this;
  6608. var ref = vm.$options;
  6609. var render = ref.render;
  6610. var _parentVnode = ref._parentVnode;
  6611. if (_parentVnode) {
  6612. vm.$scopedSlots = normalizeScopedSlots(
  6613. _parentVnode.data.scopedSlots,
  6614. vm.$slots,
  6615. vm.$scopedSlots
  6616. );
  6617. }
  6618. // set parent vnode. this allows render functions to have access
  6619. // to the data on the placeholder node.
  6620. vm.$vnode = _parentVnode;
  6621. // render self
  6622. var vnode;
  6623. try {
  6624. // There's no need to maintain a stack because all render fns are called
  6625. // separately from one another. Nested component's render fns are called
  6626. // when parent component is patched.
  6627. currentRenderingInstance = vm;
  6628. vnode = render.call(vm._renderProxy, vm.$createElement);
  6629. } catch (e) {
  6630. handleError(e, vm, "render");
  6631. // return error render result,
  6632. // or previous vnode to prevent render error causing blank component
  6633. /* istanbul ignore else */
  6634. if ( true && vm.$options.renderError) {
  6635. try {
  6636. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6637. } catch (e) {
  6638. handleError(e, vm, "renderError");
  6639. vnode = vm._vnode;
  6640. }
  6641. } else {
  6642. vnode = vm._vnode;
  6643. }
  6644. } finally {
  6645. currentRenderingInstance = null;
  6646. }
  6647. // if the returned array contains only a single node, allow it
  6648. if (Array.isArray(vnode) && vnode.length === 1) {
  6649. vnode = vnode[0];
  6650. }
  6651. // return empty vnode in case the render function errored out
  6652. if (!(vnode instanceof VNode)) {
  6653. if ( true && Array.isArray(vnode)) {
  6654. warn(
  6655. 'Multiple root nodes returned from render function. Render function ' +
  6656. 'should return a single root node.',
  6657. vm
  6658. );
  6659. }
  6660. vnode = createEmptyVNode();
  6661. }
  6662. // set parent
  6663. vnode.parent = _parentVnode;
  6664. return vnode
  6665. };
  6666. }
  6667. /* */
  6668. function ensureCtor (comp, base) {
  6669. if (
  6670. comp.__esModule ||
  6671. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6672. ) {
  6673. comp = comp.default;
  6674. }
  6675. return isObject(comp)
  6676. ? base.extend(comp)
  6677. : comp
  6678. }
  6679. function createAsyncPlaceholder (
  6680. factory,
  6681. data,
  6682. context,
  6683. children,
  6684. tag
  6685. ) {
  6686. var node = createEmptyVNode();
  6687. node.asyncFactory = factory;
  6688. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6689. return node
  6690. }
  6691. function resolveAsyncComponent (
  6692. factory,
  6693. baseCtor
  6694. ) {
  6695. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6696. return factory.errorComp
  6697. }
  6698. if (isDef(factory.resolved)) {
  6699. return factory.resolved
  6700. }
  6701. var owner = currentRenderingInstance;
  6702. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6703. // already pending
  6704. factory.owners.push(owner);
  6705. }
  6706. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6707. return factory.loadingComp
  6708. }
  6709. if (owner && !isDef(factory.owners)) {
  6710. var owners = factory.owners = [owner];
  6711. var sync = true;
  6712. var timerLoading = null;
  6713. var timerTimeout = null
  6714. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6715. var forceRender = function (renderCompleted) {
  6716. for (var i = 0, l = owners.length; i < l; i++) {
  6717. (owners[i]).$forceUpdate();
  6718. }
  6719. if (renderCompleted) {
  6720. owners.length = 0;
  6721. if (timerLoading !== null) {
  6722. clearTimeout(timerLoading);
  6723. timerLoading = null;
  6724. }
  6725. if (timerTimeout !== null) {
  6726. clearTimeout(timerTimeout);
  6727. timerTimeout = null;
  6728. }
  6729. }
  6730. };
  6731. var resolve = once(function (res) {
  6732. // cache resolved
  6733. factory.resolved = ensureCtor(res, baseCtor);
  6734. // invoke callbacks only if this is not a synchronous resolve
  6735. // (async resolves are shimmed as synchronous during SSR)
  6736. if (!sync) {
  6737. forceRender(true);
  6738. } else {
  6739. owners.length = 0;
  6740. }
  6741. });
  6742. var reject = once(function (reason) {
  6743. true && warn(
  6744. "Failed to resolve async component: " + (String(factory)) +
  6745. (reason ? ("\nReason: " + reason) : '')
  6746. );
  6747. if (isDef(factory.errorComp)) {
  6748. factory.error = true;
  6749. forceRender(true);
  6750. }
  6751. });
  6752. var res = factory(resolve, reject);
  6753. if (isObject(res)) {
  6754. if (isPromise(res)) {
  6755. // () => Promise
  6756. if (isUndef(factory.resolved)) {
  6757. res.then(resolve, reject);
  6758. }
  6759. } else if (isPromise(res.component)) {
  6760. res.component.then(resolve, reject);
  6761. if (isDef(res.error)) {
  6762. factory.errorComp = ensureCtor(res.error, baseCtor);
  6763. }
  6764. if (isDef(res.loading)) {
  6765. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6766. if (res.delay === 0) {
  6767. factory.loading = true;
  6768. } else {
  6769. timerLoading = setTimeout(function () {
  6770. timerLoading = null;
  6771. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6772. factory.loading = true;
  6773. forceRender(false);
  6774. }
  6775. }, res.delay || 200);
  6776. }
  6777. }
  6778. if (isDef(res.timeout)) {
  6779. timerTimeout = setTimeout(function () {
  6780. timerTimeout = null;
  6781. if (isUndef(factory.resolved)) {
  6782. reject(
  6783. true
  6784. ? ("timeout (" + (res.timeout) + "ms)")
  6785. : undefined
  6786. );
  6787. }
  6788. }, res.timeout);
  6789. }
  6790. }
  6791. }
  6792. sync = false;
  6793. // return in case resolved synchronously
  6794. return factory.loading
  6795. ? factory.loadingComp
  6796. : factory.resolved
  6797. }
  6798. }
  6799. /* */
  6800. function isAsyncPlaceholder (node) {
  6801. return node.isComment && node.asyncFactory
  6802. }
  6803. /* */
  6804. function getFirstComponentChild (children) {
  6805. if (Array.isArray(children)) {
  6806. for (var i = 0; i < children.length; i++) {
  6807. var c = children[i];
  6808. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6809. return c
  6810. }
  6811. }
  6812. }
  6813. }
  6814. /* */
  6815. /* */
  6816. function initEvents (vm) {
  6817. vm._events = Object.create(null);
  6818. vm._hasHookEvent = false;
  6819. // init parent attached events
  6820. var listeners = vm.$options._parentListeners;
  6821. if (listeners) {
  6822. updateComponentListeners(vm, listeners);
  6823. }
  6824. }
  6825. var target;
  6826. function add (event, fn) {
  6827. target.$on(event, fn);
  6828. }
  6829. function remove$1 (event, fn) {
  6830. target.$off(event, fn);
  6831. }
  6832. function createOnceHandler (event, fn) {
  6833. var _target = target;
  6834. return function onceHandler () {
  6835. var res = fn.apply(null, arguments);
  6836. if (res !== null) {
  6837. _target.$off(event, onceHandler);
  6838. }
  6839. }
  6840. }
  6841. function updateComponentListeners (
  6842. vm,
  6843. listeners,
  6844. oldListeners
  6845. ) {
  6846. target = vm;
  6847. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6848. target = undefined;
  6849. }
  6850. function eventsMixin (Vue) {
  6851. var hookRE = /^hook:/;
  6852. Vue.prototype.$on = function (event, fn) {
  6853. var vm = this;
  6854. if (Array.isArray(event)) {
  6855. for (var i = 0, l = event.length; i < l; i++) {
  6856. vm.$on(event[i], fn);
  6857. }
  6858. } else {
  6859. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6860. // optimize hook:event cost by using a boolean flag marked at registration
  6861. // instead of a hash lookup
  6862. if (hookRE.test(event)) {
  6863. vm._hasHookEvent = true;
  6864. }
  6865. }
  6866. return vm
  6867. };
  6868. Vue.prototype.$once = function (event, fn) {
  6869. var vm = this;
  6870. function on () {
  6871. vm.$off(event, on);
  6872. fn.apply(vm, arguments);
  6873. }
  6874. on.fn = fn;
  6875. vm.$on(event, on);
  6876. return vm
  6877. };
  6878. Vue.prototype.$off = function (event, fn) {
  6879. var vm = this;
  6880. // all
  6881. if (!arguments.length) {
  6882. vm._events = Object.create(null);
  6883. return vm
  6884. }
  6885. // array of events
  6886. if (Array.isArray(event)) {
  6887. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6888. vm.$off(event[i$1], fn);
  6889. }
  6890. return vm
  6891. }
  6892. // specific event
  6893. var cbs = vm._events[event];
  6894. if (!cbs) {
  6895. return vm
  6896. }
  6897. if (!fn) {
  6898. vm._events[event] = null;
  6899. return vm
  6900. }
  6901. // specific handler
  6902. var cb;
  6903. var i = cbs.length;
  6904. while (i--) {
  6905. cb = cbs[i];
  6906. if (cb === fn || cb.fn === fn) {
  6907. cbs.splice(i, 1);
  6908. break
  6909. }
  6910. }
  6911. return vm
  6912. };
  6913. Vue.prototype.$emit = function (event) {
  6914. var vm = this;
  6915. if (true) {
  6916. var lowerCaseEvent = event.toLowerCase();
  6917. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6918. tip(
  6919. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6920. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6921. "Note that HTML attributes are case-insensitive and you cannot use " +
  6922. "v-on to listen to camelCase events when using in-DOM templates. " +
  6923. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6924. );
  6925. }
  6926. }
  6927. var cbs = vm._events[event];
  6928. if (cbs) {
  6929. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6930. var args = toArray(arguments, 1);
  6931. var info = "event handler for \"" + event + "\"";
  6932. for (var i = 0, l = cbs.length; i < l; i++) {
  6933. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6934. }
  6935. }
  6936. return vm
  6937. };
  6938. }
  6939. /* */
  6940. var activeInstance = null;
  6941. var isUpdatingChildComponent = false;
  6942. function setActiveInstance(vm) {
  6943. var prevActiveInstance = activeInstance;
  6944. activeInstance = vm;
  6945. return function () {
  6946. activeInstance = prevActiveInstance;
  6947. }
  6948. }
  6949. function initLifecycle (vm) {
  6950. var options = vm.$options;
  6951. // locate first non-abstract parent
  6952. var parent = options.parent;
  6953. if (parent && !options.abstract) {
  6954. while (parent.$options.abstract && parent.$parent) {
  6955. parent = parent.$parent;
  6956. }
  6957. parent.$children.push(vm);
  6958. }
  6959. vm.$parent = parent;
  6960. vm.$root = parent ? parent.$root : vm;
  6961. vm.$children = [];
  6962. vm.$refs = {};
  6963. vm._watcher = null;
  6964. vm._inactive = null;
  6965. vm._directInactive = false;
  6966. vm._isMounted = false;
  6967. vm._isDestroyed = false;
  6968. vm._isBeingDestroyed = false;
  6969. }
  6970. function lifecycleMixin (Vue) {
  6971. Vue.prototype._update = function (vnode, hydrating) {
  6972. var vm = this;
  6973. var prevEl = vm.$el;
  6974. var prevVnode = vm._vnode;
  6975. var restoreActiveInstance = setActiveInstance(vm);
  6976. vm._vnode = vnode;
  6977. // Vue.prototype.__patch__ is injected in entry points
  6978. // based on the rendering backend used.
  6979. if (!prevVnode) {
  6980. // initial render
  6981. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6982. } else {
  6983. // updates
  6984. vm.$el = vm.__patch__(prevVnode, vnode);
  6985. }
  6986. restoreActiveInstance();
  6987. // update __vue__ reference
  6988. if (prevEl) {
  6989. prevEl.__vue__ = null;
  6990. }
  6991. if (vm.$el) {
  6992. vm.$el.__vue__ = vm;
  6993. }
  6994. // if parent is an HOC, update its $el as well
  6995. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6996. vm.$parent.$el = vm.$el;
  6997. }
  6998. // updated hook is called by the scheduler to ensure that children are
  6999. // updated in a parent's updated hook.
  7000. };
  7001. Vue.prototype.$forceUpdate = function () {
  7002. var vm = this;
  7003. if (vm._watcher) {
  7004. vm._watcher.update();
  7005. }
  7006. };
  7007. Vue.prototype.$destroy = function () {
  7008. var vm = this;
  7009. if (vm._isBeingDestroyed) {
  7010. return
  7011. }
  7012. callHook(vm, 'beforeDestroy');
  7013. vm._isBeingDestroyed = true;
  7014. // remove self from parent
  7015. var parent = vm.$parent;
  7016. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7017. remove(parent.$children, vm);
  7018. }
  7019. // teardown watchers
  7020. if (vm._watcher) {
  7021. vm._watcher.teardown();
  7022. }
  7023. var i = vm._watchers.length;
  7024. while (i--) {
  7025. vm._watchers[i].teardown();
  7026. }
  7027. // remove reference from data ob
  7028. // frozen object may not have observer.
  7029. if (vm._data.__ob__) {
  7030. vm._data.__ob__.vmCount--;
  7031. }
  7032. // call the last hook...
  7033. vm._isDestroyed = true;
  7034. // invoke destroy hooks on current rendered tree
  7035. vm.__patch__(vm._vnode, null);
  7036. // fire destroyed hook
  7037. callHook(vm, 'destroyed');
  7038. // turn off all instance listeners.
  7039. vm.$off();
  7040. // remove __vue__ reference
  7041. if (vm.$el) {
  7042. vm.$el.__vue__ = null;
  7043. }
  7044. // release circular reference (#6759)
  7045. if (vm.$vnode) {
  7046. vm.$vnode.parent = null;
  7047. }
  7048. };
  7049. }
  7050. function updateChildComponent (
  7051. vm,
  7052. propsData,
  7053. listeners,
  7054. parentVnode,
  7055. renderChildren
  7056. ) {
  7057. if (true) {
  7058. isUpdatingChildComponent = true;
  7059. }
  7060. // determine whether component has slot children
  7061. // we need to do this before overwriting $options._renderChildren.
  7062. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7063. // dynamic slot names). Static scoped slots compiled from template has the
  7064. // "$stable" marker.
  7065. var newScopedSlots = parentVnode.data.scopedSlots;
  7066. var oldScopedSlots = vm.$scopedSlots;
  7067. var hasDynamicScopedSlot = !!(
  7068. (newScopedSlots && !newScopedSlots.$stable) ||
  7069. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7070. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7071. );
  7072. // Any static slot children from the parent may have changed during parent's
  7073. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7074. // update is necessary to ensure correctness.
  7075. var needsForceUpdate = !!(
  7076. renderChildren || // has new static slots
  7077. vm.$options._renderChildren || // has old static slots
  7078. hasDynamicScopedSlot
  7079. );
  7080. vm.$options._parentVnode = parentVnode;
  7081. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7082. if (vm._vnode) { // update child tree's parent
  7083. vm._vnode.parent = parentVnode;
  7084. }
  7085. vm.$options._renderChildren = renderChildren;
  7086. // update $attrs and $listeners hash
  7087. // these are also reactive so they may trigger child update if the child
  7088. // used them during render
  7089. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7090. vm.$listeners = listeners || emptyObject;
  7091. // update props
  7092. if (propsData && vm.$options.props) {
  7093. toggleObserving(false);
  7094. var props = vm._props;
  7095. var propKeys = vm.$options._propKeys || [];
  7096. for (var i = 0; i < propKeys.length; i++) {
  7097. var key = propKeys[i];
  7098. var propOptions = vm.$options.props; // wtf flow?
  7099. props[key] = validateProp(key, propOptions, propsData, vm);
  7100. }
  7101. toggleObserving(true);
  7102. // keep a copy of raw propsData
  7103. vm.$options.propsData = propsData;
  7104. }
  7105. // fixed by xxxxxx update properties(mp runtime)
  7106. vm._$updateProperties && vm._$updateProperties(vm);
  7107. // update listeners
  7108. listeners = listeners || emptyObject;
  7109. var oldListeners = vm.$options._parentListeners;
  7110. vm.$options._parentListeners = listeners;
  7111. updateComponentListeners(vm, listeners, oldListeners);
  7112. // resolve slots + force update if has children
  7113. if (needsForceUpdate) {
  7114. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7115. vm.$forceUpdate();
  7116. }
  7117. if (true) {
  7118. isUpdatingChildComponent = false;
  7119. }
  7120. }
  7121. function isInInactiveTree (vm) {
  7122. while (vm && (vm = vm.$parent)) {
  7123. if (vm._inactive) { return true }
  7124. }
  7125. return false
  7126. }
  7127. function activateChildComponent (vm, direct) {
  7128. if (direct) {
  7129. vm._directInactive = false;
  7130. if (isInInactiveTree(vm)) {
  7131. return
  7132. }
  7133. } else if (vm._directInactive) {
  7134. return
  7135. }
  7136. if (vm._inactive || vm._inactive === null) {
  7137. vm._inactive = false;
  7138. for (var i = 0; i < vm.$children.length; i++) {
  7139. activateChildComponent(vm.$children[i]);
  7140. }
  7141. callHook(vm, 'activated');
  7142. }
  7143. }
  7144. function deactivateChildComponent (vm, direct) {
  7145. if (direct) {
  7146. vm._directInactive = true;
  7147. if (isInInactiveTree(vm)) {
  7148. return
  7149. }
  7150. }
  7151. if (!vm._inactive) {
  7152. vm._inactive = true;
  7153. for (var i = 0; i < vm.$children.length; i++) {
  7154. deactivateChildComponent(vm.$children[i]);
  7155. }
  7156. callHook(vm, 'deactivated');
  7157. }
  7158. }
  7159. function callHook (vm, hook) {
  7160. // #7573 disable dep collection when invoking lifecycle hooks
  7161. pushTarget();
  7162. var handlers = vm.$options[hook];
  7163. var info = hook + " hook";
  7164. if (handlers) {
  7165. for (var i = 0, j = handlers.length; i < j; i++) {
  7166. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7167. }
  7168. }
  7169. if (vm._hasHookEvent) {
  7170. vm.$emit('hook:' + hook);
  7171. }
  7172. popTarget();
  7173. }
  7174. /* */
  7175. var MAX_UPDATE_COUNT = 100;
  7176. var queue = [];
  7177. var activatedChildren = [];
  7178. var has = {};
  7179. var circular = {};
  7180. var waiting = false;
  7181. var flushing = false;
  7182. var index = 0;
  7183. /**
  7184. * Reset the scheduler's state.
  7185. */
  7186. function resetSchedulerState () {
  7187. index = queue.length = activatedChildren.length = 0;
  7188. has = {};
  7189. if (true) {
  7190. circular = {};
  7191. }
  7192. waiting = flushing = false;
  7193. }
  7194. // Async edge case #6566 requires saving the timestamp when event listeners are
  7195. // attached. However, calling performance.now() has a perf overhead especially
  7196. // if the page has thousands of event listeners. Instead, we take a timestamp
  7197. // every time the scheduler flushes and use that for all event listeners
  7198. // attached during that flush.
  7199. var currentFlushTimestamp = 0;
  7200. // Async edge case fix requires storing an event listener's attach timestamp.
  7201. var getNow = Date.now;
  7202. // Determine what event timestamp the browser is using. Annoyingly, the
  7203. // timestamp can either be hi-res (relative to page load) or low-res
  7204. // (relative to UNIX epoch), so in order to compare time we have to use the
  7205. // same timestamp type when saving the flush timestamp.
  7206. // All IE versions use low-res event timestamps, and have problematic clock
  7207. // implementations (#9632)
  7208. if (inBrowser && !isIE) {
  7209. var performance = window.performance;
  7210. if (
  7211. performance &&
  7212. typeof performance.now === 'function' &&
  7213. getNow() > document.createEvent('Event').timeStamp
  7214. ) {
  7215. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7216. // smaller than it, it means the event is using a hi-res timestamp,
  7217. // and we need to use the hi-res version for event listener timestamps as
  7218. // well.
  7219. getNow = function () { return performance.now(); };
  7220. }
  7221. }
  7222. /**
  7223. * Flush both queues and run the watchers.
  7224. */
  7225. function flushSchedulerQueue () {
  7226. currentFlushTimestamp = getNow();
  7227. flushing = true;
  7228. var watcher, id;
  7229. // Sort queue before flush.
  7230. // This ensures that:
  7231. // 1. Components are updated from parent to child. (because parent is always
  7232. // created before the child)
  7233. // 2. A component's user watchers are run before its render watcher (because
  7234. // user watchers are created before the render watcher)
  7235. // 3. If a component is destroyed during a parent component's watcher run,
  7236. // its watchers can be skipped.
  7237. queue.sort(function (a, b) { return a.id - b.id; });
  7238. // do not cache length because more watchers might be pushed
  7239. // as we run existing watchers
  7240. for (index = 0; index < queue.length; index++) {
  7241. watcher = queue[index];
  7242. if (watcher.before) {
  7243. watcher.before();
  7244. }
  7245. id = watcher.id;
  7246. has[id] = null;
  7247. watcher.run();
  7248. // in dev build, check and stop circular updates.
  7249. if ( true && has[id] != null) {
  7250. circular[id] = (circular[id] || 0) + 1;
  7251. if (circular[id] > MAX_UPDATE_COUNT) {
  7252. warn(
  7253. 'You may have an infinite update loop ' + (
  7254. watcher.user
  7255. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7256. : "in a component render function."
  7257. ),
  7258. watcher.vm
  7259. );
  7260. break
  7261. }
  7262. }
  7263. }
  7264. // keep copies of post queues before resetting state
  7265. var activatedQueue = activatedChildren.slice();
  7266. var updatedQueue = queue.slice();
  7267. resetSchedulerState();
  7268. // call component updated and activated hooks
  7269. callActivatedHooks(activatedQueue);
  7270. callUpdatedHooks(updatedQueue);
  7271. // devtool hook
  7272. /* istanbul ignore if */
  7273. if (devtools && config.devtools) {
  7274. devtools.emit('flush');
  7275. }
  7276. }
  7277. function callUpdatedHooks (queue) {
  7278. var i = queue.length;
  7279. while (i--) {
  7280. var watcher = queue[i];
  7281. var vm = watcher.vm;
  7282. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7283. callHook(vm, 'updated');
  7284. }
  7285. }
  7286. }
  7287. /**
  7288. * Queue a kept-alive component that was activated during patch.
  7289. * The queue will be processed after the entire tree has been patched.
  7290. */
  7291. function queueActivatedComponent (vm) {
  7292. // setting _inactive to false here so that a render function can
  7293. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7294. vm._inactive = false;
  7295. activatedChildren.push(vm);
  7296. }
  7297. function callActivatedHooks (queue) {
  7298. for (var i = 0; i < queue.length; i++) {
  7299. queue[i]._inactive = true;
  7300. activateChildComponent(queue[i], true /* true */);
  7301. }
  7302. }
  7303. /**
  7304. * Push a watcher into the watcher queue.
  7305. * Jobs with duplicate IDs will be skipped unless it's
  7306. * pushed when the queue is being flushed.
  7307. */
  7308. function queueWatcher (watcher) {
  7309. var id = watcher.id;
  7310. if (has[id] == null) {
  7311. has[id] = true;
  7312. if (!flushing) {
  7313. queue.push(watcher);
  7314. } else {
  7315. // if already flushing, splice the watcher based on its id
  7316. // if already past its id, it will be run next immediately.
  7317. var i = queue.length - 1;
  7318. while (i > index && queue[i].id > watcher.id) {
  7319. i--;
  7320. }
  7321. queue.splice(i + 1, 0, watcher);
  7322. }
  7323. // queue the flush
  7324. if (!waiting) {
  7325. waiting = true;
  7326. if ( true && !config.async) {
  7327. flushSchedulerQueue();
  7328. return
  7329. }
  7330. nextTick(flushSchedulerQueue);
  7331. }
  7332. }
  7333. }
  7334. /* */
  7335. var uid$2 = 0;
  7336. /**
  7337. * A watcher parses an expression, collects dependencies,
  7338. * and fires callback when the expression value changes.
  7339. * This is used for both the $watch() api and directives.
  7340. */
  7341. var Watcher = function Watcher (
  7342. vm,
  7343. expOrFn,
  7344. cb,
  7345. options,
  7346. isRenderWatcher
  7347. ) {
  7348. this.vm = vm;
  7349. if (isRenderWatcher) {
  7350. vm._watcher = this;
  7351. }
  7352. vm._watchers.push(this);
  7353. // options
  7354. if (options) {
  7355. this.deep = !!options.deep;
  7356. this.user = !!options.user;
  7357. this.lazy = !!options.lazy;
  7358. this.sync = !!options.sync;
  7359. this.before = options.before;
  7360. } else {
  7361. this.deep = this.user = this.lazy = this.sync = false;
  7362. }
  7363. this.cb = cb;
  7364. this.id = ++uid$2; // uid for batching
  7365. this.active = true;
  7366. this.dirty = this.lazy; // for lazy watchers
  7367. this.deps = [];
  7368. this.newDeps = [];
  7369. this.depIds = new _Set();
  7370. this.newDepIds = new _Set();
  7371. this.expression = true
  7372. ? expOrFn.toString()
  7373. : undefined;
  7374. // parse expression for getter
  7375. if (typeof expOrFn === 'function') {
  7376. this.getter = expOrFn;
  7377. } else {
  7378. this.getter = parsePath(expOrFn);
  7379. if (!this.getter) {
  7380. this.getter = noop;
  7381. true && warn(
  7382. "Failed watching path: \"" + expOrFn + "\" " +
  7383. 'Watcher only accepts simple dot-delimited paths. ' +
  7384. 'For full control, use a function instead.',
  7385. vm
  7386. );
  7387. }
  7388. }
  7389. this.value = this.lazy
  7390. ? undefined
  7391. : this.get();
  7392. };
  7393. /**
  7394. * Evaluate the getter, and re-collect dependencies.
  7395. */
  7396. Watcher.prototype.get = function get () {
  7397. pushTarget(this);
  7398. var value;
  7399. var vm = this.vm;
  7400. try {
  7401. value = this.getter.call(vm, vm);
  7402. } catch (e) {
  7403. if (this.user) {
  7404. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7405. } else {
  7406. throw e
  7407. }
  7408. } finally {
  7409. // "touch" every property so they are all tracked as
  7410. // dependencies for deep watching
  7411. if (this.deep) {
  7412. traverse(value);
  7413. }
  7414. popTarget();
  7415. this.cleanupDeps();
  7416. }
  7417. return value
  7418. };
  7419. /**
  7420. * Add a dependency to this directive.
  7421. */
  7422. Watcher.prototype.addDep = function addDep (dep) {
  7423. var id = dep.id;
  7424. if (!this.newDepIds.has(id)) {
  7425. this.newDepIds.add(id);
  7426. this.newDeps.push(dep);
  7427. if (!this.depIds.has(id)) {
  7428. dep.addSub(this);
  7429. }
  7430. }
  7431. };
  7432. /**
  7433. * Clean up for dependency collection.
  7434. */
  7435. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7436. var i = this.deps.length;
  7437. while (i--) {
  7438. var dep = this.deps[i];
  7439. if (!this.newDepIds.has(dep.id)) {
  7440. dep.removeSub(this);
  7441. }
  7442. }
  7443. var tmp = this.depIds;
  7444. this.depIds = this.newDepIds;
  7445. this.newDepIds = tmp;
  7446. this.newDepIds.clear();
  7447. tmp = this.deps;
  7448. this.deps = this.newDeps;
  7449. this.newDeps = tmp;
  7450. this.newDeps.length = 0;
  7451. };
  7452. /**
  7453. * Subscriber interface.
  7454. * Will be called when a dependency changes.
  7455. */
  7456. Watcher.prototype.update = function update () {
  7457. /* istanbul ignore else */
  7458. if (this.lazy) {
  7459. this.dirty = true;
  7460. } else if (this.sync) {
  7461. this.run();
  7462. } else {
  7463. queueWatcher(this);
  7464. }
  7465. };
  7466. /**
  7467. * Scheduler job interface.
  7468. * Will be called by the scheduler.
  7469. */
  7470. Watcher.prototype.run = function run () {
  7471. if (this.active) {
  7472. var value = this.get();
  7473. if (
  7474. value !== this.value ||
  7475. // Deep watchers and watchers on Object/Arrays should fire even
  7476. // when the value is the same, because the value may
  7477. // have mutated.
  7478. isObject(value) ||
  7479. this.deep
  7480. ) {
  7481. // set new value
  7482. var oldValue = this.value;
  7483. this.value = value;
  7484. if (this.user) {
  7485. try {
  7486. this.cb.call(this.vm, value, oldValue);
  7487. } catch (e) {
  7488. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7489. }
  7490. } else {
  7491. this.cb.call(this.vm, value, oldValue);
  7492. }
  7493. }
  7494. }
  7495. };
  7496. /**
  7497. * Evaluate the value of the watcher.
  7498. * This only gets called for lazy watchers.
  7499. */
  7500. Watcher.prototype.evaluate = function evaluate () {
  7501. this.value = this.get();
  7502. this.dirty = false;
  7503. };
  7504. /**
  7505. * Depend on all deps collected by this watcher.
  7506. */
  7507. Watcher.prototype.depend = function depend () {
  7508. var i = this.deps.length;
  7509. while (i--) {
  7510. this.deps[i].depend();
  7511. }
  7512. };
  7513. /**
  7514. * Remove self from all dependencies' subscriber list.
  7515. */
  7516. Watcher.prototype.teardown = function teardown () {
  7517. if (this.active) {
  7518. // remove self from vm's watcher list
  7519. // this is a somewhat expensive operation so we skip it
  7520. // if the vm is being destroyed.
  7521. if (!this.vm._isBeingDestroyed) {
  7522. remove(this.vm._watchers, this);
  7523. }
  7524. var i = this.deps.length;
  7525. while (i--) {
  7526. this.deps[i].removeSub(this);
  7527. }
  7528. this.active = false;
  7529. }
  7530. };
  7531. /* */
  7532. var sharedPropertyDefinition = {
  7533. enumerable: true,
  7534. configurable: true,
  7535. get: noop,
  7536. set: noop
  7537. };
  7538. function proxy (target, sourceKey, key) {
  7539. sharedPropertyDefinition.get = function proxyGetter () {
  7540. return this[sourceKey][key]
  7541. };
  7542. sharedPropertyDefinition.set = function proxySetter (val) {
  7543. this[sourceKey][key] = val;
  7544. };
  7545. Object.defineProperty(target, key, sharedPropertyDefinition);
  7546. }
  7547. function initState (vm) {
  7548. vm._watchers = [];
  7549. var opts = vm.$options;
  7550. if (opts.props) { initProps(vm, opts.props); }
  7551. if (opts.methods) { initMethods(vm, opts.methods); }
  7552. if (opts.data) {
  7553. initData(vm);
  7554. } else {
  7555. observe(vm._data = {}, true /* asRootData */);
  7556. }
  7557. if (opts.computed) { initComputed(vm, opts.computed); }
  7558. if (opts.watch && opts.watch !== nativeWatch) {
  7559. initWatch(vm, opts.watch);
  7560. }
  7561. }
  7562. function initProps (vm, propsOptions) {
  7563. var propsData = vm.$options.propsData || {};
  7564. var props = vm._props = {};
  7565. // cache prop keys so that future props updates can iterate using Array
  7566. // instead of dynamic object key enumeration.
  7567. var keys = vm.$options._propKeys = [];
  7568. var isRoot = !vm.$parent;
  7569. // root instance props should be converted
  7570. if (!isRoot) {
  7571. toggleObserving(false);
  7572. }
  7573. var loop = function ( key ) {
  7574. keys.push(key);
  7575. var value = validateProp(key, propsOptions, propsData, vm);
  7576. /* istanbul ignore else */
  7577. if (true) {
  7578. var hyphenatedKey = hyphenate(key);
  7579. if (isReservedAttribute(hyphenatedKey) ||
  7580. config.isReservedAttr(hyphenatedKey)) {
  7581. warn(
  7582. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7583. vm
  7584. );
  7585. }
  7586. defineReactive$$1(props, key, value, function () {
  7587. if (!isRoot && !isUpdatingChildComponent) {
  7588. {
  7589. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7590. return
  7591. }
  7592. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7593. if(
  7594. key === 'value' &&
  7595. Array.isArray(vm.$options.behaviors) &&
  7596. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7597. ){
  7598. return
  7599. }
  7600. if(vm._getFormData){
  7601. return
  7602. }
  7603. var $parent = vm.$parent;
  7604. while($parent){
  7605. if($parent.__next_tick_pending){
  7606. return
  7607. }
  7608. $parent = $parent.$parent;
  7609. }
  7610. }
  7611. warn(
  7612. "Avoid mutating a prop directly since the value will be " +
  7613. "overwritten whenever the parent component re-renders. " +
  7614. "Instead, use a data or computed property based on the prop's " +
  7615. "value. Prop being mutated: \"" + key + "\"",
  7616. vm
  7617. );
  7618. }
  7619. });
  7620. } else {}
  7621. // static props are already proxied on the component's prototype
  7622. // during Vue.extend(). We only need to proxy props defined at
  7623. // instantiation here.
  7624. if (!(key in vm)) {
  7625. proxy(vm, "_props", key);
  7626. }
  7627. };
  7628. for (var key in propsOptions) loop( key );
  7629. toggleObserving(true);
  7630. }
  7631. function initData (vm) {
  7632. var data = vm.$options.data;
  7633. data = vm._data = typeof data === 'function'
  7634. ? getData(data, vm)
  7635. : data || {};
  7636. if (!isPlainObject(data)) {
  7637. data = {};
  7638. true && warn(
  7639. 'data functions should return an object:\n' +
  7640. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7641. vm
  7642. );
  7643. }
  7644. // proxy data on instance
  7645. var keys = Object.keys(data);
  7646. var props = vm.$options.props;
  7647. var methods = vm.$options.methods;
  7648. var i = keys.length;
  7649. while (i--) {
  7650. var key = keys[i];
  7651. if (true) {
  7652. if (methods && hasOwn(methods, key)) {
  7653. warn(
  7654. ("Method \"" + key + "\" has already been defined as a data property."),
  7655. vm
  7656. );
  7657. }
  7658. }
  7659. if (props && hasOwn(props, key)) {
  7660. true && warn(
  7661. "The data property \"" + key + "\" is already declared as a prop. " +
  7662. "Use prop default value instead.",
  7663. vm
  7664. );
  7665. } else if (!isReserved(key)) {
  7666. proxy(vm, "_data", key);
  7667. }
  7668. }
  7669. // observe data
  7670. observe(data, true /* asRootData */);
  7671. }
  7672. function getData (data, vm) {
  7673. // #7573 disable dep collection when invoking data getters
  7674. pushTarget();
  7675. try {
  7676. return data.call(vm, vm)
  7677. } catch (e) {
  7678. handleError(e, vm, "data()");
  7679. return {}
  7680. } finally {
  7681. popTarget();
  7682. }
  7683. }
  7684. var computedWatcherOptions = { lazy: true };
  7685. function initComputed (vm, computed) {
  7686. // $flow-disable-line
  7687. var watchers = vm._computedWatchers = Object.create(null);
  7688. // computed properties are just getters during SSR
  7689. var isSSR = isServerRendering();
  7690. for (var key in computed) {
  7691. var userDef = computed[key];
  7692. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7693. if ( true && getter == null) {
  7694. warn(
  7695. ("Getter is missing for computed property \"" + key + "\"."),
  7696. vm
  7697. );
  7698. }
  7699. if (!isSSR) {
  7700. // create internal watcher for the computed property.
  7701. watchers[key] = new Watcher(
  7702. vm,
  7703. getter || noop,
  7704. noop,
  7705. computedWatcherOptions
  7706. );
  7707. }
  7708. // component-defined computed properties are already defined on the
  7709. // component prototype. We only need to define computed properties defined
  7710. // at instantiation here.
  7711. if (!(key in vm)) {
  7712. defineComputed(vm, key, userDef);
  7713. } else if (true) {
  7714. if (key in vm.$data) {
  7715. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7716. } else if (vm.$options.props && key in vm.$options.props) {
  7717. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7718. }
  7719. }
  7720. }
  7721. }
  7722. function defineComputed (
  7723. target,
  7724. key,
  7725. userDef
  7726. ) {
  7727. var shouldCache = !isServerRendering();
  7728. if (typeof userDef === 'function') {
  7729. sharedPropertyDefinition.get = shouldCache
  7730. ? createComputedGetter(key)
  7731. : createGetterInvoker(userDef);
  7732. sharedPropertyDefinition.set = noop;
  7733. } else {
  7734. sharedPropertyDefinition.get = userDef.get
  7735. ? shouldCache && userDef.cache !== false
  7736. ? createComputedGetter(key)
  7737. : createGetterInvoker(userDef.get)
  7738. : noop;
  7739. sharedPropertyDefinition.set = userDef.set || noop;
  7740. }
  7741. if ( true &&
  7742. sharedPropertyDefinition.set === noop) {
  7743. sharedPropertyDefinition.set = function () {
  7744. warn(
  7745. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7746. this
  7747. );
  7748. };
  7749. }
  7750. Object.defineProperty(target, key, sharedPropertyDefinition);
  7751. }
  7752. function createComputedGetter (key) {
  7753. return function computedGetter () {
  7754. var watcher = this._computedWatchers && this._computedWatchers[key];
  7755. if (watcher) {
  7756. if (watcher.dirty) {
  7757. watcher.evaluate();
  7758. }
  7759. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7760. watcher.depend();
  7761. }
  7762. return watcher.value
  7763. }
  7764. }
  7765. }
  7766. function createGetterInvoker(fn) {
  7767. return function computedGetter () {
  7768. return fn.call(this, this)
  7769. }
  7770. }
  7771. function initMethods (vm, methods) {
  7772. var props = vm.$options.props;
  7773. for (var key in methods) {
  7774. if (true) {
  7775. if (typeof methods[key] !== 'function') {
  7776. warn(
  7777. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7778. "Did you reference the function correctly?",
  7779. vm
  7780. );
  7781. }
  7782. if (props && hasOwn(props, key)) {
  7783. warn(
  7784. ("Method \"" + key + "\" has already been defined as a prop."),
  7785. vm
  7786. );
  7787. }
  7788. if ((key in vm) && isReserved(key)) {
  7789. warn(
  7790. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7791. "Avoid defining component methods that start with _ or $."
  7792. );
  7793. }
  7794. }
  7795. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7796. }
  7797. }
  7798. function initWatch (vm, watch) {
  7799. for (var key in watch) {
  7800. var handler = watch[key];
  7801. if (Array.isArray(handler)) {
  7802. for (var i = 0; i < handler.length; i++) {
  7803. createWatcher(vm, key, handler[i]);
  7804. }
  7805. } else {
  7806. createWatcher(vm, key, handler);
  7807. }
  7808. }
  7809. }
  7810. function createWatcher (
  7811. vm,
  7812. expOrFn,
  7813. handler,
  7814. options
  7815. ) {
  7816. if (isPlainObject(handler)) {
  7817. options = handler;
  7818. handler = handler.handler;
  7819. }
  7820. if (typeof handler === 'string') {
  7821. handler = vm[handler];
  7822. }
  7823. return vm.$watch(expOrFn, handler, options)
  7824. }
  7825. function stateMixin (Vue) {
  7826. // flow somehow has problems with directly declared definition object
  7827. // when using Object.defineProperty, so we have to procedurally build up
  7828. // the object here.
  7829. var dataDef = {};
  7830. dataDef.get = function () { return this._data };
  7831. var propsDef = {};
  7832. propsDef.get = function () { return this._props };
  7833. if (true) {
  7834. dataDef.set = function () {
  7835. warn(
  7836. 'Avoid replacing instance root $data. ' +
  7837. 'Use nested data properties instead.',
  7838. this
  7839. );
  7840. };
  7841. propsDef.set = function () {
  7842. warn("$props is readonly.", this);
  7843. };
  7844. }
  7845. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7846. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7847. Vue.prototype.$set = set;
  7848. Vue.prototype.$delete = del;
  7849. Vue.prototype.$watch = function (
  7850. expOrFn,
  7851. cb,
  7852. options
  7853. ) {
  7854. var vm = this;
  7855. if (isPlainObject(cb)) {
  7856. return createWatcher(vm, expOrFn, cb, options)
  7857. }
  7858. options = options || {};
  7859. options.user = true;
  7860. var watcher = new Watcher(vm, expOrFn, cb, options);
  7861. if (options.immediate) {
  7862. try {
  7863. cb.call(vm, watcher.value);
  7864. } catch (error) {
  7865. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7866. }
  7867. }
  7868. return function unwatchFn () {
  7869. watcher.teardown();
  7870. }
  7871. };
  7872. }
  7873. /* */
  7874. var uid$3 = 0;
  7875. function initMixin (Vue) {
  7876. Vue.prototype._init = function (options) {
  7877. var vm = this;
  7878. // a uid
  7879. vm._uid = uid$3++;
  7880. var startTag, endTag;
  7881. /* istanbul ignore if */
  7882. if ( true && config.performance && mark) {
  7883. startTag = "vue-perf-start:" + (vm._uid);
  7884. endTag = "vue-perf-end:" + (vm._uid);
  7885. mark(startTag);
  7886. }
  7887. // a flag to avoid this being observed
  7888. vm._isVue = true;
  7889. // merge options
  7890. if (options && options._isComponent) {
  7891. // optimize internal component instantiation
  7892. // since dynamic options merging is pretty slow, and none of the
  7893. // internal component options needs special treatment.
  7894. initInternalComponent(vm, options);
  7895. } else {
  7896. vm.$options = mergeOptions(
  7897. resolveConstructorOptions(vm.constructor),
  7898. options || {},
  7899. vm
  7900. );
  7901. }
  7902. /* istanbul ignore else */
  7903. if (true) {
  7904. initProxy(vm);
  7905. } else {}
  7906. // expose real self
  7907. vm._self = vm;
  7908. initLifecycle(vm);
  7909. initEvents(vm);
  7910. initRender(vm);
  7911. callHook(vm, 'beforeCreate');
  7912. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7913. initState(vm);
  7914. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7915. !vm._$fallback && callHook(vm, 'created');
  7916. /* istanbul ignore if */
  7917. if ( true && config.performance && mark) {
  7918. vm._name = formatComponentName(vm, false);
  7919. mark(endTag);
  7920. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7921. }
  7922. if (vm.$options.el) {
  7923. vm.$mount(vm.$options.el);
  7924. }
  7925. };
  7926. }
  7927. function initInternalComponent (vm, options) {
  7928. var opts = vm.$options = Object.create(vm.constructor.options);
  7929. // doing this because it's faster than dynamic enumeration.
  7930. var parentVnode = options._parentVnode;
  7931. opts.parent = options.parent;
  7932. opts._parentVnode = parentVnode;
  7933. var vnodeComponentOptions = parentVnode.componentOptions;
  7934. opts.propsData = vnodeComponentOptions.propsData;
  7935. opts._parentListeners = vnodeComponentOptions.listeners;
  7936. opts._renderChildren = vnodeComponentOptions.children;
  7937. opts._componentTag = vnodeComponentOptions.tag;
  7938. if (options.render) {
  7939. opts.render = options.render;
  7940. opts.staticRenderFns = options.staticRenderFns;
  7941. }
  7942. }
  7943. function resolveConstructorOptions (Ctor) {
  7944. var options = Ctor.options;
  7945. if (Ctor.super) {
  7946. var superOptions = resolveConstructorOptions(Ctor.super);
  7947. var cachedSuperOptions = Ctor.superOptions;
  7948. if (superOptions !== cachedSuperOptions) {
  7949. // super option changed,
  7950. // need to resolve new options.
  7951. Ctor.superOptions = superOptions;
  7952. // check if there are any late-modified/attached options (#4976)
  7953. var modifiedOptions = resolveModifiedOptions(Ctor);
  7954. // update base extend options
  7955. if (modifiedOptions) {
  7956. extend(Ctor.extendOptions, modifiedOptions);
  7957. }
  7958. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7959. if (options.name) {
  7960. options.components[options.name] = Ctor;
  7961. }
  7962. }
  7963. }
  7964. return options
  7965. }
  7966. function resolveModifiedOptions (Ctor) {
  7967. var modified;
  7968. var latest = Ctor.options;
  7969. var sealed = Ctor.sealedOptions;
  7970. for (var key in latest) {
  7971. if (latest[key] !== sealed[key]) {
  7972. if (!modified) { modified = {}; }
  7973. modified[key] = latest[key];
  7974. }
  7975. }
  7976. return modified
  7977. }
  7978. function Vue (options) {
  7979. if ( true &&
  7980. !(this instanceof Vue)
  7981. ) {
  7982. warn('Vue is a constructor and should be called with the `new` keyword');
  7983. }
  7984. this._init(options);
  7985. }
  7986. initMixin(Vue);
  7987. stateMixin(Vue);
  7988. eventsMixin(Vue);
  7989. lifecycleMixin(Vue);
  7990. renderMixin(Vue);
  7991. /* */
  7992. function initUse (Vue) {
  7993. Vue.use = function (plugin) {
  7994. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7995. if (installedPlugins.indexOf(plugin) > -1) {
  7996. return this
  7997. }
  7998. // additional parameters
  7999. var args = toArray(arguments, 1);
  8000. args.unshift(this);
  8001. if (typeof plugin.install === 'function') {
  8002. plugin.install.apply(plugin, args);
  8003. } else if (typeof plugin === 'function') {
  8004. plugin.apply(null, args);
  8005. }
  8006. installedPlugins.push(plugin);
  8007. return this
  8008. };
  8009. }
  8010. /* */
  8011. function initMixin$1 (Vue) {
  8012. Vue.mixin = function (mixin) {
  8013. this.options = mergeOptions(this.options, mixin);
  8014. return this
  8015. };
  8016. }
  8017. /* */
  8018. function initExtend (Vue) {
  8019. /**
  8020. * Each instance constructor, including Vue, has a unique
  8021. * cid. This enables us to create wrapped "child
  8022. * constructors" for prototypal inheritance and cache them.
  8023. */
  8024. Vue.cid = 0;
  8025. var cid = 1;
  8026. /**
  8027. * Class inheritance
  8028. */
  8029. Vue.extend = function (extendOptions) {
  8030. extendOptions = extendOptions || {};
  8031. var Super = this;
  8032. var SuperId = Super.cid;
  8033. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8034. if (cachedCtors[SuperId]) {
  8035. return cachedCtors[SuperId]
  8036. }
  8037. var name = extendOptions.name || Super.options.name;
  8038. if ( true && name) {
  8039. validateComponentName(name);
  8040. }
  8041. var Sub = function VueComponent (options) {
  8042. this._init(options);
  8043. };
  8044. Sub.prototype = Object.create(Super.prototype);
  8045. Sub.prototype.constructor = Sub;
  8046. Sub.cid = cid++;
  8047. Sub.options = mergeOptions(
  8048. Super.options,
  8049. extendOptions
  8050. );
  8051. Sub['super'] = Super;
  8052. // For props and computed properties, we define the proxy getters on
  8053. // the Vue instances at extension time, on the extended prototype. This
  8054. // avoids Object.defineProperty calls for each instance created.
  8055. if (Sub.options.props) {
  8056. initProps$1(Sub);
  8057. }
  8058. if (Sub.options.computed) {
  8059. initComputed$1(Sub);
  8060. }
  8061. // allow further extension/mixin/plugin usage
  8062. Sub.extend = Super.extend;
  8063. Sub.mixin = Super.mixin;
  8064. Sub.use = Super.use;
  8065. // create asset registers, so extended classes
  8066. // can have their private assets too.
  8067. ASSET_TYPES.forEach(function (type) {
  8068. Sub[type] = Super[type];
  8069. });
  8070. // enable recursive self-lookup
  8071. if (name) {
  8072. Sub.options.components[name] = Sub;
  8073. }
  8074. // keep a reference to the super options at extension time.
  8075. // later at instantiation we can check if Super's options have
  8076. // been updated.
  8077. Sub.superOptions = Super.options;
  8078. Sub.extendOptions = extendOptions;
  8079. Sub.sealedOptions = extend({}, Sub.options);
  8080. // cache constructor
  8081. cachedCtors[SuperId] = Sub;
  8082. return Sub
  8083. };
  8084. }
  8085. function initProps$1 (Comp) {
  8086. var props = Comp.options.props;
  8087. for (var key in props) {
  8088. proxy(Comp.prototype, "_props", key);
  8089. }
  8090. }
  8091. function initComputed$1 (Comp) {
  8092. var computed = Comp.options.computed;
  8093. for (var key in computed) {
  8094. defineComputed(Comp.prototype, key, computed[key]);
  8095. }
  8096. }
  8097. /* */
  8098. function initAssetRegisters (Vue) {
  8099. /**
  8100. * Create asset registration methods.
  8101. */
  8102. ASSET_TYPES.forEach(function (type) {
  8103. Vue[type] = function (
  8104. id,
  8105. definition
  8106. ) {
  8107. if (!definition) {
  8108. return this.options[type + 's'][id]
  8109. } else {
  8110. /* istanbul ignore if */
  8111. if ( true && type === 'component') {
  8112. validateComponentName(id);
  8113. }
  8114. if (type === 'component' && isPlainObject(definition)) {
  8115. definition.name = definition.name || id;
  8116. definition = this.options._base.extend(definition);
  8117. }
  8118. if (type === 'directive' && typeof definition === 'function') {
  8119. definition = { bind: definition, update: definition };
  8120. }
  8121. this.options[type + 's'][id] = definition;
  8122. return definition
  8123. }
  8124. };
  8125. });
  8126. }
  8127. /* */
  8128. function getComponentName (opts) {
  8129. return opts && (opts.Ctor.options.name || opts.tag)
  8130. }
  8131. function matches (pattern, name) {
  8132. if (Array.isArray(pattern)) {
  8133. return pattern.indexOf(name) > -1
  8134. } else if (typeof pattern === 'string') {
  8135. return pattern.split(',').indexOf(name) > -1
  8136. } else if (isRegExp(pattern)) {
  8137. return pattern.test(name)
  8138. }
  8139. /* istanbul ignore next */
  8140. return false
  8141. }
  8142. function pruneCache (keepAliveInstance, filter) {
  8143. var cache = keepAliveInstance.cache;
  8144. var keys = keepAliveInstance.keys;
  8145. var _vnode = keepAliveInstance._vnode;
  8146. for (var key in cache) {
  8147. var cachedNode = cache[key];
  8148. if (cachedNode) {
  8149. var name = getComponentName(cachedNode.componentOptions);
  8150. if (name && !filter(name)) {
  8151. pruneCacheEntry(cache, key, keys, _vnode);
  8152. }
  8153. }
  8154. }
  8155. }
  8156. function pruneCacheEntry (
  8157. cache,
  8158. key,
  8159. keys,
  8160. current
  8161. ) {
  8162. var cached$$1 = cache[key];
  8163. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8164. cached$$1.componentInstance.$destroy();
  8165. }
  8166. cache[key] = null;
  8167. remove(keys, key);
  8168. }
  8169. var patternTypes = [String, RegExp, Array];
  8170. var KeepAlive = {
  8171. name: 'keep-alive',
  8172. abstract: true,
  8173. props: {
  8174. include: patternTypes,
  8175. exclude: patternTypes,
  8176. max: [String, Number]
  8177. },
  8178. created: function created () {
  8179. this.cache = Object.create(null);
  8180. this.keys = [];
  8181. },
  8182. destroyed: function destroyed () {
  8183. for (var key in this.cache) {
  8184. pruneCacheEntry(this.cache, key, this.keys);
  8185. }
  8186. },
  8187. mounted: function mounted () {
  8188. var this$1 = this;
  8189. this.$watch('include', function (val) {
  8190. pruneCache(this$1, function (name) { return matches(val, name); });
  8191. });
  8192. this.$watch('exclude', function (val) {
  8193. pruneCache(this$1, function (name) { return !matches(val, name); });
  8194. });
  8195. },
  8196. render: function render () {
  8197. var slot = this.$slots.default;
  8198. var vnode = getFirstComponentChild(slot);
  8199. var componentOptions = vnode && vnode.componentOptions;
  8200. if (componentOptions) {
  8201. // check pattern
  8202. var name = getComponentName(componentOptions);
  8203. var ref = this;
  8204. var include = ref.include;
  8205. var exclude = ref.exclude;
  8206. if (
  8207. // not included
  8208. (include && (!name || !matches(include, name))) ||
  8209. // excluded
  8210. (exclude && name && matches(exclude, name))
  8211. ) {
  8212. return vnode
  8213. }
  8214. var ref$1 = this;
  8215. var cache = ref$1.cache;
  8216. var keys = ref$1.keys;
  8217. var key = vnode.key == null
  8218. // same constructor may get registered as different local components
  8219. // so cid alone is not enough (#3269)
  8220. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8221. : vnode.key;
  8222. if (cache[key]) {
  8223. vnode.componentInstance = cache[key].componentInstance;
  8224. // make current key freshest
  8225. remove(keys, key);
  8226. keys.push(key);
  8227. } else {
  8228. cache[key] = vnode;
  8229. keys.push(key);
  8230. // prune oldest entry
  8231. if (this.max && keys.length > parseInt(this.max)) {
  8232. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8233. }
  8234. }
  8235. vnode.data.keepAlive = true;
  8236. }
  8237. return vnode || (slot && slot[0])
  8238. }
  8239. };
  8240. var builtInComponents = {
  8241. KeepAlive: KeepAlive
  8242. };
  8243. /* */
  8244. function initGlobalAPI (Vue) {
  8245. // config
  8246. var configDef = {};
  8247. configDef.get = function () { return config; };
  8248. if (true) {
  8249. configDef.set = function () {
  8250. warn(
  8251. 'Do not replace the Vue.config object, set individual fields instead.'
  8252. );
  8253. };
  8254. }
  8255. Object.defineProperty(Vue, 'config', configDef);
  8256. // exposed util methods.
  8257. // NOTE: these are not considered part of the public API - avoid relying on
  8258. // them unless you are aware of the risk.
  8259. Vue.util = {
  8260. warn: warn,
  8261. extend: extend,
  8262. mergeOptions: mergeOptions,
  8263. defineReactive: defineReactive$$1
  8264. };
  8265. Vue.set = set;
  8266. Vue.delete = del;
  8267. Vue.nextTick = nextTick;
  8268. // 2.6 explicit observable API
  8269. Vue.observable = function (obj) {
  8270. observe(obj);
  8271. return obj
  8272. };
  8273. Vue.options = Object.create(null);
  8274. ASSET_TYPES.forEach(function (type) {
  8275. Vue.options[type + 's'] = Object.create(null);
  8276. });
  8277. // this is used to identify the "base" constructor to extend all plain-object
  8278. // components with in Weex's multi-instance scenarios.
  8279. Vue.options._base = Vue;
  8280. extend(Vue.options.components, builtInComponents);
  8281. initUse(Vue);
  8282. initMixin$1(Vue);
  8283. initExtend(Vue);
  8284. initAssetRegisters(Vue);
  8285. }
  8286. initGlobalAPI(Vue);
  8287. Object.defineProperty(Vue.prototype, '$isServer', {
  8288. get: isServerRendering
  8289. });
  8290. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8291. get: function get () {
  8292. /* istanbul ignore next */
  8293. return this.$vnode && this.$vnode.ssrContext
  8294. }
  8295. });
  8296. // expose FunctionalRenderContext for ssr runtime helper installation
  8297. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8298. value: FunctionalRenderContext
  8299. });
  8300. Vue.version = '2.6.11';
  8301. /**
  8302. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8303. */
  8304. var ARRAYTYPE = '[object Array]';
  8305. var OBJECTTYPE = '[object Object]';
  8306. var NULLTYPE = '[object Null]';
  8307. var UNDEFINEDTYPE = '[object Undefined]';
  8308. // const FUNCTIONTYPE = '[object Function]'
  8309. function diff(current, pre) {
  8310. var result = {};
  8311. syncKeys(current, pre);
  8312. _diff(current, pre, '', result);
  8313. return result
  8314. }
  8315. function syncKeys(current, pre) {
  8316. if (current === pre) { return }
  8317. var rootCurrentType = type(current);
  8318. var rootPreType = type(pre);
  8319. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8320. if(Object.keys(current).length >= Object.keys(pre).length){
  8321. for (var key in pre) {
  8322. var currentValue = current[key];
  8323. if (currentValue === undefined) {
  8324. current[key] = null;
  8325. } else {
  8326. syncKeys(currentValue, pre[key]);
  8327. }
  8328. }
  8329. }
  8330. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8331. if (current.length >= pre.length) {
  8332. pre.forEach(function (item, index) {
  8333. syncKeys(current[index], item);
  8334. });
  8335. }
  8336. }
  8337. }
  8338. function nullOrUndefined(currentType, preType) {
  8339. if(
  8340. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8341. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8342. ) {
  8343. return false
  8344. }
  8345. return true
  8346. }
  8347. function _diff(current, pre, path, result) {
  8348. if (current === pre) { return }
  8349. var rootCurrentType = type(current);
  8350. var rootPreType = type(pre);
  8351. if (rootCurrentType == OBJECTTYPE) {
  8352. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8353. setResult(result, path, current);
  8354. } else {
  8355. var loop = function ( key ) {
  8356. var currentValue = current[key];
  8357. var preValue = pre[key];
  8358. var currentType = type(currentValue);
  8359. var preType = type(preValue);
  8360. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8361. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8362. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8363. }
  8364. } else if (currentType == ARRAYTYPE) {
  8365. if (preType != ARRAYTYPE) {
  8366. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8367. } else {
  8368. if (currentValue.length < preValue.length) {
  8369. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8370. } else {
  8371. currentValue.forEach(function (item, index) {
  8372. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8373. });
  8374. }
  8375. }
  8376. } else if (currentType == OBJECTTYPE) {
  8377. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8378. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8379. } else {
  8380. for (var subKey in currentValue) {
  8381. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8382. }
  8383. }
  8384. }
  8385. };
  8386. for (var key in current) loop( key );
  8387. }
  8388. } else if (rootCurrentType == ARRAYTYPE) {
  8389. if (rootPreType != ARRAYTYPE) {
  8390. setResult(result, path, current);
  8391. } else {
  8392. if (current.length < pre.length) {
  8393. setResult(result, path, current);
  8394. } else {
  8395. current.forEach(function (item, index) {
  8396. _diff(item, pre[index], path + '[' + index + ']', result);
  8397. });
  8398. }
  8399. }
  8400. } else {
  8401. setResult(result, path, current);
  8402. }
  8403. }
  8404. function setResult(result, k, v) {
  8405. // if (type(v) != FUNCTIONTYPE) {
  8406. result[k] = v;
  8407. // }
  8408. }
  8409. function type(obj) {
  8410. return Object.prototype.toString.call(obj)
  8411. }
  8412. /* */
  8413. function flushCallbacks$1(vm) {
  8414. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8415. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"project2","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8416. var mpInstance = vm.$scope;
  8417. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8418. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8419. }
  8420. var copies = vm.__next_tick_callbacks.slice(0);
  8421. vm.__next_tick_callbacks.length = 0;
  8422. for (var i = 0; i < copies.length; i++) {
  8423. copies[i]();
  8424. }
  8425. }
  8426. }
  8427. function hasRenderWatcher(vm) {
  8428. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8429. }
  8430. function nextTick$1(vm, cb) {
  8431. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8432. //2.nextTick 之前存在 render watcher
  8433. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8434. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"project2","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8435. var mpInstance = vm.$scope;
  8436. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8437. ']:nextVueTick');
  8438. }
  8439. return nextTick(cb, vm)
  8440. }else{
  8441. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"project2","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8442. var mpInstance$1 = vm.$scope;
  8443. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8444. ']:nextMPTick');
  8445. }
  8446. }
  8447. var _resolve;
  8448. if (!vm.__next_tick_callbacks) {
  8449. vm.__next_tick_callbacks = [];
  8450. }
  8451. vm.__next_tick_callbacks.push(function () {
  8452. if (cb) {
  8453. try {
  8454. cb.call(vm);
  8455. } catch (e) {
  8456. handleError(e, vm, 'nextTick');
  8457. }
  8458. } else if (_resolve) {
  8459. _resolve(vm);
  8460. }
  8461. });
  8462. // $flow-disable-line
  8463. if (!cb && typeof Promise !== 'undefined') {
  8464. return new Promise(function (resolve) {
  8465. _resolve = resolve;
  8466. })
  8467. }
  8468. }
  8469. /* */
  8470. function clearInstance(key, value) {
  8471. // 简易去除 Vue 和小程序组件实例
  8472. if (value) {
  8473. if (value._isVue || value.__v_isMPComponent) {
  8474. return {}
  8475. }
  8476. }
  8477. return value
  8478. }
  8479. function cloneWithData(vm) {
  8480. // 确保当前 vm 所有数据被同步
  8481. var ret = Object.create(null);
  8482. var dataKeys = [].concat(
  8483. Object.keys(vm._data || {}),
  8484. Object.keys(vm._computedWatchers || {}));
  8485. dataKeys.reduce(function(ret, key) {
  8486. ret[key] = vm[key];
  8487. return ret
  8488. }, ret);
  8489. // vue-composition-api
  8490. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8491. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8492. if (rawBindings) {
  8493. Object.keys(rawBindings).forEach(function (key) {
  8494. ret[key] = vm[key];
  8495. });
  8496. }
  8497. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8498. Object.assign(ret, vm.$mp.data || {});
  8499. if (
  8500. Array.isArray(vm.$options.behaviors) &&
  8501. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8502. ) { //form-field
  8503. ret['name'] = vm.name;
  8504. ret['value'] = vm.value;
  8505. }
  8506. return JSON.parse(JSON.stringify(ret, clearInstance))
  8507. }
  8508. var patch = function(oldVnode, vnode) {
  8509. var this$1 = this;
  8510. if (vnode === null) { //destroy
  8511. return
  8512. }
  8513. if (this.mpType === 'page' || this.mpType === 'component') {
  8514. var mpInstance = this.$scope;
  8515. var data = Object.create(null);
  8516. try {
  8517. data = cloneWithData(this);
  8518. } catch (err) {
  8519. console.error(err);
  8520. }
  8521. data.__webviewId__ = mpInstance.data.__webviewId__;
  8522. var mpData = Object.create(null);
  8523. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8524. mpData[key] = mpInstance.data[key];
  8525. });
  8526. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8527. if (Object.keys(diffData).length) {
  8528. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"project2","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8529. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8530. ']差量更新',
  8531. JSON.stringify(diffData));
  8532. }
  8533. this.__next_tick_pending = true;
  8534. mpInstance.setData(diffData, function () {
  8535. this$1.__next_tick_pending = false;
  8536. flushCallbacks$1(this$1);
  8537. });
  8538. } else {
  8539. flushCallbacks$1(this);
  8540. }
  8541. }
  8542. };
  8543. /* */
  8544. function createEmptyRender() {
  8545. }
  8546. function mountComponent$1(
  8547. vm,
  8548. el,
  8549. hydrating
  8550. ) {
  8551. if (!vm.mpType) {//main.js 中的 new Vue
  8552. return vm
  8553. }
  8554. if (vm.mpType === 'app') {
  8555. vm.$options.render = createEmptyRender;
  8556. }
  8557. if (!vm.$options.render) {
  8558. vm.$options.render = createEmptyRender;
  8559. if (true) {
  8560. /* istanbul ignore if */
  8561. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8562. vm.$options.el || el) {
  8563. warn(
  8564. 'You are using the runtime-only build of Vue where the template ' +
  8565. 'compiler is not available. Either pre-compile the templates into ' +
  8566. 'render functions, or use the compiler-included build.',
  8567. vm
  8568. );
  8569. } else {
  8570. warn(
  8571. 'Failed to mount component: template or render function not defined.',
  8572. vm
  8573. );
  8574. }
  8575. }
  8576. }
  8577. !vm._$fallback && callHook(vm, 'beforeMount');
  8578. var updateComponent = function () {
  8579. vm._update(vm._render(), hydrating);
  8580. };
  8581. // we set this to vm._watcher inside the watcher's constructor
  8582. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8583. // component's mounted hook), which relies on vm._watcher being already defined
  8584. new Watcher(vm, updateComponent, noop, {
  8585. before: function before() {
  8586. if (vm._isMounted && !vm._isDestroyed) {
  8587. callHook(vm, 'beforeUpdate');
  8588. }
  8589. }
  8590. }, true /* isRenderWatcher */);
  8591. hydrating = false;
  8592. return vm
  8593. }
  8594. /* */
  8595. function renderClass (
  8596. staticClass,
  8597. dynamicClass
  8598. ) {
  8599. if (isDef(staticClass) || isDef(dynamicClass)) {
  8600. return concat(staticClass, stringifyClass(dynamicClass))
  8601. }
  8602. /* istanbul ignore next */
  8603. return ''
  8604. }
  8605. function concat (a, b) {
  8606. return a ? b ? (a + ' ' + b) : a : (b || '')
  8607. }
  8608. function stringifyClass (value) {
  8609. if (Array.isArray(value)) {
  8610. return stringifyArray(value)
  8611. }
  8612. if (isObject(value)) {
  8613. return stringifyObject(value)
  8614. }
  8615. if (typeof value === 'string') {
  8616. return value
  8617. }
  8618. /* istanbul ignore next */
  8619. return ''
  8620. }
  8621. function stringifyArray (value) {
  8622. var res = '';
  8623. var stringified;
  8624. for (var i = 0, l = value.length; i < l; i++) {
  8625. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8626. if (res) { res += ' '; }
  8627. res += stringified;
  8628. }
  8629. }
  8630. return res
  8631. }
  8632. function stringifyObject (value) {
  8633. var res = '';
  8634. for (var key in value) {
  8635. if (value[key]) {
  8636. if (res) { res += ' '; }
  8637. res += key;
  8638. }
  8639. }
  8640. return res
  8641. }
  8642. /* */
  8643. var parseStyleText = cached(function (cssText) {
  8644. var res = {};
  8645. var listDelimiter = /;(?![^(]*\))/g;
  8646. var propertyDelimiter = /:(.+)/;
  8647. cssText.split(listDelimiter).forEach(function (item) {
  8648. if (item) {
  8649. var tmp = item.split(propertyDelimiter);
  8650. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8651. }
  8652. });
  8653. return res
  8654. });
  8655. // normalize possible array / string values into Object
  8656. function normalizeStyleBinding (bindingStyle) {
  8657. if (Array.isArray(bindingStyle)) {
  8658. return toObject(bindingStyle)
  8659. }
  8660. if (typeof bindingStyle === 'string') {
  8661. return parseStyleText(bindingStyle)
  8662. }
  8663. return bindingStyle
  8664. }
  8665. /* */
  8666. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8667. function getTarget(obj, path) {
  8668. var parts = path.split('.');
  8669. var key = parts[0];
  8670. if (key.indexOf('__$n') === 0) { //number index
  8671. key = parseInt(key.replace('__$n', ''));
  8672. }
  8673. if (parts.length === 1) {
  8674. return obj[key]
  8675. }
  8676. return getTarget(obj[key], parts.slice(1).join('.'))
  8677. }
  8678. function internalMixin(Vue) {
  8679. Vue.config.errorHandler = function(err, vm, info) {
  8680. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8681. console.error(err);
  8682. /* eslint-disable no-undef */
  8683. var app = typeof getApp === 'function' && getApp();
  8684. if (app && app.onError) {
  8685. app.onError(err);
  8686. }
  8687. };
  8688. var oldEmit = Vue.prototype.$emit;
  8689. Vue.prototype.$emit = function(event) {
  8690. if (this.$scope && event) {
  8691. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8692. if (triggerEvent) {
  8693. try {
  8694. triggerEvent.call(this.$scope, event, {
  8695. __args__: toArray(arguments, 1)
  8696. });
  8697. } catch (error) {
  8698. }
  8699. }
  8700. }
  8701. return oldEmit.apply(this, arguments)
  8702. };
  8703. Vue.prototype.$nextTick = function(fn) {
  8704. return nextTick$1(this, fn)
  8705. };
  8706. MP_METHODS.forEach(function (method) {
  8707. Vue.prototype[method] = function(args) {
  8708. if (this.$scope && this.$scope[method]) {
  8709. return this.$scope[method](args)
  8710. }
  8711. // mp-alipay
  8712. if (typeof my === 'undefined') {
  8713. return
  8714. }
  8715. if (method === 'createSelectorQuery') {
  8716. /* eslint-disable no-undef */
  8717. return my.createSelectorQuery(args)
  8718. } else if (method === 'createIntersectionObserver') {
  8719. /* eslint-disable no-undef */
  8720. return my.createIntersectionObserver(args)
  8721. }
  8722. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8723. };
  8724. });
  8725. Vue.prototype.__init_provide = initProvide;
  8726. Vue.prototype.__init_injections = initInjections;
  8727. Vue.prototype.__call_hook = function(hook, args) {
  8728. var vm = this;
  8729. // #7573 disable dep collection when invoking lifecycle hooks
  8730. pushTarget();
  8731. var handlers = vm.$options[hook];
  8732. var info = hook + " hook";
  8733. var ret;
  8734. if (handlers) {
  8735. for (var i = 0, j = handlers.length; i < j; i++) {
  8736. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8737. }
  8738. }
  8739. if (vm._hasHookEvent) {
  8740. vm.$emit('hook:' + hook, args);
  8741. }
  8742. popTarget();
  8743. return ret
  8744. };
  8745. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8746. if (Array.isArray(modifiers)) {
  8747. if (modifiers.indexOf('trim') !== -1) {
  8748. value = value.trim();
  8749. }
  8750. if (modifiers.indexOf('number') !== -1) {
  8751. value = this._n(value);
  8752. }
  8753. }
  8754. if (!target) {
  8755. target = this;
  8756. }
  8757. // 解决动态属性添加
  8758. Vue.set(target, key, value);
  8759. };
  8760. Vue.prototype.__set_sync = function(target, key, value) {
  8761. if (!target) {
  8762. target = this;
  8763. }
  8764. // 解决动态属性添加
  8765. Vue.set(target, key, value);
  8766. };
  8767. Vue.prototype.__get_orig = function(item) {
  8768. if (isPlainObject(item)) {
  8769. return item['$orig'] || item
  8770. }
  8771. return item
  8772. };
  8773. Vue.prototype.__get_value = function(dataPath, target) {
  8774. return getTarget(target || this, dataPath)
  8775. };
  8776. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8777. return renderClass(staticClass, dynamicClass)
  8778. };
  8779. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8780. if (!dynamicStyle && !staticStyle) {
  8781. return ''
  8782. }
  8783. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8784. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8785. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8786. };
  8787. Vue.prototype.__map = function(val, iteratee) {
  8788. //TODO 暂不考虑 string
  8789. var ret, i, l, keys, key;
  8790. if (Array.isArray(val)) {
  8791. ret = new Array(val.length);
  8792. for (i = 0, l = val.length; i < l; i++) {
  8793. ret[i] = iteratee(val[i], i);
  8794. }
  8795. return ret
  8796. } else if (isObject(val)) {
  8797. keys = Object.keys(val);
  8798. ret = Object.create(null);
  8799. for (i = 0, l = keys.length; i < l; i++) {
  8800. key = keys[i];
  8801. ret[key] = iteratee(val[key], key, i);
  8802. }
  8803. return ret
  8804. } else if (typeof val === 'number') {
  8805. ret = new Array(val);
  8806. for (i = 0, l = val; i < l; i++) {
  8807. // 第一个参数暂时仍和小程序一致
  8808. ret[i] = iteratee(i, i);
  8809. }
  8810. return ret
  8811. }
  8812. return []
  8813. };
  8814. }
  8815. /* */
  8816. var LIFECYCLE_HOOKS$1 = [
  8817. //App
  8818. 'onLaunch',
  8819. 'onShow',
  8820. 'onHide',
  8821. 'onUniNViewMessage',
  8822. 'onPageNotFound',
  8823. 'onThemeChange',
  8824. 'onError',
  8825. 'onUnhandledRejection',
  8826. //Page
  8827. 'onInit',
  8828. 'onLoad',
  8829. // 'onShow',
  8830. 'onReady',
  8831. // 'onHide',
  8832. 'onUnload',
  8833. 'onPullDownRefresh',
  8834. 'onReachBottom',
  8835. 'onTabItemTap',
  8836. 'onAddToFavorites',
  8837. 'onShareTimeline',
  8838. 'onShareAppMessage',
  8839. 'onResize',
  8840. 'onPageScroll',
  8841. 'onNavigationBarButtonTap',
  8842. 'onBackPress',
  8843. 'onNavigationBarSearchInputChanged',
  8844. 'onNavigationBarSearchInputConfirmed',
  8845. 'onNavigationBarSearchInputClicked',
  8846. 'onUploadDouyinVideo',
  8847. 'onNFCReadMessage',
  8848. //Component
  8849. // 'onReady', // 兼容旧版本,应该移除该事件
  8850. 'onPageShow',
  8851. 'onPageHide',
  8852. 'onPageResize'
  8853. ];
  8854. function lifecycleMixin$1(Vue) {
  8855. //fixed vue-class-component
  8856. var oldExtend = Vue.extend;
  8857. Vue.extend = function(extendOptions) {
  8858. extendOptions = extendOptions || {};
  8859. var methods = extendOptions.methods;
  8860. if (methods) {
  8861. Object.keys(methods).forEach(function (methodName) {
  8862. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8863. extendOptions[methodName] = methods[methodName];
  8864. delete methods[methodName];
  8865. }
  8866. });
  8867. }
  8868. return oldExtend.call(this, extendOptions)
  8869. };
  8870. var strategies = Vue.config.optionMergeStrategies;
  8871. var mergeHook = strategies.created;
  8872. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8873. strategies[hook] = mergeHook;
  8874. });
  8875. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8876. }
  8877. /* */
  8878. // install platform patch function
  8879. Vue.prototype.__patch__ = patch;
  8880. // public mount method
  8881. Vue.prototype.$mount = function(
  8882. el ,
  8883. hydrating
  8884. ) {
  8885. return mountComponent$1(this, el, hydrating)
  8886. };
  8887. lifecycleMixin$1(Vue);
  8888. internalMixin(Vue);
  8889. /* */
  8890. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8891. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8892. /***/ }),
  8893. /* 26 */
  8894. /*!***********************************************************************!*\
  8895. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/pages.json ***!
  8896. \***********************************************************************/
  8897. /*! no static exports found */
  8898. /***/ (function(module, exports) {
  8899. /***/ }),
  8900. /* 27 */,
  8901. /* 28 */,
  8902. /* 29 */,
  8903. /* 30 */,
  8904. /* 31 */,
  8905. /* 32 */
  8906. /*!**********************************************************************************************************!*\
  8907. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8908. \**********************************************************************************************************/
  8909. /*! exports provided: default */
  8910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8911. "use strict";
  8912. __webpack_require__.r(__webpack_exports__);
  8913. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8914. /* globals __VUE_SSR_CONTEXT__ */
  8915. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8916. // This module is a runtime utility for cleaner component module output and will
  8917. // be included in the final webpack user bundle.
  8918. function normalizeComponent (
  8919. scriptExports,
  8920. render,
  8921. staticRenderFns,
  8922. functionalTemplate,
  8923. injectStyles,
  8924. scopeId,
  8925. moduleIdentifier, /* server only */
  8926. shadowMode, /* vue-cli only */
  8927. components, // fixed by xxxxxx auto components
  8928. renderjs // fixed by xxxxxx renderjs
  8929. ) {
  8930. // Vue.extend constructor export interop
  8931. var options = typeof scriptExports === 'function'
  8932. ? scriptExports.options
  8933. : scriptExports
  8934. // fixed by xxxxxx auto components
  8935. if (components) {
  8936. if (!options.components) {
  8937. options.components = {}
  8938. }
  8939. var hasOwn = Object.prototype.hasOwnProperty
  8940. for (var name in components) {
  8941. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8942. options.components[name] = components[name]
  8943. }
  8944. }
  8945. }
  8946. // fixed by xxxxxx renderjs
  8947. if (renderjs) {
  8948. if(typeof renderjs.beforeCreate === 'function'){
  8949. renderjs.beforeCreate = [renderjs.beforeCreate]
  8950. }
  8951. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8952. this[renderjs.__module] = this
  8953. });
  8954. (options.mixins || (options.mixins = [])).push(renderjs)
  8955. }
  8956. // render functions
  8957. if (render) {
  8958. options.render = render
  8959. options.staticRenderFns = staticRenderFns
  8960. options._compiled = true
  8961. }
  8962. // functional template
  8963. if (functionalTemplate) {
  8964. options.functional = true
  8965. }
  8966. // scopedId
  8967. if (scopeId) {
  8968. options._scopeId = 'data-v-' + scopeId
  8969. }
  8970. var hook
  8971. if (moduleIdentifier) { // server build
  8972. hook = function (context) {
  8973. // 2.3 injection
  8974. context =
  8975. context || // cached call
  8976. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8977. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8978. // 2.2 with runInNewContext: true
  8979. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8980. context = __VUE_SSR_CONTEXT__
  8981. }
  8982. // inject component styles
  8983. if (injectStyles) {
  8984. injectStyles.call(this, context)
  8985. }
  8986. // register component module identifier for async chunk inferrence
  8987. if (context && context._registeredComponents) {
  8988. context._registeredComponents.add(moduleIdentifier)
  8989. }
  8990. }
  8991. // used by ssr in case component is cached and beforeCreate
  8992. // never gets called
  8993. options._ssrRegister = hook
  8994. } else if (injectStyles) {
  8995. hook = shadowMode
  8996. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8997. : injectStyles
  8998. }
  8999. if (hook) {
  9000. if (options.functional) {
  9001. // for template-only hot-reload because in that case the render fn doesn't
  9002. // go through the normalizer
  9003. options._injectStyles = hook
  9004. // register for functioal component in vue file
  9005. var originalRender = options.render
  9006. options.render = function renderWithStyleInjection (h, context) {
  9007. hook.call(context)
  9008. return originalRender(h, context)
  9009. }
  9010. } else {
  9011. // inject component registration as beforeCreate hook
  9012. var existing = options.beforeCreate
  9013. options.beforeCreate = existing
  9014. ? [].concat(existing, hook)
  9015. : [hook]
  9016. }
  9017. }
  9018. return {
  9019. exports: scriptExports,
  9020. options: options
  9021. }
  9022. }
  9023. /***/ }),
  9024. /* 33 */
  9025. /*!*************************************************************************************!*\
  9026. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/uni.promisify.adaptor.js ***!
  9027. \*************************************************************************************/
  9028. /*! no static exports found */
  9029. /***/ (function(module, exports, __webpack_require__) {
  9030. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  9031. uni.addInterceptor({
  9032. returnValue: function returnValue(res) {
  9033. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  9034. return res;
  9035. }
  9036. return new Promise(function (resolve, reject) {
  9037. res.then(function (res) {
  9038. if (!res) return resolve(res);
  9039. return res[0] ? reject(res[0]) : resolve(res[1]);
  9040. });
  9041. });
  9042. }
  9043. });
  9044. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9045. /***/ }),
  9046. /* 34 */,
  9047. /* 35 */,
  9048. /* 36 */,
  9049. /* 37 */,
  9050. /* 38 */,
  9051. /* 39 */,
  9052. /* 40 */
  9053. /*!************************************************************************************************!*\
  9054. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9055. \************************************************************************************************/
  9056. /*! no static exports found */
  9057. /***/ (function(module, exports, __webpack_require__) {
  9058. // TODO(Babel 8): Remove this file.
  9059. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 41)();
  9060. module.exports = runtime;
  9061. /***/ }),
  9062. /* 41 */
  9063. /*!*******************************************************************!*\
  9064. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9065. \*******************************************************************/
  9066. /*! no static exports found */
  9067. /***/ (function(module, exports, __webpack_require__) {
  9068. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9069. function _regeneratorRuntime() {
  9070. "use strict";
  9071. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9072. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9073. return e;
  9074. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9075. var t,
  9076. e = {},
  9077. r = Object.prototype,
  9078. n = r.hasOwnProperty,
  9079. o = Object.defineProperty || function (t, e, r) {
  9080. t[e] = r.value;
  9081. },
  9082. i = "function" == typeof Symbol ? Symbol : {},
  9083. a = i.iterator || "@@iterator",
  9084. c = i.asyncIterator || "@@asyncIterator",
  9085. u = i.toStringTag || "@@toStringTag";
  9086. function define(t, e, r) {
  9087. return Object.defineProperty(t, e, {
  9088. value: r,
  9089. enumerable: !0,
  9090. configurable: !0,
  9091. writable: !0
  9092. }), t[e];
  9093. }
  9094. try {
  9095. define({}, "");
  9096. } catch (t) {
  9097. define = function define(t, e, r) {
  9098. return t[e] = r;
  9099. };
  9100. }
  9101. function wrap(t, e, r, n) {
  9102. var i = e && e.prototype instanceof Generator ? e : Generator,
  9103. a = Object.create(i.prototype),
  9104. c = new Context(n || []);
  9105. return o(a, "_invoke", {
  9106. value: makeInvokeMethod(t, r, c)
  9107. }), a;
  9108. }
  9109. function tryCatch(t, e, r) {
  9110. try {
  9111. return {
  9112. type: "normal",
  9113. arg: t.call(e, r)
  9114. };
  9115. } catch (t) {
  9116. return {
  9117. type: "throw",
  9118. arg: t
  9119. };
  9120. }
  9121. }
  9122. e.wrap = wrap;
  9123. var h = "suspendedStart",
  9124. l = "suspendedYield",
  9125. f = "executing",
  9126. s = "completed",
  9127. y = {};
  9128. function Generator() {}
  9129. function GeneratorFunction() {}
  9130. function GeneratorFunctionPrototype() {}
  9131. var p = {};
  9132. define(p, a, function () {
  9133. return this;
  9134. });
  9135. var d = Object.getPrototypeOf,
  9136. v = d && d(d(values([])));
  9137. v && v !== r && n.call(v, a) && (p = v);
  9138. var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
  9139. function defineIteratorMethods(t) {
  9140. ["next", "throw", "return"].forEach(function (e) {
  9141. define(t, e, function (t) {
  9142. return this._invoke(e, t);
  9143. });
  9144. });
  9145. }
  9146. function AsyncIterator(t, e) {
  9147. function invoke(r, o, i, a) {
  9148. var c = tryCatch(t[r], t, o);
  9149. if ("throw" !== c.type) {
  9150. var u = c.arg,
  9151. h = u.value;
  9152. return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
  9153. invoke("next", t, i, a);
  9154. }, function (t) {
  9155. invoke("throw", t, i, a);
  9156. }) : e.resolve(h).then(function (t) {
  9157. u.value = t, i(u);
  9158. }, function (t) {
  9159. return invoke("throw", t, i, a);
  9160. });
  9161. }
  9162. a(c.arg);
  9163. }
  9164. var r;
  9165. o(this, "_invoke", {
  9166. value: function value(t, n) {
  9167. function callInvokeWithMethodAndArg() {
  9168. return new e(function (e, r) {
  9169. invoke(t, n, e, r);
  9170. });
  9171. }
  9172. return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9173. }
  9174. });
  9175. }
  9176. function makeInvokeMethod(e, r, n) {
  9177. var o = h;
  9178. return function (i, a) {
  9179. if (o === f) throw Error("Generator is already running");
  9180. if (o === s) {
  9181. if ("throw" === i) throw a;
  9182. return {
  9183. value: t,
  9184. done: !0
  9185. };
  9186. }
  9187. for (n.method = i, n.arg = a;;) {
  9188. var c = n.delegate;
  9189. if (c) {
  9190. var u = maybeInvokeDelegate(c, n);
  9191. if (u) {
  9192. if (u === y) continue;
  9193. return u;
  9194. }
  9195. }
  9196. if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
  9197. if (o === h) throw o = s, n.arg;
  9198. n.dispatchException(n.arg);
  9199. } else "return" === n.method && n.abrupt("return", n.arg);
  9200. o = f;
  9201. var p = tryCatch(e, r, n);
  9202. if ("normal" === p.type) {
  9203. if (o = n.done ? s : l, p.arg === y) continue;
  9204. return {
  9205. value: p.arg,
  9206. done: n.done
  9207. };
  9208. }
  9209. "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
  9210. }
  9211. };
  9212. }
  9213. function maybeInvokeDelegate(e, r) {
  9214. var n = r.method,
  9215. o = e.iterator[n];
  9216. if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
  9217. var i = tryCatch(o, e.iterator, r.arg);
  9218. if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
  9219. var a = i.arg;
  9220. return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
  9221. }
  9222. function pushTryEntry(t) {
  9223. var e = {
  9224. tryLoc: t[0]
  9225. };
  9226. 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
  9227. }
  9228. function resetTryEntry(t) {
  9229. var e = t.completion || {};
  9230. e.type = "normal", delete e.arg, t.completion = e;
  9231. }
  9232. function Context(t) {
  9233. this.tryEntries = [{
  9234. tryLoc: "root"
  9235. }], t.forEach(pushTryEntry, this), this.reset(!0);
  9236. }
  9237. function values(e) {
  9238. if (e || "" === e) {
  9239. var r = e[a];
  9240. if (r) return r.call(e);
  9241. if ("function" == typeof e.next) return e;
  9242. if (!isNaN(e.length)) {
  9243. var o = -1,
  9244. i = function next() {
  9245. for (; ++o < e.length;) {
  9246. if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
  9247. }
  9248. return next.value = t, next.done = !0, next;
  9249. };
  9250. return i.next = i;
  9251. }
  9252. }
  9253. throw new TypeError(_typeof(e) + " is not iterable");
  9254. }
  9255. return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
  9256. value: GeneratorFunctionPrototype,
  9257. configurable: !0
  9258. }), o(GeneratorFunctionPrototype, "constructor", {
  9259. value: GeneratorFunction,
  9260. configurable: !0
  9261. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
  9262. var e = "function" == typeof t && t.constructor;
  9263. return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
  9264. }, e.mark = function (t) {
  9265. return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
  9266. }, e.awrap = function (t) {
  9267. return {
  9268. __await: t
  9269. };
  9270. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
  9271. return this;
  9272. }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
  9273. void 0 === i && (i = Promise);
  9274. var a = new AsyncIterator(wrap(t, r, n, o), i);
  9275. return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
  9276. return t.done ? t.value : a.next();
  9277. });
  9278. }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
  9279. return this;
  9280. }), define(g, "toString", function () {
  9281. return "[object Generator]";
  9282. }), e.keys = function (t) {
  9283. var e = Object(t),
  9284. r = [];
  9285. for (var n in e) {
  9286. r.push(n);
  9287. }
  9288. return r.reverse(), function next() {
  9289. for (; r.length;) {
  9290. var t = r.pop();
  9291. if (t in e) return next.value = t, next.done = !1, next;
  9292. }
  9293. return next.done = !0, next;
  9294. };
  9295. }, e.values = values, Context.prototype = {
  9296. constructor: Context,
  9297. reset: function reset(e) {
  9298. if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) {
  9299. "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
  9300. }
  9301. },
  9302. stop: function stop() {
  9303. this.done = !0;
  9304. var t = this.tryEntries[0].completion;
  9305. if ("throw" === t.type) throw t.arg;
  9306. return this.rval;
  9307. },
  9308. dispatchException: function dispatchException(e) {
  9309. if (this.done) throw e;
  9310. var r = this;
  9311. function handle(n, o) {
  9312. return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
  9313. }
  9314. for (var o = this.tryEntries.length - 1; o >= 0; --o) {
  9315. var i = this.tryEntries[o],
  9316. a = i.completion;
  9317. if ("root" === i.tryLoc) return handle("end");
  9318. if (i.tryLoc <= this.prev) {
  9319. var c = n.call(i, "catchLoc"),
  9320. u = n.call(i, "finallyLoc");
  9321. if (c && u) {
  9322. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  9323. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  9324. } else if (c) {
  9325. if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
  9326. } else {
  9327. if (!u) throw Error("try statement without catch or finally");
  9328. if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
  9329. }
  9330. }
  9331. }
  9332. },
  9333. abrupt: function abrupt(t, e) {
  9334. for (var r = this.tryEntries.length - 1; r >= 0; --r) {
  9335. var o = this.tryEntries[r];
  9336. if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
  9337. var i = o;
  9338. break;
  9339. }
  9340. }
  9341. i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
  9342. var a = i ? i.completion : {};
  9343. return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
  9344. },
  9345. complete: function complete(t, e) {
  9346. if ("throw" === t.type) throw t.arg;
  9347. return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
  9348. },
  9349. finish: function finish(t) {
  9350. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  9351. var r = this.tryEntries[e];
  9352. if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
  9353. }
  9354. },
  9355. "catch": function _catch(t) {
  9356. for (var e = this.tryEntries.length - 1; e >= 0; --e) {
  9357. var r = this.tryEntries[e];
  9358. if (r.tryLoc === t) {
  9359. var n = r.completion;
  9360. if ("throw" === n.type) {
  9361. var o = n.arg;
  9362. resetTryEntry(r);
  9363. }
  9364. return o;
  9365. }
  9366. }
  9367. throw Error("illegal catch attempt");
  9368. },
  9369. delegateYield: function delegateYield(e, r, n) {
  9370. return this.delegate = {
  9371. iterator: values(e),
  9372. resultName: r,
  9373. nextLoc: n
  9374. }, "next" === this.method && (this.arg = t), y;
  9375. }
  9376. }, e;
  9377. }
  9378. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9379. /***/ }),
  9380. /* 42 */
  9381. /*!*****************************************************************!*\
  9382. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9383. \*****************************************************************/
  9384. /*! no static exports found */
  9385. /***/ (function(module, exports) {
  9386. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9387. try {
  9388. var info = gen[key](arg);
  9389. var value = info.value;
  9390. } catch (error) {
  9391. reject(error);
  9392. return;
  9393. }
  9394. if (info.done) {
  9395. resolve(value);
  9396. } else {
  9397. Promise.resolve(value).then(_next, _throw);
  9398. }
  9399. }
  9400. function _asyncToGenerator(fn) {
  9401. return function () {
  9402. var self = this,
  9403. args = arguments;
  9404. return new Promise(function (resolve, reject) {
  9405. var gen = fn.apply(self, args);
  9406. function _next(value) {
  9407. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9408. }
  9409. function _throw(err) {
  9410. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9411. }
  9412. _next(undefined);
  9413. });
  9414. };
  9415. }
  9416. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9417. /***/ }),
  9418. /* 43 */
  9419. /*!************************************************************************!*\
  9420. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/api/user.js ***!
  9421. \************************************************************************/
  9422. /*! no static exports found */
  9423. /***/ (function(module, exports, __webpack_require__) {
  9424. "use strict";
  9425. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9426. Object.defineProperty(exports, "__esModule", {
  9427. value: true
  9428. });
  9429. exports.American = American;
  9430. exports.Domestic = Domestic;
  9431. exports.Variety = Variety;
  9432. var _request = _interopRequireDefault(__webpack_require__(/*! ../utils/request */ 44));
  9433. // 国产剧
  9434. function Domestic() {
  9435. return (0, _request.default)({
  9436. url: "rexxar/api/v2/subject_collection/tv_domestic/items?start=0&count=8",
  9437. method: 'get'
  9438. });
  9439. }
  9440. // 综艺
  9441. function Variety() {
  9442. return (0, _request.default)({
  9443. url: "rexxar/api/v2/subject_collection/tv_variety_show/items?start=0&count=8",
  9444. method: 'get'
  9445. });
  9446. }
  9447. // 美剧
  9448. function American() {
  9449. return (0, _request.default)({
  9450. url: "rexxar/api/v2/subject_collection/tv_american/items?start=0&count=8",
  9451. method: 'get'
  9452. });
  9453. }
  9454. /***/ }),
  9455. /* 44 */
  9456. /*!*****************************************************************************!*\
  9457. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/utils/request.js ***!
  9458. \*****************************************************************************/
  9459. /*! no static exports found */
  9460. /***/ (function(module, exports, __webpack_require__) {
  9461. "use strict";
  9462. /* WEBPACK VAR INJECTION */(function(uni) {
  9463. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9464. Object.defineProperty(exports, "__esModule", {
  9465. value: true
  9466. });
  9467. exports.default = void 0;
  9468. var _axios = _interopRequireDefault(__webpack_require__(/*! axios */ 45));
  9469. // 适配uniapp所有端
  9470. var uniAdapter = function uniAdapter(config) {
  9471. return new Promise(function (resolve, reject) {
  9472. uni.request({
  9473. method: config.method.toUpperCase(),
  9474. url: config.baseURL + config.url,
  9475. data: config.data,
  9476. header: config.headers,
  9477. timeout: config.timeout,
  9478. success: function success(res) {
  9479. resolve({
  9480. data: res.data,
  9481. status: res.statusCode,
  9482. config: config,
  9483. headers: res.header
  9484. });
  9485. },
  9486. fail: function fail(err) {
  9487. reject(new Error(err.errMsg || '请求失败'));
  9488. }
  9489. });
  9490. });
  9491. };
  9492. var instance = _axios.default.create({
  9493. baseURL: 'https://m.douban.com/',
  9494. timeout: 100000,
  9495. adapter: uniAdapter
  9496. });
  9497. // 添加请求拦截器
  9498. instance.interceptors.request.use(function (config) {
  9499. // 在发送请求之前做些什么
  9500. return config;
  9501. }, function (error) {
  9502. // 对请求错误做些什么
  9503. return Promise.reject(error);
  9504. });
  9505. // 添加响应拦截器
  9506. instance.interceptors.response.use(function (response) {
  9507. // 2xx 范围内的状态码都会触发该函数。
  9508. // 对响应数据做点什么
  9509. return response.data;
  9510. }, function (error) {
  9511. // 超出 2xx 范围的状态码都会触发该函数。
  9512. // 对响应错误做点什么
  9513. return Promise.reject(error);
  9514. });
  9515. var _default = instance;
  9516. exports.default = _default;
  9517. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9518. /***/ }),
  9519. /* 45 */
  9520. /*!****************************************************************************************!*\
  9521. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/index.js ***!
  9522. \****************************************************************************************/
  9523. /*! no static exports found */
  9524. /***/ (function(module, exports, __webpack_require__) {
  9525. "use strict";
  9526. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9527. Object.defineProperty(exports, "__esModule", {
  9528. value: true
  9529. });
  9530. exports.all = exports.VERSION = exports.HttpStatusCode = exports.CanceledError = exports.CancelToken = exports.Cancel = exports.AxiosHeaders = exports.AxiosError = exports.Axios = void 0;
  9531. Object.defineProperty(exports, "default", {
  9532. enumerable: true,
  9533. get: function get() {
  9534. return _axios.default;
  9535. }
  9536. });
  9537. exports.toFormData = exports.spread = exports.mergeConfig = exports.isCancel = exports.isAxiosError = exports.getAdapter = exports.formToJSON = void 0;
  9538. var _axios = _interopRequireDefault(__webpack_require__(/*! ./lib/axios.js */ 46));
  9539. // This module is intended to unwrap Axios default export as named.
  9540. // Keep top-level export same with static properties
  9541. // so that it can keep same with es module or cjs
  9542. var Axios = _axios.default.Axios,
  9543. AxiosError = _axios.default.AxiosError,
  9544. CanceledError = _axios.default.CanceledError,
  9545. isCancel = _axios.default.isCancel,
  9546. CancelToken = _axios.default.CancelToken,
  9547. VERSION = _axios.default.VERSION,
  9548. all = _axios.default.all,
  9549. Cancel = _axios.default.Cancel,
  9550. isAxiosError = _axios.default.isAxiosError,
  9551. spread = _axios.default.spread,
  9552. toFormData = _axios.default.toFormData,
  9553. AxiosHeaders = _axios.default.AxiosHeaders,
  9554. HttpStatusCode = _axios.default.HttpStatusCode,
  9555. formToJSON = _axios.default.formToJSON,
  9556. getAdapter = _axios.default.getAdapter,
  9557. mergeConfig = _axios.default.mergeConfig;
  9558. exports.mergeConfig = mergeConfig;
  9559. exports.getAdapter = getAdapter;
  9560. exports.formToJSON = formToJSON;
  9561. exports.HttpStatusCode = HttpStatusCode;
  9562. exports.AxiosHeaders = AxiosHeaders;
  9563. exports.toFormData = toFormData;
  9564. exports.spread = spread;
  9565. exports.isAxiosError = isAxiosError;
  9566. exports.Cancel = Cancel;
  9567. exports.all = all;
  9568. exports.VERSION = VERSION;
  9569. exports.CancelToken = CancelToken;
  9570. exports.isCancel = isCancel;
  9571. exports.CanceledError = CanceledError;
  9572. exports.AxiosError = AxiosError;
  9573. exports.Axios = Axios;
  9574. /***/ }),
  9575. /* 46 */
  9576. /*!********************************************************************************************!*\
  9577. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/axios.js ***!
  9578. \********************************************************************************************/
  9579. /*! no static exports found */
  9580. /***/ (function(module, exports, __webpack_require__) {
  9581. "use strict";
  9582. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9583. Object.defineProperty(exports, "__esModule", {
  9584. value: true
  9585. });
  9586. exports.default = void 0;
  9587. var _utils = _interopRequireDefault(__webpack_require__(/*! ./utils.js */ 47));
  9588. var _bind = _interopRequireDefault(__webpack_require__(/*! ./helpers/bind.js */ 50));
  9589. var _Axios = _interopRequireDefault(__webpack_require__(/*! ./core/Axios.js */ 51));
  9590. var _mergeConfig = _interopRequireDefault(__webpack_require__(/*! ./core/mergeConfig.js */ 97));
  9591. var _index = _interopRequireDefault(__webpack_require__(/*! ./defaults/index.js */ 70));
  9592. var _formDataToJSON = _interopRequireDefault(__webpack_require__(/*! ./helpers/formDataToJSON.js */ 79));
  9593. var _CanceledError = _interopRequireDefault(__webpack_require__(/*! ./cancel/CanceledError.js */ 83));
  9594. var _CancelToken = _interopRequireDefault(__webpack_require__(/*! ./cancel/CancelToken.js */ 108));
  9595. var _isCancel = _interopRequireDefault(__webpack_require__(/*! ./cancel/isCancel.js */ 82));
  9596. var _data = __webpack_require__(/*! ./env/data.js */ 107);
  9597. var _toFormData = _interopRequireDefault(__webpack_require__(/*! ./helpers/toFormData.js */ 54));
  9598. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ./core/AxiosError.js */ 59));
  9599. var _spread = _interopRequireDefault(__webpack_require__(/*! ./helpers/spread.js */ 109));
  9600. var _isAxiosError = _interopRequireDefault(__webpack_require__(/*! ./helpers/isAxiosError.js */ 110));
  9601. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ./core/AxiosHeaders.js */ 80));
  9602. var _adapters = _interopRequireDefault(__webpack_require__(/*! ./adapters/adapters.js */ 84));
  9603. var _HttpStatusCode = _interopRequireDefault(__webpack_require__(/*! ./helpers/HttpStatusCode.js */ 111));
  9604. /**
  9605. * Create an instance of Axios
  9606. *
  9607. * @param {Object} defaultConfig The default config for the instance
  9608. *
  9609. * @returns {Axios} A new instance of Axios
  9610. */
  9611. function createInstance(defaultConfig) {
  9612. var context = new _Axios.default(defaultConfig);
  9613. var instance = (0, _bind.default)(_Axios.default.prototype.request, context);
  9614. // Copy axios.prototype to instance
  9615. _utils.default.extend(instance, _Axios.default.prototype, context, {
  9616. allOwnKeys: true
  9617. });
  9618. // Copy context to instance
  9619. _utils.default.extend(instance, context, null, {
  9620. allOwnKeys: true
  9621. });
  9622. // Factory for creating new instances
  9623. instance.create = function create(instanceConfig) {
  9624. return createInstance((0, _mergeConfig.default)(defaultConfig, instanceConfig));
  9625. };
  9626. return instance;
  9627. }
  9628. // Create the default instance to be exported
  9629. var axios = createInstance(_index.default);
  9630. // Expose Axios class to allow class inheritance
  9631. axios.Axios = _Axios.default;
  9632. // Expose Cancel & CancelToken
  9633. axios.CanceledError = _CanceledError.default;
  9634. axios.CancelToken = _CancelToken.default;
  9635. axios.isCancel = _isCancel.default;
  9636. axios.VERSION = _data.VERSION;
  9637. axios.toFormData = _toFormData.default;
  9638. // Expose AxiosError class
  9639. axios.AxiosError = _AxiosError.default;
  9640. // alias for CanceledError for backward compatibility
  9641. axios.Cancel = axios.CanceledError;
  9642. // Expose all/spread
  9643. axios.all = function all(promises) {
  9644. return Promise.all(promises);
  9645. };
  9646. axios.spread = _spread.default;
  9647. // Expose isAxiosError
  9648. axios.isAxiosError = _isAxiosError.default;
  9649. // Expose mergeConfig
  9650. axios.mergeConfig = _mergeConfig.default;
  9651. axios.AxiosHeaders = _AxiosHeaders.default;
  9652. axios.formToJSON = function (thing) {
  9653. return (0, _formDataToJSON.default)(_utils.default.isHTMLForm(thing) ? new FormData(thing) : thing);
  9654. };
  9655. axios.getAdapter = _adapters.default.getAdapter;
  9656. axios.HttpStatusCode = _HttpStatusCode.default;
  9657. axios.default = axios;
  9658. // this module should only have a default export
  9659. var _default = axios;
  9660. exports.default = _default;
  9661. /***/ }),
  9662. /* 47 */
  9663. /*!********************************************************************************************!*\
  9664. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/utils.js ***!
  9665. \********************************************************************************************/
  9666. /*! no static exports found */
  9667. /***/ (function(module, exports, __webpack_require__) {
  9668. "use strict";
  9669. /* WEBPACK VAR INJECTION */(function(global, process) {
  9670. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9671. Object.defineProperty(exports, "__esModule", {
  9672. value: true
  9673. });
  9674. exports.default = void 0;
  9675. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  9676. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9677. var _bind = _interopRequireDefault(__webpack_require__(/*! ./helpers/bind.js */ 50));
  9678. // utils is a library of generic helper functions non-specific to axios
  9679. var toString = Object.prototype.toString;
  9680. var getPrototypeOf = Object.getPrototypeOf;
  9681. var iterator = Symbol.iterator,
  9682. toStringTag = Symbol.toStringTag;
  9683. var kindOf = function (cache) {
  9684. return function (thing) {
  9685. var str = toString.call(thing);
  9686. return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
  9687. };
  9688. }(Object.create(null));
  9689. var kindOfTest = function kindOfTest(type) {
  9690. type = type.toLowerCase();
  9691. return function (thing) {
  9692. return kindOf(thing) === type;
  9693. };
  9694. };
  9695. var typeOfTest = function typeOfTest(type) {
  9696. return function (thing) {
  9697. return (0, _typeof2.default)(thing) === type;
  9698. };
  9699. };
  9700. /**
  9701. * Determine if a value is a non-null object
  9702. *
  9703. * @param {Object} val The value to test
  9704. *
  9705. * @returns {boolean} True if value is an Array, otherwise false
  9706. */
  9707. var isArray = Array.isArray;
  9708. /**
  9709. * Determine if a value is undefined
  9710. *
  9711. * @param {*} val The value to test
  9712. *
  9713. * @returns {boolean} True if the value is undefined, otherwise false
  9714. */
  9715. var isUndefined = typeOfTest('undefined');
  9716. /**
  9717. * Determine if a value is a Buffer
  9718. *
  9719. * @param {*} val The value to test
  9720. *
  9721. * @returns {boolean} True if value is a Buffer, otherwise false
  9722. */
  9723. function isBuffer(val) {
  9724. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
  9725. }
  9726. /**
  9727. * Determine if a value is an ArrayBuffer
  9728. *
  9729. * @param {*} val The value to test
  9730. *
  9731. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  9732. */
  9733. var isArrayBuffer = kindOfTest('ArrayBuffer');
  9734. /**
  9735. * Determine if a value is a view on an ArrayBuffer
  9736. *
  9737. * @param {*} val The value to test
  9738. *
  9739. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  9740. */
  9741. function isArrayBufferView(val) {
  9742. var result;
  9743. if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
  9744. result = ArrayBuffer.isView(val);
  9745. } else {
  9746. result = val && val.buffer && isArrayBuffer(val.buffer);
  9747. }
  9748. return result;
  9749. }
  9750. /**
  9751. * Determine if a value is a String
  9752. *
  9753. * @param {*} val The value to test
  9754. *
  9755. * @returns {boolean} True if value is a String, otherwise false
  9756. */
  9757. var isString = typeOfTest('string');
  9758. /**
  9759. * Determine if a value is a Function
  9760. *
  9761. * @param {*} val The value to test
  9762. * @returns {boolean} True if value is a Function, otherwise false
  9763. */
  9764. var isFunction = typeOfTest('function');
  9765. /**
  9766. * Determine if a value is a Number
  9767. *
  9768. * @param {*} val The value to test
  9769. *
  9770. * @returns {boolean} True if value is a Number, otherwise false
  9771. */
  9772. var isNumber = typeOfTest('number');
  9773. /**
  9774. * Determine if a value is an Object
  9775. *
  9776. * @param {*} thing The value to test
  9777. *
  9778. * @returns {boolean} True if value is an Object, otherwise false
  9779. */
  9780. var isObject = function isObject(thing) {
  9781. return thing !== null && (0, _typeof2.default)(thing) === 'object';
  9782. };
  9783. /**
  9784. * Determine if a value is a Boolean
  9785. *
  9786. * @param {*} thing The value to test
  9787. * @returns {boolean} True if value is a Boolean, otherwise false
  9788. */
  9789. var isBoolean = function isBoolean(thing) {
  9790. return thing === true || thing === false;
  9791. };
  9792. /**
  9793. * Determine if a value is a plain Object
  9794. *
  9795. * @param {*} val The value to test
  9796. *
  9797. * @returns {boolean} True if value is a plain Object, otherwise false
  9798. */
  9799. var isPlainObject = function isPlainObject(val) {
  9800. if (kindOf(val) !== 'object') {
  9801. return false;
  9802. }
  9803. var prototype = getPrototypeOf(val);
  9804. return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
  9805. };
  9806. /**
  9807. * Determine if a value is an empty object (safely handles Buffers)
  9808. *
  9809. * @param {*} val The value to test
  9810. *
  9811. * @returns {boolean} True if value is an empty object, otherwise false
  9812. */
  9813. var isEmptyObject = function isEmptyObject(val) {
  9814. // Early return for non-objects or Buffers to prevent RangeError
  9815. if (!isObject(val) || isBuffer(val)) {
  9816. return false;
  9817. }
  9818. try {
  9819. return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
  9820. } catch (e) {
  9821. // Fallback for any other objects that might cause RangeError with Object.keys()
  9822. return false;
  9823. }
  9824. };
  9825. /**
  9826. * Determine if a value is a Date
  9827. *
  9828. * @param {*} val The value to test
  9829. *
  9830. * @returns {boolean} True if value is a Date, otherwise false
  9831. */
  9832. var isDate = kindOfTest('Date');
  9833. /**
  9834. * Determine if a value is a File
  9835. *
  9836. * @param {*} val The value to test
  9837. *
  9838. * @returns {boolean} True if value is a File, otherwise false
  9839. */
  9840. var isFile = kindOfTest('File');
  9841. /**
  9842. * Determine if a value is a React Native Blob
  9843. * React Native "blob": an object with a `uri` attribute. Optionally, it can
  9844. * also have a `name` and `type` attribute to specify filename and content type
  9845. *
  9846. * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
  9847. *
  9848. * @param {*} value The value to test
  9849. *
  9850. * @returns {boolean} True if value is a React Native Blob, otherwise false
  9851. */
  9852. var isReactNativeBlob = function isReactNativeBlob(value) {
  9853. return !!(value && typeof value.uri !== 'undefined');
  9854. };
  9855. /**
  9856. * Determine if environment is React Native
  9857. * ReactNative `FormData` has a non-standard `getParts()` method
  9858. *
  9859. * @param {*} formData The formData to test
  9860. *
  9861. * @returns {boolean} True if environment is React Native, otherwise false
  9862. */
  9863. var isReactNative = function isReactNative(formData) {
  9864. return formData && typeof formData.getParts !== 'undefined';
  9865. };
  9866. /**
  9867. * Determine if a value is a Blob
  9868. *
  9869. * @param {*} val The value to test
  9870. *
  9871. * @returns {boolean} True if value is a Blob, otherwise false
  9872. */
  9873. var isBlob = kindOfTest('Blob');
  9874. /**
  9875. * Determine if a value is a FileList
  9876. *
  9877. * @param {*} val The value to test
  9878. *
  9879. * @returns {boolean} True if value is a File, otherwise false
  9880. */
  9881. var isFileList = kindOfTest('FileList');
  9882. /**
  9883. * Determine if a value is a Stream
  9884. *
  9885. * @param {*} val The value to test
  9886. *
  9887. * @returns {boolean} True if value is a Stream, otherwise false
  9888. */
  9889. var isStream = function isStream(val) {
  9890. return isObject(val) && isFunction(val.pipe);
  9891. };
  9892. /**
  9893. * Determine if a value is a FormData
  9894. *
  9895. * @param {*} thing The value to test
  9896. *
  9897. * @returns {boolean} True if value is an FormData, otherwise false
  9898. */
  9899. function getGlobal() {
  9900. if (typeof globalThis !== 'undefined') return globalThis;
  9901. if (typeof self !== 'undefined') return self;
  9902. if (typeof window !== 'undefined') return window;
  9903. if (typeof global !== 'undefined') return global;
  9904. return {};
  9905. }
  9906. var G = getGlobal();
  9907. var FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
  9908. var isFormData = function isFormData(thing) {
  9909. if (!thing) return false;
  9910. if (FormDataCtor && thing instanceof FormDataCtor) return true;
  9911. // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
  9912. var proto = getPrototypeOf(thing);
  9913. if (!proto || proto === Object.prototype) return false;
  9914. if (!isFunction(thing.append)) return false;
  9915. var kind = kindOf(thing);
  9916. return kind === 'formdata' ||
  9917. // detect form-data instance
  9918. kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]';
  9919. };
  9920. /**
  9921. * Determine if a value is a URLSearchParams object
  9922. *
  9923. * @param {*} val The value to test
  9924. *
  9925. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  9926. */
  9927. var isURLSearchParams = kindOfTest('URLSearchParams');
  9928. var _map = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest),
  9929. _map2 = (0, _slicedToArray2.default)(_map, 4),
  9930. isReadableStream = _map2[0],
  9931. isRequest = _map2[1],
  9932. isResponse = _map2[2],
  9933. isHeaders = _map2[3];
  9934. /**
  9935. * Trim excess whitespace off the beginning and end of a string
  9936. *
  9937. * @param {String} str The String to trim
  9938. *
  9939. * @returns {String} The String freed of excess whitespace
  9940. */
  9941. var trim = function trim(str) {
  9942. return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
  9943. };
  9944. /**
  9945. * Iterate over an Array or an Object invoking a function for each item.
  9946. *
  9947. * If `obj` is an Array callback will be called passing
  9948. * the value, index, and complete array for each item.
  9949. *
  9950. * If 'obj' is an Object callback will be called passing
  9951. * the value, key, and complete object for each property.
  9952. *
  9953. * @param {Object|Array<unknown>} obj The object to iterate
  9954. * @param {Function} fn The callback to invoke for each item
  9955. *
  9956. * @param {Object} [options]
  9957. * @param {Boolean} [options.allOwnKeys = false]
  9958. * @returns {any}
  9959. */
  9960. function forEach(obj, fn) {
  9961. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  9962. _ref$allOwnKeys = _ref.allOwnKeys,
  9963. allOwnKeys = _ref$allOwnKeys === void 0 ? false : _ref$allOwnKeys;
  9964. // Don't bother if no value provided
  9965. if (obj === null || typeof obj === 'undefined') {
  9966. return;
  9967. }
  9968. var i;
  9969. var l;
  9970. // Force an array if not already something iterable
  9971. if ((0, _typeof2.default)(obj) !== 'object') {
  9972. /*eslint no-param-reassign:0*/
  9973. obj = [obj];
  9974. }
  9975. if (isArray(obj)) {
  9976. // Iterate over array values
  9977. for (i = 0, l = obj.length; i < l; i++) {
  9978. fn.call(null, obj[i], i, obj);
  9979. }
  9980. } else {
  9981. // Buffer check
  9982. if (isBuffer(obj)) {
  9983. return;
  9984. }
  9985. // Iterate over object keys
  9986. var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
  9987. var len = keys.length;
  9988. var key;
  9989. for (i = 0; i < len; i++) {
  9990. key = keys[i];
  9991. fn.call(null, obj[key], key, obj);
  9992. }
  9993. }
  9994. }
  9995. /**
  9996. * Finds a key in an object, case-insensitive, returning the actual key name.
  9997. * Returns null if the object is a Buffer or if no match is found.
  9998. *
  9999. * @param {Object} obj - The object to search.
  10000. * @param {string} key - The key to find (case-insensitive).
  10001. * @returns {?string} The actual key name if found, otherwise null.
  10002. */
  10003. function findKey(obj, key) {
  10004. if (isBuffer(obj)) {
  10005. return null;
  10006. }
  10007. key = key.toLowerCase();
  10008. var keys = Object.keys(obj);
  10009. var i = keys.length;
  10010. var _key;
  10011. while (i-- > 0) {
  10012. _key = keys[i];
  10013. if (key === _key.toLowerCase()) {
  10014. return _key;
  10015. }
  10016. }
  10017. return null;
  10018. }
  10019. var _global = function () {
  10020. /*eslint no-undef:0*/
  10021. if (typeof globalThis !== 'undefined') return globalThis;
  10022. return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
  10023. }();
  10024. var isContextDefined = function isContextDefined(context) {
  10025. return !isUndefined(context) && context !== _global;
  10026. };
  10027. /**
  10028. * Accepts varargs expecting each argument to be an object, then
  10029. * immutably merges the properties of each object and returns result.
  10030. *
  10031. * When multiple objects contain the same key the later object in
  10032. * the arguments list will take precedence.
  10033. *
  10034. * Example:
  10035. *
  10036. * ```js
  10037. * const result = merge({foo: 123}, {foo: 456});
  10038. * console.log(result.foo); // outputs 456
  10039. * ```
  10040. *
  10041. * @param {Object} obj1 Object to merge
  10042. *
  10043. * @returns {Object} Result of all merge properties
  10044. */
  10045. function merge( /* obj1, obj2, obj3, ... */
  10046. ) {
  10047. var _ref2 = isContextDefined(this) && this || {},
  10048. caseless = _ref2.caseless,
  10049. skipUndefined = _ref2.skipUndefined;
  10050. var result = {};
  10051. var assignValue = function assignValue(val, key) {
  10052. // Skip dangerous property names to prevent prototype pollution
  10053. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  10054. return;
  10055. }
  10056. var targetKey = caseless && findKey(result, key) || key;
  10057. if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
  10058. result[targetKey] = merge(result[targetKey], val);
  10059. } else if (isPlainObject(val)) {
  10060. result[targetKey] = merge({}, val);
  10061. } else if (isArray(val)) {
  10062. result[targetKey] = val.slice();
  10063. } else if (!skipUndefined || !isUndefined(val)) {
  10064. result[targetKey] = val;
  10065. }
  10066. };
  10067. for (var i = 0, l = arguments.length; i < l; i++) {
  10068. arguments[i] && forEach(arguments[i], assignValue);
  10069. }
  10070. return result;
  10071. }
  10072. /**
  10073. * Extends object a by mutably adding to it the properties of object b.
  10074. *
  10075. * @param {Object} a The object to be extended
  10076. * @param {Object} b The object to copy properties from
  10077. * @param {Object} thisArg The object to bind function to
  10078. *
  10079. * @param {Object} [options]
  10080. * @param {Boolean} [options.allOwnKeys]
  10081. * @returns {Object} The resulting value of object a
  10082. */
  10083. var extend = function extend(a, b, thisArg) {
  10084. var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
  10085. allOwnKeys = _ref3.allOwnKeys;
  10086. forEach(b, function (val, key) {
  10087. if (thisArg && isFunction(val)) {
  10088. Object.defineProperty(a, key, {
  10089. value: (0, _bind.default)(val, thisArg),
  10090. writable: true,
  10091. enumerable: true,
  10092. configurable: true
  10093. });
  10094. } else {
  10095. Object.defineProperty(a, key, {
  10096. value: val,
  10097. writable: true,
  10098. enumerable: true,
  10099. configurable: true
  10100. });
  10101. }
  10102. }, {
  10103. allOwnKeys: allOwnKeys
  10104. });
  10105. return a;
  10106. };
  10107. /**
  10108. * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  10109. *
  10110. * @param {string} content with BOM
  10111. *
  10112. * @returns {string} content value without BOM
  10113. */
  10114. var stripBOM = function stripBOM(content) {
  10115. if (content.charCodeAt(0) === 0xfeff) {
  10116. content = content.slice(1);
  10117. }
  10118. return content;
  10119. };
  10120. /**
  10121. * Inherit the prototype methods from one constructor into another
  10122. * @param {function} constructor
  10123. * @param {function} superConstructor
  10124. * @param {object} [props]
  10125. * @param {object} [descriptors]
  10126. *
  10127. * @returns {void}
  10128. */
  10129. var inherits = function inherits(constructor, superConstructor, props, descriptors) {
  10130. constructor.prototype = Object.create(superConstructor.prototype, descriptors);
  10131. Object.defineProperty(constructor.prototype, 'constructor', {
  10132. value: constructor,
  10133. writable: true,
  10134. enumerable: false,
  10135. configurable: true
  10136. });
  10137. Object.defineProperty(constructor, 'super', {
  10138. value: superConstructor.prototype
  10139. });
  10140. props && Object.assign(constructor.prototype, props);
  10141. };
  10142. /**
  10143. * Resolve object with deep prototype chain to a flat object
  10144. * @param {Object} sourceObj source object
  10145. * @param {Object} [destObj]
  10146. * @param {Function|Boolean} [filter]
  10147. * @param {Function} [propFilter]
  10148. *
  10149. * @returns {Object}
  10150. */
  10151. var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) {
  10152. var props;
  10153. var i;
  10154. var prop;
  10155. var merged = {};
  10156. destObj = destObj || {};
  10157. // eslint-disable-next-line no-eq-null,eqeqeq
  10158. if (sourceObj == null) return destObj;
  10159. do {
  10160. props = Object.getOwnPropertyNames(sourceObj);
  10161. i = props.length;
  10162. while (i-- > 0) {
  10163. prop = props[i];
  10164. if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
  10165. destObj[prop] = sourceObj[prop];
  10166. merged[prop] = true;
  10167. }
  10168. }
  10169. sourceObj = filter !== false && getPrototypeOf(sourceObj);
  10170. } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
  10171. return destObj;
  10172. };
  10173. /**
  10174. * Determines whether a string ends with the characters of a specified string
  10175. *
  10176. * @param {String} str
  10177. * @param {String} searchString
  10178. * @param {Number} [position= 0]
  10179. *
  10180. * @returns {boolean}
  10181. */
  10182. var endsWith = function endsWith(str, searchString, position) {
  10183. str = String(str);
  10184. if (position === undefined || position > str.length) {
  10185. position = str.length;
  10186. }
  10187. position -= searchString.length;
  10188. var lastIndex = str.indexOf(searchString, position);
  10189. return lastIndex !== -1 && lastIndex === position;
  10190. };
  10191. /**
  10192. * Returns new array from array like object or null if failed
  10193. *
  10194. * @param {*} [thing]
  10195. *
  10196. * @returns {?Array}
  10197. */
  10198. var toArray = function toArray(thing) {
  10199. if (!thing) return null;
  10200. if (isArray(thing)) return thing;
  10201. var i = thing.length;
  10202. if (!isNumber(i)) return null;
  10203. var arr = new Array(i);
  10204. while (i-- > 0) {
  10205. arr[i] = thing[i];
  10206. }
  10207. return arr;
  10208. };
  10209. /**
  10210. * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
  10211. * thing passed in is an instance of Uint8Array
  10212. *
  10213. * @param {TypedArray}
  10214. *
  10215. * @returns {Array}
  10216. */
  10217. // eslint-disable-next-line func-names
  10218. var isTypedArray = function (TypedArray) {
  10219. // eslint-disable-next-line func-names
  10220. return function (thing) {
  10221. return TypedArray && thing instanceof TypedArray;
  10222. };
  10223. }(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
  10224. /**
  10225. * For each entry in the object, call the function with the key and value.
  10226. *
  10227. * @param {Object<any, any>} obj - The object to iterate over.
  10228. * @param {Function} fn - The function to call for each entry.
  10229. *
  10230. * @returns {void}
  10231. */
  10232. var forEachEntry = function forEachEntry(obj, fn) {
  10233. var generator = obj && obj[iterator];
  10234. var _iterator = generator.call(obj);
  10235. var result;
  10236. while ((result = _iterator.next()) && !result.done) {
  10237. var pair = result.value;
  10238. fn.call(obj, pair[0], pair[1]);
  10239. }
  10240. };
  10241. /**
  10242. * It takes a regular expression and a string, and returns an array of all the matches
  10243. *
  10244. * @param {string} regExp - The regular expression to match against.
  10245. * @param {string} str - The string to search.
  10246. *
  10247. * @returns {Array<boolean>}
  10248. */
  10249. var matchAll = function matchAll(regExp, str) {
  10250. var matches;
  10251. var arr = [];
  10252. while ((matches = regExp.exec(str)) !== null) {
  10253. arr.push(matches);
  10254. }
  10255. return arr;
  10256. };
  10257. /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
  10258. var isHTMLForm = kindOfTest('HTMLFormElement');
  10259. var toCamelCase = function toCamelCase(str) {
  10260. return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
  10261. return p1.toUpperCase() + p2;
  10262. });
  10263. };
  10264. /* Creating a function that will check if an object has a property. */
  10265. var hasOwnProperty = function (_ref4) {
  10266. var hasOwnProperty = _ref4.hasOwnProperty;
  10267. return function (obj, prop) {
  10268. return hasOwnProperty.call(obj, prop);
  10269. };
  10270. }(Object.prototype);
  10271. /**
  10272. * Determine if a value is a RegExp object
  10273. *
  10274. * @param {*} val The value to test
  10275. *
  10276. * @returns {boolean} True if value is a RegExp object, otherwise false
  10277. */
  10278. var isRegExp = kindOfTest('RegExp');
  10279. var reduceDescriptors = function reduceDescriptors(obj, reducer) {
  10280. var descriptors = Object.getOwnPropertyDescriptors(obj);
  10281. var reducedDescriptors = {};
  10282. forEach(descriptors, function (descriptor, name) {
  10283. var ret;
  10284. if ((ret = reducer(descriptor, name, obj)) !== false) {
  10285. reducedDescriptors[name] = ret || descriptor;
  10286. }
  10287. });
  10288. Object.defineProperties(obj, reducedDescriptors);
  10289. };
  10290. /**
  10291. * Makes all methods read-only
  10292. * @param {Object} obj
  10293. */
  10294. var freezeMethods = function freezeMethods(obj) {
  10295. reduceDescriptors(obj, function (descriptor, name) {
  10296. // skip restricted props in strict mode
  10297. if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
  10298. return false;
  10299. }
  10300. var value = obj[name];
  10301. if (!isFunction(value)) return;
  10302. descriptor.enumerable = false;
  10303. if ('writable' in descriptor) {
  10304. descriptor.writable = false;
  10305. return;
  10306. }
  10307. if (!descriptor.set) {
  10308. descriptor.set = function () {
  10309. throw Error("Can not rewrite read-only method '" + name + "'");
  10310. };
  10311. }
  10312. });
  10313. };
  10314. /**
  10315. * Converts an array or a delimited string into an object set with values as keys and true as values.
  10316. * Useful for fast membership checks.
  10317. *
  10318. * @param {Array|string} arrayOrString - The array or string to convert.
  10319. * @param {string} delimiter - The delimiter to use if input is a string.
  10320. * @returns {Object} An object with keys from the array or string, values set to true.
  10321. */
  10322. var toObjectSet = function toObjectSet(arrayOrString, delimiter) {
  10323. var obj = {};
  10324. var define = function define(arr) {
  10325. arr.forEach(function (value) {
  10326. obj[value] = true;
  10327. });
  10328. };
  10329. isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
  10330. return obj;
  10331. };
  10332. var noop = function noop() {};
  10333. var toFiniteNumber = function toFiniteNumber(value, defaultValue) {
  10334. return value != null && Number.isFinite(value = +value) ? value : defaultValue;
  10335. };
  10336. /**
  10337. * If the thing is a FormData object, return true, otherwise return false.
  10338. *
  10339. * @param {unknown} thing - The thing to check.
  10340. *
  10341. * @returns {boolean}
  10342. */
  10343. function isSpecCompliantForm(thing) {
  10344. return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
  10345. }
  10346. /**
  10347. * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
  10348. *
  10349. * @param {Object} obj - The object to convert.
  10350. * @returns {Object} The JSON-compatible object.
  10351. */
  10352. var toJSONObject = function toJSONObject(obj) {
  10353. var stack = new Array(10);
  10354. var visit = function visit(source, i) {
  10355. if (isObject(source)) {
  10356. if (stack.indexOf(source) >= 0) {
  10357. return;
  10358. }
  10359. //Buffer check
  10360. if (isBuffer(source)) {
  10361. return source;
  10362. }
  10363. if (!('toJSON' in source)) {
  10364. stack[i] = source;
  10365. var target = isArray(source) ? [] : {};
  10366. forEach(source, function (value, key) {
  10367. var reducedValue = visit(value, i + 1);
  10368. !isUndefined(reducedValue) && (target[key] = reducedValue);
  10369. });
  10370. stack[i] = undefined;
  10371. return target;
  10372. }
  10373. }
  10374. return source;
  10375. };
  10376. return visit(obj, 0);
  10377. };
  10378. /**
  10379. * Determines if a value is an async function.
  10380. *
  10381. * @param {*} thing - The value to test.
  10382. * @returns {boolean} True if value is an async function, otherwise false.
  10383. */
  10384. var isAsyncFn = kindOfTest('AsyncFunction');
  10385. /**
  10386. * Determines if a value is thenable (has then and catch methods).
  10387. *
  10388. * @param {*} thing - The value to test.
  10389. * @returns {boolean} True if value is thenable, otherwise false.
  10390. */
  10391. var isThenable = function isThenable(thing) {
  10392. return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
  10393. };
  10394. // original code
  10395. // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
  10396. /**
  10397. * Provides a cross-platform setImmediate implementation.
  10398. * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
  10399. *
  10400. * @param {boolean} setImmediateSupported - Whether setImmediate is supported.
  10401. * @param {boolean} postMessageSupported - Whether postMessage is supported.
  10402. * @returns {Function} A function to schedule a callback asynchronously.
  10403. */
  10404. var _setImmediate = function (setImmediateSupported, postMessageSupported) {
  10405. if (setImmediateSupported) {
  10406. return setImmediate;
  10407. }
  10408. return postMessageSupported ? function (token, callbacks) {
  10409. _global.addEventListener('message', function (_ref5) {
  10410. var source = _ref5.source,
  10411. data = _ref5.data;
  10412. if (source === _global && data === token) {
  10413. callbacks.length && callbacks.shift()();
  10414. }
  10415. }, false);
  10416. return function (cb) {
  10417. callbacks.push(cb);
  10418. _global.postMessage(token, '*');
  10419. };
  10420. }("axios@".concat(Math.random()), []) : function (cb) {
  10421. return setTimeout(cb);
  10422. };
  10423. }(typeof setImmediate === 'function', isFunction(_global.postMessage));
  10424. /**
  10425. * Schedules a microtask or asynchronous callback as soon as possible.
  10426. * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
  10427. *
  10428. * @type {Function}
  10429. */
  10430. var asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
  10431. // *********************
  10432. var isIterable = function isIterable(thing) {
  10433. return thing != null && isFunction(thing[iterator]);
  10434. };
  10435. var _default = {
  10436. isArray: isArray,
  10437. isArrayBuffer: isArrayBuffer,
  10438. isBuffer: isBuffer,
  10439. isFormData: isFormData,
  10440. isArrayBufferView: isArrayBufferView,
  10441. isString: isString,
  10442. isNumber: isNumber,
  10443. isBoolean: isBoolean,
  10444. isObject: isObject,
  10445. isPlainObject: isPlainObject,
  10446. isEmptyObject: isEmptyObject,
  10447. isReadableStream: isReadableStream,
  10448. isRequest: isRequest,
  10449. isResponse: isResponse,
  10450. isHeaders: isHeaders,
  10451. isUndefined: isUndefined,
  10452. isDate: isDate,
  10453. isFile: isFile,
  10454. isReactNativeBlob: isReactNativeBlob,
  10455. isReactNative: isReactNative,
  10456. isBlob: isBlob,
  10457. isRegExp: isRegExp,
  10458. isFunction: isFunction,
  10459. isStream: isStream,
  10460. isURLSearchParams: isURLSearchParams,
  10461. isTypedArray: isTypedArray,
  10462. isFileList: isFileList,
  10463. forEach: forEach,
  10464. merge: merge,
  10465. extend: extend,
  10466. trim: trim,
  10467. stripBOM: stripBOM,
  10468. inherits: inherits,
  10469. toFlatObject: toFlatObject,
  10470. kindOf: kindOf,
  10471. kindOfTest: kindOfTest,
  10472. endsWith: endsWith,
  10473. toArray: toArray,
  10474. forEachEntry: forEachEntry,
  10475. matchAll: matchAll,
  10476. isHTMLForm: isHTMLForm,
  10477. hasOwnProperty: hasOwnProperty,
  10478. hasOwnProp: hasOwnProperty,
  10479. // an alias to avoid ESLint no-prototype-builtins detection
  10480. reduceDescriptors: reduceDescriptors,
  10481. freezeMethods: freezeMethods,
  10482. toObjectSet: toObjectSet,
  10483. toCamelCase: toCamelCase,
  10484. noop: noop,
  10485. toFiniteNumber: toFiniteNumber,
  10486. findKey: findKey,
  10487. global: _global,
  10488. isContextDefined: isContextDefined,
  10489. isSpecCompliantForm: isSpecCompliantForm,
  10490. toJSONObject: toJSONObject,
  10491. isAsyncFn: isAsyncFn,
  10492. isThenable: isThenable,
  10493. setImmediate: _setImmediate,
  10494. asap: asap,
  10495. isIterable: isIterable
  10496. };
  10497. exports.default = _default;
  10498. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/webpack/buildin/global.js */ 3), __webpack_require__(/*! ./../../../../../../../../../HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/node-libs-browser/mock/process.js */ 48)))
  10499. /***/ }),
  10500. /* 48 */
  10501. /*!********************************************************!*\
  10502. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  10503. \********************************************************/
  10504. /*! no static exports found */
  10505. /***/ (function(module, exports, __webpack_require__) {
  10506. exports.nextTick = function nextTick(fn) {
  10507. var args = Array.prototype.slice.call(arguments);
  10508. args.shift();
  10509. setTimeout(function () {
  10510. fn.apply(null, args);
  10511. }, 0);
  10512. };
  10513. exports.platform = exports.arch =
  10514. exports.execPath = exports.title = 'browser';
  10515. exports.pid = 1;
  10516. exports.browser = true;
  10517. exports.env = {};
  10518. exports.argv = [];
  10519. exports.binding = function (name) {
  10520. throw new Error('No such module. (Possibly not yet loaded)')
  10521. };
  10522. (function () {
  10523. var cwd = '/';
  10524. var path;
  10525. exports.cwd = function () { return cwd };
  10526. exports.chdir = function (dir) {
  10527. if (!path) path = __webpack_require__(/*! path */ 49);
  10528. cwd = path.resolve(dir, cwd);
  10529. };
  10530. })();
  10531. exports.exit = exports.kill =
  10532. exports.umask = exports.dlopen =
  10533. exports.uptime = exports.memoryUsage =
  10534. exports.uvCounters = function() {};
  10535. exports.features = {};
  10536. /***/ }),
  10537. /* 49 */
  10538. /*!***********************************************!*\
  10539. !*** ./node_modules/path-browserify/index.js ***!
  10540. \***********************************************/
  10541. /*! no static exports found */
  10542. /***/ (function(module, exports, __webpack_require__) {
  10543. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  10544. // backported and transplited with Babel, with backwards-compat fixes
  10545. // Copyright Joyent, Inc. and other Node contributors.
  10546. //
  10547. // Permission is hereby granted, free of charge, to any person obtaining a
  10548. // copy of this software and associated documentation files (the
  10549. // "Software"), to deal in the Software without restriction, including
  10550. // without limitation the rights to use, copy, modify, merge, publish,
  10551. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10552. // persons to whom the Software is furnished to do so, subject to the
  10553. // following conditions:
  10554. //
  10555. // The above copyright notice and this permission notice shall be included
  10556. // in all copies or substantial portions of the Software.
  10557. //
  10558. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10559. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10560. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10561. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10562. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10563. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10564. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10565. // resolves . and .. elements in a path array with directory names there
  10566. // must be no slashes, empty elements, or device names (c:\) in the array
  10567. // (so also no leading and trailing slashes - it does not distinguish
  10568. // relative and absolute paths)
  10569. function normalizeArray(parts, allowAboveRoot) {
  10570. // if the path tries to go above the root, `up` ends up > 0
  10571. var up = 0;
  10572. for (var i = parts.length - 1; i >= 0; i--) {
  10573. var last = parts[i];
  10574. if (last === '.') {
  10575. parts.splice(i, 1);
  10576. } else if (last === '..') {
  10577. parts.splice(i, 1);
  10578. up++;
  10579. } else if (up) {
  10580. parts.splice(i, 1);
  10581. up--;
  10582. }
  10583. }
  10584. // if the path is allowed to go above the root, restore leading ..s
  10585. if (allowAboveRoot) {
  10586. for (; up--; up) {
  10587. parts.unshift('..');
  10588. }
  10589. }
  10590. return parts;
  10591. }
  10592. // path.resolve([from ...], to)
  10593. // posix version
  10594. exports.resolve = function() {
  10595. var resolvedPath = '',
  10596. resolvedAbsolute = false;
  10597. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  10598. var path = (i >= 0) ? arguments[i] : process.cwd();
  10599. // Skip empty and invalid entries
  10600. if (typeof path !== 'string') {
  10601. throw new TypeError('Arguments to path.resolve must be strings');
  10602. } else if (!path) {
  10603. continue;
  10604. }
  10605. resolvedPath = path + '/' + resolvedPath;
  10606. resolvedAbsolute = path.charAt(0) === '/';
  10607. }
  10608. // At this point the path should be resolved to a full absolute path, but
  10609. // handle relative paths to be safe (might happen when process.cwd() fails)
  10610. // Normalize the path
  10611. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  10612. return !!p;
  10613. }), !resolvedAbsolute).join('/');
  10614. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  10615. };
  10616. // path.normalize(path)
  10617. // posix version
  10618. exports.normalize = function(path) {
  10619. var isAbsolute = exports.isAbsolute(path),
  10620. trailingSlash = substr(path, -1) === '/';
  10621. // Normalize the path
  10622. path = normalizeArray(filter(path.split('/'), function(p) {
  10623. return !!p;
  10624. }), !isAbsolute).join('/');
  10625. if (!path && !isAbsolute) {
  10626. path = '.';
  10627. }
  10628. if (path && trailingSlash) {
  10629. path += '/';
  10630. }
  10631. return (isAbsolute ? '/' : '') + path;
  10632. };
  10633. // posix version
  10634. exports.isAbsolute = function(path) {
  10635. return path.charAt(0) === '/';
  10636. };
  10637. // posix version
  10638. exports.join = function() {
  10639. var paths = Array.prototype.slice.call(arguments, 0);
  10640. return exports.normalize(filter(paths, function(p, index) {
  10641. if (typeof p !== 'string') {
  10642. throw new TypeError('Arguments to path.join must be strings');
  10643. }
  10644. return p;
  10645. }).join('/'));
  10646. };
  10647. // path.relative(from, to)
  10648. // posix version
  10649. exports.relative = function(from, to) {
  10650. from = exports.resolve(from).substr(1);
  10651. to = exports.resolve(to).substr(1);
  10652. function trim(arr) {
  10653. var start = 0;
  10654. for (; start < arr.length; start++) {
  10655. if (arr[start] !== '') break;
  10656. }
  10657. var end = arr.length - 1;
  10658. for (; end >= 0; end--) {
  10659. if (arr[end] !== '') break;
  10660. }
  10661. if (start > end) return [];
  10662. return arr.slice(start, end - start + 1);
  10663. }
  10664. var fromParts = trim(from.split('/'));
  10665. var toParts = trim(to.split('/'));
  10666. var length = Math.min(fromParts.length, toParts.length);
  10667. var samePartsLength = length;
  10668. for (var i = 0; i < length; i++) {
  10669. if (fromParts[i] !== toParts[i]) {
  10670. samePartsLength = i;
  10671. break;
  10672. }
  10673. }
  10674. var outputParts = [];
  10675. for (var i = samePartsLength; i < fromParts.length; i++) {
  10676. outputParts.push('..');
  10677. }
  10678. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  10679. return outputParts.join('/');
  10680. };
  10681. exports.sep = '/';
  10682. exports.delimiter = ':';
  10683. exports.dirname = function (path) {
  10684. if (typeof path !== 'string') path = path + '';
  10685. if (path.length === 0) return '.';
  10686. var code = path.charCodeAt(0);
  10687. var hasRoot = code === 47 /*/*/;
  10688. var end = -1;
  10689. var matchedSlash = true;
  10690. for (var i = path.length - 1; i >= 1; --i) {
  10691. code = path.charCodeAt(i);
  10692. if (code === 47 /*/*/) {
  10693. if (!matchedSlash) {
  10694. end = i;
  10695. break;
  10696. }
  10697. } else {
  10698. // We saw the first non-path separator
  10699. matchedSlash = false;
  10700. }
  10701. }
  10702. if (end === -1) return hasRoot ? '/' : '.';
  10703. if (hasRoot && end === 1) {
  10704. // return '//';
  10705. // Backwards-compat fix:
  10706. return '/';
  10707. }
  10708. return path.slice(0, end);
  10709. };
  10710. function basename(path) {
  10711. if (typeof path !== 'string') path = path + '';
  10712. var start = 0;
  10713. var end = -1;
  10714. var matchedSlash = true;
  10715. var i;
  10716. for (i = path.length - 1; i >= 0; --i) {
  10717. if (path.charCodeAt(i) === 47 /*/*/) {
  10718. // If we reached a path separator that was not part of a set of path
  10719. // separators at the end of the string, stop now
  10720. if (!matchedSlash) {
  10721. start = i + 1;
  10722. break;
  10723. }
  10724. } else if (end === -1) {
  10725. // We saw the first non-path separator, mark this as the end of our
  10726. // path component
  10727. matchedSlash = false;
  10728. end = i + 1;
  10729. }
  10730. }
  10731. if (end === -1) return '';
  10732. return path.slice(start, end);
  10733. }
  10734. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  10735. // in new Node.js versions, so only basename() above is backported here
  10736. exports.basename = function (path, ext) {
  10737. var f = basename(path);
  10738. if (ext && f.substr(-1 * ext.length) === ext) {
  10739. f = f.substr(0, f.length - ext.length);
  10740. }
  10741. return f;
  10742. };
  10743. exports.extname = function (path) {
  10744. if (typeof path !== 'string') path = path + '';
  10745. var startDot = -1;
  10746. var startPart = 0;
  10747. var end = -1;
  10748. var matchedSlash = true;
  10749. // Track the state of characters (if any) we see before our first dot and
  10750. // after any path separator we find
  10751. var preDotState = 0;
  10752. for (var i = path.length - 1; i >= 0; --i) {
  10753. var code = path.charCodeAt(i);
  10754. if (code === 47 /*/*/) {
  10755. // If we reached a path separator that was not part of a set of path
  10756. // separators at the end of the string, stop now
  10757. if (!matchedSlash) {
  10758. startPart = i + 1;
  10759. break;
  10760. }
  10761. continue;
  10762. }
  10763. if (end === -1) {
  10764. // We saw the first non-path separator, mark this as the end of our
  10765. // extension
  10766. matchedSlash = false;
  10767. end = i + 1;
  10768. }
  10769. if (code === 46 /*.*/) {
  10770. // If this is our first dot, mark it as the start of our extension
  10771. if (startDot === -1)
  10772. startDot = i;
  10773. else if (preDotState !== 1)
  10774. preDotState = 1;
  10775. } else if (startDot !== -1) {
  10776. // We saw a non-dot and non-path separator before our dot, so we should
  10777. // have a good chance at having a non-empty extension
  10778. preDotState = -1;
  10779. }
  10780. }
  10781. if (startDot === -1 || end === -1 ||
  10782. // We saw a non-dot character immediately before the dot
  10783. preDotState === 0 ||
  10784. // The (right-most) trimmed path component is exactly '..'
  10785. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  10786. return '';
  10787. }
  10788. return path.slice(startDot, end);
  10789. };
  10790. function filter (xs, f) {
  10791. if (xs.filter) return xs.filter(f);
  10792. var res = [];
  10793. for (var i = 0; i < xs.length; i++) {
  10794. if (f(xs[i], i, xs)) res.push(xs[i]);
  10795. }
  10796. return res;
  10797. }
  10798. // String.prototype.substr - negative index don't work in IE8
  10799. var substr = 'ab'.substr(-1) === 'b'
  10800. ? function (str, start, len) { return str.substr(start, len) }
  10801. : function (str, start, len) {
  10802. if (start < 0) start = str.length + start;
  10803. return str.substr(start, len);
  10804. }
  10805. ;
  10806. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 48)))
  10807. /***/ }),
  10808. /* 50 */
  10809. /*!***************************************************************************************************!*\
  10810. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/bind.js ***!
  10811. \***************************************************************************************************/
  10812. /*! no static exports found */
  10813. /***/ (function(module, exports, __webpack_require__) {
  10814. "use strict";
  10815. /**
  10816. * Create a bound version of a function with a specified `this` context
  10817. *
  10818. * @param {Function} fn - The function to bind
  10819. * @param {*} thisArg - The value to be passed as the `this` parameter
  10820. * @returns {Function} A new function that will call the original function with the specified `this` context
  10821. */
  10822. Object.defineProperty(exports, "__esModule", {
  10823. value: true
  10824. });
  10825. exports.default = bind;
  10826. function bind(fn, thisArg) {
  10827. return function wrap() {
  10828. return fn.apply(thisArg, arguments);
  10829. };
  10830. }
  10831. /***/ }),
  10832. /* 51 */
  10833. /*!*************************************************************************************************!*\
  10834. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/Axios.js ***!
  10835. \*************************************************************************************************/
  10836. /*! no static exports found */
  10837. /***/ (function(module, exports, __webpack_require__) {
  10838. "use strict";
  10839. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10840. Object.defineProperty(exports, "__esModule", {
  10841. value: true
  10842. });
  10843. exports.default = void 0;
  10844. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  10845. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  10846. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10847. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10848. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  10849. var _buildURL = _interopRequireDefault(__webpack_require__(/*! ../helpers/buildURL.js */ 52));
  10850. var _InterceptorManager = _interopRequireDefault(__webpack_require__(/*! ./InterceptorManager.js */ 67));
  10851. var _dispatchRequest = _interopRequireDefault(__webpack_require__(/*! ./dispatchRequest.js */ 68));
  10852. var _mergeConfig = _interopRequireDefault(__webpack_require__(/*! ./mergeConfig.js */ 97));
  10853. var _buildFullPath = _interopRequireDefault(__webpack_require__(/*! ./buildFullPath.js */ 94));
  10854. var _validator = _interopRequireDefault(__webpack_require__(/*! ../helpers/validator.js */ 106));
  10855. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ./AxiosHeaders.js */ 80));
  10856. var _transitional = _interopRequireDefault(__webpack_require__(/*! ../defaults/transitional.js */ 71));
  10857. var validators = _validator.default.validators;
  10858. /**
  10859. * Create a new instance of Axios
  10860. *
  10861. * @param {Object} instanceConfig The default config for the instance
  10862. *
  10863. * @return {Axios} A new instance of Axios
  10864. */
  10865. var Axios = /*#__PURE__*/function () {
  10866. function Axios(instanceConfig) {
  10867. (0, _classCallCheck2.default)(this, Axios);
  10868. this.defaults = instanceConfig || {};
  10869. this.interceptors = {
  10870. request: new _InterceptorManager.default(),
  10871. response: new _InterceptorManager.default()
  10872. };
  10873. }
  10874. /**
  10875. * Dispatch a request
  10876. *
  10877. * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
  10878. * @param {?Object} config
  10879. *
  10880. * @returns {Promise} The Promise to be fulfilled
  10881. */
  10882. (0, _createClass2.default)(Axios, [{
  10883. key: "request",
  10884. value: function () {
  10885. var _request2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(configOrUrl, config) {
  10886. var dummy, stack, firstNewlineIndex, secondNewlineIndex, stackWithoutTwoTopLines;
  10887. return _regenerator.default.wrap(function _callee$(_context) {
  10888. while (1) {
  10889. switch (_context.prev = _context.next) {
  10890. case 0:
  10891. _context.prev = 0;
  10892. _context.next = 3;
  10893. return this._request(configOrUrl, config);
  10894. case 3:
  10895. return _context.abrupt("return", _context.sent);
  10896. case 6:
  10897. _context.prev = 6;
  10898. _context.t0 = _context["catch"](0);
  10899. if (_context.t0 instanceof Error) {
  10900. dummy = {};
  10901. Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
  10902. // slice off the Error: ... line
  10903. stack = function () {
  10904. if (!dummy.stack) {
  10905. return '';
  10906. }
  10907. var firstNewlineIndex = dummy.stack.indexOf('\n');
  10908. return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
  10909. }();
  10910. try {
  10911. if (!_context.t0.stack) {
  10912. _context.t0.stack = stack;
  10913. // match without the 2 top stack lines
  10914. } else if (stack) {
  10915. firstNewlineIndex = stack.indexOf('\n');
  10916. secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
  10917. stackWithoutTwoTopLines = secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
  10918. if (!String(_context.t0.stack).endsWith(stackWithoutTwoTopLines)) {
  10919. _context.t0.stack += '\n' + stack;
  10920. }
  10921. }
  10922. } catch (e) {
  10923. // ignore the case where "stack" is an un-writable property
  10924. }
  10925. }
  10926. throw _context.t0;
  10927. case 10:
  10928. case "end":
  10929. return _context.stop();
  10930. }
  10931. }
  10932. }, _callee, this, [[0, 6]]);
  10933. }));
  10934. function request(_x, _x2) {
  10935. return _request2.apply(this, arguments);
  10936. }
  10937. return request;
  10938. }()
  10939. }, {
  10940. key: "_request",
  10941. value: function _request(configOrUrl, config) {
  10942. /*eslint no-param-reassign:0*/
  10943. // Allow for axios('example/url'[, config]) a la fetch API
  10944. if (typeof configOrUrl === 'string') {
  10945. config = config || {};
  10946. config.url = configOrUrl;
  10947. } else {
  10948. config = configOrUrl || {};
  10949. }
  10950. config = (0, _mergeConfig.default)(this.defaults, config);
  10951. var _config = config,
  10952. transitional = _config.transitional,
  10953. paramsSerializer = _config.paramsSerializer,
  10954. headers = _config.headers;
  10955. if (transitional !== undefined) {
  10956. _validator.default.assertOptions(transitional, {
  10957. silentJSONParsing: validators.transitional(validators.boolean),
  10958. forcedJSONParsing: validators.transitional(validators.boolean),
  10959. clarifyTimeoutError: validators.transitional(validators.boolean),
  10960. legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
  10961. }, false);
  10962. }
  10963. if (paramsSerializer != null) {
  10964. if (_utils.default.isFunction(paramsSerializer)) {
  10965. config.paramsSerializer = {
  10966. serialize: paramsSerializer
  10967. };
  10968. } else {
  10969. _validator.default.assertOptions(paramsSerializer, {
  10970. encode: validators.function,
  10971. serialize: validators.function
  10972. }, true);
  10973. }
  10974. }
  10975. // Set config.allowAbsoluteUrls
  10976. if (config.allowAbsoluteUrls !== undefined) {
  10977. // do nothing
  10978. } else if (this.defaults.allowAbsoluteUrls !== undefined) {
  10979. config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
  10980. } else {
  10981. config.allowAbsoluteUrls = true;
  10982. }
  10983. _validator.default.assertOptions(config, {
  10984. baseUrl: validators.spelling('baseURL'),
  10985. withXsrfToken: validators.spelling('withXSRFToken')
  10986. }, true);
  10987. // Set config.method
  10988. config.method = (config.method || this.defaults.method || 'get').toLowerCase();
  10989. // Flatten headers
  10990. var contextHeaders = headers && _utils.default.merge(headers.common, headers[config.method]);
  10991. headers && _utils.default.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
  10992. delete headers[method];
  10993. });
  10994. config.headers = _AxiosHeaders.default.concat(contextHeaders, headers);
  10995. // filter out skipped interceptors
  10996. var requestInterceptorChain = [];
  10997. var synchronousRequestInterceptors = true;
  10998. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  10999. if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
  11000. return;
  11001. }
  11002. synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
  11003. var transitional = config.transitional || _transitional.default;
  11004. var legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
  11005. if (legacyInterceptorReqResOrdering) {
  11006. requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
  11007. } else {
  11008. requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  11009. }
  11010. });
  11011. var responseInterceptorChain = [];
  11012. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  11013. responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
  11014. });
  11015. var promise;
  11016. var i = 0;
  11017. var len;
  11018. if (!synchronousRequestInterceptors) {
  11019. var chain = [_dispatchRequest.default.bind(this), undefined];
  11020. chain.unshift.apply(chain, requestInterceptorChain);
  11021. chain.push.apply(chain, responseInterceptorChain);
  11022. len = chain.length;
  11023. promise = Promise.resolve(config);
  11024. while (i < len) {
  11025. promise = promise.then(chain[i++], chain[i++]);
  11026. }
  11027. return promise;
  11028. }
  11029. len = requestInterceptorChain.length;
  11030. var newConfig = config;
  11031. while (i < len) {
  11032. var onFulfilled = requestInterceptorChain[i++];
  11033. var onRejected = requestInterceptorChain[i++];
  11034. try {
  11035. newConfig = onFulfilled(newConfig);
  11036. } catch (error) {
  11037. onRejected.call(this, error);
  11038. break;
  11039. }
  11040. }
  11041. try {
  11042. promise = _dispatchRequest.default.call(this, newConfig);
  11043. } catch (error) {
  11044. return Promise.reject(error);
  11045. }
  11046. i = 0;
  11047. len = responseInterceptorChain.length;
  11048. while (i < len) {
  11049. promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
  11050. }
  11051. return promise;
  11052. }
  11053. }, {
  11054. key: "getUri",
  11055. value: function getUri(config) {
  11056. config = (0, _mergeConfig.default)(this.defaults, config);
  11057. var fullPath = (0, _buildFullPath.default)(config.baseURL, config.url, config.allowAbsoluteUrls);
  11058. return (0, _buildURL.default)(fullPath, config.params, config.paramsSerializer);
  11059. }
  11060. }]);
  11061. return Axios;
  11062. }(); // Provide aliases for supported request methods
  11063. _utils.default.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  11064. /*eslint func-names:0*/
  11065. Axios.prototype[method] = function (url, config) {
  11066. return this.request((0, _mergeConfig.default)(config || {}, {
  11067. method: method,
  11068. url: url,
  11069. data: (config || {}).data
  11070. }));
  11071. };
  11072. });
  11073. _utils.default.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  11074. function generateHTTPMethod(isForm) {
  11075. return function httpMethod(url, data, config) {
  11076. return this.request((0, _mergeConfig.default)(config || {}, {
  11077. method: method,
  11078. headers: isForm ? {
  11079. 'Content-Type': 'multipart/form-data'
  11080. } : {},
  11081. url: url,
  11082. data: data
  11083. }));
  11084. };
  11085. }
  11086. Axios.prototype[method] = generateHTTPMethod();
  11087. Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
  11088. });
  11089. var _default = Axios;
  11090. exports.default = _default;
  11091. /***/ }),
  11092. /* 52 */
  11093. /*!*******************************************************************************************************!*\
  11094. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/buildURL.js ***!
  11095. \*******************************************************************************************************/
  11096. /*! no static exports found */
  11097. /***/ (function(module, exports, __webpack_require__) {
  11098. "use strict";
  11099. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11100. Object.defineProperty(exports, "__esModule", {
  11101. value: true
  11102. });
  11103. exports.default = buildURL;
  11104. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  11105. var _AxiosURLSearchParams = _interopRequireDefault(__webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ 53));
  11106. /**
  11107. * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
  11108. * their plain counterparts (`:`, `$`, `,`, `+`).
  11109. *
  11110. * @param {string} val The value to be encoded.
  11111. *
  11112. * @returns {string} The encoded value.
  11113. */
  11114. function encode(val) {
  11115. return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+');
  11116. }
  11117. /**
  11118. * Build a URL by appending params to the end
  11119. *
  11120. * @param {string} url The base of the url (e.g., http://www.google.com)
  11121. * @param {object} [params] The params to be appended
  11122. * @param {?(object|Function)} options
  11123. *
  11124. * @returns {string} The formatted url
  11125. */
  11126. function buildURL(url, params, options) {
  11127. if (!params) {
  11128. return url;
  11129. }
  11130. var _encode = options && options.encode || encode;
  11131. var _options = _utils.default.isFunction(options) ? {
  11132. serialize: options
  11133. } : options;
  11134. var serializeFn = _options && _options.serialize;
  11135. var serializedParams;
  11136. if (serializeFn) {
  11137. serializedParams = serializeFn(params, _options);
  11138. } else {
  11139. serializedParams = _utils.default.isURLSearchParams(params) ? params.toString() : new _AxiosURLSearchParams.default(params, _options).toString(_encode);
  11140. }
  11141. if (serializedParams) {
  11142. var hashmarkIndex = url.indexOf('#');
  11143. if (hashmarkIndex !== -1) {
  11144. url = url.slice(0, hashmarkIndex);
  11145. }
  11146. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  11147. }
  11148. return url;
  11149. }
  11150. /***/ }),
  11151. /* 53 */
  11152. /*!*******************************************************************************************************************!*\
  11153. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***!
  11154. \*******************************************************************************************************************/
  11155. /*! no static exports found */
  11156. /***/ (function(module, exports, __webpack_require__) {
  11157. "use strict";
  11158. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11159. Object.defineProperty(exports, "__esModule", {
  11160. value: true
  11161. });
  11162. exports.default = void 0;
  11163. var _toFormData = _interopRequireDefault(__webpack_require__(/*! ./toFormData.js */ 54));
  11164. /**
  11165. * It encodes a string by replacing all characters that are not in the unreserved set with
  11166. * their percent-encoded equivalents
  11167. *
  11168. * @param {string} str - The string to encode.
  11169. *
  11170. * @returns {string} The encoded string.
  11171. */
  11172. function encode(str) {
  11173. var charMap = {
  11174. '!': '%21',
  11175. "'": '%27',
  11176. '(': '%28',
  11177. ')': '%29',
  11178. '~': '%7E',
  11179. '%20': '+'
  11180. };
  11181. return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
  11182. return charMap[match];
  11183. });
  11184. }
  11185. /**
  11186. * It takes a params object and converts it to a FormData object
  11187. *
  11188. * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
  11189. * @param {Object<string, any>} options - The options object passed to the Axios constructor.
  11190. *
  11191. * @returns {void}
  11192. */
  11193. function AxiosURLSearchParams(params, options) {
  11194. this._pairs = [];
  11195. params && (0, _toFormData.default)(params, this, options);
  11196. }
  11197. var prototype = AxiosURLSearchParams.prototype;
  11198. prototype.append = function append(name, value) {
  11199. this._pairs.push([name, value]);
  11200. };
  11201. prototype.toString = function toString(encoder) {
  11202. var _encode = encoder ? function (value) {
  11203. return encoder.call(this, value, encode);
  11204. } : encode;
  11205. return this._pairs.map(function each(pair) {
  11206. return _encode(pair[0]) + '=' + _encode(pair[1]);
  11207. }, '').join('&');
  11208. };
  11209. var _default = AxiosURLSearchParams;
  11210. exports.default = _default;
  11211. /***/ }),
  11212. /* 54 */
  11213. /*!*********************************************************************************************************!*\
  11214. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/toFormData.js ***!
  11215. \*********************************************************************************************************/
  11216. /*! no static exports found */
  11217. /***/ (function(module, exports, __webpack_require__) {
  11218. "use strict";
  11219. /* WEBPACK VAR INJECTION */(function(Buffer) {
  11220. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11221. Object.defineProperty(exports, "__esModule", {
  11222. value: true
  11223. });
  11224. exports.default = void 0;
  11225. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11226. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  11227. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  11228. var _FormData = _interopRequireDefault(__webpack_require__(/*! ../platform/node/classes/FormData.js */ 66));
  11229. // temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
  11230. /**
  11231. * Determines if the given thing is a array or js object.
  11232. *
  11233. * @param {string} thing - The object or array to be visited.
  11234. *
  11235. * @returns {boolean}
  11236. */
  11237. function isVisitable(thing) {
  11238. return _utils.default.isPlainObject(thing) || _utils.default.isArray(thing);
  11239. }
  11240. /**
  11241. * It removes the brackets from the end of a string
  11242. *
  11243. * @param {string} key - The key of the parameter.
  11244. *
  11245. * @returns {string} the key without the brackets.
  11246. */
  11247. function removeBrackets(key) {
  11248. return _utils.default.endsWith(key, '[]') ? key.slice(0, -2) : key;
  11249. }
  11250. /**
  11251. * It takes a path, a key, and a boolean, and returns a string
  11252. *
  11253. * @param {string} path - The path to the current key.
  11254. * @param {string} key - The key of the current object being iterated over.
  11255. * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
  11256. *
  11257. * @returns {string} The path to the current key.
  11258. */
  11259. function renderKey(path, key, dots) {
  11260. if (!path) return key;
  11261. return path.concat(key).map(function each(token, i) {
  11262. // eslint-disable-next-line no-param-reassign
  11263. token = removeBrackets(token);
  11264. return !dots && i ? '[' + token + ']' : token;
  11265. }).join(dots ? '.' : '');
  11266. }
  11267. /**
  11268. * If the array is an array and none of its elements are visitable, then it's a flat array.
  11269. *
  11270. * @param {Array<any>} arr - The array to check
  11271. *
  11272. * @returns {boolean}
  11273. */
  11274. function isFlatArray(arr) {
  11275. return _utils.default.isArray(arr) && !arr.some(isVisitable);
  11276. }
  11277. var predicates = _utils.default.toFlatObject(_utils.default, {}, null, function filter(prop) {
  11278. return /^is[A-Z]/.test(prop);
  11279. });
  11280. /**
  11281. * Convert a data object to FormData
  11282. *
  11283. * @param {Object} obj
  11284. * @param {?Object} [formData]
  11285. * @param {?Object} [options]
  11286. * @param {Function} [options.visitor]
  11287. * @param {Boolean} [options.metaTokens = true]
  11288. * @param {Boolean} [options.dots = false]
  11289. * @param {?Boolean} [options.indexes = false]
  11290. *
  11291. * @returns {Object}
  11292. **/
  11293. /**
  11294. * It converts an object into a FormData object
  11295. *
  11296. * @param {Object<any, any>} obj - The object to convert to form data.
  11297. * @param {string} formData - The FormData object to append to.
  11298. * @param {Object<string, any>} options
  11299. *
  11300. * @returns
  11301. */
  11302. function toFormData(obj, formData, options) {
  11303. if (!_utils.default.isObject(obj)) {
  11304. throw new TypeError('target must be an object');
  11305. }
  11306. // eslint-disable-next-line no-param-reassign
  11307. formData = formData || new (_FormData.default || FormData)();
  11308. // eslint-disable-next-line no-param-reassign
  11309. options = _utils.default.toFlatObject(options, {
  11310. metaTokens: true,
  11311. dots: false,
  11312. indexes: false
  11313. }, false, function defined(option, source) {
  11314. // eslint-disable-next-line no-eq-null,eqeqeq
  11315. return !_utils.default.isUndefined(source[option]);
  11316. });
  11317. var metaTokens = options.metaTokens;
  11318. // eslint-disable-next-line no-use-before-define
  11319. var visitor = options.visitor || defaultVisitor;
  11320. var dots = options.dots;
  11321. var indexes = options.indexes;
  11322. var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
  11323. var maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
  11324. var useBlob = _Blob && _utils.default.isSpecCompliantForm(formData);
  11325. if (!_utils.default.isFunction(visitor)) {
  11326. throw new TypeError('visitor must be a function');
  11327. }
  11328. function convertValue(value) {
  11329. if (value === null) return '';
  11330. if (_utils.default.isDate(value)) {
  11331. return value.toISOString();
  11332. }
  11333. if (_utils.default.isBoolean(value)) {
  11334. return value.toString();
  11335. }
  11336. if (!useBlob && _utils.default.isBlob(value)) {
  11337. throw new _AxiosError.default('Blob is not supported. Use a Buffer instead.');
  11338. }
  11339. if (_utils.default.isArrayBuffer(value) || _utils.default.isTypedArray(value)) {
  11340. return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
  11341. }
  11342. return value;
  11343. }
  11344. /**
  11345. * Default visitor.
  11346. *
  11347. * @param {*} value
  11348. * @param {String|Number} key
  11349. * @param {Array<String|Number>} path
  11350. * @this {FormData}
  11351. *
  11352. * @returns {boolean} return true to visit the each prop of the value recursively
  11353. */
  11354. function defaultVisitor(value, key, path) {
  11355. var arr = value;
  11356. if (_utils.default.isReactNative(formData) && _utils.default.isReactNativeBlob(value)) {
  11357. formData.append(renderKey(path, key, dots), convertValue(value));
  11358. return false;
  11359. }
  11360. if (value && !path && (0, _typeof2.default)(value) === 'object') {
  11361. if (_utils.default.endsWith(key, '{}')) {
  11362. // eslint-disable-next-line no-param-reassign
  11363. key = metaTokens ? key : key.slice(0, -2);
  11364. // eslint-disable-next-line no-param-reassign
  11365. value = JSON.stringify(value);
  11366. } else if (_utils.default.isArray(value) && isFlatArray(value) || (_utils.default.isFileList(value) || _utils.default.endsWith(key, '[]')) && (arr = _utils.default.toArray(value))) {
  11367. // eslint-disable-next-line no-param-reassign
  11368. key = removeBrackets(key);
  11369. arr.forEach(function each(el, index) {
  11370. !(_utils.default.isUndefined(el) || el === null) && formData.append(
  11371. // eslint-disable-next-line no-nested-ternary
  11372. indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
  11373. });
  11374. return false;
  11375. }
  11376. }
  11377. if (isVisitable(value)) {
  11378. return true;
  11379. }
  11380. formData.append(renderKey(path, key, dots), convertValue(value));
  11381. return false;
  11382. }
  11383. var stack = [];
  11384. var exposedHelpers = Object.assign(predicates, {
  11385. defaultVisitor: defaultVisitor,
  11386. convertValue: convertValue,
  11387. isVisitable: isVisitable
  11388. });
  11389. function build(value, path) {
  11390. var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  11391. if (_utils.default.isUndefined(value)) return;
  11392. if (depth > maxDepth) {
  11393. throw new _AxiosError.default('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, _AxiosError.default.ERR_FORM_DATA_DEPTH_EXCEEDED);
  11394. }
  11395. if (stack.indexOf(value) !== -1) {
  11396. throw Error('Circular reference detected in ' + path.join('.'));
  11397. }
  11398. stack.push(value);
  11399. _utils.default.forEach(value, function each(el, key) {
  11400. var result = !(_utils.default.isUndefined(el) || el === null) && visitor.call(formData, el, _utils.default.isString(key) ? key.trim() : key, path, exposedHelpers);
  11401. if (result === true) {
  11402. build(el, path ? path.concat(key) : [key], depth + 1);
  11403. }
  11404. });
  11405. stack.pop();
  11406. }
  11407. if (!_utils.default.isObject(obj)) {
  11408. throw new TypeError('data must be an object');
  11409. }
  11410. build(obj);
  11411. return formData;
  11412. }
  11413. var _default = toFormData;
  11414. exports.default = _default;
  11415. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../../../../HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/buffer/index.js */ 55).Buffer))
  11416. /***/ }),
  11417. /* 55 */
  11418. /*!**************************************!*\
  11419. !*** ./node_modules/buffer/index.js ***!
  11420. \**************************************/
  11421. /*! no static exports found */
  11422. /***/ (function(module, exports, __webpack_require__) {
  11423. "use strict";
  11424. /* WEBPACK VAR INJECTION */(function(global) {/*!
  11425. * The buffer module from node.js, for the browser.
  11426. *
  11427. * @author Feross Aboukhadijeh <http://feross.org>
  11428. * @license MIT
  11429. */
  11430. /* eslint-disable no-proto */
  11431. var base64 = __webpack_require__(/*! base64-js */ 56)
  11432. var ieee754 = __webpack_require__(/*! ieee754 */ 57)
  11433. var isArray = __webpack_require__(/*! isarray */ 58)
  11434. exports.Buffer = Buffer
  11435. exports.SlowBuffer = SlowBuffer
  11436. exports.INSPECT_MAX_BYTES = 50
  11437. /**
  11438. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  11439. * === true Use Uint8Array implementation (fastest)
  11440. * === false Use Object implementation (most compatible, even IE6)
  11441. *
  11442. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  11443. * Opera 11.6+, iOS 4.2+.
  11444. *
  11445. * Due to various browser bugs, sometimes the Object implementation will be used even
  11446. * when the browser supports typed arrays.
  11447. *
  11448. * Note:
  11449. *
  11450. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  11451. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  11452. *
  11453. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  11454. *
  11455. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  11456. * incorrect length in some situations.
  11457. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  11458. * get the Object implementation, which is slower but behaves correctly.
  11459. */
  11460. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  11461. ? global.TYPED_ARRAY_SUPPORT
  11462. : typedArraySupport()
  11463. /*
  11464. * Export kMaxLength after typed array support is determined.
  11465. */
  11466. exports.kMaxLength = kMaxLength()
  11467. function typedArraySupport () {
  11468. try {
  11469. var arr = new Uint8Array(1)
  11470. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  11471. return arr.foo() === 42 && // typed array instances can be augmented
  11472. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  11473. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  11474. } catch (e) {
  11475. return false
  11476. }
  11477. }
  11478. function kMaxLength () {
  11479. return Buffer.TYPED_ARRAY_SUPPORT
  11480. ? 0x7fffffff
  11481. : 0x3fffffff
  11482. }
  11483. function createBuffer (that, length) {
  11484. if (kMaxLength() < length) {
  11485. throw new RangeError('Invalid typed array length')
  11486. }
  11487. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11488. // Return an augmented `Uint8Array` instance, for best performance
  11489. that = new Uint8Array(length)
  11490. that.__proto__ = Buffer.prototype
  11491. } else {
  11492. // Fallback: Return an object instance of the Buffer class
  11493. if (that === null) {
  11494. that = new Buffer(length)
  11495. }
  11496. that.length = length
  11497. }
  11498. return that
  11499. }
  11500. /**
  11501. * The Buffer constructor returns instances of `Uint8Array` that have their
  11502. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  11503. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  11504. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  11505. * returns a single octet.
  11506. *
  11507. * The `Uint8Array` prototype remains unmodified.
  11508. */
  11509. function Buffer (arg, encodingOrOffset, length) {
  11510. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  11511. return new Buffer(arg, encodingOrOffset, length)
  11512. }
  11513. // Common case.
  11514. if (typeof arg === 'number') {
  11515. if (typeof encodingOrOffset === 'string') {
  11516. throw new Error(
  11517. 'If encoding is specified then the first argument must be a string'
  11518. )
  11519. }
  11520. return allocUnsafe(this, arg)
  11521. }
  11522. return from(this, arg, encodingOrOffset, length)
  11523. }
  11524. Buffer.poolSize = 8192 // not used by this implementation
  11525. // TODO: Legacy, not needed anymore. Remove in next major version.
  11526. Buffer._augment = function (arr) {
  11527. arr.__proto__ = Buffer.prototype
  11528. return arr
  11529. }
  11530. function from (that, value, encodingOrOffset, length) {
  11531. if (typeof value === 'number') {
  11532. throw new TypeError('"value" argument must not be a number')
  11533. }
  11534. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  11535. return fromArrayBuffer(that, value, encodingOrOffset, length)
  11536. }
  11537. if (typeof value === 'string') {
  11538. return fromString(that, value, encodingOrOffset)
  11539. }
  11540. return fromObject(that, value)
  11541. }
  11542. /**
  11543. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  11544. * if value is a number.
  11545. * Buffer.from(str[, encoding])
  11546. * Buffer.from(array)
  11547. * Buffer.from(buffer)
  11548. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  11549. **/
  11550. Buffer.from = function (value, encodingOrOffset, length) {
  11551. return from(null, value, encodingOrOffset, length)
  11552. }
  11553. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11554. Buffer.prototype.__proto__ = Uint8Array.prototype
  11555. Buffer.__proto__ = Uint8Array
  11556. if (typeof Symbol !== 'undefined' && Symbol.species &&
  11557. Buffer[Symbol.species] === Buffer) {
  11558. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  11559. Object.defineProperty(Buffer, Symbol.species, {
  11560. value: null,
  11561. configurable: true
  11562. })
  11563. }
  11564. }
  11565. function assertSize (size) {
  11566. if (typeof size !== 'number') {
  11567. throw new TypeError('"size" argument must be a number')
  11568. } else if (size < 0) {
  11569. throw new RangeError('"size" argument must not be negative')
  11570. }
  11571. }
  11572. function alloc (that, size, fill, encoding) {
  11573. assertSize(size)
  11574. if (size <= 0) {
  11575. return createBuffer(that, size)
  11576. }
  11577. if (fill !== undefined) {
  11578. // Only pay attention to encoding if it's a string. This
  11579. // prevents accidentally sending in a number that would
  11580. // be interpretted as a start offset.
  11581. return typeof encoding === 'string'
  11582. ? createBuffer(that, size).fill(fill, encoding)
  11583. : createBuffer(that, size).fill(fill)
  11584. }
  11585. return createBuffer(that, size)
  11586. }
  11587. /**
  11588. * Creates a new filled Buffer instance.
  11589. * alloc(size[, fill[, encoding]])
  11590. **/
  11591. Buffer.alloc = function (size, fill, encoding) {
  11592. return alloc(null, size, fill, encoding)
  11593. }
  11594. function allocUnsafe (that, size) {
  11595. assertSize(size)
  11596. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  11597. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  11598. for (var i = 0; i < size; ++i) {
  11599. that[i] = 0
  11600. }
  11601. }
  11602. return that
  11603. }
  11604. /**
  11605. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  11606. * */
  11607. Buffer.allocUnsafe = function (size) {
  11608. return allocUnsafe(null, size)
  11609. }
  11610. /**
  11611. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  11612. */
  11613. Buffer.allocUnsafeSlow = function (size) {
  11614. return allocUnsafe(null, size)
  11615. }
  11616. function fromString (that, string, encoding) {
  11617. if (typeof encoding !== 'string' || encoding === '') {
  11618. encoding = 'utf8'
  11619. }
  11620. if (!Buffer.isEncoding(encoding)) {
  11621. throw new TypeError('"encoding" must be a valid string encoding')
  11622. }
  11623. var length = byteLength(string, encoding) | 0
  11624. that = createBuffer(that, length)
  11625. var actual = that.write(string, encoding)
  11626. if (actual !== length) {
  11627. // Writing a hex string, for example, that contains invalid characters will
  11628. // cause everything after the first invalid character to be ignored. (e.g.
  11629. // 'abxxcd' will be treated as 'ab')
  11630. that = that.slice(0, actual)
  11631. }
  11632. return that
  11633. }
  11634. function fromArrayLike (that, array) {
  11635. var length = array.length < 0 ? 0 : checked(array.length) | 0
  11636. that = createBuffer(that, length)
  11637. for (var i = 0; i < length; i += 1) {
  11638. that[i] = array[i] & 255
  11639. }
  11640. return that
  11641. }
  11642. function fromArrayBuffer (that, array, byteOffset, length) {
  11643. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  11644. if (byteOffset < 0 || array.byteLength < byteOffset) {
  11645. throw new RangeError('\'offset\' is out of bounds')
  11646. }
  11647. if (array.byteLength < byteOffset + (length || 0)) {
  11648. throw new RangeError('\'length\' is out of bounds')
  11649. }
  11650. if (byteOffset === undefined && length === undefined) {
  11651. array = new Uint8Array(array)
  11652. } else if (length === undefined) {
  11653. array = new Uint8Array(array, byteOffset)
  11654. } else {
  11655. array = new Uint8Array(array, byteOffset, length)
  11656. }
  11657. if (Buffer.TYPED_ARRAY_SUPPORT) {
  11658. // Return an augmented `Uint8Array` instance, for best performance
  11659. that = array
  11660. that.__proto__ = Buffer.prototype
  11661. } else {
  11662. // Fallback: Return an object instance of the Buffer class
  11663. that = fromArrayLike(that, array)
  11664. }
  11665. return that
  11666. }
  11667. function fromObject (that, obj) {
  11668. if (Buffer.isBuffer(obj)) {
  11669. var len = checked(obj.length) | 0
  11670. that = createBuffer(that, len)
  11671. if (that.length === 0) {
  11672. return that
  11673. }
  11674. obj.copy(that, 0, 0, len)
  11675. return that
  11676. }
  11677. if (obj) {
  11678. if ((typeof ArrayBuffer !== 'undefined' &&
  11679. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  11680. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  11681. return createBuffer(that, 0)
  11682. }
  11683. return fromArrayLike(that, obj)
  11684. }
  11685. if (obj.type === 'Buffer' && isArray(obj.data)) {
  11686. return fromArrayLike(that, obj.data)
  11687. }
  11688. }
  11689. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  11690. }
  11691. function checked (length) {
  11692. // Note: cannot use `length < kMaxLength()` here because that fails when
  11693. // length is NaN (which is otherwise coerced to zero.)
  11694. if (length >= kMaxLength()) {
  11695. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  11696. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  11697. }
  11698. return length | 0
  11699. }
  11700. function SlowBuffer (length) {
  11701. if (+length != length) { // eslint-disable-line eqeqeq
  11702. length = 0
  11703. }
  11704. return Buffer.alloc(+length)
  11705. }
  11706. Buffer.isBuffer = function isBuffer (b) {
  11707. return !!(b != null && b._isBuffer)
  11708. }
  11709. Buffer.compare = function compare (a, b) {
  11710. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  11711. throw new TypeError('Arguments must be Buffers')
  11712. }
  11713. if (a === b) return 0
  11714. var x = a.length
  11715. var y = b.length
  11716. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  11717. if (a[i] !== b[i]) {
  11718. x = a[i]
  11719. y = b[i]
  11720. break
  11721. }
  11722. }
  11723. if (x < y) return -1
  11724. if (y < x) return 1
  11725. return 0
  11726. }
  11727. Buffer.isEncoding = function isEncoding (encoding) {
  11728. switch (String(encoding).toLowerCase()) {
  11729. case 'hex':
  11730. case 'utf8':
  11731. case 'utf-8':
  11732. case 'ascii':
  11733. case 'latin1':
  11734. case 'binary':
  11735. case 'base64':
  11736. case 'ucs2':
  11737. case 'ucs-2':
  11738. case 'utf16le':
  11739. case 'utf-16le':
  11740. return true
  11741. default:
  11742. return false
  11743. }
  11744. }
  11745. Buffer.concat = function concat (list, length) {
  11746. if (!isArray(list)) {
  11747. throw new TypeError('"list" argument must be an Array of Buffers')
  11748. }
  11749. if (list.length === 0) {
  11750. return Buffer.alloc(0)
  11751. }
  11752. var i
  11753. if (length === undefined) {
  11754. length = 0
  11755. for (i = 0; i < list.length; ++i) {
  11756. length += list[i].length
  11757. }
  11758. }
  11759. var buffer = Buffer.allocUnsafe(length)
  11760. var pos = 0
  11761. for (i = 0; i < list.length; ++i) {
  11762. var buf = list[i]
  11763. if (!Buffer.isBuffer(buf)) {
  11764. throw new TypeError('"list" argument must be an Array of Buffers')
  11765. }
  11766. buf.copy(buffer, pos)
  11767. pos += buf.length
  11768. }
  11769. return buffer
  11770. }
  11771. function byteLength (string, encoding) {
  11772. if (Buffer.isBuffer(string)) {
  11773. return string.length
  11774. }
  11775. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  11776. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  11777. return string.byteLength
  11778. }
  11779. if (typeof string !== 'string') {
  11780. string = '' + string
  11781. }
  11782. var len = string.length
  11783. if (len === 0) return 0
  11784. // Use a for loop to avoid recursion
  11785. var loweredCase = false
  11786. for (;;) {
  11787. switch (encoding) {
  11788. case 'ascii':
  11789. case 'latin1':
  11790. case 'binary':
  11791. return len
  11792. case 'utf8':
  11793. case 'utf-8':
  11794. case undefined:
  11795. return utf8ToBytes(string).length
  11796. case 'ucs2':
  11797. case 'ucs-2':
  11798. case 'utf16le':
  11799. case 'utf-16le':
  11800. return len * 2
  11801. case 'hex':
  11802. return len >>> 1
  11803. case 'base64':
  11804. return base64ToBytes(string).length
  11805. default:
  11806. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  11807. encoding = ('' + encoding).toLowerCase()
  11808. loweredCase = true
  11809. }
  11810. }
  11811. }
  11812. Buffer.byteLength = byteLength
  11813. function slowToString (encoding, start, end) {
  11814. var loweredCase = false
  11815. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  11816. // property of a typed array.
  11817. // This behaves neither like String nor Uint8Array in that we set start/end
  11818. // to their upper/lower bounds if the value passed is out of range.
  11819. // undefined is handled specially as per ECMA-262 6th Edition,
  11820. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  11821. if (start === undefined || start < 0) {
  11822. start = 0
  11823. }
  11824. // Return early if start > this.length. Done here to prevent potential uint32
  11825. // coercion fail below.
  11826. if (start > this.length) {
  11827. return ''
  11828. }
  11829. if (end === undefined || end > this.length) {
  11830. end = this.length
  11831. }
  11832. if (end <= 0) {
  11833. return ''
  11834. }
  11835. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  11836. end >>>= 0
  11837. start >>>= 0
  11838. if (end <= start) {
  11839. return ''
  11840. }
  11841. if (!encoding) encoding = 'utf8'
  11842. while (true) {
  11843. switch (encoding) {
  11844. case 'hex':
  11845. return hexSlice(this, start, end)
  11846. case 'utf8':
  11847. case 'utf-8':
  11848. return utf8Slice(this, start, end)
  11849. case 'ascii':
  11850. return asciiSlice(this, start, end)
  11851. case 'latin1':
  11852. case 'binary':
  11853. return latin1Slice(this, start, end)
  11854. case 'base64':
  11855. return base64Slice(this, start, end)
  11856. case 'ucs2':
  11857. case 'ucs-2':
  11858. case 'utf16le':
  11859. case 'utf-16le':
  11860. return utf16leSlice(this, start, end)
  11861. default:
  11862. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  11863. encoding = (encoding + '').toLowerCase()
  11864. loweredCase = true
  11865. }
  11866. }
  11867. }
  11868. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  11869. // Buffer instances.
  11870. Buffer.prototype._isBuffer = true
  11871. function swap (b, n, m) {
  11872. var i = b[n]
  11873. b[n] = b[m]
  11874. b[m] = i
  11875. }
  11876. Buffer.prototype.swap16 = function swap16 () {
  11877. var len = this.length
  11878. if (len % 2 !== 0) {
  11879. throw new RangeError('Buffer size must be a multiple of 16-bits')
  11880. }
  11881. for (var i = 0; i < len; i += 2) {
  11882. swap(this, i, i + 1)
  11883. }
  11884. return this
  11885. }
  11886. Buffer.prototype.swap32 = function swap32 () {
  11887. var len = this.length
  11888. if (len % 4 !== 0) {
  11889. throw new RangeError('Buffer size must be a multiple of 32-bits')
  11890. }
  11891. for (var i = 0; i < len; i += 4) {
  11892. swap(this, i, i + 3)
  11893. swap(this, i + 1, i + 2)
  11894. }
  11895. return this
  11896. }
  11897. Buffer.prototype.swap64 = function swap64 () {
  11898. var len = this.length
  11899. if (len % 8 !== 0) {
  11900. throw new RangeError('Buffer size must be a multiple of 64-bits')
  11901. }
  11902. for (var i = 0; i < len; i += 8) {
  11903. swap(this, i, i + 7)
  11904. swap(this, i + 1, i + 6)
  11905. swap(this, i + 2, i + 5)
  11906. swap(this, i + 3, i + 4)
  11907. }
  11908. return this
  11909. }
  11910. Buffer.prototype.toString = function toString () {
  11911. var length = this.length | 0
  11912. if (length === 0) return ''
  11913. if (arguments.length === 0) return utf8Slice(this, 0, length)
  11914. return slowToString.apply(this, arguments)
  11915. }
  11916. Buffer.prototype.equals = function equals (b) {
  11917. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  11918. if (this === b) return true
  11919. return Buffer.compare(this, b) === 0
  11920. }
  11921. Buffer.prototype.inspect = function inspect () {
  11922. var str = ''
  11923. var max = exports.INSPECT_MAX_BYTES
  11924. if (this.length > 0) {
  11925. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  11926. if (this.length > max) str += ' ... '
  11927. }
  11928. return '<Buffer ' + str + '>'
  11929. }
  11930. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  11931. if (!Buffer.isBuffer(target)) {
  11932. throw new TypeError('Argument must be a Buffer')
  11933. }
  11934. if (start === undefined) {
  11935. start = 0
  11936. }
  11937. if (end === undefined) {
  11938. end = target ? target.length : 0
  11939. }
  11940. if (thisStart === undefined) {
  11941. thisStart = 0
  11942. }
  11943. if (thisEnd === undefined) {
  11944. thisEnd = this.length
  11945. }
  11946. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  11947. throw new RangeError('out of range index')
  11948. }
  11949. if (thisStart >= thisEnd && start >= end) {
  11950. return 0
  11951. }
  11952. if (thisStart >= thisEnd) {
  11953. return -1
  11954. }
  11955. if (start >= end) {
  11956. return 1
  11957. }
  11958. start >>>= 0
  11959. end >>>= 0
  11960. thisStart >>>= 0
  11961. thisEnd >>>= 0
  11962. if (this === target) return 0
  11963. var x = thisEnd - thisStart
  11964. var y = end - start
  11965. var len = Math.min(x, y)
  11966. var thisCopy = this.slice(thisStart, thisEnd)
  11967. var targetCopy = target.slice(start, end)
  11968. for (var i = 0; i < len; ++i) {
  11969. if (thisCopy[i] !== targetCopy[i]) {
  11970. x = thisCopy[i]
  11971. y = targetCopy[i]
  11972. break
  11973. }
  11974. }
  11975. if (x < y) return -1
  11976. if (y < x) return 1
  11977. return 0
  11978. }
  11979. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  11980. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  11981. //
  11982. // Arguments:
  11983. // - buffer - a Buffer to search
  11984. // - val - a string, Buffer, or number
  11985. // - byteOffset - an index into `buffer`; will be clamped to an int32
  11986. // - encoding - an optional encoding, relevant is val is a string
  11987. // - dir - true for indexOf, false for lastIndexOf
  11988. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  11989. // Empty buffer means no match
  11990. if (buffer.length === 0) return -1
  11991. // Normalize byteOffset
  11992. if (typeof byteOffset === 'string') {
  11993. encoding = byteOffset
  11994. byteOffset = 0
  11995. } else if (byteOffset > 0x7fffffff) {
  11996. byteOffset = 0x7fffffff
  11997. } else if (byteOffset < -0x80000000) {
  11998. byteOffset = -0x80000000
  11999. }
  12000. byteOffset = +byteOffset // Coerce to Number.
  12001. if (isNaN(byteOffset)) {
  12002. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  12003. byteOffset = dir ? 0 : (buffer.length - 1)
  12004. }
  12005. // Normalize byteOffset: negative offsets start from the end of the buffer
  12006. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  12007. if (byteOffset >= buffer.length) {
  12008. if (dir) return -1
  12009. else byteOffset = buffer.length - 1
  12010. } else if (byteOffset < 0) {
  12011. if (dir) byteOffset = 0
  12012. else return -1
  12013. }
  12014. // Normalize val
  12015. if (typeof val === 'string') {
  12016. val = Buffer.from(val, encoding)
  12017. }
  12018. // Finally, search either indexOf (if dir is true) or lastIndexOf
  12019. if (Buffer.isBuffer(val)) {
  12020. // Special case: looking for empty string/buffer always fails
  12021. if (val.length === 0) {
  12022. return -1
  12023. }
  12024. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  12025. } else if (typeof val === 'number') {
  12026. val = val & 0xFF // Search for a byte value [0-255]
  12027. if (Buffer.TYPED_ARRAY_SUPPORT &&
  12028. typeof Uint8Array.prototype.indexOf === 'function') {
  12029. if (dir) {
  12030. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  12031. } else {
  12032. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  12033. }
  12034. }
  12035. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  12036. }
  12037. throw new TypeError('val must be string, number or Buffer')
  12038. }
  12039. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  12040. var indexSize = 1
  12041. var arrLength = arr.length
  12042. var valLength = val.length
  12043. if (encoding !== undefined) {
  12044. encoding = String(encoding).toLowerCase()
  12045. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  12046. encoding === 'utf16le' || encoding === 'utf-16le') {
  12047. if (arr.length < 2 || val.length < 2) {
  12048. return -1
  12049. }
  12050. indexSize = 2
  12051. arrLength /= 2
  12052. valLength /= 2
  12053. byteOffset /= 2
  12054. }
  12055. }
  12056. function read (buf, i) {
  12057. if (indexSize === 1) {
  12058. return buf[i]
  12059. } else {
  12060. return buf.readUInt16BE(i * indexSize)
  12061. }
  12062. }
  12063. var i
  12064. if (dir) {
  12065. var foundIndex = -1
  12066. for (i = byteOffset; i < arrLength; i++) {
  12067. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  12068. if (foundIndex === -1) foundIndex = i
  12069. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  12070. } else {
  12071. if (foundIndex !== -1) i -= i - foundIndex
  12072. foundIndex = -1
  12073. }
  12074. }
  12075. } else {
  12076. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  12077. for (i = byteOffset; i >= 0; i--) {
  12078. var found = true
  12079. for (var j = 0; j < valLength; j++) {
  12080. if (read(arr, i + j) !== read(val, j)) {
  12081. found = false
  12082. break
  12083. }
  12084. }
  12085. if (found) return i
  12086. }
  12087. }
  12088. return -1
  12089. }
  12090. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  12091. return this.indexOf(val, byteOffset, encoding) !== -1
  12092. }
  12093. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  12094. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  12095. }
  12096. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  12097. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  12098. }
  12099. function hexWrite (buf, string, offset, length) {
  12100. offset = Number(offset) || 0
  12101. var remaining = buf.length - offset
  12102. if (!length) {
  12103. length = remaining
  12104. } else {
  12105. length = Number(length)
  12106. if (length > remaining) {
  12107. length = remaining
  12108. }
  12109. }
  12110. // must be an even number of digits
  12111. var strLen = string.length
  12112. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  12113. if (length > strLen / 2) {
  12114. length = strLen / 2
  12115. }
  12116. for (var i = 0; i < length; ++i) {
  12117. var parsed = parseInt(string.substr(i * 2, 2), 16)
  12118. if (isNaN(parsed)) return i
  12119. buf[offset + i] = parsed
  12120. }
  12121. return i
  12122. }
  12123. function utf8Write (buf, string, offset, length) {
  12124. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  12125. }
  12126. function asciiWrite (buf, string, offset, length) {
  12127. return blitBuffer(asciiToBytes(string), buf, offset, length)
  12128. }
  12129. function latin1Write (buf, string, offset, length) {
  12130. return asciiWrite(buf, string, offset, length)
  12131. }
  12132. function base64Write (buf, string, offset, length) {
  12133. return blitBuffer(base64ToBytes(string), buf, offset, length)
  12134. }
  12135. function ucs2Write (buf, string, offset, length) {
  12136. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  12137. }
  12138. Buffer.prototype.write = function write (string, offset, length, encoding) {
  12139. // Buffer#write(string)
  12140. if (offset === undefined) {
  12141. encoding = 'utf8'
  12142. length = this.length
  12143. offset = 0
  12144. // Buffer#write(string, encoding)
  12145. } else if (length === undefined && typeof offset === 'string') {
  12146. encoding = offset
  12147. length = this.length
  12148. offset = 0
  12149. // Buffer#write(string, offset[, length][, encoding])
  12150. } else if (isFinite(offset)) {
  12151. offset = offset | 0
  12152. if (isFinite(length)) {
  12153. length = length | 0
  12154. if (encoding === undefined) encoding = 'utf8'
  12155. } else {
  12156. encoding = length
  12157. length = undefined
  12158. }
  12159. // legacy write(string, encoding, offset, length) - remove in v0.13
  12160. } else {
  12161. throw new Error(
  12162. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  12163. )
  12164. }
  12165. var remaining = this.length - offset
  12166. if (length === undefined || length > remaining) length = remaining
  12167. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  12168. throw new RangeError('Attempt to write outside buffer bounds')
  12169. }
  12170. if (!encoding) encoding = 'utf8'
  12171. var loweredCase = false
  12172. for (;;) {
  12173. switch (encoding) {
  12174. case 'hex':
  12175. return hexWrite(this, string, offset, length)
  12176. case 'utf8':
  12177. case 'utf-8':
  12178. return utf8Write(this, string, offset, length)
  12179. case 'ascii':
  12180. return asciiWrite(this, string, offset, length)
  12181. case 'latin1':
  12182. case 'binary':
  12183. return latin1Write(this, string, offset, length)
  12184. case 'base64':
  12185. // Warning: maxLength not taken into account in base64Write
  12186. return base64Write(this, string, offset, length)
  12187. case 'ucs2':
  12188. case 'ucs-2':
  12189. case 'utf16le':
  12190. case 'utf-16le':
  12191. return ucs2Write(this, string, offset, length)
  12192. default:
  12193. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  12194. encoding = ('' + encoding).toLowerCase()
  12195. loweredCase = true
  12196. }
  12197. }
  12198. }
  12199. Buffer.prototype.toJSON = function toJSON () {
  12200. return {
  12201. type: 'Buffer',
  12202. data: Array.prototype.slice.call(this._arr || this, 0)
  12203. }
  12204. }
  12205. function base64Slice (buf, start, end) {
  12206. if (start === 0 && end === buf.length) {
  12207. return base64.fromByteArray(buf)
  12208. } else {
  12209. return base64.fromByteArray(buf.slice(start, end))
  12210. }
  12211. }
  12212. function utf8Slice (buf, start, end) {
  12213. end = Math.min(buf.length, end)
  12214. var res = []
  12215. var i = start
  12216. while (i < end) {
  12217. var firstByte = buf[i]
  12218. var codePoint = null
  12219. var bytesPerSequence = (firstByte > 0xEF) ? 4
  12220. : (firstByte > 0xDF) ? 3
  12221. : (firstByte > 0xBF) ? 2
  12222. : 1
  12223. if (i + bytesPerSequence <= end) {
  12224. var secondByte, thirdByte, fourthByte, tempCodePoint
  12225. switch (bytesPerSequence) {
  12226. case 1:
  12227. if (firstByte < 0x80) {
  12228. codePoint = firstByte
  12229. }
  12230. break
  12231. case 2:
  12232. secondByte = buf[i + 1]
  12233. if ((secondByte & 0xC0) === 0x80) {
  12234. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  12235. if (tempCodePoint > 0x7F) {
  12236. codePoint = tempCodePoint
  12237. }
  12238. }
  12239. break
  12240. case 3:
  12241. secondByte = buf[i + 1]
  12242. thirdByte = buf[i + 2]
  12243. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  12244. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  12245. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  12246. codePoint = tempCodePoint
  12247. }
  12248. }
  12249. break
  12250. case 4:
  12251. secondByte = buf[i + 1]
  12252. thirdByte = buf[i + 2]
  12253. fourthByte = buf[i + 3]
  12254. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  12255. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  12256. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  12257. codePoint = tempCodePoint
  12258. }
  12259. }
  12260. }
  12261. }
  12262. if (codePoint === null) {
  12263. // we did not generate a valid codePoint so insert a
  12264. // replacement char (U+FFFD) and advance only 1 byte
  12265. codePoint = 0xFFFD
  12266. bytesPerSequence = 1
  12267. } else if (codePoint > 0xFFFF) {
  12268. // encode to utf16 (surrogate pair dance)
  12269. codePoint -= 0x10000
  12270. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  12271. codePoint = 0xDC00 | codePoint & 0x3FF
  12272. }
  12273. res.push(codePoint)
  12274. i += bytesPerSequence
  12275. }
  12276. return decodeCodePointsArray(res)
  12277. }
  12278. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  12279. // the lowest limit is Chrome, with 0x10000 args.
  12280. // We go 1 magnitude less, for safety
  12281. var MAX_ARGUMENTS_LENGTH = 0x1000
  12282. function decodeCodePointsArray (codePoints) {
  12283. var len = codePoints.length
  12284. if (len <= MAX_ARGUMENTS_LENGTH) {
  12285. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  12286. }
  12287. // Decode in chunks to avoid "call stack size exceeded".
  12288. var res = ''
  12289. var i = 0
  12290. while (i < len) {
  12291. res += String.fromCharCode.apply(
  12292. String,
  12293. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  12294. )
  12295. }
  12296. return res
  12297. }
  12298. function asciiSlice (buf, start, end) {
  12299. var ret = ''
  12300. end = Math.min(buf.length, end)
  12301. for (var i = start; i < end; ++i) {
  12302. ret += String.fromCharCode(buf[i] & 0x7F)
  12303. }
  12304. return ret
  12305. }
  12306. function latin1Slice (buf, start, end) {
  12307. var ret = ''
  12308. end = Math.min(buf.length, end)
  12309. for (var i = start; i < end; ++i) {
  12310. ret += String.fromCharCode(buf[i])
  12311. }
  12312. return ret
  12313. }
  12314. function hexSlice (buf, start, end) {
  12315. var len = buf.length
  12316. if (!start || start < 0) start = 0
  12317. if (!end || end < 0 || end > len) end = len
  12318. var out = ''
  12319. for (var i = start; i < end; ++i) {
  12320. out += toHex(buf[i])
  12321. }
  12322. return out
  12323. }
  12324. function utf16leSlice (buf, start, end) {
  12325. var bytes = buf.slice(start, end)
  12326. var res = ''
  12327. for (var i = 0; i < bytes.length; i += 2) {
  12328. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  12329. }
  12330. return res
  12331. }
  12332. Buffer.prototype.slice = function slice (start, end) {
  12333. var len = this.length
  12334. start = ~~start
  12335. end = end === undefined ? len : ~~end
  12336. if (start < 0) {
  12337. start += len
  12338. if (start < 0) start = 0
  12339. } else if (start > len) {
  12340. start = len
  12341. }
  12342. if (end < 0) {
  12343. end += len
  12344. if (end < 0) end = 0
  12345. } else if (end > len) {
  12346. end = len
  12347. }
  12348. if (end < start) end = start
  12349. var newBuf
  12350. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12351. newBuf = this.subarray(start, end)
  12352. newBuf.__proto__ = Buffer.prototype
  12353. } else {
  12354. var sliceLen = end - start
  12355. newBuf = new Buffer(sliceLen, undefined)
  12356. for (var i = 0; i < sliceLen; ++i) {
  12357. newBuf[i] = this[i + start]
  12358. }
  12359. }
  12360. return newBuf
  12361. }
  12362. /*
  12363. * Need to make sure that buffer isn't trying to write out of bounds.
  12364. */
  12365. function checkOffset (offset, ext, length) {
  12366. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  12367. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  12368. }
  12369. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  12370. offset = offset | 0
  12371. byteLength = byteLength | 0
  12372. if (!noAssert) checkOffset(offset, byteLength, this.length)
  12373. var val = this[offset]
  12374. var mul = 1
  12375. var i = 0
  12376. while (++i < byteLength && (mul *= 0x100)) {
  12377. val += this[offset + i] * mul
  12378. }
  12379. return val
  12380. }
  12381. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  12382. offset = offset | 0
  12383. byteLength = byteLength | 0
  12384. if (!noAssert) {
  12385. checkOffset(offset, byteLength, this.length)
  12386. }
  12387. var val = this[offset + --byteLength]
  12388. var mul = 1
  12389. while (byteLength > 0 && (mul *= 0x100)) {
  12390. val += this[offset + --byteLength] * mul
  12391. }
  12392. return val
  12393. }
  12394. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  12395. if (!noAssert) checkOffset(offset, 1, this.length)
  12396. return this[offset]
  12397. }
  12398. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  12399. if (!noAssert) checkOffset(offset, 2, this.length)
  12400. return this[offset] | (this[offset + 1] << 8)
  12401. }
  12402. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  12403. if (!noAssert) checkOffset(offset, 2, this.length)
  12404. return (this[offset] << 8) | this[offset + 1]
  12405. }
  12406. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  12407. if (!noAssert) checkOffset(offset, 4, this.length)
  12408. return ((this[offset]) |
  12409. (this[offset + 1] << 8) |
  12410. (this[offset + 2] << 16)) +
  12411. (this[offset + 3] * 0x1000000)
  12412. }
  12413. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  12414. if (!noAssert) checkOffset(offset, 4, this.length)
  12415. return (this[offset] * 0x1000000) +
  12416. ((this[offset + 1] << 16) |
  12417. (this[offset + 2] << 8) |
  12418. this[offset + 3])
  12419. }
  12420. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  12421. offset = offset | 0
  12422. byteLength = byteLength | 0
  12423. if (!noAssert) checkOffset(offset, byteLength, this.length)
  12424. var val = this[offset]
  12425. var mul = 1
  12426. var i = 0
  12427. while (++i < byteLength && (mul *= 0x100)) {
  12428. val += this[offset + i] * mul
  12429. }
  12430. mul *= 0x80
  12431. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  12432. return val
  12433. }
  12434. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  12435. offset = offset | 0
  12436. byteLength = byteLength | 0
  12437. if (!noAssert) checkOffset(offset, byteLength, this.length)
  12438. var i = byteLength
  12439. var mul = 1
  12440. var val = this[offset + --i]
  12441. while (i > 0 && (mul *= 0x100)) {
  12442. val += this[offset + --i] * mul
  12443. }
  12444. mul *= 0x80
  12445. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  12446. return val
  12447. }
  12448. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  12449. if (!noAssert) checkOffset(offset, 1, this.length)
  12450. if (!(this[offset] & 0x80)) return (this[offset])
  12451. return ((0xff - this[offset] + 1) * -1)
  12452. }
  12453. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  12454. if (!noAssert) checkOffset(offset, 2, this.length)
  12455. var val = this[offset] | (this[offset + 1] << 8)
  12456. return (val & 0x8000) ? val | 0xFFFF0000 : val
  12457. }
  12458. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  12459. if (!noAssert) checkOffset(offset, 2, this.length)
  12460. var val = this[offset + 1] | (this[offset] << 8)
  12461. return (val & 0x8000) ? val | 0xFFFF0000 : val
  12462. }
  12463. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  12464. if (!noAssert) checkOffset(offset, 4, this.length)
  12465. return (this[offset]) |
  12466. (this[offset + 1] << 8) |
  12467. (this[offset + 2] << 16) |
  12468. (this[offset + 3] << 24)
  12469. }
  12470. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  12471. if (!noAssert) checkOffset(offset, 4, this.length)
  12472. return (this[offset] << 24) |
  12473. (this[offset + 1] << 16) |
  12474. (this[offset + 2] << 8) |
  12475. (this[offset + 3])
  12476. }
  12477. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  12478. if (!noAssert) checkOffset(offset, 4, this.length)
  12479. return ieee754.read(this, offset, true, 23, 4)
  12480. }
  12481. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  12482. if (!noAssert) checkOffset(offset, 4, this.length)
  12483. return ieee754.read(this, offset, false, 23, 4)
  12484. }
  12485. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  12486. if (!noAssert) checkOffset(offset, 8, this.length)
  12487. return ieee754.read(this, offset, true, 52, 8)
  12488. }
  12489. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  12490. if (!noAssert) checkOffset(offset, 8, this.length)
  12491. return ieee754.read(this, offset, false, 52, 8)
  12492. }
  12493. function checkInt (buf, value, offset, ext, max, min) {
  12494. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  12495. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  12496. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  12497. }
  12498. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  12499. value = +value
  12500. offset = offset | 0
  12501. byteLength = byteLength | 0
  12502. if (!noAssert) {
  12503. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  12504. checkInt(this, value, offset, byteLength, maxBytes, 0)
  12505. }
  12506. var mul = 1
  12507. var i = 0
  12508. this[offset] = value & 0xFF
  12509. while (++i < byteLength && (mul *= 0x100)) {
  12510. this[offset + i] = (value / mul) & 0xFF
  12511. }
  12512. return offset + byteLength
  12513. }
  12514. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  12515. value = +value
  12516. offset = offset | 0
  12517. byteLength = byteLength | 0
  12518. if (!noAssert) {
  12519. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  12520. checkInt(this, value, offset, byteLength, maxBytes, 0)
  12521. }
  12522. var i = byteLength - 1
  12523. var mul = 1
  12524. this[offset + i] = value & 0xFF
  12525. while (--i >= 0 && (mul *= 0x100)) {
  12526. this[offset + i] = (value / mul) & 0xFF
  12527. }
  12528. return offset + byteLength
  12529. }
  12530. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  12531. value = +value
  12532. offset = offset | 0
  12533. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  12534. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  12535. this[offset] = (value & 0xff)
  12536. return offset + 1
  12537. }
  12538. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  12539. if (value < 0) value = 0xffff + value + 1
  12540. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  12541. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  12542. (littleEndian ? i : 1 - i) * 8
  12543. }
  12544. }
  12545. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  12546. value = +value
  12547. offset = offset | 0
  12548. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  12549. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12550. this[offset] = (value & 0xff)
  12551. this[offset + 1] = (value >>> 8)
  12552. } else {
  12553. objectWriteUInt16(this, value, offset, true)
  12554. }
  12555. return offset + 2
  12556. }
  12557. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  12558. value = +value
  12559. offset = offset | 0
  12560. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  12561. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12562. this[offset] = (value >>> 8)
  12563. this[offset + 1] = (value & 0xff)
  12564. } else {
  12565. objectWriteUInt16(this, value, offset, false)
  12566. }
  12567. return offset + 2
  12568. }
  12569. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  12570. if (value < 0) value = 0xffffffff + value + 1
  12571. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  12572. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  12573. }
  12574. }
  12575. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  12576. value = +value
  12577. offset = offset | 0
  12578. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  12579. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12580. this[offset + 3] = (value >>> 24)
  12581. this[offset + 2] = (value >>> 16)
  12582. this[offset + 1] = (value >>> 8)
  12583. this[offset] = (value & 0xff)
  12584. } else {
  12585. objectWriteUInt32(this, value, offset, true)
  12586. }
  12587. return offset + 4
  12588. }
  12589. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  12590. value = +value
  12591. offset = offset | 0
  12592. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  12593. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12594. this[offset] = (value >>> 24)
  12595. this[offset + 1] = (value >>> 16)
  12596. this[offset + 2] = (value >>> 8)
  12597. this[offset + 3] = (value & 0xff)
  12598. } else {
  12599. objectWriteUInt32(this, value, offset, false)
  12600. }
  12601. return offset + 4
  12602. }
  12603. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  12604. value = +value
  12605. offset = offset | 0
  12606. if (!noAssert) {
  12607. var limit = Math.pow(2, 8 * byteLength - 1)
  12608. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  12609. }
  12610. var i = 0
  12611. var mul = 1
  12612. var sub = 0
  12613. this[offset] = value & 0xFF
  12614. while (++i < byteLength && (mul *= 0x100)) {
  12615. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  12616. sub = 1
  12617. }
  12618. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  12619. }
  12620. return offset + byteLength
  12621. }
  12622. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  12623. value = +value
  12624. offset = offset | 0
  12625. if (!noAssert) {
  12626. var limit = Math.pow(2, 8 * byteLength - 1)
  12627. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  12628. }
  12629. var i = byteLength - 1
  12630. var mul = 1
  12631. var sub = 0
  12632. this[offset + i] = value & 0xFF
  12633. while (--i >= 0 && (mul *= 0x100)) {
  12634. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  12635. sub = 1
  12636. }
  12637. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  12638. }
  12639. return offset + byteLength
  12640. }
  12641. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  12642. value = +value
  12643. offset = offset | 0
  12644. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  12645. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  12646. if (value < 0) value = 0xff + value + 1
  12647. this[offset] = (value & 0xff)
  12648. return offset + 1
  12649. }
  12650. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  12651. value = +value
  12652. offset = offset | 0
  12653. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  12654. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12655. this[offset] = (value & 0xff)
  12656. this[offset + 1] = (value >>> 8)
  12657. } else {
  12658. objectWriteUInt16(this, value, offset, true)
  12659. }
  12660. return offset + 2
  12661. }
  12662. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  12663. value = +value
  12664. offset = offset | 0
  12665. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  12666. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12667. this[offset] = (value >>> 8)
  12668. this[offset + 1] = (value & 0xff)
  12669. } else {
  12670. objectWriteUInt16(this, value, offset, false)
  12671. }
  12672. return offset + 2
  12673. }
  12674. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  12675. value = +value
  12676. offset = offset | 0
  12677. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  12678. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12679. this[offset] = (value & 0xff)
  12680. this[offset + 1] = (value >>> 8)
  12681. this[offset + 2] = (value >>> 16)
  12682. this[offset + 3] = (value >>> 24)
  12683. } else {
  12684. objectWriteUInt32(this, value, offset, true)
  12685. }
  12686. return offset + 4
  12687. }
  12688. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  12689. value = +value
  12690. offset = offset | 0
  12691. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  12692. if (value < 0) value = 0xffffffff + value + 1
  12693. if (Buffer.TYPED_ARRAY_SUPPORT) {
  12694. this[offset] = (value >>> 24)
  12695. this[offset + 1] = (value >>> 16)
  12696. this[offset + 2] = (value >>> 8)
  12697. this[offset + 3] = (value & 0xff)
  12698. } else {
  12699. objectWriteUInt32(this, value, offset, false)
  12700. }
  12701. return offset + 4
  12702. }
  12703. function checkIEEE754 (buf, value, offset, ext, max, min) {
  12704. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  12705. if (offset < 0) throw new RangeError('Index out of range')
  12706. }
  12707. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  12708. if (!noAssert) {
  12709. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  12710. }
  12711. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  12712. return offset + 4
  12713. }
  12714. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  12715. return writeFloat(this, value, offset, true, noAssert)
  12716. }
  12717. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  12718. return writeFloat(this, value, offset, false, noAssert)
  12719. }
  12720. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  12721. if (!noAssert) {
  12722. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  12723. }
  12724. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  12725. return offset + 8
  12726. }
  12727. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  12728. return writeDouble(this, value, offset, true, noAssert)
  12729. }
  12730. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  12731. return writeDouble(this, value, offset, false, noAssert)
  12732. }
  12733. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  12734. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  12735. if (!start) start = 0
  12736. if (!end && end !== 0) end = this.length
  12737. if (targetStart >= target.length) targetStart = target.length
  12738. if (!targetStart) targetStart = 0
  12739. if (end > 0 && end < start) end = start
  12740. // Copy 0 bytes; we're done
  12741. if (end === start) return 0
  12742. if (target.length === 0 || this.length === 0) return 0
  12743. // Fatal error conditions
  12744. if (targetStart < 0) {
  12745. throw new RangeError('targetStart out of bounds')
  12746. }
  12747. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  12748. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  12749. // Are we oob?
  12750. if (end > this.length) end = this.length
  12751. if (target.length - targetStart < end - start) {
  12752. end = target.length - targetStart + start
  12753. }
  12754. var len = end - start
  12755. var i
  12756. if (this === target && start < targetStart && targetStart < end) {
  12757. // descending copy from end
  12758. for (i = len - 1; i >= 0; --i) {
  12759. target[i + targetStart] = this[i + start]
  12760. }
  12761. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  12762. // ascending copy from start
  12763. for (i = 0; i < len; ++i) {
  12764. target[i + targetStart] = this[i + start]
  12765. }
  12766. } else {
  12767. Uint8Array.prototype.set.call(
  12768. target,
  12769. this.subarray(start, start + len),
  12770. targetStart
  12771. )
  12772. }
  12773. return len
  12774. }
  12775. // Usage:
  12776. // buffer.fill(number[, offset[, end]])
  12777. // buffer.fill(buffer[, offset[, end]])
  12778. // buffer.fill(string[, offset[, end]][, encoding])
  12779. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  12780. // Handle string cases:
  12781. if (typeof val === 'string') {
  12782. if (typeof start === 'string') {
  12783. encoding = start
  12784. start = 0
  12785. end = this.length
  12786. } else if (typeof end === 'string') {
  12787. encoding = end
  12788. end = this.length
  12789. }
  12790. if (val.length === 1) {
  12791. var code = val.charCodeAt(0)
  12792. if (code < 256) {
  12793. val = code
  12794. }
  12795. }
  12796. if (encoding !== undefined && typeof encoding !== 'string') {
  12797. throw new TypeError('encoding must be a string')
  12798. }
  12799. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  12800. throw new TypeError('Unknown encoding: ' + encoding)
  12801. }
  12802. } else if (typeof val === 'number') {
  12803. val = val & 255
  12804. }
  12805. // Invalid ranges are not set to a default, so can range check early.
  12806. if (start < 0 || this.length < start || this.length < end) {
  12807. throw new RangeError('Out of range index')
  12808. }
  12809. if (end <= start) {
  12810. return this
  12811. }
  12812. start = start >>> 0
  12813. end = end === undefined ? this.length : end >>> 0
  12814. if (!val) val = 0
  12815. var i
  12816. if (typeof val === 'number') {
  12817. for (i = start; i < end; ++i) {
  12818. this[i] = val
  12819. }
  12820. } else {
  12821. var bytes = Buffer.isBuffer(val)
  12822. ? val
  12823. : utf8ToBytes(new Buffer(val, encoding).toString())
  12824. var len = bytes.length
  12825. for (i = 0; i < end - start; ++i) {
  12826. this[i + start] = bytes[i % len]
  12827. }
  12828. }
  12829. return this
  12830. }
  12831. // HELPER FUNCTIONS
  12832. // ================
  12833. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  12834. function base64clean (str) {
  12835. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  12836. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  12837. // Node converts strings with length < 2 to ''
  12838. if (str.length < 2) return ''
  12839. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  12840. while (str.length % 4 !== 0) {
  12841. str = str + '='
  12842. }
  12843. return str
  12844. }
  12845. function stringtrim (str) {
  12846. if (str.trim) return str.trim()
  12847. return str.replace(/^\s+|\s+$/g, '')
  12848. }
  12849. function toHex (n) {
  12850. if (n < 16) return '0' + n.toString(16)
  12851. return n.toString(16)
  12852. }
  12853. function utf8ToBytes (string, units) {
  12854. units = units || Infinity
  12855. var codePoint
  12856. var length = string.length
  12857. var leadSurrogate = null
  12858. var bytes = []
  12859. for (var i = 0; i < length; ++i) {
  12860. codePoint = string.charCodeAt(i)
  12861. // is surrogate component
  12862. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  12863. // last char was a lead
  12864. if (!leadSurrogate) {
  12865. // no lead yet
  12866. if (codePoint > 0xDBFF) {
  12867. // unexpected trail
  12868. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12869. continue
  12870. } else if (i + 1 === length) {
  12871. // unpaired lead
  12872. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12873. continue
  12874. }
  12875. // valid lead
  12876. leadSurrogate = codePoint
  12877. continue
  12878. }
  12879. // 2 leads in a row
  12880. if (codePoint < 0xDC00) {
  12881. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12882. leadSurrogate = codePoint
  12883. continue
  12884. }
  12885. // valid surrogate pair
  12886. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  12887. } else if (leadSurrogate) {
  12888. // valid bmp char, but last char was a lead
  12889. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  12890. }
  12891. leadSurrogate = null
  12892. // encode utf8
  12893. if (codePoint < 0x80) {
  12894. if ((units -= 1) < 0) break
  12895. bytes.push(codePoint)
  12896. } else if (codePoint < 0x800) {
  12897. if ((units -= 2) < 0) break
  12898. bytes.push(
  12899. codePoint >> 0x6 | 0xC0,
  12900. codePoint & 0x3F | 0x80
  12901. )
  12902. } else if (codePoint < 0x10000) {
  12903. if ((units -= 3) < 0) break
  12904. bytes.push(
  12905. codePoint >> 0xC | 0xE0,
  12906. codePoint >> 0x6 & 0x3F | 0x80,
  12907. codePoint & 0x3F | 0x80
  12908. )
  12909. } else if (codePoint < 0x110000) {
  12910. if ((units -= 4) < 0) break
  12911. bytes.push(
  12912. codePoint >> 0x12 | 0xF0,
  12913. codePoint >> 0xC & 0x3F | 0x80,
  12914. codePoint >> 0x6 & 0x3F | 0x80,
  12915. codePoint & 0x3F | 0x80
  12916. )
  12917. } else {
  12918. throw new Error('Invalid code point')
  12919. }
  12920. }
  12921. return bytes
  12922. }
  12923. function asciiToBytes (str) {
  12924. var byteArray = []
  12925. for (var i = 0; i < str.length; ++i) {
  12926. // Node's code seems to be doing this and not & 0x7F..
  12927. byteArray.push(str.charCodeAt(i) & 0xFF)
  12928. }
  12929. return byteArray
  12930. }
  12931. function utf16leToBytes (str, units) {
  12932. var c, hi, lo
  12933. var byteArray = []
  12934. for (var i = 0; i < str.length; ++i) {
  12935. if ((units -= 2) < 0) break
  12936. c = str.charCodeAt(i)
  12937. hi = c >> 8
  12938. lo = c % 256
  12939. byteArray.push(lo)
  12940. byteArray.push(hi)
  12941. }
  12942. return byteArray
  12943. }
  12944. function base64ToBytes (str) {
  12945. return base64.toByteArray(base64clean(str))
  12946. }
  12947. function blitBuffer (src, dst, offset, length) {
  12948. for (var i = 0; i < length; ++i) {
  12949. if ((i + offset >= dst.length) || (i >= src.length)) break
  12950. dst[i + offset] = src[i]
  12951. }
  12952. return i
  12953. }
  12954. function isnan (val) {
  12955. return val !== val // eslint-disable-line no-self-compare
  12956. }
  12957. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ 3)))
  12958. /***/ }),
  12959. /* 56 */
  12960. /*!*****************************************!*\
  12961. !*** ./node_modules/base64-js/index.js ***!
  12962. \*****************************************/
  12963. /*! no static exports found */
  12964. /***/ (function(module, exports, __webpack_require__) {
  12965. "use strict";
  12966. exports.byteLength = byteLength
  12967. exports.toByteArray = toByteArray
  12968. exports.fromByteArray = fromByteArray
  12969. var lookup = []
  12970. var revLookup = []
  12971. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  12972. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  12973. for (var i = 0, len = code.length; i < len; ++i) {
  12974. lookup[i] = code[i]
  12975. revLookup[code.charCodeAt(i)] = i
  12976. }
  12977. // Support decoding URL-safe base64 strings, as Node.js does.
  12978. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  12979. revLookup['-'.charCodeAt(0)] = 62
  12980. revLookup['_'.charCodeAt(0)] = 63
  12981. function getLens (b64) {
  12982. var len = b64.length
  12983. if (len % 4 > 0) {
  12984. throw new Error('Invalid string. Length must be a multiple of 4')
  12985. }
  12986. // Trim off extra bytes after placeholder bytes are found
  12987. // See: https://github.com/beatgammit/base64-js/issues/42
  12988. var validLen = b64.indexOf('=')
  12989. if (validLen === -1) validLen = len
  12990. var placeHoldersLen = validLen === len
  12991. ? 0
  12992. : 4 - (validLen % 4)
  12993. return [validLen, placeHoldersLen]
  12994. }
  12995. // base64 is 4/3 + up to two characters of the original data
  12996. function byteLength (b64) {
  12997. var lens = getLens(b64)
  12998. var validLen = lens[0]
  12999. var placeHoldersLen = lens[1]
  13000. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  13001. }
  13002. function _byteLength (b64, validLen, placeHoldersLen) {
  13003. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  13004. }
  13005. function toByteArray (b64) {
  13006. var tmp
  13007. var lens = getLens(b64)
  13008. var validLen = lens[0]
  13009. var placeHoldersLen = lens[1]
  13010. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  13011. var curByte = 0
  13012. // if there are placeholders, only get up to the last complete 4 chars
  13013. var len = placeHoldersLen > 0
  13014. ? validLen - 4
  13015. : validLen
  13016. var i
  13017. for (i = 0; i < len; i += 4) {
  13018. tmp =
  13019. (revLookup[b64.charCodeAt(i)] << 18) |
  13020. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  13021. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  13022. revLookup[b64.charCodeAt(i + 3)]
  13023. arr[curByte++] = (tmp >> 16) & 0xFF
  13024. arr[curByte++] = (tmp >> 8) & 0xFF
  13025. arr[curByte++] = tmp & 0xFF
  13026. }
  13027. if (placeHoldersLen === 2) {
  13028. tmp =
  13029. (revLookup[b64.charCodeAt(i)] << 2) |
  13030. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  13031. arr[curByte++] = tmp & 0xFF
  13032. }
  13033. if (placeHoldersLen === 1) {
  13034. tmp =
  13035. (revLookup[b64.charCodeAt(i)] << 10) |
  13036. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  13037. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  13038. arr[curByte++] = (tmp >> 8) & 0xFF
  13039. arr[curByte++] = tmp & 0xFF
  13040. }
  13041. return arr
  13042. }
  13043. function tripletToBase64 (num) {
  13044. return lookup[num >> 18 & 0x3F] +
  13045. lookup[num >> 12 & 0x3F] +
  13046. lookup[num >> 6 & 0x3F] +
  13047. lookup[num & 0x3F]
  13048. }
  13049. function encodeChunk (uint8, start, end) {
  13050. var tmp
  13051. var output = []
  13052. for (var i = start; i < end; i += 3) {
  13053. tmp =
  13054. ((uint8[i] << 16) & 0xFF0000) +
  13055. ((uint8[i + 1] << 8) & 0xFF00) +
  13056. (uint8[i + 2] & 0xFF)
  13057. output.push(tripletToBase64(tmp))
  13058. }
  13059. return output.join('')
  13060. }
  13061. function fromByteArray (uint8) {
  13062. var tmp
  13063. var len = uint8.length
  13064. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  13065. var parts = []
  13066. var maxChunkLength = 16383 // must be multiple of 3
  13067. // go through the array every three bytes, we'll deal with trailing stuff later
  13068. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  13069. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  13070. }
  13071. // pad the end with zeros, but make sure to not forget the extra bytes
  13072. if (extraBytes === 1) {
  13073. tmp = uint8[len - 1]
  13074. parts.push(
  13075. lookup[tmp >> 2] +
  13076. lookup[(tmp << 4) & 0x3F] +
  13077. '=='
  13078. )
  13079. } else if (extraBytes === 2) {
  13080. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  13081. parts.push(
  13082. lookup[tmp >> 10] +
  13083. lookup[(tmp >> 4) & 0x3F] +
  13084. lookup[(tmp << 2) & 0x3F] +
  13085. '='
  13086. )
  13087. }
  13088. return parts.join('')
  13089. }
  13090. /***/ }),
  13091. /* 57 */
  13092. /*!***************************************!*\
  13093. !*** ./node_modules/ieee754/index.js ***!
  13094. \***************************************/
  13095. /*! no static exports found */
  13096. /***/ (function(module, exports) {
  13097. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  13098. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  13099. var e, m
  13100. var eLen = (nBytes * 8) - mLen - 1
  13101. var eMax = (1 << eLen) - 1
  13102. var eBias = eMax >> 1
  13103. var nBits = -7
  13104. var i = isLE ? (nBytes - 1) : 0
  13105. var d = isLE ? -1 : 1
  13106. var s = buffer[offset + i]
  13107. i += d
  13108. e = s & ((1 << (-nBits)) - 1)
  13109. s >>= (-nBits)
  13110. nBits += eLen
  13111. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  13112. m = e & ((1 << (-nBits)) - 1)
  13113. e >>= (-nBits)
  13114. nBits += mLen
  13115. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  13116. if (e === 0) {
  13117. e = 1 - eBias
  13118. } else if (e === eMax) {
  13119. return m ? NaN : ((s ? -1 : 1) * Infinity)
  13120. } else {
  13121. m = m + Math.pow(2, mLen)
  13122. e = e - eBias
  13123. }
  13124. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  13125. }
  13126. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  13127. var e, m, c
  13128. var eLen = (nBytes * 8) - mLen - 1
  13129. var eMax = (1 << eLen) - 1
  13130. var eBias = eMax >> 1
  13131. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  13132. var i = isLE ? 0 : (nBytes - 1)
  13133. var d = isLE ? 1 : -1
  13134. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  13135. value = Math.abs(value)
  13136. if (isNaN(value) || value === Infinity) {
  13137. m = isNaN(value) ? 1 : 0
  13138. e = eMax
  13139. } else {
  13140. e = Math.floor(Math.log(value) / Math.LN2)
  13141. if (value * (c = Math.pow(2, -e)) < 1) {
  13142. e--
  13143. c *= 2
  13144. }
  13145. if (e + eBias >= 1) {
  13146. value += rt / c
  13147. } else {
  13148. value += rt * Math.pow(2, 1 - eBias)
  13149. }
  13150. if (value * c >= 2) {
  13151. e++
  13152. c /= 2
  13153. }
  13154. if (e + eBias >= eMax) {
  13155. m = 0
  13156. e = eMax
  13157. } else if (e + eBias >= 1) {
  13158. m = ((value * c) - 1) * Math.pow(2, mLen)
  13159. e = e + eBias
  13160. } else {
  13161. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  13162. e = 0
  13163. }
  13164. }
  13165. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  13166. e = (e << mLen) | m
  13167. eLen += mLen
  13168. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  13169. buffer[offset + i - d] |= s * 128
  13170. }
  13171. /***/ }),
  13172. /* 58 */
  13173. /*!***************************************!*\
  13174. !*** ./node_modules/isarray/index.js ***!
  13175. \***************************************/
  13176. /*! no static exports found */
  13177. /***/ (function(module, exports) {
  13178. var toString = {}.toString;
  13179. module.exports = Array.isArray || function (arr) {
  13180. return toString.call(arr) == '[object Array]';
  13181. };
  13182. /***/ }),
  13183. /* 59 */
  13184. /*!******************************************************************************************************!*\
  13185. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/AxiosError.js ***!
  13186. \******************************************************************************************************/
  13187. /*! no static exports found */
  13188. /***/ (function(module, exports, __webpack_require__) {
  13189. "use strict";
  13190. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13191. Object.defineProperty(exports, "__esModule", {
  13192. value: true
  13193. });
  13194. exports.default = void 0;
  13195. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  13196. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  13197. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 60));
  13198. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 61));
  13199. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 62));
  13200. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 63));
  13201. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 64));
  13202. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  13203. 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); }; }
  13204. 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; } }
  13205. var AxiosError = /*#__PURE__*/function (_Error) {
  13206. (0, _inherits2.default)(AxiosError, _Error);
  13207. var _super = _createSuper(AxiosError);
  13208. /**
  13209. * Create an Error with the specified message, config, error code, request and response.
  13210. *
  13211. * @param {string} message The error message.
  13212. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  13213. * @param {Object} [config] The config.
  13214. * @param {Object} [request] The request.
  13215. * @param {Object} [response] The response.
  13216. *
  13217. * @returns {Error} The created error.
  13218. */
  13219. function AxiosError(message, code, config, request, response) {
  13220. var _this;
  13221. (0, _classCallCheck2.default)(this, AxiosError);
  13222. _this = _super.call(this, message);
  13223. // Make message enumerable to maintain backward compatibility
  13224. // The native Error constructor sets message as non-enumerable,
  13225. // but axios < v1.13.3 had it as enumerable
  13226. Object.defineProperty((0, _assertThisInitialized2.default)(_this), 'message', {
  13227. value: message,
  13228. enumerable: true,
  13229. writable: true,
  13230. configurable: true
  13231. });
  13232. _this.name = 'AxiosError';
  13233. _this.isAxiosError = true;
  13234. code && (_this.code = code);
  13235. config && (_this.config = config);
  13236. request && (_this.request = request);
  13237. if (response) {
  13238. _this.response = response;
  13239. _this.status = response.status;
  13240. }
  13241. return _this;
  13242. }
  13243. (0, _createClass2.default)(AxiosError, [{
  13244. key: "toJSON",
  13245. value: function toJSON() {
  13246. return {
  13247. // Standard
  13248. message: this.message,
  13249. name: this.name,
  13250. // Microsoft
  13251. description: this.description,
  13252. number: this.number,
  13253. // Mozilla
  13254. fileName: this.fileName,
  13255. lineNumber: this.lineNumber,
  13256. columnNumber: this.columnNumber,
  13257. stack: this.stack,
  13258. // Axios
  13259. config: _utils.default.toJSONObject(this.config),
  13260. code: this.code,
  13261. status: this.status
  13262. };
  13263. }
  13264. }], [{
  13265. key: "from",
  13266. value: function from(error, code, config, request, response, customProps) {
  13267. var axiosError = new AxiosError(error.message, code || error.code, config, request, response);
  13268. axiosError.cause = error;
  13269. axiosError.name = error.name;
  13270. // Preserve status from the original error if not already set from response
  13271. if (error.status != null && axiosError.status == null) {
  13272. axiosError.status = error.status;
  13273. }
  13274. customProps && Object.assign(axiosError, customProps);
  13275. return axiosError;
  13276. }
  13277. }]);
  13278. return AxiosError;
  13279. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
  13280. AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
  13281. AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
  13282. AxiosError.ECONNABORTED = 'ECONNABORTED';
  13283. AxiosError.ETIMEDOUT = 'ETIMEDOUT';
  13284. AxiosError.ERR_NETWORK = 'ERR_NETWORK';
  13285. AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
  13286. AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
  13287. AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
  13288. AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
  13289. AxiosError.ERR_CANCELED = 'ERR_CANCELED';
  13290. AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
  13291. AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
  13292. AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
  13293. var _default = AxiosError;
  13294. exports.default = _default;
  13295. /***/ }),
  13296. /* 60 */
  13297. /*!**********************************************************************!*\
  13298. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  13299. \**********************************************************************/
  13300. /*! no static exports found */
  13301. /***/ (function(module, exports) {
  13302. function _assertThisInitialized(self) {
  13303. if (self === void 0) {
  13304. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  13305. }
  13306. return self;
  13307. }
  13308. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13309. /***/ }),
  13310. /* 61 */
  13311. /*!*********************************************************!*\
  13312. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  13313. \*********************************************************/
  13314. /*! no static exports found */
  13315. /***/ (function(module, exports, __webpack_require__) {
  13316. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  13317. function _inherits(subClass, superClass) {
  13318. if (typeof superClass !== "function" && superClass !== null) {
  13319. throw new TypeError("Super expression must either be null or a function");
  13320. }
  13321. subClass.prototype = Object.create(superClass && superClass.prototype, {
  13322. constructor: {
  13323. value: subClass,
  13324. writable: true,
  13325. configurable: true
  13326. }
  13327. });
  13328. Object.defineProperty(subClass, "prototype", {
  13329. writable: false
  13330. });
  13331. if (superClass) setPrototypeOf(subClass, superClass);
  13332. }
  13333. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13334. /***/ }),
  13335. /* 62 */
  13336. /*!**************************************************************************!*\
  13337. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  13338. \**************************************************************************/
  13339. /*! no static exports found */
  13340. /***/ (function(module, exports, __webpack_require__) {
  13341. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  13342. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 60);
  13343. function _possibleConstructorReturn(self, call) {
  13344. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  13345. return call;
  13346. } else if (call !== void 0) {
  13347. throw new TypeError("Derived constructors may only return object or undefined");
  13348. }
  13349. return assertThisInitialized(self);
  13350. }
  13351. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13352. /***/ }),
  13353. /* 63 */
  13354. /*!***************************************************************!*\
  13355. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  13356. \***************************************************************/
  13357. /*! no static exports found */
  13358. /***/ (function(module, exports) {
  13359. function _getPrototypeOf(o) {
  13360. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  13361. return o.__proto__ || Object.getPrototypeOf(o);
  13362. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13363. return _getPrototypeOf(o);
  13364. }
  13365. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13366. /***/ }),
  13367. /* 64 */
  13368. /*!****************************************************************!*\
  13369. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  13370. \****************************************************************/
  13371. /*! no static exports found */
  13372. /***/ (function(module, exports, __webpack_require__) {
  13373. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 63);
  13374. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  13375. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 65);
  13376. var construct = __webpack_require__(/*! ./construct.js */ 15);
  13377. function _wrapNativeSuper(Class) {
  13378. var _cache = typeof Map === "function" ? new Map() : undefined;
  13379. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  13380. if (Class === null || !isNativeFunction(Class)) return Class;
  13381. if (typeof Class !== "function") {
  13382. throw new TypeError("Super expression must either be null or a function");
  13383. }
  13384. if (typeof _cache !== "undefined") {
  13385. if (_cache.has(Class)) return _cache.get(Class);
  13386. _cache.set(Class, Wrapper);
  13387. }
  13388. function Wrapper() {
  13389. return construct(Class, arguments, getPrototypeOf(this).constructor);
  13390. }
  13391. Wrapper.prototype = Object.create(Class.prototype, {
  13392. constructor: {
  13393. value: Wrapper,
  13394. enumerable: false,
  13395. writable: true,
  13396. configurable: true
  13397. }
  13398. });
  13399. return setPrototypeOf(Wrapper, Class);
  13400. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13401. return _wrapNativeSuper(Class);
  13402. }
  13403. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13404. /***/ }),
  13405. /* 65 */
  13406. /*!*****************************************************************!*\
  13407. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  13408. \*****************************************************************/
  13409. /*! no static exports found */
  13410. /***/ (function(module, exports) {
  13411. function _isNativeFunction(fn) {
  13412. try {
  13413. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  13414. } catch (e) {
  13415. return typeof fn === "function";
  13416. }
  13417. }
  13418. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13419. /***/ }),
  13420. /* 66 */
  13421. /*!***************************************************************************************************!*\
  13422. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/null.js ***!
  13423. \***************************************************************************************************/
  13424. /*! no static exports found */
  13425. /***/ (function(module, exports, __webpack_require__) {
  13426. "use strict";
  13427. Object.defineProperty(exports, "__esModule", {
  13428. value: true
  13429. });
  13430. exports.default = void 0;
  13431. // eslint-disable-next-line strict
  13432. var _default = null;
  13433. exports.default = _default;
  13434. /***/ }),
  13435. /* 67 */
  13436. /*!**************************************************************************************************************!*\
  13437. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/InterceptorManager.js ***!
  13438. \**************************************************************************************************************/
  13439. /*! no static exports found */
  13440. /***/ (function(module, exports, __webpack_require__) {
  13441. "use strict";
  13442. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13443. Object.defineProperty(exports, "__esModule", {
  13444. value: true
  13445. });
  13446. exports.default = void 0;
  13447. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  13448. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  13449. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  13450. var InterceptorManager = /*#__PURE__*/function () {
  13451. function InterceptorManager() {
  13452. (0, _classCallCheck2.default)(this, InterceptorManager);
  13453. this.handlers = [];
  13454. }
  13455. /**
  13456. * Add a new interceptor to the stack
  13457. *
  13458. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  13459. * @param {Function} rejected The function to handle `reject` for a `Promise`
  13460. * @param {Object} options The options for the interceptor, synchronous and runWhen
  13461. *
  13462. * @return {Number} An ID used to remove interceptor later
  13463. */
  13464. (0, _createClass2.default)(InterceptorManager, [{
  13465. key: "use",
  13466. value: function use(fulfilled, rejected, options) {
  13467. this.handlers.push({
  13468. fulfilled: fulfilled,
  13469. rejected: rejected,
  13470. synchronous: options ? options.synchronous : false,
  13471. runWhen: options ? options.runWhen : null
  13472. });
  13473. return this.handlers.length - 1;
  13474. }
  13475. /**
  13476. * Remove an interceptor from the stack
  13477. *
  13478. * @param {Number} id The ID that was returned by `use`
  13479. *
  13480. * @returns {void}
  13481. */
  13482. }, {
  13483. key: "eject",
  13484. value: function eject(id) {
  13485. if (this.handlers[id]) {
  13486. this.handlers[id] = null;
  13487. }
  13488. }
  13489. /**
  13490. * Clear all interceptors from the stack
  13491. *
  13492. * @returns {void}
  13493. */
  13494. }, {
  13495. key: "clear",
  13496. value: function clear() {
  13497. if (this.handlers) {
  13498. this.handlers = [];
  13499. }
  13500. }
  13501. /**
  13502. * Iterate over all the registered interceptors
  13503. *
  13504. * This method is particularly useful for skipping over any
  13505. * interceptors that may have become `null` calling `eject`.
  13506. *
  13507. * @param {Function} fn The function to call for each interceptor
  13508. *
  13509. * @returns {void}
  13510. */
  13511. }, {
  13512. key: "forEach",
  13513. value: function forEach(fn) {
  13514. _utils.default.forEach(this.handlers, function forEachHandler(h) {
  13515. if (h !== null) {
  13516. fn(h);
  13517. }
  13518. });
  13519. }
  13520. }]);
  13521. return InterceptorManager;
  13522. }();
  13523. var _default = InterceptorManager;
  13524. exports.default = _default;
  13525. /***/ }),
  13526. /* 68 */
  13527. /*!***********************************************************************************************************!*\
  13528. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/dispatchRequest.js ***!
  13529. \***********************************************************************************************************/
  13530. /*! no static exports found */
  13531. /***/ (function(module, exports, __webpack_require__) {
  13532. "use strict";
  13533. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13534. Object.defineProperty(exports, "__esModule", {
  13535. value: true
  13536. });
  13537. exports.default = dispatchRequest;
  13538. var _transformData = _interopRequireDefault(__webpack_require__(/*! ./transformData.js */ 69));
  13539. var _isCancel = _interopRequireDefault(__webpack_require__(/*! ../cancel/isCancel.js */ 82));
  13540. var _index = _interopRequireDefault(__webpack_require__(/*! ../defaults/index.js */ 70));
  13541. var _CanceledError = _interopRequireDefault(__webpack_require__(/*! ../cancel/CanceledError.js */ 83));
  13542. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosHeaders.js */ 80));
  13543. var _adapters = _interopRequireDefault(__webpack_require__(/*! ../adapters/adapters.js */ 84));
  13544. /**
  13545. * Throws a `CanceledError` if cancellation has been requested.
  13546. *
  13547. * @param {Object} config The config that is to be used for the request
  13548. *
  13549. * @returns {void}
  13550. */
  13551. function throwIfCancellationRequested(config) {
  13552. if (config.cancelToken) {
  13553. config.cancelToken.throwIfRequested();
  13554. }
  13555. if (config.signal && config.signal.aborted) {
  13556. throw new _CanceledError.default(null, config);
  13557. }
  13558. }
  13559. /**
  13560. * Dispatch a request to the server using the configured adapter.
  13561. *
  13562. * @param {object} config The config that is to be used for the request
  13563. *
  13564. * @returns {Promise} The Promise to be fulfilled
  13565. */
  13566. function dispatchRequest(config) {
  13567. throwIfCancellationRequested(config);
  13568. config.headers = _AxiosHeaders.default.from(config.headers);
  13569. // Transform request data
  13570. config.data = _transformData.default.call(config, config.transformRequest);
  13571. if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
  13572. config.headers.setContentType('application/x-www-form-urlencoded', false);
  13573. }
  13574. var adapter = _adapters.default.getAdapter(config.adapter || _index.default.adapter, config);
  13575. return adapter(config).then(function onAdapterResolution(response) {
  13576. throwIfCancellationRequested(config);
  13577. // Transform response data
  13578. response.data = _transformData.default.call(config, config.transformResponse, response);
  13579. response.headers = _AxiosHeaders.default.from(response.headers);
  13580. return response;
  13581. }, function onAdapterRejection(reason) {
  13582. if (!(0, _isCancel.default)(reason)) {
  13583. throwIfCancellationRequested(config);
  13584. // Transform response data
  13585. if (reason && reason.response) {
  13586. reason.response.data = _transformData.default.call(config, config.transformResponse, reason.response);
  13587. reason.response.headers = _AxiosHeaders.default.from(reason.response.headers);
  13588. }
  13589. }
  13590. return Promise.reject(reason);
  13591. });
  13592. }
  13593. /***/ }),
  13594. /* 69 */
  13595. /*!*********************************************************************************************************!*\
  13596. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/transformData.js ***!
  13597. \*********************************************************************************************************/
  13598. /*! no static exports found */
  13599. /***/ (function(module, exports, __webpack_require__) {
  13600. "use strict";
  13601. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13602. Object.defineProperty(exports, "__esModule", {
  13603. value: true
  13604. });
  13605. exports.default = transformData;
  13606. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  13607. var _index = _interopRequireDefault(__webpack_require__(/*! ../defaults/index.js */ 70));
  13608. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosHeaders.js */ 80));
  13609. /**
  13610. * Transform the data for a request or a response
  13611. *
  13612. * @param {Array|Function} fns A single function or Array of functions
  13613. * @param {?Object} response The response object
  13614. *
  13615. * @returns {*} The resulting transformed data
  13616. */
  13617. function transformData(fns, response) {
  13618. var config = this || _index.default;
  13619. var context = response || config;
  13620. var headers = _AxiosHeaders.default.from(context.headers);
  13621. var data = context.data;
  13622. _utils.default.forEach(fns, function transform(fn) {
  13623. data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
  13624. });
  13625. headers.normalize();
  13626. return data;
  13627. }
  13628. /***/ }),
  13629. /* 70 */
  13630. /*!*****************************************************************************************************!*\
  13631. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/defaults/index.js ***!
  13632. \*****************************************************************************************************/
  13633. /*! no static exports found */
  13634. /***/ (function(module, exports, __webpack_require__) {
  13635. "use strict";
  13636. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13637. Object.defineProperty(exports, "__esModule", {
  13638. value: true
  13639. });
  13640. exports.default = void 0;
  13641. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  13642. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  13643. var _transitional = _interopRequireDefault(__webpack_require__(/*! ./transitional.js */ 71));
  13644. var _toFormData = _interopRequireDefault(__webpack_require__(/*! ../helpers/toFormData.js */ 54));
  13645. var _toURLEncodedForm = _interopRequireDefault(__webpack_require__(/*! ../helpers/toURLEncodedForm.js */ 72));
  13646. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  13647. var _formDataToJSON = _interopRequireDefault(__webpack_require__(/*! ../helpers/formDataToJSON.js */ 79));
  13648. var own = function own(obj, key) {
  13649. return obj != null && _utils.default.hasOwnProp(obj, key) ? obj[key] : undefined;
  13650. };
  13651. /**
  13652. * It takes a string, tries to parse it, and if it fails, it returns the stringified version
  13653. * of the input
  13654. *
  13655. * @param {any} rawValue - The value to be stringified.
  13656. * @param {Function} parser - A function that parses a string into a JavaScript object.
  13657. * @param {Function} encoder - A function that takes a value and returns a string.
  13658. *
  13659. * @returns {string} A stringified version of the rawValue.
  13660. */
  13661. function stringifySafely(rawValue, parser, encoder) {
  13662. if (_utils.default.isString(rawValue)) {
  13663. try {
  13664. (parser || JSON.parse)(rawValue);
  13665. return _utils.default.trim(rawValue);
  13666. } catch (e) {
  13667. if (e.name !== 'SyntaxError') {
  13668. throw e;
  13669. }
  13670. }
  13671. }
  13672. return (encoder || JSON.stringify)(rawValue);
  13673. }
  13674. var defaults = {
  13675. transitional: _transitional.default,
  13676. adapter: ['xhr', 'http', 'fetch'],
  13677. transformRequest: [function transformRequest(data, headers) {
  13678. var contentType = headers.getContentType() || '';
  13679. var hasJSONContentType = contentType.indexOf('application/json') > -1;
  13680. var isObjectPayload = _utils.default.isObject(data);
  13681. if (isObjectPayload && _utils.default.isHTMLForm(data)) {
  13682. data = new FormData(data);
  13683. }
  13684. var isFormData = _utils.default.isFormData(data);
  13685. if (isFormData) {
  13686. return hasJSONContentType ? JSON.stringify((0, _formDataToJSON.default)(data)) : data;
  13687. }
  13688. if (_utils.default.isArrayBuffer(data) || _utils.default.isBuffer(data) || _utils.default.isStream(data) || _utils.default.isFile(data) || _utils.default.isBlob(data) || _utils.default.isReadableStream(data)) {
  13689. return data;
  13690. }
  13691. if (_utils.default.isArrayBufferView(data)) {
  13692. return data.buffer;
  13693. }
  13694. if (_utils.default.isURLSearchParams(data)) {
  13695. headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
  13696. return data.toString();
  13697. }
  13698. var isFileList;
  13699. if (isObjectPayload) {
  13700. var formSerializer = own(this, 'formSerializer');
  13701. if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
  13702. return (0, _toURLEncodedForm.default)(data, formSerializer).toString();
  13703. }
  13704. if ((isFileList = _utils.default.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
  13705. var env = own(this, 'env');
  13706. var _FormData = env && env.FormData;
  13707. return (0, _toFormData.default)(isFileList ? {
  13708. 'files[]': data
  13709. } : data, _FormData && new _FormData(), formSerializer);
  13710. }
  13711. }
  13712. if (isObjectPayload || hasJSONContentType) {
  13713. headers.setContentType('application/json', false);
  13714. return stringifySafely(data);
  13715. }
  13716. return data;
  13717. }],
  13718. transformResponse: [function transformResponse(data) {
  13719. var transitional = own(this, 'transitional') || defaults.transitional;
  13720. var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
  13721. var responseType = own(this, 'responseType');
  13722. var JSONRequested = responseType === 'json';
  13723. if (_utils.default.isResponse(data) || _utils.default.isReadableStream(data)) {
  13724. return data;
  13725. }
  13726. if (data && _utils.default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
  13727. var silentJSONParsing = transitional && transitional.silentJSONParsing;
  13728. var strictJSONParsing = !silentJSONParsing && JSONRequested;
  13729. try {
  13730. return JSON.parse(data, own(this, 'parseReviver'));
  13731. } catch (e) {
  13732. if (strictJSONParsing) {
  13733. if (e.name === 'SyntaxError') {
  13734. throw _AxiosError.default.from(e, _AxiosError.default.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
  13735. }
  13736. throw e;
  13737. }
  13738. }
  13739. }
  13740. return data;
  13741. }],
  13742. /**
  13743. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  13744. * timeout is not created.
  13745. */
  13746. timeout: 0,
  13747. xsrfCookieName: 'XSRF-TOKEN',
  13748. xsrfHeaderName: 'X-XSRF-TOKEN',
  13749. maxContentLength: -1,
  13750. maxBodyLength: -1,
  13751. env: {
  13752. FormData: _index.default.classes.FormData,
  13753. Blob: _index.default.classes.Blob
  13754. },
  13755. validateStatus: function validateStatus(status) {
  13756. return status >= 200 && status < 300;
  13757. },
  13758. headers: {
  13759. common: {
  13760. Accept: 'application/json, text/plain, */*',
  13761. 'Content-Type': undefined
  13762. }
  13763. }
  13764. };
  13765. _utils.default.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) {
  13766. defaults.headers[method] = {};
  13767. });
  13768. var _default = defaults;
  13769. exports.default = _default;
  13770. /***/ }),
  13771. /* 71 */
  13772. /*!************************************************************************************************************!*\
  13773. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/defaults/transitional.js ***!
  13774. \************************************************************************************************************/
  13775. /*! no static exports found */
  13776. /***/ (function(module, exports, __webpack_require__) {
  13777. "use strict";
  13778. Object.defineProperty(exports, "__esModule", {
  13779. value: true
  13780. });
  13781. exports.default = void 0;
  13782. var _default = {
  13783. silentJSONParsing: true,
  13784. forcedJSONParsing: true,
  13785. clarifyTimeoutError: false,
  13786. legacyInterceptorReqResOrdering: true
  13787. };
  13788. exports.default = _default;
  13789. /***/ }),
  13790. /* 72 */
  13791. /*!***************************************************************************************************************!*\
  13792. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/toURLEncodedForm.js ***!
  13793. \***************************************************************************************************************/
  13794. /*! no static exports found */
  13795. /***/ (function(module, exports, __webpack_require__) {
  13796. "use strict";
  13797. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13798. Object.defineProperty(exports, "__esModule", {
  13799. value: true
  13800. });
  13801. exports.default = toURLEncodedForm;
  13802. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  13803. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  13804. var _toFormData = _interopRequireDefault(__webpack_require__(/*! ./toFormData.js */ 54));
  13805. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  13806. 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; }
  13807. 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; }
  13808. function toURLEncodedForm(data, options) {
  13809. return (0, _toFormData.default)(data, new _index.default.classes.URLSearchParams(), _objectSpread({
  13810. visitor: function visitor(value, key, path, helpers) {
  13811. if (_index.default.isNode && _utils.default.isBuffer(value)) {
  13812. this.append(key, value.toString('base64'));
  13813. return false;
  13814. }
  13815. return helpers.defaultVisitor.apply(this, arguments);
  13816. }
  13817. }, options));
  13818. }
  13819. /***/ }),
  13820. /* 73 */
  13821. /*!*****************************************************************************************************!*\
  13822. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/platform/index.js ***!
  13823. \*****************************************************************************************************/
  13824. /*! no static exports found */
  13825. /***/ (function(module, exports, __webpack_require__) {
  13826. "use strict";
  13827. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13828. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  13829. Object.defineProperty(exports, "__esModule", {
  13830. value: true
  13831. });
  13832. exports.default = void 0;
  13833. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  13834. var _index = _interopRequireDefault(__webpack_require__(/*! ./node/index.js */ 74));
  13835. var utils = _interopRequireWildcard(__webpack_require__(/*! ./common/utils.js */ 78));
  13836. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  13837. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  13838. 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; }
  13839. 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; }
  13840. var _default = _objectSpread(_objectSpread({}, utils), _index.default);
  13841. exports.default = _default;
  13842. /***/ }),
  13843. /* 74 */
  13844. /*!*************************************************************************************************************!*\
  13845. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/platform/browser/index.js ***!
  13846. \*************************************************************************************************************/
  13847. /*! no static exports found */
  13848. /***/ (function(module, exports, __webpack_require__) {
  13849. "use strict";
  13850. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13851. Object.defineProperty(exports, "__esModule", {
  13852. value: true
  13853. });
  13854. exports.default = void 0;
  13855. var _URLSearchParams = _interopRequireDefault(__webpack_require__(/*! ./classes/URLSearchParams.js */ 75));
  13856. var _FormData = _interopRequireDefault(__webpack_require__(/*! ./classes/FormData.js */ 76));
  13857. var _Blob = _interopRequireDefault(__webpack_require__(/*! ./classes/Blob.js */ 77));
  13858. var _default = {
  13859. isBrowser: true,
  13860. classes: {
  13861. URLSearchParams: _URLSearchParams.default,
  13862. FormData: _FormData.default,
  13863. Blob: _Blob.default
  13864. },
  13865. protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
  13866. };
  13867. exports.default = _default;
  13868. /***/ }),
  13869. /* 75 */
  13870. /*!*******************************************************************************************************************************!*\
  13871. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***!
  13872. \*******************************************************************************************************************************/
  13873. /*! no static exports found */
  13874. /***/ (function(module, exports, __webpack_require__) {
  13875. "use strict";
  13876. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13877. Object.defineProperty(exports, "__esModule", {
  13878. value: true
  13879. });
  13880. exports.default = void 0;
  13881. var _AxiosURLSearchParams = _interopRequireDefault(__webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ 53));
  13882. var _default = typeof URLSearchParams !== 'undefined' ? URLSearchParams : _AxiosURLSearchParams.default;
  13883. exports.default = _default;
  13884. /***/ }),
  13885. /* 76 */
  13886. /*!************************************************************************************************************************!*\
  13887. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/platform/browser/classes/FormData.js ***!
  13888. \************************************************************************************************************************/
  13889. /*! no static exports found */
  13890. /***/ (function(module, exports, __webpack_require__) {
  13891. "use strict";
  13892. Object.defineProperty(exports, "__esModule", {
  13893. value: true
  13894. });
  13895. exports.default = void 0;
  13896. var _default = typeof FormData !== 'undefined' ? FormData : null;
  13897. exports.default = _default;
  13898. /***/ }),
  13899. /* 77 */
  13900. /*!********************************************************************************************************************!*\
  13901. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/platform/browser/classes/Blob.js ***!
  13902. \********************************************************************************************************************/
  13903. /*! no static exports found */
  13904. /***/ (function(module, exports, __webpack_require__) {
  13905. "use strict";
  13906. Object.defineProperty(exports, "__esModule", {
  13907. value: true
  13908. });
  13909. exports.default = void 0;
  13910. var _default = typeof Blob !== 'undefined' ? Blob : null;
  13911. exports.default = _default;
  13912. /***/ }),
  13913. /* 78 */
  13914. /*!************************************************************************************************************!*\
  13915. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/platform/common/utils.js ***!
  13916. \************************************************************************************************************/
  13917. /*! no static exports found */
  13918. /***/ (function(module, exports, __webpack_require__) {
  13919. "use strict";
  13920. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13921. Object.defineProperty(exports, "__esModule", {
  13922. value: true
  13923. });
  13924. exports.origin = exports.navigator = exports.hasStandardBrowserWebWorkerEnv = exports.hasStandardBrowserEnv = exports.hasBrowserEnv = void 0;
  13925. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  13926. var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
  13927. exports.hasBrowserEnv = hasBrowserEnv;
  13928. var _navigator = (typeof navigator === "undefined" ? "undefined" : (0, _typeof2.default)(navigator)) === 'object' && navigator || undefined;
  13929. /**
  13930. * Determine if we're running in a standard browser environment
  13931. *
  13932. * This allows axios to run in a web worker, and react-native.
  13933. * Both environments support XMLHttpRequest, but not fully standard globals.
  13934. *
  13935. * web workers:
  13936. * typeof window -> undefined
  13937. * typeof document -> undefined
  13938. *
  13939. * react-native:
  13940. * navigator.product -> 'ReactNative'
  13941. * nativescript
  13942. * navigator.product -> 'NativeScript' or 'NS'
  13943. *
  13944. * @returns {boolean}
  13945. */
  13946. exports.navigator = _navigator;
  13947. var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
  13948. /**
  13949. * Determine if we're running in a standard browser webWorker environment
  13950. *
  13951. * Although the `isStandardBrowserEnv` method indicates that
  13952. * `allows axios to run in a web worker`, the WebWorker will still be
  13953. * filtered out due to its judgment standard
  13954. * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
  13955. * This leads to a problem when axios post `FormData` in webWorker
  13956. */
  13957. exports.hasStandardBrowserEnv = hasStandardBrowserEnv;
  13958. var hasStandardBrowserWebWorkerEnv = function () {
  13959. return typeof WorkerGlobalScope !== 'undefined' &&
  13960. // eslint-disable-next-line no-undef
  13961. self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
  13962. }();
  13963. exports.hasStandardBrowserWebWorkerEnv = hasStandardBrowserWebWorkerEnv;
  13964. var origin = hasBrowserEnv && window.location.href || 'http://localhost';
  13965. exports.origin = origin;
  13966. /***/ }),
  13967. /* 79 */
  13968. /*!*************************************************************************************************************!*\
  13969. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/formDataToJSON.js ***!
  13970. \*************************************************************************************************************/
  13971. /*! no static exports found */
  13972. /***/ (function(module, exports, __webpack_require__) {
  13973. "use strict";
  13974. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  13975. Object.defineProperty(exports, "__esModule", {
  13976. value: true
  13977. });
  13978. exports.default = void 0;
  13979. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  13980. /**
  13981. * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
  13982. *
  13983. * @param {string} name - The name of the property to get.
  13984. *
  13985. * @returns An array of strings.
  13986. */
  13987. function parsePropPath(name) {
  13988. // foo[x][y][z]
  13989. // foo.x.y.z
  13990. // foo-x-y-z
  13991. // foo x y z
  13992. return _utils.default.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) {
  13993. return match[0] === '[]' ? '' : match[1] || match[0];
  13994. });
  13995. }
  13996. /**
  13997. * Convert an array to an object.
  13998. *
  13999. * @param {Array<any>} arr - The array to convert to an object.
  14000. *
  14001. * @returns An object with the same keys and values as the array.
  14002. */
  14003. function arrayToObject(arr) {
  14004. var obj = {};
  14005. var keys = Object.keys(arr);
  14006. var i;
  14007. var len = keys.length;
  14008. var key;
  14009. for (i = 0; i < len; i++) {
  14010. key = keys[i];
  14011. obj[key] = arr[key];
  14012. }
  14013. return obj;
  14014. }
  14015. /**
  14016. * It takes a FormData object and returns a JavaScript object
  14017. *
  14018. * @param {string} formData The FormData object to convert to JSON.
  14019. *
  14020. * @returns {Object<string, any> | null} The converted object.
  14021. */
  14022. function formDataToJSON(formData) {
  14023. function buildPath(path, value, target, index) {
  14024. var name = path[index++];
  14025. if (name === '__proto__') return true;
  14026. var isNumericKey = Number.isFinite(+name);
  14027. var isLast = index >= path.length;
  14028. name = !name && _utils.default.isArray(target) ? target.length : name;
  14029. if (isLast) {
  14030. if (_utils.default.hasOwnProp(target, name)) {
  14031. target[name] = _utils.default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
  14032. } else {
  14033. target[name] = value;
  14034. }
  14035. return !isNumericKey;
  14036. }
  14037. if (!target[name] || !_utils.default.isObject(target[name])) {
  14038. target[name] = [];
  14039. }
  14040. var result = buildPath(path, value, target[name], index);
  14041. if (result && _utils.default.isArray(target[name])) {
  14042. target[name] = arrayToObject(target[name]);
  14043. }
  14044. return !isNumericKey;
  14045. }
  14046. if (_utils.default.isFormData(formData) && _utils.default.isFunction(formData.entries)) {
  14047. var obj = {};
  14048. _utils.default.forEachEntry(formData, function (name, value) {
  14049. buildPath(parsePropPath(name), value, obj, 0);
  14050. });
  14051. return obj;
  14052. }
  14053. return null;
  14054. }
  14055. var _default = formDataToJSON;
  14056. exports.default = _default;
  14057. /***/ }),
  14058. /* 80 */
  14059. /*!********************************************************************************************************!*\
  14060. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/AxiosHeaders.js ***!
  14061. \********************************************************************************************************/
  14062. /*! no static exports found */
  14063. /***/ (function(module, exports, __webpack_require__) {
  14064. "use strict";
  14065. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14066. Object.defineProperty(exports, "__esModule", {
  14067. value: true
  14068. });
  14069. exports.default = void 0;
  14070. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  14071. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  14072. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  14073. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  14074. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  14075. var _parseHeaders = _interopRequireDefault(__webpack_require__(/*! ../helpers/parseHeaders.js */ 81));
  14076. 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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  14077. 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); }
  14078. 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; }
  14079. var $internals = Symbol('internals');
  14080. var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
  14081. function trimSPorHTAB(str) {
  14082. var start = 0;
  14083. var end = str.length;
  14084. while (start < end) {
  14085. var code = str.charCodeAt(start);
  14086. if (code !== 0x09 && code !== 0x20) {
  14087. break;
  14088. }
  14089. start += 1;
  14090. }
  14091. while (end > start) {
  14092. var _code = str.charCodeAt(end - 1);
  14093. if (_code !== 0x09 && _code !== 0x20) {
  14094. break;
  14095. }
  14096. end -= 1;
  14097. }
  14098. return start === 0 && end === str.length ? str : str.slice(start, end);
  14099. }
  14100. function normalizeHeader(header) {
  14101. return header && String(header).trim().toLowerCase();
  14102. }
  14103. function sanitizeHeaderValue(str) {
  14104. return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
  14105. }
  14106. function normalizeValue(value) {
  14107. if (value === false || value == null) {
  14108. return value;
  14109. }
  14110. return _utils.default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
  14111. }
  14112. function parseTokens(str) {
  14113. var tokens = Object.create(null);
  14114. var tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  14115. var match;
  14116. while (match = tokensRE.exec(str)) {
  14117. tokens[match[1]] = match[2];
  14118. }
  14119. return tokens;
  14120. }
  14121. var isValidHeaderName = function isValidHeaderName(str) {
  14122. return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
  14123. };
  14124. function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
  14125. if (_utils.default.isFunction(filter)) {
  14126. return filter.call(this, value, header);
  14127. }
  14128. if (isHeaderNameFilter) {
  14129. value = header;
  14130. }
  14131. if (!_utils.default.isString(value)) return;
  14132. if (_utils.default.isString(filter)) {
  14133. return value.indexOf(filter) !== -1;
  14134. }
  14135. if (_utils.default.isRegExp(filter)) {
  14136. return filter.test(value);
  14137. }
  14138. }
  14139. function formatHeader(header) {
  14140. return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, function (w, char, str) {
  14141. return char.toUpperCase() + str;
  14142. });
  14143. }
  14144. function buildAccessors(obj, header) {
  14145. var accessorName = _utils.default.toCamelCase(' ' + header);
  14146. ['get', 'set', 'has'].forEach(function (methodName) {
  14147. Object.defineProperty(obj, methodName + accessorName, {
  14148. value: function value(arg1, arg2, arg3) {
  14149. return this[methodName].call(this, header, arg1, arg2, arg3);
  14150. },
  14151. configurable: true
  14152. });
  14153. });
  14154. }
  14155. var AxiosHeaders = /*#__PURE__*/function (_Symbol$iterator, _Symbol$toStringTag) {
  14156. function AxiosHeaders(headers) {
  14157. (0, _classCallCheck2.default)(this, AxiosHeaders);
  14158. headers && this.set(headers);
  14159. }
  14160. (0, _createClass2.default)(AxiosHeaders, [{
  14161. key: "set",
  14162. value: function set(header, valueOrRewrite, rewrite) {
  14163. var self = this;
  14164. function setHeader(_value, _header, _rewrite) {
  14165. var lHeader = normalizeHeader(_header);
  14166. if (!lHeader) {
  14167. throw new Error('header name must be a non-empty string');
  14168. }
  14169. var key = _utils.default.findKey(self, lHeader);
  14170. if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
  14171. self[key || _header] = normalizeValue(_value);
  14172. }
  14173. }
  14174. var setHeaders = function setHeaders(headers, _rewrite) {
  14175. return _utils.default.forEach(headers, function (_value, _header) {
  14176. return setHeader(_value, _header, _rewrite);
  14177. });
  14178. };
  14179. if (_utils.default.isPlainObject(header) || header instanceof this.constructor) {
  14180. setHeaders(header, valueOrRewrite);
  14181. } else if (_utils.default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
  14182. setHeaders((0, _parseHeaders.default)(header), valueOrRewrite);
  14183. } else if (_utils.default.isObject(header) && _utils.default.isIterable(header)) {
  14184. var obj = {},
  14185. dest,
  14186. key;
  14187. var _iterator = _createForOfIteratorHelper(header),
  14188. _step;
  14189. try {
  14190. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  14191. var entry = _step.value;
  14192. if (!_utils.default.isArray(entry)) {
  14193. throw TypeError('Object iterator must return a key-value pair');
  14194. }
  14195. obj[key = entry[0]] = (dest = obj[key]) ? _utils.default.isArray(dest) ? [].concat((0, _toConsumableArray2.default)(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
  14196. }
  14197. } catch (err) {
  14198. _iterator.e(err);
  14199. } finally {
  14200. _iterator.f();
  14201. }
  14202. setHeaders(obj, valueOrRewrite);
  14203. } else {
  14204. header != null && setHeader(valueOrRewrite, header, rewrite);
  14205. }
  14206. return this;
  14207. }
  14208. }, {
  14209. key: "get",
  14210. value: function get(header, parser) {
  14211. header = normalizeHeader(header);
  14212. if (header) {
  14213. var key = _utils.default.findKey(this, header);
  14214. if (key) {
  14215. var value = this[key];
  14216. if (!parser) {
  14217. return value;
  14218. }
  14219. if (parser === true) {
  14220. return parseTokens(value);
  14221. }
  14222. if (_utils.default.isFunction(parser)) {
  14223. return parser.call(this, value, key);
  14224. }
  14225. if (_utils.default.isRegExp(parser)) {
  14226. return parser.exec(value);
  14227. }
  14228. throw new TypeError('parser must be boolean|regexp|function');
  14229. }
  14230. }
  14231. }
  14232. }, {
  14233. key: "has",
  14234. value: function has(header, matcher) {
  14235. header = normalizeHeader(header);
  14236. if (header) {
  14237. var key = _utils.default.findKey(this, header);
  14238. return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
  14239. }
  14240. return false;
  14241. }
  14242. }, {
  14243. key: "delete",
  14244. value: function _delete(header, matcher) {
  14245. var self = this;
  14246. var deleted = false;
  14247. function deleteHeader(_header) {
  14248. _header = normalizeHeader(_header);
  14249. if (_header) {
  14250. var key = _utils.default.findKey(self, _header);
  14251. if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
  14252. delete self[key];
  14253. deleted = true;
  14254. }
  14255. }
  14256. }
  14257. if (_utils.default.isArray(header)) {
  14258. header.forEach(deleteHeader);
  14259. } else {
  14260. deleteHeader(header);
  14261. }
  14262. return deleted;
  14263. }
  14264. }, {
  14265. key: "clear",
  14266. value: function clear(matcher) {
  14267. var keys = Object.keys(this);
  14268. var i = keys.length;
  14269. var deleted = false;
  14270. while (i--) {
  14271. var key = keys[i];
  14272. if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
  14273. delete this[key];
  14274. deleted = true;
  14275. }
  14276. }
  14277. return deleted;
  14278. }
  14279. }, {
  14280. key: "normalize",
  14281. value: function normalize(format) {
  14282. var self = this;
  14283. var headers = {};
  14284. _utils.default.forEach(this, function (value, header) {
  14285. var key = _utils.default.findKey(headers, header);
  14286. if (key) {
  14287. self[key] = normalizeValue(value);
  14288. delete self[header];
  14289. return;
  14290. }
  14291. var normalized = format ? formatHeader(header) : String(header).trim();
  14292. if (normalized !== header) {
  14293. delete self[header];
  14294. }
  14295. self[normalized] = normalizeValue(value);
  14296. headers[normalized] = true;
  14297. });
  14298. return this;
  14299. }
  14300. }, {
  14301. key: "concat",
  14302. value: function concat() {
  14303. var _this$constructor;
  14304. for (var _len = arguments.length, targets = new Array(_len), _key = 0; _key < _len; _key++) {
  14305. targets[_key] = arguments[_key];
  14306. }
  14307. return (_this$constructor = this.constructor).concat.apply(_this$constructor, [this].concat(targets));
  14308. }
  14309. }, {
  14310. key: "toJSON",
  14311. value: function toJSON(asStrings) {
  14312. var obj = Object.create(null);
  14313. _utils.default.forEach(this, function (value, header) {
  14314. value != null && value !== false && (obj[header] = asStrings && _utils.default.isArray(value) ? value.join(', ') : value);
  14315. });
  14316. return obj;
  14317. }
  14318. }, {
  14319. key: _Symbol$iterator,
  14320. value: function value() {
  14321. return Object.entries(this.toJSON())[Symbol.iterator]();
  14322. }
  14323. }, {
  14324. key: "toString",
  14325. value: function toString() {
  14326. return Object.entries(this.toJSON()).map(function (_ref) {
  14327. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  14328. header = _ref2[0],
  14329. value = _ref2[1];
  14330. return header + ': ' + value;
  14331. }).join('\n');
  14332. }
  14333. }, {
  14334. key: "getSetCookie",
  14335. value: function getSetCookie() {
  14336. return this.get('set-cookie') || [];
  14337. }
  14338. }, {
  14339. key: _Symbol$toStringTag,
  14340. get: function get() {
  14341. return 'AxiosHeaders';
  14342. }
  14343. }], [{
  14344. key: "from",
  14345. value: function from(thing) {
  14346. return thing instanceof this ? thing : new this(thing);
  14347. }
  14348. }, {
  14349. key: "concat",
  14350. value: function concat(first) {
  14351. var computed = new this(first);
  14352. for (var _len2 = arguments.length, targets = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  14353. targets[_key2 - 1] = arguments[_key2];
  14354. }
  14355. targets.forEach(function (target) {
  14356. return computed.set(target);
  14357. });
  14358. return computed;
  14359. }
  14360. }, {
  14361. key: "accessor",
  14362. value: function accessor(header) {
  14363. var internals = this[$internals] = this[$internals] = {
  14364. accessors: {}
  14365. };
  14366. var accessors = internals.accessors;
  14367. var prototype = this.prototype;
  14368. function defineAccessor(_header) {
  14369. var lHeader = normalizeHeader(_header);
  14370. if (!accessors[lHeader]) {
  14371. buildAccessors(prototype, _header);
  14372. accessors[lHeader] = true;
  14373. }
  14374. }
  14375. _utils.default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
  14376. return this;
  14377. }
  14378. }]);
  14379. return AxiosHeaders;
  14380. }(Symbol.iterator, Symbol.toStringTag);
  14381. AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
  14382. // reserved names hotfix
  14383. _utils.default.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) {
  14384. var value = _ref3.value;
  14385. var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
  14386. return {
  14387. get: function get() {
  14388. return value;
  14389. },
  14390. set: function set(headerValue) {
  14391. this[mapped] = headerValue;
  14392. }
  14393. };
  14394. });
  14395. _utils.default.freezeMethods(AxiosHeaders);
  14396. var _default = AxiosHeaders;
  14397. exports.default = _default;
  14398. /***/ }),
  14399. /* 81 */
  14400. /*!***********************************************************************************************************!*\
  14401. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/parseHeaders.js ***!
  14402. \***********************************************************************************************************/
  14403. /*! no static exports found */
  14404. /***/ (function(module, exports, __webpack_require__) {
  14405. "use strict";
  14406. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14407. Object.defineProperty(exports, "__esModule", {
  14408. value: true
  14409. });
  14410. exports.default = void 0;
  14411. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  14412. // RawAxiosHeaders whose duplicates are ignored by node
  14413. // c.f. https://nodejs.org/api/http.html#http_message_headers
  14414. var ignoreDuplicateOf = _utils.default.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
  14415. /**
  14416. * Parse headers into an object
  14417. *
  14418. * ```
  14419. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  14420. * Content-Type: application/json
  14421. * Connection: keep-alive
  14422. * Transfer-Encoding: chunked
  14423. * ```
  14424. *
  14425. * @param {String} rawHeaders Headers needing to be parsed
  14426. *
  14427. * @returns {Object} Headers parsed into an object
  14428. */
  14429. var _default = function _default(rawHeaders) {
  14430. var parsed = {};
  14431. var key;
  14432. var val;
  14433. var i;
  14434. rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
  14435. i = line.indexOf(':');
  14436. key = line.substring(0, i).trim().toLowerCase();
  14437. val = line.substring(i + 1).trim();
  14438. if (!key || parsed[key] && ignoreDuplicateOf[key]) {
  14439. return;
  14440. }
  14441. if (key === 'set-cookie') {
  14442. if (parsed[key]) {
  14443. parsed[key].push(val);
  14444. } else {
  14445. parsed[key] = [val];
  14446. }
  14447. } else {
  14448. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  14449. }
  14450. });
  14451. return parsed;
  14452. };
  14453. exports.default = _default;
  14454. /***/ }),
  14455. /* 82 */
  14456. /*!******************************************************************************************************!*\
  14457. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/cancel/isCancel.js ***!
  14458. \******************************************************************************************************/
  14459. /*! no static exports found */
  14460. /***/ (function(module, exports, __webpack_require__) {
  14461. "use strict";
  14462. Object.defineProperty(exports, "__esModule", {
  14463. value: true
  14464. });
  14465. exports.default = isCancel;
  14466. function isCancel(value) {
  14467. return !!(value && value.__CANCEL__);
  14468. }
  14469. /***/ }),
  14470. /* 83 */
  14471. /*!***********************************************************************************************************!*\
  14472. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/cancel/CanceledError.js ***!
  14473. \***********************************************************************************************************/
  14474. /*! no static exports found */
  14475. /***/ (function(module, exports, __webpack_require__) {
  14476. "use strict";
  14477. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14478. Object.defineProperty(exports, "__esModule", {
  14479. value: true
  14480. });
  14481. exports.default = void 0;
  14482. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  14483. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  14484. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 61));
  14485. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 62));
  14486. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 63));
  14487. var _AxiosError2 = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  14488. 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); }; }
  14489. 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; } }
  14490. var CanceledError = /*#__PURE__*/function (_AxiosError) {
  14491. (0, _inherits2.default)(CanceledError, _AxiosError);
  14492. var _super = _createSuper(CanceledError);
  14493. /**
  14494. * A `CanceledError` is an object that is thrown when an operation is canceled.
  14495. *
  14496. * @param {string=} message The message.
  14497. * @param {Object=} config The config.
  14498. * @param {Object=} request The request.
  14499. *
  14500. * @returns {CanceledError} The created error.
  14501. */
  14502. function CanceledError(message, config, request) {
  14503. var _this;
  14504. (0, _classCallCheck2.default)(this, CanceledError);
  14505. _this = _super.call(this, message == null ? 'canceled' : message, _AxiosError2.default.ERR_CANCELED, config, request);
  14506. _this.name = 'CanceledError';
  14507. _this.__CANCEL__ = true;
  14508. return _this;
  14509. }
  14510. return (0, _createClass2.default)(CanceledError);
  14511. }(_AxiosError2.default);
  14512. var _default = CanceledError;
  14513. exports.default = _default;
  14514. /***/ }),
  14515. /* 84 */
  14516. /*!********************************************************************************************************!*\
  14517. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/adapters/adapters.js ***!
  14518. \********************************************************************************************************/
  14519. /*! no static exports found */
  14520. /***/ (function(module, exports, __webpack_require__) {
  14521. "use strict";
  14522. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14523. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  14524. Object.defineProperty(exports, "__esModule", {
  14525. value: true
  14526. });
  14527. exports.default = void 0;
  14528. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  14529. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  14530. var _http = _interopRequireDefault(__webpack_require__(/*! ./http.js */ 66));
  14531. var _xhr = _interopRequireDefault(__webpack_require__(/*! ./xhr.js */ 85));
  14532. var fetchAdapter = _interopRequireWildcard(__webpack_require__(/*! ./fetch.js */ 98));
  14533. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  14534. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  14535. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  14536. /**
  14537. * Known adapters mapping.
  14538. * Provides environment-specific adapters for Axios:
  14539. * - `http` for Node.js
  14540. * - `xhr` for browsers
  14541. * - `fetch` for fetch API-based requests
  14542. *
  14543. * @type {Object<string, Function|Object>}
  14544. */
  14545. var knownAdapters = {
  14546. http: _http.default,
  14547. xhr: _xhr.default,
  14548. fetch: {
  14549. get: fetchAdapter.getFetch
  14550. }
  14551. };
  14552. // Assign adapter names for easier debugging and identification
  14553. _utils.default.forEach(knownAdapters, function (fn, value) {
  14554. if (fn) {
  14555. try {
  14556. Object.defineProperty(fn, 'name', {
  14557. value: value
  14558. });
  14559. } catch (e) {
  14560. // eslint-disable-next-line no-empty
  14561. }
  14562. Object.defineProperty(fn, 'adapterName', {
  14563. value: value
  14564. });
  14565. }
  14566. });
  14567. /**
  14568. * Render a rejection reason string for unknown or unsupported adapters
  14569. *
  14570. * @param {string} reason
  14571. * @returns {string}
  14572. */
  14573. var renderReason = function renderReason(reason) {
  14574. return "- ".concat(reason);
  14575. };
  14576. /**
  14577. * Check if the adapter is resolved (function, null, or false)
  14578. *
  14579. * @param {Function|null|false} adapter
  14580. * @returns {boolean}
  14581. */
  14582. var isResolvedHandle = function isResolvedHandle(adapter) {
  14583. return _utils.default.isFunction(adapter) || adapter === null || adapter === false;
  14584. };
  14585. /**
  14586. * Get the first suitable adapter from the provided list.
  14587. * Tries each adapter in order until a supported one is found.
  14588. * Throws an AxiosError if no adapter is suitable.
  14589. *
  14590. * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
  14591. * @param {Object} config - Axios request configuration
  14592. * @throws {AxiosError} If no suitable adapter is available
  14593. * @returns {Function} The resolved adapter function
  14594. */
  14595. function getAdapter(adapters, config) {
  14596. adapters = _utils.default.isArray(adapters) ? adapters : [adapters];
  14597. var _adapters = adapters,
  14598. length = _adapters.length;
  14599. var nameOrAdapter;
  14600. var adapter;
  14601. var rejectedReasons = {};
  14602. for (var i = 0; i < length; i++) {
  14603. nameOrAdapter = adapters[i];
  14604. var id = void 0;
  14605. adapter = nameOrAdapter;
  14606. if (!isResolvedHandle(nameOrAdapter)) {
  14607. adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
  14608. if (adapter === undefined) {
  14609. throw new _AxiosError.default("Unknown adapter '".concat(id, "'"));
  14610. }
  14611. }
  14612. if (adapter && (_utils.default.isFunction(adapter) || (adapter = adapter.get(config)))) {
  14613. break;
  14614. }
  14615. rejectedReasons[id || '#' + i] = adapter;
  14616. }
  14617. if (!adapter) {
  14618. var reasons = Object.entries(rejectedReasons).map(function (_ref) {
  14619. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  14620. id = _ref2[0],
  14621. state = _ref2[1];
  14622. return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
  14623. });
  14624. var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
  14625. throw new _AxiosError.default("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT');
  14626. }
  14627. return adapter;
  14628. }
  14629. /**
  14630. * Exports Axios adapters and utility to resolve an adapter
  14631. */
  14632. var _default = {
  14633. /**
  14634. * Resolve an adapter from a list of adapter names or functions.
  14635. * @type {Function}
  14636. */
  14637. getAdapter: getAdapter,
  14638. /**
  14639. * Exposes all known adapters
  14640. * @type {Object<string, Function|Object>}
  14641. */
  14642. adapters: knownAdapters
  14643. };
  14644. exports.default = _default;
  14645. /***/ }),
  14646. /* 85 */
  14647. /*!***************************************************************************************************!*\
  14648. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/adapters/xhr.js ***!
  14649. \***************************************************************************************************/
  14650. /*! no static exports found */
  14651. /***/ (function(module, exports, __webpack_require__) {
  14652. "use strict";
  14653. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14654. Object.defineProperty(exports, "__esModule", {
  14655. value: true
  14656. });
  14657. exports.default = void 0;
  14658. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  14659. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  14660. var _settle = _interopRequireDefault(__webpack_require__(/*! ../core/settle.js */ 86));
  14661. var _transitional = _interopRequireDefault(__webpack_require__(/*! ../defaults/transitional.js */ 71));
  14662. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  14663. var _CanceledError = _interopRequireDefault(__webpack_require__(/*! ../cancel/CanceledError.js */ 83));
  14664. var _parseProtocol = _interopRequireDefault(__webpack_require__(/*! ../helpers/parseProtocol.js */ 87));
  14665. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  14666. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosHeaders.js */ 80));
  14667. var _progressEventReducer5 = __webpack_require__(/*! ../helpers/progressEventReducer.js */ 88);
  14668. var _resolveConfig = _interopRequireDefault(__webpack_require__(/*! ../helpers/resolveConfig.js */ 91));
  14669. var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
  14670. var _default = isXHRAdapterSupported && function (config) {
  14671. return new Promise(function dispatchXhrRequest(resolve, reject) {
  14672. var _config = (0, _resolveConfig.default)(config);
  14673. var requestData = _config.data;
  14674. var requestHeaders = _AxiosHeaders.default.from(_config.headers).normalize();
  14675. var responseType = _config.responseType,
  14676. onUploadProgress = _config.onUploadProgress,
  14677. onDownloadProgress = _config.onDownloadProgress;
  14678. var onCanceled;
  14679. var uploadThrottled, downloadThrottled;
  14680. var flushUpload, flushDownload;
  14681. function done() {
  14682. flushUpload && flushUpload(); // flush events
  14683. flushDownload && flushDownload(); // flush events
  14684. _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
  14685. _config.signal && _config.signal.removeEventListener('abort', onCanceled);
  14686. }
  14687. var request = new XMLHttpRequest();
  14688. request.open(_config.method.toUpperCase(), _config.url, true);
  14689. // Set the request timeout in MS
  14690. request.timeout = _config.timeout;
  14691. function onloadend() {
  14692. if (!request) {
  14693. return;
  14694. }
  14695. // Prepare the response
  14696. var responseHeaders = _AxiosHeaders.default.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
  14697. var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
  14698. var response = {
  14699. data: responseData,
  14700. status: request.status,
  14701. statusText: request.statusText,
  14702. headers: responseHeaders,
  14703. config: config,
  14704. request: request
  14705. };
  14706. (0, _settle.default)(function _resolve(value) {
  14707. resolve(value);
  14708. done();
  14709. }, function _reject(err) {
  14710. reject(err);
  14711. done();
  14712. }, response);
  14713. // Clean up request
  14714. request = null;
  14715. }
  14716. if ('onloadend' in request) {
  14717. // Use onloadend if available
  14718. request.onloadend = onloadend;
  14719. } else {
  14720. // Listen for ready state to emulate onloadend
  14721. request.onreadystatechange = function handleLoad() {
  14722. if (!request || request.readyState !== 4) {
  14723. return;
  14724. }
  14725. // The request errored out and we didn't get a response, this will be
  14726. // handled by onerror instead
  14727. // With one exception: request that using file: protocol, most browsers
  14728. // will return status as 0 even though it's a successful request
  14729. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  14730. return;
  14731. }
  14732. // readystate handler is calling before onerror or ontimeout handlers,
  14733. // so we should call onloadend on the next 'tick'
  14734. setTimeout(onloadend);
  14735. };
  14736. }
  14737. // Handle browser request cancellation (as opposed to a manual cancellation)
  14738. request.onabort = function handleAbort() {
  14739. if (!request) {
  14740. return;
  14741. }
  14742. reject(new _AxiosError.default('Request aborted', _AxiosError.default.ECONNABORTED, config, request));
  14743. // Clean up request
  14744. request = null;
  14745. };
  14746. // Handle low level network errors
  14747. request.onerror = function handleError(event) {
  14748. // Browsers deliver a ProgressEvent in XHR onerror
  14749. // (message may be empty; when present, surface it)
  14750. // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
  14751. var msg = event && event.message ? event.message : 'Network Error';
  14752. var err = new _AxiosError.default(msg, _AxiosError.default.ERR_NETWORK, config, request);
  14753. // attach the underlying event for consumers who want details
  14754. err.event = event || null;
  14755. reject(err);
  14756. request = null;
  14757. };
  14758. // Handle timeout
  14759. request.ontimeout = function handleTimeout() {
  14760. var timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
  14761. var transitional = _config.transitional || _transitional.default;
  14762. if (_config.timeoutErrorMessage) {
  14763. timeoutErrorMessage = _config.timeoutErrorMessage;
  14764. }
  14765. reject(new _AxiosError.default(timeoutErrorMessage, transitional.clarifyTimeoutError ? _AxiosError.default.ETIMEDOUT : _AxiosError.default.ECONNABORTED, config, request));
  14766. // Clean up request
  14767. request = null;
  14768. };
  14769. // Remove Content-Type if data is undefined
  14770. requestData === undefined && requestHeaders.setContentType(null);
  14771. // Add headers to the request
  14772. if ('setRequestHeader' in request) {
  14773. _utils.default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
  14774. request.setRequestHeader(key, val);
  14775. });
  14776. }
  14777. // Add withCredentials to request if needed
  14778. if (!_utils.default.isUndefined(_config.withCredentials)) {
  14779. request.withCredentials = !!_config.withCredentials;
  14780. }
  14781. // Add responseType to request if needed
  14782. if (responseType && responseType !== 'json') {
  14783. request.responseType = _config.responseType;
  14784. }
  14785. // Handle progress if needed
  14786. if (onDownloadProgress) {
  14787. var _progressEventReducer = (0, _progressEventReducer5.progressEventReducer)(onDownloadProgress, true);
  14788. var _progressEventReducer2 = (0, _slicedToArray2.default)(_progressEventReducer, 2);
  14789. downloadThrottled = _progressEventReducer2[0];
  14790. flushDownload = _progressEventReducer2[1];
  14791. request.addEventListener('progress', downloadThrottled);
  14792. }
  14793. // Not all browsers support upload events
  14794. if (onUploadProgress && request.upload) {
  14795. var _progressEventReducer3 = (0, _progressEventReducer5.progressEventReducer)(onUploadProgress);
  14796. var _progressEventReducer4 = (0, _slicedToArray2.default)(_progressEventReducer3, 2);
  14797. uploadThrottled = _progressEventReducer4[0];
  14798. flushUpload = _progressEventReducer4[1];
  14799. request.upload.addEventListener('progress', uploadThrottled);
  14800. request.upload.addEventListener('loadend', flushUpload);
  14801. }
  14802. if (_config.cancelToken || _config.signal) {
  14803. // Handle cancellation
  14804. // eslint-disable-next-line func-names
  14805. onCanceled = function onCanceled(cancel) {
  14806. if (!request) {
  14807. return;
  14808. }
  14809. reject(!cancel || cancel.type ? new _CanceledError.default(null, config, request) : cancel);
  14810. request.abort();
  14811. request = null;
  14812. };
  14813. _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
  14814. if (_config.signal) {
  14815. _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
  14816. }
  14817. }
  14818. var protocol = (0, _parseProtocol.default)(_config.url);
  14819. if (protocol && _index.default.protocols.indexOf(protocol) === -1) {
  14820. reject(new _AxiosError.default('Unsupported protocol ' + protocol + ':', _AxiosError.default.ERR_BAD_REQUEST, config));
  14821. return;
  14822. }
  14823. // Send the request
  14824. request.send(requestData || null);
  14825. });
  14826. };
  14827. exports.default = _default;
  14828. /***/ }),
  14829. /* 86 */
  14830. /*!**************************************************************************************************!*\
  14831. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/settle.js ***!
  14832. \**************************************************************************************************/
  14833. /*! no static exports found */
  14834. /***/ (function(module, exports, __webpack_require__) {
  14835. "use strict";
  14836. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14837. Object.defineProperty(exports, "__esModule", {
  14838. value: true
  14839. });
  14840. exports.default = settle;
  14841. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ./AxiosError.js */ 59));
  14842. /**
  14843. * Resolve or reject a Promise based on response status.
  14844. *
  14845. * @param {Function} resolve A function that resolves the promise.
  14846. * @param {Function} reject A function that rejects the promise.
  14847. * @param {object} response The response.
  14848. *
  14849. * @returns {object} The response.
  14850. */
  14851. function settle(resolve, reject, response) {
  14852. var validateStatus = response.config.validateStatus;
  14853. if (!response.status || !validateStatus || validateStatus(response.status)) {
  14854. resolve(response);
  14855. } else {
  14856. reject(new _AxiosError.default('Request failed with status code ' + response.status, [_AxiosError.default.ERR_BAD_REQUEST, _AxiosError.default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
  14857. }
  14858. }
  14859. /***/ }),
  14860. /* 87 */
  14861. /*!************************************************************************************************************!*\
  14862. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/parseProtocol.js ***!
  14863. \************************************************************************************************************/
  14864. /*! no static exports found */
  14865. /***/ (function(module, exports, __webpack_require__) {
  14866. "use strict";
  14867. Object.defineProperty(exports, "__esModule", {
  14868. value: true
  14869. });
  14870. exports.default = parseProtocol;
  14871. function parseProtocol(url) {
  14872. var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
  14873. return match && match[1] || '';
  14874. }
  14875. /***/ }),
  14876. /* 88 */
  14877. /*!*******************************************************************************************************************!*\
  14878. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/progressEventReducer.js ***!
  14879. \*******************************************************************************************************************/
  14880. /*! no static exports found */
  14881. /***/ (function(module, exports, __webpack_require__) {
  14882. "use strict";
  14883. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14884. Object.defineProperty(exports, "__esModule", {
  14885. value: true
  14886. });
  14887. exports.progressEventReducer = exports.progressEventDecorator = exports.asyncDecorator = void 0;
  14888. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  14889. var _speedometer2 = _interopRequireDefault(__webpack_require__(/*! ./speedometer.js */ 89));
  14890. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./throttle.js */ 90));
  14891. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  14892. var progressEventReducer = function progressEventReducer(listener, isDownloadStream) {
  14893. var freq = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
  14894. var bytesNotified = 0;
  14895. var _speedometer = (0, _speedometer2.default)(50, 250);
  14896. return (0, _throttle.default)(function (e) {
  14897. var rawLoaded = e.loaded;
  14898. var total = e.lengthComputable ? e.total : undefined;
  14899. var loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
  14900. var progressBytes = Math.max(0, loaded - bytesNotified);
  14901. var rate = _speedometer(progressBytes);
  14902. bytesNotified = Math.max(bytesNotified, loaded);
  14903. var data = (0, _defineProperty2.default)({
  14904. loaded: loaded,
  14905. total: total,
  14906. progress: total ? loaded / total : undefined,
  14907. bytes: progressBytes,
  14908. rate: rate ? rate : undefined,
  14909. estimated: rate && total ? (total - loaded) / rate : undefined,
  14910. event: e,
  14911. lengthComputable: total != null
  14912. }, isDownloadStream ? 'download' : 'upload', true);
  14913. listener(data);
  14914. }, freq);
  14915. };
  14916. exports.progressEventReducer = progressEventReducer;
  14917. var progressEventDecorator = function progressEventDecorator(total, throttled) {
  14918. var lengthComputable = total != null;
  14919. return [function (loaded) {
  14920. return throttled[0]({
  14921. lengthComputable: lengthComputable,
  14922. total: total,
  14923. loaded: loaded
  14924. });
  14925. }, throttled[1]];
  14926. };
  14927. exports.progressEventDecorator = progressEventDecorator;
  14928. var asyncDecorator = function asyncDecorator(fn) {
  14929. return function () {
  14930. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  14931. args[_key] = arguments[_key];
  14932. }
  14933. return _utils.default.asap(function () {
  14934. return fn.apply(void 0, args);
  14935. });
  14936. };
  14937. };
  14938. exports.asyncDecorator = asyncDecorator;
  14939. /***/ }),
  14940. /* 89 */
  14941. /*!**********************************************************************************************************!*\
  14942. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/speedometer.js ***!
  14943. \**********************************************************************************************************/
  14944. /*! no static exports found */
  14945. /***/ (function(module, exports, __webpack_require__) {
  14946. "use strict";
  14947. /**
  14948. * Calculate data maxRate
  14949. * @param {Number} [samplesCount= 10]
  14950. * @param {Number} [min= 1000]
  14951. * @returns {Function}
  14952. */
  14953. Object.defineProperty(exports, "__esModule", {
  14954. value: true
  14955. });
  14956. exports.default = void 0;
  14957. function speedometer(samplesCount, min) {
  14958. samplesCount = samplesCount || 10;
  14959. var bytes = new Array(samplesCount);
  14960. var timestamps = new Array(samplesCount);
  14961. var head = 0;
  14962. var tail = 0;
  14963. var firstSampleTS;
  14964. min = min !== undefined ? min : 1000;
  14965. return function push(chunkLength) {
  14966. var now = Date.now();
  14967. var startedAt = timestamps[tail];
  14968. if (!firstSampleTS) {
  14969. firstSampleTS = now;
  14970. }
  14971. bytes[head] = chunkLength;
  14972. timestamps[head] = now;
  14973. var i = tail;
  14974. var bytesCount = 0;
  14975. while (i !== head) {
  14976. bytesCount += bytes[i++];
  14977. i = i % samplesCount;
  14978. }
  14979. head = (head + 1) % samplesCount;
  14980. if (head === tail) {
  14981. tail = (tail + 1) % samplesCount;
  14982. }
  14983. if (now - firstSampleTS < min) {
  14984. return;
  14985. }
  14986. var passed = startedAt && now - startedAt;
  14987. return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
  14988. };
  14989. }
  14990. var _default = speedometer;
  14991. exports.default = _default;
  14992. /***/ }),
  14993. /* 90 */
  14994. /*!*******************************************************************************************************!*\
  14995. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/throttle.js ***!
  14996. \*******************************************************************************************************/
  14997. /*! no static exports found */
  14998. /***/ (function(module, exports, __webpack_require__) {
  14999. "use strict";
  15000. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15001. Object.defineProperty(exports, "__esModule", {
  15002. value: true
  15003. });
  15004. exports.default = void 0;
  15005. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  15006. /**
  15007. * Throttle decorator
  15008. * @param {Function} fn
  15009. * @param {Number} freq
  15010. * @return {Function}
  15011. */
  15012. function throttle(fn, freq) {
  15013. var timestamp = 0;
  15014. var threshold = 1000 / freq;
  15015. var lastArgs;
  15016. var timer;
  15017. var invoke = function invoke(args) {
  15018. var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Date.now();
  15019. timestamp = now;
  15020. lastArgs = null;
  15021. if (timer) {
  15022. clearTimeout(timer);
  15023. timer = null;
  15024. }
  15025. fn.apply(void 0, (0, _toConsumableArray2.default)(args));
  15026. };
  15027. var throttled = function throttled() {
  15028. var now = Date.now();
  15029. var passed = now - timestamp;
  15030. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  15031. args[_key] = arguments[_key];
  15032. }
  15033. if (passed >= threshold) {
  15034. invoke(args, now);
  15035. } else {
  15036. lastArgs = args;
  15037. if (!timer) {
  15038. timer = setTimeout(function () {
  15039. timer = null;
  15040. invoke(lastArgs);
  15041. }, threshold - passed);
  15042. }
  15043. }
  15044. };
  15045. var flush = function flush() {
  15046. return lastArgs && invoke(lastArgs);
  15047. };
  15048. return [throttled, flush];
  15049. }
  15050. var _default = throttle;
  15051. exports.default = _default;
  15052. /***/ }),
  15053. /* 91 */
  15054. /*!************************************************************************************************************!*\
  15055. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/resolveConfig.js ***!
  15056. \************************************************************************************************************/
  15057. /*! no static exports found */
  15058. /***/ (function(module, exports, __webpack_require__) {
  15059. "use strict";
  15060. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15061. Object.defineProperty(exports, "__esModule", {
  15062. value: true
  15063. });
  15064. exports.default = void 0;
  15065. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  15066. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  15067. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  15068. var _isURLSameOrigin = _interopRequireDefault(__webpack_require__(/*! ./isURLSameOrigin.js */ 92));
  15069. var _cookies = _interopRequireDefault(__webpack_require__(/*! ./cookies.js */ 93));
  15070. var _buildFullPath = _interopRequireDefault(__webpack_require__(/*! ../core/buildFullPath.js */ 94));
  15071. var _mergeConfig = _interopRequireDefault(__webpack_require__(/*! ../core/mergeConfig.js */ 97));
  15072. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosHeaders.js */ 80));
  15073. var _buildURL = _interopRequireDefault(__webpack_require__(/*! ./buildURL.js */ 52));
  15074. var _default = function _default(config) {
  15075. var newConfig = (0, _mergeConfig.default)({}, config);
  15076. // Read only own properties to prevent prototype pollution gadgets
  15077. // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
  15078. var own = function own(key) {
  15079. return _utils.default.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
  15080. };
  15081. var data = own('data');
  15082. var withXSRFToken = own('withXSRFToken');
  15083. var xsrfHeaderName = own('xsrfHeaderName');
  15084. var xsrfCookieName = own('xsrfCookieName');
  15085. var headers = own('headers');
  15086. var auth = own('auth');
  15087. var baseURL = own('baseURL');
  15088. var allowAbsoluteUrls = own('allowAbsoluteUrls');
  15089. var url = own('url');
  15090. newConfig.headers = headers = _AxiosHeaders.default.from(headers);
  15091. newConfig.url = (0, _buildURL.default)((0, _buildFullPath.default)(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer);
  15092. // HTTP basic authentication
  15093. if (auth) {
  15094. headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')));
  15095. }
  15096. if (_utils.default.isFormData(data)) {
  15097. if (_index.default.hasStandardBrowserEnv || _index.default.hasStandardBrowserWebWorkerEnv) {
  15098. headers.setContentType(undefined); // browser handles it
  15099. } else if (_utils.default.isFunction(data.getHeaders)) {
  15100. // Node.js FormData (like form-data package)
  15101. var formHeaders = data.getHeaders();
  15102. // Only set safe headers to avoid overwriting security headers
  15103. var allowedHeaders = ['content-type', 'content-length'];
  15104. Object.entries(formHeaders).forEach(function (_ref) {
  15105. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  15106. key = _ref2[0],
  15107. val = _ref2[1];
  15108. if (allowedHeaders.includes(key.toLowerCase())) {
  15109. headers.set(key, val);
  15110. }
  15111. });
  15112. }
  15113. }
  15114. // Add xsrf header
  15115. // This is only done if running in a standard browser environment.
  15116. // Specifically not if we're in a web worker, or react-native.
  15117. if (_index.default.hasStandardBrowserEnv) {
  15118. if (_utils.default.isFunction(withXSRFToken)) {
  15119. withXSRFToken = withXSRFToken(newConfig);
  15120. }
  15121. // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
  15122. // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
  15123. // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
  15124. var shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && (0, _isURLSameOrigin.default)(newConfig.url);
  15125. if (shouldSendXSRF) {
  15126. var xsrfValue = xsrfHeaderName && xsrfCookieName && _cookies.default.read(xsrfCookieName);
  15127. if (xsrfValue) {
  15128. headers.set(xsrfHeaderName, xsrfValue);
  15129. }
  15130. }
  15131. }
  15132. return newConfig;
  15133. };
  15134. exports.default = _default;
  15135. /***/ }),
  15136. /* 92 */
  15137. /*!**************************************************************************************************************!*\
  15138. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  15139. \**************************************************************************************************************/
  15140. /*! no static exports found */
  15141. /***/ (function(module, exports, __webpack_require__) {
  15142. "use strict";
  15143. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15144. Object.defineProperty(exports, "__esModule", {
  15145. value: true
  15146. });
  15147. exports.default = void 0;
  15148. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  15149. var _default = _index.default.hasStandardBrowserEnv ? function (origin, isMSIE) {
  15150. return function (url) {
  15151. url = new URL(url, _index.default.origin);
  15152. return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
  15153. };
  15154. }(new URL(_index.default.origin), _index.default.navigator && /(msie|trident)/i.test(_index.default.navigator.userAgent)) : function () {
  15155. return true;
  15156. };
  15157. exports.default = _default;
  15158. /***/ }),
  15159. /* 93 */
  15160. /*!******************************************************************************************************!*\
  15161. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/cookies.js ***!
  15162. \******************************************************************************************************/
  15163. /*! no static exports found */
  15164. /***/ (function(module, exports, __webpack_require__) {
  15165. "use strict";
  15166. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15167. Object.defineProperty(exports, "__esModule", {
  15168. value: true
  15169. });
  15170. exports.default = void 0;
  15171. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  15172. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  15173. var _default = _index.default.hasStandardBrowserEnv ?
  15174. // Standard browser envs support document.cookie
  15175. {
  15176. write: function write(name, value, expires, path, domain, secure, sameSite) {
  15177. if (typeof document === 'undefined') return;
  15178. var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))];
  15179. if (_utils.default.isNumber(expires)) {
  15180. cookie.push("expires=".concat(new Date(expires).toUTCString()));
  15181. }
  15182. if (_utils.default.isString(path)) {
  15183. cookie.push("path=".concat(path));
  15184. }
  15185. if (_utils.default.isString(domain)) {
  15186. cookie.push("domain=".concat(domain));
  15187. }
  15188. if (secure === true) {
  15189. cookie.push('secure');
  15190. }
  15191. if (_utils.default.isString(sameSite)) {
  15192. cookie.push("SameSite=".concat(sameSite));
  15193. }
  15194. document.cookie = cookie.join('; ');
  15195. },
  15196. read: function read(name) {
  15197. if (typeof document === 'undefined') return null;
  15198. var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
  15199. return match ? decodeURIComponent(match[1]) : null;
  15200. },
  15201. remove: function remove(name) {
  15202. this.write(name, '', Date.now() - 86400000, '/');
  15203. }
  15204. } :
  15205. // Non-standard browser env (web workers, react-native) lack needed support.
  15206. {
  15207. write: function write() {},
  15208. read: function read() {
  15209. return null;
  15210. },
  15211. remove: function remove() {}
  15212. };
  15213. exports.default = _default;
  15214. /***/ }),
  15215. /* 94 */
  15216. /*!*********************************************************************************************************!*\
  15217. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/buildFullPath.js ***!
  15218. \*********************************************************************************************************/
  15219. /*! no static exports found */
  15220. /***/ (function(module, exports, __webpack_require__) {
  15221. "use strict";
  15222. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15223. Object.defineProperty(exports, "__esModule", {
  15224. value: true
  15225. });
  15226. exports.default = buildFullPath;
  15227. var _isAbsoluteURL = _interopRequireDefault(__webpack_require__(/*! ../helpers/isAbsoluteURL.js */ 95));
  15228. var _combineURLs = _interopRequireDefault(__webpack_require__(/*! ../helpers/combineURLs.js */ 96));
  15229. /**
  15230. * Creates a new URL by combining the baseURL with the requestedURL,
  15231. * only when the requestedURL is not already an absolute URL.
  15232. * If the requestURL is absolute, this function returns the requestedURL untouched.
  15233. *
  15234. * @param {string} baseURL The base URL
  15235. * @param {string} requestedURL Absolute or relative URL to combine
  15236. *
  15237. * @returns {string} The combined full path
  15238. */
  15239. function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
  15240. var isRelativeUrl = !(0, _isAbsoluteURL.default)(requestedURL);
  15241. if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
  15242. return (0, _combineURLs.default)(baseURL, requestedURL);
  15243. }
  15244. return requestedURL;
  15245. }
  15246. /***/ }),
  15247. /* 95 */
  15248. /*!************************************************************************************************************!*\
  15249. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  15250. \************************************************************************************************************/
  15251. /*! no static exports found */
  15252. /***/ (function(module, exports, __webpack_require__) {
  15253. "use strict";
  15254. /**
  15255. * Determines whether the specified URL is absolute
  15256. *
  15257. * @param {string} url The URL to test
  15258. *
  15259. * @returns {boolean} True if the specified URL is absolute, otherwise false
  15260. */
  15261. Object.defineProperty(exports, "__esModule", {
  15262. value: true
  15263. });
  15264. exports.default = isAbsoluteURL;
  15265. function isAbsoluteURL(url) {
  15266. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  15267. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  15268. // by any combination of letters, digits, plus, period, or hyphen.
  15269. if (typeof url !== 'string') {
  15270. return false;
  15271. }
  15272. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  15273. }
  15274. /***/ }),
  15275. /* 96 */
  15276. /*!**********************************************************************************************************!*\
  15277. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/combineURLs.js ***!
  15278. \**********************************************************************************************************/
  15279. /*! no static exports found */
  15280. /***/ (function(module, exports, __webpack_require__) {
  15281. "use strict";
  15282. /**
  15283. * Creates a new URL by combining the specified URLs
  15284. *
  15285. * @param {string} baseURL The base URL
  15286. * @param {string} relativeURL The relative URL
  15287. *
  15288. * @returns {string} The combined URL
  15289. */
  15290. Object.defineProperty(exports, "__esModule", {
  15291. value: true
  15292. });
  15293. exports.default = combineURLs;
  15294. function combineURLs(baseURL, relativeURL) {
  15295. return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
  15296. }
  15297. /***/ }),
  15298. /* 97 */
  15299. /*!*******************************************************************************************************!*\
  15300. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/core/mergeConfig.js ***!
  15301. \*******************************************************************************************************/
  15302. /*! no static exports found */
  15303. /***/ (function(module, exports, __webpack_require__) {
  15304. "use strict";
  15305. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15306. Object.defineProperty(exports, "__esModule", {
  15307. value: true
  15308. });
  15309. exports.default = mergeConfig;
  15310. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  15311. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  15312. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ./AxiosHeaders.js */ 80));
  15313. 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; }
  15314. 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; }
  15315. var headersToObject = function headersToObject(thing) {
  15316. return thing instanceof _AxiosHeaders.default ? _objectSpread({}, thing) : thing;
  15317. };
  15318. /**
  15319. * Config-specific merge-function which creates a new config-object
  15320. * by merging two configuration objects together.
  15321. *
  15322. * @param {Object} config1
  15323. * @param {Object} config2
  15324. *
  15325. * @returns {Object} New object resulting from merging config2 to config1
  15326. */
  15327. function mergeConfig(config1, config2) {
  15328. // eslint-disable-next-line no-param-reassign
  15329. config2 = config2 || {};
  15330. // Use a null-prototype object so that downstream reads such as `config.auth`
  15331. // or `config.baseURL` cannot inherit polluted values from Object.prototype
  15332. // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
  15333. // own slot to preserve ergonomics for user code that relies on it.
  15334. var config = Object.create(null);
  15335. Object.defineProperty(config, 'hasOwnProperty', {
  15336. value: Object.prototype.hasOwnProperty,
  15337. enumerable: false,
  15338. writable: true,
  15339. configurable: true
  15340. });
  15341. function getMergedValue(target, source, prop, caseless) {
  15342. if (_utils.default.isPlainObject(target) && _utils.default.isPlainObject(source)) {
  15343. return _utils.default.merge.call({
  15344. caseless: caseless
  15345. }, target, source);
  15346. } else if (_utils.default.isPlainObject(source)) {
  15347. return _utils.default.merge({}, source);
  15348. } else if (_utils.default.isArray(source)) {
  15349. return source.slice();
  15350. }
  15351. return source;
  15352. }
  15353. function mergeDeepProperties(a, b, prop, caseless) {
  15354. if (!_utils.default.isUndefined(b)) {
  15355. return getMergedValue(a, b, prop, caseless);
  15356. } else if (!_utils.default.isUndefined(a)) {
  15357. return getMergedValue(undefined, a, prop, caseless);
  15358. }
  15359. }
  15360. // eslint-disable-next-line consistent-return
  15361. function valueFromConfig2(a, b) {
  15362. if (!_utils.default.isUndefined(b)) {
  15363. return getMergedValue(undefined, b);
  15364. }
  15365. }
  15366. // eslint-disable-next-line consistent-return
  15367. function defaultToConfig2(a, b) {
  15368. if (!_utils.default.isUndefined(b)) {
  15369. return getMergedValue(undefined, b);
  15370. } else if (!_utils.default.isUndefined(a)) {
  15371. return getMergedValue(undefined, a);
  15372. }
  15373. }
  15374. // eslint-disable-next-line consistent-return
  15375. function mergeDirectKeys(a, b, prop) {
  15376. if (_utils.default.hasOwnProp(config2, prop)) {
  15377. return getMergedValue(a, b);
  15378. } else if (_utils.default.hasOwnProp(config1, prop)) {
  15379. return getMergedValue(undefined, a);
  15380. }
  15381. }
  15382. var mergeMap = {
  15383. url: valueFromConfig2,
  15384. method: valueFromConfig2,
  15385. data: valueFromConfig2,
  15386. baseURL: defaultToConfig2,
  15387. transformRequest: defaultToConfig2,
  15388. transformResponse: defaultToConfig2,
  15389. paramsSerializer: defaultToConfig2,
  15390. timeout: defaultToConfig2,
  15391. timeoutMessage: defaultToConfig2,
  15392. withCredentials: defaultToConfig2,
  15393. withXSRFToken: defaultToConfig2,
  15394. adapter: defaultToConfig2,
  15395. responseType: defaultToConfig2,
  15396. xsrfCookieName: defaultToConfig2,
  15397. xsrfHeaderName: defaultToConfig2,
  15398. onUploadProgress: defaultToConfig2,
  15399. onDownloadProgress: defaultToConfig2,
  15400. decompress: defaultToConfig2,
  15401. maxContentLength: defaultToConfig2,
  15402. maxBodyLength: defaultToConfig2,
  15403. beforeRedirect: defaultToConfig2,
  15404. transport: defaultToConfig2,
  15405. httpAgent: defaultToConfig2,
  15406. httpsAgent: defaultToConfig2,
  15407. cancelToken: defaultToConfig2,
  15408. socketPath: defaultToConfig2,
  15409. allowedSocketPaths: defaultToConfig2,
  15410. responseEncoding: defaultToConfig2,
  15411. validateStatus: mergeDirectKeys,
  15412. headers: function headers(a, b, prop) {
  15413. return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
  15414. }
  15415. };
  15416. _utils.default.forEach(Object.keys(_objectSpread(_objectSpread({}, config1), config2)), function computeConfigValue(prop) {
  15417. if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
  15418. var merge = _utils.default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
  15419. var a = _utils.default.hasOwnProp(config1, prop) ? config1[prop] : undefined;
  15420. var b = _utils.default.hasOwnProp(config2, prop) ? config2[prop] : undefined;
  15421. var configValue = merge(a, b, prop);
  15422. _utils.default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
  15423. });
  15424. return config;
  15425. }
  15426. /***/ }),
  15427. /* 98 */
  15428. /*!*****************************************************************************************************!*\
  15429. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/adapters/fetch.js ***!
  15430. \*****************************************************************************************************/
  15431. /*! no static exports found */
  15432. /***/ (function(module, exports, __webpack_require__) {
  15433. "use strict";
  15434. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15435. Object.defineProperty(exports, "__esModule", {
  15436. value: true
  15437. });
  15438. exports.getFetch = exports.default = void 0;
  15439. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  15440. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  15441. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  15442. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  15443. var _index = _interopRequireDefault(__webpack_require__(/*! ../platform/index.js */ 73));
  15444. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  15445. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  15446. var _composeSignals = _interopRequireDefault(__webpack_require__(/*! ../helpers/composeSignals.js */ 99));
  15447. var _trackStream = __webpack_require__(/*! ../helpers/trackStream.js */ 100);
  15448. var _AxiosHeaders = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosHeaders.js */ 80));
  15449. var _progressEventReducer = __webpack_require__(/*! ../helpers/progressEventReducer.js */ 88);
  15450. var _resolveConfig2 = _interopRequireDefault(__webpack_require__(/*! ../helpers/resolveConfig.js */ 91));
  15451. var _settle = _interopRequireDefault(__webpack_require__(/*! ../core/settle.js */ 86));
  15452. 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; }
  15453. 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; }
  15454. var DEFAULT_CHUNK_SIZE = 64 * 1024;
  15455. var isFunction = _utils.default.isFunction;
  15456. var globalFetchAPI = function (_ref) {
  15457. var Request = _ref.Request,
  15458. Response = _ref.Response;
  15459. return {
  15460. Request: Request,
  15461. Response: Response
  15462. };
  15463. }(_utils.default.global);
  15464. var _utils$global = _utils.default.global,
  15465. ReadableStream = _utils$global.ReadableStream,
  15466. TextEncoder = _utils$global.TextEncoder;
  15467. var test = function test(fn) {
  15468. try {
  15469. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  15470. args[_key - 1] = arguments[_key];
  15471. }
  15472. return !!fn.apply(void 0, args);
  15473. } catch (e) {
  15474. return false;
  15475. }
  15476. };
  15477. var factory = function factory(env) {
  15478. env = _utils.default.merge.call({
  15479. skipUndefined: true
  15480. }, globalFetchAPI, env);
  15481. var _env = env,
  15482. envFetch = _env.fetch,
  15483. Request = _env.Request,
  15484. Response = _env.Response;
  15485. var isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
  15486. var isRequestSupported = isFunction(Request);
  15487. var isResponseSupported = isFunction(Response);
  15488. if (!isFetchSupported) {
  15489. return false;
  15490. }
  15491. var isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
  15492. var encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? function (encoder) {
  15493. return function (str) {
  15494. return encoder.encode(str);
  15495. };
  15496. }(new TextEncoder()) : /*#__PURE__*/function () {
  15497. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(str) {
  15498. return _regenerator.default.wrap(function _callee$(_context) {
  15499. while (1) {
  15500. switch (_context.prev = _context.next) {
  15501. case 0:
  15502. _context.t0 = Uint8Array;
  15503. _context.next = 3;
  15504. return new Request(str).arrayBuffer();
  15505. case 3:
  15506. _context.t1 = _context.sent;
  15507. return _context.abrupt("return", new _context.t0(_context.t1));
  15508. case 5:
  15509. case "end":
  15510. return _context.stop();
  15511. }
  15512. }
  15513. }, _callee);
  15514. }));
  15515. return function (_x) {
  15516. return _ref2.apply(this, arguments);
  15517. };
  15518. }());
  15519. var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function () {
  15520. var duplexAccessed = false;
  15521. var request = new Request(_index.default.origin, {
  15522. body: new ReadableStream(),
  15523. method: 'POST',
  15524. get duplex() {
  15525. duplexAccessed = true;
  15526. return 'half';
  15527. }
  15528. });
  15529. var hasContentType = request.headers.has('Content-Type');
  15530. if (request.body != null) {
  15531. request.body.cancel();
  15532. }
  15533. return duplexAccessed && !hasContentType;
  15534. });
  15535. var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function () {
  15536. return _utils.default.isReadableStream(new Response('').body);
  15537. });
  15538. var resolvers = {
  15539. stream: supportsResponseStream && function (res) {
  15540. return res.body;
  15541. }
  15542. };
  15543. isFetchSupported && function () {
  15544. ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(function (type) {
  15545. !resolvers[type] && (resolvers[type] = function (res, config) {
  15546. var method = res && res[type];
  15547. if (method) {
  15548. return method.call(res);
  15549. }
  15550. throw new _AxiosError.default("Response type '".concat(type, "' is not supported"), _AxiosError.default.ERR_NOT_SUPPORT, config);
  15551. });
  15552. });
  15553. }();
  15554. var getBodyLength = /*#__PURE__*/function () {
  15555. var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(body) {
  15556. var _request;
  15557. return _regenerator.default.wrap(function _callee2$(_context2) {
  15558. while (1) {
  15559. switch (_context2.prev = _context2.next) {
  15560. case 0:
  15561. if (!(body == null)) {
  15562. _context2.next = 2;
  15563. break;
  15564. }
  15565. return _context2.abrupt("return", 0);
  15566. case 2:
  15567. if (!_utils.default.isBlob(body)) {
  15568. _context2.next = 4;
  15569. break;
  15570. }
  15571. return _context2.abrupt("return", body.size);
  15572. case 4:
  15573. if (!_utils.default.isSpecCompliantForm(body)) {
  15574. _context2.next = 9;
  15575. break;
  15576. }
  15577. _request = new Request(_index.default.origin, {
  15578. method: 'POST',
  15579. body: body
  15580. });
  15581. _context2.next = 8;
  15582. return _request.arrayBuffer();
  15583. case 8:
  15584. return _context2.abrupt("return", _context2.sent.byteLength);
  15585. case 9:
  15586. if (!(_utils.default.isArrayBufferView(body) || _utils.default.isArrayBuffer(body))) {
  15587. _context2.next = 11;
  15588. break;
  15589. }
  15590. return _context2.abrupt("return", body.byteLength);
  15591. case 11:
  15592. if (_utils.default.isURLSearchParams(body)) {
  15593. body = body + '';
  15594. }
  15595. if (!_utils.default.isString(body)) {
  15596. _context2.next = 16;
  15597. break;
  15598. }
  15599. _context2.next = 15;
  15600. return encodeText(body);
  15601. case 15:
  15602. return _context2.abrupt("return", _context2.sent.byteLength);
  15603. case 16:
  15604. case "end":
  15605. return _context2.stop();
  15606. }
  15607. }
  15608. }, _callee2);
  15609. }));
  15610. return function getBodyLength(_x2) {
  15611. return _ref3.apply(this, arguments);
  15612. };
  15613. }();
  15614. var resolveBodyLength = /*#__PURE__*/function () {
  15615. var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(headers, body) {
  15616. var length;
  15617. return _regenerator.default.wrap(function _callee3$(_context3) {
  15618. while (1) {
  15619. switch (_context3.prev = _context3.next) {
  15620. case 0:
  15621. length = _utils.default.toFiniteNumber(headers.getContentLength());
  15622. return _context3.abrupt("return", length == null ? getBodyLength(body) : length);
  15623. case 2:
  15624. case "end":
  15625. return _context3.stop();
  15626. }
  15627. }
  15628. }, _callee3);
  15629. }));
  15630. return function resolveBodyLength(_x3, _x4) {
  15631. return _ref4.apply(this, arguments);
  15632. };
  15633. }();
  15634. return /*#__PURE__*/function () {
  15635. var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(config) {
  15636. var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, _fetch, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref6, _ref7, _onProgress, _flush, responseData;
  15637. return _regenerator.default.wrap(function _callee4$(_context4) {
  15638. while (1) {
  15639. switch (_context4.prev = _context4.next) {
  15640. case 0:
  15641. _resolveConfig = (0, _resolveConfig2.default)(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
  15642. _fetch = envFetch || fetch;
  15643. responseType = responseType ? (responseType + '').toLowerCase() : 'text';
  15644. composedSignal = (0, _composeSignals.default)([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
  15645. request = null;
  15646. unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
  15647. composedSignal.unsubscribe();
  15648. };
  15649. _context4.prev = 6;
  15650. _context4.t0 = onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head';
  15651. if (!_context4.t0) {
  15652. _context4.next = 13;
  15653. break;
  15654. }
  15655. _context4.next = 11;
  15656. return resolveBodyLength(headers, data);
  15657. case 11:
  15658. _context4.t1 = requestContentLength = _context4.sent;
  15659. _context4.t0 = _context4.t1 !== 0;
  15660. case 13:
  15661. if (!_context4.t0) {
  15662. _context4.next = 17;
  15663. break;
  15664. }
  15665. _request = new Request(url, {
  15666. method: 'POST',
  15667. body: data,
  15668. duplex: 'half'
  15669. });
  15670. if (_utils.default.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
  15671. headers.setContentType(contentTypeHeader);
  15672. }
  15673. if (_request.body) {
  15674. _progressEventDecorat = (0, _progressEventReducer.progressEventDecorator)(requestContentLength, (0, _progressEventReducer.progressEventReducer)((0, _progressEventReducer.asyncDecorator)(onUploadProgress))), _progressEventDecorat2 = (0, _slicedToArray2.default)(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
  15675. data = (0, _trackStream.trackStream)(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
  15676. }
  15677. case 17:
  15678. if (!_utils.default.isString(withCredentials)) {
  15679. withCredentials = withCredentials ? 'include' : 'omit';
  15680. }
  15681. // Cloudflare Workers throws when credentials are defined
  15682. // see https://github.com/cloudflare/workerd/issues/902
  15683. isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype; // If data is FormData and Content-Type is multipart/form-data without boundary,
  15684. // delete it so fetch can set it correctly with the boundary
  15685. if (_utils.default.isFormData(data)) {
  15686. contentType = headers.getContentType();
  15687. if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
  15688. headers.delete('content-type');
  15689. }
  15690. }
  15691. resolvedOptions = _objectSpread(_objectSpread({}, fetchOptions), {}, {
  15692. signal: composedSignal,
  15693. method: method.toUpperCase(),
  15694. headers: headers.normalize().toJSON(),
  15695. body: data,
  15696. duplex: 'half',
  15697. credentials: isCredentialsSupported ? withCredentials : undefined
  15698. });
  15699. request = isRequestSupported && new Request(url, resolvedOptions);
  15700. _context4.next = 24;
  15701. return isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions);
  15702. case 24:
  15703. response = _context4.sent;
  15704. isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
  15705. if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
  15706. options = {};
  15707. ['status', 'statusText', 'headers'].forEach(function (prop) {
  15708. options[prop] = response[prop];
  15709. });
  15710. responseContentLength = _utils.default.toFiniteNumber(response.headers.get('content-length'));
  15711. _ref6 = onDownloadProgress && (0, _progressEventReducer.progressEventDecorator)(responseContentLength, (0, _progressEventReducer.progressEventReducer)((0, _progressEventReducer.asyncDecorator)(onDownloadProgress), true)) || [], _ref7 = (0, _slicedToArray2.default)(_ref6, 2), _onProgress = _ref7[0], _flush = _ref7[1];
  15712. response = new Response((0, _trackStream.trackStream)(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
  15713. _flush && _flush();
  15714. unsubscribe && unsubscribe();
  15715. }), options);
  15716. }
  15717. responseType = responseType || 'text';
  15718. _context4.next = 30;
  15719. return resolvers[_utils.default.findKey(resolvers, responseType) || 'text'](response, config);
  15720. case 30:
  15721. responseData = _context4.sent;
  15722. !isStreamResponse && unsubscribe && unsubscribe();
  15723. _context4.next = 34;
  15724. return new Promise(function (resolve, reject) {
  15725. (0, _settle.default)(resolve, reject, {
  15726. data: responseData,
  15727. headers: _AxiosHeaders.default.from(response.headers),
  15728. status: response.status,
  15729. statusText: response.statusText,
  15730. config: config,
  15731. request: request
  15732. });
  15733. });
  15734. case 34:
  15735. return _context4.abrupt("return", _context4.sent);
  15736. case 37:
  15737. _context4.prev = 37;
  15738. _context4.t2 = _context4["catch"](6);
  15739. unsubscribe && unsubscribe();
  15740. if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context4.t2.message))) {
  15741. _context4.next = 42;
  15742. break;
  15743. }
  15744. throw Object.assign(new _AxiosError.default('Network Error', _AxiosError.default.ERR_NETWORK, config, request, _context4.t2 && _context4.t2.response), {
  15745. cause: _context4.t2.cause || _context4.t2
  15746. });
  15747. case 42:
  15748. throw _AxiosError.default.from(_context4.t2, _context4.t2 && _context4.t2.code, config, request, _context4.t2 && _context4.t2.response);
  15749. case 43:
  15750. case "end":
  15751. return _context4.stop();
  15752. }
  15753. }
  15754. }, _callee4, null, [[6, 37]]);
  15755. }));
  15756. return function (_x5) {
  15757. return _ref5.apply(this, arguments);
  15758. };
  15759. }();
  15760. };
  15761. var seedCache = new Map();
  15762. var getFetch = function getFetch(config) {
  15763. var env = config && config.env || {};
  15764. var fetch = env.fetch,
  15765. Request = env.Request,
  15766. Response = env.Response;
  15767. var seeds = [Request, Response, fetch];
  15768. var len = seeds.length,
  15769. i = len,
  15770. seed,
  15771. target,
  15772. map = seedCache;
  15773. while (i--) {
  15774. seed = seeds[i];
  15775. target = map.get(seed);
  15776. target === undefined && map.set(seed, target = i ? new Map() : factory(env));
  15777. map = target;
  15778. }
  15779. return target;
  15780. };
  15781. exports.getFetch = getFetch;
  15782. var adapter = getFetch();
  15783. var _default = adapter;
  15784. exports.default = _default;
  15785. /***/ }),
  15786. /* 99 */
  15787. /*!*************************************************************************************************************!*\
  15788. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/composeSignals.js ***!
  15789. \*************************************************************************************************************/
  15790. /*! no static exports found */
  15791. /***/ (function(module, exports, __webpack_require__) {
  15792. "use strict";
  15793. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15794. Object.defineProperty(exports, "__esModule", {
  15795. value: true
  15796. });
  15797. exports.default = void 0;
  15798. var _CanceledError = _interopRequireDefault(__webpack_require__(/*! ../cancel/CanceledError.js */ 83));
  15799. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  15800. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  15801. var composeSignals = function composeSignals(signals, timeout) {
  15802. var _signals = signals = signals ? signals.filter(Boolean) : [],
  15803. length = _signals.length;
  15804. if (timeout || length) {
  15805. var controller = new AbortController();
  15806. var aborted;
  15807. var onabort = function onabort(reason) {
  15808. if (!aborted) {
  15809. aborted = true;
  15810. unsubscribe();
  15811. var err = reason instanceof Error ? reason : this.reason;
  15812. controller.abort(err instanceof _AxiosError.default ? err : new _CanceledError.default(err instanceof Error ? err.message : err));
  15813. }
  15814. };
  15815. var timer = timeout && setTimeout(function () {
  15816. timer = null;
  15817. onabort(new _AxiosError.default("timeout of ".concat(timeout, "ms exceeded"), _AxiosError.default.ETIMEDOUT));
  15818. }, timeout);
  15819. var unsubscribe = function unsubscribe() {
  15820. if (signals) {
  15821. timer && clearTimeout(timer);
  15822. timer = null;
  15823. signals.forEach(function (signal) {
  15824. signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
  15825. });
  15826. signals = null;
  15827. }
  15828. };
  15829. signals.forEach(function (signal) {
  15830. return signal.addEventListener('abort', onabort);
  15831. });
  15832. var signal = controller.signal;
  15833. signal.unsubscribe = function () {
  15834. return _utils.default.asap(unsubscribe);
  15835. };
  15836. return signal;
  15837. }
  15838. };
  15839. var _default = composeSignals;
  15840. exports.default = _default;
  15841. /***/ }),
  15842. /* 100 */
  15843. /*!**********************************************************************************************************!*\
  15844. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/trackStream.js ***!
  15845. \**********************************************************************************************************/
  15846. /*! no static exports found */
  15847. /***/ (function(module, exports, __webpack_require__) {
  15848. "use strict";
  15849. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15850. Object.defineProperty(exports, "__esModule", {
  15851. value: true
  15852. });
  15853. exports.trackStream = exports.streamChunk = exports.readBytes = void 0;
  15854. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 40));
  15855. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 42));
  15856. var _wrapAsyncGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapAsyncGenerator */ 101));
  15857. var _awaitAsyncGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/awaitAsyncGenerator */ 104));
  15858. var _asyncGeneratorDelegate2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncGeneratorDelegate */ 105));
  15859. function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  15860. function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(value) { var ret = this.s.return; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, throw: function _throw(value) { var thr = this.s.return; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
  15861. var streamChunk = /*#__PURE__*/_regenerator.default.mark(function streamChunk(chunk, chunkSize) {
  15862. var len, pos, end;
  15863. return _regenerator.default.wrap(function streamChunk$(_context) {
  15864. while (1) {
  15865. switch (_context.prev = _context.next) {
  15866. case 0:
  15867. len = chunk.byteLength;
  15868. if (!(!chunkSize || len < chunkSize)) {
  15869. _context.next = 5;
  15870. break;
  15871. }
  15872. _context.next = 4;
  15873. return chunk;
  15874. case 4:
  15875. return _context.abrupt("return");
  15876. case 5:
  15877. pos = 0;
  15878. case 6:
  15879. if (!(pos < len)) {
  15880. _context.next = 13;
  15881. break;
  15882. }
  15883. end = pos + chunkSize;
  15884. _context.next = 10;
  15885. return chunk.slice(pos, end);
  15886. case 10:
  15887. pos = end;
  15888. _context.next = 6;
  15889. break;
  15890. case 13:
  15891. case "end":
  15892. return _context.stop();
  15893. }
  15894. }
  15895. }, streamChunk);
  15896. });
  15897. exports.streamChunk = streamChunk;
  15898. var readBytes = /*#__PURE__*/function () {
  15899. var _ref = (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(iterable, chunkSize) {
  15900. var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk;
  15901. return _regenerator.default.wrap(function _callee$(_context2) {
  15902. while (1) {
  15903. switch (_context2.prev = _context2.next) {
  15904. case 0:
  15905. _iteratorAbruptCompletion = false;
  15906. _didIteratorError = false;
  15907. _context2.prev = 2;
  15908. _iterator = _asyncIterator(readStream(iterable));
  15909. case 4:
  15910. _context2.next = 6;
  15911. return (0, _awaitAsyncGenerator2.default)(_iterator.next());
  15912. case 6:
  15913. if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
  15914. _context2.next = 12;
  15915. break;
  15916. }
  15917. chunk = _step.value;
  15918. return _context2.delegateYield((0, _asyncGeneratorDelegate2.default)(_asyncIterator(streamChunk(chunk, chunkSize)), _awaitAsyncGenerator2.default), "t0", 9);
  15919. case 9:
  15920. _iteratorAbruptCompletion = false;
  15921. _context2.next = 4;
  15922. break;
  15923. case 12:
  15924. _context2.next = 18;
  15925. break;
  15926. case 14:
  15927. _context2.prev = 14;
  15928. _context2.t1 = _context2["catch"](2);
  15929. _didIteratorError = true;
  15930. _iteratorError = _context2.t1;
  15931. case 18:
  15932. _context2.prev = 18;
  15933. _context2.prev = 19;
  15934. if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
  15935. _context2.next = 23;
  15936. break;
  15937. }
  15938. _context2.next = 23;
  15939. return (0, _awaitAsyncGenerator2.default)(_iterator.return());
  15940. case 23:
  15941. _context2.prev = 23;
  15942. if (!_didIteratorError) {
  15943. _context2.next = 26;
  15944. break;
  15945. }
  15946. throw _iteratorError;
  15947. case 26:
  15948. return _context2.finish(23);
  15949. case 27:
  15950. return _context2.finish(18);
  15951. case 28:
  15952. case "end":
  15953. return _context2.stop();
  15954. }
  15955. }
  15956. }, _callee, null, [[2, 14, 18, 28], [19,, 23, 27]]);
  15957. }));
  15958. return function readBytes(_x, _x2) {
  15959. return _ref.apply(this, arguments);
  15960. };
  15961. }();
  15962. exports.readBytes = readBytes;
  15963. var readStream = /*#__PURE__*/function () {
  15964. var _ref2 = (0, _wrapAsyncGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(stream) {
  15965. var reader, _yield$_awaitAsyncGen, done, value;
  15966. return _regenerator.default.wrap(function _callee2$(_context3) {
  15967. while (1) {
  15968. switch (_context3.prev = _context3.next) {
  15969. case 0:
  15970. if (!stream[Symbol.asyncIterator]) {
  15971. _context3.next = 3;
  15972. break;
  15973. }
  15974. return _context3.delegateYield((0, _asyncGeneratorDelegate2.default)(_asyncIterator(stream), _awaitAsyncGenerator2.default), "t0", 2);
  15975. case 2:
  15976. return _context3.abrupt("return");
  15977. case 3:
  15978. reader = stream.getReader();
  15979. _context3.prev = 4;
  15980. case 5:
  15981. _context3.next = 7;
  15982. return (0, _awaitAsyncGenerator2.default)(reader.read());
  15983. case 7:
  15984. _yield$_awaitAsyncGen = _context3.sent;
  15985. done = _yield$_awaitAsyncGen.done;
  15986. value = _yield$_awaitAsyncGen.value;
  15987. if (!done) {
  15988. _context3.next = 12;
  15989. break;
  15990. }
  15991. return _context3.abrupt("break", 16);
  15992. case 12:
  15993. _context3.next = 14;
  15994. return value;
  15995. case 14:
  15996. _context3.next = 5;
  15997. break;
  15998. case 16:
  15999. _context3.prev = 16;
  16000. _context3.next = 19;
  16001. return (0, _awaitAsyncGenerator2.default)(reader.cancel());
  16002. case 19:
  16003. return _context3.finish(16);
  16004. case 20:
  16005. case "end":
  16006. return _context3.stop();
  16007. }
  16008. }
  16009. }, _callee2, null, [[4,, 16, 20]]);
  16010. }));
  16011. return function readStream(_x3) {
  16012. return _ref2.apply(this, arguments);
  16013. };
  16014. }();
  16015. var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish) {
  16016. var iterator = readBytes(stream, chunkSize);
  16017. var bytes = 0;
  16018. var done;
  16019. var _onFinish = function _onFinish(e) {
  16020. if (!done) {
  16021. done = true;
  16022. onFinish && onFinish(e);
  16023. }
  16024. };
  16025. return new ReadableStream({
  16026. pull: function pull(controller) {
  16027. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  16028. var _yield$iterator$next, _done, value, len, loadedBytes;
  16029. return _regenerator.default.wrap(function _callee3$(_context4) {
  16030. while (1) {
  16031. switch (_context4.prev = _context4.next) {
  16032. case 0:
  16033. _context4.prev = 0;
  16034. _context4.next = 3;
  16035. return iterator.next();
  16036. case 3:
  16037. _yield$iterator$next = _context4.sent;
  16038. _done = _yield$iterator$next.done;
  16039. value = _yield$iterator$next.value;
  16040. if (!_done) {
  16041. _context4.next = 10;
  16042. break;
  16043. }
  16044. _onFinish();
  16045. controller.close();
  16046. return _context4.abrupt("return");
  16047. case 10:
  16048. len = value.byteLength;
  16049. if (onProgress) {
  16050. loadedBytes = bytes += len;
  16051. onProgress(loadedBytes);
  16052. }
  16053. controller.enqueue(new Uint8Array(value));
  16054. _context4.next = 19;
  16055. break;
  16056. case 15:
  16057. _context4.prev = 15;
  16058. _context4.t0 = _context4["catch"](0);
  16059. _onFinish(_context4.t0);
  16060. throw _context4.t0;
  16061. case 19:
  16062. case "end":
  16063. return _context4.stop();
  16064. }
  16065. }
  16066. }, _callee3, null, [[0, 15]]);
  16067. }))();
  16068. },
  16069. cancel: function cancel(reason) {
  16070. _onFinish(reason);
  16071. return iterator.return();
  16072. }
  16073. }, {
  16074. highWaterMark: 2
  16075. });
  16076. };
  16077. exports.trackStream = trackStream;
  16078. /***/ }),
  16079. /* 101 */
  16080. /*!*******************************************************************!*\
  16081. !*** ./node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js ***!
  16082. \*******************************************************************/
  16083. /*! no static exports found */
  16084. /***/ (function(module, exports, __webpack_require__) {
  16085. var AsyncGenerator = __webpack_require__(/*! ./AsyncGenerator.js */ 102);
  16086. function _wrapAsyncGenerator(fn) {
  16087. return function () {
  16088. return new AsyncGenerator(fn.apply(this, arguments));
  16089. };
  16090. }
  16091. module.exports = _wrapAsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16092. /***/ }),
  16093. /* 102 */
  16094. /*!***************************************************************!*\
  16095. !*** ./node_modules/@babel/runtime/helpers/AsyncGenerator.js ***!
  16096. \***************************************************************/
  16097. /*! no static exports found */
  16098. /***/ (function(module, exports, __webpack_require__) {
  16099. var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ 103);
  16100. function AsyncGenerator(e) {
  16101. var r, t;
  16102. function resume(r, t) {
  16103. try {
  16104. var n = e[r](t),
  16105. o = n.value,
  16106. u = o instanceof OverloadYield;
  16107. Promise.resolve(u ? o.v : o).then(function (t) {
  16108. if (u) {
  16109. var i = "return" === r ? "return" : "next";
  16110. if (!o.k || t.done) return resume(i, t);
  16111. t = e[i](t).value;
  16112. }
  16113. settle(n.done ? "return" : "normal", t);
  16114. }, function (e) {
  16115. resume("throw", e);
  16116. });
  16117. } catch (e) {
  16118. settle("throw", e);
  16119. }
  16120. }
  16121. function settle(e, n) {
  16122. switch (e) {
  16123. case "return":
  16124. r.resolve({
  16125. value: n,
  16126. done: !0
  16127. });
  16128. break;
  16129. case "throw":
  16130. r.reject(n);
  16131. break;
  16132. default:
  16133. r.resolve({
  16134. value: n,
  16135. done: !1
  16136. });
  16137. }
  16138. (r = r.next) ? resume(r.key, r.arg) : t = null;
  16139. }
  16140. this._invoke = function (e, n) {
  16141. return new Promise(function (o, u) {
  16142. var i = {
  16143. key: e,
  16144. arg: n,
  16145. resolve: o,
  16146. reject: u,
  16147. next: null
  16148. };
  16149. t ? t = t.next = i : (r = t = i, resume(e, n));
  16150. });
  16151. }, "function" != typeof e["return"] && (this["return"] = void 0);
  16152. }
  16153. AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
  16154. return this;
  16155. }, AsyncGenerator.prototype.next = function (e) {
  16156. return this._invoke("next", e);
  16157. }, AsyncGenerator.prototype["throw"] = function (e) {
  16158. return this._invoke("throw", e);
  16159. }, AsyncGenerator.prototype["return"] = function (e) {
  16160. return this._invoke("return", e);
  16161. };
  16162. module.exports = AsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16163. /***/ }),
  16164. /* 103 */
  16165. /*!**************************************************************!*\
  16166. !*** ./node_modules/@babel/runtime/helpers/OverloadYield.js ***!
  16167. \**************************************************************/
  16168. /*! no static exports found */
  16169. /***/ (function(module, exports) {
  16170. function _OverloadYield(t, e) {
  16171. this.v = t, this.k = e;
  16172. }
  16173. module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16174. /***/ }),
  16175. /* 104 */
  16176. /*!********************************************************************!*\
  16177. !*** ./node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js ***!
  16178. \********************************************************************/
  16179. /*! no static exports found */
  16180. /***/ (function(module, exports, __webpack_require__) {
  16181. var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ 103);
  16182. function _awaitAsyncGenerator(e) {
  16183. return new OverloadYield(e, 0);
  16184. }
  16185. module.exports = _awaitAsyncGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16186. /***/ }),
  16187. /* 105 */
  16188. /*!***********************************************************************!*\
  16189. !*** ./node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js ***!
  16190. \***********************************************************************/
  16191. /*! no static exports found */
  16192. /***/ (function(module, exports, __webpack_require__) {
  16193. var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ 103);
  16194. function _asyncGeneratorDelegate(t) {
  16195. var e = {},
  16196. n = !1;
  16197. function pump(e, r) {
  16198. return n = !0, r = new Promise(function (n) {
  16199. n(t[e](r));
  16200. }), {
  16201. done: !1,
  16202. value: new OverloadYield(r, 1)
  16203. };
  16204. }
  16205. return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () {
  16206. return this;
  16207. }, e.next = function (t) {
  16208. return n ? (n = !1, t) : pump("next", t);
  16209. }, "function" == typeof t["throw"] && (e["throw"] = function (t) {
  16210. if (n) throw n = !1, t;
  16211. return pump("throw", t);
  16212. }), "function" == typeof t["return"] && (e["return"] = function (t) {
  16213. return n ? (n = !1, t) : pump("return", t);
  16214. }), e;
  16215. }
  16216. module.exports = _asyncGeneratorDelegate, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16217. /***/ }),
  16218. /* 106 */
  16219. /*!********************************************************************************************************!*\
  16220. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/validator.js ***!
  16221. \********************************************************************************************************/
  16222. /*! no static exports found */
  16223. /***/ (function(module, exports, __webpack_require__) {
  16224. "use strict";
  16225. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16226. Object.defineProperty(exports, "__esModule", {
  16227. value: true
  16228. });
  16229. exports.default = void 0;
  16230. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  16231. var _data = __webpack_require__(/*! ../env/data.js */ 107);
  16232. var _AxiosError = _interopRequireDefault(__webpack_require__(/*! ../core/AxiosError.js */ 59));
  16233. var validators = {};
  16234. // eslint-disable-next-line func-names
  16235. ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (type, i) {
  16236. validators[type] = function validator(thing) {
  16237. return (0, _typeof2.default)(thing) === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
  16238. };
  16239. });
  16240. var deprecatedWarnings = {};
  16241. /**
  16242. * Transitional option validator
  16243. *
  16244. * @param {function|boolean?} validator - set to false if the transitional option has been removed
  16245. * @param {string?} version - deprecated version / removed since version
  16246. * @param {string?} message - some message with additional info
  16247. *
  16248. * @returns {function}
  16249. */
  16250. validators.transitional = function transitional(validator, version, message) {
  16251. function formatMessage(opt, desc) {
  16252. return '[Axios v' + _data.VERSION + "] Transitional option '" + opt + "'" + desc + (message ? '. ' + message : '');
  16253. }
  16254. // eslint-disable-next-line func-names
  16255. return function (value, opt, opts) {
  16256. if (validator === false) {
  16257. throw new _AxiosError.default(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), _AxiosError.default.ERR_DEPRECATED);
  16258. }
  16259. if (version && !deprecatedWarnings[opt]) {
  16260. deprecatedWarnings[opt] = true;
  16261. // eslint-disable-next-line no-console
  16262. console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future'));
  16263. }
  16264. return validator ? validator(value, opt, opts) : true;
  16265. };
  16266. };
  16267. validators.spelling = function spelling(correctSpelling) {
  16268. return function (value, opt) {
  16269. // eslint-disable-next-line no-console
  16270. console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling));
  16271. return true;
  16272. };
  16273. };
  16274. /**
  16275. * Assert object's properties type
  16276. *
  16277. * @param {object} options
  16278. * @param {object} schema
  16279. * @param {boolean?} allowUnknown
  16280. *
  16281. * @returns {object}
  16282. */
  16283. function assertOptions(options, schema, allowUnknown) {
  16284. if ((0, _typeof2.default)(options) !== 'object') {
  16285. throw new _AxiosError.default('options must be an object', _AxiosError.default.ERR_BAD_OPTION_VALUE);
  16286. }
  16287. var keys = Object.keys(options);
  16288. var i = keys.length;
  16289. while (i-- > 0) {
  16290. var opt = keys[i];
  16291. // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
  16292. // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
  16293. var validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
  16294. if (validator) {
  16295. var value = options[opt];
  16296. var result = value === undefined || validator(value, opt, options);
  16297. if (result !== true) {
  16298. throw new _AxiosError.default('option ' + opt + ' must be ' + result, _AxiosError.default.ERR_BAD_OPTION_VALUE);
  16299. }
  16300. continue;
  16301. }
  16302. if (allowUnknown !== true) {
  16303. throw new _AxiosError.default('Unknown option ' + opt, _AxiosError.default.ERR_BAD_OPTION);
  16304. }
  16305. }
  16306. }
  16307. var _default = {
  16308. assertOptions: assertOptions,
  16309. validators: validators
  16310. };
  16311. exports.default = _default;
  16312. /***/ }),
  16313. /* 107 */
  16314. /*!***********************************************************************************************!*\
  16315. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/env/data.js ***!
  16316. \***********************************************************************************************/
  16317. /*! no static exports found */
  16318. /***/ (function(module, exports, __webpack_require__) {
  16319. "use strict";
  16320. Object.defineProperty(exports, "__esModule", {
  16321. value: true
  16322. });
  16323. exports.VERSION = void 0;
  16324. var VERSION = "1.15.2";
  16325. exports.VERSION = VERSION;
  16326. /***/ }),
  16327. /* 108 */
  16328. /*!*********************************************************************************************************!*\
  16329. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/cancel/CancelToken.js ***!
  16330. \*********************************************************************************************************/
  16331. /*! no static exports found */
  16332. /***/ (function(module, exports, __webpack_require__) {
  16333. "use strict";
  16334. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16335. Object.defineProperty(exports, "__esModule", {
  16336. value: true
  16337. });
  16338. exports.default = void 0;
  16339. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  16340. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  16341. var _CanceledError = _interopRequireDefault(__webpack_require__(/*! ./CanceledError.js */ 83));
  16342. /**
  16343. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  16344. *
  16345. * @param {Function} executor The executor function.
  16346. *
  16347. * @returns {CancelToken}
  16348. */
  16349. var CancelToken = /*#__PURE__*/function () {
  16350. function CancelToken(executor) {
  16351. (0, _classCallCheck2.default)(this, CancelToken);
  16352. if (typeof executor !== 'function') {
  16353. throw new TypeError('executor must be a function.');
  16354. }
  16355. var resolvePromise;
  16356. this.promise = new Promise(function promiseExecutor(resolve) {
  16357. resolvePromise = resolve;
  16358. });
  16359. var token = this;
  16360. // eslint-disable-next-line func-names
  16361. this.promise.then(function (cancel) {
  16362. if (!token._listeners) return;
  16363. var i = token._listeners.length;
  16364. while (i-- > 0) {
  16365. token._listeners[i](cancel);
  16366. }
  16367. token._listeners = null;
  16368. });
  16369. // eslint-disable-next-line func-names
  16370. this.promise.then = function (onfulfilled) {
  16371. var _resolve;
  16372. // eslint-disable-next-line func-names
  16373. var promise = new Promise(function (resolve) {
  16374. token.subscribe(resolve);
  16375. _resolve = resolve;
  16376. }).then(onfulfilled);
  16377. promise.cancel = function reject() {
  16378. token.unsubscribe(_resolve);
  16379. };
  16380. return promise;
  16381. };
  16382. executor(function cancel(message, config, request) {
  16383. if (token.reason) {
  16384. // Cancellation has already been requested
  16385. return;
  16386. }
  16387. token.reason = new _CanceledError.default(message, config, request);
  16388. resolvePromise(token.reason);
  16389. });
  16390. }
  16391. /**
  16392. * Throws a `CanceledError` if cancellation has been requested.
  16393. */
  16394. (0, _createClass2.default)(CancelToken, [{
  16395. key: "throwIfRequested",
  16396. value: function throwIfRequested() {
  16397. if (this.reason) {
  16398. throw this.reason;
  16399. }
  16400. }
  16401. /**
  16402. * Subscribe to the cancel signal
  16403. */
  16404. }, {
  16405. key: "subscribe",
  16406. value: function subscribe(listener) {
  16407. if (this.reason) {
  16408. listener(this.reason);
  16409. return;
  16410. }
  16411. if (this._listeners) {
  16412. this._listeners.push(listener);
  16413. } else {
  16414. this._listeners = [listener];
  16415. }
  16416. }
  16417. /**
  16418. * Unsubscribe from the cancel signal
  16419. */
  16420. }, {
  16421. key: "unsubscribe",
  16422. value: function unsubscribe(listener) {
  16423. if (!this._listeners) {
  16424. return;
  16425. }
  16426. var index = this._listeners.indexOf(listener);
  16427. if (index !== -1) {
  16428. this._listeners.splice(index, 1);
  16429. }
  16430. }
  16431. }, {
  16432. key: "toAbortSignal",
  16433. value: function toAbortSignal() {
  16434. var _this = this;
  16435. var controller = new AbortController();
  16436. var abort = function abort(err) {
  16437. controller.abort(err);
  16438. };
  16439. this.subscribe(abort);
  16440. controller.signal.unsubscribe = function () {
  16441. return _this.unsubscribe(abort);
  16442. };
  16443. return controller.signal;
  16444. }
  16445. /**
  16446. * Returns an object that contains a new `CancelToken` and a function that, when called,
  16447. * cancels the `CancelToken`.
  16448. */
  16449. }], [{
  16450. key: "source",
  16451. value: function source() {
  16452. var cancel;
  16453. var token = new CancelToken(function executor(c) {
  16454. cancel = c;
  16455. });
  16456. return {
  16457. token: token,
  16458. cancel: cancel
  16459. };
  16460. }
  16461. }]);
  16462. return CancelToken;
  16463. }();
  16464. var _default = CancelToken;
  16465. exports.default = _default;
  16466. /***/ }),
  16467. /* 109 */
  16468. /*!*****************************************************************************************************!*\
  16469. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/spread.js ***!
  16470. \*****************************************************************************************************/
  16471. /*! no static exports found */
  16472. /***/ (function(module, exports, __webpack_require__) {
  16473. "use strict";
  16474. /**
  16475. * Syntactic sugar for invoking a function and expanding an array for arguments.
  16476. *
  16477. * Common use case would be to use `Function.prototype.apply`.
  16478. *
  16479. * ```js
  16480. * function f(x, y, z) {}
  16481. * const args = [1, 2, 3];
  16482. * f.apply(null, args);
  16483. * ```
  16484. *
  16485. * With `spread` this example can be re-written.
  16486. *
  16487. * ```js
  16488. * spread(function(x, y, z) {})([1, 2, 3]);
  16489. * ```
  16490. *
  16491. * @param {Function} callback
  16492. *
  16493. * @returns {Function}
  16494. */
  16495. Object.defineProperty(exports, "__esModule", {
  16496. value: true
  16497. });
  16498. exports.default = spread;
  16499. function spread(callback) {
  16500. return function wrap(arr) {
  16501. return callback.apply(null, arr);
  16502. };
  16503. }
  16504. /***/ }),
  16505. /* 110 */
  16506. /*!***********************************************************************************************************!*\
  16507. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/isAxiosError.js ***!
  16508. \***********************************************************************************************************/
  16509. /*! no static exports found */
  16510. /***/ (function(module, exports, __webpack_require__) {
  16511. "use strict";
  16512. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16513. Object.defineProperty(exports, "__esModule", {
  16514. value: true
  16515. });
  16516. exports.default = isAxiosError;
  16517. var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils.js */ 47));
  16518. /**
  16519. * Determines whether the payload is an error thrown by Axios
  16520. *
  16521. * @param {*} payload The value to test
  16522. *
  16523. * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
  16524. */
  16525. function isAxiosError(payload) {
  16526. return _utils.default.isObject(payload) && payload.isAxiosError === true;
  16527. }
  16528. /***/ }),
  16529. /* 111 */
  16530. /*!*************************************************************************************************************!*\
  16531. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/node_modules/axios/lib/helpers/HttpStatusCode.js ***!
  16532. \*************************************************************************************************************/
  16533. /*! no static exports found */
  16534. /***/ (function(module, exports, __webpack_require__) {
  16535. "use strict";
  16536. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16537. Object.defineProperty(exports, "__esModule", {
  16538. value: true
  16539. });
  16540. exports.default = void 0;
  16541. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  16542. var HttpStatusCode = {
  16543. Continue: 100,
  16544. SwitchingProtocols: 101,
  16545. Processing: 102,
  16546. EarlyHints: 103,
  16547. Ok: 200,
  16548. Created: 201,
  16549. Accepted: 202,
  16550. NonAuthoritativeInformation: 203,
  16551. NoContent: 204,
  16552. ResetContent: 205,
  16553. PartialContent: 206,
  16554. MultiStatus: 207,
  16555. AlreadyReported: 208,
  16556. ImUsed: 226,
  16557. MultipleChoices: 300,
  16558. MovedPermanently: 301,
  16559. Found: 302,
  16560. SeeOther: 303,
  16561. NotModified: 304,
  16562. UseProxy: 305,
  16563. Unused: 306,
  16564. TemporaryRedirect: 307,
  16565. PermanentRedirect: 308,
  16566. BadRequest: 400,
  16567. Unauthorized: 401,
  16568. PaymentRequired: 402,
  16569. Forbidden: 403,
  16570. NotFound: 404,
  16571. MethodNotAllowed: 405,
  16572. NotAcceptable: 406,
  16573. ProxyAuthenticationRequired: 407,
  16574. RequestTimeout: 408,
  16575. Conflict: 409,
  16576. Gone: 410,
  16577. LengthRequired: 411,
  16578. PreconditionFailed: 412,
  16579. PayloadTooLarge: 413,
  16580. UriTooLong: 414,
  16581. UnsupportedMediaType: 415,
  16582. RangeNotSatisfiable: 416,
  16583. ExpectationFailed: 417,
  16584. ImATeapot: 418,
  16585. MisdirectedRequest: 421,
  16586. UnprocessableEntity: 422,
  16587. Locked: 423,
  16588. FailedDependency: 424,
  16589. TooEarly: 425,
  16590. UpgradeRequired: 426,
  16591. PreconditionRequired: 428,
  16592. TooManyRequests: 429,
  16593. RequestHeaderFieldsTooLarge: 431,
  16594. UnavailableForLegalReasons: 451,
  16595. InternalServerError: 500,
  16596. NotImplemented: 501,
  16597. BadGateway: 502,
  16598. ServiceUnavailable: 503,
  16599. GatewayTimeout: 504,
  16600. HttpVersionNotSupported: 505,
  16601. VariantAlsoNegotiates: 506,
  16602. InsufficientStorage: 507,
  16603. LoopDetected: 508,
  16604. NotExtended: 510,
  16605. NetworkAuthenticationRequired: 511,
  16606. WebServerIsDown: 521,
  16607. ConnectionTimedOut: 522,
  16608. OriginIsUnreachable: 523,
  16609. TimeoutOccurred: 524,
  16610. SslHandshakeFailed: 525,
  16611. InvalidSslCertificate: 526
  16612. };
  16613. Object.entries(HttpStatusCode).forEach(function (_ref) {
  16614. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  16615. key = _ref2[0],
  16616. value = _ref2[1];
  16617. HttpStatusCode[value] = key;
  16618. });
  16619. var _default = HttpStatusCode;
  16620. exports.default = _default;
  16621. /***/ }),
  16622. /* 112 */,
  16623. /* 113 */,
  16624. /* 114 */,
  16625. /* 115 */,
  16626. /* 116 */,
  16627. /* 117 */,
  16628. /* 118 */,
  16629. /* 119 */,
  16630. /* 120 */,
  16631. /* 121 */,
  16632. /* 122 */,
  16633. /* 123 */,
  16634. /* 124 */,
  16635. /* 125 */,
  16636. /* 126 */,
  16637. /* 127 */,
  16638. /* 128 */,
  16639. /* 129 */,
  16640. /* 130 */,
  16641. /* 131 */,
  16642. /* 132 */,
  16643. /* 133 */
  16644. /*!************************************************************************!*\
  16645. !*** /Applications/学习/班级/w0913/W250913/14.uniapp/project2/api/list.js ***!
  16646. \************************************************************************/
  16647. /*! no static exports found */
  16648. /***/ (function(module, exports, __webpack_require__) {
  16649. "use strict";
  16650. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  16651. Object.defineProperty(exports, "__esModule", {
  16652. value: true
  16653. });
  16654. exports.American = American;
  16655. exports.Domestic = Domestic;
  16656. exports.Variety = Variety;
  16657. var _request = _interopRequireDefault(__webpack_require__(/*! ../utils/request */ 44));
  16658. // 国产剧
  16659. function Domestic(params) {
  16660. var start = params.start,
  16661. count = params.count;
  16662. return (0, _request.default)({
  16663. url: "rexxar/api/v2/subject_collection/tv_domestic/items?start=".concat(start, "&count=").concat(count),
  16664. method: 'get'
  16665. });
  16666. }
  16667. // 综艺
  16668. function Variety() {
  16669. var _params = params,
  16670. start = _params.start,
  16671. count = _params.count;
  16672. return (0, _request.default)({
  16673. url: "rexxar/api/v2/subject_collection/tv_variety_show/items?start=".concat(start, "&count=").concat(count),
  16674. method: 'get'
  16675. });
  16676. }
  16677. // 美剧
  16678. function American() {
  16679. var _params2 = params,
  16680. start = _params2.start,
  16681. count = _params2.count;
  16682. return (0, _request.default)({
  16683. url: "rexxar/api/v2/subject_collection/tv_american/items?start=".concat(start, "&count=").concat(count),
  16684. method: 'get'
  16685. });
  16686. }
  16687. /***/ })
  16688. ]]);
  16689. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map