@thorvg/lottie-player 1.0.1 → 1.0.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/dist/gl/lottie-player.cjs.js +2 -2
- package/dist/gl/lottie-player.esm.js +2 -2
- package/dist/gl/lottie-player.js +2 -2
- package/dist/gl/thorvg.wasm +0 -0
- package/dist/gl-lite/lottie-player.cjs.js +2 -2
- package/dist/gl-lite/lottie-player.esm.js +2 -2
- package/dist/gl-lite/lottie-player.js +2 -2
- package/dist/gl-lite/thorvg.wasm +0 -0
- package/dist/lottie-player.cjs.js +2 -2
- package/dist/lottie-player.esm.js +2 -2
- package/dist/lottie-player.js +2 -2
- package/dist/sw/lottie-player.cjs.js +1 -1
- package/dist/sw/lottie-player.esm.js +1 -1
- package/dist/sw/lottie-player.js +1 -1
- package/dist/sw/thorvg.wasm +0 -0
- package/dist/sw-lite/lottie-player.cjs.js +1 -1
- package/dist/sw-lite/lottie-player.esm.js +1 -1
- package/dist/sw-lite/lottie-player.js +1 -1
- package/dist/sw-lite/thorvg.wasm +0 -0
- package/dist/thorvg.wasm +0 -0
- package/dist/wg/lottie-player.cjs.js +1 -1
- package/dist/wg/lottie-player.esm.js +1 -1
- package/dist/wg/lottie-player.js +1 -1
- package/dist/wg/thorvg.wasm +0 -0
- package/dist/wg-lite/lottie-player.cjs.js +1 -1
- package/dist/wg-lite/lottie-player.esm.js +1 -1
- package/dist/wg-lite/lottie-player.js +1 -1
- package/dist/wg-lite/thorvg.wasm +0 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let a=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const r=this.t;if(e&&void 0===t){const e=void 0!==r&&1===r.length;e&&(t=n.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(r,t))}return t}toString(){return this.cssText}};const i=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:s,defineProperty:o,getOwnPropertyDescriptor:h,getOwnPropertyNames:l,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,d=globalThis,f=d.trustedTypes,p=f?f.emptyScript:"",w=d.reactiveElementPolyfillSupport,m=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},y=(t,e)=>!s(t,e),g={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&o(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:a}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=n?.call(this);a?.call(this,e),this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??g}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...l(t),...c(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(i(t))}else void 0!==t&&e.push(i(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(e)r.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),a=t.litNonce;void 0!==a&&n.setAttribute("nonce",a),n.textContent=e.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(e,r.type);this._$Em=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const i=a.fromAttribute(e,t.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,a=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??y)(a,e)||r.useDefault&&r.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:a},i){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==a||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[m("elementProperties")]=new Map,b[m("finalized")]=new Map,w?.({ReactiveElement:b}),(d.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_=(t=$,e,r)=>{const{kind:n,metadata:a}=r;let i=globalThis.litPropertyMetadata.get(a);if(void 0===i&&globalThis.litPropertyMetadata.set(a,i=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),i.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const a=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,a,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const a=this[n];e.call(this,r),this.requestUpdate(n,a,t)}}throw Error("Unsupported decorator location: "+n)};function A(t){return(e,r)=>"object"==typeof r?_(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const E=globalThis,k=E.trustedTypes,S=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,R="?"+T,P=`<${R}>`,O=document,Z=()=>O.createComment(""),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,U=Array.isArray,j="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,M=/>/g,N=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,H=/"/g,V=/^(?:script|style|textarea|title)$/i,I=(t,...e)=>({_$litType$:1,strings:t,values:e}),L=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),G=new WeakMap,q=O.createTreeWalker(O,129);function W(t,e){if(!U(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const J=(t,e)=>{const r=t.length-1,n=[];let a,i=2===e?"<svg>":3===e?"<math>":"",s=F;for(let e=0;e<r;e++){const r=t[e];let o,h,l=-1,c=0;for(;c<r.length&&(s.lastIndex=c,h=s.exec(r),null!==h);)c=s.lastIndex,s===F?"!--"===h[1]?s=D:void 0!==h[1]?s=M:void 0!==h[2]?(V.test(h[2])&&(a=RegExp("</"+h[2],"g")),s=N):void 0!==h[3]&&(s=N):s===N?">"===h[0]?(s=a??F,l=-1):void 0===h[1]?l=-2:(l=s.lastIndex-h[2].length,o=h[1],s=void 0===h[3]?N:'"'===h[3]?H:z):s===H||s===z?s=N:s===D||s===M?s=F:(s=N,a=void 0);const u=s===N&&t[e+1].startsWith("/>")?" ":"";i+=s===F?r+P:l>=0?(n.push(o),r.slice(0,l)+C+r.slice(l)+T+u):r+T+(-2===l?e:u)}return[W(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class X{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let a=0,i=0;const s=t.length-1,o=this.parts,[h,l]=J(t,e);if(this.el=X.createElement(h,r),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=q.nextNode())&&o.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(C)){const e=l[i++],r=n.getAttribute(t).split(T),s=/([.?@])?(.*)/.exec(e);o.push({type:1,index:a,name:s[2],strings:r,ctor:"."===s[1]?et:"?"===s[1]?rt:"@"===s[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(T)&&(o.push({type:6,index:a}),n.removeAttribute(t));if(V.test(n.tagName)){const t=n.textContent.split(T),e=t.length-1;if(e>0){n.textContent=k?k.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],Z()),q.nextNode(),o.push({type:2,index:++a});n.append(t[e],Z())}}}else if(8===n.nodeType)if(n.data===R)o.push({type:2,index:a});else{let t=-1;for(;-1!==(t=n.data.indexOf(T,t+1));)o.push({type:7,index:a}),t+=T.length-1}a++}}static createElement(t,e){const r=O.createElement("template");return r.innerHTML=t,r}}function K(t,e,r=t,n){if(e===L)return e;let a=void 0!==n?r._$Co?.[n]:r._$Cl;const i=x(e)?void 0:e._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),void 0===i?a=void 0:(a=new i(t),a._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=a:r._$Cl=a),void 0!==a&&(e=K(t,a._$AS(t,e.values),a,n)),e}class Q{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??O).importNode(e,!0);q.currentNode=n;let a=q.nextNode(),i=0,s=0,o=r[0];for(;void 0!==o;){if(i===o.index){let e;2===o.type?e=new Y(a,a.nextSibling,this,t):1===o.type?e=new o.ctor(a,o.name,o.strings,this,t):6===o.type&&(e=new at(a,this,t)),this._$AV.push(e),o=r[++s]}i!==o?.index&&(a=q.nextNode(),i++)}return q.currentNode=O,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=K(this,t,e),x(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==L&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>U(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&x(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=X.createElement(W(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new Q(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new X(t)),e}k(t){U(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const a of t)n===e.length?e.push(r=new Y(this.O(Z()),this.O(Z()),this,this.options)):r=e[n],r._$AI(a),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,a){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=B}_$AI(t,e=this,r,n){const a=this.strings;let i=!1;if(void 0===a)t=K(this,t,e,0),i=!x(t)||t!==this._$AH&&t!==L,i&&(this._$AH=t);else{const n=t;let s,o;for(t=a[0],s=0;s<a.length-1;s++)o=K(this,n[r+s],e,s),o===L&&(o=this._$AH[s]),i||=!x(o)||o!==this._$AH[s],o===B?t=B:t!==B&&(t+=(o??"")+a[s+1]),this._$AH[s]=o}i&&!n&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class nt extends tt{constructor(t,e,r,n,a){super(t,e,r,n,a),this.type=5}_$AI(t,e=this){if((t=K(this,t,e,0)??B)===L)return;const r=this._$AH,n=t===B&&r!==B||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,a=t!==B&&(r===B||n);n&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const it=E.litHtmlPolyfillSupport;it?.(X,Y),(E.litHtmlVersions??=[]).push("3.3.1");const st=globalThis;class ot extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let a=n._$litPart$;if(void 0===a){const t=r?.renderBefore??null;n._$litPart$=a=new Y(e.insertBefore(Z(),t),t,void 0,r??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}}ot._$litElement$=!0,ot.finalized=!0,st.litElementHydrateSupport?.({LitElement:ot});const ht=st.litElementPolyfillSupport;function lt(t,e,r,n){var a,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}ht?.({LitElement:ot}),(st.litElementVersions??=[]).push("4.2.1");let ct=null,ut=!1;var dt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const ft=t=>new Promise(e=>setTimeout(e,t));let pt="idle";class wt extends ot{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ut)for(;!ct;)await ft(100);if(ct||(ut=!0,ct=await async function(t={}){var e,r=t,n=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(i){const{createRequire:t}=await Promise.resolve().then(function(){return yt});var s=t(import.meta.url)}var o,h,l=(t,e)=>{throw e},c=import.meta.url,u="";if(i){var d=s("fs");c.startsWith("file:")&&(u=s("path").dirname(s("url").fileURLToPath(c))+"/"),h=t=>(t=O(t)?new URL(t):t,d.readFileSync(t)),o=async t=>(t=O(t)?new URL(t):t,d.readFileSync(t,void 0)),process.argv.slice(2),l=(t,e)=>{throw process.exitCode=t,e}}else if(n||a){try{u=new URL(".",c).href}catch{}a&&(h=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=async t=>{if(O(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var f,p,w,m,v,y,g,b,$,_,A,E,k,S,C,T=function(){}.bind(),R=function(){}.bind(),P=!1,O=t=>t.startsWith("file://"),Z=!1;function x(){var t=er.buffer;v=new Int8Array(t),g=new Int16Array(t),y=new Uint8Array(t),b=new Uint16Array(t),$=new Int32Array(t),_=new Uint32Array(t),A=new Float32Array(t),E=new Float64Array(t),k=new BigInt64Array(t),S=new BigUint64Array(t)}function U(t){throw r.onAbort?.(t),R(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),m?.(t),t}class j{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var F=t=>{for(;0<t.length;)t.shift()(r)},D=[],M=[],N=()=>{var t=r.preRun.shift();M.push(t)},z=!0,H=new TextDecoder,V=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},I=(t,e,r)=>t?H.decode(y.subarray(t,V(y,t,e,r))):"",L=t=>{for(var e="";;){var r=y[t++];if(!r)return e;e+=String.fromCharCode(r)}},B={},G={},q={},W=class extends Error{constructor(t){super(t),this.name="BindingError"}},J=t=>{throw new W(t)};function X(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new W(`type "${n}" must have a positive integer typeid pointer`);if(G.hasOwnProperty(t)){if(r.Ib)return;throw new W(`Cannot register type '${n}' twice`)}G[t]=e,delete q[t],B.hasOwnProperty(t)&&(e=B[t],delete B[t],e.forEach(t=>t()))}(t,e,r)}var K=(t,e,r)=>{switch(e){case 1:return r?t=>v[t]:t=>y[t];case 2:return r?t=>g[t>>1]:t=>b[t>>1];case 4:return r?t=>$[t>>2]:t=>_[t>>2];case 8:return r?t=>k[t>>3]:t=>S[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Q=t=>{throw new W(t.$.ha.ea.name+" instance already deleted")},Y=!1,tt=()=>{},et=t=>globalThis.FinalizationRegistry?(Y=new FinalizationRegistry(t=>{--(t=t.$).count.value,0===t.count.value&&(t.ka?t.oa.Ba(t.ka):t.ha.ea.Ba(t.fa))}),et=t=>{var e=t.$;return e.ka&&Y.register(t,{$:e},t),t},tt=t=>{Y.unregister(t)},et(t)):(et=t=>t,t);function rt(){}var nt=(t,e)=>Object.defineProperty(e,"name",{value:t}),at={},it=(t,e,r)=>{if(void 0===t[e].ja){var n=t[e];t[e]=function(...n){if(!t[e].ja.hasOwnProperty(n.length))throw new W(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].ja})!`);return t[e].ja[n.length].apply(this,n)},t[e].ja=[],t[e].ja[n.Ja]=n}},st=(t,e,n)=>{if(r.hasOwnProperty(t)){if(void 0===n||void 0!==r[t].ja&&void 0!==r[t].ja[n])throw new W(`Cannot register public name '${t}' twice`);if(it(r,t,t),r[t].ja.hasOwnProperty(n))throw new W(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].ja[n]=e}else r[t]=e,r[t].Ja=n};function ot(t,e,r,n,a,i,s,o){this.name=t,this.constructor=e,this.Ga=r,this.Ba=n,this.ma=a,this.Eb=i,this.Oa=s,this.Ab=o,this.Ob=[]}var ht=(t,e,r)=>{for(;e!==r;){if(!e.Oa)throw new W(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Oa(t),e=e.ma}return t},lt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ct(t,e){if(null===e){if(this.Ya)throw new W(`null is not a valid ${this.name}`);return 0}if(!e.$)throw new W(`Cannot pass "${lt(e)}" as a ${this.name}`);if(!e.$.fa)throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);return ht(e.$.fa,e.$.ha.ea,this.ea)}function ut(t,e){if(null===e){if(this.Ya)throw new W(`null is not a valid ${this.name}`);if(this.Ra){var r=this.Pb();return null!==t&&t.push(this.Ba,r),r}return 0}if(!e||!e.$)throw new W(`Cannot pass "${lt(e)}" as a ${this.name}`);if(!e.$.fa)throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Qa&&e.$.ha.Qa)throw new W(`Cannot convert argument of type ${e.$.oa?e.$.oa.name:e.$.ha.name} to parameter type ${this.name}`);if(r=ht(e.$.fa,e.$.ha.ea,this.ea),this.Ra){if(void 0===e.$.ka)throw new W("Passing raw pointer to smart pointer is illegal");switch(this.Rb){case 0:if(e.$.oa!==this)throw new W(`Cannot convert argument of type ${e.$.oa?e.$.oa.name:e.$.ha.name} to parameter type ${this.name}`);r=e.$.ka;break;case 1:r=e.$.ka;break;case 2:if(e.$.oa===this)r=e.$.ka;else{var n=e.clone();r=this.Qb(r,jt(()=>n.delete())),null!==t&&t.push(this.Ba,r)}break;default:throw new W("Unsupporting sharing policy")}}return r}function dt(t,e){if(null===e){if(this.Ya)throw new W(`null is not a valid ${this.name}`);return 0}if(!e.$)throw new W(`Cannot pass "${lt(e)}" as a ${this.name}`);if(!e.$.fa)throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.$.ha.Qa)throw new W(`Cannot convert argument of type ${e.$.ha.name} to parameter type ${this.name}`);return ht(e.$.fa,e.$.ha.ea,this.ea)}function ft(t){return this.la(_[t>>2])}var pt=(t,e,r)=>e===r?t:void 0===r.ma||null===(t=pt(t,e,r.ma))?null:r.Ab(t),wt={},mt=class extends Error{constructor(t){super(t),this.name="InternalError"}},vt=(t,e)=>{if(!e.ha||!e.fa)throw new mt("makeClassHandle requires ptr and ptrType");if(!!e.oa!=!!e.ka)throw new mt("Both smartPtrType and smartPtr must be specified");return e.count={value:1},et(Object.create(t,{$:{value:e,writable:!0}}))};function gt(t,e,r,n,a,i,s,o,h,l,c){this.name=t,this.ea=e,this.Ya=r,this.Qa=n,this.Ra=a,this.Nb=i,this.Rb=s,this.rb=o,this.Pb=h,this.Qb=l,this.Ba=c,a||void 0!==e.ma?this.pa=ut:(this.pa=n?ct:dt,this.qa=null)}var bt=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new mt("Replacing nonexistent public symbol");void 0!==r[t].ja&&void 0!==n?r[t].ja[n]=e:(r[t]=e,r[t].Ja=n)},$t=(t,e)=>{t=L(t);var r=rr.get(e);if("function"!=typeof r)throw new W(`unknown function pointer with signature ${t}: ${e}`);return r};class _t extends Error{}var At=t=>{t=Xe(t);var e=L(t);return We(t),e},Et=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||G[e]||(q[e]?q[e].forEach(t):(r.push(e),n[e]=!0))}),new _t(`${t}: `+r.map(At).join([", "]))},kt=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new mt("Mismatched type converter count");for(var n=0;n<t.length;++n)X(t[n],e[n])}t.forEach(t=>q[t]=e);var a=Array(e.length),i=[],s=0;for(let[t,r]of e.entries())G.hasOwnProperty(r)?a[t]=G[r]:(i.push(r),B.hasOwnProperty(r)||(B[r]=[]),B[r].push(()=>{a[t]=G[r],++s===i.length&&n(a)}));0===i.length&&n(a)},St=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+4*n>>2]);return r},Ct=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function Tt(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].qa)return!0;return!1}function Rt(t,e,r,n,a,i){var s=e.length;if(2>s)throw new W("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==e[1]&&null!==r,h=Tt(e);r=!e[0].pb;var l=e[0],c=e[1];for(n=[t,J,n,a,Ct,l.la.bind(l),c?.pa.bind(c)],a=2;a<s;++a)n.push((l=e[a]).pa.bind(l));if(!h)for(a=o?1:2;a<e.length;++a)null!==e[a].qa&&n.push(e[a].qa);for(h=Tt(e),a=e.length-2,c=[],l=["fn"],o&&l.push("thisWired"),s=0;s<a;++s)c.push(`arg${s}`),l.push(`arg${s}Wired`);c=c.join(","),l=l.join(","),c=`return function (${c}) {\n`,h&&(c+="var destructors = [];\n");var u=h?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(o&&(c+=`var thisWired = toClassParamWire(${u}, this);\n`),s=0;s<a;++s){var f=`toArg${s}Wire`;c+=`var arg${s}Wired = ${f}(${u}, arg${s});\n`,d.push(f)}if(c+=(r||i?"var rv = ":"")+`invoker(${l});\n`,h)c+="runDestructors(destructors);\n";else for(s=o?1:2;s<e.length;++s)i=1===s?"thisWired":"arg"+(s-2)+"Wired",null!==e[s].qa&&(c+=`${i}_dtor(${i});\n`,d.push(`${i}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,c+"}\n")(...n),nt(t,e)}var Pt=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},Ot=[],Zt=[0,1,,1,null,1,!0,1,!1,1],xt=t=>{9<t&&0===--Zt[t+1]&&(Zt[t]=void 0,Ot.push(t))},Ut=t=>{if(!t)throw new W(`Cannot use deleted val. handle = ${t}`);return Zt[t]},jt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=Ot.pop()||Zt.length;return Zt[e]=t,Zt[e+1]=1,e}},Ft={name:"emscripten::val",la:t=>{var e=Ut(t);return xt(t),e},pa:(t,e)=>jt(e),za:ft,qa:null},Dt=(t,e)=>{switch(e){case 4:return function(t){return this.la(A[t>>2])};case 8:return function(t){return this.la(E[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Mt=(t,e,r,n)=>{if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<t.length;++i){var s=t.codePointAt(i);if(127>=s){if(r>=n)break;e[r++]=s}else if(2047>=s){if(r+1>=n)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(65535>=s){if(r+2>=n)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=n)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s,i++}}return e[r]=0,r-a},Nt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},zt=new TextDecoder("utf-16le"),Ht=(t,e,r)=>zt.decode(b.subarray(t>>=1,V(b,t,e/2,r))),Vt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var a=0;a<r;++a)g[e>>1]=t.charCodeAt(a),e+=2;return g[e>>1]=0,e-n},It=t=>2*t.length,Lt=(t,e,r)=>{var n="";t>>=2;for(var a=0;!(a>=e/4);a++){var i=_[t+a];if(!i&&!r)break;n+=String.fromCodePoint(i)}return n},Bt=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var a=0;a<t.length;++a){var i=t.codePointAt(a);if(65535<i&&a++,$[e>>2]=i,(e+=4)+4>r)break}return $[e>>2]=0,e-n},Gt=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},qt=0,Wt=[],Jt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(_[e>>2]=jt(n)),t},Xt={},Kt=t=>{var e=Xt[t];return void 0===e?L(t):e},Qt={},Yt=t=>{p=t,z||0<qt||(r.onExit?.(t),P=!0),l(t,new j(t))},te=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var a=t[n];"."===a?t.splice(n,1):".."===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},ee=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=te(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},re=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},ne=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],ae=t=>{(ae=(()=>{if(i){var t=s("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},ie=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:qe.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=te(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},se=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=ie(t).slice(1),e=ie(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),a=n,i=0;i<n;i++)if(t[i]!==e[i]){a=i;break}for(n=[],i=a;i<t.length;i++)n.push("..");return(n=n.concat(e.slice(a))).join("/")},oe=t=>{var e=V(t,0);return H.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},he=[],le=t=>{var e=Array(Nt(t)+1);return t=Mt(t,e,0,e.length),e.length=t,e},ce=[];function ue(t,e){ce[t]={input:[],output:[],Ia:e},Ee(t,de)}var de={open(t){var e=ce[t.node.rdev];if(!e)throw new qe.Z(43);t.tty=e,t.seekable=!1},close(t){t.tty.Ia.fsync(t.tty)},fsync(t){t.tty.Ia.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.Ia.mb)throw new qe.Z(60);for(var a=0,i=0;i<n;i++){try{var s=t.tty.Ia.mb(t.tty)}catch(t){throw new qe.Z(29)}if(void 0===s&&0===a)throw new qe.Z(6);if(null==s)break;a++,e[r+i]=s}return a&&(t.node.atime=Date.now()),a},write(t,e,r,n){if(!t.tty||!t.tty.Ia.bb)throw new qe.Z(60);try{for(var a=0;a<n;a++)t.tty.Ia.bb(t.tty,e[r+a])}catch(t){throw new qe.Z(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),a}},fe={mb(){t:{if(!he.length){var t=null;if(i){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=d.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}he=le(t)}t=he.shift()}return t},bb(t,e){null===e||10===e?(T(oe(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(T(oe(t.output)),t.output=[])},mc:()=>({Zb:25856,ac:5,Yb:191,$b:35387,Xb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),nc:()=>0,oc:()=>[24,80]},pe={bb(t,e){null===e||10===e?(R(oe(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(R(oe(t.output)),t.output=[])}},we={va:null,ga:()=>we.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||qe.isFIFO(r))throw new qe.Z(63);return we.va||(we.va={dir:{node:{sa:we.aa.sa,ua:we.aa.ua,lookup:we.aa.lookup,xa:we.aa.xa,rename:we.aa.rename,unlink:we.aa.unlink,rmdir:we.aa.rmdir,readdir:we.aa.readdir,symlink:we.aa.symlink},stream:{na:we.ba.na}},file:{node:{sa:we.aa.sa,ua:we.aa.ua},stream:{na:we.ba.na,read:we.ba.read,write:we.ba.write,Ha:we.ba.Ha,Ma:we.ba.Ma}},link:{node:{sa:we.aa.sa,ua:we.aa.ua,readlink:we.aa.readlink},stream:{}},fb:{node:{sa:we.aa.sa,ua:we.aa.ua},stream:qe.yb}}),ke((r=qe.createNode(t,e,r,n)).mode)?(r.aa=we.va.dir.node,r.ba=we.va.dir.stream,r.da={}):qe.isFile(r.mode)?(r.aa=we.va.file.node,r.ba=we.va.file.stream,r.ia=0,r.da=null):40960==(61440&r.mode)?(r.aa=we.va.link.node,r.ba=we.va.link.stream):8192==(61440&r.mode)&&(r.aa=we.va.fb.node,r.ba=we.va.fb.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.da[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},lc:t=>t.da?t.da.subarray?t.da.subarray(0,t.ia):new Uint8Array(t.da):new Uint8Array(0),aa:{sa(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=ke(t.mode)?4096:qe.isFile(t.mode)?t.ia:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},ua(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.ia!=(e=e.size)&&(0==e?(t.da=null,t.ia=0):(r=t.da,t.da=new Uint8Array(e),r&&t.da.set(r.subarray(0,Math.min(e,t.ia))),t.ia=e))},lookup(){throw we.Va||(we.Va=new qe.Z(44),we.Va.stack="<generic error, no stack>"),we.Va},xa:(t,e,r,n)=>we.createNode(t,e,r,n),rename(t,e,r){try{var n=Se(e,r)}catch(t){}if(n){if(ke(t.mode))for(var a in n.da)throw new qe.Z(55);Ce(n)}delete t.parent.da[t.name],e.da[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.da[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=Se(t,e);for(r in n.da)throw new qe.Z(55);delete t.da[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.da)],symlink:(t,e,r)=>((t=we.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new qe.Z(28);return t.link}},ba:{read(t,e,r,n,a){var i=t.node.da;if(a>=t.node.ia)return 0;if(8<(t=Math.min(t.node.ia-a,n))&&i.subarray)e.set(i.subarray(a,a+t),r);else for(n=0;n<t;n++)e[r+n]=i[a+n];return t},write(t,e,r,n,a,i){if(e.buffer===v.buffer&&(i=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.da||t.da.subarray)){if(i)return t.da=e.subarray(r,r+n),t.ia=n;if(0===t.ia&&0===a)return t.da=e.slice(r,r+n),t.ia=n;if(a+n<=t.ia)return t.da.set(e.subarray(r,r+n),a),n}var s=t.da?t.da.length:0;if(s>=(i=a+n)||(i=Math.max(i,s*(1048576>s?2:1.125)>>>0),0!=s&&(i=Math.max(i,256)),s=t.da,t.da=new Uint8Array(i),0<t.ia&&t.da.set(s.subarray(0,t.ia),0)),t.da.subarray&&e.subarray)t.da.set(e.subarray(r,r+n),a);else for(i=0;i<n;i++)t.da[a+i]=e[r+i];return t.ia=Math.max(t.ia,a+n),n},na(t,e,r){if(1===r?e+=t.position:2===r&&qe.isFile(t.node.mode)&&(e+=t.node.ia),0>e)throw new qe.Z(28);return e},Ha(t,e,r,n,a){if(!qe.isFile(t.node.mode))throw new qe.Z(43);if(t=t.node.da,2&a||!t||t.buffer!==v.buffer){if(n=!0,U(),!(a=void 0))throw new qe.Z(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),v.set(t,a))}else n=!1,a=t.byteOffset;return{fa:a,Tb:n}},Ma:(t,e,r,n)=>(we.ba.write(t,e,0,n,r,!1),0)}},me=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},ve=0,ye=null,ge=()=>{if(ve--,r.monitorRunDependencies?.(ve),0==ve&&ye){var t=ye;ye=null,t()}},be=()=>{ve++,r.monitorRunDependencies?.(ve)},$e=[],_e=async(t,e,r,n,a,i,s,h)=>{var l=e?ie(ee(t+"/"+e)):t;be();try{var c=r;"string"==typeof r&&(c=await(async t=>(t=await o(t),new Uint8Array(t)))(r)),c=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&Ae(),$e))if(r.canHandle(e))return r.handle(t,e);return t})(c,l),h?.(),i||Te(t,e,c,n,a,s)}finally{ge()}};function Ae(){var t,e,n;qe.Xa=!0,t??=r.stdin,e??=r.stdout,n??=r.stderr,t?qe.Aa("/dev","stdin",t):qe.symlink("/dev/tty","/dev/stdin"),e?qe.Aa("/dev","stdout",null,e):qe.symlink("/dev/tty","/dev/stdout"),n?qe.Aa("/dev","stderr",null,n):qe.symlink("/dev/tty1","/dev/stderr"),qe.open("/dev/stdin",0),qe.open("/dev/stdout",1),qe.open("/dev/stderr",1)}function Ee(t,e){qe.jb[t]={ba:e}}function ke(t){return 16384==(61440&t)}function Se(t,e){var r=ke(t.mode)?(r=Ue(t,"x"))?r:t.aa.lookup?0:2:54;if(r)throw new qe.Z(r);for(r=qe.ya[Oe(t.id,e)];r;r=r.Fa)if(r.parent.id===t.id&&r.name===e)return r;return qe.lookup(t,e)}function Ce(t){var e=Oe(t.parent.id,t.name);if(qe.ya[e]===t)qe.ya[e]=t.Fa;else for(e=qe.ya[e];e;){if(e.Fa===t){e.Fa=t.Fa;break}e=e.Fa}}function Te(t,e,r,n,a,i){var s=e;if(t&&(t="string"==typeof t?t:Pe(t),s=e?ee(t+"/"+e):t),t=me(n,a),s=qe.create(s,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,a=r.length;n<a;++n)e[n]=r.charCodeAt(n);r=e}qe.chmod(s,146|t),e=qe.open(s,577),qe.write(e,r,0,r.length,0,i),qe.close(e),qe.chmod(s,t)}}function Re(t,e={}){if(!t)throw new qe.Z(44);e.Pa??(e.Pa=!0),"/"===t.charAt(0)||(t=qe.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=qe.root,a="/",i=0;i<t.length;i++){var s=i===t.length-1;if(s&&e.parent)break;if("."!==t[i])if(".."===t[i]){if(a=re(a),qe.Za(n)){t=a+"/"+t.slice(i+1).join("/"),r--;continue t}n=n.parent}else{a=ee(a+"/"+t[i]);try{n=Se(n,t[i])}catch(t){if(44===t?.Da&&s&&e.Lb)return{path:a};throw t}if(!n.ta||s&&!e.Pa||(n=n.ta.root),40960==(61440&n.mode)&&(!s||e.ra)){if(!n.aa.readlink)throw new qe.Z(52);"/"===(n=n.aa.readlink(n)).charAt(0)||(n=re(a)+"/"+n),t=n+"/"+t.slice(i+1).join("/");continue t}}}return{path:a,node:n}}throw new qe.Z(32)}function Pe(t){for(var e;;){if(qe.Za(t))return t=t.ga.qb,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function Oe(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%qe.ya.length}function Ze(t){var e=Oe(t.parent.id,t.name);t.Fa=qe.ya[e],qe.ya[e]=t}function xe(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function Ue(t,e){return qe.nb?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function je(t,e){if(!ke(t.mode))return 54;try{return Se(t,e),20}catch(t){}return Ue(t,"wx")}function Fe(t,e,r){try{var n=Se(t,e)}catch(t){return t.Da}if(t=Ue(t,"wx"))return t;if(r){if(!ke(n.mode))return 54;if(qe.Za(n)||Pe(n)===qe.cwd())return 10}else if(ke(n.mode))return 31;return 0}function De(t,e){if(!t)throw new qe.Z(e);return t}function Me(t){if(!(t=qe.Hb(t)))throw new qe.Z(8);return t}function Ne(t,e=-1){if(t=Object.assign(new qe.wb,t),-1==e)t:{for(e=0;e<=qe.xb;e++)if(!qe.streams[e])break t;throw new qe.Z(33)}return t.fd=e,qe.streams[e]=t}function ze(t,e,r){var n=t?.ba.ua;t=n?t:e,n??=e.aa.ua,De(n,63),n(t,r)}function He(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.La)}return e}function Ve(t){var e={Wb:4096,ic:4096,blocks:1e6,Vb:5e5,Ub:5e5,files:qe.ab,fc:qe.ab-1,jc:42,flags:2,rc:255};return t.aa.tb&&Object.assign(e,t.aa.tb(t.ga.Mb.root)),e}function Ie(t,e,r){return void 0===r&&(r=e,e=438),qe.xa(t,8192|e,r)}function Le(t,e,r,n){ze(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),kb:n})}function Be(t,e,r){if(ke(e.mode))throw new qe.Z(31);if(!qe.isFile(e.mode))throw new qe.Z(28);var n=Ue(e,"w");if(n)throw new qe.Z(n);ze(t,e,{size:r,timestamp:Date.now()})}function Ge(t){if(!(t.Jb||t.Kb||t.link||t.da))if(globalThis.XMLHttpRequest)U("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{t.da=h(t.url)}catch(t){throw new qe.Z(29)}}var qe={root:null,La:[],jb:{},streams:[],ab:1,ya:null,gb:"/",Xa:!1,nb:!0,Db:null,Sa:0,sb:{},Z:class{name="ErrnoError";constructor(t){this.Da=t}},wb:class{wa={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.wa.flags}set flags(t){this.wa.flags=t}get position(){return this.wa.position}set position(t){this.wa.position=t}},vb:class{aa={};ba={};ta=null;constructor(t,e,r,n){t||=this,this.parent=t,this.ga=t.ga,this.id=qe.ab++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get Kb(){return ke(this.mode)}get Jb(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>(Ze(t=new qe.vb(t,e,r,n)),t),Za:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),xb:4096,Hb:t=>qe.streams[t],ec:(t,e=-1)=>(t=Ne(t,e),t.ba?.dc?.(t),t),yb:{open(t){t.ba=qe.Fb(t.node.rdev).ba,t.ba.open?.(t)},na(){throw new qe.Z(70)}},$a:t=>t>>8,pc:t=>255&t,Ea:(t,e)=>t<<8|e,Fb:t=>qe.jb[t],ub(t,e){function r(t){return qe.Sa--,e(t)}function n(t){if(t){if(!n.Bb)return n.Bb=!0,r(t)}else++s>=i.length&&r(null)}"function"==typeof t&&(e=t,t=!1),qe.Sa++,1<qe.Sa&&R(`warning: ${qe.Sa} FS.syncfs operations in flight at once, probably just doing extra work`);var a,i=He(qe.root.ga),s=0;for(a of i)a.type.ub?a.type.ub(a,t,n):n(null)},ga(t,e,r){var n="/"===r;if(n&&qe.root)throw new qe.Z(10);if(!n&&r){var a=Re(r,{Pa:!1});if(r=a.path,(a=a.node).ta)throw new qe.Z(10);if(!ke(a.mode))throw new qe.Z(54)}return(t=t.ga(e={type:t,Mb:e,qb:r,La:[]})).ga=e,e.root=t,n?qe.root=t:a&&(a.ta=e,a.ga&&a.ga.La.push(e)),t},wc(t){if(!(t=Re(t,{Pa:!1})).node.ta)throw new qe.Z(28);var e=(t=t.node).ta,r=He(e);for([,a]of Object.entries(qe.ya))for(;a;){var n=a.Fa;r.includes(a.ga)&&Ce(a);var a=n}t.ta=null,t.ga.La.splice(t.ga.La.indexOf(e),1)},lookup:(t,e)=>t.aa.lookup(t,e),xa(t,e,r){var n=Re(t,{parent:!0}).node;if(!(t=ne(t)))throw new qe.Z(28);if("."===t||".."===t)throw new qe.Z(20);var a=je(n,t);if(a)throw new qe.Z(a);if(!n.aa.xa)throw new qe.Z(63);return n.aa.xa(n,t,e,r)},tb:t=>Ve(Re(t,{ra:!0}).node),uc:t=>Ve(t.node),create:(t,e=438)=>qe.xa(t,4095&e|32768,0),mkdir:(t,e=511)=>qe.xa(t,1023&e|16384,0),qc(t,e){var r,n=t.split("/"),a="";for(r of n)if(r){(a||"/"===t.charAt(0))&&(a+="/"),a+=r;try{qe.mkdir(a,e)}catch(t){if(20!=t.Da)throw t}}},symlink(t,e){if(!ie(t))throw new qe.Z(44);var r=Re(e,{parent:!0}).node;if(!r)throw new qe.Z(44);var n=je(r,e=ne(e));if(n)throw new qe.Z(n);if(!r.aa.symlink)throw new qe.Z(63);return r.aa.symlink(r,e,t)},rename(t,e){var r=re(t),n=re(e),a=ne(t),i=ne(e),s=Re(t,{parent:!0}),o=s.node;if(s=(s=Re(e,{parent:!0})).node,!o||!s)throw new qe.Z(44);if(o.ga!==s.ga)throw new qe.Z(75);var h=Se(o,a);if("."!==(t=se(t,n)).charAt(0))throw new qe.Z(28);if("."!==(t=se(e,r)).charAt(0))throw new qe.Z(55);try{var l=Se(s,i)}catch(t){}if(h!==l){if(a=Fe(o,a,e=ke(h.mode)))throw new qe.Z(a);if(a=l?Fe(s,i,e):je(s,i))throw new qe.Z(a);if(!o.aa.rename)throw new qe.Z(63);if(h.ta||l&&l.ta)throw new qe.Z(10);if(s!==o&&(a=Ue(o,"w")))throw new qe.Z(a);Ce(h);try{o.aa.rename(h,s,i),h.parent=s}catch(t){throw t}finally{Ze(h)}}},rmdir(t){var e=Re(t,{parent:!0}).node,r=Se(e,t=ne(t)),n=Fe(e,t,!0);if(n)throw new qe.Z(n);if(!e.aa.rmdir)throw new qe.Z(63);if(r.ta)throw new qe.Z(10);e.aa.rmdir(e,t),Ce(r)},readdir:t=>De((t=Re(t,{ra:!0}).node).aa.readdir,54)(t),unlink(t){var e=Re(t,{parent:!0}).node;if(!e)throw new qe.Z(44);var r=Se(e,t=ne(t)),n=Fe(e,t,!1);if(n)throw new qe.Z(n);if(!e.aa.unlink)throw new qe.Z(63);if(r.ta)throw new qe.Z(10);e.aa.unlink(e,t),Ce(r)},readlink(t){if(!(t=Re(t).node))throw new qe.Z(44);if(!t.aa.readlink)throw new qe.Z(28);return t.aa.readlink(t)},stat:(t,e)=>De((t=Re(t,{ra:!e}).node).aa.sa,63)(t),fstat(t){var e=Me(t);t=e.node;var r=e.ba.sa;return e=r?e:t,r??=t.aa.sa,De(r,63),r(e)},lstat:t=>qe.stat(t,!0),chmod(t,e,r){Le(null,t="string"==typeof t?Re(t,{ra:!r}).node:t,e,r)},lchmod(t,e){qe.chmod(t,e,!0)},fchmod(t,e){Le(t=Me(t),t.node,e,!1)},chown(t,e,r,n){ze(null,t="string"==typeof t?Re(t,{ra:!n}).node:t,{timestamp:Date.now(),kb:n})},lchown(t,e,r){qe.chown(t,e,r,!0)},fchown(t){ze(t=Me(t),t.node,{timestamp:Date.now(),kb:!1})},truncate(t,e){if(0>e)throw new qe.Z(28);Be(null,t="string"==typeof t?Re(t,{ra:!0}).node:t,e)},kc(t,e){if(t=Me(t),0>e||!(2097155&t.flags))throw new qe.Z(28);Be(t,t.node,e)},xc(t,e,r){De((t=Re(t,{ra:!0}).node).aa.ua,63)(t,{atime:e,mtime:r})},open(t,e,n=438){if(""===t)throw new qe.Z(44);if("string"==typeof e){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===a)throw Error(`Unknown file open mode: ${e}`);e=a}if(n=64&e?4095&n|32768:0,"object"==typeof t)a=t;else{var i=t.endsWith("/");a=(t=Re(t,{ra:!(131072&e),Lb:!0})).node,t=t.path}var s=!1;if(64&e)if(a){if(128&e)throw new qe.Z(20)}else{if(i)throw new qe.Z(31);a=qe.xa(t,511|n,0),s=!0}if(!a)throw new qe.Z(44);if(8192==(61440&a.mode)&&(e&=-513),65536&e&&!ke(a.mode))throw new qe.Z(54);if(!s&&(i=a?40960==(61440&a.mode)?32:ke(a.mode)&&("r"!==xe(e)||576&e)?31:Ue(a,xe(e)):44))throw new qe.Z(i);return 512&e&&!s&&qe.truncate(a,0),e&=-131713,(i=Ne({node:a,path:Pe(a),flags:e,seekable:!0,position:0,ba:a.ba,Sb:[],error:!1})).ba.open&&i.ba.open(i),s&&qe.chmod(a,511&n),!r.logReadFiles||1&e||t in qe.sb||(qe.sb[t]=1),i},close(t){if(null===t.fd)throw new qe.Z(8);t.Wa&&(t.Wa=null);try{t.ba.close&&t.ba.close(t)}catch(t){throw t}finally{qe.streams[t.fd]=null}t.fd=null},na(t,e,r){if(null===t.fd)throw new qe.Z(8);if(!t.seekable||!t.ba.na)throw new qe.Z(70);if(0!=r&&1!=r&&2!=r)throw new qe.Z(28);return t.position=t.ba.na(t,e,r),t.Sb=[],t.position},read(t,e,r,n,a){if(0>n||0>a)throw new qe.Z(28);if(null===t.fd)throw new qe.Z(8);if(1==(2097155&t.flags))throw new qe.Z(8);if(ke(t.node.mode))throw new qe.Z(31);if(!t.ba.read)throw new qe.Z(28);var i=void 0!==a;if(i){if(!t.seekable)throw new qe.Z(70)}else a=t.position;return e=t.ba.read(t,e,r,n,a),i||(t.position+=e),e},write(t,e,r,n,a,i){if(0>n||0>a)throw new qe.Z(28);if(null===t.fd)throw new qe.Z(8);if(!(2097155&t.flags))throw new qe.Z(8);if(ke(t.node.mode))throw new qe.Z(31);if(!t.ba.write)throw new qe.Z(28);t.seekable&&1024&t.flags&&qe.na(t,0,2);var s=void 0!==a;if(s){if(!t.seekable)throw new qe.Z(70)}else a=t.position;return e=t.ba.write(t,e,r,n,a,i),s||(t.position+=e),e},Ha(t,e,r,n,a){if(2&n&&!(2&a)&&2!=(2097155&t.flags))throw new qe.Z(2);if(1==(2097155&t.flags))throw new qe.Z(2);if(!t.ba.Ha)throw new qe.Z(43);if(!e)throw new qe.Z(28);return t.ba.Ha(t,e,r,n,a)},Ma:(t,e,r,n,a)=>t.ba.Ma?t.ba.Ma(t,e,r,n,a):0,ob(t,e,r){if(!t.ba.ob)throw new qe.Z(59);return t.ba.ob(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding&&U(`Invalid encoding type "${e.encoding}"`);var r=qe.open(t,e.flags);t=qe.stat(t).size;var n=new Uint8Array(t);return qe.read(r,n,0,t,0),"utf8"===e.encoding&&(n=oe(n)),qe.close(r),n},writeFile(t,e,r={}){r.flags=r.flags||577,t=qe.open(t,r.flags,r.mode),"string"==typeof e&&(e=new Uint8Array(le(e))),ArrayBuffer.isView(e)?qe.write(t,e,0,e.byteLength,void 0,r.bc):U("Unsupported data type"),qe.close(t)},cwd:()=>qe.gb,chdir(t){if(null===(t=Re(t,{ra:!0})).node)throw new qe.Z(44);if(!ke(t.node.mode))throw new qe.Z(54);var e=Ue(t.node,"x");if(e)throw new qe.Z(e);qe.gb=t.path},tc(){for(var t of(qe.Xa=!1,qe.streams))t&&qe.close(t)},hc(t,e){try{var r=Re(t,{ra:!e});t=r.path}catch(t){}var n=!1,a=null;try{r=Re(t,{parent:!0}),ne(t),r=Re(t,{ra:!e}),n=!0,a=r.node}catch(t){}return n?a:null},Aa(t,e,r,n){var a;return t=((t,e)=>ee(t+"/"+e))("string"==typeof t?t:Pe(t),e),e=me(!!r,!!n),(a=qe.Aa).$a??(a.$a=64),Ee(a=qe.Ea(qe.Aa.$a++,0),{open(t){t.seekable=!1},close(){n?.buffer?.length&&n(10)},read(t,e,n,a){for(var i=0,s=0;s<a;s++){try{var o=r()}catch(t){throw new qe.Z(29)}if(void 0===o&&0===i)throw new qe.Z(6);if(null==o)break;i++,e[n+s]=o}return i&&(t.node.atime=Date.now()),i},write(t,e,r,a){for(var i=0;i<a;i++)try{n(e[r+i])}catch(t){throw new qe.Z(29)}return a&&(t.node.mtime=t.node.ctime=Date.now()),i}}),Ie(t,e,a)}};if((()=>{let t=rt.prototype;Object.assign(t,{isAliasOf:function(t){if(!(this instanceof rt&&t instanceof rt))return!1;var e=this.$.ha.ea,r=this.$.fa;t.$=t.$;var n=t.$.ha.ea;for(t=t.$.fa;e.ma;)r=e.Oa(r),e=e.ma;for(;n.ma;)t=n.Oa(t),n=n.ma;return e===n&&r===t},clone:function(){if(this.$.fa||Q(this),this.$.Na)return this.$.count.value+=1,this;var t=et,e=Object,r=e.create,n=Object.getPrototypeOf(this),a=this.$;return(t=t(r.call(e,n,{$:{value:{count:a.count,Ka:a.Ka,Na:a.Na,fa:a.fa,ha:a.ha,ka:a.ka,oa:a.oa}}}))).$.count.value+=1,t.$.Ka=!1,t},delete(){if(this.$.fa||Q(this),this.$.Ka&&!this.$.Na)throw new W("Object already scheduled for deletion");tt(this);var t=this.$;--t.count.value,0===t.count.value&&(t.ka?t.oa.Ba(t.ka):t.ha.ea.Ba(t.fa)),this.$.Na||(this.$.ka=void 0,this.$.fa=void 0)},isDeleted:function(){return!this.$.fa},deleteLater:function(){if(this.$.fa||Q(this),this.$.Ka&&!this.$.Na)throw new W("Object already scheduled for deletion");return this.$.Ka=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)})(),Object.assign(gt.prototype,{Gb(t){return this.rb&&(t=this.rb(t)),t},ib(t){this.Ba?.(t)},za:ft,la:function(t){function e(){return vt(this.ea.Ga,this.Ra?{ha:this.Nb,fa:r,oa:this,ka:t}:{ha:this,fa:t})}var r=this.Gb(t);if(!r)return this.ib(t),null;var n=((t,e)=>{if(void 0===e)throw new W("ptr should not be undefined");for(;t.ma;)e=t.Oa(e),t=t.ma;return wt[e]})(this.ea,r);if(void 0!==n)return 0===n.$.count.value?(n.$.fa=r,n.$.ka=t,n.clone()):(n=n.clone(),this.ib(t),n);if(n=this.ea.Eb(r),!(n=at[n]))return e.call(this);var a=pt(r,this.ea,(n=this.Qa?n.zb:n.pointerType).ea);return null===a?e.call(this):vt(n.ea.Ga,this.Ra?{ha:n,fa:a,oa:this,ka:t}:{ha:n,fa:a})}}),qe.cc=(t,e,r,n,a,i,s,o,h,l)=>{_e(t,e,r,n,a,o,h,l).then(i).catch(s)},qe.sc=_e,qe.ya=Array(4096),qe.ga(we,{},"/"),qe.mkdir("/tmp"),qe.mkdir("/home"),qe.mkdir("/home/web_user"),function(){qe.mkdir("/dev"),Ee(qe.Ea(1,3),{read:()=>0,write:(t,e,r,n)=>n,na:()=>0}),Ie("/dev/null",qe.Ea(1,3)),ue(qe.Ea(5,0),fe),ue(qe.Ea(6,0),pe),Ie("/dev/tty",qe.Ea(5,0)),Ie("/dev/tty1",qe.Ea(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(ae(t),e=t.byteLength),t[--e]);qe.Aa("/dev","random",r),qe.Aa("/dev","urandom",r),qe.mkdir("/dev/shm"),qe.mkdir("/dev/shm/tmp")}(),function(){qe.mkdir("/proc");var t=qe.mkdir("/proc/self");qe.mkdir("/proc/self/fd"),qe.ga({ga(){var e=qe.createNode(t,"fd",16895,73);return e.ba={na:we.ba.na},e.aa={lookup(t,e){var r=Me(t=+e);return(t={parent:null,ga:{qb:"fake"},aa:{readlink:()=>r.path},id:t+1}).parent=t},readdir:()=>Array.from(qe.streams.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},{},"/proc/self/fd")}(),qe.Db={MEMFS:we},r.noExitRuntime&&(z=r.noExitRuntime),r.preloadPlugins&&($e=r.preloadPlugins),r.print&&(T=r.print),r.printErr&&(R=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=be,r.removeRunDependency=ge,r.FS_preloadFile=_e,r.FS_unlink=(...t)=>qe.unlink(...t),r.FS_createPath=(...t)=>function(t,e){for(t="string"==typeof t?t:Pe(t),e=e.split("/").reverse();e.length;){var r=e.pop();if(r){var n=ee(t+"/"+r);try{qe.mkdir(n)}catch(t){if(20!=t.Da)throw t}t=n}}return n}(...t),r.FS_createDevice=(...t)=>qe.Aa(...t),r.FS=qe,r.FS_createDataFile=(...t)=>Te(...t),r.FS_createLazyFile=(...t)=>function(t,e,r,n,i){class s{Ua=!1;wa=[];Ta=void 0;hb=0;eb=0;get(t){if(!(t>this.length-1||0>t)){var e=t%this.chunkSize;return this.Ta(t/this.chunkSize|0)[e]}}Cb(t){this.Ta=t}lb(){var t=new XMLHttpRequest;t.open("HEAD",r,!1),t.send(null),200<=t.status&&300>t.status||304===t.status||U("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),a=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e;t=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e;var i=1048576;a||(i=n);var s=this;s.Cb(t=>{var e=t*i,a=(t+1)*i-1;if(a=Math.min(a,n-1),void 0===s.wa[t]){var o=s.wa;e>a&&U("invalid range ("+e+", "+a+") or no bytes requested!"),a>n-1&&U("only "+n+" bytes available! programmer error!");var h=new XMLHttpRequest;h.open("GET",r,!1),n!==i&&h.setRequestHeader("Range","bytes="+e+"-"+a),h.responseType="arraybuffer",h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send(null),200<=h.status&&300>h.status||304===h.status||U("Couldn't load "+r+". Status: "+h.status),e=void 0!==h.response?new Uint8Array(h.response||[]):le(h.responseText||""),o[t]=e}return void 0===s.wa[t]&&U("doXHR failed!"),s.wa[t]}),!t&&n||(i=n=1,i=n=this.Ta(0).length,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this.hb=n,this.eb=i,this.Ua=!0}get length(){return this.Ua||this.lb(),this.hb}get chunkSize(){return this.Ua||this.lb(),this.eb}}if(globalThis.XMLHttpRequest){a||U("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var o=new s,h=void 0}else h=r,o=void 0;var l=function(t,e,r,n){return t="string"==typeof t?t:Pe(t),e=ee(t+"/"+e),qe.create(e,me(r,n))}(t,e,n,i);o?l.da=o:h&&(l.da=null,l.url=h),Object.defineProperties(l,{ia:{get:function(){return this.da.length}}}),t={};for(const[e,r]of Object.entries(l.ba))t[e]=(...t)=>(Ge(l),r(...t));return t.read=(t,e,r,n,a)=>{if(Ge(l),a>=(t=t.node.da).length)e=0;else{if(n=Math.min(t.length-a,n),t.slice)for(var i=0;i<n;i++)e[r+i]=t[a+i];else for(i=0;i<n;i++)e[r+i]=t.get(a+i);e=n}return e},t.Ha=()=>{throw Ge(l),U(),new qe.Z(48)},l.ba=t,l}(...t);var We,Je,Xe,Ke,Qe,Ye,tr,er,rr,nr,ar={c:(t,e,r,n)=>U(`Assertion failed: ${I(t)}, at: `+[e?I(e):"unknown filename",r,n?I(n):"unknown function"]),D:()=>U(""),u:(t,e,r,n,a)=>{e=L(e);let i=t=>t;if(n=0n===n){const t=8*r;i=e=>BigInt.asUintN(t,e),a=i(a)}X(t,{name:e,la:i,pa:(t,e)=>("number"==typeof e&&(e=BigInt(e)),e),za:K(e,r,!n),qa:null})},L:(t,e,r,n)=>{X(t,{name:e=L(e),la:function(t){return!!t},pa:function(t,e){return e?r:n},za:function(t){return this.la(y[t])},qa:null})},I:(t,e,r,n,a,i,s,o,h,l,c,u,d)=>{c=L(c),i=$t(a,i),o&&=$t(s,o),l&&=$t(h,l),d=$t(u,d);var f=(t=>{var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(c);st(f,function(){Et(`Cannot construct ${c} due to unbound types`,[n])}),kt([t,e,r],n?[n]:[],e=>{if(e=e[0],n)var r=e.ea,a=r.Ga;else a=rt.prototype;e=nt(c,function(...t){if(Object.getPrototypeOf(this)!==s)throw new W(`Use 'new' to construct ${c}`);if(void 0===u.Ca)throw new W(`${c} has no accessible constructor`);var e=u.Ca[t.length];if(void 0===e)throw new W(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(u.Ca).toString()}) parameters instead!`);return e.apply(this,t)});var s=Object.create(a,{constructor:{value:e}});e.prototype=s;var h,u=new ot(c,e,s,d,r,i,o,l);return u.ma&&((h=u.ma).cb??(h.cb=[]),u.ma.cb.push(u)),r=new gt(c,u,!0,!1,!1),h=new gt(c+"*",u,!1,!1,!1),a=new gt(c+" const*",u,!1,!0,!1),at[t]={pointerType:h,zb:a},bt(f,e),[r,h,a]})},x:(t,e,r,n,a,i)=>{var s=St(e,r);a=$t(n,a),kt([],[t],t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.ea.Ca&&(t.ea.Ca=[]),void 0!==t.ea.Ca[e-1])throw new W(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.ea.Ca[e-1]=()=>{Et(`Cannot construct ${t.name} due to unbound types`,s)},kt([],s,n=>(n.splice(1,0,null),t.ea.Ca[e-1]=Rt(r,n,null,a,i),[])),[]})},h:(t,e,r,n,a,i,s,o,h)=>{var l=St(r,n);e=L(e),e=Pt(e),i=$t(a,i),kt([],[t],t=>{function n(){Et(`Cannot call ${a} due to unbound types`,l)}var a=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),o&&t.ea.Ob.push(e);var c=t.ea.Ga,u=c[e];return void 0===u||void 0===u.ja&&u.className!==t.name&&u.Ja===r-2?(n.Ja=r-2,n.className=t.name,c[e]=n):(it(c,e,a),c[e].ja[r-2]=n),kt([],l,n=>(n=Rt(a,n,t,i,s,h),void 0===c[e].ja?(n.Ja=r-2,c[e]=n):c[e].ja[r-2]=n,[])),[]})},J:t=>X(t,Ft),t:(t,e,r)=>{X(t,{name:e=L(e),la:t=>t,pa:(t,e)=>e,za:Dt(e,r),qa:null})},v:(t,e,r,n,a,i,s)=>{var o=St(e,r);t=L(t),t=Pt(t),a=$t(n,a),st(t,function(){Et(`Cannot call ${t} due to unbound types`,o)},e-1),kt([],o,r=>(r=[r[0],null].concat(r.slice(1)),bt(t,Rt(t,r,null,a,i,s),e-1),[]))},j:(t,e,r,n,a)=>{e=L(e);let i=t=>t;if(0===n){var s=32-8*r;i=t=>t<<s>>>s,a=i(a)}X(t,{name:e,la:i,pa:(t,e)=>e,za:K(e,r,0!==n),qa:null})},g:(t,e,r)=>{function n(t){return new a(v.buffer,_[t+4>>2],_[t>>2])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];X(t,{name:r=L(r),la:n,za:n},{Ib:!0})},K:(t,e)=>{X(t,{name:e=L(e),la(t){var e=I(t+4,_[t>>2],!0);return We(t),e},pa(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;if(!(r||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT))throw new W("Cannot pass non-string to std::string");var n=r?Nt(e):e.length,a=Je(4+n+1),i=a+4;return _[a>>2]=n,r?Mt(e,y,i,n+1):y.set(e,i),null!==t&&t.push(We,a),a},za:ft,qa(t){We(t)}})},o:(t,e,r)=>{if(r=L(r),2===e)var n=Ht,a=Vt,i=It;else n=Lt,a=Bt,i=Gt;X(t,{name:r,la:t=>{var r=n(t+4,_[t>>2]*e,!0);return We(t),r},pa:(t,n)=>{if("string"!=typeof n)throw new W(`Cannot pass non-string to C++ string type ${r}`);var s=i(n),o=Je(4+s+e);return _[o>>2]=s/e,a(n,o+4,s+e),null!==t&&t.push(We,o),o},za:ft,qa(t){We(t)}})},p:t=>{X(t,Ft)},M:(t,e)=>{X(t,{pb:!0,name:e=L(e),la:()=>{},pa:()=>{}})},B:()=>{z=!1,qt=0},y:()=>{throw 1/0},l:(t,e,r)=>{var[n,...a]=((t,e)=>{for(var r=Array(t),n=0;n<t;++n){var a=n,i=_[e+4*n>>2],s=G[i];if(void 0===s)throw t=`parameter ${n} has unknown type ${At(i)}`,new W(t);r[a]=s}return r})(t,e);e=n.pa.bind(n);var i=a.map(t=>t.za.bind(t));t--;var s={toValue:Ut};switch(t=i.map((t,e)=>{var r=`argFromPtr${e}`;return s[r]=t,`${r}(args${e?"+"+8*e:""})`}),r){case 0:var o="toValue(handle)";break;case 2:o="new (toValue(handle))";break;case 3:o="";break;case 1:s.getStringOrSymbol=Kt,o="toValue(handle)[getStringOrSymbol(methodName)]"}return o+=`(${t})`,n.pb||(s.toReturnWire=e,s.emval_returnValue=Jt,o=`return emval_returnValue(toReturnWire, destructorsRef, ${o})`),o=`return function (handle, methodName, destructorsRef, args) {\n ${o}\n }`,r=new Function(Object.keys(s),o)(...Object.values(s)),o=`methodCaller<(${a.map(t=>t.name)}) => ${n.name}>`,(t=>{var e=Wt.length;return Wt.push(t),e})(nt(o,r))},A:xt,N:t=>t?(t=Kt(t),jt(globalThis[t])):jt(globalThis),n:(t,e)=>(t=Ut(t),e=Ut(e),jt(t[e])),q:t=>{9<t&&(Zt[t+1]+=1)},k:(t,e,r,n,a)=>Wt[t](e,r,n,a),O:t=>jt(Kt(t)),w:t=>{var e=Ut(t);Ct(e),xt(t)},C:(t,e)=>{if(Qt[t]&&(clearTimeout(Qt[t].id),delete Qt[t]),!e)return 0;var r=setTimeout(()=>{delete Qt[t],(t=>{if(!P)try{if(t(),!(z||0<qt))try{p=t=p,Yt(t)}catch(t){t instanceof j||"unwind"==t||l(1,t)}}catch(t){t instanceof j||"unwind"==t||l(1,t)}})(()=>Ke(t,performance.now()))},e);return Qt[t]={id:r,vc:e},0},E:t=>{var e=y.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=e*(1+.2/r);n=Math.min(n,t+100663296);t:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(t,n)/65536))-er.buffer.byteLength+65535)/65536|0;try{er.grow(n),x();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},G:function(t){try{var e=Me(t);return qe.close(e),0}catch(t){if(void 0===qe||"ErrnoError"!==t.name)throw t;return t.Da}},F:function(t,e,r,n){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{if(isNaN(e))return 61;var a=Me(t);return qe.na(a,e,r),k[n>>3]=BigInt(a.position),a.Wa&&0===e&&0===r&&(a.Wa=null),0}catch(t){if(void 0===qe||"ErrnoError"!==t.name)throw t;return t.Da}},H:function(t,e,r,n){try{t:{var a=Me(t);t=e;for(var i,s=e=0;s<r;s++){var o=_[t>>2],h=_[t+4>>2];t+=8;var l=qe.write(a,v,o,h,i);if(0>l){var c=-1;break t}if(e+=l,l<h)break;void 0!==i&&(i+=l)}c=e}return _[n>>2]=c,0}catch(t){if(void 0===qe||"ErrnoError"!==t.name)throw t;return t.Da}},i:function(t,e){var r=tr();try{return rr.get(t)(e)}catch(t){if(Ye(r),t!==t+0)throw t;Qe(1,0)}},e:function(t,e,r){var n=tr();try{return rr.get(t)(e,r)}catch(t){if(Ye(n),t!==t+0)throw t;Qe(1,0)}},d:function(t,e,r,n){var a=tr();try{return rr.get(t)(e,r,n)}catch(t){if(Ye(a),t!==t+0)throw t;Qe(1,0)}},s:function(t,e,r,n,a,i){var s=tr();try{return rr.get(t)(e,r,n,a,i)}catch(t){if(Ye(s),t!==t+0)throw t;Qe(1,0)}},r:function(t){var e=tr();try{rr.get(t)()}catch(t){if(Ye(e),t!==t+0)throw t;Qe(1,0)}},a:function(t,e){var r=tr();try{rr.get(t)(e)}catch(t){if(Ye(r),t!==t+0)throw t;Qe(1,0)}},b:function(t,e,r){var n=tr();try{rr.get(t)(e,r)}catch(t){if(Ye(n),t!==t+0)throw t;Qe(1,0)}},f:function(t,e,r,n){var a=tr();try{rr.get(t)(e,r,n)}catch(t){if(Ye(a),t!==t+0)throw t;Qe(1,0)}},m:function(t,e,r,n,a){var i=tr();try{rr.get(t)(e,r,n,a)}catch(t){if(Ye(i),t!==t+0)throw t;Qe(1,0)}},z:Yt};return nr=await async function(){function t(t){return t=nr=t.exports,We=t.R,Je=t.S,Xe=t.T,Ke=t.V,Qe=t.W,Ye=t.X,tr=t.Y,er=t.P,rr=t.U,x(),nr}var e={a:ar};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(e,(e,r)=>{n(t(e))})}):(C??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",u):u+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,t((await async function(t){var e=C;if(!f&&!O(e)&&!i)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){R(`wasm streaming compile failed: ${t}`),R("falling back to ArrayBuffer instantiation")}return async function(t,e){try{var r=await async function(t){if(!f)try{var e=await o(t);return new Uint8Array(e)}catch{}if(t==C&&f)t=new Uint8Array(f);else{if(!h)throw"both async and sync fetching of the wasm failed";t=h(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){R(`failed to asynchronously prepare wasm: ${t}`),U(t)}}(e,t)}(e)).instance))}(),function t(){function e(){if(r.calledRun=!0,!P){if(Z=!0,r.noFSInit||qe.Xa||Ae(),nr.Q(),qe.nb=!1,w?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();D.push(t)}F(D)}}if(0<ve)ye=t;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)N();F(M),0<ve?ye=t:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),e()},1)):e()}}(),e=Z?r:new Promise((t,e)=>{w=t,m=e}),e}({locateFile:(t,e)=>t.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":e+t})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const t=this.config?.renderer||"sw";if(await(async t=>{if("wg"===t){for(;"requested"===pt;)await ft(100);if("initialized"!==pt&&(pt="requested",ct))for(;;)switch(ct.init()){case 0:return void(pt="initialized");case 1:return void(pt="failed");case 2:await ft(100)}}})(t),"failed"===pt)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ct.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:t,right:e,top:r,bottom:n}=this.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight;let s=0,o=0,h=this.canvas.width,l=this.canvas.height;t<0&&(s=Math.abs(t),h-=s),r<0&&(o=Math.abs(r),l-=o),e>a&&(h-=e-a),n>i&&(l-=n-i),this.TVG.viewport(s,o,h,l)}_observerCallback(t){const e=t[0],r=e.target;r._observable=e.isIntersecting,e.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(t){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(t){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(t,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const t=1+.75*(window.devicePixelRatio-1),{width:e,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=e*t,this.canvas.height=r*t}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const t=this.TVG.render(),e=new Uint8ClampedArray(t,0,t.byteLength);e.length<1||(this._imageData=new ImageData(e,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const t=this.TVG.duration(),e=Date.now()/1e3;if(this.currentFrame=(e-this._beginTime)/t*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const t=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||t&&this._counter<t)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ft(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(t){this.TVG&&(this.pause(),this.currentFrame=t,this.TVG.frame(t))}async load(t,e="json"){try{await this._init();const r=await(async(t,e)=>{const r=new TextEncoder;let n=t;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===e||"lot"===e)return n=await(async t=>{try{t=JSON.parse(t)}catch(e){const r=await(async t=>{if("string"!=typeof t)throw new Error("The url value must be a string");try{const e=new URL(t),r=await fetch(e.toString());return await r.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(t);t=JSON.stringify(r)}return t})(n),r.encode(n);const t=await(async t=>(await fetch(t)).arrayBuffer())(n);return new Uint8Array(t);default:throw new Error("Invalid src type")}})(t,e);this.dispatchEvent(new CustomEvent("ready")),this.fileType=e,await this._loadBytes(r)}catch(t){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(this.totalFrame=this.TVG.totalFrame(),this.totalFrame<1||(this._beginTime=Date.now()/1e3,"playing"===this.currentState))))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(t){this._frame(t),await this._update(),this._render()}resize(t,e){this.canvas.width=t,this.canvas.height=e,"playing"!==this.currentState&&this._render()}destroy(){this.TVG&&(this.TVG.delete(),this.TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ct&&(ct.term(),ct=null)}setLooping(t){this.TVG&&(this.loop=t)}setDirection(t){this.TVG&&(this.direction=t)}setSpeed(t){this.TVG&&(this.speed=t)}setBgColor(t){this.TVG&&(this.canvas.style.backgroundColor=t)}setQuality(t){this.TVG&&this.TVG.quality(t)&&"playing"!==this.currentState&&this._render()}setAssetResolver(t,e){this._assetResolverCallback=t,this._assetResolverData=e,this.TVG&&this.TVG.setAssetResolver(t,e)}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return I`
|
|
1
|
+
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let a=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const r=this.t;if(e&&void 0===t){const e=void 0!==r&&1===r.length;e&&(t=n.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(r,t))}return t}toString(){return this.cssText}};const i=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:s,defineProperty:o,getOwnPropertyDescriptor:h,getOwnPropertyNames:l,getOwnPropertySymbols:c,getPrototypeOf:u}=Object,d=globalThis,f=d.trustedTypes,p=f?f.emptyScript:"",w=d.reactiveElementPolyfillSupport,m=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},y=(t,e)=>!s(t,e),g={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let b=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&o(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:a}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=n?.call(this);a?.call(this,e),this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??g}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...l(t),...c(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(i(t))}else void 0!==t&&e.push(i(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(e)r.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),a=t.litNonce;void 0!==a&&n.setAttribute("nonce",a),n.textContent=e.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(e,r.type);this._$Em=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const i=a.fromAttribute(e,t.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,a=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??y)(a,e)||r.useDefault&&r.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:a},i){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==a||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[m("elementProperties")]=new Map,b[m("finalized")]=new Map,w?.({ReactiveElement:b}),(d.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_=(t=$,e,r)=>{const{kind:n,metadata:a}=r;let i=globalThis.litPropertyMetadata.get(a);if(void 0===i&&globalThis.litPropertyMetadata.set(a,i=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),i.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const a=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,a,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const a=this[n];e.call(this,r),this.requestUpdate(n,a,t)}}throw Error("Unsupported decorator location: "+n)};function A(t){return(e,r)=>"object"==typeof r?_(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const E=globalThis,k=E.trustedTypes,S=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,R="?"+T,P=`<${R}>`,O=document,Z=()=>O.createComment(""),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,U=Array.isArray,j="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,M=/>/g,N=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,H=/"/g,V=/^(?:script|style|textarea|title)$/i,I=(t,...e)=>({_$litType$:1,strings:t,values:e}),L=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),G=new WeakMap,q=O.createTreeWalker(O,129);function W(t,e){if(!U(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const J=(t,e)=>{const r=t.length-1,n=[];let a,i=2===e?"<svg>":3===e?"<math>":"",s=F;for(let e=0;e<r;e++){const r=t[e];let o,h,l=-1,c=0;for(;c<r.length&&(s.lastIndex=c,h=s.exec(r),null!==h);)c=s.lastIndex,s===F?"!--"===h[1]?s=D:void 0!==h[1]?s=M:void 0!==h[2]?(V.test(h[2])&&(a=RegExp("</"+h[2],"g")),s=N):void 0!==h[3]&&(s=N):s===N?">"===h[0]?(s=a??F,l=-1):void 0===h[1]?l=-2:(l=s.lastIndex-h[2].length,o=h[1],s=void 0===h[3]?N:'"'===h[3]?H:z):s===H||s===z?s=N:s===D||s===M?s=F:(s=N,a=void 0);const u=s===N&&t[e+1].startsWith("/>")?" ":"";i+=s===F?r+P:l>=0?(n.push(o),r.slice(0,l)+C+r.slice(l)+T+u):r+T+(-2===l?e:u)}return[W(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class X{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let a=0,i=0;const s=t.length-1,o=this.parts,[h,l]=J(t,e);if(this.el=X.createElement(h,r),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=q.nextNode())&&o.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(C)){const e=l[i++],r=n.getAttribute(t).split(T),s=/([.?@])?(.*)/.exec(e);o.push({type:1,index:a,name:s[2],strings:r,ctor:"."===s[1]?et:"?"===s[1]?rt:"@"===s[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(T)&&(o.push({type:6,index:a}),n.removeAttribute(t));if(V.test(n.tagName)){const t=n.textContent.split(T),e=t.length-1;if(e>0){n.textContent=k?k.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],Z()),q.nextNode(),o.push({type:2,index:++a});n.append(t[e],Z())}}}else if(8===n.nodeType)if(n.data===R)o.push({type:2,index:a});else{let t=-1;for(;-1!==(t=n.data.indexOf(T,t+1));)o.push({type:7,index:a}),t+=T.length-1}a++}}static createElement(t,e){const r=O.createElement("template");return r.innerHTML=t,r}}function K(t,e,r=t,n){if(e===L)return e;let a=void 0!==n?r._$Co?.[n]:r._$Cl;const i=x(e)?void 0:e._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),void 0===i?a=void 0:(a=new i(t),a._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=a:r._$Cl=a),void 0!==a&&(e=K(t,a._$AS(t,e.values),a,n)),e}class Q{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??O).importNode(e,!0);q.currentNode=n;let a=q.nextNode(),i=0,s=0,o=r[0];for(;void 0!==o;){if(i===o.index){let e;2===o.type?e=new Y(a,a.nextSibling,this,t):1===o.type?e=new o.ctor(a,o.name,o.strings,this,t):6===o.type&&(e=new at(a,this,t)),this._$AV.push(e),o=r[++s]}i!==o?.index&&(a=q.nextNode(),i++)}return q.currentNode=O,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Y{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=B,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=K(this,t,e),x(t)?t===B||null==t||""===t?(this._$AH!==B&&this._$AR(),this._$AH=B):t!==this._$AH&&t!==L&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>U(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==B&&x(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=X.createElement(W(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new Q(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new X(t)),e}k(t){U(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const a of t)n===e.length?e.push(r=new Y(this.O(Z()),this.O(Z()),this,this.options)):r=e[n],r._$AI(a),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,a){this.type=1,this._$AH=B,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=B}_$AI(t,e=this,r,n){const a=this.strings;let i=!1;if(void 0===a)t=K(this,t,e,0),i=!x(t)||t!==this._$AH&&t!==L,i&&(this._$AH=t);else{const n=t;let s,o;for(t=a[0],s=0;s<a.length-1;s++)o=K(this,n[r+s],e,s),o===L&&(o=this._$AH[s]),i||=!x(o)||o!==this._$AH[s],o===B?t=B:t!==B&&(t+=(o??"")+a[s+1]),this._$AH[s]=o}i&&!n&&this.j(t)}j(t){t===B?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===B?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==B)}}class nt extends tt{constructor(t,e,r,n,a){super(t,e,r,n,a),this.type=5}_$AI(t,e=this){if((t=K(this,t,e,0)??B)===L)return;const r=this._$AH,n=t===B&&r!==B||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,a=t!==B&&(r===B||n);n&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const it=E.litHtmlPolyfillSupport;it?.(X,Y),(E.litHtmlVersions??=[]).push("3.3.1");const st=globalThis;class ot extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let a=n._$litPart$;if(void 0===a){const t=r?.renderBefore??null;n._$litPart$=a=new Y(e.insertBefore(Z(),t),t,void 0,r??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}}ot._$litElement$=!0,ot.finalized=!0,st.litElementHydrateSupport?.({LitElement:ot});const ht=st.litElementPolyfillSupport;function lt(t,e,r,n){var a,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}ht?.({LitElement:ot}),(st.litElementVersions??=[]).push("4.2.1");let ct=null,ut=!1;var dt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const ft=t=>new Promise(e=>setTimeout(e,t));let pt="idle";class wt extends ot{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ut)for(;!ct;)await ft(100);if(ct||(ut=!0,ct=await async function(t={}){var e,r=t,n=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(i){const{createRequire:t}=await Promise.resolve().then(function(){return yt});var s=t(import.meta.url)}var o,h,l=(t,e)=>{throw e},c=import.meta.url,u="";if(i){var d=s("fs");c.startsWith("file:")&&(u=s("path").dirname(s("url").fileURLToPath(c))+"/"),h=t=>(t=O(t)?new URL(t):t,d.readFileSync(t)),o=async t=>(t=O(t)?new URL(t):t,d.readFileSync(t,void 0)),process.argv.slice(2),l=(t,e)=>{throw process.exitCode=t,e}}else if(n||a){try{u=new URL(".",c).href}catch{}a&&(h=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=async t=>{if(O(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var f,p,w,m,v,y,g,b,$,_,A,E,k,S,C,T=function(){}.bind(),R=function(){}.bind(),P=!1,O=t=>t.startsWith("file://"),Z=!1;function x(){var t=er.buffer;v=new Int8Array(t),g=new Int16Array(t),y=new Uint8Array(t),b=new Uint16Array(t),$=new Int32Array(t),_=new Uint32Array(t),A=new Float32Array(t),E=new Float64Array(t),k=new BigInt64Array(t),S=new BigUint64Array(t)}function U(t){throw r.onAbort?.(t),R(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),m?.(t),t}class j{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var F=t=>{for(;0<t.length;)t.shift()(r)},D=[],M=[],N=()=>{var t=r.preRun.shift();M.push(t)},z=!0,H=new TextDecoder,V=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},I=(t,e,r)=>t?H.decode(y.subarray(t,V(y,t,e,r))):"",L=t=>{for(var e="";;){var r=y[t++];if(!r)return e;e+=String.fromCharCode(r)}},B={},G={},q={},W=class extends Error{constructor(t){super(t),this.name="BindingError"}},J=t=>{throw new W(t)};function X(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new W(`type "${n}" must have a positive integer typeid pointer`);if(G.hasOwnProperty(t)){if(r.Ib)return;throw new W(`Cannot register type '${n}' twice`)}G[t]=e,delete q[t],B.hasOwnProperty(t)&&(e=B[t],delete B[t],e.forEach(t=>t()))}(t,e,r)}var K=(t,e,r)=>{switch(e){case 1:return r?t=>v[t]:t=>y[t];case 2:return r?t=>g[t>>1]:t=>b[t>>1];case 4:return r?t=>$[t>>2]:t=>_[t>>2];case 8:return r?t=>k[t>>3]:t=>S[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Q=t=>{throw new W(t.$.ha.ea.name+" instance already deleted")},Y=!1,tt=()=>{},et=t=>globalThis.FinalizationRegistry?(Y=new FinalizationRegistry(t=>{--(t=t.$).count.value,0===t.count.value&&(t.ka?t.oa.Ba(t.ka):t.ha.ea.Ba(t.fa))}),et=t=>{var e=t.$;return e.ka&&Y.register(t,{$:e},t),t},tt=t=>{Y.unregister(t)},et(t)):(et=t=>t,t);function rt(){}var nt=(t,e)=>Object.defineProperty(e,"name",{value:t}),at={},it=(t,e,r)=>{if(void 0===t[e].ja){var n=t[e];t[e]=function(...n){if(!t[e].ja.hasOwnProperty(n.length))throw new W(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].ja})!`);return t[e].ja[n.length].apply(this,n)},t[e].ja=[],t[e].ja[n.Ja]=n}},st=(t,e,n)=>{if(r.hasOwnProperty(t)){if(void 0===n||void 0!==r[t].ja&&void 0!==r[t].ja[n])throw new W(`Cannot register public name '${t}' twice`);if(it(r,t,t),r[t].ja.hasOwnProperty(n))throw new W(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].ja[n]=e}else r[t]=e,r[t].Ja=n};function ot(t,e,r,n,a,i,s,o){this.name=t,this.constructor=e,this.Ga=r,this.Ba=n,this.ma=a,this.Eb=i,this.Oa=s,this.Ab=o,this.Ob=[]}var ht=(t,e,r)=>{for(;e!==r;){if(!e.Oa)throw new W(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Oa(t),e=e.ma}return t},lt=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ct(t,e){if(null===e){if(this.Ya)throw new W(`null is not a valid ${this.name}`);return 0}if(!e.$)throw new W(`Cannot pass "${lt(e)}" as a ${this.name}`);if(!e.$.fa)throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);return ht(e.$.fa,e.$.ha.ea,this.ea)}function ut(t,e){if(null===e){if(this.Ya)throw new W(`null is not a valid ${this.name}`);if(this.Ra){var r=this.Pb();return null!==t&&t.push(this.Ba,r),r}return 0}if(!e||!e.$)throw new W(`Cannot pass "${lt(e)}" as a ${this.name}`);if(!e.$.fa)throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Qa&&e.$.ha.Qa)throw new W(`Cannot convert argument of type ${e.$.oa?e.$.oa.name:e.$.ha.name} to parameter type ${this.name}`);if(r=ht(e.$.fa,e.$.ha.ea,this.ea),this.Ra){if(void 0===e.$.ka)throw new W("Passing raw pointer to smart pointer is illegal");switch(this.Rb){case 0:if(e.$.oa!==this)throw new W(`Cannot convert argument of type ${e.$.oa?e.$.oa.name:e.$.ha.name} to parameter type ${this.name}`);r=e.$.ka;break;case 1:r=e.$.ka;break;case 2:if(e.$.oa===this)r=e.$.ka;else{var n=e.clone();r=this.Qb(r,jt(()=>n.delete())),null!==t&&t.push(this.Ba,r)}break;default:throw new W("Unsupporting sharing policy")}}return r}function dt(t,e){if(null===e){if(this.Ya)throw new W(`null is not a valid ${this.name}`);return 0}if(!e.$)throw new W(`Cannot pass "${lt(e)}" as a ${this.name}`);if(!e.$.fa)throw new W(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.$.ha.Qa)throw new W(`Cannot convert argument of type ${e.$.ha.name} to parameter type ${this.name}`);return ht(e.$.fa,e.$.ha.ea,this.ea)}function ft(t){return this.la(_[t>>2])}var pt=(t,e,r)=>e===r?t:void 0===r.ma||null===(t=pt(t,e,r.ma))?null:r.Ab(t),wt={},mt=class extends Error{constructor(t){super(t),this.name="InternalError"}},vt=(t,e)=>{if(!e.ha||!e.fa)throw new mt("makeClassHandle requires ptr and ptrType");if(!!e.oa!=!!e.ka)throw new mt("Both smartPtrType and smartPtr must be specified");return e.count={value:1},et(Object.create(t,{$:{value:e,writable:!0}}))};function gt(t,e,r,n,a,i,s,o,h,l,c){this.name=t,this.ea=e,this.Ya=r,this.Qa=n,this.Ra=a,this.Nb=i,this.Rb=s,this.rb=o,this.Pb=h,this.Qb=l,this.Ba=c,a||void 0!==e.ma?this.pa=ut:(this.pa=n?ct:dt,this.qa=null)}var bt=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new mt("Replacing nonexistent public symbol");void 0!==r[t].ja&&void 0!==n?r[t].ja[n]=e:(r[t]=e,r[t].Ja=n)},$t=(t,e)=>{t=L(t);var r=rr.get(e);if("function"!=typeof r)throw new W(`unknown function pointer with signature ${t}: ${e}`);return r};class _t extends Error{}var At=t=>{t=Xe(t);var e=L(t);return We(t),e},Et=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||G[e]||(q[e]?q[e].forEach(t):(r.push(e),n[e]=!0))}),new _t(`${t}: `+r.map(At).join([", "]))},kt=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new mt("Mismatched type converter count");for(var n=0;n<t.length;++n)X(t[n],e[n])}t.forEach(t=>q[t]=e);var a=Array(e.length),i=[],s=0;for(let[t,r]of e.entries())G.hasOwnProperty(r)?a[t]=G[r]:(i.push(r),B.hasOwnProperty(r)||(B[r]=[]),B[r].push(()=>{a[t]=G[r],++s===i.length&&n(a)}));0===i.length&&n(a)},St=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+4*n>>2]);return r},Ct=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function Tt(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].qa)return!0;return!1}function Rt(t,e,r,n,a,i){var s=e.length;if(2>s)throw new W("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==e[1]&&null!==r,h=Tt(e);r=!e[0].pb;var l=e[0],c=e[1];for(n=[t,J,n,a,Ct,l.la.bind(l),c?.pa.bind(c)],a=2;a<s;++a)n.push((l=e[a]).pa.bind(l));if(!h)for(a=o?1:2;a<e.length;++a)null!==e[a].qa&&n.push(e[a].qa);for(h=Tt(e),a=e.length-2,c=[],l=["fn"],o&&l.push("thisWired"),s=0;s<a;++s)c.push(`arg${s}`),l.push(`arg${s}Wired`);c=c.join(","),l=l.join(","),c=`return function (${c}) {\n`,h&&(c+="var destructors = [];\n");var u=h?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(o&&(c+=`var thisWired = toClassParamWire(${u}, this);\n`),s=0;s<a;++s){var f=`toArg${s}Wire`;c+=`var arg${s}Wired = ${f}(${u}, arg${s});\n`,d.push(f)}if(c+=(r||i?"var rv = ":"")+`invoker(${l});\n`,h)c+="runDestructors(destructors);\n";else for(s=o?1:2;s<e.length;++s)i=1===s?"thisWired":"arg"+(s-2)+"Wired",null!==e[s].qa&&(c+=`${i}_dtor(${i});\n`,d.push(`${i}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,c+"}\n")(...n),nt(t,e)}var Pt=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},Ot=[],Zt=[0,1,,1,null,1,!0,1,!1,1],xt=t=>{9<t&&0===--Zt[t+1]&&(Zt[t]=void 0,Ot.push(t))},Ut=t=>{if(!t)throw new W(`Cannot use deleted val. handle = ${t}`);return Zt[t]},jt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=Ot.pop()||Zt.length;return Zt[e]=t,Zt[e+1]=1,e}},Ft={name:"emscripten::val",la:t=>{var e=Ut(t);return xt(t),e},pa:(t,e)=>jt(e),za:ft,qa:null},Dt=(t,e)=>{switch(e){case 4:return function(t){return this.la(A[t>>2])};case 8:return function(t){return this.la(E[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Mt=(t,e,r,n)=>{if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<t.length;++i){var s=t.codePointAt(i);if(127>=s){if(r>=n)break;e[r++]=s}else if(2047>=s){if(r+1>=n)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(65535>=s){if(r+2>=n)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=n)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s,i++}}return e[r]=0,r-a},Nt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},zt=new TextDecoder("utf-16le"),Ht=(t,e,r)=>zt.decode(b.subarray(t>>=1,V(b,t,e/2,r))),Vt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var a=0;a<r;++a)g[e>>1]=t.charCodeAt(a),e+=2;return g[e>>1]=0,e-n},It=t=>2*t.length,Lt=(t,e,r)=>{var n="";t>>=2;for(var a=0;!(a>=e/4);a++){var i=_[t+a];if(!i&&!r)break;n+=String.fromCodePoint(i)}return n},Bt=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var a=0;a<t.length;++a){var i=t.codePointAt(a);if(65535<i&&a++,$[e>>2]=i,(e+=4)+4>r)break}return $[e>>2]=0,e-n},Gt=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},qt=0,Wt=[],Jt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(_[e>>2]=jt(n)),t},Xt={},Kt=t=>{var e=Xt[t];return void 0===e?L(t):e},Qt={},Yt=t=>{p=t,z||0<qt||(r.onExit?.(t),P=!0),l(t,new j(t))},te=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var a=t[n];"."===a?t.splice(n,1):".."===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},ee=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=te(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},re=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},ne=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],ae=t=>{(ae=(()=>{if(i){var t=s("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},ie=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:qe.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=te(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},se=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=ie(t).slice(1),e=ie(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),a=n,i=0;i<n;i++)if(t[i]!==e[i]){a=i;break}for(n=[],i=a;i<t.length;i++)n.push("..");return(n=n.concat(e.slice(a))).join("/")},oe=t=>{var e=V(t,0);return H.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},he=[],le=t=>{var e=Array(Nt(t)+1);return t=Mt(t,e,0,e.length),e.length=t,e},ce=[];function ue(t,e){ce[t]={input:[],output:[],Ia:e},Ee(t,de)}var de={open(t){var e=ce[t.node.rdev];if(!e)throw new qe.Z(43);t.tty=e,t.seekable=!1},close(t){t.tty.Ia.fsync(t.tty)},fsync(t){t.tty.Ia.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.Ia.mb)throw new qe.Z(60);for(var a=0,i=0;i<n;i++){try{var s=t.tty.Ia.mb(t.tty)}catch(t){throw new qe.Z(29)}if(void 0===s&&0===a)throw new qe.Z(6);if(null==s)break;a++,e[r+i]=s}return a&&(t.node.atime=Date.now()),a},write(t,e,r,n){if(!t.tty||!t.tty.Ia.bb)throw new qe.Z(60);try{for(var a=0;a<n;a++)t.tty.Ia.bb(t.tty,e[r+a])}catch(t){throw new qe.Z(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),a}},fe={mb(){t:{if(!he.length){var t=null;if(i){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=d.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}he=le(t)}t=he.shift()}return t},bb(t,e){null===e||10===e?(T(oe(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(T(oe(t.output)),t.output=[])},mc:()=>({Zb:25856,ac:5,Yb:191,$b:35387,Xb:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),nc:()=>0,oc:()=>[24,80]},pe={bb(t,e){null===e||10===e?(R(oe(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(R(oe(t.output)),t.output=[])}},we={va:null,ga:()=>we.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||qe.isFIFO(r))throw new qe.Z(63);return we.va||(we.va={dir:{node:{sa:we.aa.sa,ua:we.aa.ua,lookup:we.aa.lookup,xa:we.aa.xa,rename:we.aa.rename,unlink:we.aa.unlink,rmdir:we.aa.rmdir,readdir:we.aa.readdir,symlink:we.aa.symlink},stream:{na:we.ba.na}},file:{node:{sa:we.aa.sa,ua:we.aa.ua},stream:{na:we.ba.na,read:we.ba.read,write:we.ba.write,Ha:we.ba.Ha,Ma:we.ba.Ma}},link:{node:{sa:we.aa.sa,ua:we.aa.ua,readlink:we.aa.readlink},stream:{}},fb:{node:{sa:we.aa.sa,ua:we.aa.ua},stream:qe.yb}}),ke((r=qe.createNode(t,e,r,n)).mode)?(r.aa=we.va.dir.node,r.ba=we.va.dir.stream,r.da={}):qe.isFile(r.mode)?(r.aa=we.va.file.node,r.ba=we.va.file.stream,r.ia=0,r.da=null):40960==(61440&r.mode)?(r.aa=we.va.link.node,r.ba=we.va.link.stream):8192==(61440&r.mode)&&(r.aa=we.va.fb.node,r.ba=we.va.fb.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.da[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},lc:t=>t.da?t.da.subarray?t.da.subarray(0,t.ia):new Uint8Array(t.da):new Uint8Array(0),aa:{sa(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=ke(t.mode)?4096:qe.isFile(t.mode)?t.ia:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},ua(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.ia!=(e=e.size)&&(0==e?(t.da=null,t.ia=0):(r=t.da,t.da=new Uint8Array(e),r&&t.da.set(r.subarray(0,Math.min(e,t.ia))),t.ia=e))},lookup(){throw we.Va||(we.Va=new qe.Z(44),we.Va.stack="<generic error, no stack>"),we.Va},xa:(t,e,r,n)=>we.createNode(t,e,r,n),rename(t,e,r){try{var n=Se(e,r)}catch(t){}if(n){if(ke(t.mode))for(var a in n.da)throw new qe.Z(55);Ce(n)}delete t.parent.da[t.name],e.da[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.da[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=Se(t,e);for(r in n.da)throw new qe.Z(55);delete t.da[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.da)],symlink:(t,e,r)=>((t=we.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new qe.Z(28);return t.link}},ba:{read(t,e,r,n,a){var i=t.node.da;if(a>=t.node.ia)return 0;if(8<(t=Math.min(t.node.ia-a,n))&&i.subarray)e.set(i.subarray(a,a+t),r);else for(n=0;n<t;n++)e[r+n]=i[a+n];return t},write(t,e,r,n,a,i){if(e.buffer===v.buffer&&(i=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.da||t.da.subarray)){if(i)return t.da=e.subarray(r,r+n),t.ia=n;if(0===t.ia&&0===a)return t.da=e.slice(r,r+n),t.ia=n;if(a+n<=t.ia)return t.da.set(e.subarray(r,r+n),a),n}var s=t.da?t.da.length:0;if(s>=(i=a+n)||(i=Math.max(i,s*(1048576>s?2:1.125)>>>0),0!=s&&(i=Math.max(i,256)),s=t.da,t.da=new Uint8Array(i),0<t.ia&&t.da.set(s.subarray(0,t.ia),0)),t.da.subarray&&e.subarray)t.da.set(e.subarray(r,r+n),a);else for(i=0;i<n;i++)t.da[a+i]=e[r+i];return t.ia=Math.max(t.ia,a+n),n},na(t,e,r){if(1===r?e+=t.position:2===r&&qe.isFile(t.node.mode)&&(e+=t.node.ia),0>e)throw new qe.Z(28);return e},Ha(t,e,r,n,a){if(!qe.isFile(t.node.mode))throw new qe.Z(43);if(t=t.node.da,2&a||!t||t.buffer!==v.buffer){if(n=!0,U(),!(a=void 0))throw new qe.Z(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),v.set(t,a))}else n=!1,a=t.byteOffset;return{fa:a,Tb:n}},Ma:(t,e,r,n)=>(we.ba.write(t,e,0,n,r,!1),0)}},me=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},ve=0,ye=null,ge=()=>{if(ve--,r.monitorRunDependencies?.(ve),0==ve&&ye){var t=ye;ye=null,t()}},be=()=>{ve++,r.monitorRunDependencies?.(ve)},$e=[],_e=async(t,e,r,n,a,i,s,h)=>{var l=e?ie(ee(t+"/"+e)):t;be();try{var c=r;"string"==typeof r&&(c=await(async t=>(t=await o(t),new Uint8Array(t)))(r)),c=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&Ae(),$e))if(r.canHandle(e))return r.handle(t,e);return t})(c,l),h?.(),i||Te(t,e,c,n,a,s)}finally{ge()}};function Ae(){var t,e,n;qe.Xa=!0,t??=r.stdin,e??=r.stdout,n??=r.stderr,t?qe.Aa("/dev","stdin",t):qe.symlink("/dev/tty","/dev/stdin"),e?qe.Aa("/dev","stdout",null,e):qe.symlink("/dev/tty","/dev/stdout"),n?qe.Aa("/dev","stderr",null,n):qe.symlink("/dev/tty1","/dev/stderr"),qe.open("/dev/stdin",0),qe.open("/dev/stdout",1),qe.open("/dev/stderr",1)}function Ee(t,e){qe.jb[t]={ba:e}}function ke(t){return 16384==(61440&t)}function Se(t,e){var r=ke(t.mode)?(r=Ue(t,"x"))?r:t.aa.lookup?0:2:54;if(r)throw new qe.Z(r);for(r=qe.ya[Oe(t.id,e)];r;r=r.Fa)if(r.parent.id===t.id&&r.name===e)return r;return qe.lookup(t,e)}function Ce(t){var e=Oe(t.parent.id,t.name);if(qe.ya[e]===t)qe.ya[e]=t.Fa;else for(e=qe.ya[e];e;){if(e.Fa===t){e.Fa=t.Fa;break}e=e.Fa}}function Te(t,e,r,n,a,i){var s=e;if(t&&(t="string"==typeof t?t:Pe(t),s=e?ee(t+"/"+e):t),t=me(n,a),s=qe.create(s,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,a=r.length;n<a;++n)e[n]=r.charCodeAt(n);r=e}qe.chmod(s,146|t),e=qe.open(s,577),qe.write(e,r,0,r.length,0,i),qe.close(e),qe.chmod(s,t)}}function Re(t,e={}){if(!t)throw new qe.Z(44);e.Pa??(e.Pa=!0),"/"===t.charAt(0)||(t=qe.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=qe.root,a="/",i=0;i<t.length;i++){var s=i===t.length-1;if(s&&e.parent)break;if("."!==t[i])if(".."===t[i]){if(a=re(a),qe.Za(n)){t=a+"/"+t.slice(i+1).join("/"),r--;continue t}n=n.parent}else{a=ee(a+"/"+t[i]);try{n=Se(n,t[i])}catch(t){if(44===t?.Da&&s&&e.Lb)return{path:a};throw t}if(!n.ta||s&&!e.Pa||(n=n.ta.root),40960==(61440&n.mode)&&(!s||e.ra)){if(!n.aa.readlink)throw new qe.Z(52);"/"===(n=n.aa.readlink(n)).charAt(0)||(n=re(a)+"/"+n),t=n+"/"+t.slice(i+1).join("/");continue t}}}return{path:a,node:n}}throw new qe.Z(32)}function Pe(t){for(var e;;){if(qe.Za(t))return t=t.ga.qb,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function Oe(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%qe.ya.length}function Ze(t){var e=Oe(t.parent.id,t.name);t.Fa=qe.ya[e],qe.ya[e]=t}function xe(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function Ue(t,e){return qe.nb?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function je(t,e){if(!ke(t.mode))return 54;try{return Se(t,e),20}catch(t){}return Ue(t,"wx")}function Fe(t,e,r){try{var n=Se(t,e)}catch(t){return t.Da}if(t=Ue(t,"wx"))return t;if(r){if(!ke(n.mode))return 54;if(qe.Za(n)||Pe(n)===qe.cwd())return 10}else if(ke(n.mode))return 31;return 0}function De(t,e){if(!t)throw new qe.Z(e);return t}function Me(t){if(!(t=qe.Hb(t)))throw new qe.Z(8);return t}function Ne(t,e=-1){if(t=Object.assign(new qe.wb,t),-1==e)t:{for(e=0;e<=qe.xb;e++)if(!qe.streams[e])break t;throw new qe.Z(33)}return t.fd=e,qe.streams[e]=t}function ze(t,e,r){var n=t?.ba.ua;t=n?t:e,n??=e.aa.ua,De(n,63),n(t,r)}function He(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.La)}return e}function Ve(t){var e={Wb:4096,ic:4096,blocks:1e6,Vb:5e5,Ub:5e5,files:qe.ab,fc:qe.ab-1,jc:42,flags:2,rc:255};return t.aa.tb&&Object.assign(e,t.aa.tb(t.ga.Mb.root)),e}function Ie(t,e,r){return void 0===r&&(r=e,e=438),qe.xa(t,8192|e,r)}function Le(t,e,r,n){ze(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),kb:n})}function Be(t,e,r){if(ke(e.mode))throw new qe.Z(31);if(!qe.isFile(e.mode))throw new qe.Z(28);var n=Ue(e,"w");if(n)throw new qe.Z(n);ze(t,e,{size:r,timestamp:Date.now()})}function Ge(t){if(!(t.Jb||t.Kb||t.link||t.da))if(globalThis.XMLHttpRequest)U("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{t.da=h(t.url)}catch(t){throw new qe.Z(29)}}var qe={root:null,La:[],jb:{},streams:[],ab:1,ya:null,gb:"/",Xa:!1,nb:!0,Db:null,Sa:0,sb:{},Z:class{name="ErrnoError";constructor(t){this.Da=t}},wb:class{wa={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.wa.flags}set flags(t){this.wa.flags=t}get position(){return this.wa.position}set position(t){this.wa.position=t}},vb:class{aa={};ba={};ta=null;constructor(t,e,r,n){t||=this,this.parent=t,this.ga=t.ga,this.id=qe.ab++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get Kb(){return ke(this.mode)}get Jb(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>(Ze(t=new qe.vb(t,e,r,n)),t),Za:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),xb:4096,Hb:t=>qe.streams[t],ec:(t,e=-1)=>(t=Ne(t,e),t.ba?.dc?.(t),t),yb:{open(t){t.ba=qe.Fb(t.node.rdev).ba,t.ba.open?.(t)},na(){throw new qe.Z(70)}},$a:t=>t>>8,pc:t=>255&t,Ea:(t,e)=>t<<8|e,Fb:t=>qe.jb[t],ub(t,e){function r(t){return qe.Sa--,e(t)}function n(t){if(t){if(!n.Bb)return n.Bb=!0,r(t)}else++s>=i.length&&r(null)}"function"==typeof t&&(e=t,t=!1),qe.Sa++,1<qe.Sa&&R(`warning: ${qe.Sa} FS.syncfs operations in flight at once, probably just doing extra work`);var a,i=He(qe.root.ga),s=0;for(a of i)a.type.ub?a.type.ub(a,t,n):n(null)},ga(t,e,r){var n="/"===r;if(n&&qe.root)throw new qe.Z(10);if(!n&&r){var a=Re(r,{Pa:!1});if(r=a.path,(a=a.node).ta)throw new qe.Z(10);if(!ke(a.mode))throw new qe.Z(54)}return(t=t.ga(e={type:t,Mb:e,qb:r,La:[]})).ga=e,e.root=t,n?qe.root=t:a&&(a.ta=e,a.ga&&a.ga.La.push(e)),t},wc(t){if(!(t=Re(t,{Pa:!1})).node.ta)throw new qe.Z(28);var e=(t=t.node).ta,r=He(e);for([,a]of Object.entries(qe.ya))for(;a;){var n=a.Fa;r.includes(a.ga)&&Ce(a);var a=n}t.ta=null,t.ga.La.splice(t.ga.La.indexOf(e),1)},lookup:(t,e)=>t.aa.lookup(t,e),xa(t,e,r){var n=Re(t,{parent:!0}).node;if(!(t=ne(t)))throw new qe.Z(28);if("."===t||".."===t)throw new qe.Z(20);var a=je(n,t);if(a)throw new qe.Z(a);if(!n.aa.xa)throw new qe.Z(63);return n.aa.xa(n,t,e,r)},tb:t=>Ve(Re(t,{ra:!0}).node),uc:t=>Ve(t.node),create:(t,e=438)=>qe.xa(t,4095&e|32768,0),mkdir:(t,e=511)=>qe.xa(t,1023&e|16384,0),qc(t,e){var r,n=t.split("/"),a="";for(r of n)if(r){(a||"/"===t.charAt(0))&&(a+="/"),a+=r;try{qe.mkdir(a,e)}catch(t){if(20!=t.Da)throw t}}},symlink(t,e){if(!ie(t))throw new qe.Z(44);var r=Re(e,{parent:!0}).node;if(!r)throw new qe.Z(44);var n=je(r,e=ne(e));if(n)throw new qe.Z(n);if(!r.aa.symlink)throw new qe.Z(63);return r.aa.symlink(r,e,t)},rename(t,e){var r=re(t),n=re(e),a=ne(t),i=ne(e),s=Re(t,{parent:!0}),o=s.node;if(s=(s=Re(e,{parent:!0})).node,!o||!s)throw new qe.Z(44);if(o.ga!==s.ga)throw new qe.Z(75);var h=Se(o,a);if("."!==(t=se(t,n)).charAt(0))throw new qe.Z(28);if("."!==(t=se(e,r)).charAt(0))throw new qe.Z(55);try{var l=Se(s,i)}catch(t){}if(h!==l){if(a=Fe(o,a,e=ke(h.mode)))throw new qe.Z(a);if(a=l?Fe(s,i,e):je(s,i))throw new qe.Z(a);if(!o.aa.rename)throw new qe.Z(63);if(h.ta||l&&l.ta)throw new qe.Z(10);if(s!==o&&(a=Ue(o,"w")))throw new qe.Z(a);Ce(h);try{o.aa.rename(h,s,i),h.parent=s}catch(t){throw t}finally{Ze(h)}}},rmdir(t){var e=Re(t,{parent:!0}).node,r=Se(e,t=ne(t)),n=Fe(e,t,!0);if(n)throw new qe.Z(n);if(!e.aa.rmdir)throw new qe.Z(63);if(r.ta)throw new qe.Z(10);e.aa.rmdir(e,t),Ce(r)},readdir:t=>De((t=Re(t,{ra:!0}).node).aa.readdir,54)(t),unlink(t){var e=Re(t,{parent:!0}).node;if(!e)throw new qe.Z(44);var r=Se(e,t=ne(t)),n=Fe(e,t,!1);if(n)throw new qe.Z(n);if(!e.aa.unlink)throw new qe.Z(63);if(r.ta)throw new qe.Z(10);e.aa.unlink(e,t),Ce(r)},readlink(t){if(!(t=Re(t).node))throw new qe.Z(44);if(!t.aa.readlink)throw new qe.Z(28);return t.aa.readlink(t)},stat:(t,e)=>De((t=Re(t,{ra:!e}).node).aa.sa,63)(t),fstat(t){var e=Me(t);t=e.node;var r=e.ba.sa;return e=r?e:t,r??=t.aa.sa,De(r,63),r(e)},lstat:t=>qe.stat(t,!0),chmod(t,e,r){Le(null,t="string"==typeof t?Re(t,{ra:!r}).node:t,e,r)},lchmod(t,e){qe.chmod(t,e,!0)},fchmod(t,e){Le(t=Me(t),t.node,e,!1)},chown(t,e,r,n){ze(null,t="string"==typeof t?Re(t,{ra:!n}).node:t,{timestamp:Date.now(),kb:n})},lchown(t,e,r){qe.chown(t,e,r,!0)},fchown(t){ze(t=Me(t),t.node,{timestamp:Date.now(),kb:!1})},truncate(t,e){if(0>e)throw new qe.Z(28);Be(null,t="string"==typeof t?Re(t,{ra:!0}).node:t,e)},kc(t,e){if(t=Me(t),0>e||!(2097155&t.flags))throw new qe.Z(28);Be(t,t.node,e)},xc(t,e,r){De((t=Re(t,{ra:!0}).node).aa.ua,63)(t,{atime:e,mtime:r})},open(t,e,n=438){if(""===t)throw new qe.Z(44);if("string"==typeof e){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===a)throw Error(`Unknown file open mode: ${e}`);e=a}if(n=64&e?4095&n|32768:0,"object"==typeof t)a=t;else{var i=t.endsWith("/");a=(t=Re(t,{ra:!(131072&e),Lb:!0})).node,t=t.path}var s=!1;if(64&e)if(a){if(128&e)throw new qe.Z(20)}else{if(i)throw new qe.Z(31);a=qe.xa(t,511|n,0),s=!0}if(!a)throw new qe.Z(44);if(8192==(61440&a.mode)&&(e&=-513),65536&e&&!ke(a.mode))throw new qe.Z(54);if(!s&&(i=a?40960==(61440&a.mode)?32:ke(a.mode)&&("r"!==xe(e)||576&e)?31:Ue(a,xe(e)):44))throw new qe.Z(i);return 512&e&&!s&&qe.truncate(a,0),e&=-131713,(i=Ne({node:a,path:Pe(a),flags:e,seekable:!0,position:0,ba:a.ba,Sb:[],error:!1})).ba.open&&i.ba.open(i),s&&qe.chmod(a,511&n),!r.logReadFiles||1&e||t in qe.sb||(qe.sb[t]=1),i},close(t){if(null===t.fd)throw new qe.Z(8);t.Wa&&(t.Wa=null);try{t.ba.close&&t.ba.close(t)}catch(t){throw t}finally{qe.streams[t.fd]=null}t.fd=null},na(t,e,r){if(null===t.fd)throw new qe.Z(8);if(!t.seekable||!t.ba.na)throw new qe.Z(70);if(0!=r&&1!=r&&2!=r)throw new qe.Z(28);return t.position=t.ba.na(t,e,r),t.Sb=[],t.position},read(t,e,r,n,a){if(0>n||0>a)throw new qe.Z(28);if(null===t.fd)throw new qe.Z(8);if(1==(2097155&t.flags))throw new qe.Z(8);if(ke(t.node.mode))throw new qe.Z(31);if(!t.ba.read)throw new qe.Z(28);var i=void 0!==a;if(i){if(!t.seekable)throw new qe.Z(70)}else a=t.position;return e=t.ba.read(t,e,r,n,a),i||(t.position+=e),e},write(t,e,r,n,a,i){if(0>n||0>a)throw new qe.Z(28);if(null===t.fd)throw new qe.Z(8);if(!(2097155&t.flags))throw new qe.Z(8);if(ke(t.node.mode))throw new qe.Z(31);if(!t.ba.write)throw new qe.Z(28);t.seekable&&1024&t.flags&&qe.na(t,0,2);var s=void 0!==a;if(s){if(!t.seekable)throw new qe.Z(70)}else a=t.position;return e=t.ba.write(t,e,r,n,a,i),s||(t.position+=e),e},Ha(t,e,r,n,a){if(2&n&&!(2&a)&&2!=(2097155&t.flags))throw new qe.Z(2);if(1==(2097155&t.flags))throw new qe.Z(2);if(!t.ba.Ha)throw new qe.Z(43);if(!e)throw new qe.Z(28);return t.ba.Ha(t,e,r,n,a)},Ma:(t,e,r,n,a)=>t.ba.Ma?t.ba.Ma(t,e,r,n,a):0,ob(t,e,r){if(!t.ba.ob)throw new qe.Z(59);return t.ba.ob(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding&&U(`Invalid encoding type "${e.encoding}"`);var r=qe.open(t,e.flags);t=qe.stat(t).size;var n=new Uint8Array(t);return qe.read(r,n,0,t,0),"utf8"===e.encoding&&(n=oe(n)),qe.close(r),n},writeFile(t,e,r={}){r.flags=r.flags||577,t=qe.open(t,r.flags,r.mode),"string"==typeof e&&(e=new Uint8Array(le(e))),ArrayBuffer.isView(e)?qe.write(t,e,0,e.byteLength,void 0,r.bc):U("Unsupported data type"),qe.close(t)},cwd:()=>qe.gb,chdir(t){if(null===(t=Re(t,{ra:!0})).node)throw new qe.Z(44);if(!ke(t.node.mode))throw new qe.Z(54);var e=Ue(t.node,"x");if(e)throw new qe.Z(e);qe.gb=t.path},tc(){for(var t of(qe.Xa=!1,qe.streams))t&&qe.close(t)},hc(t,e){try{var r=Re(t,{ra:!e});t=r.path}catch(t){}var n=!1,a=null;try{r=Re(t,{parent:!0}),ne(t),r=Re(t,{ra:!e}),n=!0,a=r.node}catch(t){}return n?a:null},Aa(t,e,r,n){var a;return t=((t,e)=>ee(t+"/"+e))("string"==typeof t?t:Pe(t),e),e=me(!!r,!!n),(a=qe.Aa).$a??(a.$a=64),Ee(a=qe.Ea(qe.Aa.$a++,0),{open(t){t.seekable=!1},close(){n?.buffer?.length&&n(10)},read(t,e,n,a){for(var i=0,s=0;s<a;s++){try{var o=r()}catch(t){throw new qe.Z(29)}if(void 0===o&&0===i)throw new qe.Z(6);if(null==o)break;i++,e[n+s]=o}return i&&(t.node.atime=Date.now()),i},write(t,e,r,a){for(var i=0;i<a;i++)try{n(e[r+i])}catch(t){throw new qe.Z(29)}return a&&(t.node.mtime=t.node.ctime=Date.now()),i}}),Ie(t,e,a)}};if((()=>{let t=rt.prototype;Object.assign(t,{isAliasOf:function(t){if(!(this instanceof rt&&t instanceof rt))return!1;var e=this.$.ha.ea,r=this.$.fa;t.$=t.$;var n=t.$.ha.ea;for(t=t.$.fa;e.ma;)r=e.Oa(r),e=e.ma;for(;n.ma;)t=n.Oa(t),n=n.ma;return e===n&&r===t},clone:function(){if(this.$.fa||Q(this),this.$.Na)return this.$.count.value+=1,this;var t=et,e=Object,r=e.create,n=Object.getPrototypeOf(this),a=this.$;return(t=t(r.call(e,n,{$:{value:{count:a.count,Ka:a.Ka,Na:a.Na,fa:a.fa,ha:a.ha,ka:a.ka,oa:a.oa}}}))).$.count.value+=1,t.$.Ka=!1,t},delete(){if(this.$.fa||Q(this),this.$.Ka&&!this.$.Na)throw new W("Object already scheduled for deletion");tt(this);var t=this.$;--t.count.value,0===t.count.value&&(t.ka?t.oa.Ba(t.ka):t.ha.ea.Ba(t.fa)),this.$.Na||(this.$.ka=void 0,this.$.fa=void 0)},isDeleted:function(){return!this.$.fa},deleteLater:function(){if(this.$.fa||Q(this),this.$.Ka&&!this.$.Na)throw new W("Object already scheduled for deletion");return this.$.Ka=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)})(),Object.assign(gt.prototype,{Gb(t){return this.rb&&(t=this.rb(t)),t},ib(t){this.Ba?.(t)},za:ft,la:function(t){function e(){return vt(this.ea.Ga,this.Ra?{ha:this.Nb,fa:r,oa:this,ka:t}:{ha:this,fa:t})}var r=this.Gb(t);if(!r)return this.ib(t),null;var n=((t,e)=>{if(void 0===e)throw new W("ptr should not be undefined");for(;t.ma;)e=t.Oa(e),t=t.ma;return wt[e]})(this.ea,r);if(void 0!==n)return 0===n.$.count.value?(n.$.fa=r,n.$.ka=t,n.clone()):(n=n.clone(),this.ib(t),n);if(n=this.ea.Eb(r),!(n=at[n]))return e.call(this);var a=pt(r,this.ea,(n=this.Qa?n.zb:n.pointerType).ea);return null===a?e.call(this):vt(n.ea.Ga,this.Ra?{ha:n,fa:a,oa:this,ka:t}:{ha:n,fa:a})}}),qe.cc=(t,e,r,n,a,i,s,o,h,l)=>{_e(t,e,r,n,a,o,h,l).then(i).catch(s)},qe.sc=_e,qe.ya=Array(4096),qe.ga(we,{},"/"),qe.mkdir("/tmp"),qe.mkdir("/home"),qe.mkdir("/home/web_user"),function(){qe.mkdir("/dev"),Ee(qe.Ea(1,3),{read:()=>0,write:(t,e,r,n)=>n,na:()=>0}),Ie("/dev/null",qe.Ea(1,3)),ue(qe.Ea(5,0),fe),ue(qe.Ea(6,0),pe),Ie("/dev/tty",qe.Ea(5,0)),Ie("/dev/tty1",qe.Ea(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(ae(t),e=t.byteLength),t[--e]);qe.Aa("/dev","random",r),qe.Aa("/dev","urandom",r),qe.mkdir("/dev/shm"),qe.mkdir("/dev/shm/tmp")}(),function(){qe.mkdir("/proc");var t=qe.mkdir("/proc/self");qe.mkdir("/proc/self/fd"),qe.ga({ga(){var e=qe.createNode(t,"fd",16895,73);return e.ba={na:we.ba.na},e.aa={lookup(t,e){var r=Me(t=+e);return(t={parent:null,ga:{qb:"fake"},aa:{readlink:()=>r.path},id:t+1}).parent=t},readdir:()=>Array.from(qe.streams.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},{},"/proc/self/fd")}(),qe.Db={MEMFS:we},r.noExitRuntime&&(z=r.noExitRuntime),r.preloadPlugins&&($e=r.preloadPlugins),r.print&&(T=r.print),r.printErr&&(R=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=be,r.removeRunDependency=ge,r.FS_preloadFile=_e,r.FS_unlink=(...t)=>qe.unlink(...t),r.FS_createPath=(...t)=>function(t,e){for(t="string"==typeof t?t:Pe(t),e=e.split("/").reverse();e.length;){var r=e.pop();if(r){var n=ee(t+"/"+r);try{qe.mkdir(n)}catch(t){if(20!=t.Da)throw t}t=n}}return n}(...t),r.FS_createDevice=(...t)=>qe.Aa(...t),r.FS=qe,r.FS_createDataFile=(...t)=>Te(...t),r.FS_createLazyFile=(...t)=>function(t,e,r,n,i){class s{Ua=!1;wa=[];Ta=void 0;hb=0;eb=0;get(t){if(!(t>this.length-1||0>t)){var e=t%this.chunkSize;return this.Ta(t/this.chunkSize|0)[e]}}Cb(t){this.Ta=t}lb(){var t=new XMLHttpRequest;t.open("HEAD",r,!1),t.send(null),200<=t.status&&300>t.status||304===t.status||U("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),a=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e;t=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e;var i=1048576;a||(i=n);var s=this;s.Cb(t=>{var e=t*i,a=(t+1)*i-1;if(a=Math.min(a,n-1),void 0===s.wa[t]){var o=s.wa;e>a&&U("invalid range ("+e+", "+a+") or no bytes requested!"),a>n-1&&U("only "+n+" bytes available! programmer error!");var h=new XMLHttpRequest;h.open("GET",r,!1),n!==i&&h.setRequestHeader("Range","bytes="+e+"-"+a),h.responseType="arraybuffer",h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send(null),200<=h.status&&300>h.status||304===h.status||U("Couldn't load "+r+". Status: "+h.status),e=void 0!==h.response?new Uint8Array(h.response||[]):le(h.responseText||""),o[t]=e}return void 0===s.wa[t]&&U("doXHR failed!"),s.wa[t]}),!t&&n||(i=n=1,i=n=this.Ta(0).length,T("LazyFiles on gzip forces download of the whole file when length is accessed")),this.hb=n,this.eb=i,this.Ua=!0}get length(){return this.Ua||this.lb(),this.hb}get chunkSize(){return this.Ua||this.lb(),this.eb}}if(globalThis.XMLHttpRequest){a||U("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var o=new s,h=void 0}else h=r,o=void 0;var l=function(t,e,r,n){return t="string"==typeof t?t:Pe(t),e=ee(t+"/"+e),qe.create(e,me(r,n))}(t,e,n,i);o?l.da=o:h&&(l.da=null,l.url=h),Object.defineProperties(l,{ia:{get:function(){return this.da.length}}}),t={};for(const[e,r]of Object.entries(l.ba))t[e]=(...t)=>(Ge(l),r(...t));return t.read=(t,e,r,n,a)=>{if(Ge(l),a>=(t=t.node.da).length)e=0;else{if(n=Math.min(t.length-a,n),t.slice)for(var i=0;i<n;i++)e[r+i]=t[a+i];else for(i=0;i<n;i++)e[r+i]=t.get(a+i);e=n}return e},t.Ha=()=>{throw Ge(l),U(),new qe.Z(48)},l.ba=t,l}(...t);var We,Je,Xe,Ke,Qe,Ye,tr,er,rr,nr,ar={c:(t,e,r,n)=>U(`Assertion failed: ${I(t)}, at: `+[e?I(e):"unknown filename",r,n?I(n):"unknown function"]),D:()=>U(""),u:(t,e,r,n,a)=>{e=L(e);let i=t=>t;if(n=0n===n){const t=8*r;i=e=>BigInt.asUintN(t,e),a=i(a)}X(t,{name:e,la:i,pa:(t,e)=>("number"==typeof e&&(e=BigInt(e)),e),za:K(e,r,!n),qa:null})},L:(t,e,r,n)=>{X(t,{name:e=L(e),la:function(t){return!!t},pa:function(t,e){return e?r:n},za:function(t){return this.la(y[t])},qa:null})},I:(t,e,r,n,a,i,s,o,h,l,c,u,d)=>{c=L(c),i=$t(a,i),o&&=$t(s,o),l&&=$t(h,l),d=$t(u,d);var f=(t=>{var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(c);st(f,function(){Et(`Cannot construct ${c} due to unbound types`,[n])}),kt([t,e,r],n?[n]:[],e=>{if(e=e[0],n)var r=e.ea,a=r.Ga;else a=rt.prototype;e=nt(c,function(...t){if(Object.getPrototypeOf(this)!==s)throw new W(`Use 'new' to construct ${c}`);if(void 0===u.Ca)throw new W(`${c} has no accessible constructor`);var e=u.Ca[t.length];if(void 0===e)throw new W(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(u.Ca).toString()}) parameters instead!`);return e.apply(this,t)});var s=Object.create(a,{constructor:{value:e}});e.prototype=s;var h,u=new ot(c,e,s,d,r,i,o,l);return u.ma&&((h=u.ma).cb??(h.cb=[]),u.ma.cb.push(u)),r=new gt(c,u,!0,!1,!1),h=new gt(c+"*",u,!1,!1,!1),a=new gt(c+" const*",u,!1,!0,!1),at[t]={pointerType:h,zb:a},bt(f,e),[r,h,a]})},x:(t,e,r,n,a,i)=>{var s=St(e,r);a=$t(n,a),kt([],[t],t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.ea.Ca&&(t.ea.Ca=[]),void 0!==t.ea.Ca[e-1])throw new W(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.ea.Ca[e-1]=()=>{Et(`Cannot construct ${t.name} due to unbound types`,s)},kt([],s,n=>(n.splice(1,0,null),t.ea.Ca[e-1]=Rt(r,n,null,a,i),[])),[]})},h:(t,e,r,n,a,i,s,o,h)=>{var l=St(r,n);e=L(e),e=Pt(e),i=$t(a,i),kt([],[t],t=>{function n(){Et(`Cannot call ${a} due to unbound types`,l)}var a=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),o&&t.ea.Ob.push(e);var c=t.ea.Ga,u=c[e];return void 0===u||void 0===u.ja&&u.className!==t.name&&u.Ja===r-2?(n.Ja=r-2,n.className=t.name,c[e]=n):(it(c,e,a),c[e].ja[r-2]=n),kt([],l,n=>(n=Rt(a,n,t,i,s,h),void 0===c[e].ja?(n.Ja=r-2,c[e]=n):c[e].ja[r-2]=n,[])),[]})},J:t=>X(t,Ft),t:(t,e,r)=>{X(t,{name:e=L(e),la:t=>t,pa:(t,e)=>e,za:Dt(e,r),qa:null})},v:(t,e,r,n,a,i,s)=>{var o=St(e,r);t=L(t),t=Pt(t),a=$t(n,a),st(t,function(){Et(`Cannot call ${t} due to unbound types`,o)},e-1),kt([],o,r=>(r=[r[0],null].concat(r.slice(1)),bt(t,Rt(t,r,null,a,i,s),e-1),[]))},j:(t,e,r,n,a)=>{e=L(e);let i=t=>t;if(0===n){var s=32-8*r;i=t=>t<<s>>>s,a=i(a)}X(t,{name:e,la:i,pa:(t,e)=>e,za:K(e,r,0!==n),qa:null})},g:(t,e,r)=>{function n(t){return new a(v.buffer,_[t+4>>2],_[t>>2])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];X(t,{name:r=L(r),la:n,za:n},{Ib:!0})},K:(t,e)=>{X(t,{name:e=L(e),la(t){var e=I(t+4,_[t>>2],!0);return We(t),e},pa(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;if(!(r||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT))throw new W("Cannot pass non-string to std::string");var n=r?Nt(e):e.length,a=Je(4+n+1),i=a+4;return _[a>>2]=n,r?Mt(e,y,i,n+1):y.set(e,i),null!==t&&t.push(We,a),a},za:ft,qa(t){We(t)}})},o:(t,e,r)=>{if(r=L(r),2===e)var n=Ht,a=Vt,i=It;else n=Lt,a=Bt,i=Gt;X(t,{name:r,la:t=>{var r=n(t+4,_[t>>2]*e,!0);return We(t),r},pa:(t,n)=>{if("string"!=typeof n)throw new W(`Cannot pass non-string to C++ string type ${r}`);var s=i(n),o=Je(4+s+e);return _[o>>2]=s/e,a(n,o+4,s+e),null!==t&&t.push(We,o),o},za:ft,qa(t){We(t)}})},p:t=>{X(t,Ft)},M:(t,e)=>{X(t,{pb:!0,name:e=L(e),la:()=>{},pa:()=>{}})},B:()=>{z=!1,qt=0},y:()=>{throw 1/0},l:(t,e,r)=>{var[n,...a]=((t,e)=>{for(var r=Array(t),n=0;n<t;++n){var a=n,i=_[e+4*n>>2],s=G[i];if(void 0===s)throw t=`parameter ${n} has unknown type ${At(i)}`,new W(t);r[a]=s}return r})(t,e);e=n.pa.bind(n);var i=a.map(t=>t.za.bind(t));t--;var s={toValue:Ut};switch(t=i.map((t,e)=>{var r=`argFromPtr${e}`;return s[r]=t,`${r}(args${e?"+"+8*e:""})`}),r){case 0:var o="toValue(handle)";break;case 2:o="new (toValue(handle))";break;case 3:o="";break;case 1:s.getStringOrSymbol=Kt,o="toValue(handle)[getStringOrSymbol(methodName)]"}return o+=`(${t})`,n.pb||(s.toReturnWire=e,s.emval_returnValue=Jt,o=`return emval_returnValue(toReturnWire, destructorsRef, ${o})`),o=`return function (handle, methodName, destructorsRef, args) {\n ${o}\n }`,r=new Function(Object.keys(s),o)(...Object.values(s)),o=`methodCaller<(${a.map(t=>t.name)}) => ${n.name}>`,(t=>{var e=Wt.length;return Wt.push(t),e})(nt(o,r))},A:xt,N:t=>t?(t=Kt(t),jt(globalThis[t])):jt(globalThis),n:(t,e)=>(t=Ut(t),e=Ut(e),jt(t[e])),q:t=>{9<t&&(Zt[t+1]+=1)},k:(t,e,r,n,a)=>Wt[t](e,r,n,a),O:t=>jt(Kt(t)),w:t=>{var e=Ut(t);Ct(e),xt(t)},C:(t,e)=>{if(Qt[t]&&(clearTimeout(Qt[t].id),delete Qt[t]),!e)return 0;var r=setTimeout(()=>{delete Qt[t],(t=>{if(!P)try{if(t(),!(z||0<qt))try{p=t=p,Yt(t)}catch(t){t instanceof j||"unwind"==t||l(1,t)}}catch(t){t instanceof j||"unwind"==t||l(1,t)}})(()=>Ke(t,performance.now()))},e);return Qt[t]={id:r,vc:e},0},E:t=>{var e=y.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=e*(1+.2/r);n=Math.min(n,t+100663296);t:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(t,n)/65536))-er.buffer.byteLength+65535)/65536|0;try{er.grow(n),x();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},G:function(t){try{var e=Me(t);return qe.close(e),0}catch(t){if(void 0===qe||"ErrnoError"!==t.name)throw t;return t.Da}},F:function(t,e,r,n){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{if(isNaN(e))return 61;var a=Me(t);return qe.na(a,e,r),k[n>>3]=BigInt(a.position),a.Wa&&0===e&&0===r&&(a.Wa=null),0}catch(t){if(void 0===qe||"ErrnoError"!==t.name)throw t;return t.Da}},H:function(t,e,r,n){try{t:{var a=Me(t);t=e;for(var i,s=e=0;s<r;s++){var o=_[t>>2],h=_[t+4>>2];t+=8;var l=qe.write(a,v,o,h,i);if(0>l){var c=-1;break t}if(e+=l,l<h)break;void 0!==i&&(i+=l)}c=e}return _[n>>2]=c,0}catch(t){if(void 0===qe||"ErrnoError"!==t.name)throw t;return t.Da}},i:function(t,e){var r=tr();try{return rr.get(t)(e)}catch(t){if(Ye(r),t!==t+0)throw t;Qe(1,0)}},e:function(t,e,r){var n=tr();try{return rr.get(t)(e,r)}catch(t){if(Ye(n),t!==t+0)throw t;Qe(1,0)}},d:function(t,e,r,n){var a=tr();try{return rr.get(t)(e,r,n)}catch(t){if(Ye(a),t!==t+0)throw t;Qe(1,0)}},s:function(t,e,r,n,a,i){var s=tr();try{return rr.get(t)(e,r,n,a,i)}catch(t){if(Ye(s),t!==t+0)throw t;Qe(1,0)}},r:function(t){var e=tr();try{rr.get(t)()}catch(t){if(Ye(e),t!==t+0)throw t;Qe(1,0)}},a:function(t,e){var r=tr();try{rr.get(t)(e)}catch(t){if(Ye(r),t!==t+0)throw t;Qe(1,0)}},b:function(t,e,r){var n=tr();try{rr.get(t)(e,r)}catch(t){if(Ye(n),t!==t+0)throw t;Qe(1,0)}},f:function(t,e,r,n){var a=tr();try{rr.get(t)(e,r,n)}catch(t){if(Ye(a),t!==t+0)throw t;Qe(1,0)}},m:function(t,e,r,n,a){var i=tr();try{rr.get(t)(e,r,n,a)}catch(t){if(Ye(i),t!==t+0)throw t;Qe(1,0)}},z:Yt};return nr=await async function(){function t(t){return t=nr=t.exports,We=t.R,Je=t.S,Xe=t.T,Ke=t.V,Qe=t.W,Ye=t.X,tr=t.Y,er=t.P,rr=t.U,x(),nr}var e={a:ar};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(e,(e,r)=>{n(t(e))})}):(C??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",u):u+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,t((await async function(t){var e=C;if(!f&&!O(e)&&!i)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){R(`wasm streaming compile failed: ${t}`),R("falling back to ArrayBuffer instantiation")}return async function(t,e){try{var r=await async function(t){if(!f)try{var e=await o(t);return new Uint8Array(e)}catch{}if(t==C&&f)t=new Uint8Array(f);else{if(!h)throw"both async and sync fetching of the wasm failed";t=h(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){R(`failed to asynchronously prepare wasm: ${t}`),U(t)}}(e,t)}(e)).instance))}(),function t(){function e(){if(r.calledRun=!0,!P){if(Z=!0,r.noFSInit||qe.Xa||Ae(),nr.Q(),qe.nb=!1,w?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();D.push(t)}F(D)}}if(0<ve)ye=t;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)N();F(M),0<ve?ye=t:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),e()},1)):e()}}(),e=Z?r:new Promise((t,e)=>{w=t,m=e}),e}({locateFile:(t,e)=>t.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":e+t})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const t=this.config?.renderer||"sw";if(await(async t=>{if("wg"===t){for(;"requested"===pt;)await ft(100);if("initialized"!==pt&&(pt="requested",ct))for(;;)switch(ct.init()){case 0:return void(pt="initialized");case 1:return void(pt="failed");case 2:await ft(100)}}})(t),"failed"===pt)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ct.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:t,right:e,top:r,bottom:n}=this.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight;let s=0,o=0,h=this.canvas.width,l=this.canvas.height;t<0&&(s=Math.abs(t),h-=s),r<0&&(o=Math.abs(r),l-=o),e>a&&(h-=e-a),n>i&&(l-=n-i),this.TVG.viewport(s,o,h,l)}_observerCallback(t){const e=t[0],r=e.target;r._observable=e.isIntersecting,e.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(t){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(t){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(t,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const t=1+.75*(window.devicePixelRatio-1),{width:e,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=e*t,this.canvas.height=r*t}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const t=this.TVG.render(),e=new Uint8ClampedArray(t,0,t.byteLength);e.length<1||(this._imageData=new ImageData(e,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const t=this.TVG.duration(),e=Date.now()/1e3;if(this.currentFrame=(e-this._beginTime)/t*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const t=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||t&&this._counter<t)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ft(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(t){this.TVG&&(this.pause(),this.currentFrame=t,this.TVG.frame(t))}async load(t,e="json"){try{await this._init();const r=await(async(t,e)=>{const r=new TextEncoder;let n=t;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===e||"lot"===e)return n=await(async t=>{try{t=JSON.parse(t)}catch(e){const r=await(async t=>{if("string"!=typeof t)throw new Error("The url value must be a string");try{const e=new URL(t),r=await fetch(e.toString());return await r.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(t);t=JSON.stringify(r)}return t})(n),r.encode(n);const t=await(async t=>(await fetch(t)).arrayBuffer())(n);return new Uint8Array(t);default:throw new Error("Invalid src type")}})(t,e);this.dispatchEvent(new CustomEvent("ready")),this.fileType=e,await this._loadBytes(r)}catch(t){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(this.totalFrame=this.TVG.totalFrame(),this.totalFrame<1||(this._beginTime=Date.now()/1e3,"playing"===this.currentState))))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(t){this._frame(t),await this._update(),this._render()}resize(t,e){this.canvas.width=t,this.canvas.height=e,"playing"!==this.currentState&&this._render()}destroy(){this.TVG&&(this.TVG.delete(),this.TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ct&&(ct.term(),ct=null)}setLooping(t){this.TVG&&(this.loop=t)}setDirection(t){this.TVG&&(this.direction=t)}setSpeed(t){this.TVG&&(this.speed=t)}setBgColor(t){this.TVG&&(this.canvas.style.backgroundColor=t)}setQuality(t){this.TVG&&this.TVG.quality(t)&&"playing"!==this.currentState&&this._render()}setAssetResolver(t,e){this._assetResolverCallback=t,this._assetResolverData=e,this.TVG&&this.TVG.setAssetResolver(t,e)}getVersion(){return{THORVG_VERSION:"1.0.2"}}render(){return I`
|
|
2
2
|
<canvas class="thorvg" style="width: 100%; height: 100%;" />
|
|
3
3
|
`}}function mt(t,e,r,n){var a,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}lt([A({type:String})],wt.prototype,"src",void 0),lt([A({type:String})],wt.prototype,"wasmUrl",void 0),lt([A({type:dt})],wt.prototype,"fileType",void 0),lt([A({type:Number})],wt.prototype,"speed",void 0),lt([A({type:Boolean})],wt.prototype,"autoPlay",void 0),lt([A({type:Number})],wt.prototype,"count",void 0),lt([A({type:Boolean})],wt.prototype,"loop",void 0),lt([A({type:Number})],wt.prototype,"direction",void 0),lt([A()],wt.prototype,"mode",void 0),lt([A()],wt.prototype,"intermission",void 0),lt([A({type:Number})],wt.prototype,"totalFrame",void 0),lt([A({type:Number})],wt.prototype,"currentFrame",void 0),lt([A({type:Number})],wt.prototype,"currentState",void 0),lt([A({type:Float32Array})],wt.prototype,"size",null);class vt extends wt{set renderConfig(t){this.config={renderer:"sw",enableDevicePixelRatio:t.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}mt([A({type:Object})],vt.prototype,"renderConfig",null),vt=mt([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("lottie-player")],vt);var yt=Object.freeze({__proto__:null});export{vt as LottiePresetPlayer};
|
|
4
4
|
//# sourceMappingURL=lottie-player.esm.js.map
|