@mptool/all 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.mts CHANGED
@@ -35,7 +35,7 @@ declare const savePhoto: (imgPath: string) => Promise<void>;
35
35
  * @param path 下载路径
36
36
  * @param mask 遮罩层
37
37
  */
38
- declare const downLoad: (url: string, mask?: boolean) => Promise<string>;
38
+ declare const download: (url: string, mask?: boolean) => Promise<string>;
39
39
 
40
40
  /** 网络状态汇报 */
41
41
  declare const reportNetworkStatus: () => void;
@@ -1884,4 +1884,4 @@ declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, tra
1884
1884
 
1885
1885
  declare const getText: (content: string | AnyNode[]) => string;
1886
1886
 
1887
- export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, downLoad, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1887
+ export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, download, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
package/lib/index.d.ts CHANGED
@@ -35,7 +35,7 @@ declare const savePhoto: (imgPath: string) => Promise<void>;
35
35
  * @param path 下载路径
36
36
  * @param mask 遮罩层
37
37
  */
38
- declare const downLoad: (url: string, mask?: boolean) => Promise<string>;
38
+ declare const download: (url: string, mask?: boolean) => Promise<string>;
39
39
 
40
40
  /** 网络状态汇报 */
41
41
  declare const reportNetworkStatus: () => void;
@@ -1884,4 +1884,4 @@ declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, tra
1884
1884
 
1885
1885
  declare const getText: (content: string | AnyNode[]) => string;
1886
1886
 
1887
- export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, downLoad, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1887
+ export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, download, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
package/lib/index.js CHANGED
@@ -9,5 +9,5 @@ Options:
9
9
  fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
10
10
  )`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},Pi={};function dl(t,e){return t===w.falseFunc?w.falseFunc:n=>e.isTag(n)&&t(n)}function Di(t,e){const n=e.getSiblings(t);if(n.length<=1)return[];const r=n.indexOf(t);return r<0||r===n.length-1?[]:n.slice(r+1).filter(e.isTag)}function vn(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}const Sn=(t,e,n,r,i)=>{const s=i(e,vn(n),r);return s===w.trueFunc?t:s===w.falseFunc?w.falseFunc:o=>s(o)&&t(o)},An={is:Sn,matches:Sn,where:Sn,not(t,e,n,r,i){const s=i(e,vn(n),r);return s===w.falseFunc?t:s===w.trueFunc?w.falseFunc:o=>!s(o)&&t(o)},has(t,e,n,r,i){const{adapter:s}=n,o=vn(n);o.relativeSelector=!0;const c=e.some(h=>h.some(yn))?[Pi]:void 0,a=i(e,o,c);if(a===w.falseFunc)return w.falseFunc;const l=dl(a,s);if(c&&a!==w.trueFunc){const{shouldTestNextSiblings:h=!1}=a;return d=>{if(!t(d))return!1;c[0]=d;const f=s.getChildren(d),g=h?[...f,...Di(d,s)]:f;return s.existsOne(l,g)}}return h=>t(h)&&s.existsOne(l,s.getChildren(h))}};function fl(t,e,n,r,i){var s;const{name:o,data:c}=e;if(Array.isArray(c)){if(!(o in An))throw new Error(`Unknown pseudo-class :${o}(${c})`);return An[o](t,c,n,r,i)}const a=(s=n.pseudos)===null||s===void 0?void 0:s[o],l=typeof a=="string"?a:ul[o];if(typeof l=="string"){if(c!=null)throw new Error(`Pseudo ${o} doesn't have any arguments`);const h=Ae(l);return An.is(t,h,n,r,i)}if(typeof a=="function")return Oi(a,o,c,1),h=>a(h,c)&&t(h);if(o in wn)return wn[o](t,c,n,r);if(o in qi){const h=qi[o];return Oi(h,o,c,2),d=>h(d,n,c)&&t(d)}throw new Error(`Unknown pseudo-class :${o}`)}function $n(t,e){const n=e.getParent(t);return n&&e.isTag(n)?n:null}function pl(t,e,n,r,i){const{adapter:s,equals:o}=n;switch(e.type){case m.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case m.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case m.Attribute:{if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!n.xmlMode||n.lowerCaseAttributeNames)&&(e.name=e.name.toLowerCase()),ol[e.action](t,e,n)}case m.Pseudo:return fl(t,e,n,r,i);case m.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:c}=e;return(!n.xmlMode||n.lowerCaseTags)&&(c=c.toLowerCase()),function(a){return s.getName(a)===c&&t(a)}}case m.Descendant:{if(n.cacheResults===!1||typeof WeakSet=="undefined")return function(a){let l=a;for(;l=$n(l,s);)if(t(l))return!0;return!1};const c=new WeakSet;return function(a){let l=a;for(;l=$n(l,s);)if(!c.has(l)){if(s.isTag(l)&&t(l))return!0;c.add(l)}return!1}}case"_flexibleDescendant":return function(c){let a=c;do if(t(a))return!0;while(a=$n(a,s));return!1};case m.Parent:return function(c){return s.getChildren(c).some(a=>s.isTag(a)&&t(a))};case m.Child:return function(c){const a=s.getParent(c);return a!=null&&s.isTag(a)&&t(a)};case m.Sibling:return function(c){const a=s.getSiblings(c);for(let l=0;l<a.length;l++){const h=a[l];if(o(c,h))break;if(s.isTag(h)&&t(h))return!0}return!1};case m.Adjacent:return s.prevElementSibling?function(c){const a=s.prevElementSibling(c);return a!=null&&t(a)}:function(c){const a=s.getSiblings(c);let l;for(let h=0;h<a.length;h++){const d=a[h];if(o(c,d))break;s.isTag(d)&&(l=d)}return!!l&&t(l)};case m.Universal:{if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return t}}}function _i(t){return t.type===m.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some(e=>e.some(_i)))}const gl={type:m.Descendant},ml={type:"_flexibleDescendant"},bl={type:m.Pseudo,name:"scope",data:null};function yl(t,{adapter:e},n){const r=!!(n!=null&&n.every(i=>{const s=e.isTag(i)&&e.getParent(i);return i===Pi||s&&e.isTag(s)}));for(const i of t){if(!(i.length>0&&yn(i[0])&&i[0].type!==m.Descendant))if(r&&!i.some(_i))i.unshift(gl);else continue;i.unshift(bl)}}function Li(t,e,n){var r;t.forEach(rl),n=(r=e.context)!==null&&r!==void 0?r:n;const i=Array.isArray(n),s=n&&(Array.isArray(n)?n:[n]);if(e.relativeSelector!==!1)yl(t,e,s);else if(t.some(a=>a.length>0&&yn(a[0])))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let o=!1;const c=t.map(a=>{if(a.length>=2){const[l,h]=a;l.type!==m.Pseudo||l.name!=="scope"||(i&&h.type===m.Descendant?a[1]=ml:(h.type===m.Adjacent||h.type===m.Sibling)&&(o=!0))}return wl(a,e,s)}).reduce(xl,w.falseFunc);return c.shouldTestNextSiblings=o,c}function wl(t,e,n){var r;return t.reduce((i,s)=>i===w.falseFunc?w.falseFunc:pl(i,s,e,n,Li),(r=e.rootFunc)!==null&&r!==void 0?r:w.trueFunc)}function xl(t,e){return e===w.falseFunc||t===w.trueFunc?t:t===w.falseFunc||e===w.trueFunc?e:function(n){return t(n)||e(n)}}const ji=(t,e)=>t===e,vl={adapter:xe,equals:ji};function Sl(t){var e,n,r,i;const s=t!=null?t:vl;return(e=s.adapter)!==null&&e!==void 0||(s.adapter=xe),(n=s.equals)!==null&&n!==void 0||(s.equals=(i=(r=s.adapter)===null||r===void 0?void 0:r.equals)!==null&&i!==void 0?i:ji),s}function Al(t){return function(e,n,r){const i=Sl(n);return t(e,i,r)}}const Cn=Al(Li);function Mi(t,e,n=!1){return n&&(t=$l(t,e)),Array.isArray(t)?e.removeSubsets(t):e.getChildren(t)}function $l(t,e){const n=Array.isArray(t)?t.slice(0):[t],r=n.length;for(let i=0;i<r;i++){const s=Di(n[i],e);n.push(...s)}return n}const Cl=new Set(["first","last","eq","gt","nth","lt","even","odd"]);function ke(t){return t.type!=="pseudo"?!1:Cl.has(t.name)?!0:t.name==="not"&&Array.isArray(t.data)?t.data.some(e=>e.some(ke)):!1}function El(t,e,n){const r=e!=null?parseInt(e,10):NaN;switch(t){case"first":return 1;case"nth":case"eq":return isFinite(r)?r>=0?r+1:1/0:0;case"lt":return isFinite(r)?r>=0?Math.min(r,n):1/0:0;case"gt":return isFinite(r)?1/0:0;case"odd":return 2*n;case"even":return 2*n-1;case"last":case"not":return 1/0}}function kl(t){for(;t.parent;)t=t.parent;return t}function En(t){const e=[],n=[];for(const r of t)r.some(ke)?e.push(r):n.push(r);return[n,e]}const Tl={type:m.Universal,namespace:null},Il={type:m.Pseudo,name:"scope",data:null};function Bi(t,e,n={}){return Fi([t],e,n)}function Fi(t,e,n={}){if(typeof e=="function")return t.some(e);const[r,i]=En(Ae(e));return r.length>0&&t.some(Cn(r,n))||i.some(s=>Vi(s,t,n).length>0)}function Nl(t,e,n,r){const i=typeof n=="string"?parseInt(n,10):NaN;switch(t){case"first":case"lt":return e;case"last":return e.length>0?[e[e.length-1]]:e;case"nth":case"eq":return isFinite(i)&&Math.abs(i)<e.length?[i<0?e[e.length+i]:e[i]]:[];case"gt":return isFinite(i)?e.slice(i+1):[];case"even":return e.filter((s,o)=>o%2===0);case"odd":return e.filter((s,o)=>o%2===1);case"not":{const s=new Set(Ri(n,e,r));return e.filter(o=>!s.has(o))}}}function Ui(t,e,n={}){return Ri(Ae(t),e,n)}function Ri(t,e,n){if(e.length===0)return[];const[r,i]=En(t);let s;if(r.length){const o=Tn(e,r,n);if(i.length===0)return o;o.length&&(s=new Set(o))}for(let o=0;o<i.length&&(s==null?void 0:s.size)!==e.length;o++){const c=i[o];if((s?e.filter(l=>y(l)&&!s.has(l)):e).length===0)break;const a=Vi(c,e,n);if(a.length)if(s)a.forEach(l=>s.add(l));else{if(o===i.length-1)return a;s=new Set(a)}}return typeof s!="undefined"?s.size===e.length?e:e.filter(o=>s.has(o)):[]}function Vi(t,e,n){var r;if(t.some(Mt)){const i=(r=n.root)!==null&&r!==void 0?r:kl(e[0]),s=mt(_({},n),{context:e,relativeSelector:!1});return t.push(Il),Te(i,t,s,!0,e.length)}return Te(e,t,n,!1,e.length)}function ql(t,e,n={},r=1/0){if(typeof t=="function")return Hi(e,t);const[i,s]=En(Ae(t)),o=s.map(c=>Te(e,c,n,!0,r));return i.length&&o.push(kn(e,i,n,r)),o.length===0?[]:o.length===1?o[0]:wt(o.reduce((c,a)=>[...c,...a]))}function Te(t,e,n,r,i){const s=e.findIndex(ke),o=e.slice(0,s),c=e[s],a=e.length-1===s?i:1/0,l=El(c.name,c.data,a);if(l===0)return[];const h=(o.length===0&&!Array.isArray(t)?me(t).filter(y):o.length===0?(Array.isArray(t)?t:[t]).filter(y):r||o.some(Mt)?kn(t,[o],n,l):Tn(t,[o],n)).slice(0,l);let d=Nl(c.name,h,c.data,n);if(d.length===0||e.length===s+1)return d;const f=e.slice(s+1),g=f.some(Mt);if(g){if(Mt(f[0])){const{type:p}=f[0];(p===m.Sibling||p===m.Adjacent)&&(d=Mi(d,xe,!0)),f.unshift(Tl)}n=mt(_({},n),{relativeSelector:!1,rootFunc:p=>d.includes(p)})}else n.rootFunc&&n.rootFunc!==$e.trueFunc&&(n=mt(_({},n),{rootFunc:$e.trueFunc}));return f.some(ke)?Te(d,f,n,!1,i):g?kn(d,[f],n,i):Tn(d,[f],n)}function kn(t,e,n,r){const i=Cn(e,n,t);return Hi(t,i,r)}function Hi(t,e,n=1/0){const r=Mi(t,xe,e.shouldTestNextSiblings);return un(i=>y(i)&&e(i),r,!0,n)}function Tn(t,e,n){const r=(Array.isArray(t)?t:[t]).filter(y);if(r.length===0)return r;const i=Cn(e,n);return i===$e.trueFunc?r:r.filter(i)}const Ol=/^\s*[+~]/;function Pl(t){if(!t)return this._make([]);if(typeof t!="string"){const e=W(t)?t.toArray():[t],n=this.toArray();return this._make(e.filter(r=>n.some(i=>gi(i,r))))}return this._findBySelector(t,Number.POSITIVE_INFINITY)}function Dl(t,e){var n;const r=this.toArray(),i=Ol.test(t)?r:this.children().toArray(),s={context:r,root:(n=this._root)===null||n===void 0?void 0:n[0],xmlMode:this.options.xmlMode,lowerCaseTags:this.options.lowerCaseTags,lowerCaseAttributeNames:this.options.lowerCaseAttributeNames,pseudos:this.options.pseudos,quirksMode:this.options.quirksMode};return this._make(ql(t,i,s,e))}function In(t){return function(e,...n){return function(r){var i;let s=t(e,this);return r&&(s=On(s,r,this.options.xmlMode,(i=this._root)===null||i===void 0?void 0:i[0])),this._make(this.length>1&&s.length>1?n.reduce((o,c)=>c(o),s):s)}}}const Ft=In((t,e)=>{let n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);i.length>0&&(n=n.concat(i))}return n}),Nn=In((t,e)=>{const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);i!==null&&n.push(i)}return n});function qn(t,...e){let n=null;const r=In((i,s)=>{const o=[];return A(s,c=>{for(let a;(a=i(c))&&!(n!=null&&n(a,o.length));c=a)o.push(a)}),o})(t,...e);return function(i,s){n=typeof i=="string"?c=>Bi(c,i,this.options):i?Ut(i):null;const o=r.call(this,s);return n=null,o}}function vt(t){return t.length>1?Array.from(new Set(t)):t}const _l=Nn(({parent:t})=>t&&!it(t)?t:null,vt),Ll=Ft(t=>{const e=[];for(;t.parent&&!it(t.parent);)e.push(t.parent),t=t.parent;return e},wt,t=>t.reverse()),jl=qn(({parent:t})=>t&&!it(t)?t:null,wt,t=>t.reverse());function Ml(t){var e;const n=[];if(!t)return this._make(n);const r={xmlMode:this.options.xmlMode,root:(e=this._root)===null||e===void 0?void 0:e[0]},i=typeof t=="string"?s=>Bi(s,t,r):Ut(t);return A(this,s=>{for(s&&!it(s)&&!y(s)&&(s=s.parent);s&&y(s);){if(i(s,0)){n.includes(s)||n.push(s);break}s=s.parent}}),this._make(n)}const Bl=Nn(t=>ln(t)),Fl=Ft(t=>{const e=[];for(;t.next;)t=t.next,y(t)&&e.push(t);return e},vt),Ul=qn(t=>ln(t),vt),Rl=Nn(t=>hn(t)),Vl=Ft(t=>{const e=[];for(;t.prev;)t=t.prev,y(t)&&e.push(t);return e},vt),Hl=qn(t=>hn(t),vt),Gl=Ft(t=>ci(t).filter(e=>y(e)&&e!==t),wt),zl=Ft(t=>me(t).filter(y),vt);function Wl(){const t=this.toArray().reduce((e,n)=>E(n)?e.concat(n.children):e,[]);return this._make(t)}function Ql(t){let e=0;const n=this.length;for(;e<n&&t.call(this[e],e,this[e])!==!1;)++e;return this}function Zl(t){let e=[];for(let n=0;n<this.length;n++){const r=this[n],i=t.call(r,n,r);i!=null&&(e=e.concat(i))}return this._make(e)}function Ut(t){return typeof t=="function"?(e,n)=>t.call(e,n,e):W(t)?e=>Array.prototype.includes.call(t,e):function(e){return t===e}}function Jl(t){var e;return this._make(On(this.toArray(),t,this.options.xmlMode,(e=this._root)===null||e===void 0?void 0:e[0]))}function On(t,e,n,r){return typeof e=="string"?Ui(e,t,{xmlMode:n,root:r}):t.filter(Ut(e))}function Yl(t){const e=this.toArray();return typeof t=="string"?Fi(e.filter(y),t,this.options):t?e.some(Ut(t)):!1}function Xl(t){let e=this.toArray();if(typeof t=="string"){const n=new Set(Ui(t,e,this.options));e=e.filter(r=>!n.has(r))}else{const n=Ut(t);e=e.filter((r,i)=>!n(r,i))}return this._make(e)}function Kl(t){return this.filter(typeof t=="string"?`:has(${t})`:(e,n)=>this._make(n).find(t).length>0)}function th(){return this.length>1?this._make(this[0]):this}function eh(){return this.length>0?this._make(this[this.length-1]):this}function nh(t){var e;return t=+t,t===0&&this.length<=1?this:(t<0&&(t=this.length+t),this._make((e=this[t])!==null&&e!==void 0?e:[]))}function rh(t){return t==null?this.toArray():this[t<0?this.length+t:t]}function ih(){return Array.prototype.slice.call(this)}function sh(t){let e,n;return t==null?(e=this.parent().children(),n=this[0]):typeof t=="string"?(e=this._make(t),n=this[0]):(e=this,n=W(t)?t[0]:t),Array.prototype.indexOf.call(e,n)}function oh(t,e){return this._make(Array.prototype.slice.call(this,t,e))}function ah(){var t;return(t=this.prevObject)!==null&&t!==void 0?t:this._make([])}function ch(t,e){const n=this._make(t,e),r=wt([...this.get(),...n.get()]);return this._make(r)}function lh(t){return this.prevObject?this.add(t?this.prevObject.filter(t):this.prevObject):this}var hh=Object.freeze({__proto__:null,_findBySelector:Dl,add:ch,addBack:lh,children:zl,closest:Ml,contents:Wl,each:Ql,end:ah,eq:nh,filter:Jl,filterArray:On,find:Pl,first:th,get:rh,has:Kl,index:sh,is:Yl,last:eh,map:Zl,next:Bl,nextAll:Fl,nextUntil:Ul,not:Xl,parent:_l,parents:Ll,parentsUntil:jl,prev:Rl,prevAll:Vl,prevUntil:Hl,siblings:Gl,slice:oh,toArray:ih});function uh(t){return function(e,n,r,i){if(typeof Buffer!="undefined"&&Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")return t(e,n,r,i);const s=e;if(!Array.isArray(s)&&it(s))return s;const o=new Pt([]);return ct(s,o),o}}function ct(t,e){const n=Array.isArray(t)?t:[t];e?e.children=n:e=null;for(let r=0;r<n.length;r++){const i=n[r];i.parent&&i.parent.children!==n&&st(i),e?(i.prev=n[r-1]||null,i.next=n[r+1]||null):i.prev=i.next=null,i.parent=e}return e}function dh(t,e){if(t==null)return[];if(typeof t=="string")return this._parse(t,this.options,!1,null).children.slice(0);if("length"in t){if(t.length===1)return this._makeDomArray(t[0],e);const n=[];for(let r=0;r<t.length;r++){const i=t[r];if(typeof i=="object"){if(i==null)continue;if(!("length"in i)){n.push(e?Dt(i,!0):i);continue}}n.push(...this._makeDomArray(i,e))}return n}return[e?Dt(t,!0):t]}function Gi(t){return function(...e){const n=this.length-1;return A(this,(r,i)=>{if(!E(r))return;const s=typeof e[0]=="function"?e[0].call(r,i,this._render(r.children)):e,o=this._makeDomArray(s,i<n);t(o,r.children,r)})}}function K(t,e,n,r,i){var s,o;const c=[e,n,...r],a=e===0?null:t[e-1],l=e+n>=t.length?null:t[e+n];for(let h=0;h<r.length;++h){const d=r[h],f=d.parent;if(f){const g=f.children.indexOf(d);g>-1&&(f.children.splice(g,1),i===f&&e>g&&c[0]--)}d.parent=i,d.prev&&(d.prev.next=(s=d.next)!==null&&s!==void 0?s:null),d.next&&(d.next.prev=(o=d.prev)!==null&&o!==void 0?o:null),d.prev=h===0?a:r[h-1],d.next=h===r.length-1?l:r[h+1]}return a&&(a.next=r[0]),l&&(l.prev=r[r.length-1]),t.splice(...c)}function fh(t){return(W(t)?t:this._make(t)).append(this),this}function ph(t){return(W(t)?t:this._make(t)).prepend(this),this}const gh=Gi((t,e,n)=>{K(e,e.length,0,t,n)}),mh=Gi((t,e,n)=>{K(e,0,0,t,n)});function zi(t){return function(e){const n=this.length-1,r=this.parents().last();for(let i=0;i<this.length;i++){const s=this[i],o=typeof e=="function"?e.call(s,i,s):typeof e=="string"&&!fn(e)?r.find(e).clone():e,[c]=this._makeDomArray(o,i<n);if(!c||!E(c))continue;let a=c,l=0;for(;l<a.children.length;){const h=a.children[l];y(h)?(a=h,l=0):l++}t(s,a,[c])}return this}}const bh=zi((t,e,n)=>{const{parent:r}=t;if(!r)return;const i=r.children,s=i.indexOf(t);ct([t],e),K(i,s,0,n,r)}),yh=zi((t,e,n)=>{E(t)&&(ct(t.children,e),ct(n,t))});function wh(t){return this.parent(t).not("body").each((e,n)=>{this._make(n).replaceWith(n.children)}),this}function xh(t){const e=this[0];if(e){const n=this._make(typeof t=="function"?t.call(e,0,e):t).insertBefore(e);let r;for(let s=0;s<n.length;s++)n[s].type==="tag"&&(r=n[s]);let i=0;for(;r&&i<r.children.length;){const s=r.children[i];s.type==="tag"?(r=s,i=0):i++}r&&this._make(r).append(this)}return this}function vh(...t){const e=this.length-1;return A(this,(n,r)=>{if(!E(n)||!n.parent)return;const i=n.parent.children,s=i.indexOf(n);if(s<0)return;const o=typeof t[0]=="function"?t[0].call(n,r,this._render(n.children)):t,c=this._makeDomArray(o,r<e);K(i,s+1,0,c,n.parent)})}function Sh(t){typeof t=="string"&&(t=this._make(t)),this.remove();const e=[];for(const n of this._makeDomArray(t)){const r=this.clone().toArray(),{parent:i}=n;if(!i)continue;const s=i.children,o=s.indexOf(n);o<0||(K(s,o+1,0,r,i),e.push(...r))}return this._make(e)}function Ah(...t){const e=this.length-1;return A(this,(n,r)=>{if(!E(n)||!n.parent)return;const i=n.parent.children,s=i.indexOf(n);if(s<0)return;const o=typeof t[0]=="function"?t[0].call(n,r,this._render(n.children)):t,c=this._makeDomArray(o,r<e);K(i,s,0,c,n.parent)})}function $h(t){const e=this._make(t);this.remove();const n=[];return A(e,r=>{const i=this.clone().toArray(),{parent:s}=r;if(!s)return;const o=s.children,c=o.indexOf(r);c<0||(K(o,c,0,i,s),n.push(...i))}),this._make(n)}function Ch(t){const e=t?this.filter(t):this;return A(e,n=>{st(n),n.prev=n.next=n.parent=null}),this}function Eh(t){return A(this,(e,n)=>{const{parent:r}=e;if(!r)return;const i=r.children,s=typeof t=="function"?t.call(e,n,e):t,o=this._makeDomArray(s);ct(o,null);const c=i.indexOf(e);K(i,c,1,o,r),o.includes(e)||(e.parent=e.prev=e.next=null)})}function kh(){return A(this,t=>{if(E(t)){for(const e of t.children)e.next=e.prev=e.parent=null;t.children.length=0}})}function Th(t){if(t===void 0){const e=this[0];return!e||!E(e)?null:this._render(e.children)}return A(this,e=>{if(!E(e))return;for(const r of e.children)r.next=r.prev=r.parent=null;const n=W(t)?t.toArray():this._parse(`${t}`,this.options,!1,e).children;ct(n,e)})}function Ih(){return this._render(this)}function Nh(t){return t===void 0?_t(this):typeof t=="function"?A(this,(e,n)=>this._make(e).text(t.call(e,n,_t([e])))):A(this,e=>{if(!E(e))return;for(const r of e.children)r.next=r.prev=r.parent=null;const n=new ue(`${t}`);ct(n,e)})}function qh(){const t=Array.prototype.map.call(this.get(),n=>Dt(n,!0)),e=new Pt(t);for(const n of t)n.parent=e;return this._make(t)}var Oh=Object.freeze({__proto__:null,_makeDomArray:dh,after:vh,append:gh,appendTo:fh,before:Ah,clone:qh,empty:kh,html:Th,insertAfter:Sh,insertBefore:$h,prepend:mh,prependTo:ph,remove:Ch,replaceWith:Eh,text:Nh,toString:Ih,unwrap:wh,wrap:bh,wrapAll:xh,wrapInner:yh});function Ph(t,e){if(t!=null&&e!=null||typeof t=="object"&&!Array.isArray(t))return A(this,(n,r)=>{y(n)&&Wi(n,t,e,r)});if(this.length!==0)return Qi(this[0],t)}function Wi(t,e,n,r){if(typeof e=="string"){const i=Qi(t),s=typeof n=="function"?n.call(t,r,i[e]):n;s===""?delete i[e]:s!=null&&(i[e]=s),t.attribs.style=Dh(i)}else if(typeof e=="object"){const i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s];Wi(t,o,e[o],s)}}}function Qi(t,e){if(!t||!y(t))return;const n=_h(t.attribs.style);if(typeof e=="string")return n[e];if(Array.isArray(e)){const r={};for(const i of e)n[i]!=null&&(r[i]=n[i]);return r}return n}function Dh(t){return Object.keys(t).reduce((e,n)=>`${e}${e?" ":""}${n}: ${t[n]};`,"")}function _h(t){if(t=(t||"").trim(),!t)return{};const e={};let n;for(const r of t.split(";")){const i=r.indexOf(":");if(i<1||i===r.length-1){const s=r.trimEnd();s.length>0&&n!==void 0&&(e[n]+=`;${s}`)}else n=r.slice(0,i).trim(),e[n]=r.slice(i+1).trim()}return e}var Lh=Object.freeze({__proto__:null,css:Ph});const Zi="input,select,textarea,keygen",jh=/%20/g,Ji=/\r?\n/g;function Mh(){return this.serializeArray().map(t=>`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`).join("&").replace(jh,"+")}function Bh(){return this.map((t,e)=>{const n=this._make(e);return y(e)&&e.name==="form"?n.find(Zi).toArray():n.filter(Zi).toArray()}).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((t,e)=>{var n;const r=this._make(e),i=r.attr("name"),s=(n=r.val())!==null&&n!==void 0?n:"";return Array.isArray(s)?s.map(o=>({name:i,value:o.replace(Ji,`\r
11
11
  `)})):{name:i,value:s.replace(Ji,`\r
12
- `)}}).toArray()}var Fh=Object.freeze({__proto__:null,serialize:Mh,serializeArray:Bh});function Uh(t){var e;return typeof t=="string"?{selector:t,value:"textContent"}:{selector:t.selector,value:(e=t.value)!==null&&e!==void 0?e:"textContent"}}function Rh(t){const e={};for(const n in t){const r=t[n],i=Array.isArray(r),{selector:s,value:o}=Uh(i?r[0]:r),c=typeof o=="function"?o:typeof o=="string"?a=>this._make(a).prop(o):a=>this._make(a).extract(o);if(i)e[n]=this._findBySelector(s,Number.POSITIVE_INFINITY).map((a,l)=>c(l,n,e)).get();else{const a=this._findBySelector(s,1);e[n]=a.length>0?c(a[0],n,e):void 0}}return e}var Vh=Object.freeze({__proto__:null,extract:Rh});class Rt{constructor(e,n,r){if(this.length=0,this.options=r,this._root=n,e){for(let i=0;i<e.length;i++)this[i]=e[i];this.length=e.length}}}Rt.prototype.cheerio="[cheerio object]",Rt.prototype.splice=Array.prototype.splice,Rt.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(Rt.prototype,Zc,hh,Oh,Lh,Fh,Vh);function Hh(t,e){return function n(r,i,s=!0){if(r==null)throw new Error("cheerio.load() expects a string");const o=tn(i),c=t(r,o,s,null);class a extends Rt{_make(d,f){const g=l(d,f);return g.prevObject=this,g}_parse(d,f,g,p){return t(d,f,g,p)}_render(d){return e(d,this.options)}}function l(h,d,f=c,g){if(h&&W(h))return h;const p=tn(g,o),S=typeof f=="string"?[t(f,p,!1,null)]:"length"in f?f:[f],$=W(S)?S:new a(S,null,p);if($._root=$,!h)return new a(void 0,$,p);const lt=typeof h=="string"&&fn(h)?t(h,p,!1,null).children:Gh(h)?[h]:Array.isArray(h)?h:void 0,ht=new a(lt,$,p);if(lt)return ht;if(typeof h!="string")throw new TypeError("Unexpected type of selector");let At=h;const $t=d?typeof d=="string"?fn(d)?new a([t(d,p,!1,null)],$,p):(At=`${d} ${At}`,$):W(d)?d:new a(Array.isArray(d)?d:[d],$,p):$;return $t?$t.find(At):ht}return Object.assign(l,jc,{load:n,_root:c,_options:o,fn:a.prototype,prototype:a.prototype}),l}}function Gh(t){return!!t.name||t.type==="root"||t.type==="text"||t.type==="comment"}var b;(function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"})(b||(b={}));var u;(function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"})(u||(u={}));function Q(t){return t===b.Space||t===b.NewLine||t===b.Tab||t===b.FormFeed||t===b.CarriageReturn}function Ie(t){return t===b.Slash||t===b.Gt||Q(t)}function zh(t){return t>=b.LowerA&&t<=b.LowerZ||t>=b.UpperA&&t<=b.UpperZ}var V;(function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"})(V||(V={}));const N={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Wh{constructor({xmlMode:e=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=u.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new ti(e?Kr:Xr,(i,s)=>this.emitCodePoint(i,s))}reset(){this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=u.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===b.Lt||!this.decodeEntities&&this.fastForwardTo(b.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=u.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Ie(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=u.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===b.Gt||Q(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===N.TitleEnd?this.decodeEntities&&e===b.Amp&&this.startEntity():this.fastForwardTo(b.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(e===b.Lt)}stateCDATASequence(e){e===N.Cdata[this.sequenceIndex]?++this.sequenceIndex===N.Cdata.length&&(this.state=u.InCommentLike,this.currentSequence=N.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=u.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=u.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Ie(e):zh(e)}startSpecial(e,n){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=n,this.state=u.SpecialStartSequence}stateBeforeTagName(e){if(e===b.ExclamationMark)this.state=u.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===b.Questionmark)this.state=u.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const n=e|32;this.sectionStart=this.index,this.xmlMode?this.state=u.InTagName:n===N.ScriptEnd[2]?this.state=u.BeforeSpecialS:n===N.TitleEnd[2]?this.state=u.BeforeSpecialT:this.state=u.InTagName}else e===b.Slash?this.state=u.BeforeClosingTagName:(this.state=u.Text,this.stateText(e))}stateInTagName(e){Ie(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Q(e)||(e===b.Gt?this.state=u.Text:(this.state=this.isTagStartChar(e)?u.InClosingTagName:u.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===b.Gt||Q(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===b.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=u.InSpecialTag,this.sequenceIndex=0):this.state=u.Text,this.sectionStart=this.index+1):e===b.Slash?this.state=u.InSelfClosingTag:Q(e)||(this.state=u.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===b.Gt?(this.cbs.onselfclosingtag(this.index),this.state=u.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Q(e)||(this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===b.Eq||Ie(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=u.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===b.Eq?this.state=u.BeforeAttributeValue:e===b.Slash||e===b.Gt?(this.cbs.onattribend(V.NoValue,this.sectionStart),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):Q(e)||(this.cbs.onattribend(V.NoValue,this.sectionStart),this.state=u.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===b.DoubleQuote?(this.state=u.InAttributeValueDq,this.sectionStart=this.index+1):e===b.SingleQuote?(this.state=u.InAttributeValueSq,this.sectionStart=this.index+1):Q(e)||(this.sectionStart=this.index,this.state=u.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,n){e===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===b.DoubleQuote?V.Double:V.Single,this.index+1),this.state=u.BeforeAttributeName):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,b.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,b.SingleQuote)}stateInAttributeValueNoQuotes(e){Q(e)||e===b.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(V.Unquoted,this.index),this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===b.OpeningSquareBracket?(this.state=u.CDATASequence,this.sequenceIndex=0):this.state=e===b.Dash?u.BeforeComment:u.InDeclaration}stateInDeclaration(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===b.Dash?(this.state=u.InCommentLike,this.currentSequence=N.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=u.InDeclaration}stateInSpecialComment(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const n=e|32;n===N.ScriptEnd[3]?this.startSpecial(N.ScriptEnd,4):n===N.StyleEnd[3]?this.startSpecial(N.StyleEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){const n=e|32;n===N.TitleEnd[3]?this.startSpecial(N.TitleEnd,4):n===N.TextareaEnd[3]?this.startSpecial(N.TextareaEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}startEntity(){this.baseState=this.state,this.state=u.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?R.Strict:this.baseState===u.Text||this.baseState===u.InSpecialTag?R.Legacy:R.Attribute)}stateInEntity(){const e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,e===0&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===u.Text||this.state===u.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===u.InAttributeValueDq||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case u.Text:{this.stateText(e);break}case u.SpecialStartSequence:{this.stateSpecialStartSequence(e);break}case u.InSpecialTag:{this.stateInSpecialTag(e);break}case u.CDATASequence:{this.stateCDATASequence(e);break}case u.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(e);break}case u.InAttributeName:{this.stateInAttributeName(e);break}case u.InCommentLike:{this.stateInCommentLike(e);break}case u.InSpecialComment:{this.stateInSpecialComment(e);break}case u.BeforeAttributeName:{this.stateBeforeAttributeName(e);break}case u.InTagName:{this.stateInTagName(e);break}case u.InClosingTagName:{this.stateInClosingTagName(e);break}case u.BeforeTagName:{this.stateBeforeTagName(e);break}case u.AfterAttributeName:{this.stateAfterAttributeName(e);break}case u.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(e);break}case u.BeforeAttributeValue:{this.stateBeforeAttributeValue(e);break}case u.BeforeClosingTagName:{this.stateBeforeClosingTagName(e);break}case u.AfterClosingTagName:{this.stateAfterClosingTagName(e);break}case u.BeforeSpecialS:{this.stateBeforeSpecialS(e);break}case u.BeforeSpecialT:{this.stateBeforeSpecialT(e);break}case u.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(e);break}case u.InSelfClosingTag:{this.stateInSelfClosingTag(e);break}case u.InDeclaration:{this.stateInDeclaration(e);break}case u.BeforeDeclaration:{this.stateBeforeDeclaration(e);break}case u.BeforeComment:{this.stateBeforeComment(e);break}case u.InProcessingInstruction:{this.stateInProcessingInstruction(e);break}case u.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===u.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===u.InCommentLike?this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===u.InTagName||this.state===u.BeforeAttributeName||this.state===u.BeforeAttributeValue||this.state===u.AfterAttributeName||this.state===u.InAttributeName||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueDq||this.state===u.InAttributeValueNq||this.state===u.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){this.baseState!==u.Text&&this.baseState!==u.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const St=new Set(["input","option","optgroup","select","button","datalist","textarea"]),v=new Set(["p"]),Yi=new Set(["thead","tbody"]),Xi=new Set(["dd","dt"]),Ki=new Set(["rt","rp"]),Qh=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",v],["h1",v],["h2",v],["h3",v],["h4",v],["h5",v],["h6",v],["select",St],["input",St],["output",St],["button",St],["datalist",St],["textarea",St],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Xi],["dt",Xi],["address",v],["article",v],["aside",v],["blockquote",v],["details",v],["div",v],["dl",v],["fieldset",v],["figcaption",v],["figure",v],["footer",v],["form",v],["header",v],["hr",v],["main",v],["nav",v],["ol",v],["pre",v],["section",v],["table",v],["ul",v],["rt",Ki],["rp",Ki],["tbody",Yi],["tfoot",Yi]]),Zh=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ts=new Set(["math","svg"]),es=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),Jh=/\s|\//;class Yh{constructor(e,n={}){var r,i,s,o,c,a;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e!=null?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(i=n.lowerCaseAttributeNames)!==null&&i!==void 0?i:this.htmlMode,this.recognizeSelfClosing=(s=n.recognizeSelfClosing)!==null&&s!==void 0?s:!this.htmlMode,this.tokenizer=new((o=n.Tokenizer)!==null&&o!==void 0?o:Wh)(this.options,this),this.foreignContext=[!this.htmlMode],(a=(c=this.cbs).onparserinit)===null||a===void 0||a.call(c,this)}ontext(e,n){var r,i;const s=this.getSlice(e,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,s),this.startIndex=n}ontextentity(e,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,an(e)),this.startIndex=n}isVoidElement(e){return this.htmlMode&&Zh.has(e)}onopentagname(e,n){this.endIndex=n;let r=this.getSlice(e,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(e){var n,r,i,s;this.openTagStart=this.startIndex,this.tagname=e;const o=this.htmlMode&&Qh.get(e);if(o)for(;this.stack.length>0&&o.has(this.stack[0]);){const c=this.stack.shift();(r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,c,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(ts.has(e)?this.foreignContext.unshift(!0):es.has(e)&&this.foreignContext.unshift(!1))),(s=(i=this.cbs).onopentagname)===null||s===void 0||s.call(i,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var n,r;this.startIndex=this.openTagStart,this.attribs&&((r=(n=this.cbs).onopentag)===null||r===void 0||r.call(n,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,n){var r,i,s,o,c,a,l,h;this.endIndex=n;let d=this.getSlice(e,n);if(this.lowerCaseTagNames&&(d=d.toLowerCase()),this.htmlMode&&(ts.has(d)||es.has(d))&&this.foreignContext.shift(),this.isVoidElement(d))this.htmlMode&&d==="br"&&((o=(s=this.cbs).onopentagname)===null||o===void 0||o.call(s,"br"),(a=(c=this.cbs).onopentag)===null||a===void 0||a.call(c,"br",{},!0),(h=(l=this.cbs).onclosetag)===null||h===void 0||h.call(l,"br",!1));else{const f=this.stack.indexOf(d);if(f!==-1)for(let g=0;g<=f;g++){const p=this.stack.shift();(i=(r=this.cbs).onclosetag)===null||i===void 0||i.call(r,p,g!==f)}else this.htmlMode&&d==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var n,r;const i=this.tagname;this.endOpenTag(e),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!e),this.stack.shift())}onattribname(e,n){this.startIndex=e;const r=this.getSlice(e,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(e,n){this.attribvalue+=this.getSlice(e,n)}onattribentity(e){this.attribvalue+=an(e)}onattribend(e,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,e===V.Double?'"':e===V.Single?"'":e===V.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const n=e.search(Jh);let r=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(e,n,r){var i,s,o,c;this.endIndex=n,(s=(i=this.cbs).oncomment)===null||s===void 0||s.call(i,this.getSlice(e,n-r)),(c=(o=this.cbs).oncommentend)===null||c===void 0||c.call(o),this.startIndex=n+1}oncdata(e,n,r){var i,s,o,c,a,l,h,d,f,g;this.endIndex=n;const p=this.getSlice(e,n-r);!this.htmlMode||this.options.recognizeCDATA?((s=(i=this.cbs).oncdatastart)===null||s===void 0||s.call(i),(c=(o=this.cbs).ontext)===null||c===void 0||c.call(o,p),(l=(a=this.cbs).oncdataend)===null||l===void 0||l.call(a)):((d=(h=this.cbs).oncomment)===null||d===void 0||d.call(h,`[CDATA[${p}]]`),(g=(f=this.cbs).oncommentend)===null||g===void 0||g.call(f)),this.startIndex=n+1}onend(){var e,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let r=0;r<this.stack.length;r++)this.cbs.onclosetag(this.stack[r],!0)}(n=(e=this.cbs).onend)===null||n===void 0||n.call(e)}reset(){var e,n,r,i;(n=(e=this.cbs).onreset)===null||n===void 0||n.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(i=(r=this.cbs).onparserinit)===null||i===void 0||i.call(r,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,n){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(e-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".write() after done!"));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}function Xh(t,e){const n=new La(void 0,e);return new Yh(n,e).end(t),n.root}const Kh=Hh(uh(Xh),fe),tu=Kh(""),Pn=t=>{var e;return(e=tu.parseHTML(t))!=null?e:[]};var eu=Object.defineProperty,ns=Object.getOwnPropertySymbols,nu=Object.prototype.hasOwnProperty,ru=Object.prototype.propertyIsEnumerable,rs=(t,e,n)=>e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,is=(t,e)=>{for(var n in e||(e={}))nu.call(e,n)&&rs(t,n,e[n]);if(ns)for(var n of ns(e))ru.call(e,n)&&rs(t,n,e[n]);return t},ss=(t,e,n)=>new Promise((r,i)=>{var s=a=>{try{c(n.next(a))}catch(l){i(l)}},o=a=>{try{c(n.throw(a))}catch(l){i(l)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(s,o);c((n=n.apply(t,e)).next())});const os=t=>{const e=t.filter(i=>!!i),n=e[0];n&&n.type==="text"&&!n.text.trim()&&e.shift();const r=e[e.length-1];return r&&r.type==="text"&&!r.text.trim()&&e.pop(),e},as=(t,e)=>ss(void 0,[t,e],function*(n,{appendClass:r,transform:i}){if(n.type==="text")return{type:"text",text:n.data.replace(/\r/g,"")};if(n.type==="tag"){const s=Gr.find(([o])=>n.name===o);if(s){const o=Object.fromEntries(n.attributes.filter(({name:h})=>{var d;return["class","style"].includes(h)||((d=s[1])==null?void 0:d.includes(h))}).map(({name:h,value:d})=>[h,d])),c=os(yield Promise.all(n.children.map(h=>as(h,{appendClass:r,transform:i}))));r&&(o.class=o.class?`${o.class} ${n.name}`:n.name);const a=is(is({type:"node",name:n.name},Object.keys(o).length?{attrs:o}:{}),c.length?{children:c}:{}),l=i[n.name];return yield l?l(a):a}}return null}),iu=(t,...e)=>ss(void 0,[t,...e],function*(n,{appendClass:r=!0,transform:i={}}={}){return os(yield Promise.all((Array.isArray(n)?n:Pn(n)).map(s=>as(s,{appendClass:r,transform:i}))))}),cs=t=>(typeof t=="string"?Pn(t)||[]:t).map(e=>e.type==="text"?e.data:"childNodes"in e?cs(e.childNodes):"").join("");exports.$App=Js,exports.$Component=wo,exports.$Config=eo,exports.$Page=xo,exports.ALLOWED_TAGS=Gr,exports.Cookie=oe,exports.CookieStore=le,exports.Emitter=Qt,exports.Headers=Ye,exports.MpError=Ls,exports.Queue=Jn,exports.URLSearchParams=Vt,exports.addContact=Es,exports.check=zo,exports.checkAsync=Wo,exports.compareVersion=ks,exports.confirm=ys,exports.createRequest=ya,exports.decodeBase64=Ds,exports.dirname=ee,exports.downLoad=zt,exports.emitter=z,exports.encodeBase64=Ps,exports.exists=Ue,exports.funcQueue=zs,exports.get=Ro,exports.getAsync=Vo,exports.getCookieScopeDomain=se,exports.getCurrentPage=Rn,exports.getCurrentRoute=Ts,exports.getDomain=ie,exports.getRichTextNodes=iu,exports.getText=cs,exports.getUrlInfo=Ve,exports.getWindowInfo=xs,exports.isDir=Sr,exports.isFile=To,exports.isFunction=Zn,exports.isMp=Oe,exports.isQQ=qe,exports.isWx=Hn,exports.lock=Hs,exports.logger=Z,exports.ls=No,exports.mkdir=ne,exports.normalizeDomain=ft,exports.once=Gs,exports.openDocument=Is,exports.parseCookieHeader=Je,exports.parseHTML=Pn,exports.parseUrl=Cr,exports.put=Mo,exports.query=Wn,exports.readFile=qo,exports.readJSON=Oo,exports.remove=Ho,exports.removeAsync=Go,exports.reportNetworkStatus=Vn,exports.request=Rr,exports.requestCookieStore=Ke,exports.retry=ws,exports.rm=Io,exports.saveDocument=Ns,exports.saveFile=Po,exports.saveOnlineFile=Do,exports.savePhoto=qs,exports.set=Fo,exports.setAsync=Uo,exports.showModal=Ct,exports.showToast=P,exports.storage=re,exports.take=Bo,exports.type=Qn,exports.unzip=jo,exports.updateApp=Os,exports.wrapFunction=B,exports.writeClipboard=bs,exports.writeFile=_o,exports.writeJSON=Lo;
12
+ `)}}).toArray()}var Fh=Object.freeze({__proto__:null,serialize:Mh,serializeArray:Bh});function Uh(t){var e;return typeof t=="string"?{selector:t,value:"textContent"}:{selector:t.selector,value:(e=t.value)!==null&&e!==void 0?e:"textContent"}}function Rh(t){const e={};for(const n in t){const r=t[n],i=Array.isArray(r),{selector:s,value:o}=Uh(i?r[0]:r),c=typeof o=="function"?o:typeof o=="string"?a=>this._make(a).prop(o):a=>this._make(a).extract(o);if(i)e[n]=this._findBySelector(s,Number.POSITIVE_INFINITY).map((a,l)=>c(l,n,e)).get();else{const a=this._findBySelector(s,1);e[n]=a.length>0?c(a[0],n,e):void 0}}return e}var Vh=Object.freeze({__proto__:null,extract:Rh});class Rt{constructor(e,n,r){if(this.length=0,this.options=r,this._root=n,e){for(let i=0;i<e.length;i++)this[i]=e[i];this.length=e.length}}}Rt.prototype.cheerio="[cheerio object]",Rt.prototype.splice=Array.prototype.splice,Rt.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(Rt.prototype,Zc,hh,Oh,Lh,Fh,Vh);function Hh(t,e){return function n(r,i,s=!0){if(r==null)throw new Error("cheerio.load() expects a string");const o=tn(i),c=t(r,o,s,null);class a extends Rt{_make(d,f){const g=l(d,f);return g.prevObject=this,g}_parse(d,f,g,p){return t(d,f,g,p)}_render(d){return e(d,this.options)}}function l(h,d,f=c,g){if(h&&W(h))return h;const p=tn(g,o),S=typeof f=="string"?[t(f,p,!1,null)]:"length"in f?f:[f],$=W(S)?S:new a(S,null,p);if($._root=$,!h)return new a(void 0,$,p);const lt=typeof h=="string"&&fn(h)?t(h,p,!1,null).children:Gh(h)?[h]:Array.isArray(h)?h:void 0,ht=new a(lt,$,p);if(lt)return ht;if(typeof h!="string")throw new TypeError("Unexpected type of selector");let At=h;const $t=d?typeof d=="string"?fn(d)?new a([t(d,p,!1,null)],$,p):(At=`${d} ${At}`,$):W(d)?d:new a(Array.isArray(d)?d:[d],$,p):$;return $t?$t.find(At):ht}return Object.assign(l,jc,{load:n,_root:c,_options:o,fn:a.prototype,prototype:a.prototype}),l}}function Gh(t){return!!t.name||t.type==="root"||t.type==="text"||t.type==="comment"}var b;(function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"})(b||(b={}));var u;(function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"})(u||(u={}));function Q(t){return t===b.Space||t===b.NewLine||t===b.Tab||t===b.FormFeed||t===b.CarriageReturn}function Ie(t){return t===b.Slash||t===b.Gt||Q(t)}function zh(t){return t>=b.LowerA&&t<=b.LowerZ||t>=b.UpperA&&t<=b.UpperZ}var V;(function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"})(V||(V={}));const N={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Wh{constructor({xmlMode:e=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=u.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new ti(e?Kr:Xr,(i,s)=>this.emitCodePoint(i,s))}reset(){this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=u.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===b.Lt||!this.decodeEntities&&this.fastForwardTo(b.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=u.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Ie(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=u.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===b.Gt||Q(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===N.TitleEnd?this.decodeEntities&&e===b.Amp&&this.startEntity():this.fastForwardTo(b.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(e===b.Lt)}stateCDATASequence(e){e===N.Cdata[this.sequenceIndex]?++this.sequenceIndex===N.Cdata.length&&(this.state=u.InCommentLike,this.currentSequence=N.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=u.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=u.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Ie(e):zh(e)}startSpecial(e,n){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=n,this.state=u.SpecialStartSequence}stateBeforeTagName(e){if(e===b.ExclamationMark)this.state=u.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===b.Questionmark)this.state=u.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const n=e|32;this.sectionStart=this.index,this.xmlMode?this.state=u.InTagName:n===N.ScriptEnd[2]?this.state=u.BeforeSpecialS:n===N.TitleEnd[2]?this.state=u.BeforeSpecialT:this.state=u.InTagName}else e===b.Slash?this.state=u.BeforeClosingTagName:(this.state=u.Text,this.stateText(e))}stateInTagName(e){Ie(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Q(e)||(e===b.Gt?this.state=u.Text:(this.state=this.isTagStartChar(e)?u.InClosingTagName:u.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===b.Gt||Q(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===b.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=u.InSpecialTag,this.sequenceIndex=0):this.state=u.Text,this.sectionStart=this.index+1):e===b.Slash?this.state=u.InSelfClosingTag:Q(e)||(this.state=u.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===b.Gt?(this.cbs.onselfclosingtag(this.index),this.state=u.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Q(e)||(this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===b.Eq||Ie(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=u.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===b.Eq?this.state=u.BeforeAttributeValue:e===b.Slash||e===b.Gt?(this.cbs.onattribend(V.NoValue,this.sectionStart),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):Q(e)||(this.cbs.onattribend(V.NoValue,this.sectionStart),this.state=u.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===b.DoubleQuote?(this.state=u.InAttributeValueDq,this.sectionStart=this.index+1):e===b.SingleQuote?(this.state=u.InAttributeValueSq,this.sectionStart=this.index+1):Q(e)||(this.sectionStart=this.index,this.state=u.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,n){e===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===b.DoubleQuote?V.Double:V.Single,this.index+1),this.state=u.BeforeAttributeName):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,b.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,b.SingleQuote)}stateInAttributeValueNoQuotes(e){Q(e)||e===b.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(V.Unquoted,this.index),this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===b.OpeningSquareBracket?(this.state=u.CDATASequence,this.sequenceIndex=0):this.state=e===b.Dash?u.BeforeComment:u.InDeclaration}stateInDeclaration(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===b.Dash?(this.state=u.InCommentLike,this.currentSequence=N.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=u.InDeclaration}stateInSpecialComment(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const n=e|32;n===N.ScriptEnd[3]?this.startSpecial(N.ScriptEnd,4):n===N.StyleEnd[3]?this.startSpecial(N.StyleEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){const n=e|32;n===N.TitleEnd[3]?this.startSpecial(N.TitleEnd,4):n===N.TextareaEnd[3]?this.startSpecial(N.TextareaEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}startEntity(){this.baseState=this.state,this.state=u.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?R.Strict:this.baseState===u.Text||this.baseState===u.InSpecialTag?R.Legacy:R.Attribute)}stateInEntity(){const e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,e===0&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===u.Text||this.state===u.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===u.InAttributeValueDq||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case u.Text:{this.stateText(e);break}case u.SpecialStartSequence:{this.stateSpecialStartSequence(e);break}case u.InSpecialTag:{this.stateInSpecialTag(e);break}case u.CDATASequence:{this.stateCDATASequence(e);break}case u.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(e);break}case u.InAttributeName:{this.stateInAttributeName(e);break}case u.InCommentLike:{this.stateInCommentLike(e);break}case u.InSpecialComment:{this.stateInSpecialComment(e);break}case u.BeforeAttributeName:{this.stateBeforeAttributeName(e);break}case u.InTagName:{this.stateInTagName(e);break}case u.InClosingTagName:{this.stateInClosingTagName(e);break}case u.BeforeTagName:{this.stateBeforeTagName(e);break}case u.AfterAttributeName:{this.stateAfterAttributeName(e);break}case u.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(e);break}case u.BeforeAttributeValue:{this.stateBeforeAttributeValue(e);break}case u.BeforeClosingTagName:{this.stateBeforeClosingTagName(e);break}case u.AfterClosingTagName:{this.stateAfterClosingTagName(e);break}case u.BeforeSpecialS:{this.stateBeforeSpecialS(e);break}case u.BeforeSpecialT:{this.stateBeforeSpecialT(e);break}case u.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(e);break}case u.InSelfClosingTag:{this.stateInSelfClosingTag(e);break}case u.InDeclaration:{this.stateInDeclaration(e);break}case u.BeforeDeclaration:{this.stateBeforeDeclaration(e);break}case u.BeforeComment:{this.stateBeforeComment(e);break}case u.InProcessingInstruction:{this.stateInProcessingInstruction(e);break}case u.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===u.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===u.InCommentLike?this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===u.InTagName||this.state===u.BeforeAttributeName||this.state===u.BeforeAttributeValue||this.state===u.AfterAttributeName||this.state===u.InAttributeName||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueDq||this.state===u.InAttributeValueNq||this.state===u.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){this.baseState!==u.Text&&this.baseState!==u.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const St=new Set(["input","option","optgroup","select","button","datalist","textarea"]),v=new Set(["p"]),Yi=new Set(["thead","tbody"]),Xi=new Set(["dd","dt"]),Ki=new Set(["rt","rp"]),Qh=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",v],["h1",v],["h2",v],["h3",v],["h4",v],["h5",v],["h6",v],["select",St],["input",St],["output",St],["button",St],["datalist",St],["textarea",St],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Xi],["dt",Xi],["address",v],["article",v],["aside",v],["blockquote",v],["details",v],["div",v],["dl",v],["fieldset",v],["figcaption",v],["figure",v],["footer",v],["form",v],["header",v],["hr",v],["main",v],["nav",v],["ol",v],["pre",v],["section",v],["table",v],["ul",v],["rt",Ki],["rp",Ki],["tbody",Yi],["tfoot",Yi]]),Zh=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ts=new Set(["math","svg"]),es=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),Jh=/\s|\//;class Yh{constructor(e,n={}){var r,i,s,o,c,a;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e!=null?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(i=n.lowerCaseAttributeNames)!==null&&i!==void 0?i:this.htmlMode,this.recognizeSelfClosing=(s=n.recognizeSelfClosing)!==null&&s!==void 0?s:!this.htmlMode,this.tokenizer=new((o=n.Tokenizer)!==null&&o!==void 0?o:Wh)(this.options,this),this.foreignContext=[!this.htmlMode],(a=(c=this.cbs).onparserinit)===null||a===void 0||a.call(c,this)}ontext(e,n){var r,i;const s=this.getSlice(e,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,s),this.startIndex=n}ontextentity(e,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,an(e)),this.startIndex=n}isVoidElement(e){return this.htmlMode&&Zh.has(e)}onopentagname(e,n){this.endIndex=n;let r=this.getSlice(e,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(e){var n,r,i,s;this.openTagStart=this.startIndex,this.tagname=e;const o=this.htmlMode&&Qh.get(e);if(o)for(;this.stack.length>0&&o.has(this.stack[0]);){const c=this.stack.shift();(r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,c,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(ts.has(e)?this.foreignContext.unshift(!0):es.has(e)&&this.foreignContext.unshift(!1))),(s=(i=this.cbs).onopentagname)===null||s===void 0||s.call(i,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var n,r;this.startIndex=this.openTagStart,this.attribs&&((r=(n=this.cbs).onopentag)===null||r===void 0||r.call(n,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,n){var r,i,s,o,c,a,l,h;this.endIndex=n;let d=this.getSlice(e,n);if(this.lowerCaseTagNames&&(d=d.toLowerCase()),this.htmlMode&&(ts.has(d)||es.has(d))&&this.foreignContext.shift(),this.isVoidElement(d))this.htmlMode&&d==="br"&&((o=(s=this.cbs).onopentagname)===null||o===void 0||o.call(s,"br"),(a=(c=this.cbs).onopentag)===null||a===void 0||a.call(c,"br",{},!0),(h=(l=this.cbs).onclosetag)===null||h===void 0||h.call(l,"br",!1));else{const f=this.stack.indexOf(d);if(f!==-1)for(let g=0;g<=f;g++){const p=this.stack.shift();(i=(r=this.cbs).onclosetag)===null||i===void 0||i.call(r,p,g!==f)}else this.htmlMode&&d==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var n,r;const i=this.tagname;this.endOpenTag(e),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!e),this.stack.shift())}onattribname(e,n){this.startIndex=e;const r=this.getSlice(e,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(e,n){this.attribvalue+=this.getSlice(e,n)}onattribentity(e){this.attribvalue+=an(e)}onattribend(e,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,e===V.Double?'"':e===V.Single?"'":e===V.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const n=e.search(Jh);let r=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(e,n,r){var i,s,o,c;this.endIndex=n,(s=(i=this.cbs).oncomment)===null||s===void 0||s.call(i,this.getSlice(e,n-r)),(c=(o=this.cbs).oncommentend)===null||c===void 0||c.call(o),this.startIndex=n+1}oncdata(e,n,r){var i,s,o,c,a,l,h,d,f,g;this.endIndex=n;const p=this.getSlice(e,n-r);!this.htmlMode||this.options.recognizeCDATA?((s=(i=this.cbs).oncdatastart)===null||s===void 0||s.call(i),(c=(o=this.cbs).ontext)===null||c===void 0||c.call(o,p),(l=(a=this.cbs).oncdataend)===null||l===void 0||l.call(a)):((d=(h=this.cbs).oncomment)===null||d===void 0||d.call(h,`[CDATA[${p}]]`),(g=(f=this.cbs).oncommentend)===null||g===void 0||g.call(f)),this.startIndex=n+1}onend(){var e,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let r=0;r<this.stack.length;r++)this.cbs.onclosetag(this.stack[r],!0)}(n=(e=this.cbs).onend)===null||n===void 0||n.call(e)}reset(){var e,n,r,i;(n=(e=this.cbs).onreset)===null||n===void 0||n.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(i=(r=this.cbs).onparserinit)===null||i===void 0||i.call(r,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,n){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(e-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".write() after done!"));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}function Xh(t,e){const n=new La(void 0,e);return new Yh(n,e).end(t),n.root}const Kh=Hh(uh(Xh),fe),tu=Kh(""),Pn=t=>{var e;return(e=tu.parseHTML(t))!=null?e:[]};var eu=Object.defineProperty,ns=Object.getOwnPropertySymbols,nu=Object.prototype.hasOwnProperty,ru=Object.prototype.propertyIsEnumerable,rs=(t,e,n)=>e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,is=(t,e)=>{for(var n in e||(e={}))nu.call(e,n)&&rs(t,n,e[n]);if(ns)for(var n of ns(e))ru.call(e,n)&&rs(t,n,e[n]);return t},ss=(t,e,n)=>new Promise((r,i)=>{var s=a=>{try{c(n.next(a))}catch(l){i(l)}},o=a=>{try{c(n.throw(a))}catch(l){i(l)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(s,o);c((n=n.apply(t,e)).next())});const os=t=>{const e=t.filter(i=>!!i),n=e[0];n&&n.type==="text"&&!n.text.trim()&&e.shift();const r=e[e.length-1];return r&&r.type==="text"&&!r.text.trim()&&e.pop(),e},as=(t,e)=>ss(void 0,[t,e],function*(n,{appendClass:r,transform:i}){if(n.type==="text")return{type:"text",text:n.data.replace(/\r/g,"")};if(n.type==="tag"){const s=Gr.find(([o])=>n.name===o);if(s){const o=Object.fromEntries(n.attributes.filter(({name:h})=>{var d;return["class","style"].includes(h)||((d=s[1])==null?void 0:d.includes(h))}).map(({name:h,value:d})=>[h,d])),c=os(yield Promise.all(n.children.map(h=>as(h,{appendClass:r,transform:i}))));r&&(o.class=o.class?`${o.class} ${n.name}`:n.name);const a=is(is({type:"node",name:n.name},Object.keys(o).length?{attrs:o}:{}),c.length?{children:c}:{}),l=i[n.name];return yield l?l(a):a}}return null}),iu=(t,...e)=>ss(void 0,[t,...e],function*(n,{appendClass:r=!0,transform:i={}}={}){return os(yield Promise.all((Array.isArray(n)?n:Pn(n)).map(s=>as(s,{appendClass:r,transform:i}))))}),cs=t=>(typeof t=="string"?Pn(t)||[]:t).map(e=>e.type==="text"?e.data:"childNodes"in e?cs(e.childNodes):"").join("");exports.$App=Js,exports.$Component=wo,exports.$Config=eo,exports.$Page=xo,exports.ALLOWED_TAGS=Gr,exports.Cookie=oe,exports.CookieStore=le,exports.Emitter=Qt,exports.Headers=Ye,exports.MpError=Ls,exports.Queue=Jn,exports.URLSearchParams=Vt,exports.addContact=Es,exports.check=zo,exports.checkAsync=Wo,exports.compareVersion=ks,exports.confirm=ys,exports.createRequest=ya,exports.decodeBase64=Ds,exports.dirname=ee,exports.download=zt,exports.emitter=z,exports.encodeBase64=Ps,exports.exists=Ue,exports.funcQueue=zs,exports.get=Ro,exports.getAsync=Vo,exports.getCookieScopeDomain=se,exports.getCurrentPage=Rn,exports.getCurrentRoute=Ts,exports.getDomain=ie,exports.getRichTextNodes=iu,exports.getText=cs,exports.getUrlInfo=Ve,exports.getWindowInfo=xs,exports.isDir=Sr,exports.isFile=To,exports.isFunction=Zn,exports.isMp=Oe,exports.isQQ=qe,exports.isWx=Hn,exports.lock=Hs,exports.logger=Z,exports.ls=No,exports.mkdir=ne,exports.normalizeDomain=ft,exports.once=Gs,exports.openDocument=Is,exports.parseCookieHeader=Je,exports.parseHTML=Pn,exports.parseUrl=Cr,exports.put=Mo,exports.query=Wn,exports.readFile=qo,exports.readJSON=Oo,exports.remove=Ho,exports.removeAsync=Go,exports.reportNetworkStatus=Vn,exports.request=Rr,exports.requestCookieStore=Ke,exports.retry=ws,exports.rm=Io,exports.saveDocument=Ns,exports.saveFile=Po,exports.saveOnlineFile=Do,exports.savePhoto=qs,exports.set=Fo,exports.setAsync=Uo,exports.showModal=Ct,exports.showToast=P,exports.storage=re,exports.take=Bo,exports.type=Qn,exports.unzip=jo,exports.updateApp=Os,exports.wrapFunction=B,exports.writeClipboard=bs,exports.writeFile=_o,exports.writeJSON=Lo;
13
13
  //# sourceMappingURL=index.js.map