vendor.js 316 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826
  1. "use strict";
  2. const _export_sfc = (sfc, props) => {
  3. const target = sfc.__vccOpts || sfc;
  4. for (const [key, val] of props) {
  5. target[key] = val;
  6. }
  7. return target;
  8. };
  9. function makeMap(str, expectsLowerCase) {
  10. const map2 = /* @__PURE__ */ Object.create(null);
  11. const list = str.split(",");
  12. for (let i = 0; i < list.length; i++) {
  13. map2[list[i]] = true;
  14. }
  15. return expectsLowerCase ? (val) => !!map2[val.toLowerCase()] : (val) => !!map2[val];
  16. }
  17. function normalizeStyle(value) {
  18. if (isArray$1(value)) {
  19. const res = {};
  20. for (let i = 0; i < value.length; i++) {
  21. const item = value[i];
  22. const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item);
  23. if (normalized) {
  24. for (const key in normalized) {
  25. res[key] = normalized[key];
  26. }
  27. }
  28. }
  29. return res;
  30. } else if (isString$1(value)) {
  31. return value;
  32. } else if (isObject$1(value)) {
  33. return value;
  34. }
  35. }
  36. const listDelimiterRE = /;(?![^(]*\))/g;
  37. const propertyDelimiterRE = /:([^]+)/;
  38. const styleCommentRE = /\/\*.*?\*\//gs;
  39. function parseStringStyle(cssText) {
  40. const ret = {};
  41. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  42. if (item) {
  43. const tmp = item.split(propertyDelimiterRE);
  44. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  45. }
  46. });
  47. return ret;
  48. }
  49. function normalizeClass(value) {
  50. let res = "";
  51. if (isString$1(value)) {
  52. res = value;
  53. } else if (isArray$1(value)) {
  54. for (let i = 0; i < value.length; i++) {
  55. const normalized = normalizeClass(value[i]);
  56. if (normalized) {
  57. res += normalized + " ";
  58. }
  59. }
  60. } else if (isObject$1(value)) {
  61. for (const name in value) {
  62. if (value[name]) {
  63. res += name + " ";
  64. }
  65. }
  66. }
  67. return res.trim();
  68. }
  69. const toDisplayString = (val) => {
  70. return isString$1(val) ? val : val == null ? "" : isArray$1(val) || isObject$1(val) && (val.toString === objectToString || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  71. };
  72. const replacer = (_key, val) => {
  73. if (val && val.__v_isRef) {
  74. return replacer(_key, val.value);
  75. } else if (isMap(val)) {
  76. return {
  77. [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
  78. entries[`${key} =>`] = val2;
  79. return entries;
  80. }, {})
  81. };
  82. } else if (isSet(val)) {
  83. return {
  84. [`Set(${val.size})`]: [...val.values()]
  85. };
  86. } else if (isObject$1(val) && !isArray$1(val) && !isPlainObject(val)) {
  87. return String(val);
  88. }
  89. return val;
  90. };
  91. const EMPTY_OBJ = Object.freeze({});
  92. const EMPTY_ARR = Object.freeze([]);
  93. const NOOP = () => {
  94. };
  95. const NO = () => false;
  96. const onRE = /^on[^a-z]/;
  97. const isOn = (key) => onRE.test(key);
  98. const isModelListener = (key) => key.startsWith("onUpdate:");
  99. const extend$1 = Object.assign;
  100. const remove = (arr, el) => {
  101. const i = arr.indexOf(el);
  102. if (i > -1) {
  103. arr.splice(i, 1);
  104. }
  105. };
  106. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  107. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  108. const isArray$1 = Array.isArray;
  109. const isMap = (val) => toTypeString(val) === "[object Map]";
  110. const isSet = (val) => toTypeString(val) === "[object Set]";
  111. const isFunction$1 = (val) => typeof val === "function";
  112. const isString$1 = (val) => typeof val === "string";
  113. const isSymbol = (val) => typeof val === "symbol";
  114. const isObject$1 = (val) => val !== null && typeof val === "object";
  115. const isPromise = (val) => {
  116. return isObject$1(val) && isFunction$1(val.then) && isFunction$1(val.catch);
  117. };
  118. const objectToString = Object.prototype.toString;
  119. const toTypeString = (value) => objectToString.call(value);
  120. const toRawType = (value) => {
  121. return toTypeString(value).slice(8, -1);
  122. };
  123. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  124. const isIntegerKey = (key) => isString$1(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  125. const isReservedProp = /* @__PURE__ */ makeMap(
  126. // the leading comma is intentional so empty string "" is also included
  127. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  128. );
  129. const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
  130. const cacheStringFunction = (fn) => {
  131. const cache = /* @__PURE__ */ Object.create(null);
  132. return (str) => {
  133. const hit = cache[str];
  134. return hit || (cache[str] = fn(str));
  135. };
  136. };
  137. const camelizeRE = /-(\w)/g;
  138. const camelize = cacheStringFunction((str) => {
  139. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  140. });
  141. const hyphenateRE = /\B([A-Z])/g;
  142. const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  143. const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
  144. const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
  145. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  146. const invokeArrayFns$1 = (fns, arg) => {
  147. for (let i = 0; i < fns.length; i++) {
  148. fns[i](arg);
  149. }
  150. };
  151. const def = (obj, key, value) => {
  152. Object.defineProperty(obj, key, {
  153. configurable: true,
  154. enumerable: false,
  155. value
  156. });
  157. };
  158. const looseToNumber = (val) => {
  159. const n2 = parseFloat(val);
  160. return isNaN(n2) ? val : n2;
  161. };
  162. const LINEFEED = "\n";
  163. const SLOT_DEFAULT_NAME = "d";
  164. const ON_SHOW = "onShow";
  165. const ON_HIDE = "onHide";
  166. const ON_LAUNCH = "onLaunch";
  167. const ON_ERROR = "onError";
  168. const ON_THEME_CHANGE = "onThemeChange";
  169. const ON_PAGE_NOT_FOUND = "onPageNotFound";
  170. const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  171. const ON_LOAD = "onLoad";
  172. const ON_READY = "onReady";
  173. const ON_UNLOAD = "onUnload";
  174. const ON_INIT = "onInit";
  175. const ON_SAVE_EXIT_STATE = "onSaveExitState";
  176. const ON_RESIZE = "onResize";
  177. const ON_BACK_PRESS = "onBackPress";
  178. const ON_PAGE_SCROLL = "onPageScroll";
  179. const ON_TAB_ITEM_TAP = "onTabItemTap";
  180. const ON_REACH_BOTTOM = "onReachBottom";
  181. const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  182. const ON_SHARE_TIMELINE = "onShareTimeline";
  183. const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  184. const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  185. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  186. const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  187. const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  188. const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  189. const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  190. const customizeRE = /:/g;
  191. function customizeEvent(str) {
  192. return camelize(str.replace(customizeRE, "-"));
  193. }
  194. function hasLeadingSlash(str) {
  195. return str.indexOf("/") === 0;
  196. }
  197. function addLeadingSlash(str) {
  198. return hasLeadingSlash(str) ? str : "/" + str;
  199. }
  200. const invokeArrayFns = (fns, arg) => {
  201. let ret;
  202. for (let i = 0; i < fns.length; i++) {
  203. ret = fns[i](arg);
  204. }
  205. return ret;
  206. };
  207. function once(fn, ctx = null) {
  208. let res;
  209. return (...args) => {
  210. if (fn) {
  211. res = fn.apply(ctx, args);
  212. fn = null;
  213. }
  214. return res;
  215. };
  216. }
  217. function getValueByDataPath(obj, path) {
  218. if (!isString$1(path)) {
  219. return;
  220. }
  221. path = path.replace(/\[(\d+)\]/g, ".$1");
  222. const parts = path.split(".");
  223. let key = parts[0];
  224. if (!obj) {
  225. obj = {};
  226. }
  227. if (parts.length === 1) {
  228. return obj[key];
  229. }
  230. return getValueByDataPath(obj[key], parts.slice(1).join("."));
  231. }
  232. function sortObject(obj) {
  233. let sortObj = {};
  234. if (isPlainObject(obj)) {
  235. Object.keys(obj).sort().forEach((key) => {
  236. const _key = key;
  237. sortObj[_key] = obj[_key];
  238. });
  239. }
  240. return !Object.keys(sortObj) ? obj : sortObj;
  241. }
  242. const encode = encodeURIComponent;
  243. function stringifyQuery(obj, encodeStr = encode) {
  244. const res = obj ? Object.keys(obj).map((key) => {
  245. let val = obj[key];
  246. if (typeof val === void 0 || val === null) {
  247. val = "";
  248. } else if (isPlainObject(val)) {
  249. val = JSON.stringify(val);
  250. }
  251. return encodeStr(key) + "=" + encodeStr(val);
  252. }).filter((x) => x.length > 0).join("&") : null;
  253. return res ? `?${res}` : "";
  254. }
  255. const PAGE_HOOKS = [
  256. ON_INIT,
  257. ON_LOAD,
  258. ON_SHOW,
  259. ON_HIDE,
  260. ON_UNLOAD,
  261. ON_BACK_PRESS,
  262. ON_PAGE_SCROLL,
  263. ON_TAB_ITEM_TAP,
  264. ON_REACH_BOTTOM,
  265. ON_PULL_DOWN_REFRESH,
  266. ON_SHARE_TIMELINE,
  267. ON_SHARE_APP_MESSAGE,
  268. ON_ADD_TO_FAVORITES,
  269. ON_SAVE_EXIT_STATE,
  270. ON_NAVIGATION_BAR_BUTTON_TAP,
  271. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  272. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  273. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  274. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  275. ];
  276. function isRootHook(name) {
  277. return PAGE_HOOKS.indexOf(name) > -1;
  278. }
  279. const UniLifecycleHooks = [
  280. ON_SHOW,
  281. ON_HIDE,
  282. ON_LAUNCH,
  283. ON_ERROR,
  284. ON_THEME_CHANGE,
  285. ON_PAGE_NOT_FOUND,
  286. ON_UNHANDLE_REJECTION,
  287. ON_INIT,
  288. ON_LOAD,
  289. ON_READY,
  290. ON_UNLOAD,
  291. ON_RESIZE,
  292. ON_BACK_PRESS,
  293. ON_PAGE_SCROLL,
  294. ON_TAB_ITEM_TAP,
  295. ON_REACH_BOTTOM,
  296. ON_PULL_DOWN_REFRESH,
  297. ON_SHARE_TIMELINE,
  298. ON_ADD_TO_FAVORITES,
  299. ON_SHARE_APP_MESSAGE,
  300. ON_SAVE_EXIT_STATE,
  301. ON_NAVIGATION_BAR_BUTTON_TAP,
  302. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  303. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  304. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  305. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  306. ];
  307. const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  308. return {
  309. onPageScroll: 1,
  310. onShareAppMessage: 1 << 1,
  311. onShareTimeline: 1 << 2
  312. };
  313. })();
  314. function isUniLifecycleHook(name, value, checkType = true) {
  315. if (checkType && !isFunction$1(value)) {
  316. return false;
  317. }
  318. if (UniLifecycleHooks.indexOf(name) > -1) {
  319. return true;
  320. } else if (name.indexOf("on") === 0) {
  321. return true;
  322. }
  323. return false;
  324. }
  325. let vueApp;
  326. const createVueAppHooks = [];
  327. function onCreateVueApp(hook) {
  328. if (vueApp) {
  329. return hook(vueApp);
  330. }
  331. createVueAppHooks.push(hook);
  332. }
  333. function invokeCreateVueAppHook(app) {
  334. vueApp = app;
  335. createVueAppHooks.forEach((hook) => hook(app));
  336. }
  337. const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  338. if (isFunction$1(app._component.onError)) {
  339. return createErrorHandler2(app);
  340. }
  341. });
  342. const E = function() {
  343. };
  344. E.prototype = {
  345. on: function(name, callback, ctx) {
  346. var e2 = this.e || (this.e = {});
  347. (e2[name] || (e2[name] = [])).push({
  348. fn: callback,
  349. ctx
  350. });
  351. return this;
  352. },
  353. once: function(name, callback, ctx) {
  354. var self = this;
  355. function listener() {
  356. self.off(name, listener);
  357. callback.apply(ctx, arguments);
  358. }
  359. listener._ = callback;
  360. return this.on(name, listener, ctx);
  361. },
  362. emit: function(name) {
  363. var data = [].slice.call(arguments, 1);
  364. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  365. var i = 0;
  366. var len = evtArr.length;
  367. for (i; i < len; i++) {
  368. evtArr[i].fn.apply(evtArr[i].ctx, data);
  369. }
  370. return this;
  371. },
  372. off: function(name, callback) {
  373. var e2 = this.e || (this.e = {});
  374. var evts = e2[name];
  375. var liveEvents = [];
  376. if (evts && callback) {
  377. for (var i = 0, len = evts.length; i < len; i++) {
  378. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  379. liveEvents.push(evts[i]);
  380. }
  381. }
  382. liveEvents.length ? e2[name] = liveEvents : delete e2[name];
  383. return this;
  384. }
  385. };
  386. var E$1 = E;
  387. const LOCALE_ZH_HANS = "zh-Hans";
  388. const LOCALE_ZH_HANT = "zh-Hant";
  389. const LOCALE_EN = "en";
  390. const LOCALE_FR = "fr";
  391. const LOCALE_ES = "es";
  392. function include(str, parts) {
  393. return !!parts.find((part) => str.indexOf(part) !== -1);
  394. }
  395. function startsWith(str, parts) {
  396. return parts.find((part) => str.indexOf(part) === 0);
  397. }
  398. function normalizeLocale$1(locale2, messages) {
  399. if (!locale2) {
  400. return;
  401. }
  402. locale2 = locale2.trim().replace(/_/g, "-");
  403. if (messages && messages[locale2]) {
  404. return locale2;
  405. }
  406. locale2 = locale2.toLowerCase();
  407. if (locale2 === "chinese") {
  408. return LOCALE_ZH_HANS;
  409. }
  410. if (locale2.indexOf("zh") === 0) {
  411. if (locale2.indexOf("-hans") > -1) {
  412. return LOCALE_ZH_HANS;
  413. }
  414. if (locale2.indexOf("-hant") > -1) {
  415. return LOCALE_ZH_HANT;
  416. }
  417. if (include(locale2, ["-tw", "-hk", "-mo", "-cht"])) {
  418. return LOCALE_ZH_HANT;
  419. }
  420. return LOCALE_ZH_HANS;
  421. }
  422. let locales2 = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  423. if (messages && Object.keys(messages).length > 0) {
  424. locales2 = Object.keys(messages);
  425. }
  426. const lang2 = startsWith(locale2, locales2);
  427. if (lang2) {
  428. return lang2;
  429. }
  430. }
  431. function getBaseSystemInfo() {
  432. return wx.getSystemInfoSync();
  433. }
  434. function validateProtocolFail(name, msg) {
  435. console.warn(`${name}: ${msg}`);
  436. }
  437. function validateProtocol(name, data, protocol, onFail) {
  438. if (!onFail) {
  439. onFail = validateProtocolFail;
  440. }
  441. for (const key in protocol) {
  442. const errMsg = validateProp$1(key, data[key], protocol[key], !hasOwn(data, key));
  443. if (isString$1(errMsg)) {
  444. onFail(name, errMsg);
  445. }
  446. }
  447. }
  448. function validateProtocols(name, args, protocol, onFail) {
  449. if (!protocol) {
  450. return;
  451. }
  452. if (!isArray$1(protocol)) {
  453. return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  454. }
  455. const len = protocol.length;
  456. const argsLen = args.length;
  457. for (let i = 0; i < len; i++) {
  458. const opts = protocol[i];
  459. const data = /* @__PURE__ */ Object.create(null);
  460. if (argsLen > i) {
  461. data[opts.name] = args[i];
  462. }
  463. validateProtocol(name, data, { [opts.name]: opts }, onFail);
  464. }
  465. }
  466. function validateProp$1(name, value, prop, isAbsent) {
  467. if (!isPlainObject(prop)) {
  468. prop = { type: prop };
  469. }
  470. const { type, required, validator } = prop;
  471. if (required && isAbsent) {
  472. return 'Missing required args: "' + name + '"';
  473. }
  474. if (value == null && !required) {
  475. return;
  476. }
  477. if (type != null) {
  478. let isValid2 = false;
  479. const types = isArray$1(type) ? type : [type];
  480. const expectedTypes = [];
  481. for (let i = 0; i < types.length && !isValid2; i++) {
  482. const { valid, expectedType } = assertType$1(value, types[i]);
  483. expectedTypes.push(expectedType || "");
  484. isValid2 = valid;
  485. }
  486. if (!isValid2) {
  487. return getInvalidTypeMessage$1(name, value, expectedTypes);
  488. }
  489. }
  490. if (validator) {
  491. return validator(value);
  492. }
  493. }
  494. const isSimpleType$1 = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
  495. function assertType$1(value, type) {
  496. let valid;
  497. const expectedType = getType$1(type);
  498. if (isSimpleType$1(expectedType)) {
  499. const t2 = typeof value;
  500. valid = t2 === expectedType.toLowerCase();
  501. if (!valid && t2 === "object") {
  502. valid = value instanceof type;
  503. }
  504. } else if (expectedType === "Object") {
  505. valid = isObject$1(value);
  506. } else if (expectedType === "Array") {
  507. valid = isArray$1(value);
  508. } else {
  509. {
  510. valid = value instanceof type;
  511. }
  512. }
  513. return {
  514. valid,
  515. expectedType
  516. };
  517. }
  518. function getInvalidTypeMessage$1(name, value, expectedTypes) {
  519. let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  520. const expectedType = expectedTypes[0];
  521. const receivedType = toRawType(value);
  522. const expectedValue = styleValue$1(value, expectedType);
  523. const receivedValue = styleValue$1(value, receivedType);
  524. if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
  525. message += ` with value ${expectedValue}`;
  526. }
  527. message += `, got ${receivedType} `;
  528. if (isExplicable$1(receivedType)) {
  529. message += `with value ${receivedValue}.`;
  530. }
  531. return message;
  532. }
  533. function getType$1(ctor) {
  534. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  535. return match ? match[1] : "";
  536. }
  537. function styleValue$1(value, type) {
  538. if (type === "String") {
  539. return `"${value}"`;
  540. } else if (type === "Number") {
  541. return `${Number(value)}`;
  542. } else {
  543. return `${value}`;
  544. }
  545. }
  546. function isExplicable$1(type) {
  547. const explicitTypes = ["string", "number", "boolean"];
  548. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  549. }
  550. function isBoolean$1(...args) {
  551. return args.some((elem) => elem.toLowerCase() === "boolean");
  552. }
  553. function tryCatch(fn) {
  554. return function() {
  555. try {
  556. return fn.apply(fn, arguments);
  557. } catch (e2) {
  558. console.error(e2);
  559. }
  560. };
  561. }
  562. let invokeCallbackId = 1;
  563. const invokeCallbacks = {};
  564. function addInvokeCallback(id, name, callback, keepAlive = false) {
  565. invokeCallbacks[id] = {
  566. name,
  567. keepAlive,
  568. callback
  569. };
  570. return id;
  571. }
  572. function invokeCallback(id, res, extras) {
  573. if (typeof id === "number") {
  574. const opts = invokeCallbacks[id];
  575. if (opts) {
  576. if (!opts.keepAlive) {
  577. delete invokeCallbacks[id];
  578. }
  579. return opts.callback(res, extras);
  580. }
  581. }
  582. return res;
  583. }
  584. const API_SUCCESS = "success";
  585. const API_FAIL = "fail";
  586. const API_COMPLETE = "complete";
  587. function getApiCallbacks(args) {
  588. const apiCallbacks = {};
  589. for (const name in args) {
  590. const fn = args[name];
  591. if (isFunction$1(fn)) {
  592. apiCallbacks[name] = tryCatch(fn);
  593. delete args[name];
  594. }
  595. }
  596. return apiCallbacks;
  597. }
  598. function normalizeErrMsg$1(errMsg, name) {
  599. if (!errMsg || errMsg.indexOf(":fail") === -1) {
  600. return name + ":ok";
  601. }
  602. return name + errMsg.substring(errMsg.indexOf(":fail"));
  603. }
  604. function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  605. if (!isPlainObject(args)) {
  606. args = {};
  607. }
  608. const { success, fail, complete } = getApiCallbacks(args);
  609. const hasSuccess = isFunction$1(success);
  610. const hasFail = isFunction$1(fail);
  611. const hasComplete = isFunction$1(complete);
  612. const callbackId = invokeCallbackId++;
  613. addInvokeCallback(callbackId, name, (res) => {
  614. res = res || {};
  615. res.errMsg = normalizeErrMsg$1(res.errMsg, name);
  616. isFunction$1(beforeAll) && beforeAll(res);
  617. if (res.errMsg === name + ":ok") {
  618. isFunction$1(beforeSuccess) && beforeSuccess(res, args);
  619. hasSuccess && success(res);
  620. } else {
  621. hasFail && fail(res);
  622. }
  623. hasComplete && complete(res);
  624. });
  625. return callbackId;
  626. }
  627. const HOOK_SUCCESS = "success";
  628. const HOOK_FAIL = "fail";
  629. const HOOK_COMPLETE = "complete";
  630. const globalInterceptors = {};
  631. const scopedInterceptors = {};
  632. function wrapperHook(hook, params) {
  633. return function(data) {
  634. return hook(data, params) || data;
  635. };
  636. }
  637. function queue$1(hooks2, data, params) {
  638. let promise = false;
  639. for (let i = 0; i < hooks2.length; i++) {
  640. const hook = hooks2[i];
  641. if (promise) {
  642. promise = Promise.resolve(wrapperHook(hook, params));
  643. } else {
  644. const res = hook(data, params);
  645. if (isPromise(res)) {
  646. promise = Promise.resolve(res);
  647. }
  648. if (res === false) {
  649. return {
  650. then() {
  651. },
  652. catch() {
  653. }
  654. };
  655. }
  656. }
  657. }
  658. return promise || {
  659. then(callback) {
  660. return callback(data);
  661. },
  662. catch() {
  663. }
  664. };
  665. }
  666. function wrapperOptions(interceptors2, options = {}) {
  667. [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
  668. const hooks2 = interceptors2[name];
  669. if (!isArray$1(hooks2)) {
  670. return;
  671. }
  672. const oldCallback = options[name];
  673. options[name] = function callbackInterceptor(res) {
  674. queue$1(hooks2, res, options).then((res2) => {
  675. return isFunction$1(oldCallback) && oldCallback(res2) || res2;
  676. });
  677. };
  678. });
  679. return options;
  680. }
  681. function wrapperReturnValue(method, returnValue) {
  682. const returnValueHooks = [];
  683. if (isArray$1(globalInterceptors.returnValue)) {
  684. returnValueHooks.push(...globalInterceptors.returnValue);
  685. }
  686. const interceptor = scopedInterceptors[method];
  687. if (interceptor && isArray$1(interceptor.returnValue)) {
  688. returnValueHooks.push(...interceptor.returnValue);
  689. }
  690. returnValueHooks.forEach((hook) => {
  691. returnValue = hook(returnValue) || returnValue;
  692. });
  693. return returnValue;
  694. }
  695. function getApiInterceptorHooks(method) {
  696. const interceptor = /* @__PURE__ */ Object.create(null);
  697. Object.keys(globalInterceptors).forEach((hook) => {
  698. if (hook !== "returnValue") {
  699. interceptor[hook] = globalInterceptors[hook].slice();
  700. }
  701. });
  702. const scopedInterceptor = scopedInterceptors[method];
  703. if (scopedInterceptor) {
  704. Object.keys(scopedInterceptor).forEach((hook) => {
  705. if (hook !== "returnValue") {
  706. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  707. }
  708. });
  709. }
  710. return interceptor;
  711. }
  712. function invokeApi(method, api, options, params) {
  713. const interceptor = getApiInterceptorHooks(method);
  714. if (interceptor && Object.keys(interceptor).length) {
  715. if (isArray$1(interceptor.invoke)) {
  716. const res = queue$1(interceptor.invoke, options);
  717. return res.then((options2) => {
  718. return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
  719. });
  720. } else {
  721. return api(wrapperOptions(interceptor, options), ...params);
  722. }
  723. }
  724. return api(options, ...params);
  725. }
  726. function hasCallback(args) {
  727. if (isPlainObject(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction$1(args[cb]))) {
  728. return true;
  729. }
  730. return false;
  731. }
  732. function handlePromise(promise) {
  733. return promise;
  734. }
  735. function promisify$1(name, fn) {
  736. return (args = {}, ...rest) => {
  737. if (hasCallback(args)) {
  738. return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
  739. }
  740. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  741. invokeApi(name, fn, extend$1(args, { success: resolve2, fail: reject }), rest);
  742. })));
  743. };
  744. }
  745. function formatApiArgs(args, options) {
  746. const params = args[0];
  747. if (!options || !isPlainObject(options.formatArgs) && isPlainObject(params)) {
  748. return;
  749. }
  750. const formatArgs = options.formatArgs;
  751. const keys2 = Object.keys(formatArgs);
  752. for (let i = 0; i < keys2.length; i++) {
  753. const name = keys2[i];
  754. const formatterOrDefaultValue = formatArgs[name];
  755. if (isFunction$1(formatterOrDefaultValue)) {
  756. const errMsg = formatterOrDefaultValue(args[0][name], params);
  757. if (isString$1(errMsg)) {
  758. return errMsg;
  759. }
  760. } else {
  761. if (!hasOwn(params, name)) {
  762. params[name] = formatterOrDefaultValue;
  763. }
  764. }
  765. }
  766. }
  767. function invokeSuccess(id, name, res) {
  768. return invokeCallback(id, extend$1(res || {}, { errMsg: name + ":ok" }));
  769. }
  770. function invokeFail(id, name, errMsg, errRes) {
  771. return invokeCallback(id, extend$1({ errMsg: name + ":fail" + (errMsg ? " " + errMsg : "") }, errRes));
  772. }
  773. function beforeInvokeApi(name, args, protocol, options) {
  774. {
  775. validateProtocols(name, args, protocol);
  776. }
  777. if (options && options.beforeInvoke) {
  778. const errMsg2 = options.beforeInvoke(args);
  779. if (isString$1(errMsg2)) {
  780. return errMsg2;
  781. }
  782. }
  783. const errMsg = formatApiArgs(args, options);
  784. if (errMsg) {
  785. return errMsg;
  786. }
  787. }
  788. function normalizeErrMsg(errMsg) {
  789. if (!errMsg || isString$1(errMsg)) {
  790. return errMsg;
  791. }
  792. if (errMsg.stack) {
  793. console.error(errMsg.message + LINEFEED + errMsg.stack);
  794. return errMsg.message;
  795. }
  796. return errMsg;
  797. }
  798. function wrapperTaskApi(name, fn, protocol, options) {
  799. return (args) => {
  800. const id = createAsyncApiCallback(name, args, options);
  801. const errMsg = beforeInvokeApi(name, [args], protocol, options);
  802. if (errMsg) {
  803. return invokeFail(id, name, errMsg);
  804. }
  805. return fn(args, {
  806. resolve: (res) => invokeSuccess(id, name, res),
  807. reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes)
  808. });
  809. };
  810. }
  811. function wrapperSyncApi(name, fn, protocol, options) {
  812. return (...args) => {
  813. const errMsg = beforeInvokeApi(name, args, protocol, options);
  814. if (errMsg) {
  815. throw new Error(errMsg);
  816. }
  817. return fn.apply(null, args);
  818. };
  819. }
  820. function wrapperAsyncApi(name, fn, protocol, options) {
  821. return wrapperTaskApi(name, fn, protocol, options);
  822. }
  823. function defineSyncApi(name, fn, protocol, options) {
  824. return wrapperSyncApi(name, fn, protocol, options);
  825. }
  826. function defineAsyncApi(name, fn, protocol, options) {
  827. return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
  828. }
  829. const API_UPX2PX = "upx2px";
  830. const Upx2pxProtocol = [
  831. {
  832. name: "upx",
  833. type: [Number, String],
  834. required: true
  835. }
  836. ];
  837. const EPS = 1e-4;
  838. const BASE_DEVICE_WIDTH = 750;
  839. let isIOS = false;
  840. let deviceWidth = 0;
  841. let deviceDPR = 0;
  842. function checkDeviceWidth() {
  843. const { platform, pixelRatio, windowWidth } = getBaseSystemInfo();
  844. deviceWidth = windowWidth;
  845. deviceDPR = pixelRatio;
  846. isIOS = platform === "ios";
  847. }
  848. const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  849. if (deviceWidth === 0) {
  850. checkDeviceWidth();
  851. }
  852. number = Number(number);
  853. if (number === 0) {
  854. return 0;
  855. }
  856. let width = newDeviceWidth || deviceWidth;
  857. let result = number / BASE_DEVICE_WIDTH * width;
  858. if (result < 0) {
  859. result = -result;
  860. }
  861. result = Math.floor(result + EPS);
  862. if (result === 0) {
  863. if (deviceDPR === 1 || !isIOS) {
  864. result = 1;
  865. } else {
  866. result = 0.5;
  867. }
  868. }
  869. return number < 0 ? -result : result;
  870. }, Upx2pxProtocol);
  871. const API_ADD_INTERCEPTOR = "addInterceptor";
  872. const API_REMOVE_INTERCEPTOR = "removeInterceptor";
  873. const AddInterceptorProtocol = [
  874. {
  875. name: "method",
  876. type: [String, Object],
  877. required: true
  878. }
  879. ];
  880. const RemoveInterceptorProtocol = AddInterceptorProtocol;
  881. function mergeInterceptorHook(interceptors2, interceptor) {
  882. Object.keys(interceptor).forEach((hook) => {
  883. if (isFunction$1(interceptor[hook])) {
  884. interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
  885. }
  886. });
  887. }
  888. function removeInterceptorHook(interceptors2, interceptor) {
  889. if (!interceptors2 || !interceptor) {
  890. return;
  891. }
  892. Object.keys(interceptor).forEach((name) => {
  893. const hooks2 = interceptors2[name];
  894. const hook = interceptor[name];
  895. if (isArray$1(hooks2) && isFunction$1(hook)) {
  896. remove(hooks2, hook);
  897. }
  898. });
  899. }
  900. function mergeHook(parentVal, childVal) {
  901. const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray$1(childVal) ? childVal : [childVal] : parentVal;
  902. return res ? dedupeHooks(res) : res;
  903. }
  904. function dedupeHooks(hooks2) {
  905. const res = [];
  906. for (let i = 0; i < hooks2.length; i++) {
  907. if (res.indexOf(hooks2[i]) === -1) {
  908. res.push(hooks2[i]);
  909. }
  910. }
  911. return res;
  912. }
  913. const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  914. if (isString$1(method) && isPlainObject(interceptor)) {
  915. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  916. } else if (isPlainObject(method)) {
  917. mergeInterceptorHook(globalInterceptors, method);
  918. }
  919. }, AddInterceptorProtocol);
  920. const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  921. if (isString$1(method)) {
  922. if (isPlainObject(interceptor)) {
  923. removeInterceptorHook(scopedInterceptors[method], interceptor);
  924. } else {
  925. delete scopedInterceptors[method];
  926. }
  927. } else if (isPlainObject(method)) {
  928. removeInterceptorHook(globalInterceptors, method);
  929. }
  930. }, RemoveInterceptorProtocol);
  931. const interceptors = {};
  932. const API_ON = "$on";
  933. const OnProtocol = [
  934. {
  935. name: "event",
  936. type: String,
  937. required: true
  938. },
  939. {
  940. name: "callback",
  941. type: Function,
  942. required: true
  943. }
  944. ];
  945. const API_ONCE = "$once";
  946. const OnceProtocol = OnProtocol;
  947. const API_OFF = "$off";
  948. const OffProtocol = [
  949. {
  950. name: "event",
  951. type: [String, Array]
  952. },
  953. {
  954. name: "callback",
  955. type: Function
  956. }
  957. ];
  958. const API_EMIT = "$emit";
  959. const EmitProtocol = [
  960. {
  961. name: "event",
  962. type: String,
  963. required: true
  964. }
  965. ];
  966. const emitter = new E$1();
  967. const $on = defineSyncApi(API_ON, (name, callback) => {
  968. emitter.on(name, callback);
  969. return () => emitter.off(name, callback);
  970. }, OnProtocol);
  971. const $once = defineSyncApi(API_ONCE, (name, callback) => {
  972. emitter.once(name, callback);
  973. return () => emitter.off(name, callback);
  974. }, OnceProtocol);
  975. const $off = defineSyncApi(API_OFF, (name, callback) => {
  976. if (!name) {
  977. emitter.e = {};
  978. return;
  979. }
  980. if (!isArray$1(name))
  981. name = [name];
  982. name.forEach((n2) => emitter.off(n2, callback));
  983. }, OffProtocol);
  984. const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  985. emitter.emit(name, ...args);
  986. }, EmitProtocol);
  987. let cid;
  988. let cidErrMsg;
  989. let enabled;
  990. function normalizePushMessage(message) {
  991. try {
  992. return JSON.parse(message);
  993. } catch (e2) {
  994. }
  995. return message;
  996. }
  997. function invokePushCallback(args) {
  998. if (args.type === "enabled") {
  999. enabled = true;
  1000. } else if (args.type === "clientId") {
  1001. cid = args.cid;
  1002. cidErrMsg = args.errMsg;
  1003. invokeGetPushCidCallbacks(cid, args.errMsg);
  1004. } else if (args.type === "pushMsg") {
  1005. const message = {
  1006. type: "receive",
  1007. data: normalizePushMessage(args.message)
  1008. };
  1009. for (let i = 0; i < onPushMessageCallbacks.length; i++) {
  1010. const callback = onPushMessageCallbacks[i];
  1011. callback(message);
  1012. if (message.stopped) {
  1013. break;
  1014. }
  1015. }
  1016. } else if (args.type === "click") {
  1017. onPushMessageCallbacks.forEach((callback) => {
  1018. callback({
  1019. type: "click",
  1020. data: normalizePushMessage(args.message)
  1021. });
  1022. });
  1023. }
  1024. }
  1025. const getPushCidCallbacks = [];
  1026. function invokeGetPushCidCallbacks(cid2, errMsg) {
  1027. getPushCidCallbacks.forEach((callback) => {
  1028. callback(cid2, errMsg);
  1029. });
  1030. getPushCidCallbacks.length = 0;
  1031. }
  1032. const API_GET_PUSH_CLIENT_ID = "getPushClientId";
  1033. const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
  1034. Promise.resolve().then(() => {
  1035. if (typeof enabled === "undefined") {
  1036. enabled = false;
  1037. cid = "";
  1038. cidErrMsg = "uniPush is not enabled";
  1039. }
  1040. getPushCidCallbacks.push((cid2, errMsg) => {
  1041. if (cid2) {
  1042. resolve2({ cid: cid2 });
  1043. } else {
  1044. reject(errMsg);
  1045. }
  1046. });
  1047. if (typeof cid !== "undefined") {
  1048. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1049. }
  1050. });
  1051. });
  1052. const onPushMessageCallbacks = [];
  1053. const onPushMessage = (fn) => {
  1054. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1055. onPushMessageCallbacks.push(fn);
  1056. }
  1057. };
  1058. const offPushMessage = (fn) => {
  1059. if (!fn) {
  1060. onPushMessageCallbacks.length = 0;
  1061. } else {
  1062. const index2 = onPushMessageCallbacks.indexOf(fn);
  1063. if (index2 > -1) {
  1064. onPushMessageCallbacks.splice(index2, 1);
  1065. }
  1066. }
  1067. };
  1068. const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
  1069. const CONTEXT_API_RE = /^create|Manager$/;
  1070. const CONTEXT_API_RE_EXC = ["createBLEConnection"];
  1071. const ASYNC_API = ["createBLEConnection"];
  1072. const CALLBACK_API_RE = /^on|^off/;
  1073. function isContextApi(name) {
  1074. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1075. }
  1076. function isSyncApi(name) {
  1077. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1078. }
  1079. function isCallbackApi(name) {
  1080. return CALLBACK_API_RE.test(name) && name !== "onPush";
  1081. }
  1082. function shouldPromise(name) {
  1083. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1084. return false;
  1085. }
  1086. return true;
  1087. }
  1088. if (!Promise.prototype.finally) {
  1089. Promise.prototype.finally = function(onfinally) {
  1090. const promise = this.constructor;
  1091. return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
  1092. throw reason;
  1093. }));
  1094. };
  1095. }
  1096. function promisify(name, api) {
  1097. if (!shouldPromise(name)) {
  1098. return api;
  1099. }
  1100. if (!isFunction$1(api)) {
  1101. return api;
  1102. }
  1103. return function promiseApi(options = {}, ...rest) {
  1104. if (isFunction$1(options.success) || isFunction$1(options.fail) || isFunction$1(options.complete)) {
  1105. return wrapperReturnValue(name, invokeApi(name, api, options, rest));
  1106. }
  1107. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  1108. invokeApi(name, api, extend$1({}, options, {
  1109. success: resolve2,
  1110. fail: reject
  1111. }), rest);
  1112. })));
  1113. };
  1114. }
  1115. const CALLBACKS = ["success", "fail", "cancel", "complete"];
  1116. function initWrapper(protocols2) {
  1117. function processCallback(methodName, method, returnValue) {
  1118. return function(res) {
  1119. return method(processReturnValue(methodName, res, returnValue));
  1120. };
  1121. }
  1122. function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
  1123. if (isPlainObject(fromArgs)) {
  1124. const toArgs = keepFromArgs === true ? fromArgs : {};
  1125. if (isFunction$1(argsOption)) {
  1126. argsOption = argsOption(fromArgs, toArgs) || {};
  1127. }
  1128. for (const key in fromArgs) {
  1129. if (hasOwn(argsOption, key)) {
  1130. let keyOption = argsOption[key];
  1131. if (isFunction$1(keyOption)) {
  1132. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1133. }
  1134. if (!keyOption) {
  1135. console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
  1136. } else if (isString$1(keyOption)) {
  1137. toArgs[keyOption] = fromArgs[key];
  1138. } else if (isPlainObject(keyOption)) {
  1139. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1140. }
  1141. } else if (CALLBACKS.indexOf(key) !== -1) {
  1142. const callback = fromArgs[key];
  1143. if (isFunction$1(callback)) {
  1144. toArgs[key] = processCallback(methodName, callback, returnValue);
  1145. }
  1146. } else {
  1147. if (!keepFromArgs && !hasOwn(toArgs, key)) {
  1148. toArgs[key] = fromArgs[key];
  1149. }
  1150. }
  1151. }
  1152. return toArgs;
  1153. } else if (isFunction$1(fromArgs)) {
  1154. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1155. }
  1156. return fromArgs;
  1157. }
  1158. function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
  1159. if (isFunction$1(protocols2.returnValue)) {
  1160. res = protocols2.returnValue(methodName, res);
  1161. }
  1162. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1163. }
  1164. return function wrapper(methodName, method) {
  1165. if (!hasOwn(protocols2, methodName)) {
  1166. return method;
  1167. }
  1168. const protocol = protocols2[methodName];
  1169. if (!protocol) {
  1170. return function() {
  1171. console.error(`微信小程序 暂不支持${methodName}`);
  1172. };
  1173. }
  1174. return function(arg1, arg2) {
  1175. let options = protocol;
  1176. if (isFunction$1(protocol)) {
  1177. options = protocol(arg1);
  1178. }
  1179. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1180. const args = [arg1];
  1181. if (typeof arg2 !== "undefined") {
  1182. args.push(arg2);
  1183. }
  1184. const returnValue = wx[options.name || methodName].apply(wx, args);
  1185. if (isSyncApi(methodName)) {
  1186. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1187. }
  1188. return returnValue;
  1189. };
  1190. };
  1191. }
  1192. const getLocale$1 = () => {
  1193. const app = isFunction$1(getApp) && getApp({ allowDefault: true });
  1194. if (app && app.$vm) {
  1195. return app.$vm.$locale;
  1196. }
  1197. return normalizeLocale$1(wx.getSystemInfoSync().language) || LOCALE_EN;
  1198. };
  1199. const setLocale = (locale2) => {
  1200. const app = isFunction$1(getApp) && getApp();
  1201. if (!app) {
  1202. return false;
  1203. }
  1204. const oldLocale = app.$vm.$locale;
  1205. if (oldLocale !== locale2) {
  1206. app.$vm.$locale = locale2;
  1207. onLocaleChangeCallbacks.forEach((fn) => fn({ locale: locale2 }));
  1208. return true;
  1209. }
  1210. return false;
  1211. };
  1212. const onLocaleChangeCallbacks = [];
  1213. const onLocaleChange = (fn) => {
  1214. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1215. onLocaleChangeCallbacks.push(fn);
  1216. }
  1217. };
  1218. if (typeof global !== "undefined") {
  1219. global.getLocale = getLocale$1;
  1220. }
  1221. const UUID_KEY = "__DC_STAT_UUID";
  1222. let deviceId;
  1223. function useDeviceId(global2 = wx) {
  1224. return function addDeviceId(_, toRes) {
  1225. deviceId = deviceId || global2.getStorageSync(UUID_KEY);
  1226. if (!deviceId) {
  1227. deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
  1228. wx.setStorage({
  1229. key: UUID_KEY,
  1230. data: deviceId
  1231. });
  1232. }
  1233. toRes.deviceId = deviceId;
  1234. };
  1235. }
  1236. function addSafeAreaInsets(fromRes, toRes) {
  1237. if (fromRes.safeArea) {
  1238. const safeArea = fromRes.safeArea;
  1239. toRes.safeAreaInsets = {
  1240. top: safeArea.top,
  1241. left: safeArea.left,
  1242. right: fromRes.windowWidth - safeArea.right,
  1243. bottom: fromRes.screenHeight - safeArea.bottom
  1244. };
  1245. }
  1246. }
  1247. function populateParameters(fromRes, toRes) {
  1248. const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  1249. let osName = "";
  1250. let osVersion = "";
  1251. {
  1252. osName = system.split(" ")[0] || "";
  1253. osVersion = system.split(" ")[1] || "";
  1254. }
  1255. let hostVersion = version2;
  1256. let deviceType = getGetDeviceType(fromRes, model);
  1257. let deviceBrand = getDeviceBrand(brand);
  1258. let _hostName = getHostName(fromRes);
  1259. let _deviceOrientation = deviceOrientation;
  1260. let _devicePixelRatio = pixelRatio;
  1261. let _SDKVersion = SDKVersion;
  1262. const hostLanguage = language.replace(/_/g, "-");
  1263. const parameters = {
  1264. appId: "__UNI__818FE07",
  1265. appName: "match_applet",
  1266. appVersion: "1.0.0",
  1267. appVersionCode: "100",
  1268. appLanguage: getAppLanguage(hostLanguage),
  1269. uniCompileVersion: "3.8.7",
  1270. uniRuntimeVersion: "3.8.7",
  1271. uniPlatform: "mp-weixin",
  1272. deviceBrand,
  1273. deviceModel: model,
  1274. deviceType,
  1275. devicePixelRatio: _devicePixelRatio,
  1276. deviceOrientation: _deviceOrientation,
  1277. osName: osName.toLocaleLowerCase(),
  1278. osVersion,
  1279. hostTheme: theme,
  1280. hostVersion,
  1281. hostLanguage,
  1282. hostName: _hostName,
  1283. hostSDKVersion: _SDKVersion,
  1284. hostFontSizeSetting: fontSizeSetting,
  1285. windowTop: 0,
  1286. windowBottom: 0,
  1287. // TODO
  1288. osLanguage: void 0,
  1289. osTheme: void 0,
  1290. ua: void 0,
  1291. hostPackageName: void 0,
  1292. browserName: void 0,
  1293. browserVersion: void 0
  1294. };
  1295. extend$1(toRes, parameters);
  1296. }
  1297. function getGetDeviceType(fromRes, model) {
  1298. let deviceType = fromRes.deviceType || "phone";
  1299. {
  1300. const deviceTypeMaps = {
  1301. ipad: "pad",
  1302. windows: "pc",
  1303. mac: "pc"
  1304. };
  1305. const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1306. const _model = model.toLocaleLowerCase();
  1307. for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
  1308. const _m = deviceTypeMapsKeys[index2];
  1309. if (_model.indexOf(_m) !== -1) {
  1310. deviceType = deviceTypeMaps[_m];
  1311. break;
  1312. }
  1313. }
  1314. }
  1315. return deviceType;
  1316. }
  1317. function getDeviceBrand(brand) {
  1318. let deviceBrand = brand;
  1319. if (deviceBrand) {
  1320. deviceBrand = deviceBrand.toLocaleLowerCase();
  1321. }
  1322. return deviceBrand;
  1323. }
  1324. function getAppLanguage(defaultLanguage) {
  1325. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1326. }
  1327. function getHostName(fromRes) {
  1328. const _platform = "WeChat";
  1329. let _hostName = fromRes.hostName || _platform;
  1330. {
  1331. if (fromRes.environment) {
  1332. _hostName = fromRes.environment;
  1333. } else if (fromRes.host && fromRes.host.env) {
  1334. _hostName = fromRes.host.env;
  1335. }
  1336. }
  1337. return _hostName;
  1338. }
  1339. const getSystemInfo = {
  1340. returnValue: (fromRes, toRes) => {
  1341. addSafeAreaInsets(fromRes, toRes);
  1342. useDeviceId()(fromRes, toRes);
  1343. populateParameters(fromRes, toRes);
  1344. }
  1345. };
  1346. const getSystemInfoSync = getSystemInfo;
  1347. const redirectTo = {};
  1348. const previewImage = {
  1349. args(fromArgs, toArgs) {
  1350. let currentIndex = parseInt(fromArgs.current);
  1351. if (isNaN(currentIndex)) {
  1352. return;
  1353. }
  1354. const urls = fromArgs.urls;
  1355. if (!isArray$1(urls)) {
  1356. return;
  1357. }
  1358. const len = urls.length;
  1359. if (!len) {
  1360. return;
  1361. }
  1362. if (currentIndex < 0) {
  1363. currentIndex = 0;
  1364. } else if (currentIndex >= len) {
  1365. currentIndex = len - 1;
  1366. }
  1367. if (currentIndex > 0) {
  1368. toArgs.current = urls[currentIndex];
  1369. toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
  1370. } else {
  1371. toArgs.current = urls[0];
  1372. }
  1373. return {
  1374. indicator: false,
  1375. loop: false
  1376. };
  1377. }
  1378. };
  1379. const showActionSheet = {
  1380. args(fromArgs, toArgs) {
  1381. toArgs.alertText = fromArgs.title;
  1382. }
  1383. };
  1384. const getDeviceInfo = {
  1385. returnValue: (fromRes, toRes) => {
  1386. const { brand, model } = fromRes;
  1387. let deviceType = getGetDeviceType(fromRes, model);
  1388. let deviceBrand = getDeviceBrand(brand);
  1389. useDeviceId()(fromRes, toRes);
  1390. toRes = sortObject(extend$1(toRes, {
  1391. deviceType,
  1392. deviceBrand,
  1393. deviceModel: model
  1394. }));
  1395. }
  1396. };
  1397. const getAppBaseInfo = {
  1398. returnValue: (fromRes, toRes) => {
  1399. const { version: version2, language, SDKVersion, theme } = fromRes;
  1400. let _hostName = getHostName(fromRes);
  1401. let hostLanguage = language.replace(/_/g, "-");
  1402. toRes = sortObject(extend$1(toRes, {
  1403. hostVersion: version2,
  1404. hostLanguage,
  1405. hostName: _hostName,
  1406. hostSDKVersion: SDKVersion,
  1407. hostTheme: theme,
  1408. appId: "__UNI__818FE07",
  1409. appName: "match_applet",
  1410. appVersion: "1.0.0",
  1411. appVersionCode: "100",
  1412. appLanguage: getAppLanguage(hostLanguage)
  1413. }));
  1414. }
  1415. };
  1416. const getWindowInfo = {
  1417. returnValue: (fromRes, toRes) => {
  1418. addSafeAreaInsets(fromRes, toRes);
  1419. toRes = sortObject(extend$1(toRes, {
  1420. windowTop: 0,
  1421. windowBottom: 0
  1422. }));
  1423. }
  1424. };
  1425. const getAppAuthorizeSetting = {
  1426. returnValue: function(fromRes, toRes) {
  1427. const { locationReducedAccuracy } = fromRes;
  1428. toRes.locationAccuracy = "unsupported";
  1429. if (locationReducedAccuracy === true) {
  1430. toRes.locationAccuracy = "reduced";
  1431. } else if (locationReducedAccuracy === false) {
  1432. toRes.locationAccuracy = "full";
  1433. }
  1434. }
  1435. };
  1436. const baseApis = {
  1437. $on,
  1438. $off,
  1439. $once,
  1440. $emit,
  1441. upx2px,
  1442. interceptors,
  1443. addInterceptor,
  1444. removeInterceptor,
  1445. onCreateVueApp,
  1446. invokeCreateVueAppHook,
  1447. getLocale: getLocale$1,
  1448. setLocale,
  1449. onLocaleChange,
  1450. getPushClientId,
  1451. onPushMessage,
  1452. offPushMessage,
  1453. invokePushCallback
  1454. };
  1455. function initUni(api, protocols2, platform = wx) {
  1456. const wrapper = initWrapper(protocols2);
  1457. const UniProxyHandlers = {
  1458. get(target, key) {
  1459. if (hasOwn(target, key)) {
  1460. return target[key];
  1461. }
  1462. if (hasOwn(api, key)) {
  1463. return promisify(key, api[key]);
  1464. }
  1465. if (hasOwn(baseApis, key)) {
  1466. return promisify(key, baseApis[key]);
  1467. }
  1468. return promisify(key, wrapper(key, platform[key]));
  1469. }
  1470. };
  1471. return new Proxy({}, UniProxyHandlers);
  1472. }
  1473. function initGetProvider(providers) {
  1474. return function getProvider2({ service, success, fail, complete }) {
  1475. let res;
  1476. if (providers[service]) {
  1477. res = {
  1478. errMsg: "getProvider:ok",
  1479. service,
  1480. provider: providers[service]
  1481. };
  1482. isFunction$1(success) && success(res);
  1483. } else {
  1484. res = {
  1485. errMsg: "getProvider:fail:服务[" + service + "]不存在"
  1486. };
  1487. isFunction$1(fail) && fail(res);
  1488. }
  1489. isFunction$1(complete) && complete(res);
  1490. };
  1491. }
  1492. const objectKeys = [
  1493. "qy",
  1494. "env",
  1495. "error",
  1496. "version",
  1497. "lanDebug",
  1498. "cloud",
  1499. "serviceMarket",
  1500. "router",
  1501. "worklet",
  1502. "__webpack_require_UNI_MP_PLUGIN__"
  1503. ];
  1504. const singlePageDisableKey = ["lanDebug", "router", "worklet"];
  1505. const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
  1506. function isWxKey(key) {
  1507. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  1508. return false;
  1509. }
  1510. return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
  1511. }
  1512. function initWx() {
  1513. const newWx = {};
  1514. for (const key in wx) {
  1515. if (isWxKey(key)) {
  1516. newWx[key] = wx[key];
  1517. }
  1518. }
  1519. if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
  1520. globalThis.wx = newWx;
  1521. }
  1522. return newWx;
  1523. }
  1524. const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  1525. const getProvider = initGetProvider({
  1526. oauth: ["weixin"],
  1527. share: ["weixin"],
  1528. payment: ["wxpay"],
  1529. push: ["weixin"]
  1530. });
  1531. function initComponentMocks(component) {
  1532. const res = /* @__PURE__ */ Object.create(null);
  1533. mocks$1.forEach((name) => {
  1534. res[name] = component[name];
  1535. });
  1536. return res;
  1537. }
  1538. function createSelectorQuery() {
  1539. const query = wx$2.createSelectorQuery();
  1540. const oldIn = query.in;
  1541. query.in = function newIn(component) {
  1542. return oldIn.call(this, initComponentMocks(component));
  1543. };
  1544. return query;
  1545. }
  1546. const wx$2 = initWx();
  1547. let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
  1548. if (!baseInfo) {
  1549. baseInfo = wx$2.getSystemInfoSync();
  1550. }
  1551. const host = baseInfo ? baseInfo.host : null;
  1552. const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
  1553. var shims = /* @__PURE__ */ Object.freeze({
  1554. __proto__: null,
  1555. createSelectorQuery,
  1556. getProvider,
  1557. shareVideoMessage
  1558. });
  1559. const compressImage = {
  1560. args(fromArgs, toArgs) {
  1561. if (fromArgs.compressedHeight && !toArgs.compressHeight) {
  1562. toArgs.compressHeight = fromArgs.compressedHeight;
  1563. }
  1564. if (fromArgs.compressedWidth && !toArgs.compressWidth) {
  1565. toArgs.compressWidth = fromArgs.compressedWidth;
  1566. }
  1567. }
  1568. };
  1569. var protocols = /* @__PURE__ */ Object.freeze({
  1570. __proto__: null,
  1571. compressImage,
  1572. getAppAuthorizeSetting,
  1573. getAppBaseInfo,
  1574. getDeviceInfo,
  1575. getSystemInfo,
  1576. getSystemInfoSync,
  1577. getWindowInfo,
  1578. previewImage,
  1579. redirectTo,
  1580. showActionSheet
  1581. });
  1582. const wx$1 = initWx();
  1583. var index = initUni(shims, protocols, wx$1);
  1584. function warn$1(msg, ...args) {
  1585. console.warn(`[Vue warn] ${msg}`, ...args);
  1586. }
  1587. let activeEffectScope;
  1588. class EffectScope {
  1589. constructor(detached = false) {
  1590. this.detached = detached;
  1591. this._active = true;
  1592. this.effects = [];
  1593. this.cleanups = [];
  1594. this.parent = activeEffectScope;
  1595. if (!detached && activeEffectScope) {
  1596. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  1597. }
  1598. }
  1599. get active() {
  1600. return this._active;
  1601. }
  1602. run(fn) {
  1603. if (this._active) {
  1604. const currentEffectScope = activeEffectScope;
  1605. try {
  1606. activeEffectScope = this;
  1607. return fn();
  1608. } finally {
  1609. activeEffectScope = currentEffectScope;
  1610. }
  1611. } else {
  1612. warn$1(`cannot run an inactive effect scope.`);
  1613. }
  1614. }
  1615. /**
  1616. * This should only be called on non-detached scopes
  1617. * @internal
  1618. */
  1619. on() {
  1620. activeEffectScope = this;
  1621. }
  1622. /**
  1623. * This should only be called on non-detached scopes
  1624. * @internal
  1625. */
  1626. off() {
  1627. activeEffectScope = this.parent;
  1628. }
  1629. stop(fromParent) {
  1630. if (this._active) {
  1631. let i, l;
  1632. for (i = 0, l = this.effects.length; i < l; i++) {
  1633. this.effects[i].stop();
  1634. }
  1635. for (i = 0, l = this.cleanups.length; i < l; i++) {
  1636. this.cleanups[i]();
  1637. }
  1638. if (this.scopes) {
  1639. for (i = 0, l = this.scopes.length; i < l; i++) {
  1640. this.scopes[i].stop(true);
  1641. }
  1642. }
  1643. if (!this.detached && this.parent && !fromParent) {
  1644. const last = this.parent.scopes.pop();
  1645. if (last && last !== this) {
  1646. this.parent.scopes[this.index] = last;
  1647. last.index = this.index;
  1648. }
  1649. }
  1650. this.parent = void 0;
  1651. this._active = false;
  1652. }
  1653. }
  1654. }
  1655. function recordEffectScope(effect, scope = activeEffectScope) {
  1656. if (scope && scope.active) {
  1657. scope.effects.push(effect);
  1658. }
  1659. }
  1660. function getCurrentScope() {
  1661. return activeEffectScope;
  1662. }
  1663. const createDep = (effects) => {
  1664. const dep = new Set(effects);
  1665. dep.w = 0;
  1666. dep.n = 0;
  1667. return dep;
  1668. };
  1669. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  1670. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  1671. const initDepMarkers = ({ deps }) => {
  1672. if (deps.length) {
  1673. for (let i = 0; i < deps.length; i++) {
  1674. deps[i].w |= trackOpBit;
  1675. }
  1676. }
  1677. };
  1678. const finalizeDepMarkers = (effect) => {
  1679. const { deps } = effect;
  1680. if (deps.length) {
  1681. let ptr = 0;
  1682. for (let i = 0; i < deps.length; i++) {
  1683. const dep = deps[i];
  1684. if (wasTracked(dep) && !newTracked(dep)) {
  1685. dep.delete(effect);
  1686. } else {
  1687. deps[ptr++] = dep;
  1688. }
  1689. dep.w &= ~trackOpBit;
  1690. dep.n &= ~trackOpBit;
  1691. }
  1692. deps.length = ptr;
  1693. }
  1694. };
  1695. const targetMap = /* @__PURE__ */ new WeakMap();
  1696. let effectTrackDepth = 0;
  1697. let trackOpBit = 1;
  1698. const maxMarkerBits = 30;
  1699. let activeEffect;
  1700. const ITERATE_KEY = Symbol("iterate");
  1701. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
  1702. class ReactiveEffect {
  1703. constructor(fn, scheduler = null, scope) {
  1704. this.fn = fn;
  1705. this.scheduler = scheduler;
  1706. this.active = true;
  1707. this.deps = [];
  1708. this.parent = void 0;
  1709. recordEffectScope(this, scope);
  1710. }
  1711. run() {
  1712. if (!this.active) {
  1713. return this.fn();
  1714. }
  1715. let parent = activeEffect;
  1716. let lastShouldTrack = shouldTrack;
  1717. while (parent) {
  1718. if (parent === this) {
  1719. return;
  1720. }
  1721. parent = parent.parent;
  1722. }
  1723. try {
  1724. this.parent = activeEffect;
  1725. activeEffect = this;
  1726. shouldTrack = true;
  1727. trackOpBit = 1 << ++effectTrackDepth;
  1728. if (effectTrackDepth <= maxMarkerBits) {
  1729. initDepMarkers(this);
  1730. } else {
  1731. cleanupEffect(this);
  1732. }
  1733. return this.fn();
  1734. } finally {
  1735. if (effectTrackDepth <= maxMarkerBits) {
  1736. finalizeDepMarkers(this);
  1737. }
  1738. trackOpBit = 1 << --effectTrackDepth;
  1739. activeEffect = this.parent;
  1740. shouldTrack = lastShouldTrack;
  1741. this.parent = void 0;
  1742. if (this.deferStop) {
  1743. this.stop();
  1744. }
  1745. }
  1746. }
  1747. stop() {
  1748. if (activeEffect === this) {
  1749. this.deferStop = true;
  1750. } else if (this.active) {
  1751. cleanupEffect(this);
  1752. if (this.onStop) {
  1753. this.onStop();
  1754. }
  1755. this.active = false;
  1756. }
  1757. }
  1758. }
  1759. function cleanupEffect(effect) {
  1760. const { deps } = effect;
  1761. if (deps.length) {
  1762. for (let i = 0; i < deps.length; i++) {
  1763. deps[i].delete(effect);
  1764. }
  1765. deps.length = 0;
  1766. }
  1767. }
  1768. let shouldTrack = true;
  1769. const trackStack = [];
  1770. function pauseTracking() {
  1771. trackStack.push(shouldTrack);
  1772. shouldTrack = false;
  1773. }
  1774. function resetTracking() {
  1775. const last = trackStack.pop();
  1776. shouldTrack = last === void 0 ? true : last;
  1777. }
  1778. function track(target, type, key) {
  1779. if (shouldTrack && activeEffect) {
  1780. let depsMap = targetMap.get(target);
  1781. if (!depsMap) {
  1782. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  1783. }
  1784. let dep = depsMap.get(key);
  1785. if (!dep) {
  1786. depsMap.set(key, dep = createDep());
  1787. }
  1788. const eventInfo = { effect: activeEffect, target, type, key };
  1789. trackEffects(dep, eventInfo);
  1790. }
  1791. }
  1792. function trackEffects(dep, debuggerEventExtraInfo) {
  1793. let shouldTrack2 = false;
  1794. if (effectTrackDepth <= maxMarkerBits) {
  1795. if (!newTracked(dep)) {
  1796. dep.n |= trackOpBit;
  1797. shouldTrack2 = !wasTracked(dep);
  1798. }
  1799. } else {
  1800. shouldTrack2 = !dep.has(activeEffect);
  1801. }
  1802. if (shouldTrack2) {
  1803. dep.add(activeEffect);
  1804. activeEffect.deps.push(dep);
  1805. if (activeEffect.onTrack) {
  1806. activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
  1807. }
  1808. }
  1809. }
  1810. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  1811. const depsMap = targetMap.get(target);
  1812. if (!depsMap) {
  1813. return;
  1814. }
  1815. let deps = [];
  1816. if (type === "clear") {
  1817. deps = [...depsMap.values()];
  1818. } else if (key === "length" && isArray$1(target)) {
  1819. const newLength = Number(newValue);
  1820. depsMap.forEach((dep, key2) => {
  1821. if (key2 === "length" || key2 >= newLength) {
  1822. deps.push(dep);
  1823. }
  1824. });
  1825. } else {
  1826. if (key !== void 0) {
  1827. deps.push(depsMap.get(key));
  1828. }
  1829. switch (type) {
  1830. case "add":
  1831. if (!isArray$1(target)) {
  1832. deps.push(depsMap.get(ITERATE_KEY));
  1833. if (isMap(target)) {
  1834. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1835. }
  1836. } else if (isIntegerKey(key)) {
  1837. deps.push(depsMap.get("length"));
  1838. }
  1839. break;
  1840. case "delete":
  1841. if (!isArray$1(target)) {
  1842. deps.push(depsMap.get(ITERATE_KEY));
  1843. if (isMap(target)) {
  1844. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1845. }
  1846. }
  1847. break;
  1848. case "set":
  1849. if (isMap(target)) {
  1850. deps.push(depsMap.get(ITERATE_KEY));
  1851. }
  1852. break;
  1853. }
  1854. }
  1855. const eventInfo = { target, type, key, newValue, oldValue, oldTarget };
  1856. if (deps.length === 1) {
  1857. if (deps[0]) {
  1858. {
  1859. triggerEffects(deps[0], eventInfo);
  1860. }
  1861. }
  1862. } else {
  1863. const effects = [];
  1864. for (const dep of deps) {
  1865. if (dep) {
  1866. effects.push(...dep);
  1867. }
  1868. }
  1869. {
  1870. triggerEffects(createDep(effects), eventInfo);
  1871. }
  1872. }
  1873. }
  1874. function triggerEffects(dep, debuggerEventExtraInfo) {
  1875. const effects = isArray$1(dep) ? dep : [...dep];
  1876. for (const effect of effects) {
  1877. if (effect.computed) {
  1878. triggerEffect(effect, debuggerEventExtraInfo);
  1879. }
  1880. }
  1881. for (const effect of effects) {
  1882. if (!effect.computed) {
  1883. triggerEffect(effect, debuggerEventExtraInfo);
  1884. }
  1885. }
  1886. }
  1887. function triggerEffect(effect, debuggerEventExtraInfo) {
  1888. if (effect !== activeEffect || effect.allowRecurse) {
  1889. if (effect.onTrigger) {
  1890. effect.onTrigger(extend$1({ effect }, debuggerEventExtraInfo));
  1891. }
  1892. if (effect.scheduler) {
  1893. effect.scheduler();
  1894. } else {
  1895. effect.run();
  1896. }
  1897. }
  1898. }
  1899. function getDepFromReactive(object, key) {
  1900. var _a2;
  1901. return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key);
  1902. }
  1903. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1904. const builtInSymbols = new Set(
  1905. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1906. );
  1907. const get$1$1 = /* @__PURE__ */ createGetter();
  1908. const shallowGet = /* @__PURE__ */ createGetter(false, true);
  1909. const readonlyGet = /* @__PURE__ */ createGetter(true);
  1910. const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
  1911. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  1912. function createArrayInstrumentations() {
  1913. const instrumentations = {};
  1914. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  1915. instrumentations[key] = function(...args) {
  1916. const arr = toRaw(this);
  1917. for (let i = 0, l = this.length; i < l; i++) {
  1918. track(arr, "get", i + "");
  1919. }
  1920. const res = arr[key](...args);
  1921. if (res === -1 || res === false) {
  1922. return arr[key](...args.map(toRaw));
  1923. } else {
  1924. return res;
  1925. }
  1926. };
  1927. });
  1928. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  1929. instrumentations[key] = function(...args) {
  1930. pauseTracking();
  1931. const res = toRaw(this)[key].apply(this, args);
  1932. resetTracking();
  1933. return res;
  1934. };
  1935. });
  1936. return instrumentations;
  1937. }
  1938. function hasOwnProperty(key) {
  1939. const obj = toRaw(this);
  1940. track(obj, "has", key);
  1941. return obj.hasOwnProperty(key);
  1942. }
  1943. function createGetter(isReadonly2 = false, shallow = false) {
  1944. return function get2(target, key, receiver) {
  1945. if (key === "__v_isReactive") {
  1946. return !isReadonly2;
  1947. } else if (key === "__v_isReadonly") {
  1948. return isReadonly2;
  1949. } else if (key === "__v_isShallow") {
  1950. return shallow;
  1951. } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
  1952. return target;
  1953. }
  1954. const targetIsArray = isArray$1(target);
  1955. if (!isReadonly2) {
  1956. if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
  1957. return Reflect.get(arrayInstrumentations, key, receiver);
  1958. }
  1959. if (key === "hasOwnProperty") {
  1960. return hasOwnProperty;
  1961. }
  1962. }
  1963. const res = Reflect.get(target, key, receiver);
  1964. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1965. return res;
  1966. }
  1967. if (!isReadonly2) {
  1968. track(target, "get", key);
  1969. }
  1970. if (shallow) {
  1971. return res;
  1972. }
  1973. if (isRef(res)) {
  1974. return targetIsArray && isIntegerKey(key) ? res : res.value;
  1975. }
  1976. if (isObject$1(res)) {
  1977. return isReadonly2 ? readonly(res) : reactive(res);
  1978. }
  1979. return res;
  1980. };
  1981. }
  1982. const set$1$1 = /* @__PURE__ */ createSetter();
  1983. const shallowSet = /* @__PURE__ */ createSetter(true);
  1984. function createSetter(shallow = false) {
  1985. return function set2(target, key, value, receiver) {
  1986. let oldValue = target[key];
  1987. if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
  1988. return false;
  1989. }
  1990. if (!shallow) {
  1991. if (!isShallow(value) && !isReadonly(value)) {
  1992. oldValue = toRaw(oldValue);
  1993. value = toRaw(value);
  1994. }
  1995. if (!isArray$1(target) && isRef(oldValue) && !isRef(value)) {
  1996. oldValue.value = value;
  1997. return true;
  1998. }
  1999. }
  2000. const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  2001. const result = Reflect.set(target, key, value, receiver);
  2002. if (target === toRaw(receiver)) {
  2003. if (!hadKey) {
  2004. trigger(target, "add", key, value);
  2005. } else if (hasChanged(value, oldValue)) {
  2006. trigger(target, "set", key, value, oldValue);
  2007. }
  2008. }
  2009. return result;
  2010. };
  2011. }
  2012. function deleteProperty(target, key) {
  2013. const hadKey = hasOwn(target, key);
  2014. const oldValue = target[key];
  2015. const result = Reflect.deleteProperty(target, key);
  2016. if (result && hadKey) {
  2017. trigger(target, "delete", key, void 0, oldValue);
  2018. }
  2019. return result;
  2020. }
  2021. function has$1(target, key) {
  2022. const result = Reflect.has(target, key);
  2023. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  2024. track(target, "has", key);
  2025. }
  2026. return result;
  2027. }
  2028. function ownKeys(target) {
  2029. track(target, "iterate", isArray$1(target) ? "length" : ITERATE_KEY);
  2030. return Reflect.ownKeys(target);
  2031. }
  2032. const mutableHandlers = {
  2033. get: get$1$1,
  2034. set: set$1$1,
  2035. deleteProperty,
  2036. has: has$1,
  2037. ownKeys
  2038. };
  2039. const readonlyHandlers = {
  2040. get: readonlyGet,
  2041. set(target, key) {
  2042. {
  2043. warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
  2044. }
  2045. return true;
  2046. },
  2047. deleteProperty(target, key) {
  2048. {
  2049. warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
  2050. }
  2051. return true;
  2052. }
  2053. };
  2054. const shallowReactiveHandlers = /* @__PURE__ */ extend$1({}, mutableHandlers, {
  2055. get: shallowGet,
  2056. set: shallowSet
  2057. });
  2058. const shallowReadonlyHandlers = /* @__PURE__ */ extend$1({}, readonlyHandlers, {
  2059. get: shallowReadonlyGet
  2060. });
  2061. const toShallow = (value) => value;
  2062. const getProto = (v) => Reflect.getPrototypeOf(v);
  2063. function get$3(target, key, isReadonly2 = false, isShallow2 = false) {
  2064. target = target[
  2065. "__v_raw"
  2066. /* ReactiveFlags.RAW */
  2067. ];
  2068. const rawTarget = toRaw(target);
  2069. const rawKey = toRaw(key);
  2070. if (!isReadonly2) {
  2071. if (key !== rawKey) {
  2072. track(rawTarget, "get", key);
  2073. }
  2074. track(rawTarget, "get", rawKey);
  2075. }
  2076. const { has: has2 } = getProto(rawTarget);
  2077. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2078. if (has2.call(rawTarget, key)) {
  2079. return wrap(target.get(key));
  2080. } else if (has2.call(rawTarget, rawKey)) {
  2081. return wrap(target.get(rawKey));
  2082. } else if (target !== rawTarget) {
  2083. target.get(key);
  2084. }
  2085. }
  2086. function has(key, isReadonly2 = false) {
  2087. const target = this[
  2088. "__v_raw"
  2089. /* ReactiveFlags.RAW */
  2090. ];
  2091. const rawTarget = toRaw(target);
  2092. const rawKey = toRaw(key);
  2093. if (!isReadonly2) {
  2094. if (key !== rawKey) {
  2095. track(rawTarget, "has", key);
  2096. }
  2097. track(rawTarget, "has", rawKey);
  2098. }
  2099. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  2100. }
  2101. function size(target, isReadonly2 = false) {
  2102. target = target[
  2103. "__v_raw"
  2104. /* ReactiveFlags.RAW */
  2105. ];
  2106. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  2107. return Reflect.get(target, "size", target);
  2108. }
  2109. function add$2(value) {
  2110. value = toRaw(value);
  2111. const target = toRaw(this);
  2112. const proto2 = getProto(target);
  2113. const hadKey = proto2.has.call(target, value);
  2114. if (!hadKey) {
  2115. target.add(value);
  2116. trigger(target, "add", value, value);
  2117. }
  2118. return this;
  2119. }
  2120. function set$2(key, value) {
  2121. value = toRaw(value);
  2122. const target = toRaw(this);
  2123. const { has: has2, get: get2 } = getProto(target);
  2124. let hadKey = has2.call(target, key);
  2125. if (!hadKey) {
  2126. key = toRaw(key);
  2127. hadKey = has2.call(target, key);
  2128. } else {
  2129. checkIdentityKeys(target, has2, key);
  2130. }
  2131. const oldValue = get2.call(target, key);
  2132. target.set(key, value);
  2133. if (!hadKey) {
  2134. trigger(target, "add", key, value);
  2135. } else if (hasChanged(value, oldValue)) {
  2136. trigger(target, "set", key, value, oldValue);
  2137. }
  2138. return this;
  2139. }
  2140. function deleteEntry(key) {
  2141. const target = toRaw(this);
  2142. const { has: has2, get: get2 } = getProto(target);
  2143. let hadKey = has2.call(target, key);
  2144. if (!hadKey) {
  2145. key = toRaw(key);
  2146. hadKey = has2.call(target, key);
  2147. } else {
  2148. checkIdentityKeys(target, has2, key);
  2149. }
  2150. const oldValue = get2 ? get2.call(target, key) : void 0;
  2151. const result = target.delete(key);
  2152. if (hadKey) {
  2153. trigger(target, "delete", key, void 0, oldValue);
  2154. }
  2155. return result;
  2156. }
  2157. function clear() {
  2158. const target = toRaw(this);
  2159. const hadItems = target.size !== 0;
  2160. const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  2161. const result = target.clear();
  2162. if (hadItems) {
  2163. trigger(target, "clear", void 0, void 0, oldTarget);
  2164. }
  2165. return result;
  2166. }
  2167. function createForEach(isReadonly2, isShallow2) {
  2168. return function forEach(callback, thisArg) {
  2169. const observed = this;
  2170. const target = observed[
  2171. "__v_raw"
  2172. /* ReactiveFlags.RAW */
  2173. ];
  2174. const rawTarget = toRaw(target);
  2175. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2176. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  2177. return target.forEach((value, key) => {
  2178. return callback.call(thisArg, wrap(value), wrap(key), observed);
  2179. });
  2180. };
  2181. }
  2182. function createIterableMethod(method, isReadonly2, isShallow2) {
  2183. return function(...args) {
  2184. const target = this[
  2185. "__v_raw"
  2186. /* ReactiveFlags.RAW */
  2187. ];
  2188. const rawTarget = toRaw(target);
  2189. const targetIsMap = isMap(rawTarget);
  2190. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  2191. const isKeyOnly = method === "keys" && targetIsMap;
  2192. const innerIterator = target[method](...args);
  2193. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2194. !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
  2195. return {
  2196. // iterator protocol
  2197. next() {
  2198. const { value, done } = innerIterator.next();
  2199. return done ? { value, done } : {
  2200. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  2201. done
  2202. };
  2203. },
  2204. // iterable protocol
  2205. [Symbol.iterator]() {
  2206. return this;
  2207. }
  2208. };
  2209. };
  2210. }
  2211. function createReadonlyMethod(type) {
  2212. return function(...args) {
  2213. {
  2214. const key = args[0] ? `on key "${args[0]}" ` : ``;
  2215. console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
  2216. }
  2217. return type === "delete" ? false : this;
  2218. };
  2219. }
  2220. function createInstrumentations() {
  2221. const mutableInstrumentations2 = {
  2222. get(key) {
  2223. return get$3(this, key);
  2224. },
  2225. get size() {
  2226. return size(this);
  2227. },
  2228. has,
  2229. add: add$2,
  2230. set: set$2,
  2231. delete: deleteEntry,
  2232. clear,
  2233. forEach: createForEach(false, false)
  2234. };
  2235. const shallowInstrumentations2 = {
  2236. get(key) {
  2237. return get$3(this, key, false, true);
  2238. },
  2239. get size() {
  2240. return size(this);
  2241. },
  2242. has,
  2243. add: add$2,
  2244. set: set$2,
  2245. delete: deleteEntry,
  2246. clear,
  2247. forEach: createForEach(false, true)
  2248. };
  2249. const readonlyInstrumentations2 = {
  2250. get(key) {
  2251. return get$3(this, key, true);
  2252. },
  2253. get size() {
  2254. return size(this, true);
  2255. },
  2256. has(key) {
  2257. return has.call(this, key, true);
  2258. },
  2259. add: createReadonlyMethod(
  2260. "add"
  2261. /* TriggerOpTypes.ADD */
  2262. ),
  2263. set: createReadonlyMethod(
  2264. "set"
  2265. /* TriggerOpTypes.SET */
  2266. ),
  2267. delete: createReadonlyMethod(
  2268. "delete"
  2269. /* TriggerOpTypes.DELETE */
  2270. ),
  2271. clear: createReadonlyMethod(
  2272. "clear"
  2273. /* TriggerOpTypes.CLEAR */
  2274. ),
  2275. forEach: createForEach(true, false)
  2276. };
  2277. const shallowReadonlyInstrumentations2 = {
  2278. get(key) {
  2279. return get$3(this, key, true, true);
  2280. },
  2281. get size() {
  2282. return size(this, true);
  2283. },
  2284. has(key) {
  2285. return has.call(this, key, true);
  2286. },
  2287. add: createReadonlyMethod(
  2288. "add"
  2289. /* TriggerOpTypes.ADD */
  2290. ),
  2291. set: createReadonlyMethod(
  2292. "set"
  2293. /* TriggerOpTypes.SET */
  2294. ),
  2295. delete: createReadonlyMethod(
  2296. "delete"
  2297. /* TriggerOpTypes.DELETE */
  2298. ),
  2299. clear: createReadonlyMethod(
  2300. "clear"
  2301. /* TriggerOpTypes.CLEAR */
  2302. ),
  2303. forEach: createForEach(true, true)
  2304. };
  2305. const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
  2306. iteratorMethods.forEach((method) => {
  2307. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  2308. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  2309. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  2310. shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
  2311. });
  2312. return [
  2313. mutableInstrumentations2,
  2314. readonlyInstrumentations2,
  2315. shallowInstrumentations2,
  2316. shallowReadonlyInstrumentations2
  2317. ];
  2318. }
  2319. const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
  2320. function createInstrumentationGetter(isReadonly2, shallow) {
  2321. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  2322. return (target, key, receiver) => {
  2323. if (key === "__v_isReactive") {
  2324. return !isReadonly2;
  2325. } else if (key === "__v_isReadonly") {
  2326. return isReadonly2;
  2327. } else if (key === "__v_raw") {
  2328. return target;
  2329. }
  2330. return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
  2331. };
  2332. }
  2333. const mutableCollectionHandlers = {
  2334. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  2335. };
  2336. const shallowCollectionHandlers = {
  2337. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  2338. };
  2339. const readonlyCollectionHandlers = {
  2340. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  2341. };
  2342. const shallowReadonlyCollectionHandlers = {
  2343. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  2344. };
  2345. function checkIdentityKeys(target, has2, key) {
  2346. const rawKey = toRaw(key);
  2347. if (rawKey !== key && has2.call(target, rawKey)) {
  2348. const type = toRawType(target);
  2349. console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
  2350. }
  2351. }
  2352. const reactiveMap = /* @__PURE__ */ new WeakMap();
  2353. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  2354. const readonlyMap = /* @__PURE__ */ new WeakMap();
  2355. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  2356. function targetTypeMap(rawType) {
  2357. switch (rawType) {
  2358. case "Object":
  2359. case "Array":
  2360. return 1;
  2361. case "Map":
  2362. case "Set":
  2363. case "WeakMap":
  2364. case "WeakSet":
  2365. return 2;
  2366. default:
  2367. return 0;
  2368. }
  2369. }
  2370. function getTargetType(value) {
  2371. return value[
  2372. "__v_skip"
  2373. /* ReactiveFlags.SKIP */
  2374. ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  2375. }
  2376. function reactive(target) {
  2377. if (isReadonly(target)) {
  2378. return target;
  2379. }
  2380. return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
  2381. }
  2382. function shallowReactive(target) {
  2383. return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
  2384. }
  2385. function readonly(target) {
  2386. return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
  2387. }
  2388. function shallowReadonly(target) {
  2389. return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
  2390. }
  2391. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  2392. if (!isObject$1(target)) {
  2393. {
  2394. console.warn(`value cannot be made reactive: ${String(target)}`);
  2395. }
  2396. return target;
  2397. }
  2398. if (target[
  2399. "__v_raw"
  2400. /* ReactiveFlags.RAW */
  2401. ] && !(isReadonly2 && target[
  2402. "__v_isReactive"
  2403. /* ReactiveFlags.IS_REACTIVE */
  2404. ])) {
  2405. return target;
  2406. }
  2407. const existingProxy = proxyMap.get(target);
  2408. if (existingProxy) {
  2409. return existingProxy;
  2410. }
  2411. const targetType = getTargetType(target);
  2412. if (targetType === 0) {
  2413. return target;
  2414. }
  2415. const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
  2416. proxyMap.set(target, proxy);
  2417. return proxy;
  2418. }
  2419. function isReactive(value) {
  2420. if (isReadonly(value)) {
  2421. return isReactive(value[
  2422. "__v_raw"
  2423. /* ReactiveFlags.RAW */
  2424. ]);
  2425. }
  2426. return !!(value && value[
  2427. "__v_isReactive"
  2428. /* ReactiveFlags.IS_REACTIVE */
  2429. ]);
  2430. }
  2431. function isReadonly(value) {
  2432. return !!(value && value[
  2433. "__v_isReadonly"
  2434. /* ReactiveFlags.IS_READONLY */
  2435. ]);
  2436. }
  2437. function isShallow(value) {
  2438. return !!(value && value[
  2439. "__v_isShallow"
  2440. /* ReactiveFlags.IS_SHALLOW */
  2441. ]);
  2442. }
  2443. function isProxy(value) {
  2444. return isReactive(value) || isReadonly(value);
  2445. }
  2446. function toRaw(observed) {
  2447. const raw = observed && observed[
  2448. "__v_raw"
  2449. /* ReactiveFlags.RAW */
  2450. ];
  2451. return raw ? toRaw(raw) : observed;
  2452. }
  2453. function markRaw(value) {
  2454. def(value, "__v_skip", true);
  2455. return value;
  2456. }
  2457. const toReactive = (value) => isObject$1(value) ? reactive(value) : value;
  2458. const toReadonly = (value) => isObject$1(value) ? readonly(value) : value;
  2459. function trackRefValue(ref2) {
  2460. if (shouldTrack && activeEffect) {
  2461. ref2 = toRaw(ref2);
  2462. {
  2463. trackEffects(ref2.dep || (ref2.dep = createDep()), {
  2464. target: ref2,
  2465. type: "get",
  2466. key: "value"
  2467. });
  2468. }
  2469. }
  2470. }
  2471. function triggerRefValue(ref2, newVal) {
  2472. ref2 = toRaw(ref2);
  2473. const dep = ref2.dep;
  2474. if (dep) {
  2475. {
  2476. triggerEffects(dep, {
  2477. target: ref2,
  2478. type: "set",
  2479. key: "value",
  2480. newValue: newVal
  2481. });
  2482. }
  2483. }
  2484. }
  2485. function isRef(r) {
  2486. return !!(r && r.__v_isRef === true);
  2487. }
  2488. function ref(value) {
  2489. return createRef(value, false);
  2490. }
  2491. function createRef(rawValue, shallow) {
  2492. if (isRef(rawValue)) {
  2493. return rawValue;
  2494. }
  2495. return new RefImpl(rawValue, shallow);
  2496. }
  2497. class RefImpl {
  2498. constructor(value, __v_isShallow) {
  2499. this.__v_isShallow = __v_isShallow;
  2500. this.dep = void 0;
  2501. this.__v_isRef = true;
  2502. this._rawValue = __v_isShallow ? value : toRaw(value);
  2503. this._value = __v_isShallow ? value : toReactive(value);
  2504. }
  2505. get value() {
  2506. trackRefValue(this);
  2507. return this._value;
  2508. }
  2509. set value(newVal) {
  2510. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  2511. newVal = useDirectValue ? newVal : toRaw(newVal);
  2512. if (hasChanged(newVal, this._rawValue)) {
  2513. this._rawValue = newVal;
  2514. this._value = useDirectValue ? newVal : toReactive(newVal);
  2515. triggerRefValue(this, newVal);
  2516. }
  2517. }
  2518. }
  2519. function unref(ref2) {
  2520. return isRef(ref2) ? ref2.value : ref2;
  2521. }
  2522. const shallowUnwrapHandlers = {
  2523. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  2524. set: (target, key, value, receiver) => {
  2525. const oldValue = target[key];
  2526. if (isRef(oldValue) && !isRef(value)) {
  2527. oldValue.value = value;
  2528. return true;
  2529. } else {
  2530. return Reflect.set(target, key, value, receiver);
  2531. }
  2532. }
  2533. };
  2534. function proxyRefs(objectWithRefs) {
  2535. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  2536. }
  2537. function toRefs(object) {
  2538. if (!isProxy(object)) {
  2539. console.warn(`toRefs() expects a reactive object but received a plain one.`);
  2540. }
  2541. const ret = isArray$1(object) ? new Array(object.length) : {};
  2542. for (const key in object) {
  2543. ret[key] = toRef(object, key);
  2544. }
  2545. return ret;
  2546. }
  2547. class ObjectRefImpl {
  2548. constructor(_object, _key, _defaultValue) {
  2549. this._object = _object;
  2550. this._key = _key;
  2551. this._defaultValue = _defaultValue;
  2552. this.__v_isRef = true;
  2553. }
  2554. get value() {
  2555. const val = this._object[this._key];
  2556. return val === void 0 ? this._defaultValue : val;
  2557. }
  2558. set value(newVal) {
  2559. this._object[this._key] = newVal;
  2560. }
  2561. get dep() {
  2562. return getDepFromReactive(toRaw(this._object), this._key);
  2563. }
  2564. }
  2565. function toRef(object, key, defaultValue) {
  2566. const val = object[key];
  2567. return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
  2568. }
  2569. var _a;
  2570. class ComputedRefImpl {
  2571. constructor(getter, _setter, isReadonly2, isSSR) {
  2572. this._setter = _setter;
  2573. this.dep = void 0;
  2574. this.__v_isRef = true;
  2575. this[_a] = false;
  2576. this._dirty = true;
  2577. this.effect = new ReactiveEffect(getter, () => {
  2578. if (!this._dirty) {
  2579. this._dirty = true;
  2580. triggerRefValue(this);
  2581. }
  2582. });
  2583. this.effect.computed = this;
  2584. this.effect.active = this._cacheable = !isSSR;
  2585. this[
  2586. "__v_isReadonly"
  2587. /* ReactiveFlags.IS_READONLY */
  2588. ] = isReadonly2;
  2589. }
  2590. get value() {
  2591. const self = toRaw(this);
  2592. trackRefValue(self);
  2593. if (self._dirty || !self._cacheable) {
  2594. self._dirty = false;
  2595. self._value = self.effect.run();
  2596. }
  2597. return self._value;
  2598. }
  2599. set value(newValue) {
  2600. this._setter(newValue);
  2601. }
  2602. }
  2603. _a = "__v_isReadonly";
  2604. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  2605. let getter;
  2606. let setter;
  2607. const onlyGetter = isFunction$1(getterOrOptions);
  2608. if (onlyGetter) {
  2609. getter = getterOrOptions;
  2610. setter = () => {
  2611. console.warn("Write operation failed: computed value is readonly");
  2612. };
  2613. } else {
  2614. getter = getterOrOptions.get;
  2615. setter = getterOrOptions.set;
  2616. }
  2617. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  2618. if (debugOptions && !isSSR) {
  2619. cRef.effect.onTrack = debugOptions.onTrack;
  2620. cRef.effect.onTrigger = debugOptions.onTrigger;
  2621. }
  2622. return cRef;
  2623. }
  2624. const stack = [];
  2625. function pushWarningContext(vnode) {
  2626. stack.push(vnode);
  2627. }
  2628. function popWarningContext() {
  2629. stack.pop();
  2630. }
  2631. function warn$2(msg, ...args) {
  2632. pauseTracking();
  2633. const instance = stack.length ? stack[stack.length - 1].component : null;
  2634. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2635. const trace = getComponentTrace();
  2636. if (appWarnHandler) {
  2637. callWithErrorHandling(appWarnHandler, instance, 11, [
  2638. msg + args.join(""),
  2639. instance && instance.proxy,
  2640. trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
  2641. trace
  2642. ]);
  2643. } else {
  2644. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2645. if (trace.length && // avoid spamming console during tests
  2646. true) {
  2647. warnArgs.push(`
  2648. `, ...formatTrace(trace));
  2649. }
  2650. console.warn(...warnArgs);
  2651. }
  2652. resetTracking();
  2653. }
  2654. function getComponentTrace() {
  2655. let currentVNode = stack[stack.length - 1];
  2656. if (!currentVNode) {
  2657. return [];
  2658. }
  2659. const normalizedStack = [];
  2660. while (currentVNode) {
  2661. const last = normalizedStack[0];
  2662. if (last && last.vnode === currentVNode) {
  2663. last.recurseCount++;
  2664. } else {
  2665. normalizedStack.push({
  2666. vnode: currentVNode,
  2667. recurseCount: 0
  2668. });
  2669. }
  2670. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2671. currentVNode = parentInstance && parentInstance.vnode;
  2672. }
  2673. return normalizedStack;
  2674. }
  2675. function formatTrace(trace) {
  2676. const logs = [];
  2677. trace.forEach((entry, i) => {
  2678. logs.push(...i === 0 ? [] : [`
  2679. `], ...formatTraceEntry(entry));
  2680. });
  2681. return logs;
  2682. }
  2683. function formatTraceEntry({ vnode, recurseCount }) {
  2684. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2685. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2686. const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
  2687. const close = `>` + postfix;
  2688. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2689. }
  2690. function formatProps(props) {
  2691. const res = [];
  2692. const keys2 = Object.keys(props);
  2693. keys2.slice(0, 3).forEach((key) => {
  2694. res.push(...formatProp(key, props[key]));
  2695. });
  2696. if (keys2.length > 3) {
  2697. res.push(` ...`);
  2698. }
  2699. return res;
  2700. }
  2701. function formatProp(key, value, raw) {
  2702. if (isString$1(value)) {
  2703. value = JSON.stringify(value);
  2704. return raw ? value : [`${key}=${value}`];
  2705. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2706. return raw ? value : [`${key}=${value}`];
  2707. } else if (isRef(value)) {
  2708. value = formatProp(key, toRaw(value.value), true);
  2709. return raw ? value : [`${key}=Ref<`, value, `>`];
  2710. } else if (isFunction$1(value)) {
  2711. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2712. } else {
  2713. value = toRaw(value);
  2714. return raw ? value : [`${key}=`, value];
  2715. }
  2716. }
  2717. const ErrorTypeStrings = {
  2718. [
  2719. "sp"
  2720. /* LifecycleHooks.SERVER_PREFETCH */
  2721. ]: "serverPrefetch hook",
  2722. [
  2723. "bc"
  2724. /* LifecycleHooks.BEFORE_CREATE */
  2725. ]: "beforeCreate hook",
  2726. [
  2727. "c"
  2728. /* LifecycleHooks.CREATED */
  2729. ]: "created hook",
  2730. [
  2731. "bm"
  2732. /* LifecycleHooks.BEFORE_MOUNT */
  2733. ]: "beforeMount hook",
  2734. [
  2735. "m"
  2736. /* LifecycleHooks.MOUNTED */
  2737. ]: "mounted hook",
  2738. [
  2739. "bu"
  2740. /* LifecycleHooks.BEFORE_UPDATE */
  2741. ]: "beforeUpdate hook",
  2742. [
  2743. "u"
  2744. /* LifecycleHooks.UPDATED */
  2745. ]: "updated",
  2746. [
  2747. "bum"
  2748. /* LifecycleHooks.BEFORE_UNMOUNT */
  2749. ]: "beforeUnmount hook",
  2750. [
  2751. "um"
  2752. /* LifecycleHooks.UNMOUNTED */
  2753. ]: "unmounted hook",
  2754. [
  2755. "a"
  2756. /* LifecycleHooks.ACTIVATED */
  2757. ]: "activated hook",
  2758. [
  2759. "da"
  2760. /* LifecycleHooks.DEACTIVATED */
  2761. ]: "deactivated hook",
  2762. [
  2763. "ec"
  2764. /* LifecycleHooks.ERROR_CAPTURED */
  2765. ]: "errorCaptured hook",
  2766. [
  2767. "rtc"
  2768. /* LifecycleHooks.RENDER_TRACKED */
  2769. ]: "renderTracked hook",
  2770. [
  2771. "rtg"
  2772. /* LifecycleHooks.RENDER_TRIGGERED */
  2773. ]: "renderTriggered hook",
  2774. [
  2775. 0
  2776. /* ErrorCodes.SETUP_FUNCTION */
  2777. ]: "setup function",
  2778. [
  2779. 1
  2780. /* ErrorCodes.RENDER_FUNCTION */
  2781. ]: "render function",
  2782. [
  2783. 2
  2784. /* ErrorCodes.WATCH_GETTER */
  2785. ]: "watcher getter",
  2786. [
  2787. 3
  2788. /* ErrorCodes.WATCH_CALLBACK */
  2789. ]: "watcher callback",
  2790. [
  2791. 4
  2792. /* ErrorCodes.WATCH_CLEANUP */
  2793. ]: "watcher cleanup function",
  2794. [
  2795. 5
  2796. /* ErrorCodes.NATIVE_EVENT_HANDLER */
  2797. ]: "native event handler",
  2798. [
  2799. 6
  2800. /* ErrorCodes.COMPONENT_EVENT_HANDLER */
  2801. ]: "component event handler",
  2802. [
  2803. 7
  2804. /* ErrorCodes.VNODE_HOOK */
  2805. ]: "vnode hook",
  2806. [
  2807. 8
  2808. /* ErrorCodes.DIRECTIVE_HOOK */
  2809. ]: "directive hook",
  2810. [
  2811. 9
  2812. /* ErrorCodes.TRANSITION_HOOK */
  2813. ]: "transition hook",
  2814. [
  2815. 10
  2816. /* ErrorCodes.APP_ERROR_HANDLER */
  2817. ]: "app errorHandler",
  2818. [
  2819. 11
  2820. /* ErrorCodes.APP_WARN_HANDLER */
  2821. ]: "app warnHandler",
  2822. [
  2823. 12
  2824. /* ErrorCodes.FUNCTION_REF */
  2825. ]: "ref function",
  2826. [
  2827. 13
  2828. /* ErrorCodes.ASYNC_COMPONENT_LOADER */
  2829. ]: "async component loader",
  2830. [
  2831. 14
  2832. /* ErrorCodes.SCHEDULER */
  2833. ]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
  2834. };
  2835. function callWithErrorHandling(fn, instance, type, args) {
  2836. let res;
  2837. try {
  2838. res = args ? fn(...args) : fn();
  2839. } catch (err) {
  2840. handleError(err, instance, type);
  2841. }
  2842. return res;
  2843. }
  2844. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2845. if (isFunction$1(fn)) {
  2846. const res = callWithErrorHandling(fn, instance, type, args);
  2847. if (res && isPromise(res)) {
  2848. res.catch((err) => {
  2849. handleError(err, instance, type);
  2850. });
  2851. }
  2852. return res;
  2853. }
  2854. const values = [];
  2855. for (let i = 0; i < fn.length; i++) {
  2856. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2857. }
  2858. return values;
  2859. }
  2860. function handleError(err, instance, type, throwInDev = true) {
  2861. const contextVNode = instance ? instance.vnode : null;
  2862. if (instance) {
  2863. let cur = instance.parent;
  2864. const exposedInstance = instance.proxy;
  2865. const errorInfo = ErrorTypeStrings[type] || type;
  2866. while (cur) {
  2867. const errorCapturedHooks = cur.ec;
  2868. if (errorCapturedHooks) {
  2869. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2870. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2871. return;
  2872. }
  2873. }
  2874. }
  2875. cur = cur.parent;
  2876. }
  2877. const appErrorHandler = instance.appContext.config.errorHandler;
  2878. if (appErrorHandler) {
  2879. callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
  2880. return;
  2881. }
  2882. }
  2883. logError(err, type, contextVNode, throwInDev);
  2884. }
  2885. function logError(err, type, contextVNode, throwInDev = true) {
  2886. {
  2887. const info = ErrorTypeStrings[type] || type;
  2888. if (contextVNode) {
  2889. pushWarningContext(contextVNode);
  2890. }
  2891. warn$2(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2892. if (contextVNode) {
  2893. popWarningContext();
  2894. }
  2895. if (throwInDev) {
  2896. console.error(err);
  2897. } else {
  2898. console.error(err);
  2899. }
  2900. }
  2901. }
  2902. let isFlushing = false;
  2903. let isFlushPending = false;
  2904. const queue = [];
  2905. let flushIndex = 0;
  2906. const pendingPostFlushCbs = [];
  2907. let activePostFlushCbs = null;
  2908. let postFlushIndex = 0;
  2909. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2910. let currentFlushPromise = null;
  2911. const RECURSION_LIMIT = 100;
  2912. function nextTick$1(fn) {
  2913. const p2 = currentFlushPromise || resolvedPromise;
  2914. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  2915. }
  2916. function findInsertionIndex(id) {
  2917. let start = flushIndex + 1;
  2918. let end = queue.length;
  2919. while (start < end) {
  2920. const middle = start + end >>> 1;
  2921. const middleJobId = getId(queue[middle]);
  2922. middleJobId < id ? start = middle + 1 : end = middle;
  2923. }
  2924. return start;
  2925. }
  2926. function queueJob(job) {
  2927. if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
  2928. if (job.id == null) {
  2929. queue.push(job);
  2930. } else {
  2931. queue.splice(findInsertionIndex(job.id), 0, job);
  2932. }
  2933. queueFlush();
  2934. }
  2935. }
  2936. function queueFlush() {
  2937. if (!isFlushing && !isFlushPending) {
  2938. isFlushPending = true;
  2939. currentFlushPromise = resolvedPromise.then(flushJobs);
  2940. }
  2941. }
  2942. function hasQueueJob(job) {
  2943. return queue.indexOf(job) > -1;
  2944. }
  2945. function invalidateJob(job) {
  2946. const i = queue.indexOf(job);
  2947. if (i > flushIndex) {
  2948. queue.splice(i, 1);
  2949. }
  2950. }
  2951. function queuePostFlushCb(cb) {
  2952. if (!isArray$1(cb)) {
  2953. if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
  2954. pendingPostFlushCbs.push(cb);
  2955. }
  2956. } else {
  2957. pendingPostFlushCbs.push(...cb);
  2958. }
  2959. queueFlush();
  2960. }
  2961. function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
  2962. {
  2963. seen = seen || /* @__PURE__ */ new Map();
  2964. }
  2965. for (; i < queue.length; i++) {
  2966. const cb = queue[i];
  2967. if (cb && cb.pre) {
  2968. if (checkRecursiveUpdates(seen, cb)) {
  2969. continue;
  2970. }
  2971. queue.splice(i, 1);
  2972. i--;
  2973. cb();
  2974. }
  2975. }
  2976. }
  2977. function flushPostFlushCbs(seen) {
  2978. if (pendingPostFlushCbs.length) {
  2979. const deduped = [...new Set(pendingPostFlushCbs)];
  2980. pendingPostFlushCbs.length = 0;
  2981. if (activePostFlushCbs) {
  2982. activePostFlushCbs.push(...deduped);
  2983. return;
  2984. }
  2985. activePostFlushCbs = deduped;
  2986. {
  2987. seen = seen || /* @__PURE__ */ new Map();
  2988. }
  2989. activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
  2990. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2991. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  2992. continue;
  2993. }
  2994. activePostFlushCbs[postFlushIndex]();
  2995. }
  2996. activePostFlushCbs = null;
  2997. postFlushIndex = 0;
  2998. }
  2999. }
  3000. const getId = (job) => job.id == null ? Infinity : job.id;
  3001. const comparator = (a, b) => {
  3002. const diff2 = getId(a) - getId(b);
  3003. if (diff2 === 0) {
  3004. if (a.pre && !b.pre)
  3005. return -1;
  3006. if (b.pre && !a.pre)
  3007. return 1;
  3008. }
  3009. return diff2;
  3010. };
  3011. function flushJobs(seen) {
  3012. isFlushPending = false;
  3013. isFlushing = true;
  3014. {
  3015. seen = seen || /* @__PURE__ */ new Map();
  3016. }
  3017. queue.sort(comparator);
  3018. const check = (job) => checkRecursiveUpdates(seen, job);
  3019. try {
  3020. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  3021. const job = queue[flushIndex];
  3022. if (job && job.active !== false) {
  3023. if (check(job)) {
  3024. continue;
  3025. }
  3026. callWithErrorHandling(
  3027. job,
  3028. null,
  3029. 14
  3030. /* ErrorCodes.SCHEDULER */
  3031. );
  3032. }
  3033. }
  3034. } finally {
  3035. flushIndex = 0;
  3036. queue.length = 0;
  3037. flushPostFlushCbs(seen);
  3038. isFlushing = false;
  3039. currentFlushPromise = null;
  3040. if (queue.length || pendingPostFlushCbs.length) {
  3041. flushJobs(seen);
  3042. }
  3043. }
  3044. }
  3045. function checkRecursiveUpdates(seen, fn) {
  3046. if (!seen.has(fn)) {
  3047. seen.set(fn, 1);
  3048. } else {
  3049. const count = seen.get(fn);
  3050. if (count > RECURSION_LIMIT) {
  3051. const instance = fn.ownerInstance;
  3052. const componentName = instance && getComponentName(instance.type);
  3053. warn$2(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`);
  3054. return true;
  3055. } else {
  3056. seen.set(fn, count + 1);
  3057. }
  3058. }
  3059. }
  3060. let devtools;
  3061. let buffer = [];
  3062. let devtoolsNotInstalled = false;
  3063. function emit$1(event, ...args) {
  3064. if (devtools) {
  3065. devtools.emit(event, ...args);
  3066. } else if (!devtoolsNotInstalled) {
  3067. buffer.push({ event, args });
  3068. }
  3069. }
  3070. function setDevtoolsHook(hook, target) {
  3071. var _a2, _b;
  3072. devtools = hook;
  3073. if (devtools) {
  3074. devtools.enabled = true;
  3075. buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
  3076. buffer = [];
  3077. } else if (
  3078. // handle late devtools injection - only do this if we are in an actual
  3079. // browser environment to avoid the timer handle stalling test runner exit
  3080. // (#4815)
  3081. typeof window !== "undefined" && // some envs mock window but not fully
  3082. // eslint-disable-next-line no-restricted-globals
  3083. window.HTMLElement && // also exclude jsdom
  3084. // eslint-disable-next-line no-restricted-globals
  3085. !((_b = (_a2 = window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent) === null || _b === void 0 ? void 0 : _b.includes("jsdom"))
  3086. ) {
  3087. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  3088. replay.push((newHook) => {
  3089. setDevtoolsHook(newHook, target);
  3090. });
  3091. setTimeout(() => {
  3092. if (!devtools) {
  3093. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  3094. devtoolsNotInstalled = true;
  3095. buffer = [];
  3096. }
  3097. }, 3e3);
  3098. } else {
  3099. devtoolsNotInstalled = true;
  3100. buffer = [];
  3101. }
  3102. }
  3103. function devtoolsInitApp(app, version2) {
  3104. emit$1("app:init", app, version2, {
  3105. Fragment,
  3106. Text,
  3107. Comment,
  3108. Static
  3109. });
  3110. }
  3111. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  3112. "component:added"
  3113. /* DevtoolsHooks.COMPONENT_ADDED */
  3114. );
  3115. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  3116. "component:updated"
  3117. /* DevtoolsHooks.COMPONENT_UPDATED */
  3118. );
  3119. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  3120. "component:removed"
  3121. /* DevtoolsHooks.COMPONENT_REMOVED */
  3122. );
  3123. const devtoolsComponentRemoved = (component) => {
  3124. if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  3125. !devtools.cleanupBuffer(component)) {
  3126. _devtoolsComponentRemoved(component);
  3127. }
  3128. };
  3129. function createDevtoolsComponentHook(hook) {
  3130. return (component) => {
  3131. emit$1(
  3132. hook,
  3133. component.appContext.app,
  3134. component.uid,
  3135. // fixed by xxxxxx
  3136. // 为 0 是 App,无 parent 是 Page 指向 App
  3137. component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
  3138. component
  3139. );
  3140. };
  3141. }
  3142. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  3143. "perf:start"
  3144. /* DevtoolsHooks.PERFORMANCE_START */
  3145. );
  3146. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  3147. "perf:end"
  3148. /* DevtoolsHooks.PERFORMANCE_END */
  3149. );
  3150. function createDevtoolsPerformanceHook(hook) {
  3151. return (component, type, time) => {
  3152. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  3153. };
  3154. }
  3155. function devtoolsComponentEmit(component, event, params) {
  3156. emit$1("component:emit", component.appContext.app, component, event, params);
  3157. }
  3158. function emit(instance, event, ...rawArgs) {
  3159. if (instance.isUnmounted)
  3160. return;
  3161. const props = instance.vnode.props || EMPTY_OBJ;
  3162. {
  3163. const { emitsOptions, propsOptions: [propsOptions] } = instance;
  3164. if (emitsOptions) {
  3165. if (!(event in emitsOptions) && true) {
  3166. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  3167. warn$2(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`);
  3168. }
  3169. } else {
  3170. const validator = emitsOptions[event];
  3171. if (isFunction$1(validator)) {
  3172. const isValid2 = validator(...rawArgs);
  3173. if (!isValid2) {
  3174. warn$2(`Invalid event arguments: event validation failed for event "${event}".`);
  3175. }
  3176. }
  3177. }
  3178. }
  3179. }
  3180. let args = rawArgs;
  3181. const isModelListener2 = event.startsWith("update:");
  3182. const modelArg = isModelListener2 && event.slice(7);
  3183. if (modelArg && modelArg in props) {
  3184. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  3185. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  3186. if (trim) {
  3187. args = rawArgs.map((a) => isString$1(a) ? a.trim() : a);
  3188. }
  3189. if (number) {
  3190. args = rawArgs.map(looseToNumber);
  3191. }
  3192. }
  3193. {
  3194. devtoolsComponentEmit(instance, event, args);
  3195. }
  3196. {
  3197. const lowerCaseEvent = event.toLowerCase();
  3198. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  3199. warn$2(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`);
  3200. }
  3201. }
  3202. let handlerName;
  3203. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  3204. props[handlerName = toHandlerKey(camelize(event))];
  3205. if (!handler && isModelListener2) {
  3206. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  3207. }
  3208. if (handler) {
  3209. callWithAsyncErrorHandling(handler, instance, 6, args);
  3210. }
  3211. const onceHandler = props[handlerName + `Once`];
  3212. if (onceHandler) {
  3213. if (!instance.emitted) {
  3214. instance.emitted = {};
  3215. } else if (instance.emitted[handlerName]) {
  3216. return;
  3217. }
  3218. instance.emitted[handlerName] = true;
  3219. callWithAsyncErrorHandling(onceHandler, instance, 6, args);
  3220. }
  3221. }
  3222. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  3223. const cache = appContext.emitsCache;
  3224. const cached = cache.get(comp);
  3225. if (cached !== void 0) {
  3226. return cached;
  3227. }
  3228. const raw = comp.emits;
  3229. let normalized = {};
  3230. let hasExtends = false;
  3231. if (!isFunction$1(comp)) {
  3232. const extendEmits = (raw2) => {
  3233. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  3234. if (normalizedFromExtend) {
  3235. hasExtends = true;
  3236. extend$1(normalized, normalizedFromExtend);
  3237. }
  3238. };
  3239. if (!asMixin && appContext.mixins.length) {
  3240. appContext.mixins.forEach(extendEmits);
  3241. }
  3242. if (comp.extends) {
  3243. extendEmits(comp.extends);
  3244. }
  3245. if (comp.mixins) {
  3246. comp.mixins.forEach(extendEmits);
  3247. }
  3248. }
  3249. if (!raw && !hasExtends) {
  3250. if (isObject$1(comp)) {
  3251. cache.set(comp, null);
  3252. }
  3253. return null;
  3254. }
  3255. if (isArray$1(raw)) {
  3256. raw.forEach((key) => normalized[key] = null);
  3257. } else {
  3258. extend$1(normalized, raw);
  3259. }
  3260. if (isObject$1(comp)) {
  3261. cache.set(comp, normalized);
  3262. }
  3263. return normalized;
  3264. }
  3265. function isEmitListener(options, key) {
  3266. if (!options || !isOn(key)) {
  3267. return false;
  3268. }
  3269. key = key.slice(2).replace(/Once$/, "");
  3270. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  3271. }
  3272. let currentRenderingInstance = null;
  3273. function setCurrentRenderingInstance(instance) {
  3274. const prev = currentRenderingInstance;
  3275. currentRenderingInstance = instance;
  3276. instance && instance.type.__scopeId || null;
  3277. return prev;
  3278. }
  3279. function provide(key, value) {
  3280. if (!currentInstance) {
  3281. {
  3282. warn$2(`provide() can only be used inside setup().`);
  3283. }
  3284. } else {
  3285. let provides = currentInstance.provides;
  3286. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  3287. if (parentProvides === provides) {
  3288. provides = currentInstance.provides = Object.create(parentProvides);
  3289. }
  3290. provides[key] = value;
  3291. if (currentInstance.type.mpType === "app") {
  3292. currentInstance.appContext.app.provide(key, value);
  3293. }
  3294. }
  3295. }
  3296. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  3297. const instance = currentInstance || currentRenderingInstance;
  3298. if (instance) {
  3299. const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
  3300. if (provides && key in provides) {
  3301. return provides[key];
  3302. } else if (arguments.length > 1) {
  3303. return treatDefaultAsFactory && isFunction$1(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
  3304. } else {
  3305. warn$2(`injection "${String(key)}" not found.`);
  3306. }
  3307. } else {
  3308. warn$2(`inject() can only be used inside setup() or functional components.`);
  3309. }
  3310. }
  3311. const INITIAL_WATCHER_VALUE = {};
  3312. function watch(source, cb, options) {
  3313. if (!isFunction$1(cb)) {
  3314. warn$2(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
  3315. }
  3316. return doWatch(source, cb, options);
  3317. }
  3318. function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
  3319. if (!cb) {
  3320. if (immediate !== void 0) {
  3321. warn$2(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
  3322. }
  3323. if (deep !== void 0) {
  3324. warn$2(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
  3325. }
  3326. }
  3327. const warnInvalidSource = (s2) => {
  3328. warn$2(`Invalid watch source: `, s2, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
  3329. };
  3330. const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
  3331. let getter;
  3332. let forceTrigger = false;
  3333. let isMultiSource = false;
  3334. if (isRef(source)) {
  3335. getter = () => source.value;
  3336. forceTrigger = isShallow(source);
  3337. } else if (isReactive(source)) {
  3338. getter = () => source;
  3339. deep = true;
  3340. } else if (isArray$1(source)) {
  3341. isMultiSource = true;
  3342. forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
  3343. getter = () => source.map((s2) => {
  3344. if (isRef(s2)) {
  3345. return s2.value;
  3346. } else if (isReactive(s2)) {
  3347. return traverse(s2);
  3348. } else if (isFunction$1(s2)) {
  3349. return callWithErrorHandling(
  3350. s2,
  3351. instance,
  3352. 2
  3353. /* ErrorCodes.WATCH_GETTER */
  3354. );
  3355. } else {
  3356. warnInvalidSource(s2);
  3357. }
  3358. });
  3359. } else if (isFunction$1(source)) {
  3360. if (cb) {
  3361. getter = () => callWithErrorHandling(
  3362. source,
  3363. instance,
  3364. 2
  3365. /* ErrorCodes.WATCH_GETTER */
  3366. );
  3367. } else {
  3368. getter = () => {
  3369. if (instance && instance.isUnmounted) {
  3370. return;
  3371. }
  3372. if (cleanup) {
  3373. cleanup();
  3374. }
  3375. return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
  3376. };
  3377. }
  3378. } else {
  3379. getter = NOOP;
  3380. warnInvalidSource(source);
  3381. }
  3382. if (cb && deep) {
  3383. const baseGetter = getter;
  3384. getter = () => traverse(baseGetter());
  3385. }
  3386. let cleanup;
  3387. let onCleanup = (fn) => {
  3388. cleanup = effect.onStop = () => {
  3389. callWithErrorHandling(
  3390. fn,
  3391. instance,
  3392. 4
  3393. /* ErrorCodes.WATCH_CLEANUP */
  3394. );
  3395. };
  3396. };
  3397. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  3398. const job = () => {
  3399. if (!effect.active) {
  3400. return;
  3401. }
  3402. if (cb) {
  3403. const newValue = effect.run();
  3404. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  3405. if (cleanup) {
  3406. cleanup();
  3407. }
  3408. callWithAsyncErrorHandling(cb, instance, 3, [
  3409. newValue,
  3410. // pass undefined as the old value when it's changed for the first time
  3411. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  3412. onCleanup
  3413. ]);
  3414. oldValue = newValue;
  3415. }
  3416. } else {
  3417. effect.run();
  3418. }
  3419. };
  3420. job.allowRecurse = !!cb;
  3421. let scheduler;
  3422. if (flush === "sync") {
  3423. scheduler = job;
  3424. } else if (flush === "post") {
  3425. scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  3426. } else {
  3427. job.pre = true;
  3428. if (instance)
  3429. job.id = instance.uid;
  3430. scheduler = () => queueJob(job);
  3431. }
  3432. const effect = new ReactiveEffect(getter, scheduler);
  3433. {
  3434. effect.onTrack = onTrack;
  3435. effect.onTrigger = onTrigger;
  3436. }
  3437. if (cb) {
  3438. if (immediate) {
  3439. job();
  3440. } else {
  3441. oldValue = effect.run();
  3442. }
  3443. } else if (flush === "post") {
  3444. queuePostRenderEffect$1(effect.run.bind(effect), instance && instance.suspense);
  3445. } else {
  3446. effect.run();
  3447. }
  3448. const unwatch = () => {
  3449. effect.stop();
  3450. if (instance && instance.scope) {
  3451. remove(instance.scope.effects, effect);
  3452. }
  3453. };
  3454. return unwatch;
  3455. }
  3456. function instanceWatch(source, value, options) {
  3457. const publicThis = this.proxy;
  3458. const getter = isString$1(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  3459. let cb;
  3460. if (isFunction$1(value)) {
  3461. cb = value;
  3462. } else {
  3463. cb = value.handler;
  3464. options = value;
  3465. }
  3466. const cur = currentInstance;
  3467. setCurrentInstance(this);
  3468. const res = doWatch(getter, cb.bind(publicThis), options);
  3469. if (cur) {
  3470. setCurrentInstance(cur);
  3471. } else {
  3472. unsetCurrentInstance();
  3473. }
  3474. return res;
  3475. }
  3476. function createPathGetter(ctx, path) {
  3477. const segments = path.split(".");
  3478. return () => {
  3479. let cur = ctx;
  3480. for (let i = 0; i < segments.length && cur; i++) {
  3481. cur = cur[segments[i]];
  3482. }
  3483. return cur;
  3484. };
  3485. }
  3486. function traverse(value, seen) {
  3487. if (!isObject$1(value) || value[
  3488. "__v_skip"
  3489. /* ReactiveFlags.SKIP */
  3490. ]) {
  3491. return value;
  3492. }
  3493. seen = seen || /* @__PURE__ */ new Set();
  3494. if (seen.has(value)) {
  3495. return value;
  3496. }
  3497. seen.add(value);
  3498. if (isRef(value)) {
  3499. traverse(value.value, seen);
  3500. } else if (isArray$1(value)) {
  3501. for (let i = 0; i < value.length; i++) {
  3502. traverse(value[i], seen);
  3503. }
  3504. } else if (isSet(value) || isMap(value)) {
  3505. value.forEach((v) => {
  3506. traverse(v, seen);
  3507. });
  3508. } else if (isPlainObject(value)) {
  3509. for (const key in value) {
  3510. traverse(value[key], seen);
  3511. }
  3512. }
  3513. return value;
  3514. }
  3515. function defineComponent(options) {
  3516. return isFunction$1(options) ? { setup: options, name: options.name } : options;
  3517. }
  3518. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  3519. function onActivated(hook, target) {
  3520. registerKeepAliveHook(hook, "a", target);
  3521. }
  3522. function onDeactivated(hook, target) {
  3523. registerKeepAliveHook(hook, "da", target);
  3524. }
  3525. function registerKeepAliveHook(hook, type, target = currentInstance) {
  3526. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  3527. let current = target;
  3528. while (current) {
  3529. if (current.isDeactivated) {
  3530. return;
  3531. }
  3532. current = current.parent;
  3533. }
  3534. return hook();
  3535. });
  3536. injectHook(type, wrappedHook, target);
  3537. if (target) {
  3538. let current = target.parent;
  3539. while (current && current.parent) {
  3540. if (isKeepAlive(current.parent.vnode)) {
  3541. injectToKeepAliveRoot(wrappedHook, type, target, current);
  3542. }
  3543. current = current.parent;
  3544. }
  3545. }
  3546. }
  3547. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  3548. const injected = injectHook(
  3549. type,
  3550. hook,
  3551. keepAliveRoot,
  3552. true
  3553. /* prepend */
  3554. );
  3555. onUnmounted(() => {
  3556. remove(keepAliveRoot[type], injected);
  3557. }, target);
  3558. }
  3559. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3560. if (target) {
  3561. if (isRootHook(type)) {
  3562. target = target.root;
  3563. }
  3564. const hooks2 = target[type] || (target[type] = []);
  3565. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3566. if (target.isUnmounted) {
  3567. return;
  3568. }
  3569. pauseTracking();
  3570. setCurrentInstance(target);
  3571. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3572. unsetCurrentInstance();
  3573. resetTracking();
  3574. return res;
  3575. });
  3576. if (prepend) {
  3577. hooks2.unshift(wrappedHook);
  3578. } else {
  3579. hooks2.push(wrappedHook);
  3580. }
  3581. return wrappedHook;
  3582. } else {
  3583. const apiName = toHandlerKey((ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, ""));
  3584. warn$2(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`);
  3585. }
  3586. }
  3587. const createHook$1 = (lifecycle) => (hook, target = currentInstance) => (
  3588. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  3589. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  3590. );
  3591. const onBeforeMount = createHook$1(
  3592. "bm"
  3593. /* LifecycleHooks.BEFORE_MOUNT */
  3594. );
  3595. const onMounted = createHook$1(
  3596. "m"
  3597. /* LifecycleHooks.MOUNTED */
  3598. );
  3599. const onBeforeUpdate = createHook$1(
  3600. "bu"
  3601. /* LifecycleHooks.BEFORE_UPDATE */
  3602. );
  3603. const onUpdated = createHook$1(
  3604. "u"
  3605. /* LifecycleHooks.UPDATED */
  3606. );
  3607. const onBeforeUnmount = createHook$1(
  3608. "bum"
  3609. /* LifecycleHooks.BEFORE_UNMOUNT */
  3610. );
  3611. const onUnmounted = createHook$1(
  3612. "um"
  3613. /* LifecycleHooks.UNMOUNTED */
  3614. );
  3615. const onServerPrefetch = createHook$1(
  3616. "sp"
  3617. /* LifecycleHooks.SERVER_PREFETCH */
  3618. );
  3619. const onRenderTriggered = createHook$1(
  3620. "rtg"
  3621. /* LifecycleHooks.RENDER_TRIGGERED */
  3622. );
  3623. const onRenderTracked = createHook$1(
  3624. "rtc"
  3625. /* LifecycleHooks.RENDER_TRACKED */
  3626. );
  3627. function onErrorCaptured(hook, target = currentInstance) {
  3628. injectHook("ec", hook, target);
  3629. }
  3630. function validateDirectiveName(name) {
  3631. if (isBuiltInDirective(name)) {
  3632. warn$2("Do not use built-in directive ids as custom directive id: " + name);
  3633. }
  3634. }
  3635. const COMPONENTS = "components";
  3636. function resolveComponent(name, maybeSelfReference) {
  3637. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3638. }
  3639. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3640. const instance = currentRenderingInstance || currentInstance;
  3641. if (instance) {
  3642. const Component2 = instance.type;
  3643. if (type === COMPONENTS) {
  3644. const selfName = getComponentName(
  3645. Component2,
  3646. false
  3647. /* do not include inferred name to avoid breaking existing code */
  3648. );
  3649. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3650. return Component2;
  3651. }
  3652. }
  3653. const res = (
  3654. // local registration
  3655. // check instance[type] first which is resolved for options API
  3656. resolve(instance[type] || Component2[type], name) || // global registration
  3657. resolve(instance.appContext[type], name)
  3658. );
  3659. if (!res && maybeSelfReference) {
  3660. return Component2;
  3661. }
  3662. if (warnMissing && !res) {
  3663. const extra = type === COMPONENTS ? `
  3664. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3665. warn$2(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3666. }
  3667. return res;
  3668. } else {
  3669. warn$2(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
  3670. }
  3671. }
  3672. function resolve(registry, name) {
  3673. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3674. }
  3675. const getPublicInstance = (i) => {
  3676. if (!i)
  3677. return null;
  3678. if (isStatefulComponent(i))
  3679. return getExposeProxy(i) || i.proxy;
  3680. return getPublicInstance(i.parent);
  3681. };
  3682. const publicPropertiesMap = (
  3683. // Move PURE marker to new line to workaround compiler discarding it
  3684. // due to type annotation
  3685. /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), {
  3686. $: (i) => i,
  3687. // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的
  3688. // $el: i => i.vnode.el,
  3689. $el: (i) => i.__$el || (i.__$el = {}),
  3690. $data: (i) => i.data,
  3691. $props: (i) => shallowReadonly(i.props),
  3692. $attrs: (i) => shallowReadonly(i.attrs),
  3693. $slots: (i) => shallowReadonly(i.slots),
  3694. $refs: (i) => shallowReadonly(i.refs),
  3695. $parent: (i) => getPublicInstance(i.parent),
  3696. $root: (i) => getPublicInstance(i.root),
  3697. $emit: (i) => i.emit,
  3698. $options: (i) => resolveMergedOptions(i),
  3699. $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)),
  3700. // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
  3701. $watch: (i) => instanceWatch.bind(i)
  3702. })
  3703. );
  3704. const isReservedPrefix = (key) => key === "_" || key === "$";
  3705. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  3706. const PublicInstanceProxyHandlers = {
  3707. get({ _: instance }, key) {
  3708. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3709. if (key === "__isVue") {
  3710. return true;
  3711. }
  3712. let normalizedProps;
  3713. if (key[0] !== "$") {
  3714. const n2 = accessCache[key];
  3715. if (n2 !== void 0) {
  3716. switch (n2) {
  3717. case 1:
  3718. return setupState[key];
  3719. case 2:
  3720. return data[key];
  3721. case 4:
  3722. return ctx[key];
  3723. case 3:
  3724. return props[key];
  3725. }
  3726. } else if (hasSetupBinding(setupState, key)) {
  3727. accessCache[key] = 1;
  3728. return setupState[key];
  3729. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3730. accessCache[key] = 2;
  3731. return data[key];
  3732. } else if (
  3733. // only cache other properties when instance has declared (thus stable)
  3734. // props
  3735. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  3736. ) {
  3737. accessCache[key] = 3;
  3738. return props[key];
  3739. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3740. accessCache[key] = 4;
  3741. return ctx[key];
  3742. } else if (shouldCacheAccess) {
  3743. accessCache[key] = 0;
  3744. }
  3745. }
  3746. const publicGetter = publicPropertiesMap[key];
  3747. let cssModule, globalProperties;
  3748. if (publicGetter) {
  3749. if (key === "$attrs") {
  3750. track(instance, "get", key);
  3751. }
  3752. return publicGetter(instance);
  3753. } else if (
  3754. // css module (injected by vue-loader)
  3755. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3756. ) {
  3757. return cssModule;
  3758. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3759. accessCache[key] = 4;
  3760. return ctx[key];
  3761. } else if (
  3762. // global properties
  3763. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  3764. ) {
  3765. {
  3766. return globalProperties[key];
  3767. }
  3768. } else if (currentRenderingInstance && (!isString$1(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3769. // to infinite warning loop
  3770. key.indexOf("__v") !== 0)) {
  3771. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  3772. warn$2(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
  3773. } else if (instance === currentRenderingInstance) {
  3774. warn$2(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
  3775. }
  3776. }
  3777. },
  3778. set({ _: instance }, key, value) {
  3779. const { data, setupState, ctx } = instance;
  3780. if (hasSetupBinding(setupState, key)) {
  3781. setupState[key] = value;
  3782. return true;
  3783. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  3784. warn$2(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3785. return false;
  3786. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3787. data[key] = value;
  3788. return true;
  3789. } else if (hasOwn(instance.props, key)) {
  3790. warn$2(`Attempting to mutate prop "${key}". Props are readonly.`);
  3791. return false;
  3792. }
  3793. if (key[0] === "$" && key.slice(1) in instance) {
  3794. warn$2(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`);
  3795. return false;
  3796. } else {
  3797. if (key in instance.appContext.config.globalProperties) {
  3798. Object.defineProperty(ctx, key, {
  3799. enumerable: true,
  3800. configurable: true,
  3801. value
  3802. });
  3803. } else {
  3804. ctx[key] = value;
  3805. }
  3806. }
  3807. return true;
  3808. },
  3809. has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
  3810. let normalizedProps;
  3811. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
  3812. },
  3813. defineProperty(target, key, descriptor) {
  3814. if (descriptor.get != null) {
  3815. target._.accessCache[key] = 0;
  3816. } else if (hasOwn(descriptor, "value")) {
  3817. this.set(target, key, descriptor.value, null);
  3818. }
  3819. return Reflect.defineProperty(target, key, descriptor);
  3820. }
  3821. };
  3822. {
  3823. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3824. warn$2(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`);
  3825. return Reflect.ownKeys(target);
  3826. };
  3827. }
  3828. function createDevRenderContext(instance) {
  3829. const target = {};
  3830. Object.defineProperty(target, `_`, {
  3831. configurable: true,
  3832. enumerable: false,
  3833. get: () => instance
  3834. });
  3835. Object.keys(publicPropertiesMap).forEach((key) => {
  3836. Object.defineProperty(target, key, {
  3837. configurable: true,
  3838. enumerable: false,
  3839. get: () => publicPropertiesMap[key](instance),
  3840. // intercepted by the proxy so no need for implementation,
  3841. // but needed to prevent set errors
  3842. set: NOOP
  3843. });
  3844. });
  3845. return target;
  3846. }
  3847. function exposePropsOnRenderContext(instance) {
  3848. const { ctx, propsOptions: [propsOptions] } = instance;
  3849. if (propsOptions) {
  3850. Object.keys(propsOptions).forEach((key) => {
  3851. Object.defineProperty(ctx, key, {
  3852. enumerable: true,
  3853. configurable: true,
  3854. get: () => instance.props[key],
  3855. set: NOOP
  3856. });
  3857. });
  3858. }
  3859. }
  3860. function exposeSetupStateOnRenderContext(instance) {
  3861. const { ctx, setupState } = instance;
  3862. Object.keys(toRaw(setupState)).forEach((key) => {
  3863. if (!setupState.__isScriptSetup) {
  3864. if (isReservedPrefix(key[0])) {
  3865. warn$2(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
  3866. return;
  3867. }
  3868. Object.defineProperty(ctx, key, {
  3869. enumerable: true,
  3870. configurable: true,
  3871. get: () => setupState[key],
  3872. set: NOOP
  3873. });
  3874. }
  3875. });
  3876. }
  3877. function createDuplicateChecker() {
  3878. const cache = /* @__PURE__ */ Object.create(null);
  3879. return (type, key) => {
  3880. if (cache[key]) {
  3881. warn$2(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3882. } else {
  3883. cache[key] = type;
  3884. }
  3885. };
  3886. }
  3887. let shouldCacheAccess = true;
  3888. function applyOptions$1(instance) {
  3889. const options = resolveMergedOptions(instance);
  3890. const publicThis = instance.proxy;
  3891. const ctx = instance.ctx;
  3892. shouldCacheAccess = false;
  3893. if (options.beforeCreate) {
  3894. callHook$1(
  3895. options.beforeCreate,
  3896. instance,
  3897. "bc"
  3898. /* LifecycleHooks.BEFORE_CREATE */
  3899. );
  3900. }
  3901. const {
  3902. // state
  3903. data: dataOptions,
  3904. computed: computedOptions,
  3905. methods,
  3906. watch: watchOptions,
  3907. provide: provideOptions,
  3908. inject: injectOptions,
  3909. // lifecycle
  3910. created,
  3911. beforeMount,
  3912. mounted,
  3913. beforeUpdate,
  3914. updated,
  3915. activated,
  3916. deactivated,
  3917. beforeDestroy,
  3918. beforeUnmount,
  3919. destroyed,
  3920. unmounted,
  3921. render,
  3922. renderTracked,
  3923. renderTriggered,
  3924. errorCaptured,
  3925. serverPrefetch,
  3926. // public API
  3927. expose,
  3928. inheritAttrs,
  3929. // assets
  3930. components,
  3931. directives,
  3932. filters
  3933. } = options;
  3934. const checkDuplicateProperties = createDuplicateChecker();
  3935. {
  3936. const [propsOptions] = instance.propsOptions;
  3937. if (propsOptions) {
  3938. for (const key in propsOptions) {
  3939. checkDuplicateProperties("Props", key);
  3940. }
  3941. }
  3942. }
  3943. if (injectOptions) {
  3944. resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);
  3945. }
  3946. if (methods) {
  3947. for (const key in methods) {
  3948. const methodHandler = methods[key];
  3949. if (isFunction$1(methodHandler)) {
  3950. {
  3951. Object.defineProperty(ctx, key, {
  3952. value: methodHandler.bind(publicThis),
  3953. configurable: true,
  3954. enumerable: true,
  3955. writable: true
  3956. });
  3957. }
  3958. {
  3959. checkDuplicateProperties("Methods", key);
  3960. }
  3961. } else {
  3962. warn$2(`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`);
  3963. }
  3964. }
  3965. }
  3966. if (dataOptions) {
  3967. if (!isFunction$1(dataOptions)) {
  3968. warn$2(`The data option must be a function. Plain object usage is no longer supported.`);
  3969. }
  3970. const data = dataOptions.call(publicThis, publicThis);
  3971. if (isPromise(data)) {
  3972. warn$2(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`);
  3973. }
  3974. if (!isObject$1(data)) {
  3975. warn$2(`data() should return an object.`);
  3976. } else {
  3977. instance.data = reactive(data);
  3978. {
  3979. for (const key in data) {
  3980. checkDuplicateProperties("Data", key);
  3981. if (!isReservedPrefix(key[0])) {
  3982. Object.defineProperty(ctx, key, {
  3983. configurable: true,
  3984. enumerable: true,
  3985. get: () => data[key],
  3986. set: NOOP
  3987. });
  3988. }
  3989. }
  3990. }
  3991. }
  3992. }
  3993. shouldCacheAccess = true;
  3994. if (computedOptions) {
  3995. for (const key in computedOptions) {
  3996. const opt = computedOptions[key];
  3997. const get2 = isFunction$1(opt) ? opt.bind(publicThis, publicThis) : isFunction$1(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3998. if (get2 === NOOP) {
  3999. warn$2(`Computed property "${key}" has no getter.`);
  4000. }
  4001. const set2 = !isFunction$1(opt) && isFunction$1(opt.set) ? opt.set.bind(publicThis) : () => {
  4002. warn$2(`Write operation failed: computed property "${key}" is readonly.`);
  4003. };
  4004. const c = computed({
  4005. get: get2,
  4006. set: set2
  4007. });
  4008. Object.defineProperty(ctx, key, {
  4009. enumerable: true,
  4010. configurable: true,
  4011. get: () => c.value,
  4012. set: (v) => c.value = v
  4013. });
  4014. {
  4015. checkDuplicateProperties("Computed", key);
  4016. }
  4017. }
  4018. }
  4019. if (watchOptions) {
  4020. for (const key in watchOptions) {
  4021. createWatcher(watchOptions[key], ctx, publicThis, key);
  4022. }
  4023. }
  4024. {
  4025. if (provideOptions) {
  4026. const provides = isFunction$1(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  4027. Reflect.ownKeys(provides).forEach((key) => {
  4028. provide(key, provides[key]);
  4029. });
  4030. }
  4031. }
  4032. {
  4033. if (created) {
  4034. callHook$1(
  4035. created,
  4036. instance,
  4037. "c"
  4038. /* LifecycleHooks.CREATED */
  4039. );
  4040. }
  4041. }
  4042. function registerLifecycleHook(register, hook) {
  4043. if (isArray$1(hook)) {
  4044. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  4045. } else if (hook) {
  4046. register(hook.bind(publicThis));
  4047. }
  4048. }
  4049. registerLifecycleHook(onBeforeMount, beforeMount);
  4050. registerLifecycleHook(onMounted, mounted);
  4051. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  4052. registerLifecycleHook(onUpdated, updated);
  4053. registerLifecycleHook(onActivated, activated);
  4054. registerLifecycleHook(onDeactivated, deactivated);
  4055. registerLifecycleHook(onErrorCaptured, errorCaptured);
  4056. registerLifecycleHook(onRenderTracked, renderTracked);
  4057. registerLifecycleHook(onRenderTriggered, renderTriggered);
  4058. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  4059. registerLifecycleHook(onUnmounted, unmounted);
  4060. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  4061. if (isArray$1(expose)) {
  4062. if (expose.length) {
  4063. const exposed = instance.exposed || (instance.exposed = {});
  4064. expose.forEach((key) => {
  4065. Object.defineProperty(exposed, key, {
  4066. get: () => publicThis[key],
  4067. set: (val) => publicThis[key] = val
  4068. });
  4069. });
  4070. } else if (!instance.exposed) {
  4071. instance.exposed = {};
  4072. }
  4073. }
  4074. if (render && instance.render === NOOP) {
  4075. instance.render = render;
  4076. }
  4077. if (inheritAttrs != null) {
  4078. instance.inheritAttrs = inheritAttrs;
  4079. }
  4080. if (components)
  4081. instance.components = components;
  4082. if (directives)
  4083. instance.directives = directives;
  4084. if (instance.ctx.$onApplyOptions) {
  4085. instance.ctx.$onApplyOptions(options, instance, publicThis);
  4086. }
  4087. }
  4088. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
  4089. if (isArray$1(injectOptions)) {
  4090. injectOptions = normalizeInject(injectOptions);
  4091. }
  4092. for (const key in injectOptions) {
  4093. const opt = injectOptions[key];
  4094. let injected;
  4095. if (isObject$1(opt)) {
  4096. if ("default" in opt) {
  4097. injected = inject(
  4098. opt.from || key,
  4099. opt.default,
  4100. true
  4101. /* treat default function as factory */
  4102. );
  4103. } else {
  4104. injected = inject(opt.from || key);
  4105. }
  4106. } else {
  4107. injected = inject(opt);
  4108. }
  4109. if (isRef(injected)) {
  4110. if (unwrapRef) {
  4111. Object.defineProperty(ctx, key, {
  4112. enumerable: true,
  4113. configurable: true,
  4114. get: () => injected.value,
  4115. set: (v) => injected.value = v
  4116. });
  4117. } else {
  4118. {
  4119. warn$2(`injected property "${key}" is a ref and will be auto-unwrapped and no longer needs \`.value\` in the next minor release. To opt-in to the new behavior now, set \`app.config.unwrapInjectedRef = true\` (this config is temporary and will not be needed in the future.)`);
  4120. }
  4121. ctx[key] = injected;
  4122. }
  4123. } else {
  4124. ctx[key] = injected;
  4125. }
  4126. {
  4127. checkDuplicateProperties("Inject", key);
  4128. }
  4129. }
  4130. }
  4131. function callHook$1(hook, instance, type) {
  4132. callWithAsyncErrorHandling(isArray$1(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
  4133. }
  4134. function createWatcher(raw, ctx, publicThis, key) {
  4135. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  4136. if (isString$1(raw)) {
  4137. const handler = ctx[raw];
  4138. if (isFunction$1(handler)) {
  4139. watch(getter, handler);
  4140. } else {
  4141. warn$2(`Invalid watch handler specified by key "${raw}"`, handler);
  4142. }
  4143. } else if (isFunction$1(raw)) {
  4144. watch(getter, raw.bind(publicThis));
  4145. } else if (isObject$1(raw)) {
  4146. if (isArray$1(raw)) {
  4147. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  4148. } else {
  4149. const handler = isFunction$1(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  4150. if (isFunction$1(handler)) {
  4151. watch(getter, handler, raw);
  4152. } else {
  4153. warn$2(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  4154. }
  4155. }
  4156. } else {
  4157. warn$2(`Invalid watch option: "${key}"`, raw);
  4158. }
  4159. }
  4160. function resolveMergedOptions(instance) {
  4161. const base = instance.type;
  4162. const { mixins, extends: extendsOptions } = base;
  4163. const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
  4164. const cached = cache.get(base);
  4165. let resolved;
  4166. if (cached) {
  4167. resolved = cached;
  4168. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  4169. {
  4170. resolved = base;
  4171. }
  4172. } else {
  4173. resolved = {};
  4174. if (globalMixins.length) {
  4175. globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
  4176. }
  4177. mergeOptions(resolved, base, optionMergeStrategies);
  4178. }
  4179. if (isObject$1(base)) {
  4180. cache.set(base, resolved);
  4181. }
  4182. return resolved;
  4183. }
  4184. function mergeOptions(to2, from2, strats, asMixin = false) {
  4185. const { mixins, extends: extendsOptions } = from2;
  4186. if (extendsOptions) {
  4187. mergeOptions(to2, extendsOptions, strats, true);
  4188. }
  4189. if (mixins) {
  4190. mixins.forEach((m) => mergeOptions(to2, m, strats, true));
  4191. }
  4192. for (const key in from2) {
  4193. if (asMixin && key === "expose") {
  4194. warn$2(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
  4195. } else {
  4196. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  4197. to2[key] = strat ? strat(to2[key], from2[key]) : from2[key];
  4198. }
  4199. }
  4200. return to2;
  4201. }
  4202. const internalOptionMergeStrats = {
  4203. data: mergeDataFn,
  4204. props: mergeObjectOptions,
  4205. emits: mergeObjectOptions,
  4206. // objects
  4207. methods: mergeObjectOptions,
  4208. computed: mergeObjectOptions,
  4209. // lifecycle
  4210. beforeCreate: mergeAsArray$1,
  4211. created: mergeAsArray$1,
  4212. beforeMount: mergeAsArray$1,
  4213. mounted: mergeAsArray$1,
  4214. beforeUpdate: mergeAsArray$1,
  4215. updated: mergeAsArray$1,
  4216. beforeDestroy: mergeAsArray$1,
  4217. beforeUnmount: mergeAsArray$1,
  4218. destroyed: mergeAsArray$1,
  4219. unmounted: mergeAsArray$1,
  4220. activated: mergeAsArray$1,
  4221. deactivated: mergeAsArray$1,
  4222. errorCaptured: mergeAsArray$1,
  4223. serverPrefetch: mergeAsArray$1,
  4224. // assets
  4225. components: mergeObjectOptions,
  4226. directives: mergeObjectOptions,
  4227. // watch
  4228. watch: mergeWatchOptions,
  4229. // provide / inject
  4230. provide: mergeDataFn,
  4231. inject: mergeInject
  4232. };
  4233. function mergeDataFn(to2, from2) {
  4234. if (!from2) {
  4235. return to2;
  4236. }
  4237. if (!to2) {
  4238. return from2;
  4239. }
  4240. return function mergedDataFn() {
  4241. return extend$1(isFunction$1(to2) ? to2.call(this, this) : to2, isFunction$1(from2) ? from2.call(this, this) : from2);
  4242. };
  4243. }
  4244. function mergeInject(to2, from2) {
  4245. return mergeObjectOptions(normalizeInject(to2), normalizeInject(from2));
  4246. }
  4247. function normalizeInject(raw) {
  4248. if (isArray$1(raw)) {
  4249. const res = {};
  4250. for (let i = 0; i < raw.length; i++) {
  4251. res[raw[i]] = raw[i];
  4252. }
  4253. return res;
  4254. }
  4255. return raw;
  4256. }
  4257. function mergeAsArray$1(to2, from2) {
  4258. return to2 ? [...new Set([].concat(to2, from2))] : from2;
  4259. }
  4260. function mergeObjectOptions(to2, from2) {
  4261. return to2 ? extend$1(extend$1(/* @__PURE__ */ Object.create(null), to2), from2) : from2;
  4262. }
  4263. function mergeWatchOptions(to2, from2) {
  4264. if (!to2)
  4265. return from2;
  4266. if (!from2)
  4267. return to2;
  4268. const merged = extend$1(/* @__PURE__ */ Object.create(null), to2);
  4269. for (const key in from2) {
  4270. merged[key] = mergeAsArray$1(to2[key], from2[key]);
  4271. }
  4272. return merged;
  4273. }
  4274. function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  4275. const props = {};
  4276. const attrs = {};
  4277. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4278. setFullProps(instance, rawProps, props, attrs);
  4279. for (const key in instance.propsOptions[0]) {
  4280. if (!(key in props)) {
  4281. props[key] = void 0;
  4282. }
  4283. }
  4284. {
  4285. validateProps(rawProps || {}, props, instance);
  4286. }
  4287. if (isStateful) {
  4288. instance.props = isSSR ? props : shallowReactive(props);
  4289. } else {
  4290. if (!instance.type.props) {
  4291. instance.props = attrs;
  4292. } else {
  4293. instance.props = props;
  4294. }
  4295. }
  4296. instance.attrs = attrs;
  4297. }
  4298. function isInHmrContext(instance) {
  4299. while (instance) {
  4300. if (instance.type.__hmrId)
  4301. return true;
  4302. instance = instance.parent;
  4303. }
  4304. }
  4305. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4306. const { props, attrs, vnode: { patchFlag } } = instance;
  4307. const rawCurrentProps = toRaw(props);
  4308. const [options] = instance.propsOptions;
  4309. let hasAttrsChanged = false;
  4310. if (
  4311. // always force full diff in dev
  4312. // - #1942 if hmr is enabled with sfc component
  4313. // - vite#872 non-sfc component used by sfc component
  4314. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4315. ) {
  4316. if (patchFlag & 8) {
  4317. const propsToUpdate = instance.vnode.dynamicProps;
  4318. for (let i = 0; i < propsToUpdate.length; i++) {
  4319. let key = propsToUpdate[i];
  4320. if (isEmitListener(instance.emitsOptions, key)) {
  4321. continue;
  4322. }
  4323. const value = rawProps[key];
  4324. if (options) {
  4325. if (hasOwn(attrs, key)) {
  4326. if (value !== attrs[key]) {
  4327. attrs[key] = value;
  4328. hasAttrsChanged = true;
  4329. }
  4330. } else {
  4331. const camelizedKey = camelize(key);
  4332. props[camelizedKey] = resolvePropValue(
  4333. options,
  4334. rawCurrentProps,
  4335. camelizedKey,
  4336. value,
  4337. instance,
  4338. false
  4339. /* isAbsent */
  4340. );
  4341. }
  4342. } else {
  4343. if (value !== attrs[key]) {
  4344. attrs[key] = value;
  4345. hasAttrsChanged = true;
  4346. }
  4347. }
  4348. }
  4349. }
  4350. } else {
  4351. if (setFullProps(instance, rawProps, props, attrs)) {
  4352. hasAttrsChanged = true;
  4353. }
  4354. let kebabKey;
  4355. for (const key in rawCurrentProps) {
  4356. if (!rawProps || // for camelCase
  4357. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4358. // and converted to camelCase (#955)
  4359. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  4360. if (options) {
  4361. if (rawPrevProps && // for camelCase
  4362. (rawPrevProps[key] !== void 0 || // for kebab-case
  4363. rawPrevProps[kebabKey] !== void 0)) {
  4364. props[key] = resolvePropValue(
  4365. options,
  4366. rawCurrentProps,
  4367. key,
  4368. void 0,
  4369. instance,
  4370. true
  4371. /* isAbsent */
  4372. );
  4373. }
  4374. } else {
  4375. delete props[key];
  4376. }
  4377. }
  4378. }
  4379. if (attrs !== rawCurrentProps) {
  4380. for (const key in attrs) {
  4381. if (!rawProps || !hasOwn(rawProps, key) && true) {
  4382. delete attrs[key];
  4383. hasAttrsChanged = true;
  4384. }
  4385. }
  4386. }
  4387. }
  4388. if (hasAttrsChanged) {
  4389. trigger(instance, "set", "$attrs");
  4390. }
  4391. {
  4392. validateProps(rawProps || {}, props, instance);
  4393. }
  4394. }
  4395. function setFullProps(instance, rawProps, props, attrs) {
  4396. const [options, needCastKeys] = instance.propsOptions;
  4397. let hasAttrsChanged = false;
  4398. let rawCastValues;
  4399. if (rawProps) {
  4400. for (let key in rawProps) {
  4401. if (isReservedProp(key)) {
  4402. continue;
  4403. }
  4404. const value = rawProps[key];
  4405. let camelKey;
  4406. if (options && hasOwn(options, camelKey = camelize(key))) {
  4407. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4408. props[camelKey] = value;
  4409. } else {
  4410. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4411. }
  4412. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4413. if (!(key in attrs) || value !== attrs[key]) {
  4414. attrs[key] = value;
  4415. hasAttrsChanged = true;
  4416. }
  4417. }
  4418. }
  4419. }
  4420. if (needCastKeys) {
  4421. const rawCurrentProps = toRaw(props);
  4422. const castValues = rawCastValues || EMPTY_OBJ;
  4423. for (let i = 0; i < needCastKeys.length; i++) {
  4424. const key = needCastKeys[i];
  4425. props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));
  4426. }
  4427. }
  4428. return hasAttrsChanged;
  4429. }
  4430. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4431. const opt = options[key];
  4432. if (opt != null) {
  4433. const hasDefault = hasOwn(opt, "default");
  4434. if (hasDefault && value === void 0) {
  4435. const defaultValue = opt.default;
  4436. if (opt.type !== Function && isFunction$1(defaultValue)) {
  4437. const { propsDefaults } = instance;
  4438. if (key in propsDefaults) {
  4439. value = propsDefaults[key];
  4440. } else {
  4441. setCurrentInstance(instance);
  4442. value = propsDefaults[key] = defaultValue.call(null, props);
  4443. unsetCurrentInstance();
  4444. }
  4445. } else {
  4446. value = defaultValue;
  4447. }
  4448. }
  4449. if (opt[
  4450. 0
  4451. /* BooleanFlags.shouldCast */
  4452. ]) {
  4453. if (isAbsent && !hasDefault) {
  4454. value = false;
  4455. } else if (opt[
  4456. 1
  4457. /* BooleanFlags.shouldCastTrue */
  4458. ] && (value === "" || value === hyphenate(key))) {
  4459. value = true;
  4460. }
  4461. }
  4462. }
  4463. return value;
  4464. }
  4465. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4466. const cache = appContext.propsCache;
  4467. const cached = cache.get(comp);
  4468. if (cached) {
  4469. return cached;
  4470. }
  4471. const raw = comp.props;
  4472. const normalized = {};
  4473. const needCastKeys = [];
  4474. let hasExtends = false;
  4475. if (!isFunction$1(comp)) {
  4476. const extendProps = (raw2) => {
  4477. hasExtends = true;
  4478. const [props, keys2] = normalizePropsOptions(raw2, appContext, true);
  4479. extend$1(normalized, props);
  4480. if (keys2)
  4481. needCastKeys.push(...keys2);
  4482. };
  4483. if (!asMixin && appContext.mixins.length) {
  4484. appContext.mixins.forEach(extendProps);
  4485. }
  4486. if (comp.extends) {
  4487. extendProps(comp.extends);
  4488. }
  4489. if (comp.mixins) {
  4490. comp.mixins.forEach(extendProps);
  4491. }
  4492. }
  4493. if (!raw && !hasExtends) {
  4494. if (isObject$1(comp)) {
  4495. cache.set(comp, EMPTY_ARR);
  4496. }
  4497. return EMPTY_ARR;
  4498. }
  4499. if (isArray$1(raw)) {
  4500. for (let i = 0; i < raw.length; i++) {
  4501. if (!isString$1(raw[i])) {
  4502. warn$2(`props must be strings when using array syntax.`, raw[i]);
  4503. }
  4504. const normalizedKey = camelize(raw[i]);
  4505. if (validatePropName(normalizedKey)) {
  4506. normalized[normalizedKey] = EMPTY_OBJ;
  4507. }
  4508. }
  4509. } else if (raw) {
  4510. if (!isObject$1(raw)) {
  4511. warn$2(`invalid props options`, raw);
  4512. }
  4513. for (const key in raw) {
  4514. const normalizedKey = camelize(key);
  4515. if (validatePropName(normalizedKey)) {
  4516. const opt = raw[key];
  4517. const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction$1(opt) ? { type: opt } : Object.assign({}, opt);
  4518. if (prop) {
  4519. const booleanIndex = getTypeIndex(Boolean, prop.type);
  4520. const stringIndex = getTypeIndex(String, prop.type);
  4521. prop[
  4522. 0
  4523. /* BooleanFlags.shouldCast */
  4524. ] = booleanIndex > -1;
  4525. prop[
  4526. 1
  4527. /* BooleanFlags.shouldCastTrue */
  4528. ] = stringIndex < 0 || booleanIndex < stringIndex;
  4529. if (booleanIndex > -1 || hasOwn(prop, "default")) {
  4530. needCastKeys.push(normalizedKey);
  4531. }
  4532. }
  4533. }
  4534. }
  4535. }
  4536. const res = [normalized, needCastKeys];
  4537. if (isObject$1(comp)) {
  4538. cache.set(comp, res);
  4539. }
  4540. return res;
  4541. }
  4542. function validatePropName(key) {
  4543. if (key[0] !== "$") {
  4544. return true;
  4545. } else {
  4546. warn$2(`Invalid prop name: "${key}" is a reserved property.`);
  4547. }
  4548. return false;
  4549. }
  4550. function getType(ctor) {
  4551. const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
  4552. return match ? match[2] : ctor === null ? "null" : "";
  4553. }
  4554. function isSameType(a, b) {
  4555. return getType(a) === getType(b);
  4556. }
  4557. function getTypeIndex(type, expectedTypes) {
  4558. if (isArray$1(expectedTypes)) {
  4559. return expectedTypes.findIndex((t2) => isSameType(t2, type));
  4560. } else if (isFunction$1(expectedTypes)) {
  4561. return isSameType(expectedTypes, type) ? 0 : -1;
  4562. }
  4563. return -1;
  4564. }
  4565. function validateProps(rawProps, props, instance) {
  4566. const resolvedValues = toRaw(props);
  4567. const options = instance.propsOptions[0];
  4568. for (const key in options) {
  4569. let opt = options[key];
  4570. if (opt == null)
  4571. continue;
  4572. validateProp(key, resolvedValues[key], opt, !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)));
  4573. }
  4574. }
  4575. function validateProp(name, value, prop, isAbsent) {
  4576. const { type, required, validator } = prop;
  4577. if (required && isAbsent) {
  4578. warn$2('Missing required prop: "' + name + '"');
  4579. return;
  4580. }
  4581. if (value == null && !prop.required) {
  4582. return;
  4583. }
  4584. if (type != null && type !== true) {
  4585. let isValid2 = false;
  4586. const types = isArray$1(type) ? type : [type];
  4587. const expectedTypes = [];
  4588. for (let i = 0; i < types.length && !isValid2; i++) {
  4589. const { valid, expectedType } = assertType(value, types[i]);
  4590. expectedTypes.push(expectedType || "");
  4591. isValid2 = valid;
  4592. }
  4593. if (!isValid2) {
  4594. warn$2(getInvalidTypeMessage(name, value, expectedTypes));
  4595. return;
  4596. }
  4597. }
  4598. if (validator && !validator(value)) {
  4599. warn$2('Invalid prop: custom validator check failed for prop "' + name + '".');
  4600. }
  4601. }
  4602. const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
  4603. function assertType(value, type) {
  4604. let valid;
  4605. const expectedType = getType(type);
  4606. if (isSimpleType(expectedType)) {
  4607. const t2 = typeof value;
  4608. valid = t2 === expectedType.toLowerCase();
  4609. if (!valid && t2 === "object") {
  4610. valid = value instanceof type;
  4611. }
  4612. } else if (expectedType === "Object") {
  4613. valid = isObject$1(value);
  4614. } else if (expectedType === "Array") {
  4615. valid = isArray$1(value);
  4616. } else if (expectedType === "null") {
  4617. valid = value === null;
  4618. } else {
  4619. valid = value instanceof type;
  4620. }
  4621. return {
  4622. valid,
  4623. expectedType
  4624. };
  4625. }
  4626. function getInvalidTypeMessage(name, value, expectedTypes) {
  4627. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4628. const expectedType = expectedTypes[0];
  4629. const receivedType = toRawType(value);
  4630. const expectedValue = styleValue(value, expectedType);
  4631. const receivedValue = styleValue(value, receivedType);
  4632. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4633. message += ` with value ${expectedValue}`;
  4634. }
  4635. message += `, got ${receivedType} `;
  4636. if (isExplicable(receivedType)) {
  4637. message += `with value ${receivedValue}.`;
  4638. }
  4639. return message;
  4640. }
  4641. function styleValue(value, type) {
  4642. if (type === "String") {
  4643. return `"${value}"`;
  4644. } else if (type === "Number") {
  4645. return `${Number(value)}`;
  4646. } else {
  4647. return `${value}`;
  4648. }
  4649. }
  4650. function isExplicable(type) {
  4651. const explicitTypes = ["string", "number", "boolean"];
  4652. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4653. }
  4654. function isBoolean(...args) {
  4655. return args.some((elem) => elem.toLowerCase() === "boolean");
  4656. }
  4657. function createAppContext() {
  4658. return {
  4659. app: null,
  4660. config: {
  4661. isNativeTag: NO,
  4662. performance: false,
  4663. globalProperties: {},
  4664. optionMergeStrategies: {},
  4665. errorHandler: void 0,
  4666. warnHandler: void 0,
  4667. compilerOptions: {}
  4668. },
  4669. mixins: [],
  4670. components: {},
  4671. directives: {},
  4672. provides: /* @__PURE__ */ Object.create(null),
  4673. optionsCache: /* @__PURE__ */ new WeakMap(),
  4674. propsCache: /* @__PURE__ */ new WeakMap(),
  4675. emitsCache: /* @__PURE__ */ new WeakMap()
  4676. };
  4677. }
  4678. let uid$1 = 0;
  4679. function createAppAPI(render, hydrate) {
  4680. return function createApp2(rootComponent, rootProps = null) {
  4681. if (!isFunction$1(rootComponent)) {
  4682. rootComponent = Object.assign({}, rootComponent);
  4683. }
  4684. if (rootProps != null && !isObject$1(rootProps)) {
  4685. warn$2(`root props passed to app.mount() must be an object.`);
  4686. rootProps = null;
  4687. }
  4688. const context = createAppContext();
  4689. const installedPlugins = /* @__PURE__ */ new Set();
  4690. const app = context.app = {
  4691. _uid: uid$1++,
  4692. _component: rootComponent,
  4693. _props: rootProps,
  4694. _container: null,
  4695. _context: context,
  4696. _instance: null,
  4697. version,
  4698. get config() {
  4699. return context.config;
  4700. },
  4701. set config(v) {
  4702. {
  4703. warn$2(`app.config cannot be replaced. Modify individual options instead.`);
  4704. }
  4705. },
  4706. use(plugin2, ...options) {
  4707. if (installedPlugins.has(plugin2)) {
  4708. warn$2(`Plugin has already been applied to target app.`);
  4709. } else if (plugin2 && isFunction$1(plugin2.install)) {
  4710. installedPlugins.add(plugin2);
  4711. plugin2.install(app, ...options);
  4712. } else if (isFunction$1(plugin2)) {
  4713. installedPlugins.add(plugin2);
  4714. plugin2(app, ...options);
  4715. } else {
  4716. warn$2(`A plugin must either be a function or an object with an "install" function.`);
  4717. }
  4718. return app;
  4719. },
  4720. mixin(mixin) {
  4721. {
  4722. if (!context.mixins.includes(mixin)) {
  4723. context.mixins.push(mixin);
  4724. } else {
  4725. warn$2("Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : ""));
  4726. }
  4727. }
  4728. return app;
  4729. },
  4730. component(name, component) {
  4731. {
  4732. validateComponentName(name, context.config);
  4733. }
  4734. if (!component) {
  4735. return context.components[name];
  4736. }
  4737. if (context.components[name]) {
  4738. warn$2(`Component "${name}" has already been registered in target app.`);
  4739. }
  4740. context.components[name] = component;
  4741. return app;
  4742. },
  4743. directive(name, directive) {
  4744. {
  4745. validateDirectiveName(name);
  4746. }
  4747. if (!directive) {
  4748. return context.directives[name];
  4749. }
  4750. if (context.directives[name]) {
  4751. warn$2(`Directive "${name}" has already been registered in target app.`);
  4752. }
  4753. context.directives[name] = directive;
  4754. return app;
  4755. },
  4756. // fixed by xxxxxx
  4757. mount() {
  4758. },
  4759. // fixed by xxxxxx
  4760. unmount() {
  4761. },
  4762. provide(key, value) {
  4763. if (key in context.provides) {
  4764. warn$2(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
  4765. }
  4766. context.provides[key] = value;
  4767. return app;
  4768. }
  4769. };
  4770. return app;
  4771. };
  4772. }
  4773. let supported;
  4774. let perf;
  4775. function startMeasure(instance, type) {
  4776. if (instance.appContext.config.performance && isSupported()) {
  4777. perf.mark(`vue-${type}-${instance.uid}`);
  4778. }
  4779. {
  4780. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  4781. }
  4782. }
  4783. function endMeasure(instance, type) {
  4784. if (instance.appContext.config.performance && isSupported()) {
  4785. const startTag = `vue-${type}-${instance.uid}`;
  4786. const endTag = startTag + `:end`;
  4787. perf.mark(endTag);
  4788. perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);
  4789. perf.clearMarks(startTag);
  4790. perf.clearMarks(endTag);
  4791. }
  4792. {
  4793. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  4794. }
  4795. }
  4796. function isSupported() {
  4797. if (supported !== void 0) {
  4798. return supported;
  4799. }
  4800. if (typeof window !== "undefined" && window.performance) {
  4801. supported = true;
  4802. perf = window.performance;
  4803. } else {
  4804. supported = false;
  4805. }
  4806. return supported;
  4807. }
  4808. const queuePostRenderEffect$1 = queuePostFlushCb;
  4809. const Fragment = Symbol("Fragment");
  4810. const Text = Symbol("Text");
  4811. const Comment = Symbol("Comment");
  4812. const Static = Symbol("Static");
  4813. function isVNode(value) {
  4814. return value ? value.__v_isVNode === true : false;
  4815. }
  4816. const InternalObjectKey = `__vInternal`;
  4817. function guardReactiveProps(props) {
  4818. if (!props)
  4819. return null;
  4820. return isProxy(props) || InternalObjectKey in props ? extend$1({}, props) : props;
  4821. }
  4822. const emptyAppContext = createAppContext();
  4823. let uid = 0;
  4824. function createComponentInstance(vnode, parent, suspense) {
  4825. const type = vnode.type;
  4826. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  4827. const instance = {
  4828. uid: uid++,
  4829. vnode,
  4830. type,
  4831. parent,
  4832. appContext,
  4833. root: null,
  4834. next: null,
  4835. subTree: null,
  4836. effect: null,
  4837. update: null,
  4838. scope: new EffectScope(
  4839. true
  4840. /* detached */
  4841. ),
  4842. render: null,
  4843. proxy: null,
  4844. exposed: null,
  4845. exposeProxy: null,
  4846. withProxy: null,
  4847. provides: parent ? parent.provides : Object.create(appContext.provides),
  4848. accessCache: null,
  4849. renderCache: [],
  4850. // local resolved assets
  4851. components: null,
  4852. directives: null,
  4853. // resolved props and emits options
  4854. propsOptions: normalizePropsOptions(type, appContext),
  4855. emitsOptions: normalizeEmitsOptions(type, appContext),
  4856. // emit
  4857. emit: null,
  4858. emitted: null,
  4859. // props default value
  4860. propsDefaults: EMPTY_OBJ,
  4861. // inheritAttrs
  4862. inheritAttrs: type.inheritAttrs,
  4863. // state
  4864. ctx: EMPTY_OBJ,
  4865. data: EMPTY_OBJ,
  4866. props: EMPTY_OBJ,
  4867. attrs: EMPTY_OBJ,
  4868. slots: EMPTY_OBJ,
  4869. refs: EMPTY_OBJ,
  4870. setupState: EMPTY_OBJ,
  4871. setupContext: null,
  4872. // suspense related
  4873. suspense,
  4874. suspenseId: suspense ? suspense.pendingId : 0,
  4875. asyncDep: null,
  4876. asyncResolved: false,
  4877. // lifecycle hooks
  4878. // not using enums here because it results in computed properties
  4879. isMounted: false,
  4880. isUnmounted: false,
  4881. isDeactivated: false,
  4882. bc: null,
  4883. c: null,
  4884. bm: null,
  4885. m: null,
  4886. bu: null,
  4887. u: null,
  4888. um: null,
  4889. bum: null,
  4890. da: null,
  4891. a: null,
  4892. rtg: null,
  4893. rtc: null,
  4894. ec: null,
  4895. sp: null
  4896. };
  4897. {
  4898. instance.ctx = createDevRenderContext(instance);
  4899. }
  4900. instance.root = parent ? parent.root : instance;
  4901. instance.emit = emit.bind(null, instance);
  4902. if (vnode.ce) {
  4903. vnode.ce(instance);
  4904. }
  4905. return instance;
  4906. }
  4907. let currentInstance = null;
  4908. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  4909. const setCurrentInstance = (instance) => {
  4910. currentInstance = instance;
  4911. instance.scope.on();
  4912. };
  4913. const unsetCurrentInstance = () => {
  4914. currentInstance && currentInstance.scope.off();
  4915. currentInstance = null;
  4916. };
  4917. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  4918. function validateComponentName(name, config) {
  4919. const appIsNativeTag = config.isNativeTag || NO;
  4920. if (isBuiltInTag(name) || appIsNativeTag(name)) {
  4921. warn$2("Do not use built-in or reserved HTML elements as component id: " + name);
  4922. }
  4923. }
  4924. function isStatefulComponent(instance) {
  4925. return instance.vnode.shapeFlag & 4;
  4926. }
  4927. let isInSSRComponentSetup = false;
  4928. function setupComponent(instance, isSSR = false) {
  4929. isInSSRComponentSetup = isSSR;
  4930. const {
  4931. props
  4932. /*, children*/
  4933. } = instance.vnode;
  4934. const isStateful = isStatefulComponent(instance);
  4935. initProps$1(instance, props, isStateful, isSSR);
  4936. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  4937. isInSSRComponentSetup = false;
  4938. return setupResult;
  4939. }
  4940. function setupStatefulComponent(instance, isSSR) {
  4941. const Component2 = instance.type;
  4942. {
  4943. if (Component2.name) {
  4944. validateComponentName(Component2.name, instance.appContext.config);
  4945. }
  4946. if (Component2.components) {
  4947. const names = Object.keys(Component2.components);
  4948. for (let i = 0; i < names.length; i++) {
  4949. validateComponentName(names[i], instance.appContext.config);
  4950. }
  4951. }
  4952. if (Component2.directives) {
  4953. const names = Object.keys(Component2.directives);
  4954. for (let i = 0; i < names.length; i++) {
  4955. validateDirectiveName(names[i]);
  4956. }
  4957. }
  4958. if (Component2.compilerOptions && isRuntimeOnly()) {
  4959. warn$2(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`);
  4960. }
  4961. }
  4962. instance.accessCache = /* @__PURE__ */ Object.create(null);
  4963. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  4964. {
  4965. exposePropsOnRenderContext(instance);
  4966. }
  4967. const { setup } = Component2;
  4968. if (setup) {
  4969. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  4970. setCurrentInstance(instance);
  4971. pauseTracking();
  4972. const setupResult = callWithErrorHandling(setup, instance, 0, [shallowReadonly(instance.props), setupContext]);
  4973. resetTracking();
  4974. unsetCurrentInstance();
  4975. if (isPromise(setupResult)) {
  4976. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  4977. {
  4978. warn$2(`setup() returned a Promise, but the version of Vue you are using does not support it yet.`);
  4979. }
  4980. } else {
  4981. handleSetupResult(instance, setupResult, isSSR);
  4982. }
  4983. } else {
  4984. finishComponentSetup(instance, isSSR);
  4985. }
  4986. }
  4987. function handleSetupResult(instance, setupResult, isSSR) {
  4988. if (isFunction$1(setupResult)) {
  4989. {
  4990. instance.render = setupResult;
  4991. }
  4992. } else if (isObject$1(setupResult)) {
  4993. if (isVNode(setupResult)) {
  4994. warn$2(`setup() should not return VNodes directly - return a render function instead.`);
  4995. }
  4996. {
  4997. instance.devtoolsRawSetupState = setupResult;
  4998. }
  4999. instance.setupState = proxyRefs(setupResult);
  5000. {
  5001. exposeSetupStateOnRenderContext(instance);
  5002. }
  5003. } else if (setupResult !== void 0) {
  5004. warn$2(`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`);
  5005. }
  5006. finishComponentSetup(instance, isSSR);
  5007. }
  5008. let compile;
  5009. const isRuntimeOnly = () => !compile;
  5010. function finishComponentSetup(instance, isSSR, skipOptions) {
  5011. const Component2 = instance.type;
  5012. if (!instance.render) {
  5013. instance.render = Component2.render || NOOP;
  5014. }
  5015. {
  5016. setCurrentInstance(instance);
  5017. pauseTracking();
  5018. applyOptions$1(instance);
  5019. resetTracking();
  5020. unsetCurrentInstance();
  5021. }
  5022. if (!Component2.render && instance.render === NOOP && !isSSR) {
  5023. if (Component2.template) {
  5024. warn$2(
  5025. `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
  5026. /* should not happen */
  5027. );
  5028. } else {
  5029. warn$2(`Component is missing template or render function.`);
  5030. }
  5031. }
  5032. }
  5033. function createAttrsProxy(instance) {
  5034. return new Proxy(
  5035. instance.attrs,
  5036. {
  5037. get(target, key) {
  5038. track(instance, "get", "$attrs");
  5039. return target[key];
  5040. },
  5041. set() {
  5042. warn$2(`setupContext.attrs is readonly.`);
  5043. return false;
  5044. },
  5045. deleteProperty() {
  5046. warn$2(`setupContext.attrs is readonly.`);
  5047. return false;
  5048. }
  5049. }
  5050. );
  5051. }
  5052. function createSetupContext(instance) {
  5053. const expose = (exposed) => {
  5054. {
  5055. if (instance.exposed) {
  5056. warn$2(`expose() should be called only once per setup().`);
  5057. }
  5058. if (exposed != null) {
  5059. let exposedType = typeof exposed;
  5060. if (exposedType === "object") {
  5061. if (isArray$1(exposed)) {
  5062. exposedType = "array";
  5063. } else if (isRef(exposed)) {
  5064. exposedType = "ref";
  5065. }
  5066. }
  5067. if (exposedType !== "object") {
  5068. warn$2(`expose() should be passed a plain object, received ${exposedType}.`);
  5069. }
  5070. }
  5071. }
  5072. instance.exposed = exposed || {};
  5073. };
  5074. let attrs;
  5075. {
  5076. return Object.freeze({
  5077. get attrs() {
  5078. return attrs || (attrs = createAttrsProxy(instance));
  5079. },
  5080. get slots() {
  5081. return shallowReadonly(instance.slots);
  5082. },
  5083. get emit() {
  5084. return (event, ...args) => instance.emit(event, ...args);
  5085. },
  5086. expose
  5087. });
  5088. }
  5089. }
  5090. function getExposeProxy(instance) {
  5091. if (instance.exposed) {
  5092. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  5093. get(target, key) {
  5094. if (key in target) {
  5095. return target[key];
  5096. }
  5097. return instance.proxy[key];
  5098. },
  5099. has(target, key) {
  5100. return key in target || key in publicPropertiesMap;
  5101. }
  5102. }));
  5103. }
  5104. }
  5105. const classifyRE = /(?:^|[-_])(\w)/g;
  5106. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  5107. function getComponentName(Component2, includeInferred = true) {
  5108. return isFunction$1(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
  5109. }
  5110. function formatComponentName(instance, Component2, isRoot = false) {
  5111. let name = getComponentName(Component2);
  5112. if (!name && Component2.__file) {
  5113. const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
  5114. if (match) {
  5115. name = match[1];
  5116. }
  5117. }
  5118. if (!name && instance && instance.parent) {
  5119. const inferFromRegistry = (registry) => {
  5120. for (const key in registry) {
  5121. if (registry[key] === Component2) {
  5122. return key;
  5123. }
  5124. }
  5125. };
  5126. name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
  5127. }
  5128. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  5129. }
  5130. const computed = (getterOrOptions, debugOptions) => {
  5131. return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  5132. };
  5133. const version = "3.2.47";
  5134. function unwrapper(target) {
  5135. return unref(target);
  5136. }
  5137. const ARRAYTYPE = "[object Array]";
  5138. const OBJECTTYPE = "[object Object]";
  5139. function diff$1(current, pre) {
  5140. const result = {};
  5141. syncKeys(current, pre);
  5142. _diff(current, pre, "", result);
  5143. return result;
  5144. }
  5145. function syncKeys(current, pre) {
  5146. current = unwrapper(current);
  5147. if (current === pre)
  5148. return;
  5149. const rootCurrentType = toTypeString(current);
  5150. const rootPreType = toTypeString(pre);
  5151. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  5152. for (let key in pre) {
  5153. const currentValue = current[key];
  5154. if (currentValue === void 0) {
  5155. current[key] = null;
  5156. } else {
  5157. syncKeys(currentValue, pre[key]);
  5158. }
  5159. }
  5160. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  5161. if (current.length >= pre.length) {
  5162. pre.forEach((item, index2) => {
  5163. syncKeys(current[index2], item);
  5164. });
  5165. }
  5166. }
  5167. }
  5168. function _diff(current, pre, path, result) {
  5169. current = unwrapper(current);
  5170. if (current === pre)
  5171. return;
  5172. const rootCurrentType = toTypeString(current);
  5173. const rootPreType = toTypeString(pre);
  5174. if (rootCurrentType == OBJECTTYPE) {
  5175. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  5176. setResult(result, path, current);
  5177. } else {
  5178. for (let key in current) {
  5179. const currentValue = unwrapper(current[key]);
  5180. const preValue = pre[key];
  5181. const currentType = toTypeString(currentValue);
  5182. const preType = toTypeString(preValue);
  5183. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  5184. if (currentValue != preValue) {
  5185. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5186. }
  5187. } else if (currentType == ARRAYTYPE) {
  5188. if (preType != ARRAYTYPE) {
  5189. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5190. } else {
  5191. if (currentValue.length < preValue.length) {
  5192. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5193. } else {
  5194. currentValue.forEach((item, index2) => {
  5195. _diff(item, preValue[index2], (path == "" ? "" : path + ".") + key + "[" + index2 + "]", result);
  5196. });
  5197. }
  5198. }
  5199. } else if (currentType == OBJECTTYPE) {
  5200. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  5201. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5202. } else {
  5203. for (let subKey in currentValue) {
  5204. _diff(currentValue[subKey], preValue[subKey], (path == "" ? "" : path + ".") + key + "." + subKey, result);
  5205. }
  5206. }
  5207. }
  5208. }
  5209. }
  5210. } else if (rootCurrentType == ARRAYTYPE) {
  5211. if (rootPreType != ARRAYTYPE) {
  5212. setResult(result, path, current);
  5213. } else {
  5214. if (current.length < pre.length) {
  5215. setResult(result, path, current);
  5216. } else {
  5217. current.forEach((item, index2) => {
  5218. _diff(item, pre[index2], path + "[" + index2 + "]", result);
  5219. });
  5220. }
  5221. }
  5222. } else {
  5223. setResult(result, path, current);
  5224. }
  5225. }
  5226. function setResult(result, k, v) {
  5227. result[k] = v;
  5228. }
  5229. function hasComponentEffect(instance) {
  5230. return queue.includes(instance.update);
  5231. }
  5232. function flushCallbacks(instance) {
  5233. const ctx = instance.ctx;
  5234. const callbacks = ctx.__next_tick_callbacks;
  5235. if (callbacks && callbacks.length) {
  5236. const copies = callbacks.slice(0);
  5237. callbacks.length = 0;
  5238. for (let i = 0; i < copies.length; i++) {
  5239. copies[i]();
  5240. }
  5241. }
  5242. }
  5243. function nextTick(instance, fn) {
  5244. const ctx = instance.ctx;
  5245. if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
  5246. return nextTick$1(fn && fn.bind(instance.proxy));
  5247. }
  5248. let _resolve;
  5249. if (!ctx.__next_tick_callbacks) {
  5250. ctx.__next_tick_callbacks = [];
  5251. }
  5252. ctx.__next_tick_callbacks.push(() => {
  5253. if (fn) {
  5254. callWithErrorHandling(
  5255. fn.bind(instance.proxy),
  5256. instance,
  5257. 14
  5258. /* ErrorCodes.SCHEDULER */
  5259. );
  5260. } else if (_resolve) {
  5261. _resolve(instance.proxy);
  5262. }
  5263. });
  5264. return new Promise((resolve2) => {
  5265. _resolve = resolve2;
  5266. });
  5267. }
  5268. function clone$2(src, seen) {
  5269. src = unwrapper(src);
  5270. const type = typeof src;
  5271. if (type === "object" && src !== null) {
  5272. let copy = seen.get(src);
  5273. if (typeof copy !== "undefined") {
  5274. return copy;
  5275. }
  5276. if (isArray$1(src)) {
  5277. const len = src.length;
  5278. copy = new Array(len);
  5279. seen.set(src, copy);
  5280. for (let i = 0; i < len; i++) {
  5281. copy[i] = clone$2(src[i], seen);
  5282. }
  5283. } else {
  5284. copy = {};
  5285. seen.set(src, copy);
  5286. for (const name in src) {
  5287. if (hasOwn(src, name)) {
  5288. copy[name] = clone$2(src[name], seen);
  5289. }
  5290. }
  5291. }
  5292. return copy;
  5293. }
  5294. if (type !== "symbol") {
  5295. return src;
  5296. }
  5297. }
  5298. function deepCopy(src) {
  5299. return clone$2(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
  5300. }
  5301. function getMPInstanceData(instance, keys2) {
  5302. const data = instance.data;
  5303. const ret = /* @__PURE__ */ Object.create(null);
  5304. keys2.forEach((key) => {
  5305. ret[key] = data[key];
  5306. });
  5307. return ret;
  5308. }
  5309. function patch(instance, data, oldData) {
  5310. if (!data) {
  5311. return;
  5312. }
  5313. data = deepCopy(data);
  5314. const ctx = instance.ctx;
  5315. const mpType = ctx.mpType;
  5316. if (mpType === "page" || mpType === "component") {
  5317. data.r0 = 1;
  5318. const mpInstance = ctx.$scope;
  5319. const keys2 = Object.keys(data);
  5320. const diffData = diff$1(data, oldData || getMPInstanceData(mpInstance, keys2));
  5321. if (Object.keys(diffData).length) {
  5322. ctx.__next_tick_pending = true;
  5323. mpInstance.setData(diffData, () => {
  5324. ctx.__next_tick_pending = false;
  5325. flushCallbacks(instance);
  5326. });
  5327. flushPreFlushCbs();
  5328. } else {
  5329. flushCallbacks(instance);
  5330. }
  5331. }
  5332. }
  5333. function initAppConfig(appConfig) {
  5334. appConfig.globalProperties.$nextTick = function $nextTick(fn) {
  5335. return nextTick(this.$, fn);
  5336. };
  5337. }
  5338. function onApplyOptions(options, instance, publicThis) {
  5339. instance.appContext.config.globalProperties.$applyOptions(options, instance, publicThis);
  5340. const computedOptions = options.computed;
  5341. if (computedOptions) {
  5342. const keys2 = Object.keys(computedOptions);
  5343. if (keys2.length) {
  5344. const ctx = instance.ctx;
  5345. if (!ctx.$computedKeys) {
  5346. ctx.$computedKeys = [];
  5347. }
  5348. ctx.$computedKeys.push(...keys2);
  5349. }
  5350. }
  5351. delete instance.ctx.$onApplyOptions;
  5352. }
  5353. function setRef$1(instance, isUnmount = false) {
  5354. const { setupState, $templateRefs, ctx: { $scope, $mpPlatform } } = instance;
  5355. if ($mpPlatform === "mp-alipay") {
  5356. return;
  5357. }
  5358. if (!$templateRefs || !$scope) {
  5359. return;
  5360. }
  5361. if (isUnmount) {
  5362. return $templateRefs.forEach((templateRef) => setTemplateRef(templateRef, null, setupState));
  5363. }
  5364. const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  5365. const doSetByRefs = (refs) => {
  5366. const mpComponents = (
  5367. // 字节小程序 selectAllComponents 可能返回 null
  5368. // https://github.com/dcloudio/uni-app/issues/3954
  5369. ($scope.selectAllComponents(".r") || []).concat($scope.selectAllComponents(".r-i-f") || [])
  5370. );
  5371. return refs.filter((templateRef) => {
  5372. const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
  5373. if (check && refValue === null) {
  5374. return true;
  5375. }
  5376. setTemplateRef(templateRef, refValue, setupState);
  5377. return false;
  5378. });
  5379. };
  5380. const doSet = () => {
  5381. const refs = doSetByRefs($templateRefs);
  5382. if (refs.length && instance.proxy && instance.proxy.$scope) {
  5383. instance.proxy.$scope.setData({ r1: 1 }, () => {
  5384. doSetByRefs(refs);
  5385. });
  5386. }
  5387. };
  5388. if ($scope._$setRef) {
  5389. $scope._$setRef(doSet);
  5390. } else {
  5391. nextTick(instance, doSet);
  5392. }
  5393. }
  5394. function toSkip(value) {
  5395. if (isObject$1(value)) {
  5396. markRaw(value);
  5397. }
  5398. return value;
  5399. }
  5400. function findComponentPublicInstance(mpComponents, id) {
  5401. const mpInstance = mpComponents.find((com) => com && (com.properties || com.props).uI === id);
  5402. if (mpInstance) {
  5403. const vm = mpInstance.$vm;
  5404. if (vm) {
  5405. return getExposeProxy(vm.$) || vm;
  5406. }
  5407. return toSkip(mpInstance);
  5408. }
  5409. return null;
  5410. }
  5411. function setTemplateRef({ r, f: f2 }, refValue, setupState) {
  5412. if (isFunction$1(r)) {
  5413. r(refValue, {});
  5414. } else {
  5415. const _isString = isString$1(r);
  5416. const _isRef = isRef(r);
  5417. if (_isString || _isRef) {
  5418. if (f2) {
  5419. if (!_isRef) {
  5420. return;
  5421. }
  5422. if (!isArray$1(r.value)) {
  5423. r.value = [];
  5424. }
  5425. const existing = r.value;
  5426. if (existing.indexOf(refValue) === -1) {
  5427. existing.push(refValue);
  5428. if (!refValue) {
  5429. return;
  5430. }
  5431. onBeforeUnmount(() => remove(existing, refValue), refValue.$);
  5432. }
  5433. } else if (_isString) {
  5434. if (hasOwn(setupState, r)) {
  5435. setupState[r] = refValue;
  5436. }
  5437. } else if (isRef(r)) {
  5438. r.value = refValue;
  5439. } else {
  5440. warnRef(r);
  5441. }
  5442. } else {
  5443. warnRef(r);
  5444. }
  5445. }
  5446. }
  5447. function warnRef(ref2) {
  5448. warn$2("Invalid template ref type:", ref2, `(${typeof ref2})`);
  5449. }
  5450. var MPType;
  5451. (function(MPType2) {
  5452. MPType2["APP"] = "app";
  5453. MPType2["PAGE"] = "page";
  5454. MPType2["COMPONENT"] = "component";
  5455. })(MPType || (MPType = {}));
  5456. const queuePostRenderEffect = queuePostFlushCb;
  5457. function mountComponent(initialVNode, options) {
  5458. const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  5459. {
  5460. instance.ctx.$onApplyOptions = onApplyOptions;
  5461. instance.ctx.$children = [];
  5462. }
  5463. if (options.mpType === "app") {
  5464. instance.render = NOOP;
  5465. }
  5466. if (options.onBeforeSetup) {
  5467. options.onBeforeSetup(instance, options);
  5468. }
  5469. {
  5470. pushWarningContext(initialVNode);
  5471. startMeasure(instance, `mount`);
  5472. }
  5473. {
  5474. startMeasure(instance, `init`);
  5475. }
  5476. setupComponent(instance);
  5477. {
  5478. endMeasure(instance, `init`);
  5479. }
  5480. {
  5481. if (options.parentComponent && instance.proxy) {
  5482. options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
  5483. }
  5484. }
  5485. setupRenderEffect(instance);
  5486. {
  5487. popWarningContext();
  5488. endMeasure(instance, `mount`);
  5489. }
  5490. return instance.proxy;
  5491. }
  5492. const getFunctionalFallthrough = (attrs) => {
  5493. let res;
  5494. for (const key in attrs) {
  5495. if (key === "class" || key === "style" || isOn(key)) {
  5496. (res || (res = {}))[key] = attrs[key];
  5497. }
  5498. }
  5499. return res;
  5500. };
  5501. function renderComponentRoot(instance) {
  5502. const { type: Component2, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit: emit2, render, renderCache, data, setupState, ctx, uid: uid2, appContext: { app: { config: { globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 } } } }, inheritAttrs } = instance;
  5503. instance.$templateRefs = [];
  5504. instance.$ei = 0;
  5505. pruneComponentPropsCache2(uid2);
  5506. instance.__counter = instance.__counter === 0 ? 1 : 0;
  5507. let result;
  5508. const prev = setCurrentRenderingInstance(instance);
  5509. try {
  5510. if (vnode.shapeFlag & 4) {
  5511. fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
  5512. const proxyToUse = withProxy || proxy;
  5513. result = render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx);
  5514. } else {
  5515. fallthroughAttrs(inheritAttrs, props, propsOptions, Component2.props ? attrs : getFunctionalFallthrough(attrs));
  5516. const render2 = Component2;
  5517. result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
  5518. props,
  5519. null
  5520. /* we know it doesn't need it */
  5521. );
  5522. }
  5523. } catch (err) {
  5524. handleError(
  5525. err,
  5526. instance,
  5527. 1
  5528. /* ErrorCodes.RENDER_FUNCTION */
  5529. );
  5530. result = false;
  5531. }
  5532. setRef$1(instance);
  5533. setCurrentRenderingInstance(prev);
  5534. return result;
  5535. }
  5536. function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  5537. if (props && fallthroughAttrs2 && inheritAttrs !== false) {
  5538. const keys2 = Object.keys(fallthroughAttrs2).filter((key) => key !== "class" && key !== "style");
  5539. if (!keys2.length) {
  5540. return;
  5541. }
  5542. if (propsOptions && keys2.some(isModelListener)) {
  5543. keys2.forEach((key) => {
  5544. if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
  5545. props[key] = fallthroughAttrs2[key];
  5546. }
  5547. });
  5548. } else {
  5549. keys2.forEach((key) => props[key] = fallthroughAttrs2[key]);
  5550. }
  5551. }
  5552. }
  5553. const updateComponentPreRender = (instance) => {
  5554. pauseTracking();
  5555. flushPreFlushCbs();
  5556. resetTracking();
  5557. };
  5558. function componentUpdateScopedSlotsFn() {
  5559. const scopedSlotsData = this.$scopedSlotsData;
  5560. if (!scopedSlotsData || scopedSlotsData.length === 0) {
  5561. return;
  5562. }
  5563. const mpInstance = this.ctx.$scope;
  5564. const oldData = mpInstance.data;
  5565. const diffData = /* @__PURE__ */ Object.create(null);
  5566. scopedSlotsData.forEach(({ path, index: index2, data }) => {
  5567. const oldScopedSlotData = getValueByDataPath(oldData, path);
  5568. const diffPath = isString$1(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
  5569. if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
  5570. diffData[diffPath] = data;
  5571. } else {
  5572. const diffScopedSlotData = diff$1(data, oldScopedSlotData[index2]);
  5573. Object.keys(diffScopedSlotData).forEach((name) => {
  5574. diffData[diffPath + "." + name] = diffScopedSlotData[name];
  5575. });
  5576. }
  5577. });
  5578. scopedSlotsData.length = 0;
  5579. if (Object.keys(diffData).length) {
  5580. mpInstance.setData(diffData);
  5581. }
  5582. }
  5583. function toggleRecurse({ effect, update }, allowed) {
  5584. effect.allowRecurse = update.allowRecurse = allowed;
  5585. }
  5586. function setupRenderEffect(instance) {
  5587. const updateScopedSlots = componentUpdateScopedSlotsFn.bind(instance);
  5588. instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  5589. const componentUpdateFn = () => {
  5590. if (!instance.isMounted) {
  5591. onBeforeUnmount(() => {
  5592. setRef$1(instance, true);
  5593. }, instance);
  5594. {
  5595. startMeasure(instance, `patch`);
  5596. }
  5597. patch(instance, renderComponentRoot(instance));
  5598. {
  5599. endMeasure(instance, `patch`);
  5600. }
  5601. {
  5602. devtoolsComponentAdded(instance);
  5603. }
  5604. } else {
  5605. const { next, bu, u } = instance;
  5606. {
  5607. pushWarningContext(next || instance.vnode);
  5608. }
  5609. toggleRecurse(instance, false);
  5610. updateComponentPreRender();
  5611. if (bu) {
  5612. invokeArrayFns$1(bu);
  5613. }
  5614. toggleRecurse(instance, true);
  5615. {
  5616. startMeasure(instance, `patch`);
  5617. }
  5618. patch(instance, renderComponentRoot(instance));
  5619. {
  5620. endMeasure(instance, `patch`);
  5621. }
  5622. if (u) {
  5623. queuePostRenderEffect(u);
  5624. }
  5625. {
  5626. devtoolsComponentUpdated(instance);
  5627. }
  5628. {
  5629. popWarningContext();
  5630. }
  5631. }
  5632. };
  5633. const effect = instance.effect = new ReactiveEffect(
  5634. componentUpdateFn,
  5635. () => queueJob(instance.update),
  5636. instance.scope
  5637. // track it in component's effect scope
  5638. );
  5639. const update = instance.update = effect.run.bind(effect);
  5640. update.id = instance.uid;
  5641. toggleRecurse(instance, true);
  5642. {
  5643. effect.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
  5644. effect.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
  5645. update.ownerInstance = instance;
  5646. }
  5647. update();
  5648. }
  5649. function unmountComponent(instance) {
  5650. const { bum, scope, update, um } = instance;
  5651. if (bum) {
  5652. invokeArrayFns$1(bum);
  5653. }
  5654. scope.stop();
  5655. if (update) {
  5656. update.active = false;
  5657. }
  5658. if (um) {
  5659. queuePostRenderEffect(um);
  5660. }
  5661. queuePostRenderEffect(() => {
  5662. instance.isUnmounted = true;
  5663. });
  5664. {
  5665. devtoolsComponentRemoved(instance);
  5666. }
  5667. }
  5668. const oldCreateApp = createAppAPI();
  5669. function getTarget() {
  5670. if (typeof window !== "undefined") {
  5671. return window;
  5672. }
  5673. if (typeof globalThis !== "undefined") {
  5674. return globalThis;
  5675. }
  5676. if (typeof global !== "undefined") {
  5677. return global;
  5678. }
  5679. if (typeof my !== "undefined") {
  5680. return my;
  5681. }
  5682. }
  5683. function createVueApp(rootComponent, rootProps = null) {
  5684. const target = getTarget();
  5685. target.__VUE__ = true;
  5686. {
  5687. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5688. }
  5689. const app = oldCreateApp(rootComponent, rootProps);
  5690. const appContext = app._context;
  5691. initAppConfig(appContext.config);
  5692. const createVNode = (initialVNode) => {
  5693. initialVNode.appContext = appContext;
  5694. initialVNode.shapeFlag = 6;
  5695. return initialVNode;
  5696. };
  5697. const createComponent2 = function createComponent3(initialVNode, options) {
  5698. return mountComponent(createVNode(initialVNode), options);
  5699. };
  5700. const destroyComponent = function destroyComponent2(component) {
  5701. return component && unmountComponent(component.$);
  5702. };
  5703. app.mount = function mount() {
  5704. rootComponent.render = NOOP;
  5705. const instance = mountComponent(createVNode({ type: rootComponent }), {
  5706. mpType: MPType.APP,
  5707. mpInstance: null,
  5708. parentComponent: null,
  5709. slots: [],
  5710. props: null
  5711. });
  5712. app._instance = instance.$;
  5713. {
  5714. devtoolsInitApp(app, version);
  5715. }
  5716. instance.$app = app;
  5717. instance.$createComponent = createComponent2;
  5718. instance.$destroyComponent = destroyComponent;
  5719. appContext.$appInstance = instance;
  5720. return instance;
  5721. };
  5722. app.unmount = function unmount() {
  5723. warn$2(`Cannot unmount an app.`);
  5724. };
  5725. return app;
  5726. }
  5727. function injectLifecycleHook(name, hook, publicThis, instance) {
  5728. if (isFunction$1(hook)) {
  5729. injectHook(name, hook.bind(publicThis), instance);
  5730. }
  5731. }
  5732. function initHooks$1(options, instance, publicThis) {
  5733. const mpType = options.mpType || publicThis.$mpType;
  5734. if (!mpType || mpType === "component") {
  5735. return;
  5736. }
  5737. Object.keys(options).forEach((name) => {
  5738. if (isUniLifecycleHook(name, options[name], false)) {
  5739. const hooks2 = options[name];
  5740. if (isArray$1(hooks2)) {
  5741. hooks2.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
  5742. } else {
  5743. injectLifecycleHook(name, hooks2, publicThis, instance);
  5744. }
  5745. }
  5746. });
  5747. }
  5748. function applyOptions$2(options, instance, publicThis) {
  5749. initHooks$1(options, instance, publicThis);
  5750. }
  5751. function set$3(target, key, val) {
  5752. return target[key] = val;
  5753. }
  5754. function createErrorHandler(app) {
  5755. return function errorHandler(err, instance, _info) {
  5756. if (!instance) {
  5757. throw err;
  5758. }
  5759. const appInstance = app._instance;
  5760. if (!appInstance || !appInstance.proxy) {
  5761. throw err;
  5762. }
  5763. {
  5764. appInstance.proxy.$callHook(ON_ERROR, err);
  5765. }
  5766. };
  5767. }
  5768. function mergeAsArray(to2, from2) {
  5769. return to2 ? [...new Set([].concat(to2, from2))] : from2;
  5770. }
  5771. function initOptionMergeStrategies(optionMergeStrategies) {
  5772. UniLifecycleHooks.forEach((name) => {
  5773. optionMergeStrategies[name] = mergeAsArray;
  5774. });
  5775. }
  5776. let realAtob;
  5777. const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  5778. const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  5779. if (typeof atob !== "function") {
  5780. realAtob = function(str) {
  5781. str = String(str).replace(/[\t\n\f\r ]+/g, "");
  5782. if (!b64re.test(str)) {
  5783. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  5784. }
  5785. str += "==".slice(2 - (str.length & 3));
  5786. var bitmap;
  5787. var result = "";
  5788. var r1;
  5789. var r2;
  5790. var i = 0;
  5791. for (; i < str.length; ) {
  5792. 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++)));
  5793. 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);
  5794. }
  5795. return result;
  5796. };
  5797. } else {
  5798. realAtob = atob;
  5799. }
  5800. function b64DecodeUnicode(str) {
  5801. return decodeURIComponent(realAtob(str).split("").map(function(c) {
  5802. return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
  5803. }).join(""));
  5804. }
  5805. function getCurrentUserInfo() {
  5806. const token2 = index.getStorageSync("uni_id_token") || "";
  5807. const tokenArr = token2.split(".");
  5808. if (!token2 || tokenArr.length !== 3) {
  5809. return {
  5810. uid: null,
  5811. role: [],
  5812. permission: [],
  5813. tokenExpired: 0
  5814. };
  5815. }
  5816. let userInfo;
  5817. try {
  5818. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  5819. } catch (error) {
  5820. throw new Error("获取当前用户信息出错,详细错误信息为:" + error.message);
  5821. }
  5822. userInfo.tokenExpired = userInfo.exp * 1e3;
  5823. delete userInfo.exp;
  5824. delete userInfo.iat;
  5825. return userInfo;
  5826. }
  5827. function uniIdMixin(globalProperties) {
  5828. globalProperties.uniIDHasRole = function(roleId) {
  5829. const { role } = getCurrentUserInfo();
  5830. return role.indexOf(roleId) > -1;
  5831. };
  5832. globalProperties.uniIDHasPermission = function(permissionId) {
  5833. const { permission } = getCurrentUserInfo();
  5834. return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  5835. };
  5836. globalProperties.uniIDTokenValid = function() {
  5837. const { tokenExpired } = getCurrentUserInfo();
  5838. return tokenExpired > Date.now();
  5839. };
  5840. }
  5841. function initApp(app) {
  5842. const appConfig = app._context.config;
  5843. appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  5844. initOptionMergeStrategies(appConfig.optionMergeStrategies);
  5845. const globalProperties = appConfig.globalProperties;
  5846. {
  5847. uniIdMixin(globalProperties);
  5848. }
  5849. {
  5850. globalProperties.$set = set$3;
  5851. globalProperties.$applyOptions = applyOptions$2;
  5852. }
  5853. {
  5854. index.invokeCreateVueAppHook(app);
  5855. }
  5856. }
  5857. const propsCaches = /* @__PURE__ */ Object.create(null);
  5858. function renderProps(props) {
  5859. const { uid: uid2, __counter } = getCurrentInstance();
  5860. const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  5861. return uid2 + "," + propsId + "," + __counter;
  5862. }
  5863. function pruneComponentPropsCache(uid2) {
  5864. delete propsCaches[uid2];
  5865. }
  5866. function findComponentPropsData(up) {
  5867. if (!up) {
  5868. return;
  5869. }
  5870. const [uid2, propsId] = up.split(",");
  5871. if (!propsCaches[uid2]) {
  5872. return;
  5873. }
  5874. return propsCaches[uid2][parseInt(propsId)];
  5875. }
  5876. var plugin = {
  5877. install(app) {
  5878. initApp(app);
  5879. app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
  5880. const oldMount = app.mount;
  5881. app.mount = function mount(rootContainer) {
  5882. const instance = oldMount.call(app, rootContainer);
  5883. const createApp2 = getCreateApp();
  5884. if (createApp2) {
  5885. createApp2(instance);
  5886. } else {
  5887. if (typeof createMiniProgramApp !== "undefined") {
  5888. createMiniProgramApp(instance);
  5889. }
  5890. }
  5891. return instance;
  5892. };
  5893. }
  5894. };
  5895. function getCreateApp() {
  5896. const method = "createApp";
  5897. if (typeof global !== "undefined") {
  5898. return global[method];
  5899. } else if (typeof my !== "undefined") {
  5900. return my[method];
  5901. }
  5902. }
  5903. function vOn(value, key) {
  5904. const instance = getCurrentInstance();
  5905. const ctx = instance.ctx;
  5906. const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq") && (isString$1(key) || typeof key === "number") ? "_" + key : "";
  5907. const name = "e" + instance.$ei++ + extraKey;
  5908. const mpInstance = ctx.$scope;
  5909. if (!value) {
  5910. delete mpInstance[name];
  5911. return name;
  5912. }
  5913. const existingInvoker = mpInstance[name];
  5914. if (existingInvoker) {
  5915. existingInvoker.value = value;
  5916. } else {
  5917. mpInstance[name] = createInvoker(value, instance);
  5918. }
  5919. return name;
  5920. }
  5921. function createInvoker(initialValue, instance) {
  5922. const invoker = (e2) => {
  5923. patchMPEvent(e2);
  5924. let args = [e2];
  5925. if (e2.detail && e2.detail.__args__) {
  5926. args = e2.detail.__args__;
  5927. }
  5928. const eventValue = invoker.value;
  5929. const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
  5930. const eventTarget = e2.target;
  5931. const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
  5932. if (bubbles.includes(e2.type) && !eventSync) {
  5933. setTimeout(invoke);
  5934. } else {
  5935. const res = invoke();
  5936. if (e2.type === "input" && (isArray$1(res) || isPromise(res))) {
  5937. return;
  5938. }
  5939. return res;
  5940. }
  5941. };
  5942. invoker.value = initialValue;
  5943. return invoker;
  5944. }
  5945. const bubbles = [
  5946. // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
  5947. // 'touchstart',
  5948. // 'touchmove',
  5949. // 'touchcancel',
  5950. // 'touchend',
  5951. "tap",
  5952. "longpress",
  5953. "longtap",
  5954. "transitionend",
  5955. "animationstart",
  5956. "animationiteration",
  5957. "animationend",
  5958. "touchforcechange"
  5959. ];
  5960. function patchMPEvent(event) {
  5961. if (event.type && event.target) {
  5962. event.preventDefault = NOOP;
  5963. event.stopPropagation = NOOP;
  5964. event.stopImmediatePropagation = NOOP;
  5965. if (!hasOwn(event, "detail")) {
  5966. event.detail = {};
  5967. }
  5968. if (hasOwn(event, "markerId")) {
  5969. event.detail = typeof event.detail === "object" ? event.detail : {};
  5970. event.detail.markerId = event.markerId;
  5971. }
  5972. if (isPlainObject(event.detail) && hasOwn(event.detail, "checked") && !hasOwn(event.detail, "value")) {
  5973. event.detail.value = event.detail.checked;
  5974. }
  5975. if (isPlainObject(event.detail)) {
  5976. event.target = extend$1({}, event.target, event.detail);
  5977. }
  5978. }
  5979. }
  5980. function patchStopImmediatePropagation(e2, value) {
  5981. if (isArray$1(value)) {
  5982. const originalStop = e2.stopImmediatePropagation;
  5983. e2.stopImmediatePropagation = () => {
  5984. originalStop && originalStop.call(e2);
  5985. e2._stopped = true;
  5986. };
  5987. return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  5988. } else {
  5989. return value;
  5990. }
  5991. }
  5992. function vFor(source, renderItem) {
  5993. let ret;
  5994. if (isArray$1(source) || isString$1(source)) {
  5995. ret = new Array(source.length);
  5996. for (let i = 0, l = source.length; i < l; i++) {
  5997. ret[i] = renderItem(source[i], i, i);
  5998. }
  5999. } else if (typeof source === "number") {
  6000. if (!Number.isInteger(source)) {
  6001. warn$2(`The v-for range expect an integer value but got ${source}.`);
  6002. return [];
  6003. }
  6004. ret = new Array(source);
  6005. for (let i = 0; i < source; i++) {
  6006. ret[i] = renderItem(i + 1, i, i);
  6007. }
  6008. } else if (isObject$1(source)) {
  6009. if (source[Symbol.iterator]) {
  6010. ret = Array.from(source, (item, i) => renderItem(item, i, i));
  6011. } else {
  6012. const keys2 = Object.keys(source);
  6013. ret = new Array(keys2.length);
  6014. for (let i = 0, l = keys2.length; i < l; i++) {
  6015. const key = keys2[i];
  6016. ret[i] = renderItem(source[key], key, i);
  6017. }
  6018. }
  6019. } else {
  6020. ret = [];
  6021. }
  6022. return ret;
  6023. }
  6024. function stringifyStyle(value) {
  6025. if (isString$1(value)) {
  6026. return value;
  6027. }
  6028. return stringify(normalizeStyle(value));
  6029. }
  6030. function stringify(styles) {
  6031. let ret = "";
  6032. if (!styles || isString$1(styles)) {
  6033. return ret;
  6034. }
  6035. for (const key in styles) {
  6036. ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  6037. }
  6038. return ret;
  6039. }
  6040. function setRef(ref2, id, opts = {}) {
  6041. const { $templateRefs } = getCurrentInstance();
  6042. $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
  6043. }
  6044. const o = (value, key) => vOn(value, key);
  6045. const f = (source, renderItem) => vFor(source, renderItem);
  6046. const s = (value) => stringifyStyle(value);
  6047. const e = (target, ...sources) => extend$1(target, ...sources);
  6048. const n = (value) => normalizeClass(value);
  6049. const t = (val) => toDisplayString(val);
  6050. const p = (props) => renderProps(props);
  6051. const sr = (ref2, id, opts) => setRef(ref2, id, opts);
  6052. function createApp$1(rootComponent, rootProps = null) {
  6053. rootComponent && (rootComponent.mpType = "app");
  6054. return createVueApp(rootComponent, rootProps).use(plugin);
  6055. }
  6056. const createSSRApp = createApp$1;
  6057. const MP_METHODS = [
  6058. "createSelectorQuery",
  6059. "createIntersectionObserver",
  6060. "selectAllComponents",
  6061. "selectComponent"
  6062. ];
  6063. function createEmitFn(oldEmit, ctx) {
  6064. return function emit2(event, ...args) {
  6065. const scope = ctx.$scope;
  6066. if (scope && event) {
  6067. const detail = { __args__: args };
  6068. {
  6069. scope.triggerEvent(event, detail);
  6070. }
  6071. }
  6072. return oldEmit.apply(this, [event, ...args]);
  6073. };
  6074. }
  6075. function initBaseInstance(instance, options) {
  6076. const ctx = instance.ctx;
  6077. ctx.mpType = options.mpType;
  6078. ctx.$mpType = options.mpType;
  6079. ctx.$mpPlatform = "mp-weixin";
  6080. ctx.$scope = options.mpInstance;
  6081. ctx.$mp = {};
  6082. {
  6083. ctx._self = {};
  6084. }
  6085. instance.slots = {};
  6086. if (isArray$1(options.slots) && options.slots.length) {
  6087. options.slots.forEach((name) => {
  6088. instance.slots[name] = true;
  6089. });
  6090. if (instance.slots[SLOT_DEFAULT_NAME]) {
  6091. instance.slots.default = true;
  6092. }
  6093. }
  6094. ctx.getOpenerEventChannel = function() {
  6095. {
  6096. return options.mpInstance.getOpenerEventChannel();
  6097. }
  6098. };
  6099. ctx.$hasHook = hasHook;
  6100. ctx.$callHook = callHook;
  6101. instance.emit = createEmitFn(instance.emit, ctx);
  6102. }
  6103. function initComponentInstance(instance, options) {
  6104. initBaseInstance(instance, options);
  6105. const ctx = instance.ctx;
  6106. MP_METHODS.forEach((method) => {
  6107. ctx[method] = function(...args) {
  6108. const mpInstance = ctx.$scope;
  6109. if (mpInstance && mpInstance[method]) {
  6110. return mpInstance[method].apply(mpInstance, args);
  6111. }
  6112. };
  6113. });
  6114. }
  6115. function initMocks(instance, mpInstance, mocks2) {
  6116. const ctx = instance.ctx;
  6117. mocks2.forEach((mock) => {
  6118. if (hasOwn(mpInstance, mock)) {
  6119. instance[mock] = ctx[mock] = mpInstance[mock];
  6120. }
  6121. });
  6122. }
  6123. function hasHook(name) {
  6124. const hooks2 = this.$[name];
  6125. if (hooks2 && hooks2.length) {
  6126. return true;
  6127. }
  6128. return false;
  6129. }
  6130. function callHook(name, args) {
  6131. if (name === "mounted") {
  6132. callHook.call(this, "bm");
  6133. this.$.isMounted = true;
  6134. name = "m";
  6135. }
  6136. const hooks2 = this.$[name];
  6137. return hooks2 && invokeArrayFns(hooks2, args);
  6138. }
  6139. const PAGE_INIT_HOOKS = [
  6140. ON_LOAD,
  6141. ON_SHOW,
  6142. ON_HIDE,
  6143. ON_UNLOAD,
  6144. ON_RESIZE,
  6145. ON_TAB_ITEM_TAP,
  6146. ON_REACH_BOTTOM,
  6147. ON_PULL_DOWN_REFRESH,
  6148. ON_ADD_TO_FAVORITES
  6149. // 'onReady', // lifetimes.ready
  6150. // 'onPageScroll', // 影响性能,开发者手动注册
  6151. // 'onShareTimeline', // 右上角菜单,开发者手动注册
  6152. // 'onShareAppMessage' // 右上角菜单,开发者手动注册
  6153. ];
  6154. function findHooks(vueOptions, hooks2 = /* @__PURE__ */ new Set()) {
  6155. if (vueOptions) {
  6156. Object.keys(vueOptions).forEach((name) => {
  6157. if (isUniLifecycleHook(name, vueOptions[name])) {
  6158. hooks2.add(name);
  6159. }
  6160. });
  6161. {
  6162. const { extends: extendsOptions, mixins } = vueOptions;
  6163. if (mixins) {
  6164. mixins.forEach((mixin) => findHooks(mixin, hooks2));
  6165. }
  6166. if (extendsOptions) {
  6167. findHooks(extendsOptions, hooks2);
  6168. }
  6169. }
  6170. }
  6171. return hooks2;
  6172. }
  6173. function initHook(mpOptions, hook, excludes) {
  6174. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  6175. mpOptions[hook] = function(args) {
  6176. return this.$vm && this.$vm.$callHook(hook, args);
  6177. };
  6178. }
  6179. }
  6180. const EXCLUDE_HOOKS = [ON_READY];
  6181. function initHooks(mpOptions, hooks2, excludes = EXCLUDE_HOOKS) {
  6182. hooks2.forEach((hook) => initHook(mpOptions, hook, excludes));
  6183. }
  6184. function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  6185. findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
  6186. }
  6187. function initRuntimeHooks(mpOptions, runtimeHooks) {
  6188. if (!runtimeHooks) {
  6189. return;
  6190. }
  6191. const hooks2 = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  6192. hooks2.forEach((hook) => {
  6193. if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
  6194. initHook(mpOptions, hook, []);
  6195. }
  6196. });
  6197. }
  6198. const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  6199. const runtimeHooks = [];
  6200. const app = isFunction$1(getApp) && getApp({ allowDefault: true });
  6201. if (app && app.$vm && app.$vm.$) {
  6202. const mixins = app.$vm.$.appContext.mixins;
  6203. if (isArray$1(mixins)) {
  6204. const hooks2 = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  6205. mixins.forEach((mixin) => {
  6206. hooks2.forEach((hook) => {
  6207. if (hasOwn(mixin, hook) && !runtimeHooks.includes(hook)) {
  6208. runtimeHooks.push(hook);
  6209. }
  6210. });
  6211. });
  6212. }
  6213. }
  6214. return runtimeHooks;
  6215. });
  6216. function initMixinRuntimeHooks(mpOptions) {
  6217. initHooks(mpOptions, findMixinRuntimeHooks());
  6218. }
  6219. const HOOKS = [
  6220. ON_SHOW,
  6221. ON_HIDE,
  6222. ON_ERROR,
  6223. ON_THEME_CHANGE,
  6224. ON_PAGE_NOT_FOUND,
  6225. ON_UNHANDLE_REJECTION
  6226. ];
  6227. function parseApp(instance, parseAppOptions) {
  6228. const internalInstance = instance.$;
  6229. const appOptions = {
  6230. globalData: instance.$options && instance.$options.globalData || {},
  6231. $vm: instance,
  6232. onLaunch(options) {
  6233. this.$vm = instance;
  6234. const ctx = internalInstance.ctx;
  6235. if (this.$vm && ctx.$scope) {
  6236. return;
  6237. }
  6238. initBaseInstance(internalInstance, {
  6239. mpType: "app",
  6240. mpInstance: this,
  6241. slots: []
  6242. });
  6243. ctx.globalData = this.globalData;
  6244. instance.$callHook(ON_LAUNCH, options);
  6245. }
  6246. };
  6247. initLocale(instance);
  6248. const vueOptions = instance.$.type;
  6249. initHooks(appOptions, HOOKS);
  6250. initUnknownHooks(appOptions, vueOptions);
  6251. {
  6252. const methods = vueOptions.methods;
  6253. methods && extend$1(appOptions, methods);
  6254. }
  6255. if (parseAppOptions) {
  6256. parseAppOptions.parse(appOptions);
  6257. }
  6258. return appOptions;
  6259. }
  6260. function initCreateApp(parseAppOptions) {
  6261. return function createApp2(vm) {
  6262. return App(parseApp(vm, parseAppOptions));
  6263. };
  6264. }
  6265. function initCreateSubpackageApp(parseAppOptions) {
  6266. return function createApp2(vm) {
  6267. const appOptions = parseApp(vm, parseAppOptions);
  6268. const app = isFunction$1(getApp) && getApp({
  6269. allowDefault: true
  6270. });
  6271. if (!app)
  6272. return;
  6273. vm.$.ctx.$scope = app;
  6274. const globalData = app.globalData;
  6275. if (globalData) {
  6276. Object.keys(appOptions.globalData).forEach((name) => {
  6277. if (!hasOwn(globalData, name)) {
  6278. globalData[name] = appOptions.globalData[name];
  6279. }
  6280. });
  6281. }
  6282. Object.keys(appOptions).forEach((name) => {
  6283. if (!hasOwn(app, name)) {
  6284. app[name] = appOptions[name];
  6285. }
  6286. });
  6287. initAppLifecycle(appOptions, vm);
  6288. };
  6289. }
  6290. function initAppLifecycle(appOptions, vm) {
  6291. if (isFunction$1(appOptions.onLaunch)) {
  6292. const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  6293. appOptions.onLaunch(args);
  6294. }
  6295. if (isFunction$1(appOptions.onShow) && wx.onAppShow) {
  6296. wx.onAppShow((args) => {
  6297. vm.$callHook("onShow", args);
  6298. });
  6299. }
  6300. if (isFunction$1(appOptions.onHide) && wx.onAppHide) {
  6301. wx.onAppHide((args) => {
  6302. vm.$callHook("onHide", args);
  6303. });
  6304. }
  6305. }
  6306. function initLocale(appVm) {
  6307. const locale2 = ref(normalizeLocale$1(wx.getSystemInfoSync().language) || LOCALE_EN);
  6308. Object.defineProperty(appVm, "$locale", {
  6309. get() {
  6310. return locale2.value;
  6311. },
  6312. set(v) {
  6313. locale2.value = v;
  6314. }
  6315. });
  6316. }
  6317. function initVueIds(vueIds, mpInstance) {
  6318. if (!vueIds) {
  6319. return;
  6320. }
  6321. const ids = vueIds.split(",");
  6322. const len = ids.length;
  6323. if (len === 1) {
  6324. mpInstance._$vueId = ids[0];
  6325. } else if (len === 2) {
  6326. mpInstance._$vueId = ids[0];
  6327. mpInstance._$vuePid = ids[1];
  6328. }
  6329. }
  6330. const EXTRAS = ["externalClasses"];
  6331. function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  6332. EXTRAS.forEach((name) => {
  6333. if (hasOwn(vueOptions, name)) {
  6334. miniProgramComponentOptions[name] = vueOptions[name];
  6335. }
  6336. });
  6337. }
  6338. const WORKLET_RE = /_(.*)_worklet_factory_/;
  6339. function initWorkletMethods(mpMethods, vueMethods) {
  6340. if (vueMethods) {
  6341. Object.keys(vueMethods).forEach((name) => {
  6342. const matches = name.match(WORKLET_RE);
  6343. if (matches) {
  6344. const workletName = matches[1];
  6345. mpMethods[name] = vueMethods[name];
  6346. mpMethods[workletName] = vueMethods[workletName];
  6347. }
  6348. });
  6349. }
  6350. }
  6351. function initWxsCallMethods(methods, wxsCallMethods) {
  6352. if (!isArray$1(wxsCallMethods)) {
  6353. return;
  6354. }
  6355. wxsCallMethods.forEach((callMethod) => {
  6356. methods[callMethod] = function(args) {
  6357. return this.$vm[callMethod](args);
  6358. };
  6359. });
  6360. }
  6361. function selectAllComponents(mpInstance, selector, $refs) {
  6362. const components = mpInstance.selectAllComponents(selector);
  6363. components.forEach((component) => {
  6364. const ref2 = component.properties.uR;
  6365. $refs[ref2] = component.$vm || component;
  6366. });
  6367. }
  6368. function initRefs(instance, mpInstance) {
  6369. Object.defineProperty(instance, "refs", {
  6370. get() {
  6371. const $refs = {};
  6372. selectAllComponents(mpInstance, ".r", $refs);
  6373. const forComponents = mpInstance.selectAllComponents(".r-i-f");
  6374. forComponents.forEach((component) => {
  6375. const ref2 = component.properties.uR;
  6376. if (!ref2) {
  6377. return;
  6378. }
  6379. if (!$refs[ref2]) {
  6380. $refs[ref2] = [];
  6381. }
  6382. $refs[ref2].push(component.$vm || component);
  6383. });
  6384. return $refs;
  6385. }
  6386. });
  6387. }
  6388. function findVmByVueId(instance, vuePid) {
  6389. const $children = instance.$children;
  6390. for (let i = $children.length - 1; i >= 0; i--) {
  6391. const childVm = $children[i];
  6392. if (childVm.$scope._$vueId === vuePid) {
  6393. return childVm;
  6394. }
  6395. }
  6396. let parentVm;
  6397. for (let i = $children.length - 1; i >= 0; i--) {
  6398. parentVm = findVmByVueId($children[i], vuePid);
  6399. if (parentVm) {
  6400. return parentVm;
  6401. }
  6402. }
  6403. }
  6404. const builtInProps = [
  6405. // 百度小程序,快手小程序自定义组件不支持绑定动态事件,动态dataset,故通过props传递事件信息
  6406. // event-opts
  6407. "eO",
  6408. // 组件 ref
  6409. "uR",
  6410. // 组件 ref-in-for
  6411. "uRIF",
  6412. // 组件 id
  6413. "uI",
  6414. // 组件类型 m: 小程序组件
  6415. "uT",
  6416. // 组件 props
  6417. "uP",
  6418. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  6419. "uS"
  6420. ];
  6421. function initDefaultProps(options, isBehavior = false) {
  6422. const properties = {};
  6423. if (!isBehavior) {
  6424. builtInProps.forEach((name) => {
  6425. properties[name] = {
  6426. type: null,
  6427. value: ""
  6428. };
  6429. });
  6430. properties.uS = {
  6431. type: null,
  6432. value: [],
  6433. observer: function(newVal) {
  6434. const $slots = /* @__PURE__ */ Object.create(null);
  6435. newVal && newVal.forEach((slotName) => {
  6436. $slots[slotName] = true;
  6437. });
  6438. this.setData({
  6439. $slots
  6440. });
  6441. }
  6442. };
  6443. }
  6444. if (options.behaviors) {
  6445. if (options.behaviors.includes("wx://form-field")) {
  6446. if (!options.properties || !options.properties.name) {
  6447. properties.name = {
  6448. type: null,
  6449. value: ""
  6450. };
  6451. }
  6452. if (!options.properties || !options.properties.value) {
  6453. properties.value = {
  6454. type: null,
  6455. value: ""
  6456. };
  6457. }
  6458. }
  6459. }
  6460. return properties;
  6461. }
  6462. function initVirtualHostProps(options) {
  6463. const properties = {};
  6464. {
  6465. if (options && options.virtualHost) {
  6466. properties.virtualHostStyle = {
  6467. type: null,
  6468. value: ""
  6469. };
  6470. properties.virtualHostClass = {
  6471. type: null,
  6472. value: ""
  6473. };
  6474. }
  6475. }
  6476. return properties;
  6477. }
  6478. function initProps(mpComponentOptions) {
  6479. if (!mpComponentOptions.properties) {
  6480. mpComponentOptions.properties = {};
  6481. }
  6482. extend$1(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
  6483. }
  6484. const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  6485. function parsePropType(type, defaultValue) {
  6486. if (isArray$1(type) && type.length === 1) {
  6487. return type[0];
  6488. }
  6489. return type;
  6490. }
  6491. function normalizePropType(type, defaultValue) {
  6492. const res = parsePropType(type);
  6493. return PROP_TYPES.indexOf(res) !== -1 ? res : null;
  6494. }
  6495. function initPageProps({ properties }, rawProps) {
  6496. if (isArray$1(rawProps)) {
  6497. rawProps.forEach((key) => {
  6498. properties[key] = {
  6499. type: String,
  6500. value: ""
  6501. };
  6502. });
  6503. } else if (isPlainObject(rawProps)) {
  6504. Object.keys(rawProps).forEach((key) => {
  6505. const opts = rawProps[key];
  6506. if (isPlainObject(opts)) {
  6507. let value = opts.default;
  6508. if (isFunction$1(value)) {
  6509. value = value();
  6510. }
  6511. const type = opts.type;
  6512. opts.type = normalizePropType(type);
  6513. properties[key] = {
  6514. type: opts.type,
  6515. value
  6516. };
  6517. } else {
  6518. properties[key] = {
  6519. type: normalizePropType(opts)
  6520. };
  6521. }
  6522. });
  6523. }
  6524. }
  6525. function findPropsData(properties, isPage2) {
  6526. return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(properties.uP)) || {};
  6527. }
  6528. function findPagePropsData(properties) {
  6529. const propsData = {};
  6530. if (isPlainObject(properties)) {
  6531. Object.keys(properties).forEach((name) => {
  6532. if (builtInProps.indexOf(name) === -1) {
  6533. propsData[name] = properties[name];
  6534. }
  6535. });
  6536. }
  6537. return propsData;
  6538. }
  6539. function initFormField(vm) {
  6540. const vueOptions = vm.$options;
  6541. if (isArray$1(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
  6542. vm.$watch("modelValue", () => {
  6543. vm.$scope && vm.$scope.setData({
  6544. name: vm.name,
  6545. value: vm.modelValue
  6546. });
  6547. }, {
  6548. immediate: true
  6549. });
  6550. }
  6551. }
  6552. function initData(_) {
  6553. return {};
  6554. }
  6555. function initPropsObserver(componentOptions) {
  6556. const observe = function observe2() {
  6557. const up = this.properties.uP;
  6558. if (!up) {
  6559. return;
  6560. }
  6561. if (this.$vm) {
  6562. updateComponentProps(up, this.$vm.$);
  6563. } else if (this.properties.uT === "m") {
  6564. updateMiniProgramComponentProperties(up, this);
  6565. }
  6566. };
  6567. {
  6568. if (!componentOptions.observers) {
  6569. componentOptions.observers = {};
  6570. }
  6571. componentOptions.observers.uP = observe;
  6572. }
  6573. }
  6574. function updateMiniProgramComponentProperties(up, mpInstance) {
  6575. const prevProps = mpInstance.properties;
  6576. const nextProps = findComponentPropsData(up) || {};
  6577. if (hasPropsChanged(prevProps, nextProps, false)) {
  6578. mpInstance.setData(nextProps);
  6579. }
  6580. }
  6581. function updateComponentProps(up, instance) {
  6582. const prevProps = toRaw(instance.props);
  6583. const nextProps = findComponentPropsData(up) || {};
  6584. if (hasPropsChanged(prevProps, nextProps)) {
  6585. updateProps(instance, nextProps, prevProps, false);
  6586. if (hasQueueJob(instance.update)) {
  6587. invalidateJob(instance.update);
  6588. }
  6589. {
  6590. instance.update();
  6591. }
  6592. }
  6593. }
  6594. function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  6595. const nextKeys = Object.keys(nextProps);
  6596. if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
  6597. return true;
  6598. }
  6599. for (let i = 0; i < nextKeys.length; i++) {
  6600. const key = nextKeys[i];
  6601. if (nextProps[key] !== prevProps[key]) {
  6602. return true;
  6603. }
  6604. }
  6605. return false;
  6606. }
  6607. function initBehaviors(vueOptions) {
  6608. const vueBehaviors = vueOptions.behaviors;
  6609. let vueProps = vueOptions.props;
  6610. if (!vueProps) {
  6611. vueOptions.props = vueProps = [];
  6612. }
  6613. const behaviors = [];
  6614. if (isArray$1(vueBehaviors)) {
  6615. vueBehaviors.forEach((behavior) => {
  6616. behaviors.push(behavior.replace("uni://", "wx://"));
  6617. if (behavior === "uni://form-field") {
  6618. if (isArray$1(vueProps)) {
  6619. vueProps.push("name");
  6620. vueProps.push("modelValue");
  6621. } else {
  6622. vueProps.name = {
  6623. type: String,
  6624. default: ""
  6625. };
  6626. vueProps.modelValue = {
  6627. type: [String, Number, Boolean, Array, Object, Date],
  6628. default: ""
  6629. };
  6630. }
  6631. }
  6632. });
  6633. }
  6634. return behaviors;
  6635. }
  6636. function applyOptions(componentOptions, vueOptions) {
  6637. componentOptions.data = initData();
  6638. componentOptions.behaviors = initBehaviors(vueOptions);
  6639. }
  6640. function parseComponent(vueOptions, { parse, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  6641. vueOptions = vueOptions.default || vueOptions;
  6642. const options = {
  6643. multipleSlots: true,
  6644. // styleIsolation: 'apply-shared',
  6645. addGlobalClass: true,
  6646. pureDataPattern: /^uP$/
  6647. };
  6648. if (isArray$1(vueOptions.mixins)) {
  6649. vueOptions.mixins.forEach((item) => {
  6650. if (isObject$1(item.options)) {
  6651. extend$1(options, item.options);
  6652. }
  6653. });
  6654. }
  6655. if (vueOptions.options) {
  6656. extend$1(options, vueOptions.options);
  6657. }
  6658. const mpComponentOptions = {
  6659. options,
  6660. lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
  6661. pageLifetimes: {
  6662. show() {
  6663. this.$vm && this.$vm.$callHook("onPageShow");
  6664. },
  6665. hide() {
  6666. this.$vm && this.$vm.$callHook("onPageHide");
  6667. },
  6668. resize(size2) {
  6669. this.$vm && this.$vm.$callHook("onPageResize", size2);
  6670. }
  6671. },
  6672. methods: {
  6673. __l: handleLink2
  6674. }
  6675. };
  6676. {
  6677. applyOptions(mpComponentOptions, vueOptions);
  6678. }
  6679. initProps(mpComponentOptions);
  6680. initPropsObserver(mpComponentOptions);
  6681. initExtraOptions(mpComponentOptions, vueOptions);
  6682. initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  6683. {
  6684. initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
  6685. }
  6686. if (parse) {
  6687. parse(mpComponentOptions, { handleLink: handleLink2 });
  6688. }
  6689. return mpComponentOptions;
  6690. }
  6691. function initCreateComponent(parseOptions2) {
  6692. return function createComponent2(vueComponentOptions) {
  6693. return Component(parseComponent(vueComponentOptions, parseOptions2));
  6694. };
  6695. }
  6696. let $createComponentFn;
  6697. let $destroyComponentFn;
  6698. function getAppVm() {
  6699. return getApp().$vm;
  6700. }
  6701. function $createComponent(initialVNode, options) {
  6702. if (!$createComponentFn) {
  6703. $createComponentFn = getAppVm().$createComponent;
  6704. }
  6705. const proxy = $createComponentFn(initialVNode, options);
  6706. return getExposeProxy(proxy.$) || proxy;
  6707. }
  6708. function $destroyComponent(instance) {
  6709. if (!$destroyComponentFn) {
  6710. $destroyComponentFn = getAppVm().$destroyComponent;
  6711. }
  6712. return $destroyComponentFn(instance);
  6713. }
  6714. function parsePage(vueOptions, parseOptions2) {
  6715. const { parse, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  6716. const miniProgramPageOptions = parseComponent(vueOptions, {
  6717. mocks: mocks2,
  6718. isPage: isPage2,
  6719. initRelation: initRelation2,
  6720. handleLink: handleLink2,
  6721. initLifetimes: initLifetimes2
  6722. });
  6723. initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  6724. const methods = miniProgramPageOptions.methods;
  6725. methods.onLoad = function(query) {
  6726. this.options = query;
  6727. this.$page = {
  6728. fullPath: addLeadingSlash(this.route + stringifyQuery(query))
  6729. };
  6730. return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  6731. };
  6732. initHooks(methods, PAGE_INIT_HOOKS);
  6733. {
  6734. initUnknownHooks(methods, vueOptions);
  6735. }
  6736. initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  6737. initMixinRuntimeHooks(methods);
  6738. parse && parse(miniProgramPageOptions, { handleLink: handleLink2 });
  6739. return miniProgramPageOptions;
  6740. }
  6741. function initCreatePage(parseOptions2) {
  6742. return function createPage2(vuePageOptions) {
  6743. return Component(parsePage(vuePageOptions, parseOptions2));
  6744. };
  6745. }
  6746. function initCreatePluginApp(parseAppOptions) {
  6747. return function createApp2(vm) {
  6748. initAppLifecycle(parseApp(vm, parseAppOptions), vm);
  6749. };
  6750. }
  6751. const MPPage = Page;
  6752. const MPComponent = Component;
  6753. function initTriggerEvent(mpInstance) {
  6754. const oldTriggerEvent = mpInstance.triggerEvent;
  6755. const newTriggerEvent = function(event, ...args) {
  6756. return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
  6757. };
  6758. try {
  6759. mpInstance.triggerEvent = newTriggerEvent;
  6760. } catch (error) {
  6761. mpInstance._triggerEvent = newTriggerEvent;
  6762. }
  6763. }
  6764. function initMiniProgramHook(name, options, isComponent) {
  6765. const oldHook = options[name];
  6766. if (!oldHook) {
  6767. options[name] = function() {
  6768. initTriggerEvent(this);
  6769. };
  6770. } else {
  6771. options[name] = function(...args) {
  6772. initTriggerEvent(this);
  6773. return oldHook.apply(this, args);
  6774. };
  6775. }
  6776. }
  6777. Page = function(options) {
  6778. initMiniProgramHook(ON_LOAD, options);
  6779. return MPPage(options);
  6780. };
  6781. Component = function(options) {
  6782. initMiniProgramHook("created", options);
  6783. const isVueComponent = options.properties && options.properties.uP;
  6784. if (!isVueComponent) {
  6785. initProps(options);
  6786. initPropsObserver(options);
  6787. }
  6788. return MPComponent(options);
  6789. };
  6790. function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  6791. return {
  6792. attached() {
  6793. let properties = this.properties;
  6794. initVueIds(properties.uI, this);
  6795. const relationOptions = {
  6796. vuePid: this._$vuePid
  6797. };
  6798. initRelation2(this, relationOptions);
  6799. const mpInstance = this;
  6800. const isMiniProgramPage = isPage2(mpInstance);
  6801. let propsData = properties;
  6802. this.$vm = $createComponent({
  6803. type: vueOptions,
  6804. props: findPropsData(propsData, isMiniProgramPage)
  6805. }, {
  6806. mpType: isMiniProgramPage ? "page" : "component",
  6807. mpInstance,
  6808. slots: properties.uS || {},
  6809. parentComponent: relationOptions.parent && relationOptions.parent.$,
  6810. onBeforeSetup(instance, options) {
  6811. initRefs(instance, mpInstance);
  6812. initMocks(instance, mpInstance, mocks2);
  6813. initComponentInstance(instance, options);
  6814. }
  6815. });
  6816. if (!isMiniProgramPage) {
  6817. initFormField(this.$vm);
  6818. }
  6819. },
  6820. ready() {
  6821. if (this.$vm) {
  6822. {
  6823. this.$vm.$callHook("mounted");
  6824. this.$vm.$callHook(ON_READY);
  6825. }
  6826. }
  6827. },
  6828. detached() {
  6829. if (this.$vm) {
  6830. pruneComponentPropsCache(this.$vm.$.uid);
  6831. $destroyComponent(this.$vm);
  6832. }
  6833. }
  6834. };
  6835. }
  6836. const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  6837. function isPage(mpInstance) {
  6838. return !!mpInstance.route;
  6839. }
  6840. function initRelation(mpInstance, detail) {
  6841. mpInstance.triggerEvent("__l", detail);
  6842. }
  6843. function handleLink(event) {
  6844. const detail = event.detail || event.value;
  6845. const vuePid = detail.vuePid;
  6846. let parentVm;
  6847. if (vuePid) {
  6848. parentVm = findVmByVueId(this.$vm, vuePid);
  6849. }
  6850. if (!parentVm) {
  6851. parentVm = this.$vm;
  6852. }
  6853. detail.parent = parentVm;
  6854. }
  6855. var parseOptions = /* @__PURE__ */ Object.freeze({
  6856. __proto__: null,
  6857. handleLink,
  6858. initLifetimes,
  6859. initRelation,
  6860. isPage,
  6861. mocks
  6862. });
  6863. const createApp = initCreateApp();
  6864. const createPage = initCreatePage(parseOptions);
  6865. const createComponent = initCreateComponent(parseOptions);
  6866. const createPluginApp = initCreatePluginApp();
  6867. const createSubpackageApp = initCreateSubpackageApp();
  6868. {
  6869. wx.createApp = global.createApp = createApp;
  6870. wx.createPage = createPage;
  6871. wx.createComponent = createComponent;
  6872. wx.createPluginApp = global.createPluginApp = createPluginApp;
  6873. wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
  6874. }
  6875. const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
  6876. !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
  6877. };
  6878. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  6879. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  6880. const onPullDownRefresh = /* @__PURE__ */ createHook(ON_PULL_DOWN_REFRESH);
  6881. //! moment.js
  6882. //! version : 2.29.4
  6883. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  6884. //! license : MIT
  6885. //! momentjs.com
  6886. var hookCallback;
  6887. function hooks() {
  6888. return hookCallback.apply(null, arguments);
  6889. }
  6890. function setHookCallback(callback) {
  6891. hookCallback = callback;
  6892. }
  6893. function isArray(input) {
  6894. return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
  6895. }
  6896. function isObject(input) {
  6897. return input != null && Object.prototype.toString.call(input) === "[object Object]";
  6898. }
  6899. function hasOwnProp(a, b) {
  6900. return Object.prototype.hasOwnProperty.call(a, b);
  6901. }
  6902. function isObjectEmpty(obj) {
  6903. if (Object.getOwnPropertyNames) {
  6904. return Object.getOwnPropertyNames(obj).length === 0;
  6905. } else {
  6906. var k;
  6907. for (k in obj) {
  6908. if (hasOwnProp(obj, k)) {
  6909. return false;
  6910. }
  6911. }
  6912. return true;
  6913. }
  6914. }
  6915. function isUndefined(input) {
  6916. return input === void 0;
  6917. }
  6918. function isNumber(input) {
  6919. return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
  6920. }
  6921. function isDate(input) {
  6922. return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
  6923. }
  6924. function map(arr, fn) {
  6925. var res = [], i, arrLen = arr.length;
  6926. for (i = 0; i < arrLen; ++i) {
  6927. res.push(fn(arr[i], i));
  6928. }
  6929. return res;
  6930. }
  6931. function extend(a, b) {
  6932. for (var i in b) {
  6933. if (hasOwnProp(b, i)) {
  6934. a[i] = b[i];
  6935. }
  6936. }
  6937. if (hasOwnProp(b, "toString")) {
  6938. a.toString = b.toString;
  6939. }
  6940. if (hasOwnProp(b, "valueOf")) {
  6941. a.valueOf = b.valueOf;
  6942. }
  6943. return a;
  6944. }
  6945. function createUTC(input, format2, locale2, strict) {
  6946. return createLocalOrUTC(input, format2, locale2, strict, true).utc();
  6947. }
  6948. function defaultParsingFlags() {
  6949. return {
  6950. empty: false,
  6951. unusedTokens: [],
  6952. unusedInput: [],
  6953. overflow: -2,
  6954. charsLeftOver: 0,
  6955. nullInput: false,
  6956. invalidEra: null,
  6957. invalidMonth: null,
  6958. invalidFormat: false,
  6959. userInvalidated: false,
  6960. iso: false,
  6961. parsedDateParts: [],
  6962. era: null,
  6963. meridiem: null,
  6964. rfc2822: false,
  6965. weekdayMismatch: false
  6966. };
  6967. }
  6968. function getParsingFlags(m) {
  6969. if (m._pf == null) {
  6970. m._pf = defaultParsingFlags();
  6971. }
  6972. return m._pf;
  6973. }
  6974. var some;
  6975. if (Array.prototype.some) {
  6976. some = Array.prototype.some;
  6977. } else {
  6978. some = function(fun) {
  6979. var t2 = Object(this), len = t2.length >>> 0, i;
  6980. for (i = 0; i < len; i++) {
  6981. if (i in t2 && fun.call(this, t2[i], i, t2)) {
  6982. return true;
  6983. }
  6984. }
  6985. return false;
  6986. };
  6987. }
  6988. function isValid(m) {
  6989. if (m._isValid == null) {
  6990. var flags = getParsingFlags(m), parsedParts = some.call(flags.parsedDateParts, function(i) {
  6991. return i != null;
  6992. }), isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
  6993. if (m._strict) {
  6994. isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
  6995. }
  6996. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  6997. m._isValid = isNowValid;
  6998. } else {
  6999. return isNowValid;
  7000. }
  7001. }
  7002. return m._isValid;
  7003. }
  7004. function createInvalid(flags) {
  7005. var m = createUTC(NaN);
  7006. if (flags != null) {
  7007. extend(getParsingFlags(m), flags);
  7008. } else {
  7009. getParsingFlags(m).userInvalidated = true;
  7010. }
  7011. return m;
  7012. }
  7013. var momentProperties = hooks.momentProperties = [], updateInProgress = false;
  7014. function copyConfig(to2, from2) {
  7015. var i, prop, val, momentPropertiesLen = momentProperties.length;
  7016. if (!isUndefined(from2._isAMomentObject)) {
  7017. to2._isAMomentObject = from2._isAMomentObject;
  7018. }
  7019. if (!isUndefined(from2._i)) {
  7020. to2._i = from2._i;
  7021. }
  7022. if (!isUndefined(from2._f)) {
  7023. to2._f = from2._f;
  7024. }
  7025. if (!isUndefined(from2._l)) {
  7026. to2._l = from2._l;
  7027. }
  7028. if (!isUndefined(from2._strict)) {
  7029. to2._strict = from2._strict;
  7030. }
  7031. if (!isUndefined(from2._tzm)) {
  7032. to2._tzm = from2._tzm;
  7033. }
  7034. if (!isUndefined(from2._isUTC)) {
  7035. to2._isUTC = from2._isUTC;
  7036. }
  7037. if (!isUndefined(from2._offset)) {
  7038. to2._offset = from2._offset;
  7039. }
  7040. if (!isUndefined(from2._pf)) {
  7041. to2._pf = getParsingFlags(from2);
  7042. }
  7043. if (!isUndefined(from2._locale)) {
  7044. to2._locale = from2._locale;
  7045. }
  7046. if (momentPropertiesLen > 0) {
  7047. for (i = 0; i < momentPropertiesLen; i++) {
  7048. prop = momentProperties[i];
  7049. val = from2[prop];
  7050. if (!isUndefined(val)) {
  7051. to2[prop] = val;
  7052. }
  7053. }
  7054. }
  7055. return to2;
  7056. }
  7057. function Moment(config) {
  7058. copyConfig(this, config);
  7059. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  7060. if (!this.isValid()) {
  7061. this._d = /* @__PURE__ */ new Date(NaN);
  7062. }
  7063. if (updateInProgress === false) {
  7064. updateInProgress = true;
  7065. hooks.updateOffset(this);
  7066. updateInProgress = false;
  7067. }
  7068. }
  7069. function isMoment(obj) {
  7070. return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
  7071. }
  7072. function warn(msg) {
  7073. if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
  7074. console.warn("Deprecation warning: " + msg);
  7075. }
  7076. }
  7077. function deprecate(msg, fn) {
  7078. var firstTime = true;
  7079. return extend(function() {
  7080. if (hooks.deprecationHandler != null) {
  7081. hooks.deprecationHandler(null, msg);
  7082. }
  7083. if (firstTime) {
  7084. var args = [], arg, i, key, argLen = arguments.length;
  7085. for (i = 0; i < argLen; i++) {
  7086. arg = "";
  7087. if (typeof arguments[i] === "object") {
  7088. arg += "\n[" + i + "] ";
  7089. for (key in arguments[0]) {
  7090. if (hasOwnProp(arguments[0], key)) {
  7091. arg += key + ": " + arguments[0][key] + ", ";
  7092. }
  7093. }
  7094. arg = arg.slice(0, -2);
  7095. } else {
  7096. arg = arguments[i];
  7097. }
  7098. args.push(arg);
  7099. }
  7100. warn(
  7101. msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
  7102. );
  7103. firstTime = false;
  7104. }
  7105. return fn.apply(this, arguments);
  7106. }, fn);
  7107. }
  7108. var deprecations = {};
  7109. function deprecateSimple(name, msg) {
  7110. if (hooks.deprecationHandler != null) {
  7111. hooks.deprecationHandler(name, msg);
  7112. }
  7113. if (!deprecations[name]) {
  7114. warn(msg);
  7115. deprecations[name] = true;
  7116. }
  7117. }
  7118. hooks.suppressDeprecationWarnings = false;
  7119. hooks.deprecationHandler = null;
  7120. function isFunction(input) {
  7121. return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
  7122. }
  7123. function set(config) {
  7124. var prop, i;
  7125. for (i in config) {
  7126. if (hasOwnProp(config, i)) {
  7127. prop = config[i];
  7128. if (isFunction(prop)) {
  7129. this[i] = prop;
  7130. } else {
  7131. this["_" + i] = prop;
  7132. }
  7133. }
  7134. }
  7135. this._config = config;
  7136. this._dayOfMonthOrdinalParseLenient = new RegExp(
  7137. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
  7138. );
  7139. }
  7140. function mergeConfigs(parentConfig, childConfig) {
  7141. var res = extend({}, parentConfig), prop;
  7142. for (prop in childConfig) {
  7143. if (hasOwnProp(childConfig, prop)) {
  7144. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  7145. res[prop] = {};
  7146. extend(res[prop], parentConfig[prop]);
  7147. extend(res[prop], childConfig[prop]);
  7148. } else if (childConfig[prop] != null) {
  7149. res[prop] = childConfig[prop];
  7150. } else {
  7151. delete res[prop];
  7152. }
  7153. }
  7154. }
  7155. for (prop in parentConfig) {
  7156. if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
  7157. res[prop] = extend({}, res[prop]);
  7158. }
  7159. }
  7160. return res;
  7161. }
  7162. function Locale(config) {
  7163. if (config != null) {
  7164. this.set(config);
  7165. }
  7166. }
  7167. var keys;
  7168. if (Object.keys) {
  7169. keys = Object.keys;
  7170. } else {
  7171. keys = function(obj) {
  7172. var i, res = [];
  7173. for (i in obj) {
  7174. if (hasOwnProp(obj, i)) {
  7175. res.push(i);
  7176. }
  7177. }
  7178. return res;
  7179. };
  7180. }
  7181. var defaultCalendar = {
  7182. sameDay: "[Today at] LT",
  7183. nextDay: "[Tomorrow at] LT",
  7184. nextWeek: "dddd [at] LT",
  7185. lastDay: "[Yesterday at] LT",
  7186. lastWeek: "[Last] dddd [at] LT",
  7187. sameElse: "L"
  7188. };
  7189. function calendar(key, mom, now2) {
  7190. var output = this._calendar[key] || this._calendar["sameElse"];
  7191. return isFunction(output) ? output.call(mom, now2) : output;
  7192. }
  7193. function zeroFill(number, targetLength, forceSign) {
  7194. var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0;
  7195. return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  7196. }
  7197. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
  7198. function addFormatToken(token2, padded, ordinal2, callback) {
  7199. var func = callback;
  7200. if (typeof callback === "string") {
  7201. func = function() {
  7202. return this[callback]();
  7203. };
  7204. }
  7205. if (token2) {
  7206. formatTokenFunctions[token2] = func;
  7207. }
  7208. if (padded) {
  7209. formatTokenFunctions[padded[0]] = function() {
  7210. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  7211. };
  7212. }
  7213. if (ordinal2) {
  7214. formatTokenFunctions[ordinal2] = function() {
  7215. return this.localeData().ordinal(
  7216. func.apply(this, arguments),
  7217. token2
  7218. );
  7219. };
  7220. }
  7221. }
  7222. function removeFormattingTokens(input) {
  7223. if (input.match(/\[[\s\S]/)) {
  7224. return input.replace(/^\[|\]$/g, "");
  7225. }
  7226. return input.replace(/\\/g, "");
  7227. }
  7228. function makeFormatFunction(format2) {
  7229. var array = format2.match(formattingTokens), i, length;
  7230. for (i = 0, length = array.length; i < length; i++) {
  7231. if (formatTokenFunctions[array[i]]) {
  7232. array[i] = formatTokenFunctions[array[i]];
  7233. } else {
  7234. array[i] = removeFormattingTokens(array[i]);
  7235. }
  7236. }
  7237. return function(mom) {
  7238. var output = "", i2;
  7239. for (i2 = 0; i2 < length; i2++) {
  7240. output += isFunction(array[i2]) ? array[i2].call(mom, format2) : array[i2];
  7241. }
  7242. return output;
  7243. };
  7244. }
  7245. function formatMoment(m, format2) {
  7246. if (!m.isValid()) {
  7247. return m.localeData().invalidDate();
  7248. }
  7249. format2 = expandFormat(format2, m.localeData());
  7250. formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
  7251. return formatFunctions[format2](m);
  7252. }
  7253. function expandFormat(format2, locale2) {
  7254. var i = 5;
  7255. function replaceLongDateFormatTokens(input) {
  7256. return locale2.longDateFormat(input) || input;
  7257. }
  7258. localFormattingTokens.lastIndex = 0;
  7259. while (i >= 0 && localFormattingTokens.test(format2)) {
  7260. format2 = format2.replace(
  7261. localFormattingTokens,
  7262. replaceLongDateFormatTokens
  7263. );
  7264. localFormattingTokens.lastIndex = 0;
  7265. i -= 1;
  7266. }
  7267. return format2;
  7268. }
  7269. var defaultLongDateFormat = {
  7270. LTS: "h:mm:ss A",
  7271. LT: "h:mm A",
  7272. L: "MM/DD/YYYY",
  7273. LL: "MMMM D, YYYY",
  7274. LLL: "MMMM D, YYYY h:mm A",
  7275. LLLL: "dddd, MMMM D, YYYY h:mm A"
  7276. };
  7277. function longDateFormat(key) {
  7278. var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
  7279. if (format2 || !formatUpper) {
  7280. return format2;
  7281. }
  7282. this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
  7283. if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
  7284. return tok.slice(1);
  7285. }
  7286. return tok;
  7287. }).join("");
  7288. return this._longDateFormat[key];
  7289. }
  7290. var defaultInvalidDate = "Invalid date";
  7291. function invalidDate() {
  7292. return this._invalidDate;
  7293. }
  7294. var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  7295. function ordinal(number) {
  7296. return this._ordinal.replace("%d", number);
  7297. }
  7298. var defaultRelativeTime = {
  7299. future: "in %s",
  7300. past: "%s ago",
  7301. s: "a few seconds",
  7302. ss: "%d seconds",
  7303. m: "a minute",
  7304. mm: "%d minutes",
  7305. h: "an hour",
  7306. hh: "%d hours",
  7307. d: "a day",
  7308. dd: "%d days",
  7309. w: "a week",
  7310. ww: "%d weeks",
  7311. M: "a month",
  7312. MM: "%d months",
  7313. y: "a year",
  7314. yy: "%d years"
  7315. };
  7316. function relativeTime(number, withoutSuffix, string, isFuture) {
  7317. var output = this._relativeTime[string];
  7318. return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
  7319. }
  7320. function pastFuture(diff2, output) {
  7321. var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
  7322. return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
  7323. }
  7324. var aliases = {};
  7325. function addUnitAlias(unit, shorthand) {
  7326. var lowerCase = unit.toLowerCase();
  7327. aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit;
  7328. }
  7329. function normalizeUnits(units) {
  7330. return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
  7331. }
  7332. function normalizeObjectUnits(inputObject) {
  7333. var normalizedInput = {}, normalizedProp, prop;
  7334. for (prop in inputObject) {
  7335. if (hasOwnProp(inputObject, prop)) {
  7336. normalizedProp = normalizeUnits(prop);
  7337. if (normalizedProp) {
  7338. normalizedInput[normalizedProp] = inputObject[prop];
  7339. }
  7340. }
  7341. }
  7342. return normalizedInput;
  7343. }
  7344. var priorities = {};
  7345. function addUnitPriority(unit, priority) {
  7346. priorities[unit] = priority;
  7347. }
  7348. function getPrioritizedUnits(unitsObj) {
  7349. var units = [], u;
  7350. for (u in unitsObj) {
  7351. if (hasOwnProp(unitsObj, u)) {
  7352. units.push({ unit: u, priority: priorities[u] });
  7353. }
  7354. }
  7355. units.sort(function(a, b) {
  7356. return a.priority - b.priority;
  7357. });
  7358. return units;
  7359. }
  7360. function isLeapYear(year) {
  7361. return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  7362. }
  7363. function absFloor(number) {
  7364. if (number < 0) {
  7365. return Math.ceil(number) || 0;
  7366. } else {
  7367. return Math.floor(number);
  7368. }
  7369. }
  7370. function toInt(argumentForCoercion) {
  7371. var coercedNumber = +argumentForCoercion, value = 0;
  7372. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  7373. value = absFloor(coercedNumber);
  7374. }
  7375. return value;
  7376. }
  7377. function makeGetSet(unit, keepTime) {
  7378. return function(value) {
  7379. if (value != null) {
  7380. set$1(this, unit, value);
  7381. hooks.updateOffset(this, keepTime);
  7382. return this;
  7383. } else {
  7384. return get(this, unit);
  7385. }
  7386. };
  7387. }
  7388. function get(mom, unit) {
  7389. return mom.isValid() ? mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]() : NaN;
  7390. }
  7391. function set$1(mom, unit, value) {
  7392. if (mom.isValid() && !isNaN(value)) {
  7393. if (unit === "FullYear" && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
  7394. value = toInt(value);
  7395. mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](
  7396. value,
  7397. mom.month(),
  7398. daysInMonth(value, mom.month())
  7399. );
  7400. } else {
  7401. mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value);
  7402. }
  7403. }
  7404. }
  7405. function stringGet(units) {
  7406. units = normalizeUnits(units);
  7407. if (isFunction(this[units])) {
  7408. return this[units]();
  7409. }
  7410. return this;
  7411. }
  7412. function stringSet(units, value) {
  7413. if (typeof units === "object") {
  7414. units = normalizeObjectUnits(units);
  7415. var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length;
  7416. for (i = 0; i < prioritizedLen; i++) {
  7417. this[prioritized[i].unit](units[prioritized[i].unit]);
  7418. }
  7419. } else {
  7420. units = normalizeUnits(units);
  7421. if (isFunction(this[units])) {
  7422. return this[units](value);
  7423. }
  7424. }
  7425. return this;
  7426. }
  7427. var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, regexes;
  7428. regexes = {};
  7429. function addRegexToken(token2, regex, strictRegex) {
  7430. regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
  7431. return isStrict && strictRegex ? strictRegex : regex;
  7432. };
  7433. }
  7434. function getParseRegexForToken(token2, config) {
  7435. if (!hasOwnProp(regexes, token2)) {
  7436. return new RegExp(unescapeFormat(token2));
  7437. }
  7438. return regexes[token2](config._strict, config._locale);
  7439. }
  7440. function unescapeFormat(s2) {
  7441. return regexEscape(
  7442. s2.replace("\\", "").replace(
  7443. /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
  7444. function(matched, p1, p2, p3, p4) {
  7445. return p1 || p2 || p3 || p4;
  7446. }
  7447. )
  7448. );
  7449. }
  7450. function regexEscape(s2) {
  7451. return s2.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
  7452. }
  7453. var tokens = {};
  7454. function addParseToken(token2, callback) {
  7455. var i, func = callback, tokenLen;
  7456. if (typeof token2 === "string") {
  7457. token2 = [token2];
  7458. }
  7459. if (isNumber(callback)) {
  7460. func = function(input, array) {
  7461. array[callback] = toInt(input);
  7462. };
  7463. }
  7464. tokenLen = token2.length;
  7465. for (i = 0; i < tokenLen; i++) {
  7466. tokens[token2[i]] = func;
  7467. }
  7468. }
  7469. function addWeekParseToken(token2, callback) {
  7470. addParseToken(token2, function(input, array, config, token3) {
  7471. config._w = config._w || {};
  7472. callback(input, config._w, config, token3);
  7473. });
  7474. }
  7475. function addTimeToArrayFromToken(token2, input, config) {
  7476. if (input != null && hasOwnProp(tokens, token2)) {
  7477. tokens[token2](input, config._a, config, token2);
  7478. }
  7479. }
  7480. var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
  7481. function mod(n2, x) {
  7482. return (n2 % x + x) % x;
  7483. }
  7484. var indexOf;
  7485. if (Array.prototype.indexOf) {
  7486. indexOf = Array.prototype.indexOf;
  7487. } else {
  7488. indexOf = function(o2) {
  7489. var i;
  7490. for (i = 0; i < this.length; ++i) {
  7491. if (this[i] === o2) {
  7492. return i;
  7493. }
  7494. }
  7495. return -1;
  7496. };
  7497. }
  7498. function daysInMonth(year, month) {
  7499. if (isNaN(year) || isNaN(month)) {
  7500. return NaN;
  7501. }
  7502. var modMonth = mod(month, 12);
  7503. year += (month - modMonth) / 12;
  7504. return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
  7505. }
  7506. addFormatToken("M", ["MM", 2], "Mo", function() {
  7507. return this.month() + 1;
  7508. });
  7509. addFormatToken("MMM", 0, 0, function(format2) {
  7510. return this.localeData().monthsShort(this, format2);
  7511. });
  7512. addFormatToken("MMMM", 0, 0, function(format2) {
  7513. return this.localeData().months(this, format2);
  7514. });
  7515. addUnitAlias("month", "M");
  7516. addUnitPriority("month", 8);
  7517. addRegexToken("M", match1to2);
  7518. addRegexToken("MM", match1to2, match2);
  7519. addRegexToken("MMM", function(isStrict, locale2) {
  7520. return locale2.monthsShortRegex(isStrict);
  7521. });
  7522. addRegexToken("MMMM", function(isStrict, locale2) {
  7523. return locale2.monthsRegex(isStrict);
  7524. });
  7525. addParseToken(["M", "MM"], function(input, array) {
  7526. array[MONTH] = toInt(input) - 1;
  7527. });
  7528. addParseToken(["MMM", "MMMM"], function(input, array, config, token2) {
  7529. var month = config._locale.monthsParse(input, token2, config._strict);
  7530. if (month != null) {
  7531. array[MONTH] = month;
  7532. } else {
  7533. getParsingFlags(config).invalidMonth = input;
  7534. }
  7535. });
  7536. var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
  7537. "_"
  7538. ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
  7539. function localeMonths(m, format2) {
  7540. if (!m) {
  7541. return isArray(this._months) ? this._months : this._months["standalone"];
  7542. }
  7543. return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m.month()];
  7544. }
  7545. function localeMonthsShort(m, format2) {
  7546. if (!m) {
  7547. return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
  7548. }
  7549. return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
  7550. }
  7551. function handleStrictParse(monthName, format2, strict) {
  7552. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  7553. if (!this._monthsParse) {
  7554. this._monthsParse = [];
  7555. this._longMonthsParse = [];
  7556. this._shortMonthsParse = [];
  7557. for (i = 0; i < 12; ++i) {
  7558. mom = createUTC([2e3, i]);
  7559. this._shortMonthsParse[i] = this.monthsShort(
  7560. mom,
  7561. ""
  7562. ).toLocaleLowerCase();
  7563. this._longMonthsParse[i] = this.months(mom, "").toLocaleLowerCase();
  7564. }
  7565. }
  7566. if (strict) {
  7567. if (format2 === "MMM") {
  7568. ii = indexOf.call(this._shortMonthsParse, llc);
  7569. return ii !== -1 ? ii : null;
  7570. } else {
  7571. ii = indexOf.call(this._longMonthsParse, llc);
  7572. return ii !== -1 ? ii : null;
  7573. }
  7574. } else {
  7575. if (format2 === "MMM") {
  7576. ii = indexOf.call(this._shortMonthsParse, llc);
  7577. if (ii !== -1) {
  7578. return ii;
  7579. }
  7580. ii = indexOf.call(this._longMonthsParse, llc);
  7581. return ii !== -1 ? ii : null;
  7582. } else {
  7583. ii = indexOf.call(this._longMonthsParse, llc);
  7584. if (ii !== -1) {
  7585. return ii;
  7586. }
  7587. ii = indexOf.call(this._shortMonthsParse, llc);
  7588. return ii !== -1 ? ii : null;
  7589. }
  7590. }
  7591. }
  7592. function localeMonthsParse(monthName, format2, strict) {
  7593. var i, mom, regex;
  7594. if (this._monthsParseExact) {
  7595. return handleStrictParse.call(this, monthName, format2, strict);
  7596. }
  7597. if (!this._monthsParse) {
  7598. this._monthsParse = [];
  7599. this._longMonthsParse = [];
  7600. this._shortMonthsParse = [];
  7601. }
  7602. for (i = 0; i < 12; i++) {
  7603. mom = createUTC([2e3, i]);
  7604. if (strict && !this._longMonthsParse[i]) {
  7605. this._longMonthsParse[i] = new RegExp(
  7606. "^" + this.months(mom, "").replace(".", "") + "$",
  7607. "i"
  7608. );
  7609. this._shortMonthsParse[i] = new RegExp(
  7610. "^" + this.monthsShort(mom, "").replace(".", "") + "$",
  7611. "i"
  7612. );
  7613. }
  7614. if (!strict && !this._monthsParse[i]) {
  7615. regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
  7616. this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i");
  7617. }
  7618. if (strict && format2 === "MMMM" && this._longMonthsParse[i].test(monthName)) {
  7619. return i;
  7620. } else if (strict && format2 === "MMM" && this._shortMonthsParse[i].test(monthName)) {
  7621. return i;
  7622. } else if (!strict && this._monthsParse[i].test(monthName)) {
  7623. return i;
  7624. }
  7625. }
  7626. }
  7627. function setMonth(mom, value) {
  7628. var dayOfMonth;
  7629. if (!mom.isValid()) {
  7630. return mom;
  7631. }
  7632. if (typeof value === "string") {
  7633. if (/^\d+$/.test(value)) {
  7634. value = toInt(value);
  7635. } else {
  7636. value = mom.localeData().monthsParse(value);
  7637. if (!isNumber(value)) {
  7638. return mom;
  7639. }
  7640. }
  7641. }
  7642. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  7643. mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth);
  7644. return mom;
  7645. }
  7646. function getSetMonth(value) {
  7647. if (value != null) {
  7648. setMonth(this, value);
  7649. hooks.updateOffset(this, true);
  7650. return this;
  7651. } else {
  7652. return get(this, "Month");
  7653. }
  7654. }
  7655. function getDaysInMonth() {
  7656. return daysInMonth(this.year(), this.month());
  7657. }
  7658. function monthsShortRegex(isStrict) {
  7659. if (this._monthsParseExact) {
  7660. if (!hasOwnProp(this, "_monthsRegex")) {
  7661. computeMonthsParse.call(this);
  7662. }
  7663. if (isStrict) {
  7664. return this._monthsShortStrictRegex;
  7665. } else {
  7666. return this._monthsShortRegex;
  7667. }
  7668. } else {
  7669. if (!hasOwnProp(this, "_monthsShortRegex")) {
  7670. this._monthsShortRegex = defaultMonthsShortRegex;
  7671. }
  7672. return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
  7673. }
  7674. }
  7675. function monthsRegex(isStrict) {
  7676. if (this._monthsParseExact) {
  7677. if (!hasOwnProp(this, "_monthsRegex")) {
  7678. computeMonthsParse.call(this);
  7679. }
  7680. if (isStrict) {
  7681. return this._monthsStrictRegex;
  7682. } else {
  7683. return this._monthsRegex;
  7684. }
  7685. } else {
  7686. if (!hasOwnProp(this, "_monthsRegex")) {
  7687. this._monthsRegex = defaultMonthsRegex;
  7688. }
  7689. return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
  7690. }
  7691. }
  7692. function computeMonthsParse() {
  7693. function cmpLenRev(a, b) {
  7694. return b.length - a.length;
  7695. }
  7696. var shortPieces = [], longPieces = [], mixedPieces = [], i, mom;
  7697. for (i = 0; i < 12; i++) {
  7698. mom = createUTC([2e3, i]);
  7699. shortPieces.push(this.monthsShort(mom, ""));
  7700. longPieces.push(this.months(mom, ""));
  7701. mixedPieces.push(this.months(mom, ""));
  7702. mixedPieces.push(this.monthsShort(mom, ""));
  7703. }
  7704. shortPieces.sort(cmpLenRev);
  7705. longPieces.sort(cmpLenRev);
  7706. mixedPieces.sort(cmpLenRev);
  7707. for (i = 0; i < 12; i++) {
  7708. shortPieces[i] = regexEscape(shortPieces[i]);
  7709. longPieces[i] = regexEscape(longPieces[i]);
  7710. }
  7711. for (i = 0; i < 24; i++) {
  7712. mixedPieces[i] = regexEscape(mixedPieces[i]);
  7713. }
  7714. this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  7715. this._monthsShortRegex = this._monthsRegex;
  7716. this._monthsStrictRegex = new RegExp(
  7717. "^(" + longPieces.join("|") + ")",
  7718. "i"
  7719. );
  7720. this._monthsShortStrictRegex = new RegExp(
  7721. "^(" + shortPieces.join("|") + ")",
  7722. "i"
  7723. );
  7724. }
  7725. addFormatToken("Y", 0, 0, function() {
  7726. var y = this.year();
  7727. return y <= 9999 ? zeroFill(y, 4) : "+" + y;
  7728. });
  7729. addFormatToken(0, ["YY", 2], 0, function() {
  7730. return this.year() % 100;
  7731. });
  7732. addFormatToken(0, ["YYYY", 4], 0, "year");
  7733. addFormatToken(0, ["YYYYY", 5], 0, "year");
  7734. addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
  7735. addUnitAlias("year", "y");
  7736. addUnitPriority("year", 1);
  7737. addRegexToken("Y", matchSigned);
  7738. addRegexToken("YY", match1to2, match2);
  7739. addRegexToken("YYYY", match1to4, match4);
  7740. addRegexToken("YYYYY", match1to6, match6);
  7741. addRegexToken("YYYYYY", match1to6, match6);
  7742. addParseToken(["YYYYY", "YYYYYY"], YEAR);
  7743. addParseToken("YYYY", function(input, array) {
  7744. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  7745. });
  7746. addParseToken("YY", function(input, array) {
  7747. array[YEAR] = hooks.parseTwoDigitYear(input);
  7748. });
  7749. addParseToken("Y", function(input, array) {
  7750. array[YEAR] = parseInt(input, 10);
  7751. });
  7752. function daysInYear(year) {
  7753. return isLeapYear(year) ? 366 : 365;
  7754. }
  7755. hooks.parseTwoDigitYear = function(input) {
  7756. return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
  7757. };
  7758. var getSetYear = makeGetSet("FullYear", true);
  7759. function getIsLeapYear() {
  7760. return isLeapYear(this.year());
  7761. }
  7762. function createDate(y, m, d, h, M, s2, ms) {
  7763. var date;
  7764. if (y < 100 && y >= 0) {
  7765. date = new Date(y + 400, m, d, h, M, s2, ms);
  7766. if (isFinite(date.getFullYear())) {
  7767. date.setFullYear(y);
  7768. }
  7769. } else {
  7770. date = new Date(y, m, d, h, M, s2, ms);
  7771. }
  7772. return date;
  7773. }
  7774. function createUTCDate(y) {
  7775. var date, args;
  7776. if (y < 100 && y >= 0) {
  7777. args = Array.prototype.slice.call(arguments);
  7778. args[0] = y + 400;
  7779. date = new Date(Date.UTC.apply(null, args));
  7780. if (isFinite(date.getUTCFullYear())) {
  7781. date.setUTCFullYear(y);
  7782. }
  7783. } else {
  7784. date = new Date(Date.UTC.apply(null, arguments));
  7785. }
  7786. return date;
  7787. }
  7788. function firstWeekOffset(year, dow, doy) {
  7789. var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  7790. return -fwdlw + fwd - 1;
  7791. }
  7792. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  7793. var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
  7794. if (dayOfYear <= 0) {
  7795. resYear = year - 1;
  7796. resDayOfYear = daysInYear(resYear) + dayOfYear;
  7797. } else if (dayOfYear > daysInYear(year)) {
  7798. resYear = year + 1;
  7799. resDayOfYear = dayOfYear - daysInYear(year);
  7800. } else {
  7801. resYear = year;
  7802. resDayOfYear = dayOfYear;
  7803. }
  7804. return {
  7805. year: resYear,
  7806. dayOfYear: resDayOfYear
  7807. };
  7808. }
  7809. function weekOfYear(mom, dow, doy) {
  7810. var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
  7811. if (week < 1) {
  7812. resYear = mom.year() - 1;
  7813. resWeek = week + weeksInYear(resYear, dow, doy);
  7814. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  7815. resWeek = week - weeksInYear(mom.year(), dow, doy);
  7816. resYear = mom.year() + 1;
  7817. } else {
  7818. resYear = mom.year();
  7819. resWeek = week;
  7820. }
  7821. return {
  7822. week: resWeek,
  7823. year: resYear
  7824. };
  7825. }
  7826. function weeksInYear(year, dow, doy) {
  7827. var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  7828. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  7829. }
  7830. addFormatToken("w", ["ww", 2], "wo", "week");
  7831. addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
  7832. addUnitAlias("week", "w");
  7833. addUnitAlias("isoWeek", "W");
  7834. addUnitPriority("week", 5);
  7835. addUnitPriority("isoWeek", 5);
  7836. addRegexToken("w", match1to2);
  7837. addRegexToken("ww", match1to2, match2);
  7838. addRegexToken("W", match1to2);
  7839. addRegexToken("WW", match1to2, match2);
  7840. addWeekParseToken(
  7841. ["w", "ww", "W", "WW"],
  7842. function(input, week, config, token2) {
  7843. week[token2.substr(0, 1)] = toInt(input);
  7844. }
  7845. );
  7846. function localeWeek(mom) {
  7847. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  7848. }
  7849. var defaultLocaleWeek = {
  7850. dow: 0,
  7851. // Sunday is the first day of the week.
  7852. doy: 6
  7853. // The week that contains Jan 6th is the first week of the year.
  7854. };
  7855. function localeFirstDayOfWeek() {
  7856. return this._week.dow;
  7857. }
  7858. function localeFirstDayOfYear() {
  7859. return this._week.doy;
  7860. }
  7861. function getSetWeek(input) {
  7862. var week = this.localeData().week(this);
  7863. return input == null ? week : this.add((input - week) * 7, "d");
  7864. }
  7865. function getSetISOWeek(input) {
  7866. var week = weekOfYear(this, 1, 4).week;
  7867. return input == null ? week : this.add((input - week) * 7, "d");
  7868. }
  7869. addFormatToken("d", 0, "do", "day");
  7870. addFormatToken("dd", 0, 0, function(format2) {
  7871. return this.localeData().weekdaysMin(this, format2);
  7872. });
  7873. addFormatToken("ddd", 0, 0, function(format2) {
  7874. return this.localeData().weekdaysShort(this, format2);
  7875. });
  7876. addFormatToken("dddd", 0, 0, function(format2) {
  7877. return this.localeData().weekdays(this, format2);
  7878. });
  7879. addFormatToken("e", 0, 0, "weekday");
  7880. addFormatToken("E", 0, 0, "isoWeekday");
  7881. addUnitAlias("day", "d");
  7882. addUnitAlias("weekday", "e");
  7883. addUnitAlias("isoWeekday", "E");
  7884. addUnitPriority("day", 11);
  7885. addUnitPriority("weekday", 11);
  7886. addUnitPriority("isoWeekday", 11);
  7887. addRegexToken("d", match1to2);
  7888. addRegexToken("e", match1to2);
  7889. addRegexToken("E", match1to2);
  7890. addRegexToken("dd", function(isStrict, locale2) {
  7891. return locale2.weekdaysMinRegex(isStrict);
  7892. });
  7893. addRegexToken("ddd", function(isStrict, locale2) {
  7894. return locale2.weekdaysShortRegex(isStrict);
  7895. });
  7896. addRegexToken("dddd", function(isStrict, locale2) {
  7897. return locale2.weekdaysRegex(isStrict);
  7898. });
  7899. addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) {
  7900. var weekday = config._locale.weekdaysParse(input, token2, config._strict);
  7901. if (weekday != null) {
  7902. week.d = weekday;
  7903. } else {
  7904. getParsingFlags(config).invalidWeekday = input;
  7905. }
  7906. });
  7907. addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) {
  7908. week[token2] = toInt(input);
  7909. });
  7910. function parseWeekday(input, locale2) {
  7911. if (typeof input !== "string") {
  7912. return input;
  7913. }
  7914. if (!isNaN(input)) {
  7915. return parseInt(input, 10);
  7916. }
  7917. input = locale2.weekdaysParse(input);
  7918. if (typeof input === "number") {
  7919. return input;
  7920. }
  7921. return null;
  7922. }
  7923. function parseIsoWeekday(input, locale2) {
  7924. if (typeof input === "string") {
  7925. return locale2.weekdaysParse(input) % 7 || 7;
  7926. }
  7927. return isNaN(input) ? null : input;
  7928. }
  7929. function shiftWeekdays(ws, n2) {
  7930. return ws.slice(n2, 7).concat(ws.slice(0, n2));
  7931. }
  7932. var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
  7933. function localeWeekdays(m, format2) {
  7934. var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
  7935. return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
  7936. }
  7937. function localeWeekdaysShort(m) {
  7938. return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  7939. }
  7940. function localeWeekdaysMin(m) {
  7941. return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  7942. }
  7943. function handleStrictParse$1(weekdayName, format2, strict) {
  7944. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  7945. if (!this._weekdaysParse) {
  7946. this._weekdaysParse = [];
  7947. this._shortWeekdaysParse = [];
  7948. this._minWeekdaysParse = [];
  7949. for (i = 0; i < 7; ++i) {
  7950. mom = createUTC([2e3, 1]).day(i);
  7951. this._minWeekdaysParse[i] = this.weekdaysMin(
  7952. mom,
  7953. ""
  7954. ).toLocaleLowerCase();
  7955. this._shortWeekdaysParse[i] = this.weekdaysShort(
  7956. mom,
  7957. ""
  7958. ).toLocaleLowerCase();
  7959. this._weekdaysParse[i] = this.weekdays(mom, "").toLocaleLowerCase();
  7960. }
  7961. }
  7962. if (strict) {
  7963. if (format2 === "dddd") {
  7964. ii = indexOf.call(this._weekdaysParse, llc);
  7965. return ii !== -1 ? ii : null;
  7966. } else if (format2 === "ddd") {
  7967. ii = indexOf.call(this._shortWeekdaysParse, llc);
  7968. return ii !== -1 ? ii : null;
  7969. } else {
  7970. ii = indexOf.call(this._minWeekdaysParse, llc);
  7971. return ii !== -1 ? ii : null;
  7972. }
  7973. } else {
  7974. if (format2 === "dddd") {
  7975. ii = indexOf.call(this._weekdaysParse, llc);
  7976. if (ii !== -1) {
  7977. return ii;
  7978. }
  7979. ii = indexOf.call(this._shortWeekdaysParse, llc);
  7980. if (ii !== -1) {
  7981. return ii;
  7982. }
  7983. ii = indexOf.call(this._minWeekdaysParse, llc);
  7984. return ii !== -1 ? ii : null;
  7985. } else if (format2 === "ddd") {
  7986. ii = indexOf.call(this._shortWeekdaysParse, llc);
  7987. if (ii !== -1) {
  7988. return ii;
  7989. }
  7990. ii = indexOf.call(this._weekdaysParse, llc);
  7991. if (ii !== -1) {
  7992. return ii;
  7993. }
  7994. ii = indexOf.call(this._minWeekdaysParse, llc);
  7995. return ii !== -1 ? ii : null;
  7996. } else {
  7997. ii = indexOf.call(this._minWeekdaysParse, llc);
  7998. if (ii !== -1) {
  7999. return ii;
  8000. }
  8001. ii = indexOf.call(this._weekdaysParse, llc);
  8002. if (ii !== -1) {
  8003. return ii;
  8004. }
  8005. ii = indexOf.call(this._shortWeekdaysParse, llc);
  8006. return ii !== -1 ? ii : null;
  8007. }
  8008. }
  8009. }
  8010. function localeWeekdaysParse(weekdayName, format2, strict) {
  8011. var i, mom, regex;
  8012. if (this._weekdaysParseExact) {
  8013. return handleStrictParse$1.call(this, weekdayName, format2, strict);
  8014. }
  8015. if (!this._weekdaysParse) {
  8016. this._weekdaysParse = [];
  8017. this._minWeekdaysParse = [];
  8018. this._shortWeekdaysParse = [];
  8019. this._fullWeekdaysParse = [];
  8020. }
  8021. for (i = 0; i < 7; i++) {
  8022. mom = createUTC([2e3, 1]).day(i);
  8023. if (strict && !this._fullWeekdaysParse[i]) {
  8024. this._fullWeekdaysParse[i] = new RegExp(
  8025. "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
  8026. "i"
  8027. );
  8028. this._shortWeekdaysParse[i] = new RegExp(
  8029. "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
  8030. "i"
  8031. );
  8032. this._minWeekdaysParse[i] = new RegExp(
  8033. "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
  8034. "i"
  8035. );
  8036. }
  8037. if (!this._weekdaysParse[i]) {
  8038. regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
  8039. this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i");
  8040. }
  8041. if (strict && format2 === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) {
  8042. return i;
  8043. } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) {
  8044. return i;
  8045. } else if (strict && format2 === "dd" && this._minWeekdaysParse[i].test(weekdayName)) {
  8046. return i;
  8047. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  8048. return i;
  8049. }
  8050. }
  8051. }
  8052. function getSetDayOfWeek(input) {
  8053. if (!this.isValid()) {
  8054. return input != null ? this : NaN;
  8055. }
  8056. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  8057. if (input != null) {
  8058. input = parseWeekday(input, this.localeData());
  8059. return this.add(input - day, "d");
  8060. } else {
  8061. return day;
  8062. }
  8063. }
  8064. function getSetLocaleDayOfWeek(input) {
  8065. if (!this.isValid()) {
  8066. return input != null ? this : NaN;
  8067. }
  8068. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  8069. return input == null ? weekday : this.add(input - weekday, "d");
  8070. }
  8071. function getSetISODayOfWeek(input) {
  8072. if (!this.isValid()) {
  8073. return input != null ? this : NaN;
  8074. }
  8075. if (input != null) {
  8076. var weekday = parseIsoWeekday(input, this.localeData());
  8077. return this.day(this.day() % 7 ? weekday : weekday - 7);
  8078. } else {
  8079. return this.day() || 7;
  8080. }
  8081. }
  8082. function weekdaysRegex(isStrict) {
  8083. if (this._weekdaysParseExact) {
  8084. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8085. computeWeekdaysParse.call(this);
  8086. }
  8087. if (isStrict) {
  8088. return this._weekdaysStrictRegex;
  8089. } else {
  8090. return this._weekdaysRegex;
  8091. }
  8092. } else {
  8093. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8094. this._weekdaysRegex = defaultWeekdaysRegex;
  8095. }
  8096. return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
  8097. }
  8098. }
  8099. function weekdaysShortRegex(isStrict) {
  8100. if (this._weekdaysParseExact) {
  8101. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8102. computeWeekdaysParse.call(this);
  8103. }
  8104. if (isStrict) {
  8105. return this._weekdaysShortStrictRegex;
  8106. } else {
  8107. return this._weekdaysShortRegex;
  8108. }
  8109. } else {
  8110. if (!hasOwnProp(this, "_weekdaysShortRegex")) {
  8111. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  8112. }
  8113. return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  8114. }
  8115. }
  8116. function weekdaysMinRegex(isStrict) {
  8117. if (this._weekdaysParseExact) {
  8118. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8119. computeWeekdaysParse.call(this);
  8120. }
  8121. if (isStrict) {
  8122. return this._weekdaysMinStrictRegex;
  8123. } else {
  8124. return this._weekdaysMinRegex;
  8125. }
  8126. } else {
  8127. if (!hasOwnProp(this, "_weekdaysMinRegex")) {
  8128. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  8129. }
  8130. return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  8131. }
  8132. }
  8133. function computeWeekdaysParse() {
  8134. function cmpLenRev(a, b) {
  8135. return b.length - a.length;
  8136. }
  8137. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp;
  8138. for (i = 0; i < 7; i++) {
  8139. mom = createUTC([2e3, 1]).day(i);
  8140. minp = regexEscape(this.weekdaysMin(mom, ""));
  8141. shortp = regexEscape(this.weekdaysShort(mom, ""));
  8142. longp = regexEscape(this.weekdays(mom, ""));
  8143. minPieces.push(minp);
  8144. shortPieces.push(shortp);
  8145. longPieces.push(longp);
  8146. mixedPieces.push(minp);
  8147. mixedPieces.push(shortp);
  8148. mixedPieces.push(longp);
  8149. }
  8150. minPieces.sort(cmpLenRev);
  8151. shortPieces.sort(cmpLenRev);
  8152. longPieces.sort(cmpLenRev);
  8153. mixedPieces.sort(cmpLenRev);
  8154. this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  8155. this._weekdaysShortRegex = this._weekdaysRegex;
  8156. this._weekdaysMinRegex = this._weekdaysRegex;
  8157. this._weekdaysStrictRegex = new RegExp(
  8158. "^(" + longPieces.join("|") + ")",
  8159. "i"
  8160. );
  8161. this._weekdaysShortStrictRegex = new RegExp(
  8162. "^(" + shortPieces.join("|") + ")",
  8163. "i"
  8164. );
  8165. this._weekdaysMinStrictRegex = new RegExp(
  8166. "^(" + minPieces.join("|") + ")",
  8167. "i"
  8168. );
  8169. }
  8170. function hFormat() {
  8171. return this.hours() % 12 || 12;
  8172. }
  8173. function kFormat() {
  8174. return this.hours() || 24;
  8175. }
  8176. addFormatToken("H", ["HH", 2], 0, "hour");
  8177. addFormatToken("h", ["hh", 2], 0, hFormat);
  8178. addFormatToken("k", ["kk", 2], 0, kFormat);
  8179. addFormatToken("hmm", 0, 0, function() {
  8180. return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  8181. });
  8182. addFormatToken("hmmss", 0, 0, function() {
  8183. return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  8184. });
  8185. addFormatToken("Hmm", 0, 0, function() {
  8186. return "" + this.hours() + zeroFill(this.minutes(), 2);
  8187. });
  8188. addFormatToken("Hmmss", 0, 0, function() {
  8189. return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  8190. });
  8191. function meridiem(token2, lowercase) {
  8192. addFormatToken(token2, 0, 0, function() {
  8193. return this.localeData().meridiem(
  8194. this.hours(),
  8195. this.minutes(),
  8196. lowercase
  8197. );
  8198. });
  8199. }
  8200. meridiem("a", true);
  8201. meridiem("A", false);
  8202. addUnitAlias("hour", "h");
  8203. addUnitPriority("hour", 13);
  8204. function matchMeridiem(isStrict, locale2) {
  8205. return locale2._meridiemParse;
  8206. }
  8207. addRegexToken("a", matchMeridiem);
  8208. addRegexToken("A", matchMeridiem);
  8209. addRegexToken("H", match1to2);
  8210. addRegexToken("h", match1to2);
  8211. addRegexToken("k", match1to2);
  8212. addRegexToken("HH", match1to2, match2);
  8213. addRegexToken("hh", match1to2, match2);
  8214. addRegexToken("kk", match1to2, match2);
  8215. addRegexToken("hmm", match3to4);
  8216. addRegexToken("hmmss", match5to6);
  8217. addRegexToken("Hmm", match3to4);
  8218. addRegexToken("Hmmss", match5to6);
  8219. addParseToken(["H", "HH"], HOUR);
  8220. addParseToken(["k", "kk"], function(input, array, config) {
  8221. var kInput = toInt(input);
  8222. array[HOUR] = kInput === 24 ? 0 : kInput;
  8223. });
  8224. addParseToken(["a", "A"], function(input, array, config) {
  8225. config._isPm = config._locale.isPM(input);
  8226. config._meridiem = input;
  8227. });
  8228. addParseToken(["h", "hh"], function(input, array, config) {
  8229. array[HOUR] = toInt(input);
  8230. getParsingFlags(config).bigHour = true;
  8231. });
  8232. addParseToken("hmm", function(input, array, config) {
  8233. var pos = input.length - 2;
  8234. array[HOUR] = toInt(input.substr(0, pos));
  8235. array[MINUTE] = toInt(input.substr(pos));
  8236. getParsingFlags(config).bigHour = true;
  8237. });
  8238. addParseToken("hmmss", function(input, array, config) {
  8239. var pos1 = input.length - 4, pos2 = input.length - 2;
  8240. array[HOUR] = toInt(input.substr(0, pos1));
  8241. array[MINUTE] = toInt(input.substr(pos1, 2));
  8242. array[SECOND] = toInt(input.substr(pos2));
  8243. getParsingFlags(config).bigHour = true;
  8244. });
  8245. addParseToken("Hmm", function(input, array, config) {
  8246. var pos = input.length - 2;
  8247. array[HOUR] = toInt(input.substr(0, pos));
  8248. array[MINUTE] = toInt(input.substr(pos));
  8249. });
  8250. addParseToken("Hmmss", function(input, array, config) {
  8251. var pos1 = input.length - 4, pos2 = input.length - 2;
  8252. array[HOUR] = toInt(input.substr(0, pos1));
  8253. array[MINUTE] = toInt(input.substr(pos1, 2));
  8254. array[SECOND] = toInt(input.substr(pos2));
  8255. });
  8256. function localeIsPM(input) {
  8257. return (input + "").toLowerCase().charAt(0) === "p";
  8258. }
  8259. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
  8260. function localeMeridiem(hours2, minutes2, isLower) {
  8261. if (hours2 > 11) {
  8262. return isLower ? "pm" : "PM";
  8263. } else {
  8264. return isLower ? "am" : "AM";
  8265. }
  8266. }
  8267. var baseConfig = {
  8268. calendar: defaultCalendar,
  8269. longDateFormat: defaultLongDateFormat,
  8270. invalidDate: defaultInvalidDate,
  8271. ordinal: defaultOrdinal,
  8272. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  8273. relativeTime: defaultRelativeTime,
  8274. months: defaultLocaleMonths,
  8275. monthsShort: defaultLocaleMonthsShort,
  8276. week: defaultLocaleWeek,
  8277. weekdays: defaultLocaleWeekdays,
  8278. weekdaysMin: defaultLocaleWeekdaysMin,
  8279. weekdaysShort: defaultLocaleWeekdaysShort,
  8280. meridiemParse: defaultLocaleMeridiemParse
  8281. };
  8282. var locales = {}, localeFamilies = {}, globalLocale;
  8283. function commonPrefix(arr1, arr2) {
  8284. var i, minl = Math.min(arr1.length, arr2.length);
  8285. for (i = 0; i < minl; i += 1) {
  8286. if (arr1[i] !== arr2[i]) {
  8287. return i;
  8288. }
  8289. }
  8290. return minl;
  8291. }
  8292. function normalizeLocale(key) {
  8293. return key ? key.toLowerCase().replace("_", "-") : key;
  8294. }
  8295. function chooseLocale(names) {
  8296. var i = 0, j, next, locale2, split;
  8297. while (i < names.length) {
  8298. split = normalizeLocale(names[i]).split("-");
  8299. j = split.length;
  8300. next = normalizeLocale(names[i + 1]);
  8301. next = next ? next.split("-") : null;
  8302. while (j > 0) {
  8303. locale2 = loadLocale(split.slice(0, j).join("-"));
  8304. if (locale2) {
  8305. return locale2;
  8306. }
  8307. if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {
  8308. break;
  8309. }
  8310. j--;
  8311. }
  8312. i++;
  8313. }
  8314. return globalLocale;
  8315. }
  8316. function isLocaleNameSane(name) {
  8317. return name.match("^[^/\\\\]*$") != null;
  8318. }
  8319. function loadLocale(name) {
  8320. var oldLocale = null, aliasedRequire;
  8321. if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
  8322. try {
  8323. oldLocale = globalLocale._abbr;
  8324. aliasedRequire = require;
  8325. aliasedRequire("./locale/" + name);
  8326. getSetGlobalLocale(oldLocale);
  8327. } catch (e2) {
  8328. locales[name] = null;
  8329. }
  8330. }
  8331. return locales[name];
  8332. }
  8333. function getSetGlobalLocale(key, values) {
  8334. var data;
  8335. if (key) {
  8336. if (isUndefined(values)) {
  8337. data = getLocale(key);
  8338. } else {
  8339. data = defineLocale(key, values);
  8340. }
  8341. if (data) {
  8342. globalLocale = data;
  8343. } else {
  8344. if (typeof console !== "undefined" && console.warn) {
  8345. console.warn(
  8346. "Locale " + key + " not found. Did you forget to load it?"
  8347. );
  8348. }
  8349. }
  8350. }
  8351. return globalLocale._abbr;
  8352. }
  8353. function defineLocale(name, config) {
  8354. if (config !== null) {
  8355. var locale2, parentConfig = baseConfig;
  8356. config.abbr = name;
  8357. if (locales[name] != null) {
  8358. deprecateSimple(
  8359. "defineLocaleOverride",
  8360. "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
  8361. );
  8362. parentConfig = locales[name]._config;
  8363. } else if (config.parentLocale != null) {
  8364. if (locales[config.parentLocale] != null) {
  8365. parentConfig = locales[config.parentLocale]._config;
  8366. } else {
  8367. locale2 = loadLocale(config.parentLocale);
  8368. if (locale2 != null) {
  8369. parentConfig = locale2._config;
  8370. } else {
  8371. if (!localeFamilies[config.parentLocale]) {
  8372. localeFamilies[config.parentLocale] = [];
  8373. }
  8374. localeFamilies[config.parentLocale].push({
  8375. name,
  8376. config
  8377. });
  8378. return null;
  8379. }
  8380. }
  8381. }
  8382. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  8383. if (localeFamilies[name]) {
  8384. localeFamilies[name].forEach(function(x) {
  8385. defineLocale(x.name, x.config);
  8386. });
  8387. }
  8388. getSetGlobalLocale(name);
  8389. return locales[name];
  8390. } else {
  8391. delete locales[name];
  8392. return null;
  8393. }
  8394. }
  8395. function updateLocale(name, config) {
  8396. if (config != null) {
  8397. var locale2, tmpLocale, parentConfig = baseConfig;
  8398. if (locales[name] != null && locales[name].parentLocale != null) {
  8399. locales[name].set(mergeConfigs(locales[name]._config, config));
  8400. } else {
  8401. tmpLocale = loadLocale(name);
  8402. if (tmpLocale != null) {
  8403. parentConfig = tmpLocale._config;
  8404. }
  8405. config = mergeConfigs(parentConfig, config);
  8406. if (tmpLocale == null) {
  8407. config.abbr = name;
  8408. }
  8409. locale2 = new Locale(config);
  8410. locale2.parentLocale = locales[name];
  8411. locales[name] = locale2;
  8412. }
  8413. getSetGlobalLocale(name);
  8414. } else {
  8415. if (locales[name] != null) {
  8416. if (locales[name].parentLocale != null) {
  8417. locales[name] = locales[name].parentLocale;
  8418. if (name === getSetGlobalLocale()) {
  8419. getSetGlobalLocale(name);
  8420. }
  8421. } else if (locales[name] != null) {
  8422. delete locales[name];
  8423. }
  8424. }
  8425. }
  8426. return locales[name];
  8427. }
  8428. function getLocale(key) {
  8429. var locale2;
  8430. if (key && key._locale && key._locale._abbr) {
  8431. key = key._locale._abbr;
  8432. }
  8433. if (!key) {
  8434. return globalLocale;
  8435. }
  8436. if (!isArray(key)) {
  8437. locale2 = loadLocale(key);
  8438. if (locale2) {
  8439. return locale2;
  8440. }
  8441. key = [key];
  8442. }
  8443. return chooseLocale(key);
  8444. }
  8445. function listLocales() {
  8446. return keys(locales);
  8447. }
  8448. function checkOverflow(m) {
  8449. var overflow, a = m._a;
  8450. if (a && getParsingFlags(m).overflow === -2) {
  8451. overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1;
  8452. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  8453. overflow = DATE;
  8454. }
  8455. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  8456. overflow = WEEK;
  8457. }
  8458. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  8459. overflow = WEEKDAY;
  8460. }
  8461. getParsingFlags(m).overflow = overflow;
  8462. }
  8463. return m;
  8464. }
  8465. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
  8466. ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
  8467. ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
  8468. ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
  8469. ["GGGG-[W]WW", /\d{4}-W\d\d/, false],
  8470. ["YYYY-DDD", /\d{4}-\d{3}/],
  8471. ["YYYY-MM", /\d{4}-\d\d/, false],
  8472. ["YYYYYYMMDD", /[+-]\d{10}/],
  8473. ["YYYYMMDD", /\d{8}/],
  8474. ["GGGG[W]WWE", /\d{4}W\d{3}/],
  8475. ["GGGG[W]WW", /\d{4}W\d{2}/, false],
  8476. ["YYYYDDD", /\d{7}/],
  8477. ["YYYYMM", /\d{6}/, false],
  8478. ["YYYY", /\d{4}/, false]
  8479. ], isoTimes = [
  8480. ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
  8481. ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
  8482. ["HH:mm:ss", /\d\d:\d\d:\d\d/],
  8483. ["HH:mm", /\d\d:\d\d/],
  8484. ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
  8485. ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
  8486. ["HHmmss", /\d\d\d\d\d\d/],
  8487. ["HHmm", /\d\d\d\d/],
  8488. ["HH", /\d\d/]
  8489. ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
  8490. UT: 0,
  8491. GMT: 0,
  8492. EDT: -4 * 60,
  8493. EST: -5 * 60,
  8494. CDT: -5 * 60,
  8495. CST: -6 * 60,
  8496. MDT: -6 * 60,
  8497. MST: -7 * 60,
  8498. PDT: -7 * 60,
  8499. PST: -8 * 60
  8500. };
  8501. function configFromISO(config) {
  8502. var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
  8503. if (match) {
  8504. getParsingFlags(config).iso = true;
  8505. for (i = 0, l = isoDatesLen; i < l; i++) {
  8506. if (isoDates[i][1].exec(match[1])) {
  8507. dateFormat = isoDates[i][0];
  8508. allowTime = isoDates[i][2] !== false;
  8509. break;
  8510. }
  8511. }
  8512. if (dateFormat == null) {
  8513. config._isValid = false;
  8514. return;
  8515. }
  8516. if (match[3]) {
  8517. for (i = 0, l = isoTimesLen; i < l; i++) {
  8518. if (isoTimes[i][1].exec(match[3])) {
  8519. timeFormat = (match[2] || " ") + isoTimes[i][0];
  8520. break;
  8521. }
  8522. }
  8523. if (timeFormat == null) {
  8524. config._isValid = false;
  8525. return;
  8526. }
  8527. }
  8528. if (!allowTime && timeFormat != null) {
  8529. config._isValid = false;
  8530. return;
  8531. }
  8532. if (match[4]) {
  8533. if (tzRegex.exec(match[4])) {
  8534. tzFormat = "Z";
  8535. } else {
  8536. config._isValid = false;
  8537. return;
  8538. }
  8539. }
  8540. config._f = dateFormat + (timeFormat || "") + (tzFormat || "");
  8541. configFromStringAndFormat(config);
  8542. } else {
  8543. config._isValid = false;
  8544. }
  8545. }
  8546. function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  8547. var result = [
  8548. untruncateYear(yearStr),
  8549. defaultLocaleMonthsShort.indexOf(monthStr),
  8550. parseInt(dayStr, 10),
  8551. parseInt(hourStr, 10),
  8552. parseInt(minuteStr, 10)
  8553. ];
  8554. if (secondStr) {
  8555. result.push(parseInt(secondStr, 10));
  8556. }
  8557. return result;
  8558. }
  8559. function untruncateYear(yearStr) {
  8560. var year = parseInt(yearStr, 10);
  8561. if (year <= 49) {
  8562. return 2e3 + year;
  8563. } else if (year <= 999) {
  8564. return 1900 + year;
  8565. }
  8566. return year;
  8567. }
  8568. function preprocessRFC2822(s2) {
  8569. return s2.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
  8570. }
  8571. function checkWeekday(weekdayStr, parsedInput, config) {
  8572. if (weekdayStr) {
  8573. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
  8574. parsedInput[0],
  8575. parsedInput[1],
  8576. parsedInput[2]
  8577. ).getDay();
  8578. if (weekdayProvided !== weekdayActual) {
  8579. getParsingFlags(config).weekdayMismatch = true;
  8580. config._isValid = false;
  8581. return false;
  8582. }
  8583. }
  8584. return true;
  8585. }
  8586. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  8587. if (obsOffset) {
  8588. return obsOffsets[obsOffset];
  8589. } else if (militaryOffset) {
  8590. return 0;
  8591. } else {
  8592. var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100;
  8593. return h * 60 + m;
  8594. }
  8595. }
  8596. function configFromRFC2822(config) {
  8597. var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
  8598. if (match) {
  8599. parsedArray = extractFromRFC2822Strings(
  8600. match[4],
  8601. match[3],
  8602. match[2],
  8603. match[5],
  8604. match[6],
  8605. match[7]
  8606. );
  8607. if (!checkWeekday(match[1], parsedArray, config)) {
  8608. return;
  8609. }
  8610. config._a = parsedArray;
  8611. config._tzm = calculateOffset(match[8], match[9], match[10]);
  8612. config._d = createUTCDate.apply(null, config._a);
  8613. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  8614. getParsingFlags(config).rfc2822 = true;
  8615. } else {
  8616. config._isValid = false;
  8617. }
  8618. }
  8619. function configFromString(config) {
  8620. var matched = aspNetJsonRegex.exec(config._i);
  8621. if (matched !== null) {
  8622. config._d = /* @__PURE__ */ new Date(+matched[1]);
  8623. return;
  8624. }
  8625. configFromISO(config);
  8626. if (config._isValid === false) {
  8627. delete config._isValid;
  8628. } else {
  8629. return;
  8630. }
  8631. configFromRFC2822(config);
  8632. if (config._isValid === false) {
  8633. delete config._isValid;
  8634. } else {
  8635. return;
  8636. }
  8637. if (config._strict) {
  8638. config._isValid = false;
  8639. } else {
  8640. hooks.createFromInputFallback(config);
  8641. }
  8642. }
  8643. hooks.createFromInputFallback = deprecate(
  8644. "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
  8645. function(config) {
  8646. config._d = /* @__PURE__ */ new Date(config._i + (config._useUTC ? " UTC" : ""));
  8647. }
  8648. );
  8649. function defaults(a, b, c) {
  8650. if (a != null) {
  8651. return a;
  8652. }
  8653. if (b != null) {
  8654. return b;
  8655. }
  8656. return c;
  8657. }
  8658. function currentDateArray(config) {
  8659. var nowValue = new Date(hooks.now());
  8660. if (config._useUTC) {
  8661. return [
  8662. nowValue.getUTCFullYear(),
  8663. nowValue.getUTCMonth(),
  8664. nowValue.getUTCDate()
  8665. ];
  8666. }
  8667. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  8668. }
  8669. function configFromArray(config) {
  8670. var i, date, input = [], currentDate, expectedWeekday, yearToUse;
  8671. if (config._d) {
  8672. return;
  8673. }
  8674. currentDate = currentDateArray(config);
  8675. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  8676. dayOfYearFromWeekInfo(config);
  8677. }
  8678. if (config._dayOfYear != null) {
  8679. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  8680. if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
  8681. getParsingFlags(config)._overflowDayOfYear = true;
  8682. }
  8683. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  8684. config._a[MONTH] = date.getUTCMonth();
  8685. config._a[DATE] = date.getUTCDate();
  8686. }
  8687. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  8688. config._a[i] = input[i] = currentDate[i];
  8689. }
  8690. for (; i < 7; i++) {
  8691. config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];
  8692. }
  8693. if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
  8694. config._nextDay = true;
  8695. config._a[HOUR] = 0;
  8696. }
  8697. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  8698. null,
  8699. input
  8700. );
  8701. expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
  8702. if (config._tzm != null) {
  8703. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  8704. }
  8705. if (config._nextDay) {
  8706. config._a[HOUR] = 24;
  8707. }
  8708. if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
  8709. getParsingFlags(config).weekdayMismatch = true;
  8710. }
  8711. }
  8712. function dayOfYearFromWeekInfo(config) {
  8713. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  8714. w = config._w;
  8715. if (w.GG != null || w.W != null || w.E != null) {
  8716. dow = 1;
  8717. doy = 4;
  8718. weekYear = defaults(
  8719. w.GG,
  8720. config._a[YEAR],
  8721. weekOfYear(createLocal(), 1, 4).year
  8722. );
  8723. week = defaults(w.W, 1);
  8724. weekday = defaults(w.E, 1);
  8725. if (weekday < 1 || weekday > 7) {
  8726. weekdayOverflow = true;
  8727. }
  8728. } else {
  8729. dow = config._locale._week.dow;
  8730. doy = config._locale._week.doy;
  8731. curWeek = weekOfYear(createLocal(), dow, doy);
  8732. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  8733. week = defaults(w.w, curWeek.week);
  8734. if (w.d != null) {
  8735. weekday = w.d;
  8736. if (weekday < 0 || weekday > 6) {
  8737. weekdayOverflow = true;
  8738. }
  8739. } else if (w.e != null) {
  8740. weekday = w.e + dow;
  8741. if (w.e < 0 || w.e > 6) {
  8742. weekdayOverflow = true;
  8743. }
  8744. } else {
  8745. weekday = dow;
  8746. }
  8747. }
  8748. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  8749. getParsingFlags(config)._overflowWeeks = true;
  8750. } else if (weekdayOverflow != null) {
  8751. getParsingFlags(config)._overflowWeekday = true;
  8752. } else {
  8753. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  8754. config._a[YEAR] = temp.year;
  8755. config._dayOfYear = temp.dayOfYear;
  8756. }
  8757. }
  8758. hooks.ISO_8601 = function() {
  8759. };
  8760. hooks.RFC_2822 = function() {
  8761. };
  8762. function configFromStringAndFormat(config) {
  8763. if (config._f === hooks.ISO_8601) {
  8764. configFromISO(config);
  8765. return;
  8766. }
  8767. if (config._f === hooks.RFC_2822) {
  8768. configFromRFC2822(config);
  8769. return;
  8770. }
  8771. config._a = [];
  8772. getParsingFlags(config).empty = true;
  8773. var string = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
  8774. tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  8775. tokenLen = tokens2.length;
  8776. for (i = 0; i < tokenLen; i++) {
  8777. token2 = tokens2[i];
  8778. parsedInput = (string.match(getParseRegexForToken(token2, config)) || [])[0];
  8779. if (parsedInput) {
  8780. skipped = string.substr(0, string.indexOf(parsedInput));
  8781. if (skipped.length > 0) {
  8782. getParsingFlags(config).unusedInput.push(skipped);
  8783. }
  8784. string = string.slice(
  8785. string.indexOf(parsedInput) + parsedInput.length
  8786. );
  8787. totalParsedInputLength += parsedInput.length;
  8788. }
  8789. if (formatTokenFunctions[token2]) {
  8790. if (parsedInput) {
  8791. getParsingFlags(config).empty = false;
  8792. } else {
  8793. getParsingFlags(config).unusedTokens.push(token2);
  8794. }
  8795. addTimeToArrayFromToken(token2, parsedInput, config);
  8796. } else if (config._strict && !parsedInput) {
  8797. getParsingFlags(config).unusedTokens.push(token2);
  8798. }
  8799. }
  8800. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  8801. if (string.length > 0) {
  8802. getParsingFlags(config).unusedInput.push(string);
  8803. }
  8804. if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
  8805. getParsingFlags(config).bigHour = void 0;
  8806. }
  8807. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  8808. getParsingFlags(config).meridiem = config._meridiem;
  8809. config._a[HOUR] = meridiemFixWrap(
  8810. config._locale,
  8811. config._a[HOUR],
  8812. config._meridiem
  8813. );
  8814. era = getParsingFlags(config).era;
  8815. if (era !== null) {
  8816. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  8817. }
  8818. configFromArray(config);
  8819. checkOverflow(config);
  8820. }
  8821. function meridiemFixWrap(locale2, hour, meridiem2) {
  8822. var isPm;
  8823. if (meridiem2 == null) {
  8824. return hour;
  8825. }
  8826. if (locale2.meridiemHour != null) {
  8827. return locale2.meridiemHour(hour, meridiem2);
  8828. } else if (locale2.isPM != null) {
  8829. isPm = locale2.isPM(meridiem2);
  8830. if (isPm && hour < 12) {
  8831. hour += 12;
  8832. }
  8833. if (!isPm && hour === 12) {
  8834. hour = 0;
  8835. }
  8836. return hour;
  8837. } else {
  8838. return hour;
  8839. }
  8840. }
  8841. function configFromStringAndArray(config) {
  8842. var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
  8843. if (configfLen === 0) {
  8844. getParsingFlags(config).invalidFormat = true;
  8845. config._d = /* @__PURE__ */ new Date(NaN);
  8846. return;
  8847. }
  8848. for (i = 0; i < configfLen; i++) {
  8849. currentScore = 0;
  8850. validFormatFound = false;
  8851. tempConfig = copyConfig({}, config);
  8852. if (config._useUTC != null) {
  8853. tempConfig._useUTC = config._useUTC;
  8854. }
  8855. tempConfig._f = config._f[i];
  8856. configFromStringAndFormat(tempConfig);
  8857. if (isValid(tempConfig)) {
  8858. validFormatFound = true;
  8859. }
  8860. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  8861. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  8862. getParsingFlags(tempConfig).score = currentScore;
  8863. if (!bestFormatIsValid) {
  8864. if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
  8865. scoreToBeat = currentScore;
  8866. bestMoment = tempConfig;
  8867. if (validFormatFound) {
  8868. bestFormatIsValid = true;
  8869. }
  8870. }
  8871. } else {
  8872. if (currentScore < scoreToBeat) {
  8873. scoreToBeat = currentScore;
  8874. bestMoment = tempConfig;
  8875. }
  8876. }
  8877. }
  8878. extend(config, bestMoment || tempConfig);
  8879. }
  8880. function configFromObject(config) {
  8881. if (config._d) {
  8882. return;
  8883. }
  8884. var i = normalizeObjectUnits(config._i), dayOrDate = i.day === void 0 ? i.date : i.day;
  8885. config._a = map(
  8886. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  8887. function(obj) {
  8888. return obj && parseInt(obj, 10);
  8889. }
  8890. );
  8891. configFromArray(config);
  8892. }
  8893. function createFromConfig(config) {
  8894. var res = new Moment(checkOverflow(prepareConfig(config)));
  8895. if (res._nextDay) {
  8896. res.add(1, "d");
  8897. res._nextDay = void 0;
  8898. }
  8899. return res;
  8900. }
  8901. function prepareConfig(config) {
  8902. var input = config._i, format2 = config._f;
  8903. config._locale = config._locale || getLocale(config._l);
  8904. if (input === null || format2 === void 0 && input === "") {
  8905. return createInvalid({ nullInput: true });
  8906. }
  8907. if (typeof input === "string") {
  8908. config._i = input = config._locale.preparse(input);
  8909. }
  8910. if (isMoment(input)) {
  8911. return new Moment(checkOverflow(input));
  8912. } else if (isDate(input)) {
  8913. config._d = input;
  8914. } else if (isArray(format2)) {
  8915. configFromStringAndArray(config);
  8916. } else if (format2) {
  8917. configFromStringAndFormat(config);
  8918. } else {
  8919. configFromInput(config);
  8920. }
  8921. if (!isValid(config)) {
  8922. config._d = null;
  8923. }
  8924. return config;
  8925. }
  8926. function configFromInput(config) {
  8927. var input = config._i;
  8928. if (isUndefined(input)) {
  8929. config._d = new Date(hooks.now());
  8930. } else if (isDate(input)) {
  8931. config._d = new Date(input.valueOf());
  8932. } else if (typeof input === "string") {
  8933. configFromString(config);
  8934. } else if (isArray(input)) {
  8935. config._a = map(input.slice(0), function(obj) {
  8936. return parseInt(obj, 10);
  8937. });
  8938. configFromArray(config);
  8939. } else if (isObject(input)) {
  8940. configFromObject(config);
  8941. } else if (isNumber(input)) {
  8942. config._d = new Date(input);
  8943. } else {
  8944. hooks.createFromInputFallback(config);
  8945. }
  8946. }
  8947. function createLocalOrUTC(input, format2, locale2, strict, isUTC) {
  8948. var c = {};
  8949. if (format2 === true || format2 === false) {
  8950. strict = format2;
  8951. format2 = void 0;
  8952. }
  8953. if (locale2 === true || locale2 === false) {
  8954. strict = locale2;
  8955. locale2 = void 0;
  8956. }
  8957. if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
  8958. input = void 0;
  8959. }
  8960. c._isAMomentObject = true;
  8961. c._useUTC = c._isUTC = isUTC;
  8962. c._l = locale2;
  8963. c._i = input;
  8964. c._f = format2;
  8965. c._strict = strict;
  8966. return createFromConfig(c);
  8967. }
  8968. function createLocal(input, format2, locale2, strict) {
  8969. return createLocalOrUTC(input, format2, locale2, strict, false);
  8970. }
  8971. var prototypeMin = deprecate(
  8972. "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
  8973. function() {
  8974. var other = createLocal.apply(null, arguments);
  8975. if (this.isValid() && other.isValid()) {
  8976. return other < this ? this : other;
  8977. } else {
  8978. return createInvalid();
  8979. }
  8980. }
  8981. ), prototypeMax = deprecate(
  8982. "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
  8983. function() {
  8984. var other = createLocal.apply(null, arguments);
  8985. if (this.isValid() && other.isValid()) {
  8986. return other > this ? this : other;
  8987. } else {
  8988. return createInvalid();
  8989. }
  8990. }
  8991. );
  8992. function pickBy(fn, moments) {
  8993. var res, i;
  8994. if (moments.length === 1 && isArray(moments[0])) {
  8995. moments = moments[0];
  8996. }
  8997. if (!moments.length) {
  8998. return createLocal();
  8999. }
  9000. res = moments[0];
  9001. for (i = 1; i < moments.length; ++i) {
  9002. if (!moments[i].isValid() || moments[i][fn](res)) {
  9003. res = moments[i];
  9004. }
  9005. }
  9006. return res;
  9007. }
  9008. function min() {
  9009. var args = [].slice.call(arguments, 0);
  9010. return pickBy("isBefore", args);
  9011. }
  9012. function max() {
  9013. var args = [].slice.call(arguments, 0);
  9014. return pickBy("isAfter", args);
  9015. }
  9016. var now = function() {
  9017. return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
  9018. };
  9019. var ordering = [
  9020. "year",
  9021. "quarter",
  9022. "month",
  9023. "week",
  9024. "day",
  9025. "hour",
  9026. "minute",
  9027. "second",
  9028. "millisecond"
  9029. ];
  9030. function isDurationValid(m) {
  9031. var key, unitHasDecimal = false, i, orderLen = ordering.length;
  9032. for (key in m) {
  9033. if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
  9034. return false;
  9035. }
  9036. }
  9037. for (i = 0; i < orderLen; ++i) {
  9038. if (m[ordering[i]]) {
  9039. if (unitHasDecimal) {
  9040. return false;
  9041. }
  9042. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  9043. unitHasDecimal = true;
  9044. }
  9045. }
  9046. }
  9047. return true;
  9048. }
  9049. function isValid$1() {
  9050. return this._isValid;
  9051. }
  9052. function createInvalid$1() {
  9053. return createDuration(NaN);
  9054. }
  9055. function Duration(duration) {
  9056. var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
  9057. this._isValid = isDurationValid(normalizedInput);
  9058. this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
  9059. minutes2 * 6e4 + // 1000 * 60
  9060. hours2 * 1e3 * 60 * 60;
  9061. this._days = +days2 + weeks2 * 7;
  9062. this._months = +months2 + quarters * 3 + years2 * 12;
  9063. this._data = {};
  9064. this._locale = getLocale();
  9065. this._bubble();
  9066. }
  9067. function isDuration(obj) {
  9068. return obj instanceof Duration;
  9069. }
  9070. function absRound(number) {
  9071. if (number < 0) {
  9072. return Math.round(-1 * number) * -1;
  9073. } else {
  9074. return Math.round(number);
  9075. }
  9076. }
  9077. function compareArrays(array1, array2, dontConvert) {
  9078. var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i;
  9079. for (i = 0; i < len; i++) {
  9080. if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
  9081. diffs++;
  9082. }
  9083. }
  9084. return diffs + lengthDiff;
  9085. }
  9086. function offset(token2, separator) {
  9087. addFormatToken(token2, 0, 0, function() {
  9088. var offset2 = this.utcOffset(), sign2 = "+";
  9089. if (offset2 < 0) {
  9090. offset2 = -offset2;
  9091. sign2 = "-";
  9092. }
  9093. return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
  9094. });
  9095. }
  9096. offset("Z", ":");
  9097. offset("ZZ", "");
  9098. addRegexToken("Z", matchShortOffset);
  9099. addRegexToken("ZZ", matchShortOffset);
  9100. addParseToken(["Z", "ZZ"], function(input, array, config) {
  9101. config._useUTC = true;
  9102. config._tzm = offsetFromString(matchShortOffset, input);
  9103. });
  9104. var chunkOffset = /([\+\-]|\d\d)/gi;
  9105. function offsetFromString(matcher, string) {
  9106. var matches = (string || "").match(matcher), chunk, parts, minutes2;
  9107. if (matches === null) {
  9108. return null;
  9109. }
  9110. chunk = matches[matches.length - 1] || [];
  9111. parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
  9112. minutes2 = +(parts[1] * 60) + toInt(parts[2]);
  9113. return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
  9114. }
  9115. function cloneWithOffset(input, model) {
  9116. var res, diff2;
  9117. if (model._isUTC) {
  9118. res = model.clone();
  9119. diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  9120. res._d.setTime(res._d.valueOf() + diff2);
  9121. hooks.updateOffset(res, false);
  9122. return res;
  9123. } else {
  9124. return createLocal(input).local();
  9125. }
  9126. }
  9127. function getDateOffset(m) {
  9128. return -Math.round(m._d.getTimezoneOffset());
  9129. }
  9130. hooks.updateOffset = function() {
  9131. };
  9132. function getSetOffset(input, keepLocalTime, keepMinutes) {
  9133. var offset2 = this._offset || 0, localAdjust;
  9134. if (!this.isValid()) {
  9135. return input != null ? this : NaN;
  9136. }
  9137. if (input != null) {
  9138. if (typeof input === "string") {
  9139. input = offsetFromString(matchShortOffset, input);
  9140. if (input === null) {
  9141. return this;
  9142. }
  9143. } else if (Math.abs(input) < 16 && !keepMinutes) {
  9144. input = input * 60;
  9145. }
  9146. if (!this._isUTC && keepLocalTime) {
  9147. localAdjust = getDateOffset(this);
  9148. }
  9149. this._offset = input;
  9150. this._isUTC = true;
  9151. if (localAdjust != null) {
  9152. this.add(localAdjust, "m");
  9153. }
  9154. if (offset2 !== input) {
  9155. if (!keepLocalTime || this._changeInProgress) {
  9156. addSubtract(
  9157. this,
  9158. createDuration(input - offset2, "m"),
  9159. 1,
  9160. false
  9161. );
  9162. } else if (!this._changeInProgress) {
  9163. this._changeInProgress = true;
  9164. hooks.updateOffset(this, true);
  9165. this._changeInProgress = null;
  9166. }
  9167. }
  9168. return this;
  9169. } else {
  9170. return this._isUTC ? offset2 : getDateOffset(this);
  9171. }
  9172. }
  9173. function getSetZone(input, keepLocalTime) {
  9174. if (input != null) {
  9175. if (typeof input !== "string") {
  9176. input = -input;
  9177. }
  9178. this.utcOffset(input, keepLocalTime);
  9179. return this;
  9180. } else {
  9181. return -this.utcOffset();
  9182. }
  9183. }
  9184. function setOffsetToUTC(keepLocalTime) {
  9185. return this.utcOffset(0, keepLocalTime);
  9186. }
  9187. function setOffsetToLocal(keepLocalTime) {
  9188. if (this._isUTC) {
  9189. this.utcOffset(0, keepLocalTime);
  9190. this._isUTC = false;
  9191. if (keepLocalTime) {
  9192. this.subtract(getDateOffset(this), "m");
  9193. }
  9194. }
  9195. return this;
  9196. }
  9197. function setOffsetToParsedOffset() {
  9198. if (this._tzm != null) {
  9199. this.utcOffset(this._tzm, false, true);
  9200. } else if (typeof this._i === "string") {
  9201. var tZone = offsetFromString(matchOffset, this._i);
  9202. if (tZone != null) {
  9203. this.utcOffset(tZone);
  9204. } else {
  9205. this.utcOffset(0, true);
  9206. }
  9207. }
  9208. return this;
  9209. }
  9210. function hasAlignedHourOffset(input) {
  9211. if (!this.isValid()) {
  9212. return false;
  9213. }
  9214. input = input ? createLocal(input).utcOffset() : 0;
  9215. return (this.utcOffset() - input) % 60 === 0;
  9216. }
  9217. function isDaylightSavingTime() {
  9218. return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
  9219. }
  9220. function isDaylightSavingTimeShifted() {
  9221. if (!isUndefined(this._isDSTShifted)) {
  9222. return this._isDSTShifted;
  9223. }
  9224. var c = {}, other;
  9225. copyConfig(c, this);
  9226. c = prepareConfig(c);
  9227. if (c._a) {
  9228. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  9229. this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  9230. } else {
  9231. this._isDSTShifted = false;
  9232. }
  9233. return this._isDSTShifted;
  9234. }
  9235. function isLocal() {
  9236. return this.isValid() ? !this._isUTC : false;
  9237. }
  9238. function isUtcOffset() {
  9239. return this.isValid() ? this._isUTC : false;
  9240. }
  9241. function isUtc() {
  9242. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  9243. }
  9244. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  9245. function createDuration(input, key) {
  9246. var duration = input, match = null, sign2, ret, diffRes;
  9247. if (isDuration(input)) {
  9248. duration = {
  9249. ms: input._milliseconds,
  9250. d: input._days,
  9251. M: input._months
  9252. };
  9253. } else if (isNumber(input) || !isNaN(+input)) {
  9254. duration = {};
  9255. if (key) {
  9256. duration[key] = +input;
  9257. } else {
  9258. duration.milliseconds = +input;
  9259. }
  9260. } else if (match = aspNetRegex.exec(input)) {
  9261. sign2 = match[1] === "-" ? -1 : 1;
  9262. duration = {
  9263. y: 0,
  9264. d: toInt(match[DATE]) * sign2,
  9265. h: toInt(match[HOUR]) * sign2,
  9266. m: toInt(match[MINUTE]) * sign2,
  9267. s: toInt(match[SECOND]) * sign2,
  9268. ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
  9269. // the millisecond decimal point is included in the match
  9270. };
  9271. } else if (match = isoRegex.exec(input)) {
  9272. sign2 = match[1] === "-" ? -1 : 1;
  9273. duration = {
  9274. y: parseIso(match[2], sign2),
  9275. M: parseIso(match[3], sign2),
  9276. w: parseIso(match[4], sign2),
  9277. d: parseIso(match[5], sign2),
  9278. h: parseIso(match[6], sign2),
  9279. m: parseIso(match[7], sign2),
  9280. s: parseIso(match[8], sign2)
  9281. };
  9282. } else if (duration == null) {
  9283. duration = {};
  9284. } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
  9285. diffRes = momentsDifference(
  9286. createLocal(duration.from),
  9287. createLocal(duration.to)
  9288. );
  9289. duration = {};
  9290. duration.ms = diffRes.milliseconds;
  9291. duration.M = diffRes.months;
  9292. }
  9293. ret = new Duration(duration);
  9294. if (isDuration(input) && hasOwnProp(input, "_locale")) {
  9295. ret._locale = input._locale;
  9296. }
  9297. if (isDuration(input) && hasOwnProp(input, "_isValid")) {
  9298. ret._isValid = input._isValid;
  9299. }
  9300. return ret;
  9301. }
  9302. createDuration.fn = Duration.prototype;
  9303. createDuration.invalid = createInvalid$1;
  9304. function parseIso(inp, sign2) {
  9305. var res = inp && parseFloat(inp.replace(",", "."));
  9306. return (isNaN(res) ? 0 : res) * sign2;
  9307. }
  9308. function positiveMomentsDifference(base, other) {
  9309. var res = {};
  9310. res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
  9311. if (base.clone().add(res.months, "M").isAfter(other)) {
  9312. --res.months;
  9313. }
  9314. res.milliseconds = +other - +base.clone().add(res.months, "M");
  9315. return res;
  9316. }
  9317. function momentsDifference(base, other) {
  9318. var res;
  9319. if (!(base.isValid() && other.isValid())) {
  9320. return { milliseconds: 0, months: 0 };
  9321. }
  9322. other = cloneWithOffset(other, base);
  9323. if (base.isBefore(other)) {
  9324. res = positiveMomentsDifference(base, other);
  9325. } else {
  9326. res = positiveMomentsDifference(other, base);
  9327. res.milliseconds = -res.milliseconds;
  9328. res.months = -res.months;
  9329. }
  9330. return res;
  9331. }
  9332. function createAdder(direction, name) {
  9333. return function(val, period) {
  9334. var dur, tmp;
  9335. if (period !== null && !isNaN(+period)) {
  9336. deprecateSimple(
  9337. name,
  9338. "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
  9339. );
  9340. tmp = val;
  9341. val = period;
  9342. period = tmp;
  9343. }
  9344. dur = createDuration(val, period);
  9345. addSubtract(this, dur, direction);
  9346. return this;
  9347. };
  9348. }
  9349. function addSubtract(mom, duration, isAdding, updateOffset) {
  9350. var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
  9351. if (!mom.isValid()) {
  9352. return;
  9353. }
  9354. updateOffset = updateOffset == null ? true : updateOffset;
  9355. if (months2) {
  9356. setMonth(mom, get(mom, "Month") + months2 * isAdding);
  9357. }
  9358. if (days2) {
  9359. set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
  9360. }
  9361. if (milliseconds2) {
  9362. mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
  9363. }
  9364. if (updateOffset) {
  9365. hooks.updateOffset(mom, days2 || months2);
  9366. }
  9367. }
  9368. var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
  9369. function isString(input) {
  9370. return typeof input === "string" || input instanceof String;
  9371. }
  9372. function isMomentInput(input) {
  9373. return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
  9374. }
  9375. function isMomentInputObject(input) {
  9376. var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
  9377. "years",
  9378. "year",
  9379. "y",
  9380. "months",
  9381. "month",
  9382. "M",
  9383. "days",
  9384. "day",
  9385. "d",
  9386. "dates",
  9387. "date",
  9388. "D",
  9389. "hours",
  9390. "hour",
  9391. "h",
  9392. "minutes",
  9393. "minute",
  9394. "m",
  9395. "seconds",
  9396. "second",
  9397. "s",
  9398. "milliseconds",
  9399. "millisecond",
  9400. "ms"
  9401. ], i, property, propertyLen = properties.length;
  9402. for (i = 0; i < propertyLen; i += 1) {
  9403. property = properties[i];
  9404. propertyTest = propertyTest || hasOwnProp(input, property);
  9405. }
  9406. return objectTest && propertyTest;
  9407. }
  9408. function isNumberOrStringArray(input) {
  9409. var arrayTest = isArray(input), dataTypeTest = false;
  9410. if (arrayTest) {
  9411. dataTypeTest = input.filter(function(item) {
  9412. return !isNumber(item) && isString(input);
  9413. }).length === 0;
  9414. }
  9415. return arrayTest && dataTypeTest;
  9416. }
  9417. function isCalendarSpec(input) {
  9418. var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
  9419. "sameDay",
  9420. "nextDay",
  9421. "lastDay",
  9422. "nextWeek",
  9423. "lastWeek",
  9424. "sameElse"
  9425. ], i, property;
  9426. for (i = 0; i < properties.length; i += 1) {
  9427. property = properties[i];
  9428. propertyTest = propertyTest || hasOwnProp(input, property);
  9429. }
  9430. return objectTest && propertyTest;
  9431. }
  9432. function getCalendarFormat(myMoment, now2) {
  9433. var diff2 = myMoment.diff(now2, "days", true);
  9434. return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
  9435. }
  9436. function calendar$1(time, formats) {
  9437. if (arguments.length === 1) {
  9438. if (!arguments[0]) {
  9439. time = void 0;
  9440. formats = void 0;
  9441. } else if (isMomentInput(arguments[0])) {
  9442. time = arguments[0];
  9443. formats = void 0;
  9444. } else if (isCalendarSpec(arguments[0])) {
  9445. formats = arguments[0];
  9446. time = void 0;
  9447. }
  9448. }
  9449. var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
  9450. return this.format(
  9451. output || this.localeData().calendar(format2, this, createLocal(now2))
  9452. );
  9453. }
  9454. function clone() {
  9455. return new Moment(this);
  9456. }
  9457. function isAfter(input, units) {
  9458. var localInput = isMoment(input) ? input : createLocal(input);
  9459. if (!(this.isValid() && localInput.isValid())) {
  9460. return false;
  9461. }
  9462. units = normalizeUnits(units) || "millisecond";
  9463. if (units === "millisecond") {
  9464. return this.valueOf() > localInput.valueOf();
  9465. } else {
  9466. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  9467. }
  9468. }
  9469. function isBefore(input, units) {
  9470. var localInput = isMoment(input) ? input : createLocal(input);
  9471. if (!(this.isValid() && localInput.isValid())) {
  9472. return false;
  9473. }
  9474. units = normalizeUnits(units) || "millisecond";
  9475. if (units === "millisecond") {
  9476. return this.valueOf() < localInput.valueOf();
  9477. } else {
  9478. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  9479. }
  9480. }
  9481. function isBetween(from2, to2, units, inclusivity) {
  9482. var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
  9483. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  9484. return false;
  9485. }
  9486. inclusivity = inclusivity || "()";
  9487. return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
  9488. }
  9489. function isSame(input, units) {
  9490. var localInput = isMoment(input) ? input : createLocal(input), inputMs;
  9491. if (!(this.isValid() && localInput.isValid())) {
  9492. return false;
  9493. }
  9494. units = normalizeUnits(units) || "millisecond";
  9495. if (units === "millisecond") {
  9496. return this.valueOf() === localInput.valueOf();
  9497. } else {
  9498. inputMs = localInput.valueOf();
  9499. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  9500. }
  9501. }
  9502. function isSameOrAfter(input, units) {
  9503. return this.isSame(input, units) || this.isAfter(input, units);
  9504. }
  9505. function isSameOrBefore(input, units) {
  9506. return this.isSame(input, units) || this.isBefore(input, units);
  9507. }
  9508. function diff(input, units, asFloat) {
  9509. var that, zoneDelta, output;
  9510. if (!this.isValid()) {
  9511. return NaN;
  9512. }
  9513. that = cloneWithOffset(input, this);
  9514. if (!that.isValid()) {
  9515. return NaN;
  9516. }
  9517. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  9518. units = normalizeUnits(units);
  9519. switch (units) {
  9520. case "year":
  9521. output = monthDiff(this, that) / 12;
  9522. break;
  9523. case "month":
  9524. output = monthDiff(this, that);
  9525. break;
  9526. case "quarter":
  9527. output = monthDiff(this, that) / 3;
  9528. break;
  9529. case "second":
  9530. output = (this - that) / 1e3;
  9531. break;
  9532. case "minute":
  9533. output = (this - that) / 6e4;
  9534. break;
  9535. case "hour":
  9536. output = (this - that) / 36e5;
  9537. break;
  9538. case "day":
  9539. output = (this - that - zoneDelta) / 864e5;
  9540. break;
  9541. case "week":
  9542. output = (this - that - zoneDelta) / 6048e5;
  9543. break;
  9544. default:
  9545. output = this - that;
  9546. }
  9547. return asFloat ? output : absFloor(output);
  9548. }
  9549. function monthDiff(a, b) {
  9550. if (a.date() < b.date()) {
  9551. return -monthDiff(b, a);
  9552. }
  9553. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
  9554. if (b - anchor < 0) {
  9555. anchor2 = a.clone().add(wholeMonthDiff - 1, "months");
  9556. adjust = (b - anchor) / (anchor - anchor2);
  9557. } else {
  9558. anchor2 = a.clone().add(wholeMonthDiff + 1, "months");
  9559. adjust = (b - anchor) / (anchor2 - anchor);
  9560. }
  9561. return -(wholeMonthDiff + adjust) || 0;
  9562. }
  9563. hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
  9564. hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
  9565. function toString() {
  9566. return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
  9567. }
  9568. function toISOString(keepOffset) {
  9569. if (!this.isValid()) {
  9570. return null;
  9571. }
  9572. var utc = keepOffset !== true, m = utc ? this.clone().utc() : this;
  9573. if (m.year() < 0 || m.year() > 9999) {
  9574. return formatMoment(
  9575. m,
  9576. utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
  9577. );
  9578. }
  9579. if (isFunction(Date.prototype.toISOString)) {
  9580. if (utc) {
  9581. return this.toDate().toISOString();
  9582. } else {
  9583. return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z"));
  9584. }
  9585. }
  9586. return formatMoment(
  9587. m,
  9588. utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
  9589. );
  9590. }
  9591. function inspect() {
  9592. if (!this.isValid()) {
  9593. return "moment.invalid(/* " + this._i + " */)";
  9594. }
  9595. var func = "moment", zone = "", prefix, year, datetime, suffix;
  9596. if (!this.isLocal()) {
  9597. func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
  9598. zone = "Z";
  9599. }
  9600. prefix = "[" + func + '("]';
  9601. year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
  9602. datetime = "-MM-DD[T]HH:mm:ss.SSS";
  9603. suffix = zone + '[")]';
  9604. return this.format(prefix + year + datetime + suffix);
  9605. }
  9606. function format(inputString) {
  9607. if (!inputString) {
  9608. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  9609. }
  9610. var output = formatMoment(this, inputString);
  9611. return this.localeData().postformat(output);
  9612. }
  9613. function from(time, withoutSuffix) {
  9614. if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
  9615. return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
  9616. } else {
  9617. return this.localeData().invalidDate();
  9618. }
  9619. }
  9620. function fromNow(withoutSuffix) {
  9621. return this.from(createLocal(), withoutSuffix);
  9622. }
  9623. function to(time, withoutSuffix) {
  9624. if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
  9625. return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix);
  9626. } else {
  9627. return this.localeData().invalidDate();
  9628. }
  9629. }
  9630. function toNow(withoutSuffix) {
  9631. return this.to(createLocal(), withoutSuffix);
  9632. }
  9633. function locale(key) {
  9634. var newLocaleData;
  9635. if (key === void 0) {
  9636. return this._locale._abbr;
  9637. } else {
  9638. newLocaleData = getLocale(key);
  9639. if (newLocaleData != null) {
  9640. this._locale = newLocaleData;
  9641. }
  9642. return this;
  9643. }
  9644. }
  9645. var lang = deprecate(
  9646. "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
  9647. function(key) {
  9648. if (key === void 0) {
  9649. return this.localeData();
  9650. } else {
  9651. return this.locale(key);
  9652. }
  9653. }
  9654. );
  9655. function localeData() {
  9656. return this._locale;
  9657. }
  9658. var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  9659. function mod$1(dividend, divisor) {
  9660. return (dividend % divisor + divisor) % divisor;
  9661. }
  9662. function localStartOfDate(y, m, d) {
  9663. if (y < 100 && y >= 0) {
  9664. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  9665. } else {
  9666. return new Date(y, m, d).valueOf();
  9667. }
  9668. }
  9669. function utcStartOfDate(y, m, d) {
  9670. if (y < 100 && y >= 0) {
  9671. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  9672. } else {
  9673. return Date.UTC(y, m, d);
  9674. }
  9675. }
  9676. function startOf(units) {
  9677. var time, startOfDate;
  9678. units = normalizeUnits(units);
  9679. if (units === void 0 || units === "millisecond" || !this.isValid()) {
  9680. return this;
  9681. }
  9682. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  9683. switch (units) {
  9684. case "year":
  9685. time = startOfDate(this.year(), 0, 1);
  9686. break;
  9687. case "quarter":
  9688. time = startOfDate(
  9689. this.year(),
  9690. this.month() - this.month() % 3,
  9691. 1
  9692. );
  9693. break;
  9694. case "month":
  9695. time = startOfDate(this.year(), this.month(), 1);
  9696. break;
  9697. case "week":
  9698. time = startOfDate(
  9699. this.year(),
  9700. this.month(),
  9701. this.date() - this.weekday()
  9702. );
  9703. break;
  9704. case "isoWeek":
  9705. time = startOfDate(
  9706. this.year(),
  9707. this.month(),
  9708. this.date() - (this.isoWeekday() - 1)
  9709. );
  9710. break;
  9711. case "day":
  9712. case "date":
  9713. time = startOfDate(this.year(), this.month(), this.date());
  9714. break;
  9715. case "hour":
  9716. time = this._d.valueOf();
  9717. time -= mod$1(
  9718. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  9719. MS_PER_HOUR
  9720. );
  9721. break;
  9722. case "minute":
  9723. time = this._d.valueOf();
  9724. time -= mod$1(time, MS_PER_MINUTE);
  9725. break;
  9726. case "second":
  9727. time = this._d.valueOf();
  9728. time -= mod$1(time, MS_PER_SECOND);
  9729. break;
  9730. }
  9731. this._d.setTime(time);
  9732. hooks.updateOffset(this, true);
  9733. return this;
  9734. }
  9735. function endOf(units) {
  9736. var time, startOfDate;
  9737. units = normalizeUnits(units);
  9738. if (units === void 0 || units === "millisecond" || !this.isValid()) {
  9739. return this;
  9740. }
  9741. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  9742. switch (units) {
  9743. case "year":
  9744. time = startOfDate(this.year() + 1, 0, 1) - 1;
  9745. break;
  9746. case "quarter":
  9747. time = startOfDate(
  9748. this.year(),
  9749. this.month() - this.month() % 3 + 3,
  9750. 1
  9751. ) - 1;
  9752. break;
  9753. case "month":
  9754. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  9755. break;
  9756. case "week":
  9757. time = startOfDate(
  9758. this.year(),
  9759. this.month(),
  9760. this.date() - this.weekday() + 7
  9761. ) - 1;
  9762. break;
  9763. case "isoWeek":
  9764. time = startOfDate(
  9765. this.year(),
  9766. this.month(),
  9767. this.date() - (this.isoWeekday() - 1) + 7
  9768. ) - 1;
  9769. break;
  9770. case "day":
  9771. case "date":
  9772. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  9773. break;
  9774. case "hour":
  9775. time = this._d.valueOf();
  9776. time += MS_PER_HOUR - mod$1(
  9777. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  9778. MS_PER_HOUR
  9779. ) - 1;
  9780. break;
  9781. case "minute":
  9782. time = this._d.valueOf();
  9783. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  9784. break;
  9785. case "second":
  9786. time = this._d.valueOf();
  9787. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  9788. break;
  9789. }
  9790. this._d.setTime(time);
  9791. hooks.updateOffset(this, true);
  9792. return this;
  9793. }
  9794. function valueOf() {
  9795. return this._d.valueOf() - (this._offset || 0) * 6e4;
  9796. }
  9797. function unix() {
  9798. return Math.floor(this.valueOf() / 1e3);
  9799. }
  9800. function toDate() {
  9801. return new Date(this.valueOf());
  9802. }
  9803. function toArray() {
  9804. var m = this;
  9805. return [
  9806. m.year(),
  9807. m.month(),
  9808. m.date(),
  9809. m.hour(),
  9810. m.minute(),
  9811. m.second(),
  9812. m.millisecond()
  9813. ];
  9814. }
  9815. function toObject() {
  9816. var m = this;
  9817. return {
  9818. years: m.year(),
  9819. months: m.month(),
  9820. date: m.date(),
  9821. hours: m.hours(),
  9822. minutes: m.minutes(),
  9823. seconds: m.seconds(),
  9824. milliseconds: m.milliseconds()
  9825. };
  9826. }
  9827. function toJSON() {
  9828. return this.isValid() ? this.toISOString() : null;
  9829. }
  9830. function isValid$2() {
  9831. return isValid(this);
  9832. }
  9833. function parsingFlags() {
  9834. return extend({}, getParsingFlags(this));
  9835. }
  9836. function invalidAt() {
  9837. return getParsingFlags(this).overflow;
  9838. }
  9839. function creationData() {
  9840. return {
  9841. input: this._i,
  9842. format: this._f,
  9843. locale: this._locale,
  9844. isUTC: this._isUTC,
  9845. strict: this._strict
  9846. };
  9847. }
  9848. addFormatToken("N", 0, 0, "eraAbbr");
  9849. addFormatToken("NN", 0, 0, "eraAbbr");
  9850. addFormatToken("NNN", 0, 0, "eraAbbr");
  9851. addFormatToken("NNNN", 0, 0, "eraName");
  9852. addFormatToken("NNNNN", 0, 0, "eraNarrow");
  9853. addFormatToken("y", ["y", 1], "yo", "eraYear");
  9854. addFormatToken("y", ["yy", 2], 0, "eraYear");
  9855. addFormatToken("y", ["yyy", 3], 0, "eraYear");
  9856. addFormatToken("y", ["yyyy", 4], 0, "eraYear");
  9857. addRegexToken("N", matchEraAbbr);
  9858. addRegexToken("NN", matchEraAbbr);
  9859. addRegexToken("NNN", matchEraAbbr);
  9860. addRegexToken("NNNN", matchEraName);
  9861. addRegexToken("NNNNN", matchEraNarrow);
  9862. addParseToken(
  9863. ["N", "NN", "NNN", "NNNN", "NNNNN"],
  9864. function(input, array, config, token2) {
  9865. var era = config._locale.erasParse(input, token2, config._strict);
  9866. if (era) {
  9867. getParsingFlags(config).era = era;
  9868. } else {
  9869. getParsingFlags(config).invalidEra = input;
  9870. }
  9871. }
  9872. );
  9873. addRegexToken("y", matchUnsigned);
  9874. addRegexToken("yy", matchUnsigned);
  9875. addRegexToken("yyy", matchUnsigned);
  9876. addRegexToken("yyyy", matchUnsigned);
  9877. addRegexToken("yo", matchEraYearOrdinal);
  9878. addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
  9879. addParseToken(["yo"], function(input, array, config, token2) {
  9880. var match;
  9881. if (config._locale._eraYearOrdinalRegex) {
  9882. match = input.match(config._locale._eraYearOrdinalRegex);
  9883. }
  9884. if (config._locale.eraYearOrdinalParse) {
  9885. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  9886. } else {
  9887. array[YEAR] = parseInt(input, 10);
  9888. }
  9889. });
  9890. function localeEras(m, format2) {
  9891. var i, l, date, eras = this._eras || getLocale("en")._eras;
  9892. for (i = 0, l = eras.length; i < l; ++i) {
  9893. switch (typeof eras[i].since) {
  9894. case "string":
  9895. date = hooks(eras[i].since).startOf("day");
  9896. eras[i].since = date.valueOf();
  9897. break;
  9898. }
  9899. switch (typeof eras[i].until) {
  9900. case "undefined":
  9901. eras[i].until = Infinity;
  9902. break;
  9903. case "string":
  9904. date = hooks(eras[i].until).startOf("day").valueOf();
  9905. eras[i].until = date.valueOf();
  9906. break;
  9907. }
  9908. }
  9909. return eras;
  9910. }
  9911. function localeErasParse(eraName, format2, strict) {
  9912. var i, l, eras = this.eras(), name, abbr, narrow;
  9913. eraName = eraName.toUpperCase();
  9914. for (i = 0, l = eras.length; i < l; ++i) {
  9915. name = eras[i].name.toUpperCase();
  9916. abbr = eras[i].abbr.toUpperCase();
  9917. narrow = eras[i].narrow.toUpperCase();
  9918. if (strict) {
  9919. switch (format2) {
  9920. case "N":
  9921. case "NN":
  9922. case "NNN":
  9923. if (abbr === eraName) {
  9924. return eras[i];
  9925. }
  9926. break;
  9927. case "NNNN":
  9928. if (name === eraName) {
  9929. return eras[i];
  9930. }
  9931. break;
  9932. case "NNNNN":
  9933. if (narrow === eraName) {
  9934. return eras[i];
  9935. }
  9936. break;
  9937. }
  9938. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  9939. return eras[i];
  9940. }
  9941. }
  9942. }
  9943. function localeErasConvertYear(era, year) {
  9944. var dir = era.since <= era.until ? 1 : -1;
  9945. if (year === void 0) {
  9946. return hooks(era.since).year();
  9947. } else {
  9948. return hooks(era.since).year() + (year - era.offset) * dir;
  9949. }
  9950. }
  9951. function getEraName() {
  9952. var i, l, val, eras = this.localeData().eras();
  9953. for (i = 0, l = eras.length; i < l; ++i) {
  9954. val = this.clone().startOf("day").valueOf();
  9955. if (eras[i].since <= val && val <= eras[i].until) {
  9956. return eras[i].name;
  9957. }
  9958. if (eras[i].until <= val && val <= eras[i].since) {
  9959. return eras[i].name;
  9960. }
  9961. }
  9962. return "";
  9963. }
  9964. function getEraNarrow() {
  9965. var i, l, val, eras = this.localeData().eras();
  9966. for (i = 0, l = eras.length; i < l; ++i) {
  9967. val = this.clone().startOf("day").valueOf();
  9968. if (eras[i].since <= val && val <= eras[i].until) {
  9969. return eras[i].narrow;
  9970. }
  9971. if (eras[i].until <= val && val <= eras[i].since) {
  9972. return eras[i].narrow;
  9973. }
  9974. }
  9975. return "";
  9976. }
  9977. function getEraAbbr() {
  9978. var i, l, val, eras = this.localeData().eras();
  9979. for (i = 0, l = eras.length; i < l; ++i) {
  9980. val = this.clone().startOf("day").valueOf();
  9981. if (eras[i].since <= val && val <= eras[i].until) {
  9982. return eras[i].abbr;
  9983. }
  9984. if (eras[i].until <= val && val <= eras[i].since) {
  9985. return eras[i].abbr;
  9986. }
  9987. }
  9988. return "";
  9989. }
  9990. function getEraYear() {
  9991. var i, l, dir, val, eras = this.localeData().eras();
  9992. for (i = 0, l = eras.length; i < l; ++i) {
  9993. dir = eras[i].since <= eras[i].until ? 1 : -1;
  9994. val = this.clone().startOf("day").valueOf();
  9995. if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) {
  9996. return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset;
  9997. }
  9998. }
  9999. return this.year();
  10000. }
  10001. function erasNameRegex(isStrict) {
  10002. if (!hasOwnProp(this, "_erasNameRegex")) {
  10003. computeErasParse.call(this);
  10004. }
  10005. return isStrict ? this._erasNameRegex : this._erasRegex;
  10006. }
  10007. function erasAbbrRegex(isStrict) {
  10008. if (!hasOwnProp(this, "_erasAbbrRegex")) {
  10009. computeErasParse.call(this);
  10010. }
  10011. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  10012. }
  10013. function erasNarrowRegex(isStrict) {
  10014. if (!hasOwnProp(this, "_erasNarrowRegex")) {
  10015. computeErasParse.call(this);
  10016. }
  10017. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  10018. }
  10019. function matchEraAbbr(isStrict, locale2) {
  10020. return locale2.erasAbbrRegex(isStrict);
  10021. }
  10022. function matchEraName(isStrict, locale2) {
  10023. return locale2.erasNameRegex(isStrict);
  10024. }
  10025. function matchEraNarrow(isStrict, locale2) {
  10026. return locale2.erasNarrowRegex(isStrict);
  10027. }
  10028. function matchEraYearOrdinal(isStrict, locale2) {
  10029. return locale2._eraYearOrdinalRegex || matchUnsigned;
  10030. }
  10031. function computeErasParse() {
  10032. var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, eras = this.eras();
  10033. for (i = 0, l = eras.length; i < l; ++i) {
  10034. namePieces.push(regexEscape(eras[i].name));
  10035. abbrPieces.push(regexEscape(eras[i].abbr));
  10036. narrowPieces.push(regexEscape(eras[i].narrow));
  10037. mixedPieces.push(regexEscape(eras[i].name));
  10038. mixedPieces.push(regexEscape(eras[i].abbr));
  10039. mixedPieces.push(regexEscape(eras[i].narrow));
  10040. }
  10041. this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  10042. this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
  10043. this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
  10044. this._erasNarrowRegex = new RegExp(
  10045. "^(" + narrowPieces.join("|") + ")",
  10046. "i"
  10047. );
  10048. }
  10049. addFormatToken(0, ["gg", 2], 0, function() {
  10050. return this.weekYear() % 100;
  10051. });
  10052. addFormatToken(0, ["GG", 2], 0, function() {
  10053. return this.isoWeekYear() % 100;
  10054. });
  10055. function addWeekYearFormatToken(token2, getter) {
  10056. addFormatToken(0, [token2, token2.length], 0, getter);
  10057. }
  10058. addWeekYearFormatToken("gggg", "weekYear");
  10059. addWeekYearFormatToken("ggggg", "weekYear");
  10060. addWeekYearFormatToken("GGGG", "isoWeekYear");
  10061. addWeekYearFormatToken("GGGGG", "isoWeekYear");
  10062. addUnitAlias("weekYear", "gg");
  10063. addUnitAlias("isoWeekYear", "GG");
  10064. addUnitPriority("weekYear", 1);
  10065. addUnitPriority("isoWeekYear", 1);
  10066. addRegexToken("G", matchSigned);
  10067. addRegexToken("g", matchSigned);
  10068. addRegexToken("GG", match1to2, match2);
  10069. addRegexToken("gg", match1to2, match2);
  10070. addRegexToken("GGGG", match1to4, match4);
  10071. addRegexToken("gggg", match1to4, match4);
  10072. addRegexToken("GGGGG", match1to6, match6);
  10073. addRegexToken("ggggg", match1to6, match6);
  10074. addWeekParseToken(
  10075. ["gggg", "ggggg", "GGGG", "GGGGG"],
  10076. function(input, week, config, token2) {
  10077. week[token2.substr(0, 2)] = toInt(input);
  10078. }
  10079. );
  10080. addWeekParseToken(["gg", "GG"], function(input, week, config, token2) {
  10081. week[token2] = hooks.parseTwoDigitYear(input);
  10082. });
  10083. function getSetWeekYear(input) {
  10084. return getSetWeekYearHelper.call(
  10085. this,
  10086. input,
  10087. this.week(),
  10088. this.weekday(),
  10089. this.localeData()._week.dow,
  10090. this.localeData()._week.doy
  10091. );
  10092. }
  10093. function getSetISOWeekYear(input) {
  10094. return getSetWeekYearHelper.call(
  10095. this,
  10096. input,
  10097. this.isoWeek(),
  10098. this.isoWeekday(),
  10099. 1,
  10100. 4
  10101. );
  10102. }
  10103. function getISOWeeksInYear() {
  10104. return weeksInYear(this.year(), 1, 4);
  10105. }
  10106. function getISOWeeksInISOWeekYear() {
  10107. return weeksInYear(this.isoWeekYear(), 1, 4);
  10108. }
  10109. function getWeeksInYear() {
  10110. var weekInfo = this.localeData()._week;
  10111. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  10112. }
  10113. function getWeeksInWeekYear() {
  10114. var weekInfo = this.localeData()._week;
  10115. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  10116. }
  10117. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  10118. var weeksTarget;
  10119. if (input == null) {
  10120. return weekOfYear(this, dow, doy).year;
  10121. } else {
  10122. weeksTarget = weeksInYear(input, dow, doy);
  10123. if (week > weeksTarget) {
  10124. week = weeksTarget;
  10125. }
  10126. return setWeekAll.call(this, input, week, weekday, dow, doy);
  10127. }
  10128. }
  10129. function setWeekAll(weekYear, week, weekday, dow, doy) {
  10130. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  10131. this.year(date.getUTCFullYear());
  10132. this.month(date.getUTCMonth());
  10133. this.date(date.getUTCDate());
  10134. return this;
  10135. }
  10136. addFormatToken("Q", 0, "Qo", "quarter");
  10137. addUnitAlias("quarter", "Q");
  10138. addUnitPriority("quarter", 7);
  10139. addRegexToken("Q", match1);
  10140. addParseToken("Q", function(input, array) {
  10141. array[MONTH] = (toInt(input) - 1) * 3;
  10142. });
  10143. function getSetQuarter(input) {
  10144. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  10145. }
  10146. addFormatToken("D", ["DD", 2], "Do", "date");
  10147. addUnitAlias("date", "D");
  10148. addUnitPriority("date", 9);
  10149. addRegexToken("D", match1to2);
  10150. addRegexToken("DD", match1to2, match2);
  10151. addRegexToken("Do", function(isStrict, locale2) {
  10152. return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
  10153. });
  10154. addParseToken(["D", "DD"], DATE);
  10155. addParseToken("Do", function(input, array) {
  10156. array[DATE] = toInt(input.match(match1to2)[0]);
  10157. });
  10158. var getSetDayOfMonth = makeGetSet("Date", true);
  10159. addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
  10160. addUnitAlias("dayOfYear", "DDD");
  10161. addUnitPriority("dayOfYear", 4);
  10162. addRegexToken("DDD", match1to3);
  10163. addRegexToken("DDDD", match3);
  10164. addParseToken(["DDD", "DDDD"], function(input, array, config) {
  10165. config._dayOfYear = toInt(input);
  10166. });
  10167. function getSetDayOfYear(input) {
  10168. var dayOfYear = Math.round(
  10169. (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
  10170. ) + 1;
  10171. return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
  10172. }
  10173. addFormatToken("m", ["mm", 2], 0, "minute");
  10174. addUnitAlias("minute", "m");
  10175. addUnitPriority("minute", 14);
  10176. addRegexToken("m", match1to2);
  10177. addRegexToken("mm", match1to2, match2);
  10178. addParseToken(["m", "mm"], MINUTE);
  10179. var getSetMinute = makeGetSet("Minutes", false);
  10180. addFormatToken("s", ["ss", 2], 0, "second");
  10181. addUnitAlias("second", "s");
  10182. addUnitPriority("second", 15);
  10183. addRegexToken("s", match1to2);
  10184. addRegexToken("ss", match1to2, match2);
  10185. addParseToken(["s", "ss"], SECOND);
  10186. var getSetSecond = makeGetSet("Seconds", false);
  10187. addFormatToken("S", 0, 0, function() {
  10188. return ~~(this.millisecond() / 100);
  10189. });
  10190. addFormatToken(0, ["SS", 2], 0, function() {
  10191. return ~~(this.millisecond() / 10);
  10192. });
  10193. addFormatToken(0, ["SSS", 3], 0, "millisecond");
  10194. addFormatToken(0, ["SSSS", 4], 0, function() {
  10195. return this.millisecond() * 10;
  10196. });
  10197. addFormatToken(0, ["SSSSS", 5], 0, function() {
  10198. return this.millisecond() * 100;
  10199. });
  10200. addFormatToken(0, ["SSSSSS", 6], 0, function() {
  10201. return this.millisecond() * 1e3;
  10202. });
  10203. addFormatToken(0, ["SSSSSSS", 7], 0, function() {
  10204. return this.millisecond() * 1e4;
  10205. });
  10206. addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
  10207. return this.millisecond() * 1e5;
  10208. });
  10209. addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
  10210. return this.millisecond() * 1e6;
  10211. });
  10212. addUnitAlias("millisecond", "ms");
  10213. addUnitPriority("millisecond", 16);
  10214. addRegexToken("S", match1to3, match1);
  10215. addRegexToken("SS", match1to3, match2);
  10216. addRegexToken("SSS", match1to3, match3);
  10217. var token, getSetMillisecond;
  10218. for (token = "SSSS"; token.length <= 9; token += "S") {
  10219. addRegexToken(token, matchUnsigned);
  10220. }
  10221. function parseMs(input, array) {
  10222. array[MILLISECOND] = toInt(("0." + input) * 1e3);
  10223. }
  10224. for (token = "S"; token.length <= 9; token += "S") {
  10225. addParseToken(token, parseMs);
  10226. }
  10227. getSetMillisecond = makeGetSet("Milliseconds", false);
  10228. addFormatToken("z", 0, 0, "zoneAbbr");
  10229. addFormatToken("zz", 0, 0, "zoneName");
  10230. function getZoneAbbr() {
  10231. return this._isUTC ? "UTC" : "";
  10232. }
  10233. function getZoneName() {
  10234. return this._isUTC ? "Coordinated Universal Time" : "";
  10235. }
  10236. var proto = Moment.prototype;
  10237. proto.add = add;
  10238. proto.calendar = calendar$1;
  10239. proto.clone = clone;
  10240. proto.diff = diff;
  10241. proto.endOf = endOf;
  10242. proto.format = format;
  10243. proto.from = from;
  10244. proto.fromNow = fromNow;
  10245. proto.to = to;
  10246. proto.toNow = toNow;
  10247. proto.get = stringGet;
  10248. proto.invalidAt = invalidAt;
  10249. proto.isAfter = isAfter;
  10250. proto.isBefore = isBefore;
  10251. proto.isBetween = isBetween;
  10252. proto.isSame = isSame;
  10253. proto.isSameOrAfter = isSameOrAfter;
  10254. proto.isSameOrBefore = isSameOrBefore;
  10255. proto.isValid = isValid$2;
  10256. proto.lang = lang;
  10257. proto.locale = locale;
  10258. proto.localeData = localeData;
  10259. proto.max = prototypeMax;
  10260. proto.min = prototypeMin;
  10261. proto.parsingFlags = parsingFlags;
  10262. proto.set = stringSet;
  10263. proto.startOf = startOf;
  10264. proto.subtract = subtract;
  10265. proto.toArray = toArray;
  10266. proto.toObject = toObject;
  10267. proto.toDate = toDate;
  10268. proto.toISOString = toISOString;
  10269. proto.inspect = inspect;
  10270. if (typeof Symbol !== "undefined" && Symbol.for != null) {
  10271. proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
  10272. return "Moment<" + this.format() + ">";
  10273. };
  10274. }
  10275. proto.toJSON = toJSON;
  10276. proto.toString = toString;
  10277. proto.unix = unix;
  10278. proto.valueOf = valueOf;
  10279. proto.creationData = creationData;
  10280. proto.eraName = getEraName;
  10281. proto.eraNarrow = getEraNarrow;
  10282. proto.eraAbbr = getEraAbbr;
  10283. proto.eraYear = getEraYear;
  10284. proto.year = getSetYear;
  10285. proto.isLeapYear = getIsLeapYear;
  10286. proto.weekYear = getSetWeekYear;
  10287. proto.isoWeekYear = getSetISOWeekYear;
  10288. proto.quarter = proto.quarters = getSetQuarter;
  10289. proto.month = getSetMonth;
  10290. proto.daysInMonth = getDaysInMonth;
  10291. proto.week = proto.weeks = getSetWeek;
  10292. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  10293. proto.weeksInYear = getWeeksInYear;
  10294. proto.weeksInWeekYear = getWeeksInWeekYear;
  10295. proto.isoWeeksInYear = getISOWeeksInYear;
  10296. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  10297. proto.date = getSetDayOfMonth;
  10298. proto.day = proto.days = getSetDayOfWeek;
  10299. proto.weekday = getSetLocaleDayOfWeek;
  10300. proto.isoWeekday = getSetISODayOfWeek;
  10301. proto.dayOfYear = getSetDayOfYear;
  10302. proto.hour = proto.hours = getSetHour;
  10303. proto.minute = proto.minutes = getSetMinute;
  10304. proto.second = proto.seconds = getSetSecond;
  10305. proto.millisecond = proto.milliseconds = getSetMillisecond;
  10306. proto.utcOffset = getSetOffset;
  10307. proto.utc = setOffsetToUTC;
  10308. proto.local = setOffsetToLocal;
  10309. proto.parseZone = setOffsetToParsedOffset;
  10310. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  10311. proto.isDST = isDaylightSavingTime;
  10312. proto.isLocal = isLocal;
  10313. proto.isUtcOffset = isUtcOffset;
  10314. proto.isUtc = isUtc;
  10315. proto.isUTC = isUtc;
  10316. proto.zoneAbbr = getZoneAbbr;
  10317. proto.zoneName = getZoneName;
  10318. proto.dates = deprecate(
  10319. "dates accessor is deprecated. Use date instead.",
  10320. getSetDayOfMonth
  10321. );
  10322. proto.months = deprecate(
  10323. "months accessor is deprecated. Use month instead",
  10324. getSetMonth
  10325. );
  10326. proto.years = deprecate(
  10327. "years accessor is deprecated. Use year instead",
  10328. getSetYear
  10329. );
  10330. proto.zone = deprecate(
  10331. "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
  10332. getSetZone
  10333. );
  10334. proto.isDSTShifted = deprecate(
  10335. "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
  10336. isDaylightSavingTimeShifted
  10337. );
  10338. function createUnix(input) {
  10339. return createLocal(input * 1e3);
  10340. }
  10341. function createInZone() {
  10342. return createLocal.apply(null, arguments).parseZone();
  10343. }
  10344. function preParsePostFormat(string) {
  10345. return string;
  10346. }
  10347. var proto$1 = Locale.prototype;
  10348. proto$1.calendar = calendar;
  10349. proto$1.longDateFormat = longDateFormat;
  10350. proto$1.invalidDate = invalidDate;
  10351. proto$1.ordinal = ordinal;
  10352. proto$1.preparse = preParsePostFormat;
  10353. proto$1.postformat = preParsePostFormat;
  10354. proto$1.relativeTime = relativeTime;
  10355. proto$1.pastFuture = pastFuture;
  10356. proto$1.set = set;
  10357. proto$1.eras = localeEras;
  10358. proto$1.erasParse = localeErasParse;
  10359. proto$1.erasConvertYear = localeErasConvertYear;
  10360. proto$1.erasAbbrRegex = erasAbbrRegex;
  10361. proto$1.erasNameRegex = erasNameRegex;
  10362. proto$1.erasNarrowRegex = erasNarrowRegex;
  10363. proto$1.months = localeMonths;
  10364. proto$1.monthsShort = localeMonthsShort;
  10365. proto$1.monthsParse = localeMonthsParse;
  10366. proto$1.monthsRegex = monthsRegex;
  10367. proto$1.monthsShortRegex = monthsShortRegex;
  10368. proto$1.week = localeWeek;
  10369. proto$1.firstDayOfYear = localeFirstDayOfYear;
  10370. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  10371. proto$1.weekdays = localeWeekdays;
  10372. proto$1.weekdaysMin = localeWeekdaysMin;
  10373. proto$1.weekdaysShort = localeWeekdaysShort;
  10374. proto$1.weekdaysParse = localeWeekdaysParse;
  10375. proto$1.weekdaysRegex = weekdaysRegex;
  10376. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  10377. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  10378. proto$1.isPM = localeIsPM;
  10379. proto$1.meridiem = localeMeridiem;
  10380. function get$1(format2, index2, field, setter) {
  10381. var locale2 = getLocale(), utc = createUTC().set(setter, index2);
  10382. return locale2[field](utc, format2);
  10383. }
  10384. function listMonthsImpl(format2, index2, field) {
  10385. if (isNumber(format2)) {
  10386. index2 = format2;
  10387. format2 = void 0;
  10388. }
  10389. format2 = format2 || "";
  10390. if (index2 != null) {
  10391. return get$1(format2, index2, field, "month");
  10392. }
  10393. var i, out = [];
  10394. for (i = 0; i < 12; i++) {
  10395. out[i] = get$1(format2, i, field, "month");
  10396. }
  10397. return out;
  10398. }
  10399. function listWeekdaysImpl(localeSorted, format2, index2, field) {
  10400. if (typeof localeSorted === "boolean") {
  10401. if (isNumber(format2)) {
  10402. index2 = format2;
  10403. format2 = void 0;
  10404. }
  10405. format2 = format2 || "";
  10406. } else {
  10407. format2 = localeSorted;
  10408. index2 = format2;
  10409. localeSorted = false;
  10410. if (isNumber(format2)) {
  10411. index2 = format2;
  10412. format2 = void 0;
  10413. }
  10414. format2 = format2 || "";
  10415. }
  10416. var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i, out = [];
  10417. if (index2 != null) {
  10418. return get$1(format2, (index2 + shift) % 7, field, "day");
  10419. }
  10420. for (i = 0; i < 7; i++) {
  10421. out[i] = get$1(format2, (i + shift) % 7, field, "day");
  10422. }
  10423. return out;
  10424. }
  10425. function listMonths(format2, index2) {
  10426. return listMonthsImpl(format2, index2, "months");
  10427. }
  10428. function listMonthsShort(format2, index2) {
  10429. return listMonthsImpl(format2, index2, "monthsShort");
  10430. }
  10431. function listWeekdays(localeSorted, format2, index2) {
  10432. return listWeekdaysImpl(localeSorted, format2, index2, "weekdays");
  10433. }
  10434. function listWeekdaysShort(localeSorted, format2, index2) {
  10435. return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysShort");
  10436. }
  10437. function listWeekdaysMin(localeSorted, format2, index2) {
  10438. return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysMin");
  10439. }
  10440. getSetGlobalLocale("en", {
  10441. eras: [
  10442. {
  10443. since: "0001-01-01",
  10444. until: Infinity,
  10445. offset: 1,
  10446. name: "Anno Domini",
  10447. narrow: "AD",
  10448. abbr: "AD"
  10449. },
  10450. {
  10451. since: "0000-12-31",
  10452. until: -Infinity,
  10453. offset: 1,
  10454. name: "Before Christ",
  10455. narrow: "BC",
  10456. abbr: "BC"
  10457. }
  10458. ],
  10459. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  10460. ordinal: function(number) {
  10461. var b = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
  10462. return number + output;
  10463. }
  10464. });
  10465. hooks.lang = deprecate(
  10466. "moment.lang is deprecated. Use moment.locale instead.",
  10467. getSetGlobalLocale
  10468. );
  10469. hooks.langData = deprecate(
  10470. "moment.langData is deprecated. Use moment.localeData instead.",
  10471. getLocale
  10472. );
  10473. var mathAbs = Math.abs;
  10474. function abs() {
  10475. var data = this._data;
  10476. this._milliseconds = mathAbs(this._milliseconds);
  10477. this._days = mathAbs(this._days);
  10478. this._months = mathAbs(this._months);
  10479. data.milliseconds = mathAbs(data.milliseconds);
  10480. data.seconds = mathAbs(data.seconds);
  10481. data.minutes = mathAbs(data.minutes);
  10482. data.hours = mathAbs(data.hours);
  10483. data.months = mathAbs(data.months);
  10484. data.years = mathAbs(data.years);
  10485. return this;
  10486. }
  10487. function addSubtract$1(duration, input, value, direction) {
  10488. var other = createDuration(input, value);
  10489. duration._milliseconds += direction * other._milliseconds;
  10490. duration._days += direction * other._days;
  10491. duration._months += direction * other._months;
  10492. return duration._bubble();
  10493. }
  10494. function add$1(input, value) {
  10495. return addSubtract$1(this, input, value, 1);
  10496. }
  10497. function subtract$1(input, value) {
  10498. return addSubtract$1(this, input, value, -1);
  10499. }
  10500. function absCeil(number) {
  10501. if (number < 0) {
  10502. return Math.floor(number);
  10503. } else {
  10504. return Math.ceil(number);
  10505. }
  10506. }
  10507. function bubble() {
  10508. var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
  10509. if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
  10510. milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
  10511. days2 = 0;
  10512. months2 = 0;
  10513. }
  10514. data.milliseconds = milliseconds2 % 1e3;
  10515. seconds2 = absFloor(milliseconds2 / 1e3);
  10516. data.seconds = seconds2 % 60;
  10517. minutes2 = absFloor(seconds2 / 60);
  10518. data.minutes = minutes2 % 60;
  10519. hours2 = absFloor(minutes2 / 60);
  10520. data.hours = hours2 % 24;
  10521. days2 += absFloor(hours2 / 24);
  10522. monthsFromDays = absFloor(daysToMonths(days2));
  10523. months2 += monthsFromDays;
  10524. days2 -= absCeil(monthsToDays(monthsFromDays));
  10525. years2 = absFloor(months2 / 12);
  10526. months2 %= 12;
  10527. data.days = days2;
  10528. data.months = months2;
  10529. data.years = years2;
  10530. return this;
  10531. }
  10532. function daysToMonths(days2) {
  10533. return days2 * 4800 / 146097;
  10534. }
  10535. function monthsToDays(months2) {
  10536. return months2 * 146097 / 4800;
  10537. }
  10538. function as(units) {
  10539. if (!this.isValid()) {
  10540. return NaN;
  10541. }
  10542. var days2, months2, milliseconds2 = this._milliseconds;
  10543. units = normalizeUnits(units);
  10544. if (units === "month" || units === "quarter" || units === "year") {
  10545. days2 = this._days + milliseconds2 / 864e5;
  10546. months2 = this._months + daysToMonths(days2);
  10547. switch (units) {
  10548. case "month":
  10549. return months2;
  10550. case "quarter":
  10551. return months2 / 3;
  10552. case "year":
  10553. return months2 / 12;
  10554. }
  10555. } else {
  10556. days2 = this._days + Math.round(monthsToDays(this._months));
  10557. switch (units) {
  10558. case "week":
  10559. return days2 / 7 + milliseconds2 / 6048e5;
  10560. case "day":
  10561. return days2 + milliseconds2 / 864e5;
  10562. case "hour":
  10563. return days2 * 24 + milliseconds2 / 36e5;
  10564. case "minute":
  10565. return days2 * 1440 + milliseconds2 / 6e4;
  10566. case "second":
  10567. return days2 * 86400 + milliseconds2 / 1e3;
  10568. case "millisecond":
  10569. return Math.floor(days2 * 864e5) + milliseconds2;
  10570. default:
  10571. throw new Error("Unknown unit " + units);
  10572. }
  10573. }
  10574. }
  10575. function valueOf$1() {
  10576. if (!this.isValid()) {
  10577. return NaN;
  10578. }
  10579. return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
  10580. }
  10581. function makeAs(alias) {
  10582. return function() {
  10583. return this.as(alias);
  10584. };
  10585. }
  10586. var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y");
  10587. function clone$1() {
  10588. return createDuration(this);
  10589. }
  10590. function get$2(units) {
  10591. units = normalizeUnits(units);
  10592. return this.isValid() ? this[units + "s"]() : NaN;
  10593. }
  10594. function makeGetter(name) {
  10595. return function() {
  10596. return this.isValid() ? this._data[name] : NaN;
  10597. };
  10598. }
  10599. var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
  10600. function weeks() {
  10601. return absFloor(this.days() / 7);
  10602. }
  10603. var round = Math.round, thresholds = {
  10604. ss: 44,
  10605. // a few seconds to seconds
  10606. s: 45,
  10607. // seconds to minute
  10608. m: 45,
  10609. // minutes to hour
  10610. h: 22,
  10611. // hours to day
  10612. d: 26,
  10613. // days to month/week
  10614. w: null,
  10615. // weeks to month
  10616. M: 11
  10617. // months to year
  10618. };
  10619. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) {
  10620. return locale2.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  10621. }
  10622. function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
  10623. var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
  10624. if (thresholds2.w != null) {
  10625. a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
  10626. }
  10627. a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
  10628. a[2] = withoutSuffix;
  10629. a[3] = +posNegDuration > 0;
  10630. a[4] = locale2;
  10631. return substituteTimeAgo.apply(null, a);
  10632. }
  10633. function getSetRelativeTimeRounding(roundingFunction) {
  10634. if (roundingFunction === void 0) {
  10635. return round;
  10636. }
  10637. if (typeof roundingFunction === "function") {
  10638. round = roundingFunction;
  10639. return true;
  10640. }
  10641. return false;
  10642. }
  10643. function getSetRelativeTimeThreshold(threshold, limit) {
  10644. if (thresholds[threshold] === void 0) {
  10645. return false;
  10646. }
  10647. if (limit === void 0) {
  10648. return thresholds[threshold];
  10649. }
  10650. thresholds[threshold] = limit;
  10651. if (threshold === "s") {
  10652. thresholds.ss = limit - 1;
  10653. }
  10654. return true;
  10655. }
  10656. function humanize(argWithSuffix, argThresholds) {
  10657. if (!this.isValid()) {
  10658. return this.localeData().invalidDate();
  10659. }
  10660. var withSuffix = false, th = thresholds, locale2, output;
  10661. if (typeof argWithSuffix === "object") {
  10662. argThresholds = argWithSuffix;
  10663. argWithSuffix = false;
  10664. }
  10665. if (typeof argWithSuffix === "boolean") {
  10666. withSuffix = argWithSuffix;
  10667. }
  10668. if (typeof argThresholds === "object") {
  10669. th = Object.assign({}, thresholds, argThresholds);
  10670. if (argThresholds.s != null && argThresholds.ss == null) {
  10671. th.ss = argThresholds.s - 1;
  10672. }
  10673. }
  10674. locale2 = this.localeData();
  10675. output = relativeTime$1(this, !withSuffix, th, locale2);
  10676. if (withSuffix) {
  10677. output = locale2.pastFuture(+this, output);
  10678. }
  10679. return locale2.postformat(output);
  10680. }
  10681. var abs$1 = Math.abs;
  10682. function sign(x) {
  10683. return (x > 0) - (x < 0) || +x;
  10684. }
  10685. function toISOString$1() {
  10686. if (!this.isValid()) {
  10687. return this.localeData().invalidDate();
  10688. }
  10689. var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s2, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
  10690. if (!total) {
  10691. return "P0D";
  10692. }
  10693. minutes2 = absFloor(seconds2 / 60);
  10694. hours2 = absFloor(minutes2 / 60);
  10695. seconds2 %= 60;
  10696. minutes2 %= 60;
  10697. years2 = absFloor(months2 / 12);
  10698. months2 %= 12;
  10699. s2 = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
  10700. totalSign = total < 0 ? "-" : "";
  10701. ymSign = sign(this._months) !== sign(total) ? "-" : "";
  10702. daysSign = sign(this._days) !== sign(total) ? "-" : "";
  10703. hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
  10704. return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s2 + "S" : "");
  10705. }
  10706. var proto$2 = Duration.prototype;
  10707. proto$2.isValid = isValid$1;
  10708. proto$2.abs = abs;
  10709. proto$2.add = add$1;
  10710. proto$2.subtract = subtract$1;
  10711. proto$2.as = as;
  10712. proto$2.asMilliseconds = asMilliseconds;
  10713. proto$2.asSeconds = asSeconds;
  10714. proto$2.asMinutes = asMinutes;
  10715. proto$2.asHours = asHours;
  10716. proto$2.asDays = asDays;
  10717. proto$2.asWeeks = asWeeks;
  10718. proto$2.asMonths = asMonths;
  10719. proto$2.asQuarters = asQuarters;
  10720. proto$2.asYears = asYears;
  10721. proto$2.valueOf = valueOf$1;
  10722. proto$2._bubble = bubble;
  10723. proto$2.clone = clone$1;
  10724. proto$2.get = get$2;
  10725. proto$2.milliseconds = milliseconds;
  10726. proto$2.seconds = seconds;
  10727. proto$2.minutes = minutes;
  10728. proto$2.hours = hours;
  10729. proto$2.days = days;
  10730. proto$2.weeks = weeks;
  10731. proto$2.months = months;
  10732. proto$2.years = years;
  10733. proto$2.humanize = humanize;
  10734. proto$2.toISOString = toISOString$1;
  10735. proto$2.toString = toISOString$1;
  10736. proto$2.toJSON = toISOString$1;
  10737. proto$2.locale = locale;
  10738. proto$2.localeData = localeData;
  10739. proto$2.toIsoString = deprecate(
  10740. "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
  10741. toISOString$1
  10742. );
  10743. proto$2.lang = lang;
  10744. addFormatToken("X", 0, 0, "unix");
  10745. addFormatToken("x", 0, 0, "valueOf");
  10746. addRegexToken("x", matchSigned);
  10747. addRegexToken("X", matchTimestamp);
  10748. addParseToken("X", function(input, array, config) {
  10749. config._d = new Date(parseFloat(input) * 1e3);
  10750. });
  10751. addParseToken("x", function(input, array, config) {
  10752. config._d = new Date(toInt(input));
  10753. });
  10754. //! moment.js
  10755. hooks.version = "2.29.4";
  10756. setHookCallback(createLocal);
  10757. hooks.fn = proto;
  10758. hooks.min = min;
  10759. hooks.max = max;
  10760. hooks.now = now;
  10761. hooks.utc = createUTC;
  10762. hooks.unix = createUnix;
  10763. hooks.months = listMonths;
  10764. hooks.isDate = isDate;
  10765. hooks.locale = getSetGlobalLocale;
  10766. hooks.invalid = createInvalid;
  10767. hooks.duration = createDuration;
  10768. hooks.isMoment = isMoment;
  10769. hooks.weekdays = listWeekdays;
  10770. hooks.parseZone = createInZone;
  10771. hooks.localeData = getLocale;
  10772. hooks.isDuration = isDuration;
  10773. hooks.monthsShort = listMonthsShort;
  10774. hooks.weekdaysMin = listWeekdaysMin;
  10775. hooks.defineLocale = defineLocale;
  10776. hooks.updateLocale = updateLocale;
  10777. hooks.locales = listLocales;
  10778. hooks.weekdaysShort = listWeekdaysShort;
  10779. hooks.normalizeUnits = normalizeUnits;
  10780. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  10781. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  10782. hooks.calendarFormat = getCalendarFormat;
  10783. hooks.prototype = proto;
  10784. hooks.HTML5_FMT = {
  10785. DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
  10786. // <input type="datetime-local" />
  10787. DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
  10788. // <input type="datetime-local" step="1" />
  10789. DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
  10790. // <input type="datetime-local" step="0.001" />
  10791. DATE: "YYYY-MM-DD",
  10792. // <input type="date" />
  10793. TIME: "HH:mm",
  10794. // <input type="time" />
  10795. TIME_SECONDS: "HH:mm:ss",
  10796. // <input type="time" step="1" />
  10797. TIME_MS: "HH:mm:ss.SSS",
  10798. // <input type="time" step="0.001" />
  10799. WEEK: "GGGG-[W]WW",
  10800. // <input type="week" />
  10801. MONTH: "YYYY-MM"
  10802. // <input type="month" />
  10803. };
  10804. exports._export_sfc = _export_sfc;
  10805. exports.computed = computed;
  10806. exports.createSSRApp = createSSRApp;
  10807. exports.defineComponent = defineComponent;
  10808. exports.e = e;
  10809. exports.f = f;
  10810. exports.getCurrentInstance = getCurrentInstance;
  10811. exports.hooks = hooks;
  10812. exports.index = index;
  10813. exports.n = n;
  10814. exports.o = o;
  10815. exports.onLoad = onLoad;
  10816. exports.onPullDownRefresh = onPullDownRefresh;
  10817. exports.onShow = onShow;
  10818. exports.p = p;
  10819. exports.ref = ref;
  10820. exports.resolveComponent = resolveComponent;
  10821. exports.s = s;
  10822. exports.sr = sr;
  10823. exports.t = t;
  10824. exports.toRefs = toRefs;
  10825. exports.unref = unref;
  10826. exports.watch = watch;