| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341 |
- "use strict";
- (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"],{
- /***/ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js":
- /*!**************************************************************!*\
- !*** ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js ***!
- \**************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ A: function() { return /* binding */ A; },
- /* harmony export */ APP: function() { return /* binding */ APP; },
- /* harmony export */ BEHAVIORS: function() { return /* binding */ BEHAVIORS; },
- /* harmony export */ BODY: function() { return /* binding */ BODY; },
- /* harmony export */ CATCHMOVE: function() { return /* binding */ CATCHMOVE; },
- /* harmony export */ CATCH_VIEW: function() { return /* binding */ CATCH_VIEW; },
- /* harmony export */ CHANGE: function() { return /* binding */ CHANGE; },
- /* harmony export */ CLASS: function() { return /* binding */ CLASS; },
- /* harmony export */ COMMENT: function() { return /* binding */ COMMENT; },
- /* harmony export */ CONFIRM: function() { return /* binding */ CONFIRM; },
- /* harmony export */ CONTAINER: function() { return /* binding */ CONTAINER; },
- /* harmony export */ CONTEXT_ACTIONS: function() { return /* binding */ CONTEXT_ACTIONS; },
- /* harmony export */ CURRENT_TARGET: function() { return /* binding */ CURRENT_TARGET; },
- /* harmony export */ CUSTOM_WRAPPER: function() { return /* binding */ CUSTOM_WRAPPER; },
- /* harmony export */ Current: function() { return /* binding */ Current; },
- /* harmony export */ DATASET: function() { return /* binding */ DATASET; },
- /* harmony export */ DATE: function() { return /* binding */ DATE; },
- /* harmony export */ DOCUMENT_ELEMENT_NAME: function() { return /* binding */ DOCUMENT_ELEMENT_NAME; },
- /* harmony export */ DOCUMENT_FRAGMENT: function() { return /* binding */ DOCUMENT_FRAGMENT; },
- /* harmony export */ EVENT_CALLBACK_RESULT: function() { return /* binding */ EVENT_CALLBACK_RESULT; },
- /* harmony export */ EXTERNAL_CLASSES: function() { return /* binding */ EXTERNAL_CLASSES; },
- /* harmony export */ FOCUS: function() { return /* binding */ FOCUS; },
- /* harmony export */ FormElement: function() { return /* binding */ FormElement; },
- /* harmony export */ HEAD: function() { return /* binding */ HEAD; },
- /* harmony export */ HOOKS_APP_ID: function() { return /* binding */ HOOKS_APP_ID; },
- /* harmony export */ HTML: function() { return /* binding */ HTML; },
- /* harmony export */ History: function() { return /* binding */ History; },
- /* harmony export */ ID: function() { return /* binding */ ID; },
- /* harmony export */ INPUT: function() { return /* binding */ INPUT; },
- /* harmony export */ KEY_CODE: function() { return /* binding */ KEY_CODE; },
- /* harmony export */ Location: function() { return /* binding */ Location; },
- /* harmony export */ MutationObserver: function() { return /* binding */ MutationObserver; },
- /* harmony export */ OBJECT: function() { return /* binding */ OBJECT; },
- /* harmony export */ ON_HIDE: function() { return /* binding */ ON_HIDE; },
- /* harmony export */ ON_LOAD: function() { return /* binding */ ON_LOAD; },
- /* harmony export */ ON_READY: function() { return /* binding */ ON_READY; },
- /* harmony export */ ON_SHOW: function() { return /* binding */ ON_SHOW; },
- /* harmony export */ OPTIONS: function() { return /* binding */ OPTIONS; },
- /* harmony export */ PAGE_INIT: function() { return /* binding */ PAGE_INIT; },
- /* harmony export */ PROPERTY_THRESHOLD: function() { return /* binding */ PROPERTY_THRESHOLD; },
- /* harmony export */ PROPS: function() { return /* binding */ PROPS; },
- /* harmony export */ PURE_VIEW: function() { return /* binding */ PURE_VIEW; },
- /* harmony export */ ROOT_STR: function() { return /* binding */ ROOT_STR; },
- /* harmony export */ SET_DATA: function() { return /* binding */ SET_DATA; },
- /* harmony export */ SET_TIMEOUT: function() { return /* binding */ SET_TIMEOUT; },
- /* harmony export */ STATIC_VIEW: function() { return /* binding */ STATIC_VIEW; },
- /* harmony export */ STYLE: function() { return /* binding */ STYLE; },
- /* harmony export */ SVGElement: function() { return /* binding */ SVGElement; },
- /* harmony export */ Style: function() { return /* binding */ Style; },
- /* harmony export */ TARGET: function() { return /* binding */ TARGET; },
- /* harmony export */ TARO_RUNTIME: function() { return /* binding */ TARO_RUNTIME; },
- /* harmony export */ TIME_STAMP: function() { return /* binding */ TIME_STAMP; },
- /* harmony export */ TOUCHMOVE: function() { return /* binding */ TOUCHMOVE; },
- /* harmony export */ TYPE: function() { return /* binding */ TYPE; },
- /* harmony export */ TaroElement: function() { return /* binding */ TaroElement; },
- /* harmony export */ TaroEvent: function() { return /* binding */ TaroEvent; },
- /* harmony export */ TaroNode: function() { return /* binding */ TaroNode; },
- /* harmony export */ TaroRootElement: function() { return /* binding */ TaroRootElement; },
- /* harmony export */ TaroText: function() { return /* binding */ TaroText; },
- /* harmony export */ UID: function() { return /* binding */ UID; },
- /* harmony export */ URL: function() { return /* binding */ URL; },
- /* harmony export */ URLSearchParams: function() { return /* binding */ URLSearchParams; },
- /* harmony export */ VALUE: function() { return /* binding */ VALUE; },
- /* harmony export */ VIEW: function() { return /* binding */ VIEW; },
- /* harmony export */ _caf: function() { return /* binding */ _caf; },
- /* harmony export */ _raf: function() { return /* binding */ _raf; },
- /* harmony export */ addLeadingSlash: function() { return /* binding */ addLeadingSlash; },
- /* harmony export */ createComponentConfig: function() { return /* binding */ createComponentConfig; },
- /* harmony export */ createEvent: function() { return /* binding */ createEvent; },
- /* harmony export */ createPageConfig: function() { return /* binding */ createPageConfig; },
- /* harmony export */ createRecursiveComponentConfig: function() { return /* binding */ createRecursiveComponentConfig; },
- /* harmony export */ document$1: function() { return /* binding */ document$1; },
- /* harmony export */ env: function() { return /* binding */ env; },
- /* harmony export */ eventCenter: function() { return /* binding */ eventCenter; },
- /* harmony export */ eventHandler: function() { return /* binding */ eventHandler; },
- /* harmony export */ eventSource: function() { return /* binding */ eventSource; },
- /* harmony export */ getComputedStyle: function() { return /* binding */ getComputedStyle; },
- /* harmony export */ getCurrentInstance: function() { return /* binding */ getCurrentInstance; },
- /* harmony export */ getOnHideEventKey: function() { return /* binding */ getOnHideEventKey; },
- /* harmony export */ getOnReadyEventKey: function() { return /* binding */ getOnReadyEventKey; },
- /* harmony export */ getOnShowEventKey: function() { return /* binding */ getOnShowEventKey; },
- /* harmony export */ getPageInstance: function() { return /* binding */ getPageInstance; },
- /* harmony export */ getPath: function() { return /* binding */ getPath; },
- /* harmony export */ history: function() { return /* binding */ history; },
- /* harmony export */ hydrate: function() { return /* binding */ hydrate; },
- /* harmony export */ incrementId: function() { return /* binding */ incrementId; },
- /* harmony export */ init_runtime_esm: function() { return /* binding */ init_runtime_esm; },
- /* harmony export */ injectPageInstance: function() { return /* binding */ injectPageInstance; },
- /* harmony export */ location: function() { return /* binding */ location; },
- /* harmony export */ nav: function() { return /* binding */ nav; },
- /* harmony export */ nextTick: function() { return /* binding */ nextTick; },
- /* harmony export */ now: function() { return /* binding */ now; },
- /* harmony export */ options: function() { return /* binding */ options; },
- /* harmony export */ parseUrl: function() { return /* binding */ parseUrl; },
- /* harmony export */ removePageInstance: function() { return /* binding */ removePageInstance; },
- /* harmony export */ runtime_esm_exports: function() { return /* binding */ runtime_esm_exports; },
- /* harmony export */ safeExecute: function() { return /* binding */ safeExecute; },
- /* harmony export */ stringify: function() { return /* binding */ stringify; },
- /* harmony export */ window$1: function() { return /* binding */ window$1; }
- /* harmony export */ });
- /* harmony import */ var _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-77KB62LY.js */ "./node_modules/.taro/weapp/prebundle/chunk-77KB62LY.js");
- /* harmony import */ var _chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-P7VEE7PG.js */ "./node_modules/.taro/weapp/prebundle/chunk-P7VEE7PG.js");
- /* provided dependency */ var window = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["window$1"];
- /* provided dependency */ var document = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["document$1"];
- /* provided dependency */ var requestAnimationFrame = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["_raf"];
- /* provided dependency */ var cancelAnimationFrame = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["_caf"];
- // node_modules/@tarojs/runtime/dist/runtime.esm.js
- var runtime_esm_exports = {};
- (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_1__.__export)(runtime_esm_exports, {
- A: ()=>A,
- APP: ()=>APP,
- BEHAVIORS: ()=>BEHAVIORS,
- BODY: ()=>BODY,
- CATCHMOVE: ()=>CATCHMOVE,
- CATCH_VIEW: ()=>CATCH_VIEW,
- CHANGE: ()=>CHANGE,
- CLASS: ()=>CLASS,
- COMMENT: ()=>COMMENT,
- CONFIRM: ()=>CONFIRM,
- CONTAINER: ()=>CONTAINER,
- CONTEXT_ACTIONS: ()=>CONTEXT_ACTIONS,
- CURRENT_TARGET: ()=>CURRENT_TARGET,
- CUSTOM_WRAPPER: ()=>CUSTOM_WRAPPER,
- Current: ()=>Current,
- DATASET: ()=>DATASET,
- DATE: ()=>DATE,
- DOCUMENT_ELEMENT_NAME: ()=>DOCUMENT_ELEMENT_NAME,
- DOCUMENT_FRAGMENT: ()=>DOCUMENT_FRAGMENT,
- EVENT_CALLBACK_RESULT: ()=>EVENT_CALLBACK_RESULT,
- EXTERNAL_CLASSES: ()=>EXTERNAL_CLASSES,
- Events: ()=>_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events,
- FOCUS: ()=>FOCUS,
- FormElement: ()=>FormElement,
- HEAD: ()=>HEAD,
- HOOKS_APP_ID: ()=>HOOKS_APP_ID,
- HTML: ()=>HTML,
- History: ()=>History,
- ID: ()=>ID,
- INPUT: ()=>INPUT,
- KEY_CODE: ()=>KEY_CODE,
- Location: ()=>Location,
- MutationObserver: ()=>MutationObserver,
- OBJECT: ()=>OBJECT,
- ON_HIDE: ()=>ON_HIDE,
- ON_LOAD: ()=>ON_LOAD,
- ON_READY: ()=>ON_READY,
- ON_SHOW: ()=>ON_SHOW,
- OPTIONS: ()=>OPTIONS,
- PAGE_INIT: ()=>PAGE_INIT,
- PROPERTY_THRESHOLD: ()=>PROPERTY_THRESHOLD,
- PROPS: ()=>PROPS,
- PURE_VIEW: ()=>PURE_VIEW,
- ROOT_STR: ()=>ROOT_STR,
- SET_DATA: ()=>SET_DATA,
- SET_TIMEOUT: ()=>SET_TIMEOUT,
- STATIC_VIEW: ()=>STATIC_VIEW,
- STYLE: ()=>STYLE,
- SVGElement: ()=>SVGElement,
- Style: ()=>Style,
- TARGET: ()=>TARGET,
- TARO_RUNTIME: ()=>TARO_RUNTIME,
- TIME_STAMP: ()=>TIME_STAMP,
- TOUCHMOVE: ()=>TOUCHMOVE,
- TYPE: ()=>TYPE,
- TaroElement: ()=>TaroElement,
- TaroEvent: ()=>TaroEvent,
- TaroNode: ()=>TaroNode,
- TaroRootElement: ()=>TaroRootElement,
- TaroText: ()=>TaroText,
- UID: ()=>UID,
- URL: ()=>URL,
- URLSearchParams: ()=>URLSearchParams,
- VALUE: ()=>VALUE,
- VIEW: ()=>VIEW,
- addLeadingSlash: ()=>addLeadingSlash,
- cancelAnimationFrame: ()=>_caf,
- createComponentConfig: ()=>createComponentConfig,
- createEvent: ()=>createEvent,
- createPageConfig: ()=>createPageConfig,
- createRecursiveComponentConfig: ()=>createRecursiveComponentConfig,
- document: ()=>document$1,
- env: ()=>env,
- eventCenter: ()=>eventCenter,
- eventHandler: ()=>eventHandler,
- eventSource: ()=>eventSource,
- getComputedStyle: ()=>getComputedStyle,
- getCurrentInstance: ()=>getCurrentInstance,
- getOnHideEventKey: ()=>getOnHideEventKey,
- getOnReadyEventKey: ()=>getOnReadyEventKey,
- getOnShowEventKey: ()=>getOnShowEventKey,
- getPageInstance: ()=>getPageInstance,
- getPath: ()=>getPath,
- history: ()=>history,
- hooks: ()=>_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks,
- hydrate: ()=>hydrate,
- incrementId: ()=>incrementId,
- injectPageInstance: ()=>injectPageInstance,
- location: ()=>location,
- navigator: ()=>nav,
- nextTick: ()=>nextTick,
- now: ()=>now,
- options: ()=>options,
- parseUrl: ()=>parseUrl,
- removePageInstance: ()=>removePageInstance,
- requestAnimationFrame: ()=>_raf,
- safeExecute: ()=>safeExecute,
- stringify: ()=>stringify,
- window: ()=>window$1
- });
- function logMutation(observer, record) {
- observer.records.push(record);
- if (!pendingMuatations) {
- pendingMuatations = true;
- Promise.resolve().then(()=>{
- pendingMuatations = false;
- observers.forEach((observer2)=>{
- return observer2.callback(observer2.takeRecords());
- });
- });
- }
- }
- function recordMutation(record) {
- observers.forEach((observer)=>{
- const { options: options2 } = observer;
- for(let t = record.target; t; t = t.parentNode){
- if (sidMatches(observer.target, t) && isConcerned(record, options2)) {
- logMutation(observer, record);
- break;
- }
- if (!options2.subtree) break;
- }
- });
- }
- function isElement(node) {
- return node.nodeType === 1;
- }
- function isText(node) {
- return node.nodeType === 3;
- }
- function isComment(node) {
- return node.nodeName === COMMENT;
- }
- function isHasExtractProp(el) {
- const res = Object.keys(el.props).find((prop)=>{
- return !(/^(class|style|id)$/.test(prop) || prop.startsWith("data-"));
- });
- return Boolean(res);
- }
- function isParentBinded(node, type) {
- var _a;
- let res = false;
- while((node === null || node === void 0 ? void 0 : node.parentElement) && node.parentElement._path !== ROOT_STR){
- if ((_a = node.parentElement.__handlers[type]) === null || _a === void 0 ? void 0 : _a.length) {
- res = true;
- break;
- }
- node = node.parentElement;
- }
- return res;
- }
- function shortcutAttr(key) {
- switch(key){
- case STYLE:
- return "st";
- case ID:
- return UID;
- case CLASS:
- return "cl";
- default:
- return key;
- }
- }
- function extend(ctor, methodName, options2) {
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(options2)) {
- options2 = {
- value: options2
- };
- }
- Object.defineProperty(ctor.prototype, methodName, Object.assign({
- configurable: true,
- enumerable: true
- }, options2));
- }
- function getComponentsAlias2() {
- if (!componentsAlias$1) {
- componentsAlias$1 = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.getComponentsAlias)(_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.internalComponents);
- }
- return componentsAlias$1;
- }
- function hydrate(node) {
- var _a;
- if (!componentsAlias) {
- componentsAlias = getComponentsAlias2();
- }
- if (!SPECIAL_NODES) {
- SPECIAL_NODES = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getSpecialNodes");
- }
- const nodeName = node.nodeName;
- if (isText(node)) {
- return {
- ["v"]: node.nodeValue,
- ["nn"]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || "8"
- };
- }
- const data = {
- ["nn"]: nodeName,
- sid: node.sid
- };
- if (node.uid !== node.sid) {
- data.uid = node.uid;
- }
- if (!node.isAnyEventBinded() && SPECIAL_NODES.indexOf(nodeName) > -1) {
- data["nn"] = `static-${nodeName}`;
- if (nodeName === VIEW && !isHasExtractProp(node)) {
- data["nn"] = PURE_VIEW;
- }
- }
- const { props } = node;
- for(const prop in props){
- const propInCamelCase = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(prop);
- if (!prop.startsWith("data-") && prop !== CLASS && prop !== STYLE && prop !== ID && propInCamelCase !== CATCHMOVE) {
- data[propInCamelCase] = props[prop];
- }
- if (nodeName === VIEW && propInCamelCase === CATCHMOVE && props[prop] !== false) {
- data["nn"] = CATCH_VIEW;
- }
- }
- let { childNodes } = node;
- childNodes = childNodes.filter((node2)=>!isComment(node2));
- if (childNodes.length > 0) {
- data["cn"] = childNodes.map(hydrate);
- } else {
- data["cn"] = [];
- }
- if (node.className !== "") {
- data["cl"] = node.className;
- }
- const cssText = node.cssText;
- if (cssText !== "" && nodeName !== "swiper-item") {
- data["st"] = cssText;
- }
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyHydrateData", data);
- const nn = data["nn"];
- const componentAlias = componentsAlias[nn];
- if (componentAlias) {
- data["nn"] = componentAlias._num;
- for(const prop1 in data){
- if (prop1 in componentAlias) {
- data[componentAlias[prop1]] = data[prop1];
- delete data[prop1];
- }
- }
- }
- return data;
- }
- function combine(prefix, list, excludeSelf) {
- !excludeSelf && styleProperties.push(prefix);
- list.forEach((item)=>{
- styleProperties.push(prefix + item);
- if (prefix === WEBKIT) {
- styleProperties.push("Webkit" + item);
- }
- });
- }
- function recordCss(obj) {
- MutationObserver.record({
- type: "attributes",
- target: obj._element,
- attributeName: "style",
- oldValue: obj.cssText
- });
- }
- function enqueueUpdate(obj) {
- const element = obj._element;
- if (element._root) {
- element.enqueueUpdate({
- path: `${element._path}.${"st"}`,
- value: obj.cssText
- });
- }
- }
- function setStyle(newVal, styleKey) {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(newVal) && newVal.length > PROPERTY_THRESHOLD, `Style \u5C5E\u6027 ${styleKey} \u7684\u503C\u6570\u636E\u91CF\u8FC7\u5927\uFF0C\u53EF\u80FD\u4F1A\u5F71\u54CD\u6E32\u67D3\u6027\u80FD\uFF0C\u8003\u8651\u4F7F\u7528 CSS \u7C7B\u6216\u5176\u5B83\u65B9\u6848\u66FF\u4EE3\u3002`);
- const old = this[styleKey];
- if (old === newVal) return;
- !this._pending && recordCss(this);
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(newVal) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(newVal)) {
- this._usedStyleProp.delete(styleKey);
- delete this._value[styleKey];
- } else {
- this._usedStyleProp.add(styleKey);
- this._value[styleKey] = newVal;
- }
- !this._pending && enqueueUpdate(this);
- }
- function initStyle(ctor, styleProperties2) {
- const properties = {};
- for(let i = 0; i < styleProperties2.length; i++){
- const styleKey = styleProperties2[i];
- if (ctor[styleKey]) return;
- properties[styleKey] = {
- get () {
- const val = this._value[styleKey];
- return (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(val) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(val) ? "" : val;
- },
- set (newVal) {
- setStyle.call(this, newVal, styleKey);
- }
- };
- }
- Object.defineProperties(ctor.prototype, properties);
- }
- function isCssVariable(propertyName) {
- return /^--/.test(propertyName);
- }
- function returnTrue() {
- return true;
- }
- function treeToArray(root, predict) {
- const array = [];
- const filter = predict !== null && predict !== void 0 ? predict : returnTrue;
- let object = root;
- while(object){
- if (object.nodeType === 1 && filter(object)) {
- array.push(object);
- }
- object = following(object, root);
- }
- return array;
- }
- function following(el, root) {
- const firstChild = el.firstChild;
- const isElmentTypeValid = el.nodeType === 1 || el.nodeType === 9;
- if (firstChild && isElmentTypeValid) {
- return firstChild;
- }
- let current = el;
- do {
- if (current === root) {
- return null;
- }
- const nextSibling = current.nextSibling;
- if (nextSibling) {
- return nextSibling;
- }
- current = current.parentElement;
- }while (current)
- return null;
- }
- function initPosition() {
- return {
- index: 0,
- column: 0,
- line: 0
- };
- }
- function feedPosition(position, str, len) {
- const start = position.index;
- const end = position.index = start + len;
- for(let i = start; i < end; i++){
- const char = str.charAt(i);
- if (char === "\n") {
- position.line++;
- position.column = 0;
- } else {
- position.column++;
- }
- }
- }
- function jumpPosition(position, str, end) {
- const len = end - position.index;
- return feedPosition(position, str, len);
- }
- function copyPosition(position) {
- return {
- index: position.index,
- line: position.line,
- column: position.column
- };
- }
- function isWhitespaceChar(char) {
- return whitespace.test(char);
- }
- function isEqualSignChar(char) {
- return equalSign.test(char);
- }
- function shouldBeIgnore(tagName) {
- const name = tagName.toLowerCase();
- if (options.html.skipElements.has(name)) {
- return true;
- }
- return false;
- }
- function findTextEnd(str, index) {
- while(true){
- const textEnd = str.indexOf("<", index);
- if (textEnd === -1) {
- return textEnd;
- }
- const char = str.charAt(textEnd + 1);
- if (char === "/" || char === "!" || alphanumeric.test(char)) {
- return textEnd;
- }
- index = textEnd + 1;
- }
- }
- function isWordEnd(cursor, wordBegin, html) {
- if (!isWhitespaceChar(html.charAt(cursor))) return false;
- const len = html.length;
- for(let i = cursor - 1; i > wordBegin; i--){
- const char = html.charAt(i);
- if (!isWhitespaceChar(char)) {
- if (isEqualSignChar(char)) return false;
- break;
- }
- }
- for(let i1 = cursor + 1; i1 < len; i1++){
- const char1 = html.charAt(i1);
- if (!isWhitespaceChar(char1)) {
- if (isEqualSignChar(char1)) return false;
- return true;
- }
- }
- }
- function unquote(str) {
- const car = str.charAt(0);
- const end = str.length - 1;
- const isQuoteStart = car === '"' || car === "'";
- if (isQuoteStart && car === str.charAt(end)) {
- return str.slice(1, end);
- }
- return str;
- }
- function getPreviousElement(el) {
- const parent = el.parentElement;
- if (!parent) return null;
- const prev = el.previousSibling;
- if (!prev) return null;
- if (prev.nodeType === 1) {
- return prev;
- } else {
- return getPreviousElement(prev);
- }
- }
- function sortStyles(styles) {
- return styles.sort((s1, s2)=>{
- const hundreds1 = getHundredsWeight(s1.selectorList);
- const hundreds2 = getHundredsWeight(s2.selectorList);
- if (hundreds1 !== hundreds2) return hundreds1 - hundreds2;
- const tens1 = getTensWeight(s1.selectorList);
- const tens2 = getTensWeight(s2.selectorList);
- if (tens1 !== tens2) return tens1 - tens2;
- const ones1 = getOnesWeight(s1.selectorList);
- const ones2 = getOnesWeight(s2.selectorList);
- return ones1 - ones2;
- });
- }
- function getHundredsWeight(selectors) {
- return selectors.reduce((pre, cur)=>pre + (cur.id ? 1 : 0), 0);
- }
- function getTensWeight(selectors) {
- return selectors.reduce((pre, cur)=>pre + cur.class.length + cur.attrs.length, 0);
- }
- function getOnesWeight(selectors) {
- return selectors.reduce((pre, cur)=>pre + (cur.tag ? 1 : 0), 0);
- }
- function makeMap(str, expectsLowerCase) {
- const map = /* @__PURE__ */ Object.create(null);
- const list = str.split(",");
- for(let i = 0; i < list.length; i++){
- map[list[i]] = true;
- }
- return expectsLowerCase ? (val)=>!!map[val.toLowerCase()] : (val)=>!!map[val];
- }
- function hasTerminalParent(tagName, stack) {
- const tagParents = closingTagAncestorBreakers[tagName];
- if (tagParents) {
- let currentIndex = stack.length - 1;
- while(currentIndex >= 0){
- const parentTagName = stack[currentIndex].tagName;
- if (parentTagName === tagName) {
- break;
- }
- if (tagParents && tagParents.includes(parentTagName)) {
- return true;
- }
- currentIndex--;
- }
- }
- return false;
- }
- function getTagName(tag) {
- if (options.html.renderHTMLTag) {
- return tag;
- }
- if (specialMiniElements[tag]) {
- return specialMiniElements[tag];
- } else if (isMiniElements(tag)) {
- return tag;
- } else if (isBlockElements(tag)) {
- return "view";
- } else if (isInlineElements(tag)) {
- return "text";
- }
- return "view";
- }
- function splitEqual(str) {
- const sep = "=";
- const idx = str.indexOf(sep);
- if (idx === -1) return [
- str
- ];
- const key = str.slice(0, idx).trim();
- const value = str.slice(idx + sep.length).trim();
- return [
- key,
- value
- ];
- }
- function format(children, document2, styleOptions, parent) {
- return children.filter((child)=>{
- if (child.type === "comment") {
- return false;
- } else if (child.type === "text") {
- return child.content !== "";
- }
- return true;
- }).map((child)=>{
- if (child.type === "text") {
- let text = document2.createTextNode(child.content);
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(options.html.transformText)) {
- text = options.html.transformText(text, child);
- }
- parent === null || parent === void 0 ? void 0 : parent.appendChild(text);
- return text;
- }
- const el = document2.createElement(getTagName(child.tagName));
- el.h5tagName = child.tagName;
- parent === null || parent === void 0 ? void 0 : parent.appendChild(el);
- if (!options.html.renderHTMLTag) {
- el.className = `h5-${child.tagName}`;
- }
- for(let i = 0; i < child.attributes.length; i++){
- const attr = child.attributes[i];
- const [key, value] = splitEqual(attr);
- if (key === "class") {
- el.className += " " + unquote(value);
- } else if (key[0] === "o" && key[1] === "n") {
- continue;
- } else {
- el.setAttribute(key, value == null ? true : unquote(value));
- }
- }
- const { styleTagParser , descendantList } = styleOptions;
- const list = descendantList.slice();
- const style2 = styleTagParser.matchStyle(child.tagName, el, list);
- el.setAttribute("style", style2 + el.style.cssText);
- format(child.children, document2, {
- styleTagParser,
- descendantList: list
- }, el);
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(options.html.transformElement)) {
- return options.html.transformElement(el, child);
- }
- return el;
- });
- }
- function parser(html, document2) {
- const styleTagParser = new StyleTagParser();
- html = styleTagParser.extractStyle(html);
- const tokens = new Scaner(html).scan();
- const root = {
- tagName: "",
- children: [],
- type: "element",
- attributes: []
- };
- const state = {
- tokens,
- options,
- cursor: 0,
- stack: [
- root
- ]
- };
- parse(state);
- return format(root.children, document2, {
- styleTagParser,
- descendantList: Array(styleTagParser.styles.length).fill(0)
- });
- }
- function parse(state) {
- const { tokens , stack } = state;
- let { cursor } = state;
- const len = tokens.length;
- let nodes = stack[stack.length - 1].children;
- while(cursor < len){
- const token = tokens[cursor];
- if (token.type !== "tag-start") {
- nodes.push(token);
- cursor++;
- continue;
- }
- const tagToken = tokens[++cursor];
- cursor++;
- const tagName = tagToken.content.toLowerCase();
- if (token.close) {
- let index = stack.length;
- let shouldRewind = false;
- while(--index > -1){
- if (stack[index].tagName === tagName) {
- shouldRewind = true;
- break;
- }
- }
- while(cursor < len){
- const endToken = tokens[cursor];
- if (endToken.type !== "tag-end") break;
- cursor++;
- }
- if (shouldRewind) {
- stack.splice(index);
- break;
- } else {
- continue;
- }
- }
- const isClosingTag = options.html.closingElements.has(tagName);
- let shouldRewindToAutoClose = isClosingTag;
- if (shouldRewindToAutoClose) {
- shouldRewindToAutoClose = !hasTerminalParent(tagName, stack);
- }
- if (shouldRewindToAutoClose) {
- let currentIndex = stack.length - 1;
- while(currentIndex > 0){
- if (tagName === stack[currentIndex].tagName) {
- stack.splice(currentIndex);
- const previousIndex = currentIndex - 1;
- nodes = stack[previousIndex].children;
- break;
- }
- currentIndex = currentIndex - 1;
- }
- }
- const attributes = [];
- let attrToken;
- while(cursor < len){
- attrToken = tokens[cursor];
- if (attrToken.type === "tag-end") break;
- attributes.push(attrToken.content);
- cursor++;
- }
- cursor++;
- const children = [];
- const element = {
- type: "element",
- tagName: tagToken.content,
- attributes,
- children
- };
- nodes.push(element);
- const hasChildren = !(attrToken.close || options.html.voidElements.has(tagName));
- if (hasChildren) {
- stack.push({
- tagName,
- children
- });
- const innerState = {
- tokens,
- cursor,
- stack
- };
- parse(innerState);
- cursor = innerState.cursor;
- }
- }
- state.cursor = cursor;
- }
- function setInnerHTML(element, html) {
- while(element.firstChild){
- element.removeChild(element.firstChild);
- }
- const children = parser(html, element.ownerDocument);
- for(let i = 0; i < children.length; i++){
- element.appendChild(children[i]);
- }
- }
- function getBoundingClientRectImpl() {
- if (!options.miniGlobal) return Promise.resolve(null);
- return new Promise((resolve)=>{
- const query = options.miniGlobal.createSelectorQuery();
- query.select(`#${this.uid}`).boundingClientRect((res)=>{
- resolve(res);
- }).exec();
- });
- }
- function getTemplateContent(ctx) {
- if (ctx.nodeName === "template") {
- const document2 = ctx.ownerDocument;
- const content = document2.createElement(DOCUMENT_FRAGMENT);
- content.childNodes = ctx.childNodes;
- ctx.childNodes = [
- content
- ];
- content.parentNode = ctx;
- content.childNodes.forEach((nodes)=>{
- nodes.parentNode = content;
- });
- return content;
- }
- }
- function insertAdjacentHTML(position, html) {
- var _a, _b;
- const parsedNodes = parser(html, this.ownerDocument);
- for(let i = 0; i < parsedNodes.length; i++){
- const n = parsedNodes[i];
- switch(position){
- case "beforebegin":
- (_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(n, this);
- break;
- case "afterbegin":
- if (this.hasChildNodes()) {
- this.insertBefore(n, this.childNodes[0]);
- } else {
- this.appendChild(n);
- }
- break;
- case "beforeend":
- this.appendChild(n);
- break;
- case "afterend":
- (_b = this.parentNode) === null || _b === void 0 ? void 0 : _b.appendChild(n);
- break;
- }
- }
- }
- function cloneNode(isDeep = false) {
- const document2 = this.ownerDocument;
- let newNode;
- if (this.nodeType === 1) {
- newNode = document2.createElement(this.nodeName);
- } else if (this.nodeType === 3) {
- newNode = document2.createTextNode("");
- }
- for(const key in this){
- const value = this[key];
- if ([
- PROPS,
- DATASET
- ].includes(key) && typeof value === OBJECT) {
- newNode[key] = Object.assign({}, value);
- } else if (key === "_value") {
- newNode[key] = value;
- } else if (key === STYLE) {
- newNode.style._value = Object.assign({}, value._value);
- newNode.style._usedStyleProp = new Set(Array.from(value._usedStyleProp));
- }
- }
- if (isDeep) {
- newNode.childNodes = this.childNodes.map((node)=>node.cloneNode(true));
- }
- return newNode;
- }
- function contains(node) {
- let isContains = false;
- this.childNodes.some((childNode)=>{
- const { uid } = childNode;
- if (uid === node.uid || uid === node.id || childNode.contains(node)) {
- isContains = true;
- return true;
- }
- });
- return isContains;
- }
- function createEvent(event, node) {
- if (typeof event === "string") {
- return new TaroEvent(event, {
- bubbles: true,
- cancelable: true
- });
- }
- const domEv = new TaroEvent(event.type, {
- bubbles: true,
- cancelable: true
- }, event);
- for(const key in event){
- if (key === CURRENT_TARGET || key === TARGET || key === TYPE || key === TIME_STAMP) {
- continue;
- } else {
- domEv[key] = event[key];
- }
- }
- if (domEv.type === CONFIRM && (node === null || node === void 0 ? void 0 : node.nodeName) === INPUT) {
- domEv[KEY_CODE] = 13;
- }
- return domEv;
- }
- function getEventCBResult(event) {
- const result = event[EVENT_CALLBACK_RESULT];
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(result)) {
- delete event[EVENT_CALLBACK_RESULT];
- }
- return result;
- }
- function eventHandler(event) {
- var _a, _b;
- event.type === void 0 && Object.defineProperty(event, "type", {
- value: event._type
- });
- event.detail === void 0 && Object.defineProperty(event, "detail", {
- value: event._detail || Object.assign({}, event)
- });
- event.currentTarget = event.currentTarget || event.target || Object.assign({}, event);
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyMpEventImpl", event);
- const currentTarget = event.currentTarget;
- const id = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a.sid) || currentTarget.id || ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.id) || "";
- const node = env.document.getElementById(id);
- if (node) {
- const dispatch = ()=>{
- const e = createEvent(event, node);
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyTaroEvent", e, node);
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("dispatchTaroEvent", e, node);
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("dispatchTaroEventFinish", e, node);
- };
- if (_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.isExist("batchedEventUpdates")) {
- const type = event.type;
- if (!_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("isBubbleEvents", type) || !isParentBinded(node, type) || type === TOUCHMOVE && !!node.props.catchMove) {
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("batchedEventUpdates", ()=>{
- if (eventsBatch[type]) {
- eventsBatch[type].forEach((fn)=>fn());
- delete eventsBatch[type];
- }
- dispatch();
- });
- return getEventCBResult(event);
- } else {
- (eventsBatch[type] || (eventsBatch[type] = [])).push(dispatch);
- }
- } else {
- dispatch();
- return getEventCBResult(event);
- }
- }
- }
- function findCustomWrapper(root, dataPathArr) {
- const list = dataPathArr.slice(1);
- let currentData = root;
- let customWrapper;
- let splitedPath = "";
- list.some((item, i)=>{
- const key = item.replace(/^\[(.+)\]$/, "$1").replace(/\bcn\b/g, "childNodes");
- currentData = currentData[key];
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(currentData)) {
- currentData = currentData.filter((el)=>!isComment(el));
- }
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(currentData)) return true;
- if (currentData.nodeName === CUSTOM_WRAPPER) {
- const res = customWrapperCache.get(currentData.sid);
- if (res) {
- customWrapper = res;
- splitedPath = dataPathArr.slice(i + 2).join(".");
- }
- }
- });
- if (customWrapper) {
- return {
- customWrapper,
- splitedPath
- };
- }
- }
- function __classPrivateFieldGet(receiver, state, kind, f) {
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
- }
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
- if (kind === "m") throw new TypeError("Private method is not writable");
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
- }
- function replacer(match) {
- return replaceCharMap[match];
- }
- function appendTo(dict, name, value) {
- const res = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) ? value.join(",") : value;
- if (name in dict) dict[name].push(res);
- else dict[name] = [
- res
- ];
- }
- function addEach(value, key) {
- appendTo(this, key, value);
- }
- function decode(str) {
- return decodeURIComponent(str.replace(plusReg, " "));
- }
- function encode(str) {
- return encodeURIComponent(str).replace(findReg, replacer);
- }
- function parseUrl(url = "") {
- const result = {
- href: "",
- origin: "",
- protocol: "",
- hostname: "",
- host: "",
- port: "",
- pathname: "",
- search: "",
- hash: ""
- };
- if (!url || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) return result;
- url = url.trim();
- const PATTERN = /^(([^:/?#]+):)?\/\/(([^/?#]+):(.+)@)?([^/?#:]*)(:(\d+))?([^?#]*)(\?([^#]*))?(#(.*))?/;
- const matches = url.match(PATTERN);
- if (!matches) return result;
- result.protocol = matches[1] || "https:";
- result.hostname = matches[6] || "taro.com";
- result.port = matches[8] || "";
- result.pathname = matches[9] || "/";
- result.search = matches[10] || "";
- result.hash = matches[12] || "";
- result.href = url;
- result.origin = result.protocol + "//" + result.hostname;
- result.host = result.hostname + (result.port ? `:${result.port}` : "");
- return result;
- }
- function parseUrlBase(url, base) {
- const VALID_URL = /^(https?:)\/\//i;
- let fullUrl = "";
- let parsedBase = null;
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(base)) {
- base = String(base).trim();
- if (!VALID_URL.test(base)) throw new TypeError(`Failed to construct 'URL': Invalid base URL`);
- parsedBase = parseUrl(base);
- }
- url = String(url).trim();
- if (VALID_URL.test(url)) {
- fullUrl = url;
- } else if (parsedBase) {
- if (url) {
- if (url.startsWith("//")) {
- fullUrl = parsedBase.protocol + url;
- } else {
- fullUrl = parsedBase.origin + (url.startsWith("/") ? url : `/${url}`);
- }
- } else {
- fullUrl = parsedBase.href;
- }
- } else {
- throw new TypeError(`Failed to construct 'URL': Invalid URL`);
- }
- return parseUrl(fullUrl);
- }
- function getComputedStyle(element) {
- return element.style;
- }
- function generateFullUrl(val = "") {
- const origin = INIT_URL;
- if (/^[/?#]/.test(val)) {
- return origin + val;
- }
- return val;
- }
- function injectPageInstance(inst, id) {
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("mergePageInstance", instances.get(id), inst);
- instances.set(id, inst);
- }
- function getPageInstance(id) {
- return instances.get(id);
- }
- function removePageInstance(id) {
- instances.delete(id);
- }
- function addLeadingSlash(path) {
- if (path == null) {
- return "";
- }
- return path.charAt(0) === "/" ? path : "/" + path;
- }
- function safeExecute(path, lifecycle, ...args) {
- const instance = instances.get(path);
- if (instance == null) {
- return;
- }
- const func = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getLifecycle", instance, lifecycle);
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(func)) {
- const res = func.map((fn)=>fn.apply(instance, args));
- return res[0];
- }
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(func)) {
- return;
- }
- return func.apply(instance, args);
- }
- function stringify(obj) {
- if (obj == null) {
- return "";
- }
- const path = Object.keys(obj).map((key)=>{
- return key + "=" + obj[key];
- }).join("&");
- return path === "" ? path : "?" + path;
- }
- function getPath(id, options2) {
- const idx = id.indexOf("?");
- if (isWeb) {
- return `${idx > -1 ? id.substring(0, idx) : id}${stringify((options2 === null || options2 === void 0 ? void 0 : options2.stamp) ? {
- stamp: options2.stamp
- } : {})}`;
- } else {
- return `${idx > -1 ? id.substring(0, idx) : id}${stringify(options2)}`;
- }
- }
- function getOnReadyEventKey(path) {
- return path + "." + ON_READY;
- }
- function getOnShowEventKey(path) {
- return path + "." + ON_SHOW;
- }
- function getOnHideEventKey(path) {
- return path + "." + ON_HIDE;
- }
- function createPageConfig(component, pageName, data, pageConfig) {
- const id = pageName !== null && pageName !== void 0 ? pageName : `taro_page_${pageId()}`;
- const [ONLOAD, ONUNLOAD, ONREADY, ONSHOW, ONHIDE, LIFECYCLES, SIDE_EFFECT_LIFECYCLES] = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getMiniLifecycleImpl").page;
- let pageElement = null;
- let unmounting = false;
- let prepareMountList = [];
- function setCurrentRouter(page) {
- const router = isWeb ? page.$taroPath : page.route || page.__route__ || page.$taroPath;
- Current.router = {
- params: page.$taroParams,
- path: addLeadingSlash(router),
- $taroPath: page.$taroPath,
- onReady: getOnReadyEventKey(id),
- onShow: getOnShowEventKey(id),
- onHide: getOnHideEventKey(id)
- };
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(page.exitState)) {
- Current.router.exitState = page.exitState;
- }
- }
- let loadResolver;
- let hasLoaded;
- const config = {
- [ONLOAD] (options2 = {}, cb) {
- hasLoaded = new Promise((resolve)=>{
- loadResolver = resolve;
- });
- perf.start(PAGE_INIT);
- Current.page = this;
- this.config = pageConfig || {};
- const uniqueOptions = Object.assign({}, options2, {
- $taroTimestamp: Date.now()
- });
- const $taroPath = this.$taroPath = getPath(id, uniqueOptions);
- if (isWeb) {
- config.path = $taroPath;
- }
- if (this.$taroParams == null) {
- this.$taroParams = uniqueOptions;
- }
- setCurrentRouter(this);
- if (!isWeb) {
- window$1.trigger(CONTEXT_ACTIONS.INIT, $taroPath);
- }
- const mount = ()=>{
- Current.app.mount(component, $taroPath, ()=>{
- pageElement = env.document.getElementById($taroPath);
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.ensure)(pageElement !== null, "\u6CA1\u6709\u627E\u5230\u9875\u9762\u5B9E\u4F8B\u3002");
- safeExecute($taroPath, ON_LOAD, this.$taroParams);
- loadResolver();
- if (!isWeb) {
- pageElement.ctx = this;
- pageElement.performUpdate(true, cb);
- } else {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(cb) && cb();
- }
- });
- };
- if (unmounting) {
- prepareMountList.push(mount);
- } else {
- mount();
- }
- },
- [ONUNLOAD] () {
- const $taroPath = this.$taroPath;
- if (!isWeb) {
- window$1.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath);
- }
- safeExecute($taroPath, ONUNLOAD);
- unmounting = true;
- Current.app.unmount($taroPath, ()=>{
- unmounting = false;
- instances.delete($taroPath);
- if (pageElement) {
- pageElement.ctx = null;
- pageElement = null;
- }
- if (prepareMountList.length) {
- prepareMountList.forEach((fn)=>fn());
- prepareMountList = [];
- }
- });
- },
- [ONREADY] () {
- hasLoaded.then(()=>{
- safeExecute(this.$taroPath, ON_READY);
- _raf(()=>eventCenter.trigger(getOnReadyEventKey(id)));
- this.onReady.called = true;
- });
- },
- [ONSHOW] (options2 = {}) {
- hasLoaded.then(()=>{
- Current.page = this;
- setCurrentRouter(this);
- if (!isWeb) {
- window$1.trigger(CONTEXT_ACTIONS.RECOVER, this.$taroPath);
- }
- safeExecute(this.$taroPath, ON_SHOW, options2);
- _raf(()=>eventCenter.trigger(getOnShowEventKey(id)));
- });
- },
- [ONHIDE] () {
- if (!isWeb) {
- window$1.trigger(CONTEXT_ACTIONS.RESTORE, this.$taroPath);
- }
- if (Current.page === this) {
- Current.page = null;
- Current.router = null;
- }
- safeExecute(this.$taroPath, ON_HIDE);
- eventCenter.trigger(getOnHideEventKey(id));
- }
- };
- LIFECYCLES.forEach((lifecycle)=>{
- let isDefer = false;
- lifecycle = lifecycle.replace(/^defer:/, ()=>{
- isDefer = true;
- return "";
- });
- config[lifecycle] = function() {
- const exec = ()=>safeExecute(this.$taroPath, lifecycle, ...arguments);
- if (isDefer) {
- hasLoaded.then(exec);
- } else {
- return exec();
- }
- };
- });
- SIDE_EFFECT_LIFECYCLES.forEach((lifecycle)=>{
- var _a;
- if (component[lifecycle] || ((_a = component.prototype) === null || _a === void 0 ? void 0 : _a[lifecycle]) || component[lifecycle.replace(/^on/, "enable")] || (pageConfig === null || pageConfig === void 0 ? void 0 : pageConfig[lifecycle.replace(/^on/, "enable")])) {
- config[lifecycle] = function(...args) {
- var _a2;
- const target = (_a2 = args[0]) === null || _a2 === void 0 ? void 0 : _a2.target;
- if (target === null || target === void 0 ? void 0 : target.id) {
- const id2 = target.id;
- const element = env.document.getElementById(id2);
- if (element) {
- target.dataset = element.dataset;
- }
- }
- return safeExecute(this.$taroPath, lifecycle, ...args);
- };
- }
- });
- config.eh = eventHandler;
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(data)) {
- config.data = data;
- }
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyPageObject", config);
- return config;
- }
- function createComponentConfig(component, componentName, data) {
- const id = componentName !== null && componentName !== void 0 ? componentName : `taro_component_${pageId()}`;
- let componentElement = null;
- const [ATTACHED, DETACHED] = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getMiniLifecycleImpl").component;
- const config = {
- [ATTACHED] () {
- var _a;
- perf.start(PAGE_INIT);
- this.pageIdCache = ((_a = this.getPageId) === null || _a === void 0 ? void 0 : _a.call(this)) || pageId();
- const path = getPath(id, {
- id: this.pageIdCache
- });
- Current.app.mount(component, path, ()=>{
- componentElement = env.document.getElementById(path);
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.ensure)(componentElement !== null, "\u6CA1\u6709\u627E\u5230\u7EC4\u4EF6\u5B9E\u4F8B\u3002");
- this.$taroInstances = instances.get(path);
- safeExecute(path, ON_LOAD);
- if (!isWeb) {
- componentElement.ctx = this;
- componentElement.performUpdate(true);
- }
- });
- },
- [DETACHED] () {
- const path = getPath(id, {
- id: this.pageIdCache
- });
- Current.app.unmount(path, ()=>{
- instances.delete(path);
- if (componentElement) {
- componentElement.ctx = null;
- }
- });
- },
- methods: {
- eh: eventHandler
- }
- };
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(data)) {
- config.data = data;
- }
- [
- OPTIONS,
- EXTERNAL_CLASSES,
- BEHAVIORS
- ].forEach((key)=>{
- var _a;
- config[key] = (_a = component[key]) !== null && _a !== void 0 ? _a : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
- });
- return config;
- }
- function createRecursiveComponentConfig(componentName) {
- const isCustomWrapper = componentName === CUSTOM_WRAPPER;
- const [ATTACHED, DETACHED] = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getMiniLifecycleImpl").component;
- const lifeCycles = isCustomWrapper ? {
- [ATTACHED] () {
- var _a, _b;
- const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.sid) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b.sid);
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(componentId)) {
- customWrapperCache.set(componentId, this);
- const el = env.document.getElementById(componentId);
- if (el) {
- el.ctx = this;
- }
- }
- },
- [DETACHED] () {
- var _a, _b;
- const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.sid) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b.sid);
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(componentId)) {
- customWrapperCache.delete(componentId);
- const el = env.document.getElementById(componentId);
- if (el) {
- el.ctx = null;
- }
- }
- }
- } : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
- return Object.assign({
- properties: {
- i: {
- type: Object,
- value: {
- ["nn"]: (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.getComponentsAlias)(_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.internalComponents)[VIEW]._num
- }
- },
- l: {
- type: String,
- value: ""
- }
- },
- options: {
- addGlobalClass: true,
- virtualHost: !isCustomWrapper
- },
- methods: {
- eh: eventHandler
- }
- }, lifeCycles);
- }
- var PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, observers, MutationObserverImpl, sidMatches, isConcerned, pendingMuatations, MutationObserver, incrementId, customWrapperCache, componentsAlias$1, ClassList, EventSource, eventSource, isWeb$1, env, SPECIAL_NODES, componentsAlias, TaroEventTarget, CHILDNODES, nodeId, TaroNode, WEBKIT, styleProperties, color, style, width, image, size, color_style_width, fitlength_fitwidth_image, fitlength_fitwidth_image_radius, color_style_width_fitlength_fitwidth_image, endRadius_startRadius, bottom_left_right_top, end_start, content_items_self, blockSize_height_inlineSize_width, after_before, Style, TaroElement, options, whitespace, equalSign, alphanumeric, Scaner, LEFT_BRACKET, RIGHT_BRACKET, CLASS_SELECTOR, ID_SELECTOR, CHILD_COMBINATOR, GENERAL_SIBLING_COMBINATOR, ADJACENT_SIBLING_COMBINATOR, StyleTagParser, specialMiniElements, internalCompsList, isMiniElements, isInlineElements, isBlockElements, closingTagAncestorBreakers, TaroEvent, eventsBatch, FormElement, Performance, perf, TaroRootElement, TaroText, _URLSearchParams_dict, findReg, plusReg, replaceCharMap, URLSearchParams, _URL_hash, _URL_hostname, _URL_pathname, _URL_port, _URL_protocol, _URL_search, URL, AnchorElement, TaroDocument, document$1, eventCenter, RuntimeCache, _History_instances, _History_location, _History_stack, _History_cur, _History_window, _History_reset, cache$1, History, Current, getCurrentInstance, _Location_instances, _Location_url, _Location_noCheckUrl, _Location_window, _Location_reset, _Location_getPreValue, _Location_rollBack, _Location_recordHistory, _Location_checkUrlChange, INIT_URL, cache, Location, machine, arch, engine, msg, nav, now, lastTime, _raf, _caf, window$1, location, history, SVGElement, instances, pageId, isWeb, TIMEOUT, nextTick;
- var init_runtime_esm = (0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_1__.__esm)({
- "node_modules/@tarojs/runtime/dist/runtime.esm.js" () {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.init_shared_esm)();
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.init_shared_esm)();
- PROPERTY_THRESHOLD = 2046;
- TARO_RUNTIME = "Taro runtime";
- HOOKS_APP_ID = "taro-app";
- SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
- PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
- ROOT_STR = "root";
- HTML = "html";
- HEAD = "head";
- BODY = "body";
- APP = "app";
- CONTAINER = "container";
- DOCUMENT_ELEMENT_NAME = "#document";
- DOCUMENT_FRAGMENT = "document-fragment";
- ID = "id";
- UID = "uid";
- CLASS = "class";
- STYLE = "style";
- FOCUS = "focus";
- VIEW = "view";
- STATIC_VIEW = "static-view";
- PURE_VIEW = "pure-view";
- PROPS = "props";
- DATASET = "dataset";
- OBJECT = "object";
- VALUE = "value";
- INPUT = "input";
- CHANGE = "change";
- CUSTOM_WRAPPER = "custom-wrapper";
- TARGET = "target";
- CURRENT_TARGET = "currentTarget";
- TYPE = "type";
- CONFIRM = "confirm";
- TIME_STAMP = "timeStamp";
- KEY_CODE = "keyCode";
- TOUCHMOVE = "touchmove";
- DATE = "Date";
- SET_TIMEOUT = "setTimeout";
- CATCHMOVE = "catchMove";
- CATCH_VIEW = "catch-view";
- COMMENT = "comment";
- ON_LOAD = "onLoad";
- ON_READY = "onReady";
- ON_SHOW = "onShow";
- ON_HIDE = "onHide";
- OPTIONS = "options";
- EXTERNAL_CLASSES = "externalClasses";
- EVENT_CALLBACK_RESULT = "e_result";
- BEHAVIORS = "behaviors";
- A = "a";
- (function(CONTEXT_ACTIONS2) {
- CONTEXT_ACTIONS2["INIT"] = "0";
- CONTEXT_ACTIONS2["RESTORE"] = "1";
- CONTEXT_ACTIONS2["RECOVER"] = "2";
- CONTEXT_ACTIONS2["DESTORY"] = "3";
- })(CONTEXT_ACTIONS || (CONTEXT_ACTIONS = {}));
- observers = [];
- MutationObserverImpl = class {
- observe(target, options2) {
- this.disconnect();
- this.target = target;
- this.options = options2 || {};
- observers.push(this);
- }
- disconnect() {
- this.target = null;
- const index = observers.indexOf(this);
- if (index >= 0) {
- observers.splice(index, 1);
- }
- }
- takeRecords() {
- return this.records.splice(0, this.records.length);
- }
- constructor(callback){
- this.records = [];
- this.callback = callback;
- }
- };
- sidMatches = (observerTarget, target)=>{
- return !!observerTarget && observerTarget.sid === (target === null || target === void 0 ? void 0 : target.sid);
- };
- isConcerned = (record, options2)=>{
- const { characterData , characterDataOldValue , attributes , attributeOldValue , childList } = options2;
- switch(record.type){
- case "characterData":
- if (characterData) {
- if (!characterDataOldValue) record.oldValue = null;
- return true;
- }
- return false;
- case "attributes":
- if (attributes) {
- if (!attributeOldValue) record.oldValue = null;
- return true;
- }
- return false;
- case "childList":
- if (childList) {
- return true;
- }
- return false;
- }
- };
- pendingMuatations = false;
- MutationObserver = class {
- observe(...args) {
- this.core.observe(...args);
- }
- disconnect() {
- this.core.disconnect();
- }
- takeRecords() {
- return this.core.takeRecords();
- }
- static record(record) {
- recordMutation(record);
- }
- constructor(callback){
- if (false) {} else {
- if (true) {
- console.warn("[Taro Warning] \u82E5\u8981\u4F7F\u7528 MutationObserver\uFF0C\u8BF7\u5728 Taro \u7F16\u8BD1\u914D\u7F6E\u4E2D\u8BBE\u7F6E 'mini.enableMutationObserver: true'");
- }
- this.core = {
- observe: _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.noop,
- disconnect: _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.noop,
- takeRecords: _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.noop
- };
- }
- }
- };
- incrementId = ()=>{
- const chatCodes = [];
- for(let i = 65; i <= 90; i++){
- chatCodes.push(i);
- }
- for(let i1 = 97; i1 <= 122; i1++){
- chatCodes.push(i1);
- }
- const chatCodesLen = chatCodes.length - 1;
- const list = [
- 0,
- 0
- ];
- return ()=>{
- const target = list.map((item)=>chatCodes[item]);
- const res = String.fromCharCode(...target);
- let tailIdx = list.length - 1;
- list[tailIdx]++;
- while(list[tailIdx] > chatCodesLen){
- list[tailIdx] = 0;
- tailIdx = tailIdx - 1;
- if (tailIdx < 0) {
- list.push(0);
- break;
- }
- list[tailIdx]++;
- }
- return res;
- };
- };
- customWrapperCache = /* @__PURE__ */ new Map();
- ClassList = class {
- get value() {
- return this.toString();
- }
- get length() {
- return this.tokenList.length;
- }
- add() {
- let index = 0;
- let updated = false;
- const tokens = arguments;
- const length = tokens.length;
- const tokenList = this.tokenList;
- do {
- const token = tokens[index];
- if (this.checkTokenIsValid(token) && !~tokenList.indexOf(token)) {
- tokenList.push(token);
- updated = true;
- }
- }while (++index < length)
- if (updated) {
- this._update();
- }
- }
- remove() {
- let i = 0;
- let updated = false;
- const tokens = arguments;
- const length = tokens.length;
- const tokenList = this.tokenList;
- do {
- const token = tokens[i] + "";
- if (!this.checkTokenIsValid(token)) continue;
- const index = tokenList.indexOf(token);
- if (~tokenList.indexOf(token)) {
- tokenList.splice(index, 1);
- updated = true;
- }
- }while (++i < length)
- if (updated) {
- this._update();
- }
- }
- contains(token) {
- if (!this.checkTokenIsValid(token)) return false;
- return !!~this.tokenList.indexOf(token);
- }
- toggle(token, force) {
- const result = this.contains(token);
- const method = result ? force !== true && "remove" : force !== false && "add";
- if (method) {
- this[method](token);
- }
- if (force === true || force === false) {
- return force;
- } else {
- return !result;
- }
- }
- replace(token, replacement_token) {
- if (!this.checkTokenIsValid(token) || !this.checkTokenIsValid(replacement_token)) return;
- const index = this.tokenList.indexOf(token);
- if (~index) {
- this.tokenList.splice(index, 1, replacement_token);
- this._update();
- }
- }
- toString() {
- return this.tokenList.filter((v)=>v !== "").join(" ");
- }
- checkTokenIsValid(token) {
- if (token === "" || /\s/.test(token)) return false;
- return true;
- }
- _update() {
- this.el.className = this.value;
- }
- constructor(className, el){
- this.tokenList = [];
- this.el = el;
- className.trim().split(/\s+/).forEach((token)=>this.tokenList.push(token));
- }
- };
- EventSource = class extends Map {
- removeNode(child) {
- const { sid , uid } = child;
- this.delete(sid);
- if (uid !== sid && uid) this.delete(uid);
- }
- removeNodeTree(child) {
- this.removeNode(child);
- const { childNodes } = child;
- childNodes.forEach((node)=>this.removeNodeTree(node));
- }
- };
- eventSource = new EventSource();
- isWeb$1 = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)();
- env = {
- window: isWeb$1 ? window : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ,
- document: isWeb$1 ? document : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ
- };
- TaroEventTarget = class {
- addEventListener(type, handler, options2) {
- type = type.toLowerCase();
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("onAddEvent", type, handler, options2, this);
- if (type === "regionchange") {
- this.addEventListener("begin", handler, options2);
- this.addEventListener("end", handler, options2);
- return;
- }
- let isCapture = Boolean(options2);
- let isOnce = false;
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(options2)) {
- isCapture = Boolean(options2.capture);
- isOnce = Boolean(options2.once);
- }
- if (isOnce) {
- const wrapper = function() {
- handler.apply(this, arguments);
- this.removeEventListener(type, wrapper);
- };
- this.addEventListener(type, wrapper, Object.assign(Object.assign({}, options2), {
- once: false
- }));
- return;
- }
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(isCapture, "Taro \u6682\u672A\u5B9E\u73B0 event \u7684 capture \u7279\u6027\u3002");
- const oldHandler = handler;
- handler = function() {
- return oldHandler.apply(this, arguments);
- };
- handler.oldHandler = oldHandler;
- const handlers = this.__handlers[type];
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(handlers)) {
- handlers.push(handler);
- } else {
- this.__handlers[type] = [
- handler
- ];
- }
- }
- removeEventListener(type, handler) {
- type = type.toLowerCase();
- if (type === "regionchange") {
- this.removeEventListener("begin", handler);
- this.removeEventListener("end", handler);
- return;
- }
- if (!handler) {
- return;
- }
- const handlers = this.__handlers[type];
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(handlers)) {
- return;
- }
- const index = handlers.findIndex((item)=>{
- if (item === handler || item.oldHandler === handler) return true;
- });
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(index === -1, `\u4E8B\u4EF6: '${type}' \u6CA1\u6709\u6CE8\u518C\u5728 DOM \u4E2D\uFF0C\u56E0\u6B64\u4E0D\u4F1A\u88AB\u79FB\u9664\u3002`);
- handlers.splice(index, 1);
- }
- isAnyEventBinded() {
- const handlers = this.__handlers;
- const isAnyEventBinded = Object.keys(handlers).find((key)=>handlers[key].length);
- return Boolean(isAnyEventBinded);
- }
- constructor(){
- this.__handlers = {};
- }
- };
- CHILDNODES = "cn";
- nodeId = incrementId();
- TaroNode = class extends TaroEventTarget {
- updateChildNodes(isClean) {
- const cleanChildNodes = ()=>[];
- const rerenderChildNodes = ()=>{
- const childNodes = this.childNodes.filter((node)=>!isComment(node));
- return childNodes.map(hydrate);
- };
- this.enqueueUpdate({
- path: `${this._path}.${CHILDNODES}`,
- value: isClean ? cleanChildNodes : rerenderChildNodes
- });
- }
- updateSingleChild(index) {
- this.childNodes.forEach((child, childIndex)=>{
- if (isComment(child)) return;
- if (index && childIndex < index) return;
- this.enqueueUpdate({
- path: child._path,
- value: this.hydrate(child)
- });
- });
- }
- get _root() {
- var _a;
- return ((_a = this.parentNode) === null || _a === void 0 ? void 0 : _a._root) || null;
- }
- findIndex(refChild) {
- const index = this.childNodes.indexOf(refChild);
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.ensure)(index !== -1, "The node to be replaced is not a child of this node.");
- return index;
- }
- get _path() {
- const parentNode = this.parentNode;
- if (parentNode) {
- const list = parentNode.childNodes.filter((node)=>!isComment(node));
- const indexOfNode = list.indexOf(this);
- const index = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getPathIndex", indexOfNode);
- return `${parentNode._path}.${CHILDNODES}.${index}`;
- }
- return "";
- }
- get nextSibling() {
- const parentNode = this.parentNode;
- return (parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes[parentNode.findIndex(this) + 1]) || null;
- }
- get previousSibling() {
- const parentNode = this.parentNode;
- return (parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes[parentNode.findIndex(this) - 1]) || null;
- }
- get parentElement() {
- const parentNode = this.parentNode;
- if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeType) === 1) {
- return parentNode;
- }
- return null;
- }
- get firstChild() {
- return this.childNodes[0] || null;
- }
- get lastChild() {
- const childNodes = this.childNodes;
- return childNodes[childNodes.length - 1] || null;
- }
- set textContent(text) {
- const removedNodes = this.childNodes.slice();
- const addedNodes = [];
- while(this.firstChild){
- this.removeChild(this.firstChild, {
- doUpdate: false
- });
- }
- if (text === "") {
- this.updateChildNodes(true);
- } else {
- const newText = env.document.createTextNode(text);
- addedNodes.push(newText);
- this.appendChild(newText);
- this.updateChildNodes();
- }
- MutationObserver.record({
- type: "childList",
- target: this,
- removedNodes,
- addedNodes
- });
- }
- insertBefore(newChild, refChild, isReplace) {
- if (newChild.nodeName === DOCUMENT_FRAGMENT) {
- newChild.childNodes.reduceRight((previousValue, currentValue)=>{
- this.insertBefore(currentValue, previousValue);
- return currentValue;
- }, refChild);
- return newChild;
- }
- newChild.remove({
- cleanRef: false
- });
- let index = 0;
- newChild.parentNode = this;
- if (refChild) {
- index = this.findIndex(refChild);
- this.childNodes.splice(index, 0, newChild);
- } else {
- this.childNodes.push(newChild);
- }
- const childNodesLength = this.childNodes.length;
- if (this._root) {
- if (!refChild) {
- const isOnlyChild = childNodesLength === 1;
- if (isOnlyChild) {
- this.updateChildNodes();
- } else {
- this.enqueueUpdate({
- path: newChild._path,
- value: this.hydrate(newChild)
- });
- }
- } else if (isReplace) {
- this.enqueueUpdate({
- path: newChild._path,
- value: this.hydrate(newChild)
- });
- } else {
- const mark = childNodesLength * 2 / 3;
- if (mark > index) {
- this.updateChildNodes();
- } else {
- this.updateSingleChild(index);
- }
- }
- }
- MutationObserver.record({
- type: "childList",
- target: this,
- addedNodes: [
- newChild
- ],
- removedNodes: isReplace ? [
- refChild
- ] : [],
- nextSibling: isReplace ? refChild.nextSibling : refChild || null,
- previousSibling: newChild.previousSibling
- });
- return newChild;
- }
- appendChild(newChild) {
- return this.insertBefore(newChild);
- }
- replaceChild(newChild, oldChild) {
- if (oldChild.parentNode !== this) return;
- this.insertBefore(newChild, oldChild, true);
- oldChild.remove({
- doUpdate: false
- });
- return oldChild;
- }
- removeChild(child, options2 = {}) {
- const { cleanRef , doUpdate } = options2;
- if (cleanRef !== false && doUpdate !== false) {
- MutationObserver.record({
- type: "childList",
- target: this,
- removedNodes: [
- child
- ],
- nextSibling: child.nextSibling,
- previousSibling: child.previousSibling
- });
- }
- const index = this.findIndex(child);
- this.childNodes.splice(index, 1);
- child.parentNode = null;
- if (cleanRef !== false) {
- eventSource.removeNodeTree(child);
- }
- if (this._root && doUpdate !== false) {
- this.updateChildNodes();
- }
- return child;
- }
- remove(options2) {
- var _a;
- (_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this, options2);
- }
- hasChildNodes() {
- return this.childNodes.length > 0;
- }
- enqueueUpdate(payload) {
- var _a;
- (_a = this._root) === null || _a === void 0 ? void 0 : _a.enqueueUpdate(payload);
- }
- get ownerDocument() {
- return env.document;
- }
- static extend(methodName, options2) {
- extend(TaroNode, methodName, options2);
- }
- constructor(){
- super();
- this.parentNode = null;
- this.childNodes = [];
- this.hydrate = (node)=>()=>hydrate(node);
- this.uid = "_" + nodeId();
- this.sid = this.uid;
- eventSource.set(this.sid, this);
- }
- };
- WEBKIT = "webkit";
- styleProperties = [
- "all",
- "appearance",
- "blockOverflow",
- "blockSize",
- "bottom",
- "clear",
- "contain",
- "content",
- "continue",
- "cursor",
- "direction",
- "display",
- "filter",
- "float",
- "gap",
- "height",
- "inset",
- "isolation",
- "left",
- "letterSpacing",
- "lightingColor",
- "markerSide",
- "mixBlendMode",
- "opacity",
- "order",
- "position",
- "quotes",
- "resize",
- "right",
- "rowGap",
- "tabSize",
- "tableLayout",
- "top",
- "userSelect",
- "verticalAlign",
- "visibility",
- "voiceFamily",
- "volume",
- "whiteSpace",
- "widows",
- "width",
- "zIndex",
- "pointerEvents",
- "aspectRatio"
- ];
- color = "Color";
- style = "Style";
- width = "Width";
- image = "Image";
- size = "Size";
- color_style_width = [
- color,
- style,
- width
- ];
- fitlength_fitwidth_image = [
- "FitLength",
- "FitWidth",
- image
- ];
- fitlength_fitwidth_image_radius = [
- ...fitlength_fitwidth_image,
- "Radius"
- ];
- color_style_width_fitlength_fitwidth_image = [
- ...color_style_width,
- ...fitlength_fitwidth_image
- ];
- endRadius_startRadius = [
- "EndRadius",
- "StartRadius"
- ];
- bottom_left_right_top = [
- "Bottom",
- "Left",
- "Right",
- "Top"
- ];
- end_start = [
- "End",
- "Start"
- ];
- content_items_self = [
- "Content",
- "Items",
- "Self"
- ];
- blockSize_height_inlineSize_width = [
- "BlockSize",
- "Height",
- "InlineSize",
- width
- ];
- after_before = [
- "After",
- "Before"
- ];
- combine("borderBlock", color_style_width);
- combine("borderBlockEnd", color_style_width);
- combine("borderBlockStart", color_style_width);
- combine("outline", [
- ...color_style_width,
- "Offset"
- ]);
- combine("border", [
- ...color_style_width,
- "Boundary",
- "Break",
- "Collapse",
- "Radius",
- "Spacing"
- ]);
- combine("borderFit", [
- "Length",
- width
- ]);
- combine("borderInline", color_style_width);
- combine("borderInlineEnd", color_style_width);
- combine("borderInlineStart", color_style_width);
- combine("borderLeft", color_style_width_fitlength_fitwidth_image);
- combine("borderRight", color_style_width_fitlength_fitwidth_image);
- combine("borderTop", color_style_width_fitlength_fitwidth_image);
- combine("borderBottom", color_style_width_fitlength_fitwidth_image);
- combine("textDecoration", [
- color,
- style,
- "Line"
- ]);
- combine("textEmphasis", [
- color,
- style,
- "Position"
- ]);
- combine("scrollMargin", bottom_left_right_top);
- combine("scrollPadding", bottom_left_right_top);
- combine("padding", bottom_left_right_top);
- combine("margin", [
- ...bottom_left_right_top,
- "Trim"
- ]);
- combine("scrollMarginBlock", end_start);
- combine("scrollMarginInline", end_start);
- combine("scrollPaddingBlock", end_start);
- combine("scrollPaddingInline", end_start);
- combine("gridColumn", end_start);
- combine("gridRow", end_start);
- combine("insetBlock", end_start);
- combine("insetInline", end_start);
- combine("marginBlock", end_start);
- combine("marginInline", end_start);
- combine("paddingBlock", end_start);
- combine("paddingInline", end_start);
- combine("pause", after_before);
- combine("cue", after_before);
- combine("mask", [
- "Clip",
- "Composite",
- image,
- "Mode",
- "Origin",
- "Position",
- "Repeat",
- size,
- "Type"
- ]);
- combine("borderImage", [
- "Outset",
- "Repeat",
- "Slice",
- "Source",
- "Transform",
- width
- ]);
- combine("maskBorder", [
- "Mode",
- "Outset",
- "Repeat",
- "Slice",
- "Source",
- width
- ]);
- combine("font", [
- "Family",
- "FeatureSettings",
- "Kerning",
- "LanguageOverride",
- "MaxSize",
- "MinSize",
- "OpticalSizing",
- "Palette",
- size,
- "SizeAdjust",
- "Stretch",
- style,
- "Weight",
- "VariationSettings"
- ]);
- combine("transform", [
- "Box",
- "Origin",
- style
- ]);
- combine("background", [
- color,
- image,
- "Attachment",
- "BlendMode",
- "Clip",
- "Origin",
- "Position",
- "Repeat",
- size
- ]);
- combine("listStyle", [
- image,
- "Position",
- "Type"
- ]);
- combine("scrollSnap", [
- "Align",
- "Stop",
- "Type"
- ]);
- combine("grid", [
- "Area",
- "AutoColumns",
- "AutoFlow",
- "AutoRows"
- ]);
- combine("gridTemplate", [
- "Areas",
- "Columns",
- "Rows"
- ]);
- combine("overflow", [
- "Block",
- "Inline",
- "Wrap",
- "X",
- "Y"
- ]);
- combine("transition", [
- "Delay",
- "Duration",
- "Property",
- "TimingFunction"
- ]);
- combine("color", [
- "Adjust",
- "InterpolationFilters",
- "Scheme"
- ]);
- combine("textAlign", [
- "All",
- "Last"
- ]);
- combine("page", [
- "BreakAfter",
- "BreakBefore",
- "BreakInside"
- ]);
- combine("animation", [
- "Delay",
- "Direction",
- "Duration",
- "FillMode",
- "IterationCount",
- "Name",
- "PlayState",
- "TimingFunction"
- ]);
- combine("flex", [
- "Basis",
- "Direction",
- "Flow",
- "Grow",
- "Shrink",
- "Wrap"
- ]);
- combine("offset", [
- ...after_before,
- ...end_start,
- "Anchor",
- "Distance",
- "Path",
- "Position",
- "Rotate"
- ]);
- combine("perspective", [
- "Origin"
- ]);
- combine("clip", [
- "Path",
- "Rule"
- ]);
- combine("flow", [
- "From",
- "Into"
- ]);
- combine("align", [
- "Content",
- "Items",
- "Self"
- ], true);
- combine("alignment", [
- "Adjust",
- "Baseline"
- ], true);
- combine("borderStart", endRadius_startRadius, true);
- combine("borderEnd", endRadius_startRadius, true);
- combine("borderCorner", [
- "Fit",
- image,
- "ImageTransform"
- ], true);
- combine("borderTopLeft", fitlength_fitwidth_image_radius, true);
- combine("borderTopRight", fitlength_fitwidth_image_radius, true);
- combine("borderBottomLeft", fitlength_fitwidth_image_radius, true);
- combine("borderBottomRight", fitlength_fitwidth_image_radius, true);
- combine("column", [
- "s",
- "Count",
- "Fill",
- "Gap",
- "Rule",
- "RuleColor",
- "RuleStyle",
- "RuleWidth",
- "Span",
- width
- ], true);
- combine("break", [
- ...after_before,
- "Inside"
- ], true);
- combine("wrap", [
- ...after_before,
- "Flow",
- "Inside",
- "Through"
- ], true);
- combine("justify", content_items_self, true);
- combine("place", content_items_self, true);
- combine("max", [
- ...blockSize_height_inlineSize_width,
- "Lines"
- ], true);
- combine("min", blockSize_height_inlineSize_width, true);
- combine("line", [
- "Break",
- "Clamp",
- "Grid",
- "Height",
- "Padding",
- "Snap"
- ], true);
- combine("inline", [
- "BoxAlign",
- size,
- "Sizing"
- ], true);
- combine("text", [
- "CombineUpright",
- "GroupAlign",
- "Height",
- "Indent",
- "Justify",
- "Orientation",
- "Overflow",
- "Shadow",
- "SpaceCollapse",
- "SpaceTrim",
- "Spacing",
- "Transform",
- "UnderlinePosition",
- "Wrap"
- ], true);
- combine("shape", [
- "ImageThreshold",
- "Inside",
- "Margin",
- "Outside"
- ], true);
- combine("word", [
- "Break",
- "Spacing",
- "Wrap"
- ], true);
- combine("object", [
- "Fit",
- "Position"
- ], true);
- combine("box", [
- "DecorationBreak",
- "Shadow",
- "Sizing",
- "Snap"
- ], true);
- combine(WEBKIT, [
- "LineClamp",
- "BoxOrient",
- "TextFillColor",
- "TextStroke",
- "TextStrokeColor",
- "TextStrokeWidth"
- ], true);
- Style = class {
- setCssVariables(styleKey) {
- this.hasOwnProperty(styleKey) || Object.defineProperty(this, styleKey, {
- enumerable: true,
- configurable: true,
- get: ()=>{
- return this._value[styleKey] || "";
- },
- set: (newVal)=>{
- setStyle.call(this, newVal, styleKey);
- }
- });
- }
- get cssText() {
- if (!this._usedStyleProp.size) return "";
- const texts = [];
- this._usedStyleProp.forEach((key)=>{
- const val = this[key];
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(val) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(val)) return;
- let styleName = isCssVariable(key) ? key : (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toDashed)(key);
- if (styleName.indexOf("webkit") === 0 || styleName.indexOf("Webkit") === 0) {
- styleName = `-${styleName}`;
- }
- texts.push(`${styleName}: ${val};`);
- });
- return texts.join(" ");
- }
- set cssText(str) {
- this._pending = true;
- recordCss(this);
- this._usedStyleProp.forEach((prop)=>{
- this.removeProperty(prop);
- });
- if (str === "" || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(str) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(str)) {
- this._pending = false;
- enqueueUpdate(this);
- return;
- }
- const rules = str.split(";");
- for(let i = 0; i < rules.length; i++){
- const rule = rules[i].trim();
- if (rule === "") {
- continue;
- }
- const [propName, ...valList] = rule.split(":");
- const val = valList.join(":");
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(val)) {
- continue;
- }
- this.setProperty(propName.trim(), val.trim());
- }
- this._pending = false;
- enqueueUpdate(this);
- }
- setProperty(propertyName, value) {
- if (propertyName[0] === "-") {
- this.setCssVariables(propertyName);
- } else {
- propertyName = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(propertyName);
- }
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(value) || (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(value)) {
- this.removeProperty(propertyName);
- } else {
- this[propertyName] = value;
- }
- }
- removeProperty(propertyName) {
- propertyName = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(propertyName);
- if (!this._usedStyleProp.has(propertyName)) {
- return "";
- }
- const value = this[propertyName];
- this[propertyName] = void 0;
- return value;
- }
- getPropertyValue(propertyName) {
- propertyName = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(propertyName);
- const value = this[propertyName];
- if (!value) {
- return "";
- }
- return value;
- }
- constructor(element){
- this._element = element;
- this._usedStyleProp = /* @__PURE__ */ new Set();
- this._value = {};
- }
- };
- initStyle(Style, styleProperties);
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.tap("injectNewStyleProperties", (newStyleProperties)=>{
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(newStyleProperties)) {
- initStyle(Style, newStyleProperties);
- } else {
- if (typeof newStyleProperties !== "string") return;
- initStyle(Style, [
- newStyleProperties
- ]);
- }
- });
- TaroElement = class extends TaroNode {
- _stopPropagation(event) {
- let target = this;
- while(target = target.parentNode){
- const listeners = target.__handlers[event.type];
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(listeners)) {
- continue;
- }
- for(let i = listeners.length; i--;){
- const l = listeners[i];
- l._stop = true;
- }
- }
- }
- get id() {
- return this.getAttribute(ID);
- }
- set id(val) {
- this.setAttribute(ID, val);
- }
- get className() {
- return this.getAttribute(CLASS) || "";
- }
- set className(val) {
- this.setAttribute(CLASS, val);
- }
- get cssText() {
- return this.getAttribute(STYLE) || "";
- }
- get classList() {
- return new ClassList(this.className, this);
- }
- get children() {
- return this.childNodes.filter(isElement);
- }
- get attributes() {
- const props = this.props;
- const propKeys = Object.keys(props);
- const style2 = this.style.cssText;
- const attrs = propKeys.map((key)=>({
- name: key,
- value: props[key]
- }));
- return attrs.concat(style2 ? {
- name: STYLE,
- value: style2
- } : []);
- }
- get textContent() {
- let text = "";
- const childNodes = this.childNodes;
- for(let i = 0; i < childNodes.length; i++){
- text += childNodes[i].textContent;
- }
- return text;
- }
- set textContent(text) {
- super.textContent = text;
- }
- hasAttribute(qualifiedName) {
- return !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(this.props[qualifiedName]);
- }
- hasAttributes() {
- return this.attributes.length > 0;
- }
- get focus() {
- return function() {
- this.setAttribute(FOCUS, true);
- };
- }
- set focus(value) {
- this.setAttribute(FOCUS, value);
- }
- blur() {
- this.setAttribute(FOCUS, false);
- }
- setAttribute(qualifiedName, value) {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value) && value.length > PROPERTY_THRESHOLD, `\u5143\u7D20 ${this.nodeName} \u7684 ${qualifiedName} \u5C5E\u6027\u503C\u6570\u636E\u91CF\u8FC7\u5927\uFF0C\u53EF\u80FD\u4F1A\u5F71\u54CD\u6E32\u67D3\u6027\u80FD\u3002\u8003\u8651\u964D\u4F4E\u56FE\u7247\u8F6C\u4E3A base64 \u7684\u9608\u503C\u6216\u5728 CSS \u4E2D\u4F7F\u7528 base64\u3002`);
- const isPureView = this.nodeName === VIEW && !isHasExtractProp(this) && !this.isAnyEventBinded();
- if (qualifiedName !== STYLE) {
- MutationObserver.record({
- target: this,
- type: "attributes",
- attributeName: qualifiedName,
- oldValue: this.getAttribute(qualifiedName)
- });
- }
- switch(qualifiedName){
- case STYLE:
- this.style.cssText = value;
- break;
- case ID:
- if (this.uid !== this.sid) {
- eventSource.delete(this.uid);
- }
- value = String(value);
- this.props[qualifiedName] = this.uid = value;
- eventSource.set(value, this);
- break;
- default:
- this.props[qualifiedName] = value;
- if (qualifiedName.startsWith("data-")) {
- if (this.dataset === _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ) {
- this.dataset = /* @__PURE__ */ Object.create(null);
- }
- this.dataset[(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedName.replace(/^data-/, ""))] = value;
- }
- break;
- }
- if (!this._root) return;
- const componentsAlias2 = getComponentsAlias2();
- const _alias = componentsAlias2[this.nodeName];
- const viewAlias = componentsAlias2[VIEW]._num;
- const staticViewAlias = componentsAlias2[STATIC_VIEW]._num;
- const catchViewAlias = componentsAlias2[CATCH_VIEW]._num;
- const _path = this._path;
- qualifiedName = shortcutAttr(qualifiedName);
- const qualifiedNameInCamelCase = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedName);
- const payload = {
- path: `${_path}.${qualifiedNameInCamelCase}`,
- value: (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value) ? ()=>value : value
- };
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifySetAttrPayload", this, qualifiedName, payload, componentsAlias2);
- if (_alias) {
- const qualifiedNameAlias = _alias[qualifiedNameInCamelCase] || qualifiedName;
- payload.path = `${_path}.${(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedNameAlias)}`;
- }
- this.enqueueUpdate(payload);
- if (this.nodeName === VIEW) {
- if (qualifiedNameInCamelCase === CATCHMOVE) {
- this.enqueueUpdate({
- path: `${_path}.${"nn"}`,
- value: value ? catchViewAlias : this.isAnyEventBinded() ? viewAlias : staticViewAlias
- });
- } else if (isPureView && isHasExtractProp(this)) {
- this.enqueueUpdate({
- path: `${_path}.${"nn"}`,
- value: staticViewAlias
- });
- }
- }
- }
- removeAttribute(qualifiedName) {
- const isStaticView = this.nodeName === VIEW && isHasExtractProp(this) && !this.isAnyEventBinded();
- MutationObserver.record({
- target: this,
- type: "attributes",
- attributeName: qualifiedName,
- oldValue: this.getAttribute(qualifiedName)
- });
- if (qualifiedName === STYLE) {
- this.style.cssText = "";
- } else {
- const isInterrupt = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("onRemoveAttribute", this, qualifiedName);
- if (isInterrupt) {
- return;
- }
- if (!this.props.hasOwnProperty(qualifiedName)) {
- return;
- }
- delete this.props[qualifiedName];
- }
- if (!this._root) return;
- const componentsAlias2 = getComponentsAlias2();
- const _alias = componentsAlias2[this.nodeName];
- const viewAlias = componentsAlias2[VIEW]._num;
- const staticViewAlias = componentsAlias2[STATIC_VIEW]._num;
- const pureViewAlias = componentsAlias2[PURE_VIEW]._num;
- const _path = this._path;
- qualifiedName = shortcutAttr(qualifiedName);
- const qualifiedNameInCamelCase = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedName);
- const payload = {
- path: `${_path}.${qualifiedNameInCamelCase}`,
- value: ""
- };
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyRmAttrPayload", this, qualifiedName, payload, componentsAlias2);
- if (_alias) {
- const qualifiedNameAlias = _alias[qualifiedNameInCamelCase] || qualifiedName;
- payload.path = `${_path}.${(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.toCamelCase)(qualifiedNameAlias)}`;
- }
- this.enqueueUpdate(payload);
- if (this.nodeName === VIEW) {
- if (qualifiedNameInCamelCase === CATCHMOVE) {
- this.enqueueUpdate({
- path: `${_path}.${"nn"}`,
- value: this.isAnyEventBinded() ? viewAlias : isHasExtractProp(this) ? staticViewAlias : pureViewAlias
- });
- } else if (isStaticView && !isHasExtractProp(this)) {
- this.enqueueUpdate({
- path: `${_path}.${"nn"}`,
- value: pureViewAlias
- });
- }
- }
- }
- getAttribute(qualifiedName) {
- const attr = qualifiedName === STYLE ? this.style.cssText : this.props[qualifiedName];
- return attr !== null && attr !== void 0 ? attr : "";
- }
- getElementsByTagName(tagName) {
- return treeToArray(this, (el)=>{
- return el.nodeName === tagName || tagName === "*" && this !== el;
- });
- }
- getElementsByClassName(className) {
- const classNames = className.trim().split(/\s+/);
- return treeToArray(this, (el)=>{
- const classList = el.classList;
- return classNames.every((c)=>classList.contains(c));
- });
- }
- dispatchEvent(event) {
- const cancelable = event.cancelable;
- const listeners = this.__handlers[event.type];
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(listeners)) {
- return false;
- }
- for(let i = listeners.length; i--;){
- const listener = listeners[i];
- let result;
- if (listener._stop) {
- listener._stop = false;
- } else {
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("modifyDispatchEvent", event, this);
- result = listener.call(this, event);
- }
- if ((result === false || event._end) && cancelable) {
- event.defaultPrevented = true;
- }
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(result) && event.mpEvent) {
- event.mpEvent[EVENT_CALLBACK_RESULT] = result;
- }
- if (event._end && event._stop) {
- break;
- }
- }
- if (event._stop) {
- this._stopPropagation(event);
- } else {
- event._stop = true;
- }
- return listeners != null;
- }
- addEventListener(type, handler, options2) {
- const name = this.nodeName;
- const SPECIAL_NODES2 = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getSpecialNodes");
- let sideEffect = true;
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(options2) && options2.sideEffect === false) {
- sideEffect = false;
- delete options2.sideEffect;
- }
- if (sideEffect !== false && !this.isAnyEventBinded() && SPECIAL_NODES2.indexOf(name) > -1) {
- const componentsAlias2 = getComponentsAlias2();
- const alias = componentsAlias2[name]._num;
- this.enqueueUpdate({
- path: `${this._path}.${"nn"}`,
- value: alias
- });
- }
- super.addEventListener(type, handler, options2);
- }
- removeEventListener(type, handler, sideEffect = true) {
- super.removeEventListener(type, handler);
- const name = this.nodeName;
- const SPECIAL_NODES2 = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getSpecialNodes");
- if (sideEffect !== false && !this.isAnyEventBinded() && SPECIAL_NODES2.indexOf(name) > -1) {
- const componentsAlias2 = getComponentsAlias2();
- const value = isHasExtractProp(this) ? `static-${name}` : `pure-${name}`;
- const valueAlias = componentsAlias2[value]._num;
- this.enqueueUpdate({
- path: `${this._path}.${"nn"}`,
- value: valueAlias
- });
- }
- }
- static extend(methodName, options2) {
- extend(TaroElement, methodName, options2);
- }
- constructor(){
- super();
- this.props = {};
- this.dataset = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
- this.nodeType = 1;
- this.style = new Style(this);
- _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("patchElement", this);
- }
- };
- options = {
- prerender: true,
- debug: false
- };
- whitespace = /\s/;
- equalSign = /=/;
- alphanumeric = /[A-Za-z0-9]/;
- Scaner = class {
- scan() {
- const { html , position } = this;
- const len = html.length;
- while(position.index < len){
- const start = position.index;
- this.scanText();
- if (position.index === start) {
- const isComment2 = html.startsWith("!--", start + 1);
- if (isComment2) {
- this.scanComment();
- } else {
- const tagName = this.scanTag();
- if (shouldBeIgnore(tagName)) {
- this.scanSkipTag(tagName);
- }
- }
- }
- }
- return this.tokens;
- }
- scanText() {
- const type = "text";
- const { html , position } = this;
- let textEnd = findTextEnd(html, position.index);
- if (textEnd === position.index) {
- return;
- }
- if (textEnd === -1) {
- textEnd = html.length;
- }
- const start = copyPosition(position);
- const content = html.slice(position.index, textEnd);
- jumpPosition(position, html, textEnd);
- const end = copyPosition(position);
- this.tokens.push({
- type,
- content,
- position: {
- start,
- end
- }
- });
- }
- scanComment() {
- const type = "comment";
- const { html , position } = this;
- const start = copyPosition(position);
- feedPosition(position, html, 4);
- let contentEnd = html.indexOf("-->", position.index);
- let commentEnd = contentEnd + 3;
- if (contentEnd === -1) {
- contentEnd = commentEnd = html.length;
- }
- const content = html.slice(position.index, contentEnd);
- jumpPosition(position, html, commentEnd);
- this.tokens.push({
- type,
- content,
- position: {
- start,
- end: copyPosition(position)
- }
- });
- }
- scanTag() {
- this.scanTagStart();
- const tagName = this.scanTagName();
- this.scanAttrs();
- this.scanTagEnd();
- return tagName;
- }
- scanTagStart() {
- const type = "tag-start";
- const { html , position } = this;
- const secondChar = html.charAt(position.index + 1);
- const close = secondChar === "/";
- const start = copyPosition(position);
- feedPosition(position, html, close ? 2 : 1);
- this.tokens.push({
- type,
- close,
- position: {
- start
- }
- });
- }
- scanTagEnd() {
- const type = "tag-end";
- const { html , position } = this;
- const firstChar = html.charAt(position.index);
- const close = firstChar === "/";
- feedPosition(position, html, close ? 2 : 1);
- const end = copyPosition(position);
- this.tokens.push({
- type,
- close,
- position: {
- end
- }
- });
- }
- scanTagName() {
- const type = "tag";
- const { html , position } = this;
- const len = html.length;
- let start = position.index;
- while(start < len){
- const char = html.charAt(start);
- const isTagChar = !(isWhitespaceChar(char) || char === "/" || char === ">");
- if (isTagChar) break;
- start++;
- }
- let end = start + 1;
- while(end < len){
- const char1 = html.charAt(end);
- const isTagChar1 = !(isWhitespaceChar(char1) || char1 === "/" || char1 === ">");
- if (!isTagChar1) break;
- end++;
- }
- jumpPosition(position, html, end);
- const tagName = html.slice(start, end);
- this.tokens.push({
- type,
- content: tagName
- });
- return tagName;
- }
- scanAttrs() {
- const { html , position , tokens } = this;
- let cursor = position.index;
- let quote = null;
- let wordBegin = cursor;
- const words = [];
- const len = html.length;
- while(cursor < len){
- const char = html.charAt(cursor);
- if (quote) {
- const isQuoteEnd = char === quote;
- if (isQuoteEnd) {
- quote = null;
- }
- cursor++;
- continue;
- }
- const isTagEnd = char === "/" || char === ">";
- if (isTagEnd) {
- if (cursor !== wordBegin) {
- words.push(html.slice(wordBegin, cursor));
- }
- break;
- }
- if (isWordEnd(cursor, wordBegin, html)) {
- if (cursor !== wordBegin) {
- words.push(html.slice(wordBegin, cursor));
- }
- wordBegin = cursor + 1;
- cursor++;
- continue;
- }
- const isQuoteStart = char === "'" || char === '"';
- if (isQuoteStart) {
- quote = char;
- cursor++;
- continue;
- }
- cursor++;
- }
- jumpPosition(position, html, cursor);
- const wLen = words.length;
- const type = "attribute";
- for(let i = 0; i < wLen; i++){
- const word = words[i];
- const isNotPair = word.includes("=");
- if (isNotPair) {
- const secondWord = words[i + 1];
- if (secondWord && secondWord.startsWith("=")) {
- if (secondWord.length > 1) {
- const newWord = word + secondWord;
- tokens.push({
- type,
- content: newWord
- });
- i += 1;
- continue;
- }
- const thirdWord = words[i + 2];
- i += 1;
- if (thirdWord) {
- const newWord1 = word + "=" + thirdWord;
- tokens.push({
- type,
- content: newWord1
- });
- i += 1;
- continue;
- }
- }
- }
- if (word.endsWith("=")) {
- const secondWord1 = words[i + 1];
- if (secondWord1 && !secondWord1.includes("=")) {
- const newWord2 = word + secondWord1;
- tokens.push({
- type,
- content: newWord2
- });
- i += 1;
- continue;
- }
- const newWord3 = word.slice(0, -1);
- tokens.push({
- type,
- content: newWord3
- });
- continue;
- }
- tokens.push({
- type,
- content: word
- });
- }
- }
- scanSkipTag(tagName) {
- const { html , position } = this;
- const safeTagName = tagName.toLowerCase();
- const len = html.length;
- while(position.index < len){
- const nextTag = html.indexOf("</", position.index);
- if (nextTag === -1) {
- this.scanText();
- break;
- }
- jumpPosition(position, html, nextTag);
- const name = this.scanTag();
- if (safeTagName === name.toLowerCase()) {
- break;
- }
- }
- }
- constructor(html){
- this.tokens = [];
- this.position = initPosition();
- this.html = html;
- }
- };
- LEFT_BRACKET = "{";
- RIGHT_BRACKET = "}";
- CLASS_SELECTOR = ".";
- ID_SELECTOR = "#";
- CHILD_COMBINATOR = ">";
- GENERAL_SIBLING_COMBINATOR = "~";
- ADJACENT_SIBLING_COMBINATOR = "+";
- StyleTagParser = class {
- extractStyle(src) {
- const REG_STYLE = /<style\s?[^>]*>((.|\n|\s)+?)<\/style>/g;
- let html = src;
- html = html.replace(REG_STYLE, (_, $1)=>{
- const style2 = $1.trim();
- this.stringToSelector(style2);
- return "";
- });
- return html.trim();
- }
- stringToSelector(style2) {
- let lb = style2.indexOf(LEFT_BRACKET);
- while(lb > -1){
- const rb = style2.indexOf(RIGHT_BRACKET);
- const selectors = style2.slice(0, lb).trim();
- let content = style2.slice(lb + 1, rb);
- content = content.replace(/:(.*);/g, function(_, $1) {
- const t = $1.trim().replace(/ +/g, "+++");
- return `:${t};`;
- });
- content = content.replace(/ /g, "");
- content = content.replace(/\+\+\+/g, " ");
- if (!/;$/.test(content)) {
- content += ";";
- }
- selectors.split(",").forEach((src)=>{
- const selectorList = this.parseSelector(src);
- this.styles.push({
- content,
- selectorList
- });
- });
- style2 = style2.slice(rb + 1);
- lb = style2.indexOf(LEFT_BRACKET);
- }
- }
- parseSelector(src) {
- const list = src.trim().replace(/ *([>~+]) */g, " $1").replace(/ +/g, " ").replace(/\[\s*([^[\]=\s]+)\s*=\s*([^[\]=\s]+)\s*\]/g, "[$1=$2]").split(" ");
- const selectors = list.map((item)=>{
- const firstChar = item.charAt(0);
- const selector = {
- isChild: firstChar === CHILD_COMBINATOR,
- isGeneralSibling: firstChar === GENERAL_SIBLING_COMBINATOR,
- isAdjacentSibling: firstChar === ADJACENT_SIBLING_COMBINATOR,
- tag: null,
- id: null,
- class: [],
- attrs: []
- };
- item = item.replace(/^[>~+]/, "");
- item = item.replace(/\[(.+?)\]/g, function(_, $1) {
- const [key, value] = $1.split("=");
- const all = $1.indexOf("=") === -1;
- const attr = {
- all,
- key,
- value: all ? null : value
- };
- selector.attrs.push(attr);
- return "";
- });
- item = item.replace(/([.#][A-Za-z0-9-_]+)/g, function(_, $1) {
- if ($1[0] === ID_SELECTOR) {
- selector.id = $1.substr(1);
- } else if ($1[0] === CLASS_SELECTOR) {
- selector.class.push($1.substr(1));
- }
- return "";
- });
- if (item !== "") {
- selector.tag = item;
- }
- return selector;
- });
- return selectors;
- }
- matchStyle(tagName, el, list) {
- const res = sortStyles(this.styles).reduce((str, { content , selectorList }, i)=>{
- let idx = list[i];
- let selector = selectorList[idx];
- const nextSelector = selectorList[idx + 1];
- if ((nextSelector === null || nextSelector === void 0 ? void 0 : nextSelector.isGeneralSibling) || (nextSelector === null || nextSelector === void 0 ? void 0 : nextSelector.isAdjacentSibling)) {
- selector = nextSelector;
- idx += 1;
- list[i] += 1;
- }
- let isMatch = this.matchCurrent(tagName, el, selector);
- if (isMatch && selector.isGeneralSibling) {
- let prev = getPreviousElement(el);
- while(prev){
- if (prev.h5tagName && this.matchCurrent(prev.h5tagName, prev, selectorList[idx - 1])) {
- isMatch = true;
- break;
- }
- prev = getPreviousElement(prev);
- isMatch = false;
- }
- }
- if (isMatch && selector.isAdjacentSibling) {
- const prev1 = getPreviousElement(el);
- if (!prev1 || !prev1.h5tagName) {
- isMatch = false;
- } else {
- const isSiblingMatch = this.matchCurrent(prev1.h5tagName, prev1, selectorList[idx - 1]);
- if (!isSiblingMatch) {
- isMatch = false;
- }
- }
- }
- if (isMatch) {
- if (idx === selectorList.length - 1) {
- return str + content;
- } else if (idx < selectorList.length - 1) {
- list[i] += 1;
- }
- } else {
- if (selector.isChild && idx > 0) {
- list[i] -= 1;
- if (this.matchCurrent(tagName, el, selectorList[list[i]])) {
- list[i] += 1;
- }
- }
- }
- return str;
- }, "");
- return res;
- }
- matchCurrent(tagName, el, selector) {
- if (selector.tag && selector.tag !== tagName) return false;
- if (selector.id && selector.id !== el.id) return false;
- if (selector.class.length) {
- const classList = el.className.split(" ");
- for(let i = 0; i < selector.class.length; i++){
- const cls = selector.class[i];
- if (classList.indexOf(cls) === -1) {
- return false;
- }
- }
- }
- if (selector.attrs.length) {
- for(let i1 = 0; i1 < selector.attrs.length; i1++){
- const { all , key , value } = selector.attrs[i1];
- if (all && !el.hasAttribute(key)) {
- return false;
- } else {
- const attr = el.getAttribute(key);
- if (attr !== unquote(value || "")) {
- return false;
- }
- }
- }
- }
- return true;
- }
- constructor(){
- this.styles = [];
- }
- };
- specialMiniElements = {
- img: "image",
- iframe: "web-view"
- };
- internalCompsList = Object.keys(_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.internalComponents).map((i)=>i.toLowerCase()).join(",");
- isMiniElements = makeMap(internalCompsList, true);
- isInlineElements = makeMap("a,i,abbr,iframe,select,acronym,slot,small,span,bdi,kbd,strong,big,map,sub,sup,br,mark,mark,meter,template,canvas,textarea,cite,object,time,code,output,u,data,picture,tt,datalist,var,dfn,del,q,em,s,embed,samp,b", true);
- isBlockElements = makeMap("address,fieldset,li,article,figcaption,main,aside,figure,nav,blockquote,footer,ol,details,form,p,dialog,h1,h2,h3,h4,h5,h6,pre,dd,header,section,div,hgroup,table,dl,hr,ul,dt", true);
- closingTagAncestorBreakers = {
- li: [
- "ul",
- "ol",
- "menu"
- ],
- dt: [
- "dl"
- ],
- dd: [
- "dl"
- ],
- tbody: [
- "table"
- ],
- thead: [
- "table"
- ],
- tfoot: [
- "table"
- ],
- tr: [
- "table"
- ],
- td: [
- "table"
- ]
- };
- options.html = {
- skipElements: /* @__PURE__ */ new Set([
- "style",
- "script"
- ]),
- voidElements: /* @__PURE__ */ new Set([
- "!doctype",
- "area",
- "base",
- "br",
- "col",
- "command",
- "embed",
- "hr",
- "img",
- "input",
- "keygen",
- "link",
- "meta",
- "param",
- "source",
- "track",
- "wbr"
- ]),
- closingElements: /* @__PURE__ */ new Set([
- "html",
- "head",
- "body",
- "p",
- "dt",
- "dd",
- "li",
- "option",
- "thead",
- "th",
- "tbody",
- "tr",
- "td",
- "tfoot",
- "colgroup"
- ]),
- renderHTMLTag: false
- };
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
- if (true) {
- TaroNode.extend("innerHTML", {
- set (html) {
- setInnerHTML.call(this, this, html);
- },
- get () {
- return "";
- }
- });
- if (false) {}
- }
- if (false) {}
- if (false) {}
- if (false) {}
- if (false) {}
- }
- TaroEvent = class {
- stopPropagation() {
- this._stop = true;
- }
- stopImmediatePropagation() {
- this._end = this._stop = true;
- }
- preventDefault() {
- this.defaultPrevented = true;
- }
- get target() {
- var _a, _b, _c;
- const cacheTarget = this.cacheTarget;
- if (!cacheTarget) {
- const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
- const element = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.sid) || target.id || null);
- target.dataset = element !== null ? element.dataset : _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.EMPTY_OBJ;
- for(const key in (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.detail){
- target[key] = this.mpEvent.detail[key];
- }
- this.cacheTarget = target;
- return target;
- } else {
- return cacheTarget;
- }
- }
- get currentTarget() {
- var _a, _b, _c, _d, _e, _f, _g, _h;
- const cacheCurrentTarget = this.cacheCurrentTarget;
- if (!cacheCurrentTarget) {
- const doc = env.document;
- const currentTarget = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.currentTarget) || null);
- const element = doc.getElementById(((_b = currentTarget.dataset) === null || _b === void 0 ? void 0 : _b.sid) || currentTarget.id || null);
- const targetElement = doc.getElementById(((_e = (_d = (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.dataset) === null || _e === void 0 ? void 0 : _e.sid) || ((_g = (_f = this.mpEvent) === null || _f === void 0 ? void 0 : _f.target) === null || _g === void 0 ? void 0 : _g.id) || null);
- if (element === null || element && element === targetElement) {
- this.cacheCurrentTarget = this.target;
- return this.target;
- }
- currentTarget.dataset = element.dataset;
- for(const key in (_h = this.mpEvent) === null || _h === void 0 ? void 0 : _h.detail){
- currentTarget[key] = this.mpEvent.detail[key];
- }
- this.cacheCurrentTarget = currentTarget;
- return currentTarget;
- } else {
- return cacheCurrentTarget;
- }
- }
- constructor(type, opts, event){
- this._stop = false;
- this._end = false;
- this.defaultPrevented = false;
- this.button = 0;
- this.timeStamp = Date.now();
- this.type = type.toLowerCase();
- this.mpEvent = event;
- this.bubbles = Boolean(opts && opts.bubbles);
- this.cancelable = Boolean(opts && opts.cancelable);
- }
- };
- eventsBatch = {};
- FormElement = class extends TaroElement {
- get type() {
- var _a;
- return (_a = this.props[TYPE]) !== null && _a !== void 0 ? _a : "";
- }
- set type(val) {
- this.setAttribute(TYPE, val);
- }
- get value() {
- const val = this.props[VALUE];
- return val == null ? "" : val;
- }
- set value(val) {
- this.setAttribute(VALUE, val);
- }
- dispatchEvent(event) {
- if (event.mpEvent) {
- const val = event.mpEvent.detail.value;
- if (event.type === CHANGE) {
- this.props.value = val;
- } else if (event.type === INPUT) {
- this.value = val;
- }
- }
- return super.dispatchEvent(event);
- }
- };
- Performance = class {
- start(id) {
- if (!options.debug) {
- return;
- }
- this.recorder.set(id, Date.now());
- }
- stop(id) {
- if (!options.debug) {
- return;
- }
- const now2 = Date.now();
- const prev = this.recorder.get(id);
- this.recorder.delete(id);
- const time = now2 - prev;
- console.log(`${id} \u65F6\u957F\uFF1A ${time}ms`);
- }
- constructor(){
- this.recorder = /* @__PURE__ */ new Map();
- }
- };
- perf = new Performance();
- TaroRootElement = class extends TaroElement {
- get _path() {
- return ROOT_STR;
- }
- get _root() {
- return this;
- }
- enqueueUpdate(payload) {
- this.updatePayloads.push(payload);
- if (!this.pendingUpdate && this.ctx) {
- this.performUpdate();
- }
- }
- performUpdate(initRender = false, prerender) {
- this.pendingUpdate = true;
- const ctx = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("proxyToRaw", this.ctx);
- setTimeout(()=>{
- const setDataMark = `${SET_DATA} \u5F00\u59CB\u65F6\u95F4\u6233 ${Date.now()}`;
- perf.start(setDataMark);
- const data = /* @__PURE__ */ Object.create(null);
- const resetPaths = new Set(initRender ? [
- "root.cn.[0]",
- "root.cn[0]"
- ] : []);
- while(this.updatePayloads.length > 0){
- const { path , value } = this.updatePayloads.shift();
- if (path.endsWith("cn")) {
- resetPaths.add(path);
- }
- data[path] = value;
- }
- for(const path1 in data){
- resetPaths.forEach((p)=>{
- if (path1.includes(p) && path1 !== p) {
- delete data[path1];
- }
- });
- const value1 = data[path1];
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value1)) {
- data[path1] = value1();
- }
- }
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(prerender)) return prerender(data);
- this.pendingUpdate = false;
- let normalUpdate = {};
- const customWrapperMap = /* @__PURE__ */ new Map();
- if (initRender) {
- normalUpdate = data;
- } else {
- for(const p in data){
- const dataPathArr = p.split(".");
- const found = findCustomWrapper(this, dataPathArr);
- if (found) {
- const { customWrapper , splitedPath } = found;
- customWrapperMap.set(customWrapper, Object.assign(Object.assign({}, customWrapperMap.get(customWrapper) || {}), {
- [`i.${splitedPath}`]: data[p]
- }));
- } else {
- normalUpdate[p] = data[p];
- }
- }
- }
- const customWrapperCount = customWrapperMap.size;
- const isNeedNormalUpdate = Object.keys(normalUpdate).length > 0;
- const updateArrLen = customWrapperCount + (isNeedNormalUpdate ? 1 : 0);
- let executeTime = 0;
- const cb = ()=>{
- if (++executeTime === updateArrLen) {
- perf.stop(setDataMark);
- this.flushUpdateCallback();
- initRender && perf.stop(PAGE_INIT);
- }
- };
- if (customWrapperCount) {
- customWrapperMap.forEach((data2, ctx2)=>{
- if (options.debug) {
- console.log("custom wrapper setData: ", data2);
- }
- ctx2.setData(data2, cb);
- });
- }
- if (isNeedNormalUpdate) {
- if (options.debug) {
- console.log("page setData:", normalUpdate);
- }
- ctx.setData(normalUpdate, cb);
- }
- }, 0);
- }
- enqueueUpdateCallback(cb, ctx) {
- this.updateCallbacks.push(()=>{
- ctx ? cb.call(ctx) : cb();
- });
- }
- flushUpdateCallback() {
- const updateCallbacks = this.updateCallbacks;
- if (!updateCallbacks.length) return;
- const copies = updateCallbacks.slice(0);
- this.updateCallbacks.length = 0;
- for(let i = 0; i < copies.length; i++){
- copies[i]();
- }
- }
- constructor(){
- super();
- this.updatePayloads = [];
- this.updateCallbacks = [];
- this.pendingUpdate = false;
- this.ctx = null;
- this.nodeName = ROOT_STR;
- this.tagName = ROOT_STR.toUpperCase();
- }
- };
- TaroText = class extends TaroNode {
- set textContent(text) {
- MutationObserver.record({
- target: this,
- type: "characterData",
- oldValue: this._value
- });
- this._value = text;
- this.enqueueUpdate({
- path: `${this._path}.${"v"}`,
- value: text
- });
- }
- get textContent() {
- return this._value;
- }
- set nodeValue(text) {
- this.textContent = text;
- }
- get nodeValue() {
- return this._value;
- }
- set data(text) {
- this.textContent = text;
- }
- get data() {
- return this._value;
- }
- constructor(value){
- super();
- this.nodeType = 3;
- this.nodeName = "#text";
- this._value = value;
- }
- };
- findReg = /[!'()~]|%20|%00/g;
- plusReg = /\+/g;
- replaceCharMap = {
- "!": "%21",
- "'": "%27",
- "(": "%28",
- ")": "%29",
- "~": "%7E",
- "%20": "+",
- "%00": "\0"
- };
- URLSearchParams = class {
- append(name, value) {
- appendTo(__classPrivateFieldGet(this, _URLSearchParams_dict, "f"), name, value);
- }
- delete(name) {
- delete __classPrivateFieldGet(this, _URLSearchParams_dict, "f")[name];
- }
- get(name) {
- const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
- return name in dict ? dict[name][0] : null;
- }
- getAll(name) {
- const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
- return name in dict ? dict[name].slice(0) : [];
- }
- has(name) {
- return name in __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
- }
- keys() {
- return Object.keys(__classPrivateFieldGet(this, _URLSearchParams_dict, "f"));
- }
- set(name, value) {
- __classPrivateFieldGet(this, _URLSearchParams_dict, "f")[name] = [
- "" + value
- ];
- }
- forEach(callback, thisArg) {
- const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
- Object.getOwnPropertyNames(dict).forEach(function(name) {
- dict[name].forEach(function(value) {
- callback.call(thisArg, value, name, this);
- }, this);
- }, this);
- }
- toJSON() {
- return {};
- }
- toString() {
- const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
- const query = [];
- for(const key in dict){
- const name = encode(key);
- for(let i = 0, value = dict[key]; i < value.length; i++){
- query.push(name + "=" + encode(value[i]));
- }
- }
- return query.join("&");
- }
- constructor(query){
- _URLSearchParams_dict.set(this, /* @__PURE__ */ Object.create(null));
- query !== null && query !== void 0 ? query : query = "";
- const dict = __classPrivateFieldGet(this, _URLSearchParams_dict, "f");
- if (typeof query === "string") {
- if (query.charAt(0) === "?") {
- query = query.slice(1);
- }
- for(let pairs = query.split("&"), i = 0, length = pairs.length; i < length; i++){
- const value = pairs[i];
- const index = value.indexOf("=");
- if (index > -1) {
- appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));
- } else if (value.length) {
- appendTo(dict, decode(value), "");
- }
- }
- } else {
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(query)) {
- for(let i1 = 0, length1 = query.length; i1 < length1; i1++){
- const value1 = query[i1];
- appendTo(dict, value1[0], value1[1]);
- }
- } else if (query.forEach) {
- query.forEach(addEach, dict);
- } else {
- for(const key in query){
- appendTo(dict, key, query[key]);
- }
- }
- }
- }
- };
- _URLSearchParams_dict = /* @__PURE__ */ new WeakMap();
- URL = class {
- static createObjectURL() {
- throw new Error("Oops, not support URL.createObjectURL() in miniprogram.");
- }
- static revokeObjectURL() {
- throw new Error("Oops, not support URL.revokeObjectURL() in miniprogram.");
- }
- get protocol() {
- return __classPrivateFieldGet(this, _URL_protocol, "f");
- }
- set protocol(val) {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) && __classPrivateFieldSet(this, _URL_protocol, val.trim(), "f");
- }
- get host() {
- return this.hostname + (this.port ? ":" + this.port : "");
- }
- set host(val) {
- if (val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
- val = val.trim();
- const { hostname , port } = parseUrl(`//${val}`);
- this.hostname = hostname;
- this.port = port;
- }
- }
- get hostname() {
- return __classPrivateFieldGet(this, _URL_hostname, "f");
- }
- set hostname(val) {
- val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) && __classPrivateFieldSet(this, _URL_hostname, val.trim(), "f");
- }
- get port() {
- return __classPrivateFieldGet(this, _URL_port, "f");
- }
- set port(val) {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) && __classPrivateFieldSet(this, _URL_port, val.trim(), "f");
- }
- get pathname() {
- return __classPrivateFieldGet(this, _URL_pathname, "f");
- }
- set pathname(val) {
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
- val = val.trim();
- const HEAD_REG = /^(\/|\.\/|\.\.\/)/;
- let temp = val;
- while(HEAD_REG.test(temp)){
- temp = temp.replace(HEAD_REG, "");
- }
- if (temp) __classPrivateFieldSet(this, _URL_pathname, "/" + temp, "f");
- else __classPrivateFieldSet(this, _URL_pathname, "/", "f");
- }
- }
- get search() {
- const val = __classPrivateFieldGet(this, _URL_search, "f").toString();
- return val.length === 0 || val.startsWith("?") ? val : `?${val}`;
- }
- set search(val) {
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
- val = val.trim();
- __classPrivateFieldSet(this, _URL_search, new URLSearchParams(val), "f");
- }
- }
- get hash() {
- return __classPrivateFieldGet(this, _URL_hash, "f");
- }
- set hash(val) {
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
- val = val.trim();
- if (val) __classPrivateFieldSet(this, _URL_hash, val.startsWith("#") ? val : `#${val}`, "f");
- else __classPrivateFieldSet(this, _URL_hash, "", "f");
- }
- }
- get href() {
- return `${this.protocol}//${this.host}${this.pathname}${this.search}${this.hash}`;
- }
- set href(val) {
- if (val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
- val = val.trim();
- const { protocol , hostname , port , hash , search , pathname } = parseUrl(val);
- this.protocol = protocol;
- this.hostname = hostname;
- this.pathname = pathname;
- this.port = port;
- this.hash = hash;
- this.search = search;
- }
- }
- get origin() {
- return `${this.protocol}//${this.host}`;
- }
- set origin(val) {
- if (val && (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) {
- val = val.trim();
- const { protocol , hostname , port } = parseUrl(val);
- this.protocol = protocol;
- this.hostname = hostname;
- this.port = port;
- }
- }
- get searchParams() {
- return __classPrivateFieldGet(this, _URL_search, "f");
- }
- toString() {
- return this.href;
- }
- toJSON() {
- return this.toString();
- }
- _toRaw() {
- return {
- protocol: this.protocol,
- port: this.port,
- host: this.host,
- hostname: this.hostname,
- pathname: this.pathname,
- hash: this.hash,
- search: this.search,
- origin: this.origin,
- href: this.href
- };
- }
- constructor(url, base){
- _URL_hash.set(this, "");
- _URL_hostname.set(this, "");
- _URL_pathname.set(this, "");
- _URL_port.set(this, "");
- _URL_protocol.set(this, "");
- _URL_search.set(this, void 0);
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) url = String(url);
- const parseResult = parseUrlBase(url, base);
- const { hash , hostname , pathname , port , protocol , search } = parseResult;
- __classPrivateFieldSet(this, _URL_hash, hash, "f");
- __classPrivateFieldSet(this, _URL_hostname, hostname, "f");
- __classPrivateFieldSet(this, _URL_pathname, pathname || "/", "f");
- __classPrivateFieldSet(this, _URL_port, port, "f");
- __classPrivateFieldSet(this, _URL_protocol, protocol, "f");
- __classPrivateFieldSet(this, _URL_search, new URLSearchParams(search), "f");
- }
- };
- _URL_hash = /* @__PURE__ */ new WeakMap(), _URL_hostname = /* @__PURE__ */ new WeakMap(), _URL_pathname = /* @__PURE__ */ new WeakMap(), _URL_port = /* @__PURE__ */ new WeakMap(), _URL_protocol = /* @__PURE__ */ new WeakMap(), _URL_search = /* @__PURE__ */ new WeakMap();
- AnchorElement = class extends TaroElement {
- get href() {
- var _a;
- return (_a = this.props["href"]) !== null && _a !== void 0 ? _a : "";
- }
- set href(val) {
- this.setAttribute("href", val);
- }
- get protocol() {
- var _a;
- return (_a = this.props["protocol"]) !== null && _a !== void 0 ? _a : "";
- }
- get host() {
- var _a;
- return (_a = this.props["host"]) !== null && _a !== void 0 ? _a : "";
- }
- get search() {
- var _a;
- return (_a = this.props["search"]) !== null && _a !== void 0 ? _a : "";
- }
- get hash() {
- var _a;
- return (_a = this.props["hash"]) !== null && _a !== void 0 ? _a : "";
- }
- get hostname() {
- var _a;
- return (_a = this.props["hostname"]) !== null && _a !== void 0 ? _a : "";
- }
- get port() {
- var _a;
- return (_a = this.props["port"]) !== null && _a !== void 0 ? _a : "";
- }
- get pathname() {
- var _a;
- return (_a = this.props["pathname"]) !== null && _a !== void 0 ? _a : "";
- }
- setAttribute(qualifiedName, value) {
- if (qualifiedName === "href") {
- const willSetAttr = parseUrl(value);
- for(const k in willSetAttr){
- super.setAttribute(k, willSetAttr[k]);
- }
- } else {
- super.setAttribute(qualifiedName, value);
- }
- }
- };
- TaroDocument = class extends TaroElement {
- createElement(type) {
- const nodeName = type.toLowerCase();
- let element;
- switch(true){
- case nodeName === ROOT_STR:
- element = new TaroRootElement();
- return element;
- case _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.controlledComponent.has(nodeName):
- element = new FormElement();
- break;
- case nodeName === A:
- element = new AnchorElement();
- break;
- default:
- element = new TaroElement();
- break;
- }
- element.nodeName = nodeName;
- element.tagName = type.toUpperCase();
- return element;
- }
- createElementNS(_svgNS, type) {
- return this.createElement(type);
- }
- createTextNode(text) {
- return new TaroText(text);
- }
- getElementById(id) {
- const el = eventSource.get(id);
- return (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(el) ? null : el;
- }
- querySelector(query) {
- if (/^#/.test(query)) {
- return this.getElementById(query.slice(1));
- }
- return null;
- }
- querySelectorAll() {
- return [];
- }
- createComment() {
- const textnode = new TaroText("");
- textnode.nodeName = COMMENT;
- return textnode;
- }
- get defaultView() {
- return env.window;
- }
- constructor(){
- super();
- this.createEvent = createEvent;
- this.nodeType = 9;
- this.nodeName = DOCUMENT_ELEMENT_NAME;
- }
- };
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
- let createDocument = function() {
- const doc = new TaroDocument();
- const documentCreateElement = doc.createElement.bind(doc);
- const html = documentCreateElement(HTML);
- const head = documentCreateElement(HEAD);
- const body = documentCreateElement(BODY);
- const app = documentCreateElement(APP);
- app.id = APP;
- const container = documentCreateElement(CONTAINER);
- doc.appendChild(html);
- html.appendChild(head);
- html.appendChild(body);
- body.appendChild(container);
- container.appendChild(app);
- doc.documentElement = html;
- doc.head = head;
- doc.body = body;
- return doc;
- };
- document$1 = env.document = createDocument();
- } else {
- document$1 = env.document;
- }
- eventCenter = _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.hooks.call("getEventCenter", _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events);
- RuntimeCache = class {
- has(identifier) {
- return this.cache.has(identifier);
- }
- set(identifier, ctx) {
- if (identifier && ctx) {
- this.cache.set(identifier, ctx);
- }
- }
- get(identifier) {
- if (this.has(identifier)) return this.cache.get(identifier);
- }
- delete(identifier) {
- this.cache.delete(identifier);
- }
- constructor(name){
- this.cache = /* @__PURE__ */ new Map();
- this.name = name;
- }
- };
- cache$1 = new RuntimeCache("history");
- History = class extends _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events {
- get length() {
- return __classPrivateFieldGet(this, _History_stack, "f").length;
- }
- get state() {
- return __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")].state;
- }
- go(delta) {
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(delta) || isNaN(delta)) return;
- let targetIdx = __classPrivateFieldGet(this, _History_cur, "f") + delta;
- targetIdx = Math.min(Math.max(targetIdx, 0), this.length - 1);
- __classPrivateFieldSet(this, _History_cur, targetIdx, "f");
- __classPrivateFieldGet(this, _History_location, "f").trigger("__set_href_without_history__", __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")].url);
- __classPrivateFieldGet(this, _History_window, "f").trigger("popstate", __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")]);
- }
- back() {
- this.go(-1);
- }
- forward() {
- this.go(1);
- }
- pushState(state, title, url) {
- if (!url || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) return;
- __classPrivateFieldSet(this, _History_stack, __classPrivateFieldGet(this, _History_stack, "f").slice(0, __classPrivateFieldGet(this, _History_cur, "f") + 1), "f");
- __classPrivateFieldGet(this, _History_stack, "f").push({
- state,
- title,
- url
- });
- __classPrivateFieldSet(this, _History_cur, this.length - 1, "f");
- __classPrivateFieldGet(this, _History_location, "f").trigger("__set_href_without_history__", url);
- }
- replaceState(state, title, url) {
- if (!url || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(url)) return;
- __classPrivateFieldGet(this, _History_stack, "f")[__classPrivateFieldGet(this, _History_cur, "f")] = {
- state,
- title,
- url
- };
- __classPrivateFieldGet(this, _History_location, "f").trigger("__set_href_without_history__", url);
- }
- get cache() {
- return cache$1;
- }
- constructor(location2, options2){
- super();
- _History_instances.add(this);
- _History_location.set(this, void 0);
- _History_stack.set(this, []);
- _History_cur.set(this, 0);
- _History_window.set(this, void 0);
- __classPrivateFieldSet(this, _History_window, options2.window, "f");
- __classPrivateFieldSet(this, _History_location, location2, "f");
- __classPrivateFieldGet(this, _History_location, "f").on("__record_history__", (href)=>{
- var _a;
- __classPrivateFieldSet(this, _History_cur, (_a = __classPrivateFieldGet(this, _History_cur, "f"), _a++, _a), "f");
- __classPrivateFieldSet(this, _History_stack, __classPrivateFieldGet(this, _History_stack, "f").slice(0, __classPrivateFieldGet(this, _History_cur, "f")), "f");
- __classPrivateFieldGet(this, _History_stack, "f").push({
- state: null,
- title: "",
- url: href
- });
- }, null);
- __classPrivateFieldGet(this, _History_location, "f").on("__reset_history__", (href)=>{
- __classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this, href);
- }, null);
- this.on(CONTEXT_ACTIONS.INIT, ()=>{
- __classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this);
- }, null);
- this.on(CONTEXT_ACTIONS.RESTORE, (pageId2)=>{
- cache$1.set(pageId2, {
- location: __classPrivateFieldGet(this, _History_location, "f"),
- stack: __classPrivateFieldGet(this, _History_stack, "f").slice(),
- cur: __classPrivateFieldGet(this, _History_cur, "f")
- });
- }, null);
- this.on(CONTEXT_ACTIONS.RECOVER, (pageId2)=>{
- if (cache$1.has(pageId2)) {
- const ctx = cache$1.get(pageId2);
- __classPrivateFieldSet(this, _History_location, ctx.location, "f");
- __classPrivateFieldSet(this, _History_stack, ctx.stack, "f");
- __classPrivateFieldSet(this, _History_cur, ctx.cur, "f");
- }
- }, null);
- this.on(CONTEXT_ACTIONS.DESTORY, (pageId2)=>{
- cache$1.delete(pageId2);
- }, null);
- __classPrivateFieldGet(this, _History_instances, "m", _History_reset).call(this);
- }
- };
- _History_location = /* @__PURE__ */ new WeakMap(), _History_stack = /* @__PURE__ */ new WeakMap(), _History_cur = /* @__PURE__ */ new WeakMap(), _History_window = /* @__PURE__ */ new WeakMap(), _History_instances = /* @__PURE__ */ new WeakSet(), _History_reset = function _History_reset2(href = "") {
- __classPrivateFieldSet(this, _History_stack, [
- {
- state: null,
- title: "",
- url: href || __classPrivateFieldGet(this, _History_location, "f").href
- }
- ], "f");
- __classPrivateFieldSet(this, _History_cur, 0, "f");
- };
- Current = {
- app: null,
- router: null,
- page: null
- };
- getCurrentInstance = ()=>Current;
- INIT_URL = "https://taro.com";
- cache = new RuntimeCache("location");
- Location = class extends _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events {
- get protocol() {
- return __classPrivateFieldGet(this, _Location_url, "f").protocol;
- }
- set protocol(val) {
- const REG = /^(http|https):$/i;
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) || !REG.test(val.trim())) return;
- val = val.trim();
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").protocol = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get host() {
- return __classPrivateFieldGet(this, _Location_url, "f").host;
- }
- set host(val) {
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
- val = val.trim();
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").host = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get hostname() {
- return __classPrivateFieldGet(this, _Location_url, "f").hostname;
- }
- set hostname(val) {
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
- val = val.trim();
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").hostname = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get port() {
- return __classPrivateFieldGet(this, _Location_url, "f").port;
- }
- set port(val) {
- const xVal = Number(val = val.trim());
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(xVal) || xVal <= 0) return;
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").port = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get pathname() {
- return __classPrivateFieldGet(this, _Location_url, "f").pathname;
- }
- set pathname(val) {
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
- val = val.trim();
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").pathname = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get search() {
- return __classPrivateFieldGet(this, _Location_url, "f").search;
- }
- set search(val) {
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
- val = val.trim();
- val = val.startsWith("?") ? val : `?${val}`;
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").search = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get hash() {
- return __classPrivateFieldGet(this, _Location_url, "f").hash;
- }
- set hash(val) {
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val)) return;
- val = val.trim();
- val = val.startsWith("#") ? val : `#${val}`;
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").hash = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get href() {
- return __classPrivateFieldGet(this, _Location_url, "f").href;
- }
- set href(val) {
- const REG = /^(http:|https:)?\/\/.+/;
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) || !REG.test(val = val.trim())) return;
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").href = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- get origin() {
- return __classPrivateFieldGet(this, _Location_url, "f").origin;
- }
- set origin(val) {
- const REG = /^(http:|https:)?\/\/.+/;
- if (!val || !(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(val) || !REG.test(val = val.trim())) return;
- const preValue = __classPrivateFieldGet(this, _Location_instances, "m", _Location_getPreValue).call(this);
- __classPrivateFieldGet(this, _Location_url, "f").origin = val;
- if (__classPrivateFieldGet(this, _Location_instances, "m", _Location_checkUrlChange).call(this, preValue)) __classPrivateFieldGet(this, _Location_instances, "m", _Location_recordHistory).call(this);
- }
- assign() {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(true, "\u5C0F\u7A0B\u5E8F\u73AF\u5883\u4E2D\u8C03\u7528location.assign()\u65E0\u6548.");
- }
- reload() {
- (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.warn)(true, "\u5C0F\u7A0B\u5E8F\u73AF\u5883\u4E2D\u8C03\u7528location.reload()\u65E0\u6548.");
- }
- replace(url) {
- this.trigger("__set_href_without_history__", url);
- }
- toString() {
- return this.href;
- }
- get cache() {
- return cache;
- }
- constructor(options2){
- super();
- _Location_instances.add(this);
- _Location_url.set(this, new URL(INIT_URL));
- _Location_noCheckUrl.set(this, false);
- _Location_window.set(this, void 0);
- __classPrivateFieldSet(this, _Location_window, options2.window, "f");
- __classPrivateFieldGet(this, _Location_instances, "m", _Location_reset).call(this);
- this.on("__set_href_without_history__", (href)=>{
- __classPrivateFieldSet(this, _Location_noCheckUrl, true, "f");
- const lastHash = __classPrivateFieldGet(this, _Location_url, "f").hash;
- __classPrivateFieldGet(this, _Location_url, "f").href = generateFullUrl(href);
- if (lastHash !== __classPrivateFieldGet(this, _Location_url, "f").hash) {
- __classPrivateFieldGet(this, _Location_window, "f").trigger("hashchange");
- }
- __classPrivateFieldSet(this, _Location_noCheckUrl, false, "f");
- }, null);
- this.on(CONTEXT_ACTIONS.INIT, ()=>{
- __classPrivateFieldGet(this, _Location_instances, "m", _Location_reset).call(this);
- }, null);
- this.on(CONTEXT_ACTIONS.RESTORE, (pageId2)=>{
- cache.set(pageId2, {
- lastHref: this.href
- });
- }, null);
- this.on(CONTEXT_ACTIONS.RECOVER, (pageId2)=>{
- if (cache.has(pageId2)) {
- const ctx = cache.get(pageId2);
- __classPrivateFieldSet(this, _Location_noCheckUrl, true, "f");
- __classPrivateFieldGet(this, _Location_url, "f").href = ctx.lastHref;
- __classPrivateFieldSet(this, _Location_noCheckUrl, false, "f");
- }
- }, null);
- this.on(CONTEXT_ACTIONS.DESTORY, (pageId2)=>{
- cache.delete(pageId2);
- }, null);
- }
- };
- _Location_url = /* @__PURE__ */ new WeakMap(), _Location_noCheckUrl = /* @__PURE__ */ new WeakMap(), _Location_window = /* @__PURE__ */ new WeakMap(), _Location_instances = /* @__PURE__ */ new WeakSet(), _Location_reset = function _Location_reset2() {
- const Current2 = getCurrentInstance();
- const router = Current2.router;
- if (router) {
- const { path , params } = router;
- const searchArr = Object.keys(params).map((key)=>{
- return `${key}=${params[key]}`;
- });
- const searchStr = searchArr.length > 0 ? "?" + searchArr.join("&") : "";
- const url = `${INIT_URL}${path.startsWith("/") ? path : "/" + path}${searchStr}`;
- __classPrivateFieldSet(this, _Location_url, new URL(url), "f");
- this.trigger("__reset_history__", this.href);
- }
- }, _Location_getPreValue = function _Location_getPreValue2() {
- return __classPrivateFieldGet(this, _Location_url, "f")._toRaw();
- }, _Location_rollBack = function _Location_rollBack2(href) {
- __classPrivateFieldGet(this, _Location_url, "f").href = href;
- }, _Location_recordHistory = function _Location_recordHistory2() {
- this.trigger("__record_history__", this.href);
- }, _Location_checkUrlChange = function _Location_checkUrlChange2(preValue) {
- if (__classPrivateFieldGet(this, _Location_noCheckUrl, "f")) {
- return false;
- }
- const { protocol , hostname , port , pathname , search , hash } = __classPrivateFieldGet(this, _Location_url, "f")._toRaw();
- if (protocol !== preValue.protocol || hostname !== preValue.hostname || port !== preValue.port) {
- __classPrivateFieldGet(this, _Location_instances, "m", _Location_rollBack).call(this, preValue.href);
- return false;
- }
- if (pathname !== preValue.pathname) {
- return true;
- }
- if (search !== preValue.search) {
- return true;
- }
- if (hash !== preValue.hash) {
- __classPrivateFieldGet(this, _Location_window, "f").trigger("hashchange");
- return true;
- }
- __classPrivateFieldGet(this, _Location_instances, "m", _Location_rollBack).call(this, preValue.href);
- return false;
- };
- machine = "Macintosh";
- arch = "Intel Mac OS X 10_14_5";
- engine = "AppleWebKit/534.36 (KHTML, like Gecko) NodeJS/v4.1.0 Chrome/76.0.3809.132 Safari/534.36";
- msg = "(" + machine + "; " + arch + ") " + engine;
- nav = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)() ? env.window.navigator : {
- appCodeName: "Mozilla",
- appName: "Netscape",
- appVersion: "5.0 " + msg,
- cookieEnabled: true,
- mimeTypes: [],
- onLine: true,
- platform: "MacIntel",
- plugins: [],
- product: "Taro",
- productSub: "20030107",
- userAgent: "Mozilla/5.0 " + msg,
- vendor: "Joyent",
- vendorSub: ""
- };
- (function() {
- let loadTime;
- if (typeof performance !== "undefined" && performance !== null && performance.now) {
- now = ()=>performance.now();
- } else if (Date.now) {
- loadTime = Date.now();
- now = ()=>Date.now() - loadTime;
- } else {
- loadTime = new Date().getTime();
- now = ()=>new Date().getTime() - loadTime;
- }
- })();
- lastTime = 0;
- _raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame !== null ? requestAnimationFrame : function(callback) {
- const _now = now();
- const nextTime = Math.max(lastTime + 16, _now);
- return setTimeout(function() {
- callback(lastTime = nextTime);
- }, nextTime - _now);
- };
- _caf = typeof cancelAnimationFrame !== "undefined" && cancelAnimationFrame !== null ? cancelAnimationFrame : function(seed) {
- clearTimeout(seed);
- };
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
- class Window extends _chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.Events {
- initEvent() {
- const _location = this.location;
- const _history = this.history;
- this.on(CONTEXT_ACTIONS.INIT, (pageId2)=>{
- _location.trigger(CONTEXT_ACTIONS.INIT, pageId2);
- }, null);
- this.on(CONTEXT_ACTIONS.RECOVER, (pageId2)=>{
- _location.trigger(CONTEXT_ACTIONS.RECOVER, pageId2);
- _history.trigger(CONTEXT_ACTIONS.RECOVER, pageId2);
- }, null);
- this.on(CONTEXT_ACTIONS.RESTORE, (pageId2)=>{
- _location.trigger(CONTEXT_ACTIONS.RESTORE, pageId2);
- _history.trigger(CONTEXT_ACTIONS.RESTORE, pageId2);
- }, null);
- this.on(CONTEXT_ACTIONS.DESTORY, (pageId2)=>{
- _location.trigger(CONTEXT_ACTIONS.DESTORY, pageId2);
- _history.trigger(CONTEXT_ACTIONS.DESTORY, pageId2);
- }, null);
- }
- get document() {
- return env.document;
- }
- addEventListener(event, callback) {
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(event)) return;
- this.on(event, callback, null);
- }
- removeEventListener(event, callback) {
- if (!(0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isString)(event)) return;
- this.off(event, callback, null);
- }
- setTimeout(...args) {
- return setTimeout(...args);
- }
- clearTimeout(...args) {
- return clearTimeout(...args);
- }
- constructor(){
- super();
- this.navigator = nav;
- this.requestAnimationFrame = _raf;
- this.cancelAnimationFrame = _caf;
- this.getComputedStyle = getComputedStyle;
- const globalProperties = [
- ...Object.getOwnPropertyNames(__webpack_require__.g || {}),
- ...Object.getOwnPropertySymbols(__webpack_require__.g || {})
- ];
- globalProperties.forEach((property)=>{
- if (property === "atob" || property === "document") return;
- if (!Object.prototype.hasOwnProperty.call(this, property)) {
- try {
- this[property] = __webpack_require__.g[property];
- } catch (e) {
- if (true) {
- console.warn(`[Taro warn] window.${String(property)} \u5728\u8D4B\u503C\u5230 window \u65F6\u62A5\u9519`);
- }
- }
- }
- });
- this.Date || (this.Date = Date);
- this.location = new Location({
- window: this
- });
- this.history = new History(this.location, {
- window: this
- });
- this.initEvent();
- }
- }
- window$1 = env.window = new Window();
- } else {
- window$1 = env.window;
- }
- location = window$1.location;
- history = window$1.history;
- SVGElement = class extends TaroElement {
- };
- instances = /* @__PURE__ */ new Map();
- pageId = incrementId();
- isWeb = (0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)();
- TIMEOUT = 100;
- nextTick = (cb, ctx)=>{
- const beginTime = Date.now();
- const router = Current.router;
- const timerFunc = ()=>{
- setTimeout(function() {
- ctx ? cb.call(ctx) : cb();
- }, 1);
- };
- if (router === null) return timerFunc();
- const path = router.$taroPath;
- function next() {
- var _a, _b, _c;
- const pageElement = env.document.getElementById(path);
- if (pageElement === null || pageElement === void 0 ? void 0 : pageElement.pendingUpdate) {
- if ((0,_chunk_77KB62LY_js__WEBPACK_IMPORTED_MODULE_0__.isWebPlatform)()) {
- (_c = (_b = (_a = pageElement.firstChild) === null || _a === void 0 ? void 0 : _a["componentOnReady"]) === null || _b === void 0 ? void 0 : _b.call(_a).then(()=>{
- timerFunc();
- })) !== null && _c !== void 0 ? _c : timerFunc();
- } else {
- pageElement.enqueueUpdateCallback(cb, ctx);
- }
- } else if (Date.now() - beginTime > TIMEOUT) {
- timerFunc();
- } else {
- setTimeout(()=>next(), 20);
- }
- }
- next();
- };
- }
- });
- /***/ })
- }]);
|