@thorvg/lottie-player 1.0.0-pre.2 → 1.0.0-pre.21

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.
@@ -1,4 +1,4 @@
1
- "use strict";var e="undefined"!=typeof document?document.currentScript:null;const t=globalThis,r=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;let a=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(r&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(t,e))}return e}toString(){return this.cssText}};const i=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:s,defineProperty:l,getOwnPropertyDescriptor:u,getOwnPropertyNames:c,getOwnPropertySymbols:d,getPrototypeOf:h}=Object,p=globalThis,m=p.trustedTypes,f=m?m.emptyScript:"",g=p.reactiveElementPolyfillSupport,v=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?f:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},w=(e,t)=>!s(e,t),b={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),p.litPropertyMetadata??=new WeakMap;class _ extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=b){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(e,r,t);void 0!==n&&l(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){const{get:n,set:o}=u(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return n?.call(this)},set(t){const a=n?.call(this);o.call(this,t),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??b}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=h(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...c(e),...d(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(i(e))}else void 0!==e&&t.push(i(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,n)=>{if(r)e.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const r of n){const n=document.createElement("style"),o=t.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=r.cssText,e.appendChild(n)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){const r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(void 0!==n&&!0===r.reflect){const o=(void 0!==r.converter?.toAttribute?r.converter:y).toAttribute(t,r.type);this._$Em=e,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){const r=this.constructor,n=r._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=r.getPropertyOptions(n),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=n,this[n]=o.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??w)(this[e],t))return;this.P(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e)!0!==r.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[v("elementProperties")]=new Map,_[v("finalized")]=new Map,g?.({ReactiveElement:_}),(p.reactiveElementVersions??=[]).push("2.0.4");const E=globalThis,S=E.trustedTypes,$=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+x,T=`<${P}>`,k=document,A=()=>k.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,F=Array.isArray,R="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,O=/>/g,U=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),L=/'/g,j=/"/g,z=/^(?:script|style|textarea|title)$/i,I=(e=>(t,...r)=>({_$litType$:e,strings:t,values:r}))(1),N=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),W=new WeakMap,G=k.createTreeWalker(k,129);function H(e,t){if(!F(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$?$.createHTML(t):t}class q{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,a=0;const i=e.length-1,s=this.parts,[l,u]=((e,t)=>{const r=e.length-1,n=[];let o,a=2===t?"<svg>":3===t?"<math>":"",i=M;for(let t=0;t<r;t++){const r=e[t];let s,l,u=-1,c=0;for(;c<r.length&&(i.lastIndex=c,l=i.exec(r),null!==l);)c=i.lastIndex,i===M?"!--"===l[1]?i=B:void 0!==l[1]?i=O:void 0!==l[2]?(z.test(l[2])&&(o=RegExp("</"+l[2],"g")),i=U):void 0!==l[3]&&(i=U):i===U?">"===l[0]?(i=o??M,u=-1):void 0===l[1]?u=-2:(u=i.lastIndex-l[2].length,s=l[1],i=void 0===l[3]?U:'"'===l[3]?j:L):i===j||i===L?i=U:i===B||i===O?i=M:(i=U,o=void 0);const d=i===U&&e[t+1].startsWith("/>")?" ":"";a+=i===M?r+T:u>=0?(n.push(s),r.slice(0,u)+C+r.slice(u)+x+d):r+x+(-2===u?t:d)}return[H(e,a+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=q.createElement(l,r),G.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=G.nextNode())&&s.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(C)){const t=u[a++],r=n.getAttribute(e).split(x),i=/([.?@])?(.*)/.exec(t);s.push({type:1,index:o,name:i[2],strings:r,ctor:"."===i[1]?Z:"?"===i[1]?Y:"@"===i[1]?ee:K}),n.removeAttribute(e)}else e.startsWith(x)&&(s.push({type:6,index:o}),n.removeAttribute(e));if(z.test(n.tagName)){const e=n.textContent.split(x),t=e.length-1;if(t>0){n.textContent=S?S.emptyScript:"";for(let r=0;r<t;r++)n.append(e[r],A()),G.nextNode(),s.push({type:2,index:++o});n.append(e[t],A())}}}else if(8===n.nodeType)if(n.data===P)s.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf(x,e+1));)s.push({type:7,index:o}),e+=x.length-1}o++}}static createElement(e,t){const r=k.createElement("template");return r.innerHTML=e,r}}function Q(e,t,r=e,n){if(t===N)return t;let o=void 0!==n?r.o?.[n]:r.l;const a=D(t)?void 0:t._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(e),o._$AT(e,r,n)),void 0!==n?(r.o??=[])[n]=o:r.l=o),void 0!==o&&(t=Q(e,o._$AS(e,t.values),o,n)),t}class X{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??k).importNode(t,!0);G.currentNode=n;let o=G.nextNode(),a=0,i=0,s=r[0];for(;void 0!==s;){if(a===s.index){let t;2===s.type?t=new J(o,o.nextSibling,this,e):1===s.type?t=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(t=new te(o,this,e)),this._$AV.push(t),s=r[++i]}a!==s?.index&&(o=G.nextNode(),a++)}return G.currentNode=k,n}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class J{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,t,r,n){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Q(this,e,t),D(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==N&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>F(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,n="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=q.createElement(H(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const e=new X(n,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=W.get(e.strings);return void 0===t&&W.set(e.strings,t=new q(e)),t}k(e){F(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const o of e)n===t.length?t.push(r=new J(this.O(A()),this.O(A()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class K{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=V}_$AI(e,t=this,r,n){const o=this.strings;let a=!1;if(void 0===o)e=Q(this,e,t,0),a=!D(e)||e!==this._$AH&&e!==N,a&&(this._$AH=e);else{const n=e;let i,s;for(e=o[0],i=0;i<o.length-1;i++)s=Q(this,n[r+i],t,i),s===N&&(s=this._$AH[i]),a||=!D(s)||s!==this._$AH[i],s===V?e=V:e!==V&&(e+=(s??"")+o[i+1]),this._$AH[i]=s}a&&!n&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Z extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class Y extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class ee extends K{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=Q(this,e,t,0)??V)===N)return;const r=this._$AH,n=e===V&&r!==V||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==V&&(r===V||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class te{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Q(this,e)}}const re=E.litHtmlPolyfillSupport;re?.(q,J),(E.litHtmlVersions??=[]).push("3.2.0");class ne extends _{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,t,r)=>{const n=r?.renderBefore??t;let o=n._$litPart$;if(void 0===o){const e=r?.renderBefore??null;n._$litPart$=o=new J(t.insertBefore(A(),e),e,void 0,r??{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return N}}ne._$litElement$=!0,ne.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ne});const oe=globalThis.litElementPolyfillSupport;oe?.({LitElement:ne}),(globalThis.litElementVersions??=[]).push("4.1.0");const ae={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:w},ie=(e=ae,t,r)=>{const{kind:n,metadata:o}=r;let a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(r.name,e),"accessor"===n){const{name:n}=r;return{set(r){const o=t.get.call(this);t.set.call(this,r),this.requestUpdate(n,o,e)},init(t){return void 0!==t&&this.P(n,void 0,e),t}}}if("setter"===n){const{name:n}=r;return function(r){const o=this[n];t.call(this,r),this.requestUpdate(n,o,e)}}throw Error("Unsupported decorator location: "+n)};function se(e){return(t,r)=>"object"==typeof r?ie(e,t,r):((e,t,r)=>{const n=t.hasOwnProperty(r);return t.constructor.createProperty(r,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}for(var le,ue=[],ce=0;ce<256;++ce)ue.push((ce+256).toString(16).slice(1));var de=new Uint8Array(16);function he(){if(!le&&!(le="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(de)}var pe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function me(e,t,r){if(pe.randomUUID&&!t&&!e)return pe.randomUUID();var n=(e=e||{}).random||(e.rng||he)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(ue[e[t+0]]+ue[e[t+1]]+ue[e[t+2]]+ue[e[t+3]]+"-"+ue[e[t+4]]+ue[e[t+5]]+"-"+ue[e[t+6]]+ue[e[t+7]]+"-"+ue[e[t+8]]+ue[e[t+9]]+"-"+ue[e[t+10]]+ue[e[t+11]]+ue[e[t+12]]+ue[e[t+13]]+ue[e[t+14]]+ue[e[t+15]]).toLowerCase()}(n)}var fe,ge=(fe="undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href,async function(t={}){var r,n,o=t,a=new Promise(((e,t)=>{r=e,n=t})),i="object"==typeof window,s="function"==typeof importScripts,l="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(l){const{createRequire:t}=await Promise.resolve().then((function(){return Re}));var u=t("undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href)}var c,d,h=Object.assign({},o),p="./this.program",m=(e,t)=>{throw t},f="";if(l){var g=u("fs"),v=u("path");f=u("url").fileURLToPath(new URL("./","undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href)),d=e=>(e=G(e)?new URL(e):v.normalize(e),g.readFileSync(e)),c=(e,t=!0)=>(e=G(e)?new URL(e):v.normalize(e),new Promise(((r,n)=>{g.readFile(e,t?void 0:"utf8",((e,o)=>{e?n(e):r(t?o.buffer:o)}))}))),!o.thisProgram&&process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),m=(e,t)=>{throw process.exitCode=e,t}}else(i||s)&&(s?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),fe&&(f=fe),f=f.startsWith("blob:")?"":f.substr(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),c=e=>G(e)?new Promise(((t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r(n.status)},n.onerror=r,n.send(null)})):fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url)))));var y=o.print||console.log.bind(console),w=o.printErr||console.error.bind(console);Object.assign(o,h),h=null,o.arguments&&o.arguments,o.thisProgram&&(p=o.thisProgram);var b,_,E,S,$,C,x,P,T,k,A=o.wasmBinary,D=!1;function F(){var e=b.buffer;o.HEAP8=E=new Int8Array(e),o.HEAP16=$=new Int16Array(e),o.HEAPU8=S=new Uint8Array(e),o.HEAPU16=C=new Uint16Array(e),o.HEAP32=x=new Int32Array(e),o.HEAPU32=P=new Uint32Array(e),o.HEAPF32=T=new Float32Array(e),o.HEAPF64=k=new Float64Array(e)}var R=[],M=[],B=[],O=0,U=null;function L(e){O++,o.monitorRunDependencies?.(O)}function j(e){if(O--,o.monitorRunDependencies?.(O),0==O&&U){var t=U;U=null,t()}}function z(e){o.onAbort?.(e),w(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var I,N,V,W=e=>e.startsWith("data:application/octet-stream;base64,"),G=e=>e.startsWith("file://");function H(){if(o.locateFile){var t="thorvg-wasm.wasm";return W(t)?t:(r=t,o.locateFile?o.locateFile(r,f):f+r)}var r;return new URL("thorvg-wasm.wasm","undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href).href}function q(e){if(e==I&&A)return new Uint8Array(A);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function Q(e,t,r){return function(e){return A?Promise.resolve().then((()=>q(e))):c(e).then((e=>new Uint8Array(e)),(()=>q(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then(r,(e=>{w(`failed to asynchronously prepare wasm: ${e}`),z(e)}))}function X(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var J=e=>{for(;e.length>0;)e.shift()(o)},K=o.noExitRuntime||!0,Z=e=>fr(e),Y=()=>vr(),ee="undefined"!=typeof TextDecoder?new TextDecoder:void 0,te=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ee)return ee.decode(e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var l=63&e[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},re=(e,t)=>e?te(S,e,t):"";function ne(){var e=x[+$e.varargs>>2];return $e.varargs+=4,e}var oe=ne,ae={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=ae.isAbs(e),r="/"===e.substr(-1);return e=ae.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"),e||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ae.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=ae.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:(...e)=>ae.normalize(e.join("/")),join2:(e,t)=>ae.normalize(e+"/"+t)},ie=e=>(ie=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(l)try{var e=u("crypto");if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}z("initRandomDevice")})())(e),se={resolve:(...e)=>{for(var t="",r=!1,n=e.length-1;n>=-1&&!r;n--){var o=n>=0?e[n]:Se.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";t=o+"/"+t,r=ae.isAbs(o)}return t=ae.normalizeArray(t.split("/").filter((e=>!!e)),!r).join("/"),(r?"/":"")+t||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=se.resolve(e).substr(1),t=se.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},le=[],ue=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},ce=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function de(e,t,r){var n=ue(e)+1,o=new Array(n),a=ce(e,o,0,o.length);return o.length=a,o}var he,pe,me,ge={ttys:[],init(){},shutdown(){},register(e,t){ge.ttys[e]={input:[],output:[],ops:t},Se.registerDevice(e,ge.stream_ops)},stream_ops:{open(e){var t=ge.ttys[e.node.rdev];if(!t)throw new Se.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Se.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Se.ErrnoError(29)}if(void 0===s&&0===a)throw new Se.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Se.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Se.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!le.length){var e=null;if(l){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=g.readSync(n,t,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}r>0&&(e=t.slice(0,r).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;le=de(e)}return le.shift()})(),put_char(e,t){null===t||10===t?(y(te(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(y(te(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(w(te(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(w(te(e.output,0)),e.output=[])}}},ve=e=>{z()},ye={ops_table:null,mount:e=>ye.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Se.isBlkdev(r)||Se.isFIFO(r))throw new Se.ErrnoError(63);ye.ops_table||={dir:{node:{getattr:ye.node_ops.getattr,setattr:ye.node_ops.setattr,lookup:ye.node_ops.lookup,mknod:ye.node_ops.mknod,rename:ye.node_ops.rename,unlink:ye.node_ops.unlink,rmdir:ye.node_ops.rmdir,readdir:ye.node_ops.readdir,symlink:ye.node_ops.symlink},stream:{llseek:ye.stream_ops.llseek}},file:{node:{getattr:ye.node_ops.getattr,setattr:ye.node_ops.setattr},stream:{llseek:ye.stream_ops.llseek,read:ye.stream_ops.read,write:ye.stream_ops.write,allocate:ye.stream_ops.allocate,mmap:ye.stream_ops.mmap,msync:ye.stream_ops.msync}},link:{node:{getattr:ye.node_ops.getattr,setattr:ye.node_ops.setattr,readlink:ye.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ye.node_ops.getattr,setattr:ye.node_ops.setattr},stream:Se.chrdev_stream_ops}};var o=Se.createNode(e,t,r,n);return Se.isDir(o.mode)?(o.node_ops=ye.ops_table.dir.node,o.stream_ops=ye.ops_table.dir.stream,o.contents={}):Se.isFile(o.mode)?(o.node_ops=ye.ops_table.file.node,o.stream_ops=ye.ops_table.file.stream,o.usedBytes=0,o.contents=null):Se.isLink(o.mode)?(o.node_ops=ye.ops_table.link.node,o.stream_ops=ye.ops_table.link.stream):Se.isChrdev(o.mode)&&(o.node_ops=ye.ops_table.chrdev.node,o.stream_ops=ye.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Se.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Se.isDir(e.mode)?t.size=4096:Se.isFile(e.mode)?t.size=e.usedBytes:Se.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ye.resizeFileStorage(e,t.size)},lookup(e,t){throw Se.genericErrors[44]},mknod:(e,t,r,n)=>ye.createNode(e,t,r,n),rename(e,t,r){if(Se.isDir(e.mode)){var n;try{n=Se.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Se.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Se.lookupNode(e,t);for(var n in r.contents)throw new Se.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var n=ye.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Se.isLink(e.mode))throw new Se.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write(e,t,r,n,o,a){if(t.buffer===E.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(r,r+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(r,r+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(r,r+n),o),n}if(ye.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[r+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Se.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Se.ErrnoError(28);return n},allocate(e,t,r){ye.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Se.isFile(e.node.mode))throw new Se.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==E.buffer){if(i=!0,!(a=ve()))throw new Se.ErrnoError(48);s&&((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),E.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,t,r,n,o)=>(ye.stream_ops.write(e,t,0,n,r,!1),0)}},we=(e,t,r,n,o,a)=>{Se.createDataFile(e,t,r,n,o,a)},be=o.preloadPlugins||[],_e=(e,t,r,n,o,a,i,s,l,u)=>{var d=t?se.resolve(ae.join2(e,t)):e;function h(r){function c(r){u?.(),s||we(e,t,r,n,o,l),a?.(),j()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return be.forEach((a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)})),o})(r,d,c,(()=>{i?.(),j()}))||c(r)}L(),"string"==typeof r?((e,t,r)=>{var n=`al ${e}`;c(e).then((e=>{t(new Uint8Array(e)),n&&j()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&L()})(r,h,i):h(r)},Ee=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Se={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Se.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return Se.isDir(this.mode)}get isDevice(){return Se.isChrdev(this.mode)}},lookupPath(e,t={}){if(!(e=se.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Se.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Se.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=Se.lookupNode(n,r[a]),o=ae.join2(o,r[a]),Se.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;Se.isLink(n.mode);){var l=Se.readlink(o);if(o=se.resolve(ae.dirname(o),l),n=Se.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Se.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Se.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Se.nameTable.length},hashAddNode(e){var t=Se.hashName(e.parent.id,e.name);e.name_next=Se.nameTable[t],Se.nameTable[t]=e},hashRemoveNode(e){var t=Se.hashName(e.parent.id,e.name);if(Se.nameTable[t]===e)Se.nameTable[t]=e.name_next;else for(var r=Se.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Se.mayLookup(e);if(r)throw new Se.ErrnoError(r);for(var n=Se.hashName(e.id,t),o=Se.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Se.lookup(e,t)},createNode(e,t,r,n){var o=new Se.FSNode(e,t,r,n);return Se.hashAddNode(o),o},destroyNode(e){Se.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Se.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!Se.isDir(e.mode))return 54;var t=Se.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Se.lookupNode(e,t),20}catch(e){}return Se.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Se.lookupNode(e,t)}catch(e){return e.errno}var o=Se.nodePermissions(e,"wx");if(o)return o;if(r){if(!Se.isDir(n.mode))return 54;if(Se.isRoot(n)||Se.getPath(n)===Se.cwd())return 10}else if(Se.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Se.isLink(e.mode)?32:Se.isDir(e.mode)&&("r"!==Se.flagsToPermissionString(t)||512&t)?31:Se.nodePermissions(e,Se.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Se.MAX_OPEN_FDS;e++)if(!Se.streams[e])return e;throw new Se.ErrnoError(33)},getStreamChecked(e){var t=Se.getStream(e);if(!t)throw new Se.ErrnoError(8);return t},getStream:e=>Se.streams[e],createStream:(e,t=-1)=>(e=Object.assign(new Se.FSStream,e),-1==t&&(t=Se.nextfd()),e.fd=t,Se.streams[t]=e,e),closeStream(e){Se.streams[e]=null},dupStream(e,t=-1){var r=Se.createStream(e,t);return r.stream_ops?.dup?.(r),r},chrdev_stream_ops:{open(e){var t=Se.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Se.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Se.devices[e]={stream_ops:t}},getDevice:e=>Se.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push(...n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Se.syncFSRequests++,Se.syncFSRequests>1&&w(`warning: ${Se.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Se.getMounts(Se.root.mount),n=0;function o(e){return Se.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount(e,t,r){var n,o="/"===r,a=!r;if(o&&Se.root)throw new Se.ErrnoError(10);if(!o&&!a){var i=Se.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Se.isMountpoint(n))throw new Se.ErrnoError(10);if(!Se.isDir(n.mode))throw new Se.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?Se.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var t=Se.lookupPath(e,{follow_mount:!1});if(!Se.isMountpoint(t.node))throw new Se.ErrnoError(28);var r=t.node,n=r.mounted,o=Se.getMounts(n);Object.keys(Se.nameTable).forEach((e=>{for(var t=Se.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Se.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);r.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Se.lookupPath(e,{parent:!0}).node,o=ae.basename(e);if(!o||"."===o||".."===o)throw new Se.ErrnoError(28);var a=Se.mayCreate(n,o);if(a)throw new Se.ErrnoError(a);if(!n.node_ops.mknod)throw new Se.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Se.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Se.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Se.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Se.mknod(e,t,r)),symlink(e,t){if(!se.resolve(e))throw new Se.ErrnoError(44);var r=Se.lookupPath(t,{parent:!0}).node;if(!r)throw new Se.ErrnoError(44);var n=ae.basename(t),o=Se.mayCreate(r,n);if(o)throw new Se.ErrnoError(o);if(!r.node_ops.symlink)throw new Se.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=ae.dirname(e),a=ae.dirname(t),i=ae.basename(e),s=ae.basename(t);if(r=Se.lookupPath(e,{parent:!0}).node,n=Se.lookupPath(t,{parent:!0}).node,!r||!n)throw new Se.ErrnoError(44);if(r.mount!==n.mount)throw new Se.ErrnoError(75);var l,u=Se.lookupNode(r,i),c=se.relative(e,a);if("."!==c.charAt(0))throw new Se.ErrnoError(28);if("."!==(c=se.relative(t,o)).charAt(0))throw new Se.ErrnoError(55);try{l=Se.lookupNode(n,s)}catch(e){}if(u!==l){var d=Se.isDir(u.mode),h=Se.mayDelete(r,i,d);if(h)throw new Se.ErrnoError(h);if(h=l?Se.mayDelete(n,s,d):Se.mayCreate(n,s))throw new Se.ErrnoError(h);if(!r.node_ops.rename)throw new Se.ErrnoError(63);if(Se.isMountpoint(u)||l&&Se.isMountpoint(l))throw new Se.ErrnoError(10);if(n!==r&&(h=Se.nodePermissions(r,"w")))throw new Se.ErrnoError(h);Se.hashRemoveNode(u);try{r.node_ops.rename(u,n,s),u.parent=n}catch(e){throw e}finally{Se.hashAddNode(u)}}},rmdir(e){var t=Se.lookupPath(e,{parent:!0}).node,r=ae.basename(e),n=Se.lookupNode(t,r),o=Se.mayDelete(t,r,!0);if(o)throw new Se.ErrnoError(o);if(!t.node_ops.rmdir)throw new Se.ErrnoError(63);if(Se.isMountpoint(n))throw new Se.ErrnoError(10);t.node_ops.rmdir(t,r),Se.destroyNode(n)},readdir(e){var t=Se.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Se.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Se.lookupPath(e,{parent:!0}).node;if(!t)throw new Se.ErrnoError(44);var r=ae.basename(e),n=Se.lookupNode(t,r),o=Se.mayDelete(t,r,!1);if(o)throw new Se.ErrnoError(o);if(!t.node_ops.unlink)throw new Se.ErrnoError(63);if(Se.isMountpoint(n))throw new Se.ErrnoError(10);t.node_ops.unlink(t,r),Se.destroyNode(n)},readlink(e){var t=Se.lookupPath(e).node;if(!t)throw new Se.ErrnoError(44);if(!t.node_ops.readlink)throw new Se.ErrnoError(28);return se.resolve(Se.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Se.lookupPath(e,{follow:!t}).node;if(!r)throw new Se.ErrnoError(44);if(!r.node_ops.getattr)throw new Se.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Se.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Se.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Se.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Se.chmod(e,t,!0)},fchmod(e,t){var r=Se.getStreamChecked(e);Se.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Se.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Se.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Se.chown(e,t,r,!0)},fchown(e,t,r){var n=Se.getStreamChecked(e);Se.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Se.ErrnoError(28);var r;if(!(r="string"==typeof e?Se.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Se.ErrnoError(63);if(Se.isDir(r.mode))throw new Se.ErrnoError(31);if(!Se.isFile(r.mode))throw new Se.ErrnoError(28);var n=Se.nodePermissions(r,"w");if(n)throw new Se.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Se.getStreamChecked(e);if(!(2097155&r.flags))throw new Se.ErrnoError(28);Se.truncate(r.node,t)},utime(e,t,r){var n=Se.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Se.ErrnoError(44);var n;if(r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&(r=void 0===r?438:r)|32768:0,"object"==typeof e)n=e;else{e=ae.normalize(e);try{n=Se.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(n){if(128&t)throw new Se.ErrnoError(20)}else n=Se.mknod(e,r,0),a=!0;if(!n)throw new Se.ErrnoError(44);if(Se.isChrdev(n.mode)&&(t&=-513),65536&t&&!Se.isDir(n.mode))throw new Se.ErrnoError(54);if(!a){var i=Se.mayOpen(n,t);if(i)throw new Se.ErrnoError(i)}512&t&&!a&&Se.truncate(n,0),t&=-131713;var s=Se.createStream({node:n,path:Se.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&t||(Se.readFiles||(Se.readFiles={}),e in Se.readFiles||(Se.readFiles[e]=1)),s},close(e){if(Se.isClosed(e))throw new Se.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Se.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Se.isClosed(e))throw new Se.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Se.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Se.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new Se.ErrnoError(28);if(Se.isClosed(e))throw new Se.ErrnoError(8);if(1==(2097155&e.flags))throw new Se.ErrnoError(8);if(Se.isDir(e.node.mode))throw new Se.ErrnoError(31);if(!e.stream_ops.read)throw new Se.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new Se.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write(e,t,r,n,o,a){if(n<0||o<0)throw new Se.ErrnoError(28);if(Se.isClosed(e))throw new Se.ErrnoError(8);if(!(2097155&e.flags))throw new Se.ErrnoError(8);if(Se.isDir(e.node.mode))throw new Se.ErrnoError(31);if(!e.stream_ops.write)throw new Se.ErrnoError(28);e.seekable&&1024&e.flags&&Se.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new Se.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=s),s},allocate(e,t,r){if(Se.isClosed(e))throw new Se.ErrnoError(8);if(t<0||r<=0)throw new Se.ErrnoError(28);if(!(2097155&e.flags))throw new Se.ErrnoError(8);if(!Se.isFile(e.node.mode)&&!Se.isDir(e.node.mode))throw new Se.ErrnoError(43);if(!e.stream_ops.allocate)throw new Se.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new Se.ErrnoError(2);if(1==(2097155&e.flags))throw new Se.ErrnoError(2);if(!e.stream_ops.mmap)throw new Se.ErrnoError(43);if(!t)throw new Se.ErrnoError(28);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Se.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Se.open(e,t.flags),o=Se.stat(e).size,a=new Uint8Array(o);return Se.read(n,a,0,o,0),"utf8"===t.encoding?r=te(a,0):"binary"===t.encoding&&(r=a),Se.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Se.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(ue(t)+1),a=ce(t,o,0,o.length);Se.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Se.write(n,t,0,t.byteLength,void 0,r.canOwn)}Se.close(n)},cwd:()=>Se.currentPath,chdir(e){var t=Se.lookupPath(e,{follow:!0});if(null===t.node)throw new Se.ErrnoError(44);if(!Se.isDir(t.node.mode))throw new Se.ErrnoError(54);var r=Se.nodePermissions(t.node,"x");if(r)throw new Se.ErrnoError(r);Se.currentPath=t.path},createDefaultDirectories(){Se.mkdir("/tmp"),Se.mkdir("/home"),Se.mkdir("/home/web_user")},createDefaultDevices(){Se.mkdir("/dev"),Se.registerDevice(Se.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Se.mkdev("/dev/null",Se.makedev(1,3)),ge.register(Se.makedev(5,0),ge.default_tty_ops),ge.register(Se.makedev(6,0),ge.default_tty1_ops),Se.mkdev("/dev/tty",Se.makedev(5,0)),Se.mkdev("/dev/tty1",Se.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ie(e).byteLength),e[--t]);Se.createDevice("/dev","random",r),Se.createDevice("/dev","urandom",r),Se.mkdir("/dev/shm"),Se.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Se.mkdir("/proc");var e=Se.mkdir("/proc/self");Se.mkdir("/proc/self/fd"),Se.mount({mount(){var t=Se.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Se.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,r){e?Se.createDevice("/dev","stdin",e):Se.symlink("/dev/tty","/dev/stdin"),t?Se.createDevice("/dev","stdout",null,t):Se.symlink("/dev/tty","/dev/stdout"),r?Se.createDevice("/dev","stderr",null,r):Se.symlink("/dev/tty1","/dev/stderr"),Se.open("/dev/stdin",0),Se.open("/dev/stdout",1),Se.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{Se.genericErrors[e]=new Se.ErrnoError(e),Se.genericErrors[e].stack="<generic error, no stack>"})),Se.nameTable=new Array(4096),Se.mount(ye,{},"/"),Se.createDefaultDirectories(),Se.createDefaultDevices(),Se.createSpecialDirectories(),Se.filesystems={MEMFS:ye}},init(e,t,r){Se.initialized=!0,e??=o.stdin,t??=o.stdout,r??=o.stderr,Se.createStandardStreams(e,t,r)},quit(){Se.initialized=!1;for(var e=0;e<Se.streams.length;e++){var t=Se.streams[e];t&&Se.close(t)}},findObject(e,t){var r=Se.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Se.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Se.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ae.basename(e),n=Se.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:Se.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=ae.join2(e,a);try{Se.mkdir(i)}catch(e){}e=i}}return i},createFile(e,t,r,n,o){var a=ae.join2("string"==typeof e?e:Se.getPath(e),t),i=Ee(n,o);return Se.create(a,i)},createDataFile(e,t,r,n,o,a){var i=t;e&&(e="string"==typeof e?e:Se.getPath(e),i=t?ae.join2(e,t):e);var s=Ee(n,o),l=Se.create(i,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),c=0,d=r.length;c<d;++c)u[c]=r.charCodeAt(c);r=u}Se.chmod(l,146|s);var h=Se.open(l,577);Se.write(h,r,0,r.length,0,a),Se.close(h),Se.chmod(l,s)}},createDevice(e,t,r,n){var o=ae.join2("string"==typeof e?e:Se.getPath(e),t),a=Ee(!!r,!!n);Se.createDevice.major||(Se.createDevice.major=64);var i=Se.makedev(Se.createDevice.major++,0);return Se.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=r()}catch(e){throw new Se.ErrnoError(29)}if(void 0===l&&0===i)throw new Se.ErrnoError(6);if(null==l)break;i++,t[n+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Se.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Se.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("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.");try{e.contents=d(e.url),e.usedBytes=e.contents.length}catch(e){throw new Se.ErrnoError(29)}},createLazyFile(e,t,r,n,o){class a{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):de(o.responseText||"")})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,y("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!s)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:r};var l=Se.createFile(e,t,i,n,o);i.contents?l.contents=i.contents:i.url&&(l.contents=null,l.url=i.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i}return Object.keys(l.stream_ops).forEach((e=>{var t=l.stream_ops[e];u[e]=(...e)=>(Se.forceLoadFile(l),t(...e))})),u.read=(e,t,r,n,o)=>(Se.forceLoadFile(l),c(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{Se.forceLoadFile(l);var a=ve();if(!a)throw new Se.ErrnoError(48);return c(e,E,a,t,r),{ptr:a,allocated:!0}},l.stream_ops=u,l}},$e={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(ae.isAbs(t))return t;var n;if(n=-100===e?Se.cwd():$e.getStreamFromFD(e).path,0==t.length){if(!r)throw new Se.ErrnoError(44);return n}return ae.join2(n,t)},doStat(e,t,r){var n=e(t);x[r>>2]=n.dev,x[r+4>>2]=n.mode,P[r+8>>2]=n.nlink,x[r+12>>2]=n.uid,x[r+16>>2]=n.gid,x[r+20>>2]=n.rdev,V=[n.size>>>0,(N=n.size,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[r+24>>2]=V[0],x[r+28>>2]=V[1],x[r+32>>2]=4096,x[r+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return V=[Math.floor(o/1e3)>>>0,(N=Math.floor(o/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[r+40>>2]=V[0],x[r+44>>2]=V[1],P[r+48>>2]=o%1e3*1e3*1e3,V=[Math.floor(a/1e3)>>>0,(N=Math.floor(a/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[r+56>>2]=V[0],x[r+60>>2]=V[1],P[r+64>>2]=a%1e3*1e3*1e3,V=[Math.floor(i/1e3)>>>0,(N=Math.floor(i/1e3),+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[r+72>>2]=V[0],x[r+76>>2]=V[1],P[r+80>>2]=i%1e3*1e3*1e3,V=[n.ino>>>0,(N=n.ino,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[r+88>>2]=V[0],x[r+92>>2]=V[1],0},doMsync(e,t,r,n,o){if(!Se.isFile(t.node.mode))throw new Se.ErrnoError(43);if(2&n)return 0;var a=S.slice(e,e+r);Se.msync(t,a,o,r,n)},getStreamFromFD:e=>Se.getStreamChecked(e),varargs:void 0,getStr:e=>re(e)},Ce=e=>{for(var t="",r=e;S[r];)t+=he[S[r++]];return t},xe={},Pe={},Te={},ke=e=>{throw new pe(e)},Ae=e=>{throw new me(e)},De=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&Ae("Mismatched type converter count");for(var o=0;o<e.length;++o)Fe(e[o],n[o])}e.forEach((e=>Te[e]=t));var o=new Array(t.length),a=[],i=0;t.forEach(((e,t)=>{Pe.hasOwnProperty(e)?o[t]=Pe[e]:(a.push(e),xe.hasOwnProperty(e)||(xe[e]=[]),xe[e].push((()=>{o[t]=Pe[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function Fe(e,t,r={}){return function(e,t,r={}){var n=t.name;if(e||ke(`type "${n}" must have a positive integer typeid pointer`),Pe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ke(`Cannot register type '${n}' twice`)}if(Pe[e]=t,delete Te[e],xe.hasOwnProperty(e)){var o=xe[e];delete xe[e],o.forEach((e=>e()))}}(e,t,r)}var Me,Be=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Oe=e=>{ke(e.$$.ptrType.registeredClass.name+" instance already deleted")},Ue=!1,Le=e=>{},je=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},ze=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=ze(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ie={},Ne=()=>Object.keys(qe).length,Ve=()=>{var e=[];for(var t in qe)qe.hasOwnProperty(t)&&e.push(qe[t]);return e},We=[],Ge=()=>{for(;We.length;){var e=We.pop();e.$$.deleteScheduled=!1,e.delete()}},He=e=>{Me=e,We.length&&Me&&Me(Ge)},qe={},Qe=(e,t)=>(t=((e,t)=>{for(void 0===t&&ke("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),qe[t]),Xe=(e,t)=>(t.ptrType&&t.ptr||Ae("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ae("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ke(Object.create(e,{$$:{value:t,writable:!0}})));function Je(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Qe(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Xe(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Xe(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(t),s=Ie[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=ze(t,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?Xe(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):Xe(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var Ke=e=>"undefined"==typeof FinalizationRegistry?(Ke=e=>e,e):(Ue=new FinalizationRegistry((e=>{je(e.$$)})),Ke=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ue.register(e,r,e)}return e},Le=e=>Ue.unregister(e),Ke(e));function Ze(){}var Ye=(e,t)=>Object.defineProperty(t,"name",{value:e}),et=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||ke(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},tt=(e,t,r)=>{o.hasOwnProperty(e)?((void 0===r||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[r])&&ke(`Cannot register public name '${e}' twice`),et(o,e,e),o.hasOwnProperty(r)&&ke(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),o[e].overloadTable[r]=t):(o[e]=t,void 0!==r&&(o[e].numArguments=r))};function rt(e,t,r,n,o,a,i,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var nt=(e,t,r)=>{for(;t!==r;)t.upcast||ke(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function ot(e,t){if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),0;t.$$||ke(`Cannot pass "${Mt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return nt(t.$$.ptr,r,this.registeredClass)}function at(e,t){var r;if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||ke(`Cannot pass "${Mt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=nt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ke("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ke(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Ft.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:ke("Unsupporting sharing policy")}return r}function it(e,t){if(null===t)return this.isReference&&ke(`null is not a valid ${this.name}`),0;t.$$||ke(`Cannot pass "${Mt(t)}" as a ${this.name}`),t.$$.ptr||ke(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ke(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return nt(t.$$.ptr,r,this.registeredClass)}function st(e){return this.fromWireType(P[e>>2])}function lt(e,t,r,n,o,a,i,s,l,u,c){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=c,o||void 0!==t.baseClass?this.toWireType=at:n?(this.toWireType=ot,this.destructorFunction=null):(this.toWireType=it,this.destructorFunction=null)}var ut,ct=(e,t,r)=>{o.hasOwnProperty(e)||Ae("Replacing nonexistent public symbol"),void 0!==o[e].overloadTable&&void 0!==r?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r)},dt=(e,t,r=[])=>{var n=((e,t,r)=>(e=e.replace(/p/g,"i"),(0,o["dynCall_"+e])(t,...r)))(e,t,r);return n},ht=(e,t)=>{e=Ce(e);var r,n,o=(r=e,n=t,(...e)=>dt(r,n,e));return"function"!=typeof o&&ke(`unknown function pointer with signature ${e}: ${t}`),o},pt=e=>{var t=dr(e),r=Ce(t);return ur(t),r},mt=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||Pe[t]||(Te[t]?Te[t].forEach(e):(r.push(t),n[t]=!0))})),new ut(`${e}: `+r.map(pt).join([", "]))},ft=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+4*n>>2]);return r},gt=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function vt(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}var yt=e=>{try{return e()}catch(e){z(e)}},wt=e=>{if(e instanceof X||"unwind"==e)return _;m(1,e)},bt=0,_t=()=>K||bt>0,Et=e=>{_=e,_t()||(o.onExit?.(e),D=!0),m(e,new X(e))},St=(e,t)=>{_=e,Et(e)},$t=e=>{if(!D)try{e(),(()=>{if(!_t())try{St(_)}catch(e){wt(e)}})()}catch(e){wt(e)}},Ct={instrumentWasmImports(e){var t=/^(invoke_.*|__asyncjs__.*)$/;for(let[r,n]of Object.entries(e))"function"==typeof n&&(n.isAsync||t.test(r))},instrumentWasmExports(e){var t={};for(let[r,n]of Object.entries(e))t[r]="function"==typeof n?(...e)=>{Ct.exportCallStack.push(r);try{return n(...e)}finally{D||(Ct.exportCallStack.pop(),Ct.maybeStopUnwind())}}:n;return t},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:4096,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId(e){var t=Ct.callStackNameToId[e];return void 0===t&&(t=Ct.callStackId++,Ct.callStackNameToId[e]=t,Ct.callStackIdToName[t]=e),t},maybeStopUnwind(){Ct.currData&&Ct.state===Ct.State.Unwinding&&0===Ct.exportCallStack.length&&(Ct.state=Ct.State.Normal,yt(kr),"undefined"!=typeof Fibers&&Fibers.trampoline())},whenDone:()=>new Promise(((e,t)=>{Ct.asyncPromiseHandlers={resolve:e,reject:t}})),allocateData(){var e=cr(12+Ct.StackSize);return Ct.setDataHeader(e,e+12,Ct.StackSize),Ct.setDataRewindFunc(e),e},setDataHeader(e,t,r){P[e>>2]=t,P[e+4>>2]=t+r},setDataRewindFunc(e){var t=Ct.exportCallStack[0],r=Ct.getCallStackId(t);x[e+8>>2]=r},getDataRewindFuncName(e){var t=x[e+8>>2];return Ct.callStackIdToName[t]},getDataRewindFunc:e=>lr[e],doRewind(e){var t=Ct.getDataRewindFuncName(e);return Ct.getDataRewindFunc(t)()},handleSleep(e){if(!D){if(Ct.state===Ct.State.Normal){var t=!1,r=!1;e(((e=0)=>{if(!D&&(Ct.handleSleepReturnValue=e,t=!0,r)){Ct.state=Ct.State.Rewinding,yt((()=>Ar(Ct.currData))),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.resume();var n,o=!1;try{n=Ct.doRewind(Ct.currData)}catch(e){n=e,o=!0}var a=!1;if(!Ct.currData){var i=Ct.asyncPromiseHandlers;i&&(Ct.asyncPromiseHandlers=null,(o?i.reject:i.resolve)(n),a=!0)}if(o&&!a)throw n}})),r=!0,t||(Ct.state=Ct.State.Unwinding,Ct.currData=Ct.allocateData(),"undefined"!=typeof Browser&&Browser.mainLoop.func&&Browser.mainLoop.pause(),yt((()=>Tr(Ct.currData))))}else Ct.state===Ct.State.Rewinding?(Ct.state=Ct.State.Normal,yt(Dr),ur(Ct.currData),Ct.currData=null,Ct.sleepCallbacks.forEach($t)):z(`invalid state: ${Ct.state}`);return Ct.handleSleepReturnValue}},handleAsync:e=>Ct.handleSleep((t=>{e().then(t)}))};function xt(e,t,r,n,o,a){var i=t.length;i<2&&ke("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,l=vt(t),u="void"!==t[0].name,c=[e,ke,n,o,gt,t[0],t[1]],d=0;d<i-2;++d)c.push(t[d+2]);if(c.push(Ct),!l)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&c.push(t[d].destructorFunction);let[h,p]=function(e,t,r,n){var o=vt(e),a=e.length-2,i=[],s=["fn"];t&&s.push("thisWired");for(var l=0;l<a;++l)i.push(`arg${l}`),s.push(`arg${l}Wired`);i=i.join(","),s=s.join(",");var u=`\n return function (${i}) {\n if (arguments.length !== ${a}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a}');\n }`;o&&(u+="var destructors = [];\n");var c=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(t&&(u+=`var thisWired = classParam['toWireType'](${c}, this);\n`),l=0;l<a;++l)u+=`var arg${l}Wired = argType${l}['toWireType'](${c}, arg${l});\n`,d.push(`argType${l}`);u+=(r||n?"var rv = ":"")+`invoker(${s});\n`;var h=r?"rv":"";if(d.push("Asyncify"),u+=`function onDone(${h}) {\n`,o)u+="runDestructors(destructors);\n";else for(l=t?1:2;l<e.length;++l){var p=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(u+=`${p}_dtor(${p});\n`,d.push(`${p}_dtor`))}return r&&(u+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),u+="}\n",u+=`return Asyncify.currData ? Asyncify.whenDone().then(onDone) : onDone(${h});\n`,[d,u+="}\n"]}(t,s,u,a);h.push(p);var m=function(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=Ye(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}(Function,h)(...c);return Ye(e,m)}var Pt,Tt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},kt=[],At=[],Dt=()=>At.length/2-5-kt.length,Ft={toValue:e=>(e||ke("Cannot use deleted val. handle = "+e),At[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=kt.pop()||At.length;return At[t]=e,At[t+1]=1,t}}}},Rt={name:"emscripten::val",fromWireType:e=>{var t=Ft.toValue(e);return(e=>{e>9&&0==--At[e+1]&&(At[e]=void 0,kt.push(e))})(e),t},toWireType:(e,t)=>Ft.toHandle(t),argPackAdvance:8,readValueFromPointer:st,destructorFunction:null},Mt=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Bt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(T[e>>2])};case 8:return function(e){return this.fromWireType(k[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Ot=(e,t,r)=>{switch(t){case 1:return r?e=>E[e]:e=>S[e];case 2:return r?e=>$[e>>1]:e=>C[e>>1];case 4:return r?e=>x[e>>2]:e=>P[e>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ut=(e,t,r)=>ce(e,S,t,r),Lt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,jt=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&C[n];)++n;if((r=n<<1)-e>32&&Lt)return Lt.decode(S.subarray(e,r));for(var a="",i=0;!(i>=t/2);++i){var s=$[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},zt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);$[t>>1]=i,t+=2}return $[t>>1]=0,t-n},It=e=>2*e.length,Nt=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=x[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Vt=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,o=n+r-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),x[t>>2]=i,(t+=4)+4>o)break}return x[t>>2]=0,t-n},Wt=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Gt={};Pt=()=>performance.now();var Ht=e=>{var t=(e-b.buffer.byteLength+65535)/65536;try{return b.grow(t),F(),1}catch(e){}},qt=e=>Ct.handleSleep((t=>{return r=t,setTimeout((()=>{$t(r)}),e);var r}));qt.isAsync=!0;var Qt,Xt,Jt,Kt={},Zt=()=>{if(!Zt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in Kt)void 0===Kt[t]?delete e[t]:e[t]=Kt[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Zt.strings=r}return Zt.strings},Yt=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,er=e=>{var t=ue(e)+1,r=gr(t);return Ut(e,r,t),r},tr={errorCallback:(e,t,r,n)=>{var o=Y(),a=er(r);Cr(e,t,a,n),Z(o)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,t={}){var r=this.nextId++;return t.refcount=1,t.object=e,this.objects[r]=t,r},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var t=this.objects[e];t.refcount--,t.refcount<=0&&delete this.objects[e]}}tr.mgrDevice||(tr.mgrSurface=tr.mgrSurface||new e,tr.mgrSwapChain=tr.mgrSwapChain||new e,tr.mgrAdapter=tr.mgrAdapter||new e,tr.mgrDevice=tr.mgrDevice||new e,tr.mgrQueue=tr.mgrQueue||new e,tr.mgrCommandBuffer=tr.mgrCommandBuffer||new e,tr.mgrCommandEncoder=tr.mgrCommandEncoder||new e,tr.mgrRenderPassEncoder=tr.mgrRenderPassEncoder||new e,tr.mgrComputePassEncoder=tr.mgrComputePassEncoder||new e,tr.mgrBindGroup=tr.mgrBindGroup||new e,tr.mgrBuffer=tr.mgrBuffer||new e,tr.mgrSampler=tr.mgrSampler||new e,tr.mgrTexture=tr.mgrTexture||new e,tr.mgrTextureView=tr.mgrTextureView||new e,tr.mgrQuerySet=tr.mgrQuerySet||new e,tr.mgrBindGroupLayout=tr.mgrBindGroupLayout||new e,tr.mgrPipelineLayout=tr.mgrPipelineLayout||new e,tr.mgrRenderPipeline=tr.mgrRenderPipeline||new e,tr.mgrComputePipeline=tr.mgrComputePipeline||new e,tr.mgrShaderModule=tr.mgrShaderModule||new e,tr.mgrRenderBundleEncoder=tr.mgrRenderBundleEncoder||new e,tr.mgrRenderBundle=tr.mgrRenderBundle||new e)},makeColor:e=>({r:k[e>>3],g:k[e+8>>3],b:k[e+16>>3],a:k[e+24>>3]}),makeExtent3D:e=>({width:P[e>>2],height:P[e+4>>2],depthOrArrayLayers:P[e+8>>2]}),makeOrigin3D:e=>({x:P[e>>2],y:P[e+4>>2],z:P[e+8>>2]}),makeImageCopyTexture:e=>({texture:tr.mgrTexture.get(P[e+4>>2]),mipLevel:P[e+8>>2],origin:tr.makeOrigin3D(e+12),aspect:tr.TextureAspect[P[e+24>>2]]}),makeTextureDataLayout:e=>{var t=P[e+16>>2],r=P[e+20>>2];return{offset:4294967296*P[e+4+8>>2]+P[e+8>>2],bytesPerRow:4294967295===t?void 0:t,rowsPerImage:4294967295===r?void 0:r}},makeImageCopyBuffer:e=>{var t=e+8,r=tr.makeTextureDataLayout(t);return r.buffer=tr.mgrBuffer.get(P[e+32>>2]),r},makePipelineConstants:(e,t)=>{if(e){for(var r={},n=0;n<e;++n){var o=t+16*n;r[re(P[o+4>>2])]=k[o+8>>3]}return r}},makePipelineLayout:e=>e?tr.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var t={module:tr.mgrShaderModule.get(P[e+4>>2]),constants:tr.makePipelineConstants(P[e+12>>2],P[e+16>>2])},r=P[e+8>>2];return r&&(t.entryPoint=re(r)),t}},fillLimitStruct:(e,t)=>{var r=t+8;function n(t,n){var o=e[t];x[r+n>>2]=o}function o(t,n){var o=e[t];V=[o>>>0,(N=o,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[r+n>>2]=V[0],x[r+(n+4)>>2]=V[1]}n("maxTextureDimension1D",0),n("maxTextureDimension2D",4),n("maxTextureDimension3D",8),n("maxTextureArrayLayers",12),n("maxBindGroups",16),n("maxBindGroupsPlusVertexBuffers",20),n("maxBindingsPerBindGroup",24),n("maxDynamicUniformBuffersPerPipelineLayout",28),n("maxDynamicStorageBuffersPerPipelineLayout",32),n("maxSampledTexturesPerShaderStage",36),n("maxSamplersPerShaderStage",40),n("maxStorageBuffersPerShaderStage",44),n("maxStorageTexturesPerShaderStage",48),n("maxUniformBuffersPerShaderStage",52),n("minUniformBufferOffsetAlignment",72),n("minStorageBufferOffsetAlignment",76),o("maxUniformBufferBindingSize",56),o("maxStorageBufferBindingSize",64),n("maxVertexBuffers",80),o("maxBufferSize",88),n("maxVertexAttributes",96),n("maxVertexBufferArrayStride",100),n("maxInterStageShaderComponents",104),n("maxInterStageShaderVariables",108),n("maxColorAttachments",112),n("maxColorAttachmentBytesPerSample",116),n("maxComputeWorkgroupStorageSize",120),n("maxComputeInvocationsPerWorkgroup",124),n("maxComputeWorkgroupSizeX",128),n("maxComputeWorkgroupSizeY",132),n("maxComputeWorkgroupSizeZ",136),n("maxComputeWorkgroupsPerDimension",140)},Int_BufferMapState:{unmapped:1,pending:2,mapped:3},Int_CompilationMessageType:{error:0,warning:1,info:2},Int_DeviceLostReason:{undefined:1,unknown:1,destroyed:2},Int_PreferredFormat:{rgba8unorm:18,bgra8unorm:23},WGSLFeatureName:[,"readonly_and_readwrite_storage_textures","packed_4x8_integer_dot_product","unrestricted_pointer_parameters","pointer_composite_access"],AddressMode:[,"clamp-to-edge","repeat","mirror-repeat"],AlphaMode:[,"opaque","premultiplied"],BlendFactor:[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:[,"add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],BufferMapState:{1:"unmapped",2:"pending",3:"mapped"},CompareFunction:[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:[,"none","front","back"],ErrorFilter:{1:"validation",2:"out-of-memory",3:"internal"},FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32-filterable"],FilterMode:[,"nearest","linear"],FrontFace:[,"ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:[,"nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:{1:"occlusion",2:"timestamp"},SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only","read-only","read-write"],StoreOp:[,"store","discard"],TextureAspect:[,"all","stencil-only","depth-only"],TextureDimension:[,"1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2"],VertexStepMode:[,"vertex-buffer-not-used","vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10","float32-filterable":"11"}},rr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],nr=e=>{var t;return e=(t=e)>2?re(t):t,rr[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},or=Se.createPath,ar=Se.createLazyFile,ir=Se.createDevice;Se.createPreloadedFile=_e,Se.staticInit(),o.FS_createPath=Se.createPath,o.FS_createDataFile=Se.createDataFile,o.FS_createPreloadedFile=Se.createPreloadedFile,o.FS_unlink=Se.unlink,o.FS_createLazyFile=Se.createLazyFile,o.FS_createDevice=Se.createDevice,(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);he=e})(),pe=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},me=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Ze.prototype,{isAliasOf(e){if(!(this instanceof Ze))return!1;if(!(e instanceof Ze))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o},clone(){if(this.$$.ptr||Oe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Ke(Object.create(Object.getPrototypeOf(this),{$$:{value:Be(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Oe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),Le(this),je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Oe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ke("Object already scheduled for deletion"),We.push(this),1===We.length&&Me&&Me(Ge),this.$$.deleteScheduled=!0,this}}),o.getInheritedInstanceCount=Ne,o.getLiveInheritedInstances=Ve,o.flushPendingDeletes=Ge,o.setDelayFunction=He,Object.assign(lt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:st,fromWireType:Je}),ut=o.UnboundTypeError=(Qt=Error,(Jt=Ye(Xt="UnboundTypeError",(function(e){this.name=Xt,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Qt.prototype),Jt.prototype.constructor=Jt,Jt.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Jt),At.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=Dt,tr.initManagers();var sr={b:(e,t,r,n)=>{z(`Assertion failed: ${re(e)}, at: `+[t?re(t):"unknown filename",r,n?re(n):"unknown function"])},O:function(e,t,r){$e.varargs=r;try{var n=$e.getStreamFromFD(e);switch(t){case 0:if((o=ne())<0)return-28;for(;Se.streams[o];)o++;return Se.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=ne();return n.flags|=o,0;case 12:return o=oe(),$[o+0>>1]=2,0}return-28}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return-e.errno}},va:function(e,t,r){$e.varargs=r;try{var n=$e.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=oe();x[a>>2]=o.c_iflag||0,x[a+4>>2]=o.c_oflag||0,x[a+8>>2]=o.c_cflag||0,x[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)E[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=oe();var s=x[a>>2],l=x[a+4>>2],u=x[a+8>>2],c=x[a+12>>2],d=[];for(i=0;i<32;i++)d.push(E[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:c,c_cc:d})}return 0;case 21519:return n.tty?(a=oe(),x[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=oe(),Se.ioctl(n,t,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=oe(),$[a>>1]=h[0],$[a+2>>1]=h[1]}return 0;default:return-28}}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return-e.errno}},wa:function(e,t,r,n){$e.varargs=n;try{t=$e.getStr(t),t=$e.calculateAt(e,t);var o=n?ne():0;return Se.open(t,r,o).fd}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return-e.errno}},xa:()=>{z("")},ea:(e,t,r,n,o)=>{},Aa:(e,t,r,n)=>{Fe(e,{name:t=Ce(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(S[e])},destructorFunction:null})},Ea:(e,t,r,n,o,a,i,s,l,u,c,d,h)=>{c=Ce(c),a=ht(o,a),s&&=ht(i,s),u&&=ht(l,u),h=ht(d,h);var p=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(c);tt(p,(function(){mt(`Cannot construct ${c} due to unbound types`,[n])})),De([e,t,r],n?[n]:[],(t=>{var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Ze.prototype;var i=Ye(c,(function(...e){if(Object.getPrototypeOf(this)!==l)throw new pe("Use 'new' to construct "+c);if(void 0===d.constructor_body)throw new pe(c+" has no accessible constructor");var t=d.constructor_body[e.length];if(void 0===t)throw new pe(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)})),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var d=new rt(c,i,l,h,r,a,s,u);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var m=new lt(c,d,!0,!1,!1),f=new lt(c+"*",d,!1,!1,!1),g=new lt(c+" const*",d,!1,!0,!1);return Ie[e]={pointerType:f,constPointerType:g},ct(p,i),[m,f,g]}))},Da:(e,t,r,n,o,a)=>{var i=ft(t,r);o=ht(n,o),De([],[e],(e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new pe(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{mt(`Cannot construct ${e.name} due to unbound types`,i)},De([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=xt(r,n,null,o,a),[]))),[]}))},q:(e,t,r,n,o,a,i,s,l)=>{var u=ft(r,n);t=Ce(t),t=Tt(t),a=ht(o,a),De([],[e],(e=>{var n=`${(e=e[0]).name}.${t}`;function o(){mt(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,d=c[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(et(c,t,n),c[t].overloadTable[r-2]=o),De([],u,(o=>{var s=xt(n,o,e,a,i,l);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},za:e=>Fe(e,Rt),P:(e,t,r)=>{Fe(e,{name:t=Ce(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Bt(t,r),destructorFunction:null})},S:(e,t,r,n,o,a,i)=>{var s=ft(t,r);e=Ce(e),e=Tt(e),o=ht(n,o),tt(e,(function(){mt(`Cannot call ${e} due to unbound types`,s)}),t-1),De([],s,(r=>{var n=[r[0],null].concat(r.slice(1));return ct(e,xt(e,n,null,o,a,i),t-1),[]}))},v:(e,t,r,n,o)=>{t=Ce(t);var a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var s=t.includes("unsigned");Fe(e,{name:t,fromWireType:a,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Ot(t,r,0!==n),destructorFunction:null})},h:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=P[e>>2],r=P[e+4>>2];return new n(E.buffer,r,t)}Fe(e,{name:r=Ce(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Q:(e,t)=>{var r="std::string"===(t=Ce(t));Fe(e,{name:t,fromWireType(e){var t,n=P[e>>2],o=e+4;if(r)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==S[s]){var l=re(a,s-a);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),a=s+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(S[o+i]);t=u.join("")}return ur(e),t},toWireType(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||ke("Cannot pass non-string to std::string"),n=r&&o?ue(t):t.length;var a=cr(4+n+1),i=a+4;if(P[a>>2]=n,r&&o)Ut(t,i,n+1);else if(o)for(var s=0;s<n;++s){var l=t.charCodeAt(s);l>255&&(ur(i),ke("String has UTF-16 code units that do not fit in 8 bits")),S[i+s]=l}else for(s=0;s<n;++s)S[i+s]=t[s];return null!==e&&e.push(ur,a),a},argPackAdvance:8,readValueFromPointer:st,destructorFunction(e){ur(e)}})},J:(e,t,r)=>{var n,o,a,i;r=Ce(r),2===t?(n=jt,o=zt,i=It,a=e=>C[e>>1]):4===t&&(n=Nt,o=Vt,i=Wt,a=e=>P[e>>2]),Fe(e,{name:r,fromWireType:e=>{for(var r,o=P[e>>2],i=e+4,s=0;s<=o;++s){var l=e+4+s*t;if(s==o||0==a(l)){var u=n(i,l-i);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),i=l+t}}return ur(e),r},toWireType:(e,n)=>{"string"!=typeof n&&ke(`Cannot pass non-string to C++ string type ${r}`);var a=i(n),s=cr(4+a+t);return P[s>>2]=a/t,o(n,s+4,a+t),null!==e&&e.push(ur,s),s},argPackAdvance:8,readValueFromPointer:st,destructorFunction(e){ur(e)}})},Ba:(e,t)=>{Fe(e,{isVoid:!0,name:t=Ce(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},sa:(e,t,r)=>S.copyWithin(e,t,t+r),la:()=>{K=!1,bt=0},ja:()=>{throw 1/0},A:(e,t)=>{var r,n,o;n="_emval_take_value",void 0===(o=Pe[r=e])&&ke(`${n} has unknown type ${pt(r)}`);var a=(e=o).readValueFromPointer(t);return Ft.toHandle(a)},ma:(e,t)=>{if(Gt[e]&&(clearTimeout(Gt[e].id),delete Gt[e]),!t)return 0;var r=setTimeout((()=>{delete Gt[e],$t((()=>hr(e,Pt())))}),t);return Gt[e]={id:r,timeout_ms:t},0},na:(e,t,r,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);P[e>>2]=60*u,x[t>>2]=Number(s!=l);var c=e=>{var t=e>=0?"-":"+",r=Math.abs(e);return`UTC${t}${String(Math.floor(r/60)).padStart(2,"0")}${String(r%60).padStart(2,"0")}`},d=c(s),h=c(l);l<s?(Ut(d,r,17),Ut(h,n,17)):(Ut(d,n,17),Ut(h,r,17))},ra:e=>{var t,r,n=S.length,o=2147483648;if((e>>>=0)>o)return!1;for(var a=1;a<=4;a*=2){var i=n*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(o,(t=Math.max(e,i),r=65536,Math.ceil(t/r)*r));if(Ht(s))return!0}return!1},T:qt,oa:(e,t)=>{var r=0;return Zt().forEach(((n,o)=>{var a=t+r;P[e+4*o>>2]=a,((e,t)=>{for(var r=0;r<e.length;++r)E[t++]=e.charCodeAt(r);E[t]=0})(n,a),r+=n.length+1})),0},pa:(e,t)=>{var r=Zt();P[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),P[t>>2]=n,0},N:function(e){try{var t=$e.getStreamFromFD(e);return Se.close(t),0}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return e.errno}},ua:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,a=0;a<r;a++){var i=P[t>>2],s=P[t+4>>2];t+=8;var l=Se.read(e,E,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})($e.getStreamFromFD(e),t,r);return P[n>>2]=o,0}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return e.errno}},Va:function(e,t,r,n,o){var a=Yt(t,r);try{if(isNaN(a))return 61;var i=$e.getStreamFromFD(e);return Se.llseek(i,a,n),V=[i.position>>>0,(N=i.position,+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0)],x[o>>2]=V[0],x[o+4>>2]=V[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return e.errno}},ta:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,a=0;a<r;a++){var i=P[t>>2],s=P[t+4>>2];t+=8;var l=Se.write(e,E,i,s,n);if(l<0)return-1;if(o+=l,l<s)break}return o})($e.getStreamFromFD(e),t,r);return P[n>>2]=o,0}catch(e){if(void 0===Se||"ErrnoError"!==e.name)throw e;return e.errno}},n:function(e,t){var r=Y();try{return wr(e,t)}catch(e){if(Z(r),e!==e+0)throw e;pr(1,0)}},g:function(e,t,r){var n=Y();try{return $r(e,t,r)}catch(e){if(Z(n),e!==e+0)throw e;pr(1,0)}},e:function(e,t,r,n){var o=Y();try{return yr(e,t,r,n)}catch(e){if(Z(o),e!==e+0)throw e;pr(1,0)}},D:function(e,t,r,n,o,a){var i=Y();try{return Sr(e,t,r,n,o,a)}catch(e){if(Z(i),e!==e+0)throw e;pr(1,0)}},a:function(e,t){var r=Y();try{br(e,t)}catch(e){if(Z(r),e!==e+0)throw e;pr(1,0)}},c:function(e,t,r){var n=Y();try{_r(e,t,r)}catch(e){if(Z(n),e!==e+0)throw e;pr(1,0)}},f:function(e,t,r,n){var o=Y();try{Cr(e,t,r,n)}catch(e){if(Z(o),e!==e+0)throw e;pr(1,0)}},z:function(e,t,r,n,o){var a=Y();try{xr(e,t,r,n,o)}catch(e){if(Z(a),e!==e+0)throw e;pr(1,0)}},Ua:function(e,t,r,n,o,a){var i=Y();try{Er(e,t,r,n,o,a)}catch(e){if(Z(i),e!==e+0)throw e;pr(1,0)}},ka:Et,V:(e,t)=>{var r=tr.mgrAdapter.get(e);if(0!==t){var n=0;r.features.forEach((e=>{var r=tr.FeatureNameString2Enum[e];x[t+n>>2]=r,n+=4}))}return r.features.size},$:e=>tr.mgrAdapter.release(e),U:(e,t,r,n)=>{var o=tr.mgrAdapter.get(e),a={};if(t){var i=P[t+8>>2];if(i){var s=P[t+12>>2];a.requiredFeatures=Array.from(x.subarray(s>>2,s+4*i>>2),(e=>tr.FeatureName[e]))}var l=P[t+16>>2];if(l){var u=l+8,c={};function g(e,t){var r=P[u+t>>2];4294967295!=r&&(c[e]=r)}function v(e,t){var r=u+t,n=P[r>>2],o=P[r+4>>2];4294967295==n&&4294967295==o||(c[e]=4294967296*P[r+4>>2]+P[r>>2])}g("maxTextureDimension1D",0),g("maxTextureDimension2D",4),g("maxTextureDimension3D",8),g("maxTextureArrayLayers",12),g("maxBindGroups",16),g("maxBindGroupsPlusVertexBuffers",20),g("maxDynamicUniformBuffersPerPipelineLayout",28),g("maxDynamicStorageBuffersPerPipelineLayout",32),g("maxSampledTexturesPerShaderStage",36),g("maxSamplersPerShaderStage",40),g("maxStorageBuffersPerShaderStage",44),g("maxStorageTexturesPerShaderStage",48),g("maxUniformBuffersPerShaderStage",52),g("minUniformBufferOffsetAlignment",72),g("minStorageBufferOffsetAlignment",76),v("maxUniformBufferBindingSize",56),v("maxStorageBufferBindingSize",64),g("maxVertexBuffers",80),v("maxBufferSize",88),g("maxVertexAttributes",96),g("maxVertexBufferArrayStride",100),g("maxInterStageShaderComponents",104),g("maxInterStageShaderVariables",108),g("maxColorAttachments",112),g("maxColorAttachmentBytesPerSample",116),g("maxComputeWorkgroupStorageSize",120),g("maxComputeInvocationsPerWorkgroup",124),g("maxComputeWorkgroupSizeX",128),g("maxComputeWorkgroupSizeY",132),g("maxComputeWorkgroupSizeZ",136),g("maxComputeWorkgroupsPerDimension",140),a.requiredLimits=c}var d=P[t+20>>2];if(d){var h={};(p=P[d+4>>2])&&(h.label=re(p)),a.defaultQueue=h}var p,m=P[t+28>>2],f=P[t+32>>2];(p=P[t+4>>2])&&(a.label=re(p))}o.requestDevice(a).then((e=>{$t((()=>{var t={queueId:tr.mgrQueue.create(e.queue)},o=tr.mgrDevice.create(e,t);m&&e.lost.then((e=>{$t((()=>tr.errorCallback(m,tr.Int_DeviceLostReason[e.reason],e.message,f)))})),xr(r,0,o,0,n)}))}),(function(e){$t((()=>{var t=Y(),o=er(e.message);xr(r,1,0,o,n),Z(t)}))}))},w:e=>tr.mgrBindGroupLayout.release(e),t:e=>tr.mgrBindGroup.release(e),Qa:e=>{var t=tr.mgrBuffer.objects[e];if(t.onUnmap){for(var r=0;r<t.onUnmap.length;++r)t.onUnmap[r]();t.onUnmap=void 0}tr.mgrBuffer.get(e).destroy()},ia:function(e){var t,r=tr.mgrBuffer.get(e).size;return N=r,t=+Math.abs(N)>=1?N>0?+Math.floor(N/4294967296)>>>0:~~+Math.ceil((N-+(~~N>>>0))/4294967296)>>>0:0,mr(t),r>>>0},Pa:e=>tr.mgrBuffer.release(e),Y:e=>tr.mgrCommandBuffer.release(e),Na:(e,t)=>{var r;if(t){r={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:tr.mgrQuerySet.get(P[e>>2]),beginningOfPassWriteIndex:P[e+4>>2],endOfPassWriteIndex:P[e+8>>2]}}(P[t+8>>2])};var n=P[t+4>>2];n&&(r.label=re(n))}var o=tr.mgrCommandEncoder.get(e);return tr.mgrComputePassEncoder.create(o.beginComputePass(r))},da:(e,t)=>{function r(e){var t=P[e+4>>2];if(0!==t){var r=x[e+8>>2];-1==r&&(r=void 0);var n=P[e+16>>2],o=P[e+20>>2],a=tr.makeColor(e+24);return{view:tr.mgrTextureView.get(t),depthSlice:r,resolveTarget:tr.mgrTextureView.get(P[e+12>>2]),clearValue:a,loadOp:tr.LoadOp[n],storeOp:tr.StoreOp[o]}}}function n(e,t){for(var n=[],o=0;o<e;++o)n.push(r(t+56*o));return n}function o(e){if(0!==e)return{view:tr.mgrTextureView.get(P[e>>2]),depthClearValue:T[e+12>>2],depthLoadOp:tr.LoadOp[P[e+4>>2]],depthStoreOp:tr.StoreOp[P[e+8>>2]],depthReadOnly:!!P[e+16>>2],stencilClearValue:P[e+28>>2],stencilLoadOp:tr.LoadOp[P[e+20>>2]],stencilStoreOp:tr.StoreOp[P[e+24>>2]],stencilReadOnly:!!P[e+32>>2]}}function a(e){if(0!==e)return{querySet:tr.mgrQuerySet.get(P[e>>2]),beginningOfPassWriteIndex:P[e+4>>2],endOfPassWriteIndex:P[e+8>>2]}}var i=function(e){var t=P[e>>2],r=void 0;if(0!==t){P[t+4>>2];var i=t;r=4294967296*P[i+4+8>>2]+P[i+8>>2]}var s={label:void 0,colorAttachments:n(P[e+8>>2],P[e+12>>2]),depthStencilAttachment:o(P[e+16>>2]),occlusionQuerySet:tr.mgrQuerySet.get(P[e+20>>2]),timestampWrites:a(P[e+24>>2]),maxDrawCount:r},l=P[e+4>>2];return l&&(s.label=re(l)),s}(t),s=tr.mgrCommandEncoder.get(e);return tr.mgrRenderPassEncoder.create(s.beginRenderPass(i))},B:(e,t,r,n)=>{var o=tr.mgrCommandEncoder.get(e),a=tr.makeExtent3D(n);o.copyTextureToTexture(tr.makeImageCopyTexture(t),tr.makeImageCopyTexture(r),a)},Z:(e,t)=>{var r=tr.mgrCommandEncoder.get(e);return tr.mgrCommandBuffer.create(r.finish())},X:e=>tr.mgrCommandEncoder.release(e),La:(e,t,r,n)=>{tr.mgrComputePassEncoder.get(e).dispatchWorkgroups(t,r,n)},Ka:e=>{tr.mgrComputePassEncoder.get(e).end()},L:(e,t,r,n,o)=>{var a=tr.mgrComputePassEncoder.get(e),i=tr.mgrBindGroup.get(r);if(0==n)a.setBindGroup(t,i);else{for(var s=[],l=0;l<n;l++,o+=4)s.push(P[o>>2]);a.setBindGroup(t,i,s)}},Ma:(e,t)=>{var r=tr.mgrComputePassEncoder.get(e),n=tr.mgrComputePipeline.get(t);r.setPipeline(n)},Ia:e=>tr.mgrComputePipeline.release(e),x:(e,t)=>{function r(e){var t,r=P[e+8>>2],n=P[e+32>>2],o=P[e+36>>2],a=P[e+4>>2];if(r){var i=P[(t=e+24)>>2]+4294967296*x[t+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:tr.mgrBuffer.get(r),offset:4294967296*P[e+4+16>>2]+P[e+16>>2],size:i}}}return n?{binding:a,resource:tr.mgrSampler.get(n)}:{binding:a,resource:tr.mgrTextureView.get(o)}}var n={label:void 0,layout:tr.mgrBindGroupLayout.get(P[t+8>>2]),entries:function(e,t){for(var n=[],o=0;o<e;++o)n.push(r(t+40*o));return n}(P[t+12>>2],P[t+16>>2])},o=P[t+4>>2];o&&(n.label=re(o));var a=tr.mgrDevice.get(e);return tr.mgrBindGroup.create(a.createBindGroup(n))},u:(e,t)=>{function r(e){var t=P[e+4>>2];if(t)return{type:tr.BufferBindingType[t],hasDynamicOffset:!!P[e+8>>2],minBindingSize:4294967296*P[e+4+16>>2]+P[e+16>>2]}}function n(e){var t=P[e+4>>2];if(t)return{type:tr.SamplerBindingType[t]}}function o(e){var t=P[e+4>>2];if(t)return{sampleType:tr.TextureSampleType[t],viewDimension:tr.TextureViewDimension[P[e+8>>2]],multisampled:!!P[e+12>>2]}}function a(e){var t=P[e+4>>2];if(t)return{access:tr.StorageTextureAccess[t],format:tr.TextureFormat[P[e+8>>2]],viewDimension:tr.TextureViewDimension[P[e+12>>2]]}}var i={entries:function(e,t){for(var i,s=[],l=0;l<e;++l)s.push({binding:P[(i=t+80*l)+4>>2],visibility:P[i+8>>2],buffer:r(i+16),sampler:n(i+40),texture:o(i+48),storageTexture:a(i+64)});return s}(P[t+8>>2],P[t+12>>2])},s=P[t+4>>2];s&&(i.label=re(s));var l=tr.mgrDevice.get(e);return tr.mgrBindGroupLayout.create(l.createBindGroupLayout(i))},F:(e,t)=>{var r=!!P[t+24>>2],n={label:void 0,usage:P[t+8>>2],size:4294967296*P[t+4+16>>2]+P[t+16>>2],mappedAtCreation:r},o=P[t+4>>2];o&&(n.label=re(o));var a=tr.mgrDevice.get(e),i={},s=tr.mgrBuffer.create(a.createBuffer(n),i);return r&&(i.mapMode=2,i.onUnmap=[]),s},_:(e,t)=>{var r;if(t){r={label:void 0};var n=P[t+4>>2];n&&(r.label=re(n))}var o=tr.mgrDevice.get(e);return tr.mgrCommandEncoder.create(o.createCommandEncoder(r))},Ja:(e,t)=>{var r=(e=>{var t={label:void 0,layout:tr.makePipelineLayout(P[e+8>>2]),compute:tr.makeProgrammableStageDescriptor(e+12)},r=P[e+4>>2];return r&&(t.label=re(r)),t})(t),n=tr.mgrDevice.get(e);return tr.mgrComputePipeline.create(n.createComputePipeline(r))},r:(e,t)=>{for(var r=P[t+8>>2],n=P[t+12>>2],o=[],a=0;a<r;++a)o.push(tr.mgrBindGroupLayout.get(P[n+4*a>>2]));var i={label:void 0,bindGroupLayouts:o},s=P[t+4>>2];s&&(i.label=re(s));var l=tr.mgrDevice.get(e);return tr.mgrPipelineLayout.create(l.createPipelineLayout(i))},j:(e,t)=>{var r=(e=>{function t(e){if(e)return{operation:tr.BlendOperation[P[e>>2]],srcFactor:tr.BlendFactor[P[e+4>>2]],dstFactor:tr.BlendFactor[P[e+8>>2]]}}function r(e){if(e)return{alpha:t(e+12),color:t(e+0)}}function n(e,t){for(var n,o,a=[],i=0;i<e;++i)a.push((o=void 0,0===(o=P[(n=t+16*i)+4>>2])?void 0:{format:tr.TextureFormat[o],blend:r(P[n+8>>2]),writeMask:P[n+12>>2]}));return a}function o(e){return{compare:tr.CompareFunction[P[e>>2]],failOp:tr.StencilOperation[P[e+4>>2]],depthFailOp:tr.StencilOperation[P[e+8>>2]],passOp:tr.StencilOperation[P[e+12>>2]]}}function a(e,t){for(var r,n=[],o=0;o<e;++o)n.push((r=t+24*o,{format:tr.VertexFormat[P[r>>2]],offset:4294967296*P[r+4+8>>2]+P[r+8>>2],shaderLocation:P[r+16>>2]}));return n}function i(e){if(e){var t=P[e+8>>2];return 1===t?null:{arrayStride:4294967296*P[e+4>>2]+P[e>>2],stepMode:tr.VertexStepMode[t],attributes:a(P[e+12>>2],P[e+16>>2])}}}function s(e,t){if(e){for(var r=[],n=0;n<e;++n)r.push(i(t+24*n));return r}}var l={label:void 0,layout:tr.makePipelineLayout(P[e+8>>2]),vertex:function(e){if(e){var t={module:tr.mgrShaderModule.get(P[e+4>>2]),constants:tr.makePipelineConstants(P[e+12>>2],P[e+16>>2]),buffers:s(P[e+20>>2],P[e+24>>2])},r=P[e+8>>2];return r&&(t.entryPoint=re(r)),t}}(e+12),primitive:function(e){if(e){var t=P[e>>2],r=t?P[t+4>>2]:0;return{topology:tr.PrimitiveTopology[P[e+4>>2]],stripIndexFormat:tr.IndexFormat[P[e+8>>2]],frontFace:tr.FrontFace[P[e+12>>2]],cullMode:tr.CullMode[P[e+16>>2]],unclippedDepth:7===r&&!!P[t+8>>2]}}}(e+40),depthStencil:function(e){if(e)return{format:tr.TextureFormat[P[e+4>>2]],depthWriteEnabled:!!P[e+8>>2],depthCompare:tr.CompareFunction[P[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:P[e+48>>2],stencilWriteMask:P[e+52>>2],depthBias:x[e+56>>2],depthBiasSlopeScale:T[e+60>>2],depthBiasClamp:T[e+64>>2]}}(P[e+60>>2]),multisample:function(e){if(e)return{count:P[e+4>>2],mask:P[e+8>>2],alphaToCoverageEnabled:!!P[e+12>>2]}}(e+64),fragment:function(e){if(e){var t={module:tr.mgrShaderModule.get(P[e+4>>2]),constants:tr.makePipelineConstants(P[e+12>>2],P[e+16>>2]),targets:n(P[e+20>>2],P[e+24>>2])},r=P[e+8>>2];return r&&(t.entryPoint=re(r)),t}}(P[e+80>>2])},u=P[e+4>>2];return u&&(l.label=re(u)),l})(t),n=tr.mgrDevice.get(e);return tr.mgrRenderPipeline.create(n.createRenderPipeline(r))},E:(e,t)=>{var r;if(t){r={label:void 0,addressModeU:tr.AddressMode[P[t+8>>2]],addressModeV:tr.AddressMode[P[t+12>>2]],addressModeW:tr.AddressMode[P[t+16>>2]],magFilter:tr.FilterMode[P[t+20>>2]],minFilter:tr.FilterMode[P[t+24>>2]],mipmapFilter:tr.MipmapFilterMode[P[t+28>>2]],lodMinClamp:T[t+32>>2],lodMaxClamp:T[t+36>>2],compare:tr.CompareFunction[P[t+40>>2]]};var n=P[t+4>>2];n&&(r.label=re(n))}var o=tr.mgrDevice.get(e);return tr.mgrSampler.create(o.createSampler(r))},o:(e,t)=>{var r=P[t>>2],n=P[r+4>>2],o={label:void 0,code:""},a=P[t+4>>2];switch(a&&(o.label=re(a)),n){case 5:var i=P[r+8>>2],s=P[r+12>>2]>>2;o.code=P.subarray(s,s+i);break;case 6:var l=P[r+8>>2];l&&(o.code=re(l))}var u=tr.mgrDevice.get(e);return tr.mgrShaderModule.create(u.createShaderModule(o))},H:(e,t)=>{var r={label:void 0,size:tr.makeExtent3D(t+16),mipLevelCount:P[t+32>>2],sampleCount:P[t+36>>2],dimension:tr.TextureDimension[P[t+12>>2]],format:tr.TextureFormat[P[t+28>>2]],usage:P[t+8>>2]},n=P[t+4>>2];n&&(r.label=re(n));var o=P[t+40>>2];if(o){var a=P[t+44>>2];r.viewFormats=Array.from(x.subarray(a>>2,a+4*o>>2),(function(e){return tr.TextureFormat[e]}))}var i=tr.mgrDevice.get(e);return tr.mgrTexture.create(i.createTexture(r))},Ha:e=>{var t=tr.mgrDevice.objects[e].queueId;return tr.mgrQueue.reference(t),t},aa:e=>tr.mgrDevice.release(e),Ca:(e,t)=>{var r=P[t>>2],n=P[r+8>>2],o=nr(n).getContext("webgpu");if(!o)return 0;var a=P[t+4>>2];return a&&(o.surfaceLabelWebGPU=re(a)),tr.mgrSurface.create(o)},W:(e,t,r,n)=>{var o;if(t&&(o={powerPreference:tr.PowerPreference[P[t+8>>2]],forceFallbackAdapter:!!P[t+16>>2]}),!("gpu"in navigator)){var a=Y(),i=er("WebGPU not available on this browser (navigator.gpu is not available)");return xr(r,1,0,i,n),void Z(a)}navigator.gpu.requestAdapter(o).then((e=>{$t((()=>{if(e)((e,t,n,o)=>{xr(r,0,t,0,o)})(0,tr.mgrAdapter.create(e),0,n);else{var t=Y();((e,t,n,o)=>{xr(r,1,0,n,o)})(0,0,er("WebGPU not available on this system (requestAdapter returned null)"),n),Z(t)}}))}),(e=>{$t((()=>{var t=Y();((e,t,n,o)=>{xr(r,2,0,n,o)})(0,0,er(e.message),n),Z(t)}))}))},p:e=>tr.mgrPipelineLayout.release(e),Oa:e=>tr.mgrQueue.release(e),C:(e,t,r)=>{var n=tr.mgrQueue.get(e),o=Array.from(x.subarray(r>>2,r+4*t>>2),(e=>tr.mgrCommandBuffer.get(e)));n.submit(o)},ha:function(e,t,r,n,o,a){var i=Yt(r,n),s=tr.mgrQueue.get(e),l=tr.mgrBuffer.get(t),u=S.subarray(o,o+a);s.writeBuffer(l,i,u,0,a)},I:(e,t,r,n,o,a)=>{var i=tr.mgrQueue.get(e),s=tr.makeImageCopyTexture(t),l=tr.makeTextureDataLayout(o),u=tr.makeExtent3D(a),c=S.subarray(r,r+n);i.writeTexture(s,c,l,u)},K:(e,t,r,n,o,a)=>{tr.mgrRenderPassEncoder.get(e).drawIndexed(t,r,n,o,a)},ca:e=>{tr.mgrRenderPassEncoder.get(e).end()},ba:e=>tr.mgrRenderPassEncoder.release(e),d:(e,t,r,n,o)=>{var a=tr.mgrRenderPassEncoder.get(e),i=tr.mgrBindGroup.get(r);if(0==n)a.setBindGroup(t,i);else{for(var s=[],l=0;l<n;l++,o+=4)s.push(P[o>>2]);a.setBindGroup(t,i,s)}},fa:function(e,t,r,n,o,a,i){var s=Yt(n,o),l=Yt(a,i),u=tr.mgrRenderPassEncoder.get(e),c=tr.mgrBuffer.get(t);-1==l&&(l=void 0),u.setIndexBuffer(c,tr.IndexFormat[r],s,l)},k:(e,t)=>{var r=tr.mgrRenderPassEncoder.get(e),n=tr.mgrRenderPipeline.get(t);r.setPipeline(n)},s:(e,t,r,n,o)=>{tr.mgrRenderPassEncoder.get(e).setScissorRect(t,r,n,o)},l:(e,t)=>{tr.mgrRenderPassEncoder.get(e).setStencilReference(t)},ga:function(e,t,r,n,o,a,i){var s=Yt(n,o),l=Yt(a,i),u=tr.mgrRenderPassEncoder.get(e),c=tr.mgrBuffer.get(r);-1==l&&(l=void 0),u.setVertexBuffer(t,c,s,l)},i:e=>tr.mgrRenderPipeline.release(e),G:e=>tr.mgrSampler.release(e),m:e=>tr.mgrShaderModule.release(e),Fa:(e,t)=>{var r=P[t+4>>2],n=tr.mgrSurface.get(e),o=[P[t+28>>2],P[t+32>>2]];0!==o[0]&&(n.canvas.width=o[0]),0!==o[1]&&(n.canvas.height=o[1]);var a={device:tr.mgrDevice.get(r),format:tr.TextureFormat[P[t+8>>2]],usage:P[t+12>>2],alphaMode:tr.AlphaMode[P[t+24>>2]]};n.configure(a)},Ga:(e,t)=>{var r=tr.mgrSurface.get(e);try{var n=tr.mgrTexture.create(r.getCurrentTexture());P[t>>2]=n,x[t+4>>2]=0,x[t+8>>2]=0}catch(e){P[t>>2]=0,x[t+4>>2]=0,x[t+8>>2]=5}},R:e=>tr.mgrSurface.release(e),Sa:(e,t)=>{var r;if(t){var n=P[t+20>>2],o=P[t+28>>2];r={format:tr.TextureFormat[P[t+8>>2]],dimension:tr.TextureViewDimension[P[t+12>>2]],baseMipLevel:P[t+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:P[t+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:tr.TextureAspect[P[t+32>>2]]};var a=P[t+4>>2];a&&(r.label=re(a))}var i=tr.mgrTexture.get(e);return tr.mgrTextureView.create(i.createView(r))},Ra:e=>tr.mgrTexture.get(e).destroy(),Ta:e=>{var t=tr.mgrTexture.get(e);return tr.TextureFormat.indexOf(t.format)},qa:e=>tr.mgrTexture.get(e).height,ya:e=>tr.mgrTexture.get(e).width,M:e=>tr.mgrTexture.release(e),y:e=>tr.mgrTextureView.release(e)},lr=function(){var e,t,r,a,i={a:sr};function s(e,t){var r;return lr=e.exports,lr=Ct.instrumentWasmExports(lr),b=lr.Wa,F(),lr.$a,r=lr.Xa,M.unshift(r),j(),lr}if(L(),o.instantiateWasm)try{return o.instantiateWasm(i,s)}catch(e){w(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return I||(I=H()),(e=A,t=I,r=i,a=function(e){s(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||W(t)||G(t)||l||"function"!=typeof fetch?Q(t,r,a):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(a,(function(e){return w(`wasm streaming compile failed: ${e}`),w("falling back to ArrayBuffer instantiation"),Q(t,r,a)}))))).catch(n),{}}(),ur=e=>(ur=lr.Ya)(e),cr=e=>(cr=lr.Za)(e),dr=e=>(dr=lr._a)(e),hr=(e,t)=>(hr=lr.ab)(e,t),pr=(e,t)=>(pr=lr.bb)(e,t),mr=e=>(mr=lr.cb)(e),fr=e=>(fr=lr.db)(e),gr=e=>(gr=lr.eb)(e),vr=()=>(vr=lr.fb)(),yr=o.dynCall_iiii=(e,t,r,n)=>(yr=o.dynCall_iiii=lr.gb)(e,t,r,n),wr=o.dynCall_ii=(e,t)=>(wr=o.dynCall_ii=lr.hb)(e,t);o.dynCall_iiiii=(e,t,r,n,a)=>(o.dynCall_iiiii=lr.ib)(e,t,r,n,a),o.dynCall_iiiiiffiii=(e,t,r,n,a,i,s,l,u,c)=>(o.dynCall_iiiiiffiii=lr.jb)(e,t,r,n,a,i,s,l,u,c),o.dynCall_fii=(e,t,r)=>(o.dynCall_fii=lr.kb)(e,t,r);var br=o.dynCall_vi=(e,t)=>(br=o.dynCall_vi=lr.lb)(e,t),_r=o.dynCall_vii=(e,t,r)=>(_r=o.dynCall_vii=lr.mb)(e,t,r),Er=o.dynCall_viiij=(e,t,r,n,a,i)=>(Er=o.dynCall_viiij=lr.nb)(e,t,r,n,a,i),Sr=o.dynCall_iiiiii=(e,t,r,n,a,i)=>(Sr=o.dynCall_iiiiii=lr.ob)(e,t,r,n,a,i),$r=o.dynCall_iii=(e,t,r)=>($r=o.dynCall_iii=lr.pb)(e,t,r),Cr=o.dynCall_viii=(e,t,r,n)=>(Cr=o.dynCall_viii=lr.qb)(e,t,r,n),xr=o.dynCall_viiii=(e,t,r,n,a)=>(xr=o.dynCall_viiii=lr.rb)(e,t,r,n,a);o.dynCall_viiiii=(e,t,r,n,a,i)=>(o.dynCall_viiiii=lr.sb)(e,t,r,n,a,i),o.dynCall_viiiiii=(e,t,r,n,a,i,s)=>(o.dynCall_viiiiii=lr.tb)(e,t,r,n,a,i,s),o.dynCall_v=e=>(o.dynCall_v=lr.ub)(e),o.dynCall_fi=(e,t)=>(o.dynCall_fi=lr.vb)(e,t),o.dynCall_iiiiiii=(e,t,r,n,a,i,s)=>(o.dynCall_iiiiiii=lr.wb)(e,t,r,n,a,i,s),o.dynCall_iiiiiiii=(e,t,r,n,a,i,s,l)=>(o.dynCall_iiiiiiii=lr.xb)(e,t,r,n,a,i,s,l),o.dynCall_iif=(e,t,r)=>(o.dynCall_iif=lr.yb)(e,t,r),o.dynCall_iiif=(e,t,r,n)=>(o.dynCall_iiif=lr.zb)(e,t,r,n),o.dynCall_iiffff=(e,t,r,n,a,i)=>(o.dynCall_iiffff=lr.Ab)(e,t,r,n,a,i),o.dynCall_iiiffff=(e,t,r,n,a,i,s)=>(o.dynCall_iiiffff=lr.Bb)(e,t,r,n,a,i,s),o.dynCall_jiji=(e,t,r,n,a)=>(o.dynCall_jiji=lr.Cb)(e,t,r,n,a),o.dynCall_iiiiiiiii=(e,t,r,n,a,i,s,l,u)=>(o.dynCall_iiiiiiiii=lr.Db)(e,t,r,n,a,i,s,l,u),o.dynCall_iiiff=(e,t,r,n,a)=>(o.dynCall_iiiff=lr.Eb)(e,t,r,n,a),o.dynCall_iiifi=(e,t,r,n,a)=>(o.dynCall_iiifi=lr.Fb)(e,t,r,n,a),o.dynCall_viijii=(e,t,r,n,a,i,s)=>(o.dynCall_viijii=lr.Gb)(e,t,r,n,a,i,s),o.dynCall_iiiiij=(e,t,r,n,a,i,s)=>(o.dynCall_iiiiij=lr.Hb)(e,t,r,n,a,i,s),o.dynCall_iiiiid=(e,t,r,n,a,i)=>(o.dynCall_iiiiid=lr.Ib)(e,t,r,n,a,i),o.dynCall_iiiiijj=(e,t,r,n,a,i,s,l,u)=>(o.dynCall_iiiiijj=lr.Jb)(e,t,r,n,a,i,s,l,u),o.dynCall_iiiiiijj=(e,t,r,n,a,i,s,l,u,c)=>(o.dynCall_iiiiiijj=lr.Kb)(e,t,r,n,a,i,s,l,u,c);var Pr,Tr=e=>(Tr=lr.Lb)(e),kr=()=>(kr=lr.Mb)(),Ar=e=>(Ar=lr.Nb)(e),Dr=()=>(Dr=lr.Ob)();function Fr(){function e(){Pr||(Pr=!0,o.calledRun=!0,D||(o.noFSInit||Se.initialized||Se.init(),Se.ignorePermissions=!1,J(M),r(o),o.onRuntimeInitialized?.(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),B.unshift(e);var e;J(B)}()))}O>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),R.unshift(e);var e;J(R)}(),O>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>o.setStatus("")),1),e()}),1)):e()))}if(o.addRunDependency=L,o.removeRunDependency=j,o.FS_createPreloadedFile=_e,o.FS_unlink=e=>Se.unlink(e),o.FS_createPath=or,o.FS_createDevice=ir,o.FS=Se,o.FS_createDataFile=we,o.FS_createLazyFile=ar,U=function e(){Pr||Fr(),Pr||(U=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Fr(),a});const ve="1.0.0";function ye(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}let we;var be,_e,Ee,Se,$e,Ce,xe;(async()=>{we=await ge({locateFile:(e,t)=>e.endsWith(".wasm")?"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg-wasm.wasm":t+e})})(),exports.Renderer=void 0,(be=exports.Renderer||(exports.Renderer={})).SW="sw",be.WG="wg",exports.InitStatus=void 0,(_e=exports.InitStatus||(exports.InitStatus={})).IDLE="idle",_e.REQUESTED="requested",_e.INITIALIZED="initialized",exports.ExportableType=void 0,(Ee=exports.ExportableType||(exports.ExportableType={})).GIF="gif",Ee.TVG="tvg",Ee.PNG="png",exports.MimeType=void 0,(Se=exports.MimeType||(exports.MimeType={})).JSON="json",Se.JPG="jpg",Se.PNG="png",Se.SVG="svg",Se.TVG="tvg",exports.PlayerState=void 0,($e=exports.PlayerState||(exports.PlayerState={})).Destroyed="destroyed",$e.Error="error",$e.Loading="loading",$e.Paused="paused",$e.Playing="playing",$e.Stopped="stopped",$e.Frozen="frozen",exports.PlayMode=void 0,(Ce=exports.PlayMode||(exports.PlayMode={})).Bounce="bounce",Ce.Normal="normal",exports.PlayerEvent=void 0,(xe=exports.PlayerEvent||(exports.PlayerEvent={})).Complete="complete",xe.Destroyed="destroyed",xe.Error="error",xe.Frame="frame",xe.Freeze="freeze",xe.Load="load",xe.Loop="loop",xe.Pause="pause",xe.Play="play",xe.Ready="ready",xe.Stop="stop";const Pe=async e=>{try{e=JSON.parse(e)}catch(t){const r=await(async e=>{if("string"!=typeof e)throw new Error("The url value must be a string");try{const t=new URL(e),r=await fetch(t.toString());return await r.json()}catch(e){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(e);e=JSON.stringify(r)}return e},Te=async(e,t)=>{const r=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===t)return n=await Pe(n),r.encode(n);const e=await(async e=>(await fetch(e)).arrayBuffer())(n);return new Uint8Array(e);default:throw new Error("Invalid src type")}},ke=e=>new Promise((t=>setTimeout(t,e))),Ae=(e,t)=>{const r=document.createElement("a");r.setAttribute("href",URL.createObjectURL(t)),r.setAttribute("download",e),document.body.appendChild(r),r.click(),document.body.removeChild(r)};let De="idle";class Fe extends ne{src;mimeType="json";renderConfig;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;_canvas;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(!we)return;if(!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.renderConfig?.renderer||"sw";await(async e=>{if("sw"!==e){for(;"requested"===De;)await ke(100);"initialized"!==De&&(De="requested",await we.init(),De="initialized")}})(e),this._TVG=new we.TvgLottieAnimation(e,`#${this._canvas.id}`),this.src&&this.load(this.src,this.mimeType)}_viewport(){const{left:e,right:t,top:r,bottom:n}=this.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let i=0,s=0,l=this._canvas.width,u=this._canvas.height;e<0&&(i=Math.abs(e),l-=i),r<0&&(s=Math.abs(r),u-=s),t>o&&(l-=t-o),n>a&&(u-=n-a),this._TVG.viewport(i,s,l,u)}_observerCallback(e){const t=e[0],r=t.target;r._observable=t.isIntersecting,t.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this._canvas=this.querySelector(".thorvg"),this._canvas.id=`thorvg-${me().replaceAll("-","").substring(0,6)}`,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.mimeType):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(e,t=""){if(!this._TVG.load(e,this.mimeType,this._canvas.width,this._canvas.height,t))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.renderConfig?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:t,height:r}=this._canvas.getBoundingClientRect();this._canvas.width=t*e,this._canvas.height=r*e}this._TVG.resize(this._canvas.width,this._canvas.height),this._viewport();if(!this._TVG.update())return;if("wg"===this.renderConfig?.renderer)return void this._TVG.render();const e=this._TVG.render(),t=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);t.length<1||(this._imageData=new ImageData(t,this._canvas.width,this._canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this._TVG.duration(),t=Date.now()/1e3;if(this.currentFrame=(t-this._beginTime)/e*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 e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)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 ke(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(e){this.pause(),this.currentFrame=e,this._TVG.frame(e)}async load(e,t="json"){try{await this._init();const r=await Te(e,t);this.dispatchEvent(new CustomEvent("ready")),this.mimeType=t,await this._loadBytes(r)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if("json"===this.mimeType&&(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(e){this._frame(e),await this._update(),this._render()}resize(e,t){this._canvas.width=e,this._canvas.height=t,"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(){we.term(),we=null}setLooping(e){this._TVG&&(this.loop=e)}setDirection(e){this._TVG&&(this.direction=e)}setSpeed(e){this._TVG&&(this.speed=e)}setBgColor(e){this._TVG&&(this._canvas.style.backgroundColor=e)}save(e){if(!this._TVG)return;const t=`output.${e}`;if("png"===e)return void this._canvas.toBlob((e=>{e&&Ae("output.png",e)}),"image/png");if(!this._TVG.save(e))throw new Error("Unable to save. Error: ",this._TVG.error());const r=we.FS.readFile(t);if("gif"===e&&r.length<6)throw new Error("Unable to save the GIF data. The generated file size is invalid.");if("tvg"===e&&r.length<33)throw new Error("Unable to save the TVG data. The generated file size is invalid.");const n=new Blob([r],{type:"application/octet-stream"});Ae(t,n)}getVersion(){return{THORVG_VERSION:ve}}render(){return I`
1
+ "use strict";var e="undefined"!=typeof document?document.currentScript:null;const r=globalThis,t=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;let a=class{constructor(e,r,t){if(this._$cssResult$=!0,t!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(t&&void 0===e){const t=void 0!==r&&1===r.length;t&&(e=o.get(r)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&o.set(r,e))}return e}toString(){return this.cssText}};const i=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let r="";for(const t of e.cssRules)r+=t.cssText;return(e=>new a("string"==typeof e?e:e+"",void 0,n))(r)})(e):e,{is:s,defineProperty:u,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:d,getPrototypeOf:f}=Object,m=globalThis,p=m.trustedTypes,h=p?p.emptyScript:"",g=m.reactiveElementPolyfillSupport,v=(e,r)=>e,y={toAttribute(e,r){switch(r){case Boolean:e=e?h:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,r){let t=e;switch(r){case Boolean:t=null!==e;break;case Number:t=null===e?null:Number(e);break;case Object:case Array:try{t=JSON.parse(e)}catch(e){t=null}}return t}},w=(e,r)=>!s(e,r),b={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;class _ extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=b){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const t=Symbol(),n=this.getPropertyDescriptor(e,t,r);void 0!==n&&u(this.prototype,e,n)}}static getPropertyDescriptor(e,r,t){const{get:n,set:o}=c(this.prototype,e)??{get(){return this[r]},set(e){this[r]=e}};return{get(){return n?.call(this)},set(r){const a=n?.call(this);o.call(this,r),this.requestUpdate(e,a,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??b}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const e=f(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,r=[...l(e),...d(e)];for(const t of r)this.createProperty(t,e[t])}const e=this[Symbol.metadata];if(null!==e){const r=litPropertyMetadata.get(e);if(void 0!==r)for(const[e,t]of r)this.elementProperties.set(e,t)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const t=new Set(e.flat(1/0).reverse());for(const e of t)r.unshift(i(e))}else void 0!==e&&r.push(i(e));return r}static _$Eu(e,r){const t=r.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const t of r.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,n)=>{if(t)e.adoptedStyleSheets=n.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const t of n){const n=document.createElement("style"),o=r.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=t.cssText,e.appendChild(n)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,t){this._$AK(e,t)}_$EC(e,r){const t=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,t);if(void 0!==n&&!0===t.reflect){const o=(void 0!==t.converter?.toAttribute?t.converter:y).toAttribute(r,t.type);this._$Em=e,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,r){const t=this.constructor,n=t._$Eh.get(e);if(void 0!==n&&this._$Em!==n){const e=t.getPropertyOptions(n),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:y;this._$Em=n,this[n]=o.fromAttribute(r,e.type),this._$Em=null}}requestUpdate(e,r,t){if(void 0!==e){if(t??=this.constructor.getPropertyOptions(e),!(t.hasChanged??w)(this[e],r))return;this.P(e,r,t)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,r,t){this._$AL.has(e)||this._$AL.set(e,r),!0===t.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,r]of this._$Ep)this[e]=r;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[r,t]of e)!0!==t.wrapped||this._$AL.has(r)||void 0===this[r]||this.P(r,this[r],t)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(r)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[v("elementProperties")]=new Map,_[v("finalized")]=new Map,g?.({ReactiveElement:_}),(m.reactiveElementVersions??=[]).push("2.0.4");const x=globalThis,E=x.trustedTypes,S=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,P="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,$="?"+A,C=`<${$}>`,T=document,k=()=>T.createComment(""),B=e=>null===e||"object"!=typeof e&&"function"!=typeof e,F=Array.isArray,D="[ \t\n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,R=/>/g,U=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,M=/"/g,V=/^(?:script|style|textarea|title)$/i,N=(e,...r)=>({_$litType$:1,strings:e,values:r}),j=Symbol.for("lit-noChange"),z=Symbol.for("lit-nothing"),G=new WeakMap,W=T.createTreeWalker(T,129);function H(e,r){if(!F(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(r):r}class q{constructor({strings:e,_$litType$:r},t){let n;this.parts=[];let o=0,a=0;const i=e.length-1,s=this.parts,[u,c]=((e,r)=>{const t=e.length-1,n=[];let o,a=2===r?"<svg>":3===r?"<math>":"",i=L;for(let r=0;r<t;r++){const t=e[r];let s,u,c=-1,l=0;for(;l<t.length&&(i.lastIndex=l,u=i.exec(t),null!==u);)l=i.lastIndex,i===L?"!--"===u[1]?i=O:void 0!==u[1]?i=R:void 0!==u[2]?(V.test(u[2])&&(o=RegExp("</"+u[2],"g")),i=U):void 0!==u[3]&&(i=U):i===U?">"===u[0]?(i=o??L,c=-1):void 0===u[1]?c=-2:(c=i.lastIndex-u[2].length,s=u[1],i=void 0===u[3]?U:'"'===u[3]?M:I):i===M||i===I?i=U:i===O||i===R?i=L:(i=U,o=void 0);const d=i===U&&e[r+1].startsWith("/>")?" ":"";a+=i===L?t+C:c>=0?(n.push(s),t.slice(0,c)+P+t.slice(c)+A+d):t+A+(-2===c?r:d)}return[H(e,a+(e[t]||"<?>")+(2===r?"</svg>":3===r?"</math>":"")),n]})(e,r);if(this.el=q.createElement(u,t),W.currentNode=this.el.content,2===r||3===r){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=W.nextNode())&&s.length<i;){if(1===n.nodeType){if(n.hasAttributes())for(const e of n.getAttributeNames())if(e.endsWith(P)){const r=c[a++],t=n.getAttribute(e).split(A),i=/([.?@])?(.*)/.exec(r);s.push({type:1,index:o,name:i[2],strings:t,ctor:"."===i[1]?K:"?"===i[1]?Y:"@"===i[1]?ee:J}),n.removeAttribute(e)}else e.startsWith(A)&&(s.push({type:6,index:o}),n.removeAttribute(e));if(V.test(n.tagName)){const e=n.textContent.split(A),r=e.length-1;if(r>0){n.textContent=E?E.emptyScript:"";for(let t=0;t<r;t++)n.append(e[t],k()),W.nextNode(),s.push({type:2,index:++o});n.append(e[r],k())}}}else if(8===n.nodeType)if(n.data===$)s.push({type:2,index:o});else{let e=-1;for(;-1!==(e=n.data.indexOf(A,e+1));)s.push({type:7,index:o}),e+=A.length-1}o++}}static createElement(e,r){const t=T.createElement("template");return t.innerHTML=e,t}}function X(e,r,t=e,n){if(r===j)return r;let o=void 0!==n?t.o?.[n]:t.l;const a=B(r)?void 0:r._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(e),o._$AT(e,t,n)),void 0!==n?(t.o??=[])[n]=o:t.l=o),void 0!==o&&(r=X(e,o._$AS(e,r.values),o,n)),r}class Q{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:t}=this._$AD,n=(e?.creationScope??T).importNode(r,!0);W.currentNode=n;let o=W.nextNode(),a=0,i=0,s=t[0];for(;void 0!==s;){if(a===s.index){let r;2===s.type?r=new Z(o,o.nextSibling,this,e):1===s.type?r=new s.ctor(o,s.name,s.strings,this,e):6===s.type&&(r=new re(o,this,e)),this._$AV.push(r),s=t[++i]}a!==s?.index&&(o=W.nextNode(),a++)}return W.currentNode=T,n}p(e){let r=0;for(const t of this._$AV)void 0!==t&&(void 0!==t.strings?(t._$AI(e,t,r),r+=t.strings.length-2):t._$AI(e[r])),r++}}class Z{get _$AU(){return this._$AM?._$AU??this.v}constructor(e,r,t,n){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=t,this.options=n,this.v=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return void 0!==r&&11===e?.nodeType&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=X(this,e,r),B(e)?e===z||null==e||""===e?(this._$AH!==z&&this._$AR(),this._$AH=z):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>F(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==z&&B(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){const{values:r,_$litType$:t}=e,n="number"==typeof t?this._$AC(e):(void 0===t.el&&(t.el=q.createElement(H(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===n)this._$AH.p(r);else{const e=new Q(n,this),t=e.u(this.options);e.p(r),this.T(t),this._$AH=e}}_$AC(e){let r=G.get(e.strings);return void 0===r&&G.set(e.strings,r=new q(e)),r}k(e){F(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let t,n=0;for(const o of e)n===r.length?r.push(t=new Z(this.O(k()),this.O(k()),this,this.options)):t=r[n],t._$AI(o),n++;n<r.length&&(this._$AR(t&&t._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){void 0===this._$AM&&(this.v=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,t,n,o){this.type=1,this._$AH=z,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=o,t.length>2||""!==t[0]||""!==t[1]?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=z}_$AI(e,r=this,t,n){const o=this.strings;let a=!1;if(void 0===o)e=X(this,e,r,0),a=!B(e)||e!==this._$AH&&e!==j,a&&(this._$AH=e);else{const n=e;let i,s;for(e=o[0],i=0;i<o.length-1;i++)s=X(this,n[t+i],r,i),s===j&&(s=this._$AH[i]),a||=!B(s)||s!==this._$AH[i],s===z?e=z:e!==z&&(e+=(s??"")+o[i+1]),this._$AH[i]=s}a&&!n&&this.j(e)}j(e){e===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class K extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===z?void 0:e}}class Y extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==z)}}class ee extends J{constructor(e,r,t,n,o){super(e,r,t,n,o),this.type=5}_$AI(e,r=this){if((e=X(this,e,r,0)??z)===j)return;const t=this._$AH,n=e===z&&t!==z||e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive,o=e!==z&&(t===z||n);n&&this.element.removeEventListener(this.name,this,t),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class re{constructor(e,r,t){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(e){X(this,e)}}const te=x.litHtmlPolyfillSupport;te?.(q,Z),(x.litHtmlVersions??=[]).push("3.2.0");class ne extends _{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=((e,r,t)=>{const n=t?.renderBefore??r;let o=n._$litPart$;if(void 0===o){const e=t?.renderBefore??null;n._$litPart$=o=new Z(r.insertBefore(k(),e),e,void 0,t??{})}return o._$AI(e),o})(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return j}}ne._$litElement$=!0,ne.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ne});const oe=globalThis.litElementPolyfillSupport;oe?.({LitElement:ne}),(globalThis.litElementVersions??=[]).push("4.1.0");const ae={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:w},ie=(e=ae,r,t)=>{const{kind:n,metadata:o}=t;let a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),a.set(t.name,e),"accessor"===n){const{name:n}=t;return{set(t){const o=r.get.call(this);r.set.call(this,t),this.requestUpdate(n,o,e)},init(r){return void 0!==r&&this.P(n,void 0,e),r}}}if("setter"===n){const{name:n}=t;return function(t){const o=this[n];r.call(this,t),this.requestUpdate(n,o,e)}}throw Error("Unsupported decorator location: "+n)};function se(e){return(r,t)=>"object"==typeof t?ie(e,r,t):((e,r,t)=>{const n=r.hasOwnProperty(t);return r.constructor.createProperty(t,n?{...e,wrapped:!0}:e),n?Object.getOwnPropertyDescriptor(r,t):void 0})(e,r,t)}for(var ue,ce=[],le=0;le<256;++le)ce.push((le+256).toString(16).slice(1));var de=new Uint8Array(16);function fe(){if(!ue&&!(ue="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(de)}var me={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function pe(e,r,t){if(me.randomUUID&&!r&&!e)return me.randomUUID();var n=(e=e||{}).random||(e.rng||fe)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,r=0){return(ce[e[r+0]]+ce[e[r+1]]+ce[e[r+2]]+ce[e[r+3]]+"-"+ce[e[r+4]]+ce[e[r+5]]+"-"+ce[e[r+6]]+ce[e[r+7]]+"-"+ce[e[r+8]]+ce[e[r+9]]+"-"+ce[e[r+10]]+ce[e[r+11]]+ce[e[r+12]]+ce[e[r+13]]+ce[e[r+14]]+ce[e[r+15]]).toLowerCase()}(n)}var he,ge=(he="undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href,async function(r={}){var t,n,o=r,a=new Promise(((e,r)=>{t=e,n=r})),i="object"==typeof window,s="undefined"!=typeof WorkerGlobalScope,u="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type;if(u){const{createRequire:r}=await Promise.resolve().then((function(){return Fe}));var c=r("undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href)}var l,d,f={...o},m="./this.program",p=(e,r)=>{throw r},h="";if(u){var g=c("fs"),v=c("path");("undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href).startsWith("data:")||(h=v.dirname(c("url").fileURLToPath("undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href))+"/"),d=e=>(e=L(e)?new URL(e):e,g.readFileSync(e)),l=async(e,r=!0)=>(e=L(e)?new URL(e):e,g.readFileSync(e,r?void 0:"utf8")),!o.thisProgram&&process.argv.length>1&&(m=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r}}else(i||s)&&(s?h=self.location.href:"undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),he&&(h=he),h=h.startsWith("blob:")?"":h.slice(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1),s&&(d=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),l=async e=>{if(L(e))return new Promise(((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)}));var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)});var y=o.print||void 0,w=o.printErr||void 0;Object.assign(o,f),f=null,o.thisProgram&&(m=o.thisProgram);var b,_,x,E,S,P,A,$,C,T,k,B,F=o.wasmBinary,D=!1,L=e=>e.startsWith("file://");function O(){var e=b.buffer;o.HEAP8=x=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=E=new Uint8Array(e),o.HEAPU16=P=new Uint16Array(e),o.HEAP32=A=new Int32Array(e),o.HEAPU32=$=new Uint32Array(e),o.HEAPF32=C=new Float32Array(e),o.HEAPF64=B=new Float64Array(e),o.HEAP64=T=new BigInt64Array(e),o.HEAPU64=k=new BigUint64Array(e)}var R,U=0,I=null;function M(e){U++,o.monitorRunDependencies?.(U)}function V(e){if(U--,o.monitorRunDependencies?.(U),0==U&&I){var r=I;I=null,r()}}function N(e){o.onAbort?.(e),w(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}class j{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var z,G=e=>{for(;e.length>0;)e.shift()(o)},W=[],H=[],q=o.noExitRuntime||!0,X=e=>it(e),Q=()=>ut(),Z="undefined"!=typeof TextDecoder?new TextDecoder:void 0,J=(e,r=0,t=NaN)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Z)return Z.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var u=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},K=(e,r)=>e?J(E,e,r):"",Y=()=>{var e=A[+ve.varargs>>2];return ve.varargs+=4,e},ee=Y,re={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=re.isAbs(e),t="/"===e.slice(-1);return e=re.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"),e||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=re.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.slice(0,-1)),t+n):"."},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>re.normalize(e.join("/")),join2:(e,r)=>re.normalize(e+"/"+r)},te=e=>{(te=(()=>{if(u){var e=c("crypto");return r=>e.randomFillSync(r)}return e=>crypto.getRandomValues(e)})())(e)},ne={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:ge.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=re.isAbs(o)}return r=re.normalizeArray(r.split("/").filter((e=>!!e)),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ne.resolve(e).slice(1),r=ne.resolve(r).slice(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},oe=[],ae=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},ie=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o},se=(e,r,t)=>{var n=ae(e)+1,o=new Array(n),a=ie(e,o,0,o.length);return o.length=a,o},ue={ttys:[],init(){},shutdown(){},register(e,r){ue.ttys[e]={input:[],output:[],ops:r},ge.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var r=ue.ttys[e.node.rdev];if(!r)throw new ge.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ge.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ge.ErrnoError(29)}if(void 0===s&&0===a)throw new ge.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ge.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ge.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!oe.length){var e=null;if(u){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}t>0&&(e=r.slice(0,t).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n");if(!e)return null;oe=se(e)}return oe.shift()})(),put_char(e,r){null===r||10===r?(y(J(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(y(J(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(w(J(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(w(J(e.output)),e.output=[])}}},ce=e=>{N()},le={ops_table:null,mount:e=>le.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ge.isBlkdev(t)||ge.isFIFO(t))throw new ge.ErrnoError(63);le.ops_table||={dir:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,lookup:le.node_ops.lookup,mknod:le.node_ops.mknod,rename:le.node_ops.rename,unlink:le.node_ops.unlink,rmdir:le.node_ops.rmdir,readdir:le.node_ops.readdir,symlink:le.node_ops.symlink},stream:{llseek:le.stream_ops.llseek}},file:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:{llseek:le.stream_ops.llseek,read:le.stream_ops.read,write:le.stream_ops.write,mmap:le.stream_ops.mmap,msync:le.stream_ops.msync}},link:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,readlink:le.node_ops.readlink},stream:{}},chrdev:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:ge.chrdev_stream_ops}};var o=ge.createNode(e,r,t,n);return ge.isDir(o.mode)?(o.node_ops=le.ops_table.dir.node,o.stream_ops=le.ops_table.dir.stream,o.contents={}):ge.isFile(o.mode)?(o.node_ops=le.ops_table.file.node,o.stream_ops=le.ops_table.file.stream,o.usedBytes=0,o.contents=null):ge.isLink(o.mode)?(o.node_ops=le.ops_table.link.node,o.stream_ops=le.ops_table.link.stream):ge.isChrdev(o.mode)&&(o.node_ops=le.ops_table.chrdev.node,o.stream_ops=le.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ge.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,r.size=ge.isDir(e.mode)?4096:ge.isFile(e.mode)?e.usedBytes:ge.isLink(e.mode)?e.link.length:0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])null!=r[t]&&(e[t]=r[t]);void 0!==r.size&&le.resizeFileStorage(e,r.size)},lookup(e,r){throw le.doesNotExistError},mknod:(e,r,t,n)=>le.createNode(e,r,t,n),rename(e,r,t){var n;try{n=ge.lookupNode(r,t)}catch(e){}if(n){if(ge.isDir(e.mode))for(var o in n.contents)throw new ge.ErrnoError(55);ge.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=ge.lookupNode(e,r);for(var n in t.contents)throw new ge.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.contents)],symlink(e,r,t){var n=le.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ge.isLink(e.mode))throw new ge.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===x.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.mtime=i.ctime=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(le.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ge.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ge.ErrnoError(28);return n},mmap(e,r,t,n,o){if(!ge.isFile(e.node.mode))throw new ge.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==x.buffer){if(i=!0,!(a=ce()))throw new ge.ErrnoError(48);s&&((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),x.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(le.stream_ops.write(e,r,0,n,t,!1),0)}},de=(e,r,t,n,o,a)=>{ge.createDataFile(e,r,t,n,o,a)},fe=o.preloadPlugins||[],me=(e,r,t,n,o,a,i,s,u,c)=>{var d=r?ne.resolve(re.join2(e,r)):e;function f(t){function l(t){c?.(),s||de(e,r,t,n,o,u),a?.(),V()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return fe.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,l,(()=>{i?.(),V()}))||l(t)}M(),"string"==typeof t?(async e=>{var r=await l(e);return new Uint8Array(r)})(t).then(f,i):f(t)},pe=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ge={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,readFiles:{},ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=ge.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return ge.isDir(this.mode)}get isDevice(){return ge.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new ge.ErrnoError(44);r.follow_mount??=!0,re.isAbs(e)||(e=ge.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter((e=>!!e)),o=ge.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&r.parent)break;if("."!==n[i])if(".."!==n[i]){a=re.join2(a,n[i]);try{o=ge.lookupNode(o,n[i])}catch(e){if(44===e?.errno&&s&&r.noent_okay)return{path:a};throw e}if(!ge.isMountpoint(o)||s&&!r.follow_mount||(o=o.mounted.root),ge.isLink(o.mode)&&(!s||r.follow)){if(!o.node_ops.readlink)throw new ge.ErrnoError(52);var u=o.node_ops.readlink(o);re.isAbs(u)||(u=re.dirname(a)+"/"+u),e=u+"/"+n.slice(i+1).join("/");continue e}}else a=re.dirname(a),o=o.parent}return{path:a,node:o}}throw new ge.ErrnoError(32)},getPath(e){for(var r;;){if(ge.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%ge.nameTable.length},hashAddNode(e){var r=ge.hashName(e.parent.id,e.name);e.name_next=ge.nameTable[r],ge.nameTable[r]=e},hashRemoveNode(e){var r=ge.hashName(e.parent.id,e.name);if(ge.nameTable[r]===e)ge.nameTable[r]=e.name_next;else for(var t=ge.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ge.mayLookup(e);if(t)throw new ge.ErrnoError(t);for(var n=ge.hashName(e.id,r),o=ge.nameTable[n];o;o=o.name_next)if(o.parent.id===e.id&&o.name===r)return o;return ge.lookup(e,r)},createNode(e,r,t,n){var o=new ge.FSNode(e,r,t,n);return ge.hashAddNode(o),o},destroyNode(e){ge.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ge.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ge.isDir(e.mode)?ge.nodePermissions(e,"x")||(e.node_ops.lookup?0:2):54,mayCreate(e,r){if(!ge.isDir(e.mode))return 54;try{return ge.lookupNode(e,r),20}catch(e){}return ge.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ge.lookupNode(e,r)}catch(e){return e.errno}var o=ge.nodePermissions(e,"wx");if(o)return o;if(t){if(!ge.isDir(n.mode))return 54;if(ge.isRoot(n)||ge.getPath(n)===ge.cwd())return 10}else if(ge.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ge.isLink(e.mode)?32:ge.isDir(e.mode)&&("r"!==ge.flagsToPermissionString(r)||576&r)?31:ge.nodePermissions(e,ge.flagsToPermissionString(r)):44,checkOpExists(e,r){if(!e)throw new ge.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ge.MAX_OPEN_FDS;e++)if(!ge.streams[e])return e;throw new ge.ErrnoError(33)},getStreamChecked(e){var r=ge.getStream(e);if(!r)throw new ge.ErrnoError(8);return r},getStream:e=>ge.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new ge.FSStream,e),-1==r&&(r=ge.nextfd()),e.fd=r,ge.streams[r]=e,e),closeStream(e){ge.streams[e]=null},dupStream(e,r=-1){var t=ge.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,o=n?e:r;n??=r.node_ops.setattr,ge.checkOpExists(n,63),n(o,t)},chrdev_stream_ops:{open(e){var r=ge.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new ge.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ge.devices[e]={stream_ops:r}},getDevice:e=>ge.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ge.syncFSRequests++,ge.syncFSRequests>1&&w(`warning: ${ge.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ge.getMounts(ge.root.mount),n=0;function o(e){return ge.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&ge.root)throw new ge.ErrnoError(10);if(!o&&!a){var i=ge.lookupPath(t,{follow_mount:!1});if(t=i.path,ge.isMountpoint(n=i.node))throw new ge.ErrnoError(10);if(!ge.isDir(n.mode))throw new ge.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?ge.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=ge.lookupPath(e,{follow_mount:!1});if(!ge.isMountpoint(r.node))throw new ge.ErrnoError(28);var t=r.node,n=t.mounted,o=ge.getMounts(n);Object.keys(ge.nameTable).forEach((e=>{for(var r=ge.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ge.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ge.lookupPath(e,{parent:!0}).node,o=re.basename(e);if(!o)throw new ge.ErrnoError(28);if("."===o||".."===o)throw new ge.ErrnoError(20);var a=ge.mayCreate(n,o);if(a)throw new ge.ErrnoError(a);if(!n.node_ops.mknod)throw new ge.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},statfs:e=>ge.statfsNode(ge.lookupPath(e,{follow:!0}).node),statfsStream:e=>ge.statfsNode(e.node),statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:ge.nextInode,ffree:ge.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create:(e,r=438)=>(r&=4095,ge.mknod(e,r|=32768,0)),mkdir:(e,r=511)=>(r&=1023,ge.mknod(e,r|=16384,0)),mkdirTree(e,r){var t=e.split("/"),n="";for(var o of t)if(o){(n||re.isAbs(e))&&(n+="/"),n+=o;try{ge.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),ge.mknod(e,r|=8192,t)),symlink(e,r){if(!ne.resolve(e))throw new ge.ErrnoError(44);var t=ge.lookupPath(r,{parent:!0}).node;if(!t)throw new ge.ErrnoError(44);var n=re.basename(r),o=ge.mayCreate(t,n);if(o)throw new ge.ErrnoError(o);if(!t.node_ops.symlink)throw new ge.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=re.dirname(e),a=re.dirname(r),i=re.basename(e),s=re.basename(r);if(t=ge.lookupPath(e,{parent:!0}).node,n=ge.lookupPath(r,{parent:!0}).node,!t||!n)throw new ge.ErrnoError(44);if(t.mount!==n.mount)throw new ge.ErrnoError(75);var u,c=ge.lookupNode(t,i),l=ne.relative(e,a);if("."!==l.charAt(0))throw new ge.ErrnoError(28);if("."!==(l=ne.relative(r,o)).charAt(0))throw new ge.ErrnoError(55);try{u=ge.lookupNode(n,s)}catch(e){}if(c!==u){var d=ge.isDir(c.mode),f=ge.mayDelete(t,i,d);if(f)throw new ge.ErrnoError(f);if(f=u?ge.mayDelete(n,s,d):ge.mayCreate(n,s))throw new ge.ErrnoError(f);if(!t.node_ops.rename)throw new ge.ErrnoError(63);if(ge.isMountpoint(c)||u&&ge.isMountpoint(u))throw new ge.ErrnoError(10);if(n!==t&&(f=ge.nodePermissions(t,"w")))throw new ge.ErrnoError(f);ge.hashRemoveNode(c);try{t.node_ops.rename(c,n,s),c.parent=n}catch(e){throw e}finally{ge.hashAddNode(c)}}},rmdir(e){var r=ge.lookupPath(e,{parent:!0}).node,t=re.basename(e),n=ge.lookupNode(r,t),o=ge.mayDelete(r,t,!0);if(o)throw new ge.ErrnoError(o);if(!r.node_ops.rmdir)throw new ge.ErrnoError(63);if(ge.isMountpoint(n))throw new ge.ErrnoError(10);r.node_ops.rmdir(r,t),ge.destroyNode(n)},readdir(e){var r=ge.lookupPath(e,{follow:!0}).node;return ge.checkOpExists(r.node_ops.readdir,54)(r)},unlink(e){var r=ge.lookupPath(e,{parent:!0}).node;if(!r)throw new ge.ErrnoError(44);var t=re.basename(e),n=ge.lookupNode(r,t),o=ge.mayDelete(r,t,!1);if(o)throw new ge.ErrnoError(o);if(!r.node_ops.unlink)throw new ge.ErrnoError(63);if(ge.isMountpoint(n))throw new ge.ErrnoError(10);r.node_ops.unlink(r,t),ge.destroyNode(n)},readlink(e){var r=ge.lookupPath(e).node;if(!r)throw new ge.ErrnoError(44);if(!r.node_ops.readlink)throw new ge.ErrnoError(28);return r.node_ops.readlink(r)},stat(e,r){var t=ge.lookupPath(e,{follow:!r}).node;return ge.checkOpExists(t.node_ops.getattr,63)(t)},fstat(e){var r=ge.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,o=n?r:t;return n??=t.node_ops.getattr,ge.checkOpExists(n,63),n(o)},lstat:e=>ge.stat(e,!0),doChmod(e,r,t,n){ge.doSetAttr(e,r,{mode:4095&t|-4096&r.mode,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;n="string"==typeof e?ge.lookupPath(e,{follow:!t}).node:e,ge.doChmod(null,n,r,t)},lchmod(e,r){ge.chmod(e,r,!0)},fchmod(e,r){var t=ge.getStreamChecked(e);ge.doChmod(t,t.node,r,!1)},doChown(e,r,t){ge.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var o;o="string"==typeof e?ge.lookupPath(e,{follow:!n}).node:e,ge.doChown(null,o,n)},lchown(e,r,t){ge.chown(e,r,t,!0)},fchown(e,r,t){var n=ge.getStreamChecked(e);ge.doChown(n,n.node,!1)},doTruncate(e,r,t){if(ge.isDir(r.mode))throw new ge.ErrnoError(31);if(!ge.isFile(r.mode))throw new ge.ErrnoError(28);var n=ge.nodePermissions(r,"w");if(n)throw new ge.ErrnoError(n);ge.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new ge.ErrnoError(28);var t;t="string"==typeof e?ge.lookupPath(e,{follow:!0}).node:e,ge.doTruncate(null,t,r)},ftruncate(e,r){var t=ge.getStreamChecked(e);if(r<0||!(2097155&t.flags))throw new ge.ErrnoError(28);ge.doTruncate(t,t.node,r)},utime(e,r,t){var n=ge.lookupPath(e,{follow:!0}).node;ge.checkOpExists(n.node_ops.setattr,63)(n,{atime:r,mtime:t})},open(e,r,t=438){if(""===e)throw new ge.ErrnoError(44);var n,a;if(t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{a=e.endsWith("/");var i=ge.lookupPath(e,{follow:!(131072&r),noent_okay:!0});n=i.node,e=i.path}var s=!1;if(64&r)if(n){if(128&r)throw new ge.ErrnoError(20)}else{if(a)throw new ge.ErrnoError(31);n=ge.mknod(e,511|t,0),s=!0}if(!n)throw new ge.ErrnoError(44);if(ge.isChrdev(n.mode)&&(r&=-513),65536&r&&!ge.isDir(n.mode))throw new ge.ErrnoError(54);if(!s){var u=ge.mayOpen(n,r);if(u)throw new ge.ErrnoError(u)}512&r&&!s&&ge.truncate(n,0),r&=-131713;var c=ge.createStream({node:n,path:ge.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),s&&ge.chmod(n,511&t),!o.logReadFiles||1&r||e in ge.readFiles||(ge.readFiles[e]=1),c},close(e){if(ge.isClosed(e))throw new ge.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ge.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ge.isClosed(e))throw new ge.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ge.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ge.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new ge.ErrnoError(28);if(ge.isClosed(e))throw new ge.ErrnoError(8);if(1==(2097155&e.flags))throw new ge.ErrnoError(8);if(ge.isDir(e.node.mode))throw new ge.ErrnoError(31);if(!e.stream_ops.read)throw new ge.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ge.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new ge.ErrnoError(28);if(ge.isClosed(e))throw new ge.ErrnoError(8);if(!(2097155&e.flags))throw new ge.ErrnoError(8);if(ge.isDir(e.node.mode))throw new ge.ErrnoError(31);if(!e.stream_ops.write)throw new ge.ErrnoError(28);e.seekable&&1024&e.flags&&ge.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ge.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new ge.ErrnoError(2);if(1==(2097155&e.flags))throw new ge.ErrnoError(2);if(!e.stream_ops.mmap)throw new ge.ErrnoError(43);if(!r)throw new ge.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ge.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ge.open(e,r.flags),o=ge.stat(e).size,a=new Uint8Array(o);return ge.read(n,a,0,o,0),"utf8"===r.encoding?t=J(a):"binary"===r.encoding&&(t=a),ge.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ge.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ae(r)+1),a=ie(r,o,0,o.length);ge.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ge.write(n,r,0,r.byteLength,void 0,t.canOwn)}ge.close(n)},cwd:()=>ge.currentPath,chdir(e){var r=ge.lookupPath(e,{follow:!0});if(null===r.node)throw new ge.ErrnoError(44);if(!ge.isDir(r.node.mode))throw new ge.ErrnoError(54);var t=ge.nodePermissions(r.node,"x");if(t)throw new ge.ErrnoError(t);ge.currentPath=r.path},createDefaultDirectories(){ge.mkdir("/tmp"),ge.mkdir("/home"),ge.mkdir("/home/web_user")},createDefaultDevices(){ge.mkdir("/dev"),ge.registerDevice(ge.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n,llseek:()=>0}),ge.mkdev("/dev/null",ge.makedev(1,3)),ue.register(ge.makedev(5,0),ue.default_tty_ops),ue.register(ge.makedev(6,0),ue.default_tty1_ops),ge.mkdev("/dev/tty",ge.makedev(5,0)),ge.mkdev("/dev/tty1",ge.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(te(e),r=e.byteLength),e[--r]);ge.createDevice("/dev","random",t),ge.createDevice("/dev","urandom",t),ge.mkdir("/dev/shm"),ge.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ge.mkdir("/proc");var e=ge.mkdir("/proc/self");ge.mkdir("/proc/self/fd"),ge.mount({mount(){var r=ge.createNode(e,"fd",16895,73);return r.stream_ops={llseek:le.stream_ops.llseek},r.node_ops={lookup(e,r){var t=+r,n=ge.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(ge.streams.entries()).filter((([e,r])=>r)).map((([e,r])=>e.toString()))},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?ge.createDevice("/dev","stdin",e):ge.symlink("/dev/tty","/dev/stdin"),r?ge.createDevice("/dev","stdout",null,r):ge.symlink("/dev/tty","/dev/stdout"),t?ge.createDevice("/dev","stderr",null,t):ge.symlink("/dev/tty1","/dev/stderr"),ge.open("/dev/stdin",0),ge.open("/dev/stdout",1),ge.open("/dev/stderr",1)},staticInit(){ge.nameTable=new Array(4096),ge.mount(le,{},"/"),ge.createDefaultDirectories(),ge.createDefaultDevices(),ge.createSpecialDirectories(),ge.filesystems={MEMFS:le}},init(e,r,t){ge.initialized=!0,e??=o.stdin,r??=o.stdout,t??=o.stderr,ge.createStandardStreams(e,r,t)},quit(){for(var e of(ge.initialized=!1,ge.streams))e&&ge.close(e)},findObject(e,r){var t=ge.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ge.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ge.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=re.basename(e),n=ge.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ge.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=re.join2(e,a);try{ge.mkdir(i)}catch(e){if(20!=e.errno)throw e}e=i}}return i},createFile(e,r,t,n,o){var a=re.join2("string"==typeof e?e:ge.getPath(e),r),i=pe(n,o);return ge.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ge.getPath(e),i=r?re.join2(e,r):e);var s=pe(n,o),u=ge.create(i,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),l=0,d=t.length;l<d;++l)c[l]=t.charCodeAt(l);t=c}ge.chmod(u,146|s);var f=ge.open(u,577);ge.write(f,t,0,t.length,0,a),ge.close(f),ge.chmod(u,s)}},createDevice(e,r,t,n){var o=re.join2("string"==typeof e?e:ge.getPath(e),r),a=pe(!!t,!!n);ge.createDevice.major??=64;var i=ge.makedev(ge.createDevice.major++,0);return ge.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=t()}catch(e){throw new ge.ErrnoError(29)}if(void 0===u&&0===i)throw new ge.ErrnoError(6);if(null==u)break;i++,r[n+s]=u}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new ge.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}}),ge.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("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.");try{e.contents=d(e.url),e.usedBytes=e.contents.length}catch(e){throw new ge.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class a{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize;return this.getter(e/this.chunkSize|0)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):se(o.responseText||"")})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,y("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!s)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:t};var u=ge.createFile(e,r,i,n,o);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(u.stream_ops).forEach((e=>{var r=u.stream_ops[e];c[e]=(...e)=>(ge.forceLoadFile(u),r(...e))})),c.read=(e,r,t,n,o)=>(ge.forceLoadFile(u),l(e,r,t,n,o)),c.mmap=(e,r,t,n,o)=>{ge.forceLoadFile(u);var a=ce();if(!a)throw new ge.ErrnoError(48);return l(e,x,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=c,u}},ve={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(re.isAbs(r))return r;var n;if(n=-100===e?ge.cwd():ve.getStreamFromFD(e).path,0==r.length){if(!t)throw new ge.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){A[e>>2]=r.dev,A[e+4>>2]=r.mode,$[e+8>>2]=r.nlink,A[e+12>>2]=r.uid,A[e+16>>2]=r.gid,A[e+20>>2]=r.rdev,T[e+24>>3]=BigInt(r.size),A[e+32>>2]=4096,A[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),o=r.ctime.getTime();return T[e+40>>3]=BigInt(Math.floor(t/1e3)),$[e+48>>2]=t%1e3*1e3*1e3,T[e+56>>3]=BigInt(Math.floor(n/1e3)),$[e+64>>2]=n%1e3*1e3*1e3,T[e+72>>3]=BigInt(Math.floor(o/1e3)),$[e+80>>2]=o%1e3*1e3*1e3,T[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){A[e+4>>2]=r.bsize,A[e+40>>2]=r.bsize,A[e+8>>2]=r.blocks,A[e+12>>2]=r.bfree,A[e+16>>2]=r.bavail,A[e+20>>2]=r.files,A[e+24>>2]=r.ffree,A[e+28>>2]=r.fsid,A[e+44>>2]=r.flags,A[e+36>>2]=r.namelen},doMsync(e,r,t,n,o){if(!ge.isFile(r.node.mode))throw new ge.ErrnoError(43);if(2&n)return 0;var a=E.slice(e,e+t);ge.msync(r,a,o,t,n)},getStreamFromFD:e=>ge.getStreamChecked(e),varargs:void 0,getStr:e=>K(e)},ye=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},we=e=>{for(var r="",t=e;E[t];)r+=z[E[t++]];return r},be={},_e={},xe={},Ee=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Se=e=>{throw new Ee(e)};function Pe(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||Se(`type "${n}" must have a positive integer typeid pointer`),_e.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Se(`Cannot register type '${n}' twice`)}if(_e[e]=r,delete xe[e],be.hasOwnProperty(e)){var o=be[e];delete be[e],o.forEach((e=>e()))}}(e,r,t)}var Ae=(e,r,t)=>{switch(r){case 1:return t?e=>x[e]:e=>E[e];case 2:return t?e=>S[e>>1]:e=>P[e>>1];case 4:return t?e=>A[e>>2]:e=>$[e>>2];case 8:return t?e=>T[e>>3]:e=>k[e>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},$e=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ce=e=>{Se(e.$$.ptrType.registeredClass.name+" instance already deleted")},Te=!1,ke=e=>{},Be=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},De=e=>"undefined"==typeof FinalizationRegistry?(De=e=>e,e):(Te=new FinalizationRegistry((e=>{Be(e.$$)})),De=e=>{var r=e.$$;return!r.smartPtr||Te.register(e,{$$:r},e),e},ke=e=>Te.unregister(e),De(e)),Le=[];function Oe(){}var Re=(e,r)=>Object.defineProperty(r,"name",{value:e}),Ue={},Ie=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||Se(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},Me=(e,r,t)=>{o.hasOwnProperty(e)?((void 0===t||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[t])&&Se(`Cannot register public name '${e}' twice`),Ie(o,e,e),o[e].overloadTable.hasOwnProperty(t)&&Se(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[e].overloadTable[t]=r):(o[e]=r,o[e].argCount=t)};function Ve(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Ne=(e,r,t)=>{for(;r!==t;)r.upcast||Se(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function je(e,r){return null===r?(this.isReference&&Se(`null is not a valid ${this.name}`),0):(r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass))}function ze(e,r){var t;if(null===r)return this.isReference&&Se(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;if(r&&r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Se(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`),t=Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Se("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Se(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var n=r.clone();t=this.rawShare(t,pr.toHandle((()=>n.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Se("Unsupporting sharing policy")}return t}function Ge(e,r){return null===r?(this.isReference&&Se(`null is not a valid ${this.name}`),0):(r.$$||Se(`Cannot pass "${ye(r)}" as a ${this.name}`),r.$$.ptr||Se(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Se(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`),Ne(r.$$.ptr,r.$$.ptrType.registeredClass,this.registeredClass))}function We(e){return this.fromWireType($[e>>2])}var He=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=He(e,r,t.baseClass);return null===n?null:t.downcast(n)},qe={},Xe=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Qe=e=>{throw new Xe(e)},Ze=(e,r)=>(r.ptrType&&r.ptr||Qe("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&Qe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},De(Object.create(e,{$$:{value:r,writable:!0}})));function Je(e,r,t,n,o,a,i,s,u,c,l){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==r.baseClass?this.toWireType=ze:n?(this.toWireType=je,this.destructorFunction=null):(this.toWireType=Ge,this.destructorFunction=null)}var Ke,Ye=(e,r,t)=>{o.hasOwnProperty(e)||Qe("Replacing nonexistent public symbol"),void 0!==o[e].overloadTable&&void 0!==t?o[e].overloadTable[t]=r:(o[e]=r,o[e].argCount=t)},er=e=>Ke.get(e),rr=(e,r,t=!1)=>{e=we(e);var n=er(r);return"function"!=typeof n&&Se(`unknown function pointer with signature ${e}: ${r}`),n};class tr extends Error{}var nr=e=>{var r=nt(e),t=we(r);return rt(r),t},or=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||_e[r]||(xe[r]?xe[r].forEach(e):(t.push(r),n[r]=!0))})),new tr(`${e}: `+t.map(nr).join([", "]))},ar=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Qe("Mismatched type converter count");for(var o=0;o<e.length;++o)Pe(e[o],n[o])}e.forEach((e=>xe[e]=r));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{_e.hasOwnProperty(e)?o[r]=_e[e]:(a.push(e),be.hasOwnProperty(e)||(be[e]=[]),be[e].push((()=>{o[r]=_e[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)},ir=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push($[r+4*n>>2]);return t},sr=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function ur(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function cr(e,r,t,n,o,a){var i=r.length;i<2&&Se("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==r[1]&&null!==t,u=ur(r),c="void"!==r[0].name,l=[e,Se,n,o,sr,r[0],r[1]],d=0;d<i-2;++d)l.push(r[d+2]);if(!u)for(d=s?1:2;d<r.length;++d)null!==r[d].destructorFunction&&l.push(r[d].destructorFunction);let[f,m]=function(e,r,t,n){var o=ur(e),a=e.length-2,i=[],s=["fn"];r&&s.push("thisWired");for(var u=0;u<a;++u)i.push(`arg${u}`),s.push(`arg${u}Wired`);i=i.join(","),s=s.join(",");var c=`return function (${i}) {\n`;o&&(c+="var destructors = [];\n");var l=o?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(c+=`var thisWired = classParam['toWireType'](${l}, this);\n`),u=0;u<a;++u)c+=`var arg${u}Wired = argType${u}['toWireType'](${l}, arg${u});\n`,d.push(`argType${u}`);if(c+=(t||n?"var rv = ":"")+`invoker(${s});\n`,o)c+="runDestructors(destructors);\n";else for(u=r?1:2;u<e.length;++u){var f=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(c+=`${f}_dtor(${f});\n`,d.push(`${f}_dtor`))}return t&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[d,c+="}\n"]}(r,s,c,a);var p=new Function(...f,m)(...l);return Re(e,p)}var lr,dr=e=>{const r=(e=e.trim()).indexOf("(");return-1===r?e:e.slice(0,r)},fr=[],mr=[],pr={toValue:e=>(e||Se(`Cannot use deleted val. handle = ${e}`),mr[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=fr.pop()||mr.length;return mr[r]=e,mr[r+1]=1,r}}}},hr={name:"emscripten::val",fromWireType:e=>{var r=pr.toValue(e);return(e=>{e>9&&0==--mr[e+1]&&(mr[e]=void 0,fr.push(e))})(e),r},toWireType:(e,r)=>pr.toHandle(r),argPackAdvance:8,readValueFromPointer:We,destructorFunction:null},gr=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(C[e>>2])};case 8:return function(e){return this.fromWireType(B[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},vr=(e,r,t)=>ie(e,E,r,t),yr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,wr=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&P[n];)++n;if((t=n<<1)-e>32&&yr)return yr.decode(E.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},br=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);S[r>>1]=i,r+=2}return S[r>>1]=0,r-n},_r=e=>2*e.length,xr=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=A[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Er=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),A[r>>2]=i,(r+=4)+4>o)break}return A[r>>2]=0,r-n},Sr=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Pr=0,Ar={},$r=e=>{if(e instanceof j||"unwind"==e)return _;p(1,e)},Cr=()=>q||Pr>0,Tr=e=>{_=e,Cr()||(o.onExit?.(e),D=!0),p(e,new j(e))},kr=e=>{if(!D)try{e(),(()=>{if(!Cr())try{_=e=_,Tr(e)}catch(e){$r(e)}var e})()}catch(e){$r(e)}},Br=e=>{var r=(e-b.buffer.byteLength+65535)/65536|0;try{return b.grow(r),O(),1}catch(e){}},Fr=e=>{var r=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_conservative_depth","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","NV_shader_noperspective_interpolation","WEBGL_clip_cull_distance","EXT_clip_control","EXT_color_buffer_half_float","EXT_depth_clamp","EXT_float_blend","EXT_polygon_offset_clamp","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_blend_func_extended","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw","WEBGL_polygon_mode"];return(e.getSupportedExtensions()||[]).filter((e=>r.includes(e)))},Dr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,unpackRowLength:0,recordError:e=>{Dr.lastError||(Dr.lastError=e)},getNewId:e=>{for(var r=Dr.counter++,t=e.length;t<r;t++)e[t]=null;for(;e[r];)r=Dr.counter++;return r},genObject:(e,r,t,n)=>{for(var o=0;o<e;o++){var a=lr[t](),i=a&&Dr.getNewId(n);a?(a.name=i,n[i]=a):Dr.recordError(1282),A[r+4*o>>2]=i}},MAX_TEMP_BUFFER_SIZE:2097152,numTempVertexBuffersPerSize:64,log2ceilLookup:e=>32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=Dr.log2ceilLookup(Dr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=Dr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s<o;++s)a[s]=i[s]=null}if(e){r.tempQuadIndexBuffer=lr.createBuffer(),r.GLctx.bindBuffer(34963,r.tempQuadIndexBuffer);for(var u=Dr.MAX_TEMP_BUFFER_SIZE>>1,c=new Uint16Array(u),l=(n=0,0);c[n++]=l,!(n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;r.GLctx.bufferData(34963,c,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:e=>{var r=Dr.log2ceilLookup(e),t=Dr.currentContext.tempVertexBuffers1[r],n=Dr.currentContext.tempVertexBufferCounters1[r];Dr.currentContext.tempVertexBufferCounters1[r]=Dr.currentContext.tempVertexBufferCounters1[r]+1&Dr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=lr.getParameter(34964);return t[n]=lr.createBuffer(),lr.bindBuffer(34962,t[n]),lr.bufferData(34962,1<<r,35048),lr.bindBuffer(34962,a),t[n]},getTempIndexBuffer:e=>{var r=Dr.log2ceilLookup(e),t=Dr.currentContext.tempIndexBuffers[r];if(t)return t;var n=lr.getParameter(34965);return Dr.currentContext.tempIndexBuffers[r]=lr.createBuffer(),lr.bindBuffer(34963,Dr.currentContext.tempIndexBuffers[r]),lr.bufferData(34963,1<<r,35048),lr.bindBuffer(34963,n),Dr.currentContext.tempIndexBuffers[r]},newRenderingFrameStarted:()=>{if(Dr.currentContext){var e=Dr.currentContext.tempVertexBuffers1;Dr.currentContext.tempVertexBuffers1=Dr.currentContext.tempVertexBuffers2,Dr.currentContext.tempVertexBuffers2=e,e=Dr.currentContext.tempVertexBufferCounters1,Dr.currentContext.tempVertexBufferCounters1=Dr.currentContext.tempVertexBufferCounters2,Dr.currentContext.tempVertexBufferCounters2=e;for(var r=Dr.log2ceilLookup(Dr.MAX_TEMP_BUFFER_SIZE),t=0;t<=r;++t)Dr.currentContext.tempVertexBufferCounters1[t]=0}},getSource:(e,r,t,n)=>{for(var o="",a=0;a<r;++a)o+=K($[t+4*a>>2],n?$[n+4*a>>2]:void 0);return o},calcBufLength:(e,r,t,n)=>t>0?n*t:e*Dr.byteSizeByType[r-Dr.byteSizeByTypeRoot]*n,usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:e=>{Dr.resetBufferBinding=!1;for(var r=0;r<Dr.currentContext.maxVertexAttribs;++r){var t=Dr.currentContext.clientBuffers[r];if(t.clientside&&t.enabled){Dr.resetBufferBinding=!0;var n=Dr.calcBufLength(t.size,t.type,t.stride,e),o=Dr.getTempVertexBuffer(n);lr.bindBuffer(34962,o),lr.bufferSubData(34962,0,E.subarray(t.ptr,t.ptr+n)),t.vertexAttribPointerAdaptor.call(lr,r,t.size,t.type,t.normalized,t.stride,0)}}},postDrawHandleClientVertexAttribBindings:()=>{Dr.resetBufferBinding&&lr.bindBuffer(34962,Dr.buffers[lr.currentArrayBufferBinding])},createContext:(e,r)=>{if(!e.getContextSafariWebGL2Fixed){function n(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null}e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=n}var t=e.getContext(r.majorVersion>1?"webgl2":"webgl",r);return t?Dr.registerContext(t,r):0},registerContext:(e,r)=>{var t=Dr.getNewId(Dr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),Dr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&Dr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o<n.maxVertexAttribs;o++)n.clientBuffers[o]={enabled:!1,clientside:!1,size:0,type:0,normalized:0,stride:0,ptr:0,vertexAttribPointerAdaptor:null};return Dr.generateTempBuffers(!1,n),t},makeContextCurrent:e=>(Dr.currentContext=Dr.contexts[e],o.ctx=lr=Dr.currentContext?.GLctx,!(e&&!lr)),getContext:e=>Dr.contexts[e],deleteContext:e=>{Dr.currentContext===Dr.contexts[e]&&(Dr.currentContext=null),"object"==typeof JSEvents&&JSEvents.removeAllHandlersOnTarget(Dr.contexts[e].GLctx.canvas),Dr.contexts[e]?.GLctx.canvas&&(Dr.contexts[e].GLctx.canvas.GLctxObject=void 0),Dr.contexts[e]=null},initExtensions:e=>{if(e||=Dr.currentContext,!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(r=t).multiDrawWebgl=r.getExtension("WEBGL_multi_draw"),(e=>{e.extPolygonOffsetClamp=e.getExtension("EXT_polygon_offset_clamp")})(t),(e=>{e.extClipControl=e.getExtension("EXT_clip_control")})(t),(e=>{e.webglPolygonMode=e.getExtension("WEBGL_polygon_mode")})(t),(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(e=>{e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")})(t),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),Fr(t).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},Lr=["default","low-power","high-performance"],Or=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],Rr=e=>{var r;return e=(r=e)>2?K(r):r,Or[e]||("undefined"!=typeof document?document.querySelector(e):null)},Ur={},Ir=()=>{if(!Ir.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(var r in Ur)void 0===Ur[r]?delete e[r]:e[r]=Ur[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Ir.strings=t}return Ir.strings},Mr=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),Vr=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Nr=[],jr=e=>0==(e-=5120)?x:1==e?E:2==e?S:4==e?A:6==e?C:5==e||28922==e||28520==e||30779==e||30782==e?$:P,zr=(e,r)=>e>>>31-Math.clz32(r.BYTES_PER_ELEMENT),Gr=e=>{var r=lr.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=lr.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?`[${t}]`:""))),t}Dr.recordError(1282)},Wr=[],Hr=e=>{var r=ae(e)+1,t=st(r);return vr(e,t,r),t},qr={errorCallback:(e,r,t,n)=>{var o=Q(),a=Hr(t);er(e)(r,a,n),X(o)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}qr.mgrSurface=new e,qr.mgrSwapChain=new e,qr.mgrAdapter=new e,qr.mgrDevice=new e,qr.mgrQueue=new e,qr.mgrCommandBuffer=new e,qr.mgrCommandEncoder=new e,qr.mgrRenderPassEncoder=new e,qr.mgrComputePassEncoder=new e,qr.mgrBindGroup=new e,qr.mgrBuffer=new e,qr.mgrSampler=new e,qr.mgrTexture=new e,qr.mgrTextureView=new e,qr.mgrQuerySet=new e,qr.mgrBindGroupLayout=new e,qr.mgrPipelineLayout=new e,qr.mgrRenderPipeline=new e,qr.mgrComputePipeline=new e,qr.mgrShaderModule=new e,qr.mgrRenderBundleEncoder=new e,qr.mgrRenderBundle=new e},makeColor:e=>({r:B[e>>3],g:B[e+8>>3],b:B[e+16>>3],a:B[e+24>>3]}),makeExtent3D:e=>({width:$[e>>2],height:$[e+4>>2],depthOrArrayLayers:$[e+8>>2]}),makeOrigin3D:e=>({x:$[e>>2],y:$[e+4>>2],z:$[e+8>>2]}),makeImageCopyTexture:e=>({texture:qr.mgrTexture.get($[e+4>>2]),mipLevel:$[e+8>>2],origin:qr.makeOrigin3D(e+12),aspect:qr.TextureAspect[$[e+24>>2]]}),makeTextureDataLayout:e=>{var r=$[e+16>>2],t=$[e+20>>2];return{offset:4294967296*$[e+4+8>>2]+$[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=qr.makeTextureDataLayout(e+8);return r.buffer=qr.mgrBuffer.get($[e+32>>2]),r},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n<e;++n){var o=r+16*n;t[K($[o+4>>2])]=B[o+8>>3]}return t}},makePipelineLayout:e=>e?qr.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}},fillLimitStruct:(e,r)=>{var t=r+8;function n(r,n){A[t+n>>2]=e[r]}function o(r,n){T[t+n>>3]=BigInt(e[r])}n("maxTextureDimension1D",0),n("maxTextureDimension2D",4),n("maxTextureDimension3D",8),n("maxTextureArrayLayers",12),n("maxBindGroups",16),n("maxBindGroupsPlusVertexBuffers",20),n("maxBindingsPerBindGroup",24),n("maxDynamicUniformBuffersPerPipelineLayout",28),n("maxDynamicStorageBuffersPerPipelineLayout",32),n("maxSampledTexturesPerShaderStage",36),n("maxSamplersPerShaderStage",40),n("maxStorageBuffersPerShaderStage",44),n("maxStorageTexturesPerShaderStage",48),n("maxUniformBuffersPerShaderStage",52),n("minUniformBufferOffsetAlignment",72),n("minStorageBufferOffsetAlignment",76),o("maxUniformBufferBindingSize",56),o("maxStorageBufferBindingSize",64),n("maxVertexBuffers",80),o("maxBufferSize",88),n("maxVertexAttributes",96),n("maxVertexBufferArrayStride",100),n("maxInterStageShaderComponents",104),n("maxInterStageShaderVariables",108),n("maxColorAttachments",112),n("maxColorAttachmentBytesPerSample",116),n("maxComputeWorkgroupStorageSize",120),n("maxComputeInvocationsPerWorkgroup",124),n("maxComputeWorkgroupSizeX",128),n("maxComputeWorkgroupSizeY",132),n("maxComputeWorkgroupSizeZ",136),n("maxComputeWorkgroupsPerDimension",140)},Int_BufferMapState:{unmapped:1,pending:2,mapped:3},Int_CompilationMessageType:{error:1,warning:2,info:3},Int_DeviceLostReason:{undefined:1,unknown:1,destroyed:2},Int_PreferredFormat:{rgba8unorm:18,bgra8unorm:23},WGSLFeatureName:[,"readonly_and_readwrite_storage_textures","packed_4x8_integer_dot_product","unrestricted_pointer_parameters","pointer_composite_access"],AddressMode:[,"clamp-to-edge","repeat","mirror-repeat"],AlphaMode:[,"opaque","premultiplied"],BlendFactor:[,"zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:[,"add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],BufferMapState:{1:"unmapped",2:"pending",3:"mapped"},CompareFunction:[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:[,"none","front","back"],ErrorFilter:{1:"validation",2:"out-of-memory",3:"internal"},FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32-filterable"],FilterMode:[,"nearest","linear"],FrontFace:[,"ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:[,"nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:{1:"occlusion",2:"timestamp"},SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only","read-only","read-write"],StoreOp:[,"store","discard"],TextureAspect:[,"all","stencil-only","depth-only"],TextureDimension:[,"1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2"],VertexStepMode:[,"vertex-buffer-not-used","vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10","float32-filterable":"11"}},Xr=ge.createPath,Qr=ge.createLazyFile,Zr=ge.createDevice;ge.createPreloadedFile=me,ge.staticInit(),o.FS_createPath=ge.createPath,o.FS_createDataFile=ge.createDataFile,o.FS_createPreloadedFile=ge.createPreloadedFile,o.FS_unlink=ge.unlink,o.FS_createLazyFile=ge.createLazyFile,o.FS_createDevice=ge.createDevice,le.doesNotExistError=new ge.ErrnoError(44),le.doesNotExistError.stack="<generic error, no stack>",(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);z=e})(),(()=>{let e=Oe.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof Oe))return!1;if(!(e instanceof Oe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Ce(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=De(Object.create(Object.getPrototypeOf(this),{$$:{value:$e(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ce(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),ke(this),Be(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ce(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Se("Object already scheduled for deletion"),Le.push(this),this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)})(),Object.assign(Je.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:8,readValueFromPointer:We,fromWireType:function(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=((e,r)=>{for(void 0===r&&Se("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r})(this.registeredClass,r),qe[r]))(0,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return Ze(this.registeredClass.instancePrototype,this.isSmartPointer?{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}:{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Ue[i];if(!s)return o.call(this);var u=He(r,this.registeredClass,(a=this.isConst?s.constPointerType:s.pointerType).registeredClass);return null===u?o.call(this):Ze(a.registeredClass.instancePrototype,this.isSmartPointer?{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}:{ptrType:a,ptr:u})}}),mr.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=()=>mr.length/2-5-fr.length,"undefined"!=typeof MainLoop&&MainLoop.preMainLoop.push((()=>Dr.newRenderingFrameStarted()));for(let e=0;e<32;++e)Nr.push(new Array(e));for(var Jr=new Int32Array(288),Kr=0;Kr<=288;++Kr)Wr[Kr]=Jr.subarray(0,Kr);qr.initManagers();var Yr={a:(e,r,t,n)=>N(`Assertion failed: ${K(e)}, at: `+[r?K(r):"unknown filename",t,n?K(n):"unknown function"]),ua:function(e,r,t){ve.varargs=t;try{var n=ve.getStreamFromFD(e);switch(r){case 0:if((o=Y())<0)return-28;for(;ge.streams[o];)o++;return ge.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Y();return n.flags|=o,0;case 12:return o=ee(),S[o+0>>1]=2,0}return-28}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return-e.errno}},Hb:function(e,r,t){ve.varargs=t;try{var n=ve.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=ee();A[a>>2]=o.c_iflag||0,A[a+4>>2]=o.c_oflag||0,A[a+8>>2]=o.c_cflag||0,A[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)x[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=ee();var s=A[a>>2],u=A[a+4>>2],c=A[a+8>>2],l=A[a+12>>2],d=[];for(i=0;i<32;i++)d.push(x[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(a=ee(),A[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=ee(),ge.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=ee(),S[a>>1]=f[0],S[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return-e.errno}},Ib:function(e,r,t,n){ve.varargs=n;try{r=ve.getStr(r),r=ve.calculateAt(e,r);var o=n?Y():0;return ge.open(r,t,o).fd}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return-e.errno}},Jb:()=>N(""),xa:(e,r,t,n,o)=>{var a=-1!=(r=we(r)).indexOf("u");Pe(e,{name:r,fromWireType:e=>e,toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${ye(r)}" to ${this.name}`);return"number"==typeof r&&(r=BigInt(r)),r},argPackAdvance:8,readValueFromPointer:Ae(r,t,!a),destructorFunction:null})},Mb:(e,r,t,n)=>{Pe(e,{name:r=we(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e])},destructorFunction:null})},Ub:(e,r,t,n,o,a,i,s,u,c,l,d,f)=>{l=we(l),a=rr(o,a),s&&=rr(i,s),c&&=rr(u,c),f=rr(d,f);var m=(e=>{var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(l);Me(m,(function(){or(`Cannot construct ${l} due to unbound types`,[n])})),ar([e,r,t],n?[n]:[],(r=>{var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:Oe.prototype;var i=Re(l,(function(...e){if(Object.getPrototypeOf(this)!==u)throw new Ee(`Use 'new' to construct ${l}`);if(void 0===d.constructor_body)throw new Ee(`${l} has no accessible constructor`);var r=d.constructor_body[e.length];if(void 0===r)throw new Ee(`Tried to invoke ctor of ${l} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Ve(l,i,u,f,t,a,s,c);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var p=new Je(l,d,!0,!1,!1),h=new Je(l+"*",d,!1,!1,!1),g=new Je(l+" const*",d,!1,!0,!1);return Ue[e]={pointerType:h,constPointerType:g},Ye(m,i),[p,h,g]}))},Tb:(e,r,t,n,o,a)=>{var i=ir(r,t);o=rr(n,o),ar([],[e],(e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{or(`Cannot construct ${e.name} due to unbound types`,i)},ar([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=cr(t,n,null,o,a),[]))),[]}))},x:(e,r,t,n,o,a,i,s,u,c)=>{var l=ir(t,n);r=we(r),r=dr(r),a=rr(o,a,u),ar([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function o(){or(`Cannot call ${n} due to unbound types`,l)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var c=e.registeredClass.instancePrototype,d=c[r];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===t-2?(o.argCount=t-2,o.className=e.name,c[r]=o):(Ie(c,r,n),c[r].overloadTable[t-2]=o),ar([],l,(o=>{var s=cr(n,o,e,a,i,u);return void 0===c[r].overloadTable?(s.argCount=t-2,c[r]=s):c[r].overloadTable[t-2]=s,[]})),[]}))},Kb:e=>Pe(e,hr),wa:(e,r,t)=>{Pe(e,{name:r=we(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:gr(r,t),destructorFunction:null})},za:(e,r,t,n,o,a,i,s)=>{var u=ir(r,t);e=we(e),e=dr(e),o=rr(n,o,i),Me(e,(function(){or(`Cannot call ${e} due to unbound types`,u)}),r-1),ar([],u,(t=>{var n=[t[0],null].concat(t.slice(1));return Ye(e,cr(e,n,null,o,a,i),r-1),[]}))},w:(e,r,t,n,o)=>{r=we(r);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned");Pe(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return r>>>0}:function(e,r){return r},argPackAdvance:8,readValueFromPointer:Ae(r,t,0!==n),destructorFunction:null})},n:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][r];function o(e){return new n(x.buffer,$[e+4>>2],$[e>>2])}Pe(e,{name:t=we(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Lb:(e,r)=>{Pe(e,{name:r=we(r),fromWireType(e){for(var r,t=$[e>>2],n=e+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==E[i]){var s=K(o,i-o);void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),o=i+1}}return rt(e),r},toWireType(e,r){var t;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||ArrayBuffer.isView(r)&&1==r.BYTES_PER_ELEMENT||Se("Cannot pass non-string to std::string"),t=n?ae(r):r.length;var o=tt(4+t+1),a=o+4;return $[o>>2]=t,n?vr(r,a,t+1):E.set(r,a),null!==e&&e.push(rt,o),o},argPackAdvance:8,readValueFromPointer:We,destructorFunction(e){rt(e)}})},_:(e,r,t)=>{var n,o,a,i;t=we(t),2===r?(n=wr,o=br,i=_r,a=e=>P[e>>1]):4===r&&(n=xr,o=Er,i=Sr,a=e=>$[e>>2]),Pe(e,{name:t,fromWireType:e=>{for(var t,o=$[e>>2],i=e+4,s=0;s<=o;++s){var u=e+4+s*r;if(s==o||0==a(u)){var c=n(i,u-i);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),i=u+r}}return rt(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Se(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=tt(4+a+r);return $[s>>2]=a/r,o(n,s+4,a+r),null!==e&&e.push(rt,s),s},argPackAdvance:8,readValueFromPointer:We,destructorFunction(e){rt(e)}})},Ob:(e,r)=>{Pe(e,{isVoid:!0,name:r=we(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},xb:()=>{q=!1,Pr=0},vb:()=>{throw 1/0},ya:(e,r)=>{var t,n;void 0===(n=_e[t=e])&&Se(`_emval_take_value has unknown type ${nr(t)}`);var o=(e=n).readValueFromPointer(r);return pr.toHandle(o)},yb:(e,r)=>{if(Ar[e]&&(clearTimeout(Ar[e].id),delete Ar[e]),!r)return 0;var t=setTimeout((()=>{delete Ar[e],kr((()=>ot(e,performance.now())))}),r);return Ar[e]={id:t,timeout_ms:r},0},Ab:(e,r,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.max(s,u);$[e>>2]=60*c,A[r>>2]=Number(s!=u);var l=e=>{var r=e>=0?"-":"+",t=Math.abs(e);return`UTC${r}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},d=l(s),f=l(u);u<s?(vr(d,t,17),vr(f,n,17)):(vr(d,n,17),vr(f,t,17))},Db:e=>{var r,t=E.length,n=2147483648;if((e>>>=0)>n)return!1;for(var o=1;o<=4;o*=2){var a=t*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(n,(r=Math.max(e,a),65536*Math.ceil(r/65536)));if(Br(i))return!0}return!1},Rb:(e,r)=>{var t=r>>2,n={alpha:!!x[r+0],depth:!!x[r+1],stencil:!!x[r+2],antialias:!!x[r+3],premultipliedAlpha:!!x[r+4],preserveDrawingBuffer:!!x[r+5],powerPreference:Lr[A[t+2]],failIfMajorPerformanceCaveat:!!x[r+12],majorVersion:A[t+4],minorVersion:A[t+5],enableExtensionsByDefault:x[r+24],explicitSwapControl:x[r+25],proxyContextToMainThread:A[t+7],renderViaOffscreenBackBuffer:x[r+32]},o=Rr(e);return o?n.explicitSwapControl?0:Dr.createContext(o,n):0},Sb:e=>{Dr.currentContext==e&&(Dr.currentContext=0),Dr.deleteContext(e)},tb:()=>Dr.currentContext?Dr.currentContext.handle:0,qa:e=>Dr.makeContextCurrent(e)?0:-5,Bb:(e,r)=>{var t=0;return Ir().forEach(((n,o)=>{var a=r+t;$[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)x[r++]=e.charCodeAt(t);x[r]=0})(n,a),t+=n.length+1})),0},Cb:(e,r)=>{var t=Ir();$[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),$[r>>2]=n,0},ta:function(e){try{var r=ve.getStreamFromFD(e);return ge.close(r),0}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return e.errno}},Gb:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=$[r>>2],i=$[r+4>>2];r+=8;var s=ge.read(e,x,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(ve.getStreamFromFD(e),r,t);return $[n>>2]=o,0}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return e.errno}},Eb:function(e,r,t,n){r=Mr(r);try{if(isNaN(r))return 61;var o=ve.getStreamFromFD(e);return ge.llseek(o,r,t),T[n>>3]=BigInt(o.position),o.getdents&&0===r&&0===t&&(o.getdents=null),0}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return e.errno}},Fb:function(e,r,t,n){try{var o=((e,r,t)=>{for(var n=0,o=0;o<t;o++){var a=$[r>>2],i=$[r+4>>2];r+=8;var s=ge.write(e,x,a,i,void 0);if(s<0)return-1;if(n+=s,s<i)break}return n})(ve.getStreamFromFD(e),r,t);return $[n>>2]=o,0}catch(e){if(void 0===ge||"ErrnoError"!==e.name)throw e;return e.errno}},ib:e=>lr.activeTexture(e),Fa:(e,r)=>{lr.attachShader(Dr.programs[e],Dr.shaders[r])},t:(e,r)=>{if(r&&!Dr.buffers[r]){var t=lr.createBuffer();t.name=r,Dr.buffers[r]=t}34962==e?lr.currentArrayBufferBinding=r:34963==e&&(lr.currentElementArrayBufferBinding=r),35051==e?lr.currentPixelPackBufferBinding=r:35052==e&&(lr.currentPixelUnpackBufferBinding=r),lr.bindBuffer(e,Dr.buffers[r])},gb:(e,r,t,n,o)=>{lr.bindBufferRange(e,r,Dr.buffers[t],n,o)},j:(e,r)=>{lr.bindFramebuffer(e,Dr.framebuffers[r])},Z:(e,r)=>{lr.bindRenderbuffer(e,Dr.renderbuffers[r])},O:(e,r)=>{lr.bindTexture(e,Dr.textures[r])},fa:e=>{lr.bindVertexArray(Dr.vaos[e]);var r=lr.getParameter(34965);lr.currentElementArrayBufferBinding=r?0|r.name:0},Y:e=>lr.blendEquation(e),v:(e,r)=>lr.blendFunc(e,r),z:(e,r,t,n,o,a,i,s,u,c)=>lr.blitFramebuffer(e,r,t,n,o,a,i,s,u,c),Ga:(e,r,t,n)=>{Dr.currentContext.version>=2?t&&r?lr.bufferData(e,E,n,t,r):lr.bufferData(e,r,n):lr.bufferData(e,t?E.subarray(t,t+r):r,n)},ia:e=>lr.clear(e),ja:(e,r,t,n)=>lr.clearColor(e,r,t,n),cb:e=>lr.clearDepth(e),db:e=>lr.clearStencil(e),H:(e,r,t,n)=>{lr.colorMask(!!e,!!r,!!t,!!n)},Za:e=>{lr.compileShader(Dr.shaders[e])},jc:()=>{var e=Dr.getNewId(Dr.programs),r=lr.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,Dr.programs[e]=r,e},$a:e=>{var r=Dr.getNewId(Dr.shaders);return Dr.shaders[r]=lr.createShader(e),r},sb:e=>lr.cullFace(e),eb:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.buffers[n];o&&(lr.deleteBuffer(o),o.name=0,Dr.buffers[n]=null,n==lr.currentArrayBufferBinding&&(lr.currentArrayBufferBinding=0),n==lr.currentElementArrayBufferBinding&&(lr.currentElementArrayBufferBinding=0),n==lr.currentPixelPackBufferBinding&&(lr.currentPixelPackBufferBinding=0),n==lr.currentPixelUnpackBufferBinding&&(lr.currentPixelUnpackBufferBinding=0))}},ob:(e,r)=>{for(var t=0;t<e;++t){var n=A[r+4*t>>2],o=Dr.framebuffers[n];o&&(lr.deleteFramebuffer(o),o.name=0,Dr.framebuffers[n]=null)}},va:e=>{if(e){var r=Dr.programs[e];r?(lr.deleteProgram(r),r.name=0,Dr.programs[e]=null):Dr.recordError(1281)}},nb:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.renderbuffers[n];o&&(lr.deleteRenderbuffer(o),o.name=0,Dr.renderbuffers[n]=null)}},X:e=>{if(e){var r=Dr.shaders[e];r?(lr.deleteShader(r),Dr.shaders[e]=null):Dr.recordError(1281)}},ra:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2],o=Dr.textures[n];o&&(lr.deleteTexture(o),o.name=0,Dr.textures[n]=null)}},Xa:(e,r)=>{for(var t=0;t<e;t++){var n=A[r+4*t>>2];lr.deleteVertexArray(Dr.vaos[n]),Dr.vaos[n]=null}},qb:e=>lr.depthFunc(e),Q:e=>{lr.depthMask(!!e)},C:e=>lr.disable(e),kc:e=>{Dr.currentContext.clientBuffers[e].enabled=!1,lr.disableVertexAttribArray(e)},fb:(e,r,t,n)=>{var o,a=0;if(!lr.currentElementArrayBufferBinding){var i=Dr.calcBufLength(1,t,0,r);if(o=Dr.getTempIndexBuffer(i),lr.bindBuffer(34963,o),lr.bufferSubData(34963,0,E.subarray(n,n+i)),r>0)for(var s=0;s<Dr.currentContext.maxVertexAttribs;++s){var u=Dr.currentContext.clientBuffers[s];if(u.clientside&&u.enabled){let e;switch(t){case 5121:e=Uint8Array;break;case 5123:e=Uint16Array;break;case 5125:e=Uint32Array;break;default:return void Dr.recordError(1282)}a=new e(E.buffer,n,r).reduce(((e,r)=>Math.max(e,r)))+1;break}}n=0}Dr.preDrawHandleClientVertexAttribBindings(a),lr.drawElements(e,r,t,n),Dr.postDrawHandleClientVertexAttribBindings(r),lr.currentElementArrayBufferBinding||lr.bindBuffer(34963,null)},s:e=>lr.enable(e),kb:e=>{Dr.currentContext.clientBuffers[e].enabled=!0,lr.enableVertexAttribArray(e)},ka:(e,r,t,n)=>{lr.framebufferRenderbuffer(e,r,t,Dr.renderbuffers[n])},mb:(e,r,t,n,o)=>{lr.framebufferTexture2D(e,r,t,Dr.textures[n],o)},rb:e=>lr.frontFace(e),pb:(e,r)=>{Dr.genObject(e,r,"createBuffer",Dr.buffers)},na:(e,r)=>{Dr.genObject(e,r,"createFramebuffer",Dr.framebuffers)},ma:(e,r)=>{Dr.genObject(e,r,"createRenderbuffer",Dr.renderbuffers)},pa:(e,r)=>{Dr.genObject(e,r,"createTexture",Dr.textures)},bb:(e,r)=>{Dr.genObject(e,r,"createVertexArray",Dr.vaos)},La:(e,r)=>((e,r)=>{if(r){var t,n=void 0;switch(e){case 36346:n=1;break;case 36344:return;case 34814:case 36345:n=0;break;case 34466:var o=lr.getParameter(34467);n=o?o.length:0;break;case 33309:if(Dr.currentContext.version<2)return void Dr.recordError(1282);n=(t=Fr(lr),t=t.concat(t.map((e=>"GL_"+e))),t).length;break;case 33307:case 33308:if(Dr.currentContext.version<2)return void Dr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=lr.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void Dr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Dr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i<a.length;++i)A[r+4*i>>2]=a[i];return}try{n=0|a.name}catch(r){return Dr.recordError(1280),void w(`GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter(${e})! (error: ${r})`)}}break;default:return Dr.recordError(1280),void w(`GL_INVALID_ENUM in glGet0v: Native code calling glGet0v(${e}) and it returns ${a} of type ${typeof a}!`)}}A[r>>2]=n}else Dr.recordError(1281)})(e,r),Nb:(e,r,t,n)=>{var o=lr.getProgramInfoLog(Dr.programs[e]);null===o&&(o="(unknown error)");var a=r>0&&n?vr(o,n,r):0;t&&(A[t>>2]=a)},Aa:(e,r,t)=>{if(t)if(e>=Dr.counter)Dr.recordError(1281);else if(e=Dr.programs[e],35716==r){var n=lr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),A[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=lr.getProgramParameter(e,35718),a=0;a<o;++a)e.maxUniformLength=Math.max(e.maxUniformLength,lr.getActiveUniform(e,a).name.length+1);A[t>>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength){var i=lr.getProgramParameter(e,35721);for(a=0;a<i;++a)e.maxAttributeLength=Math.max(e.maxAttributeLength,lr.getActiveAttrib(e,a).name.length+1)}A[t>>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength){var s=lr.getProgramParameter(e,35382);for(a=0;a<s;++a)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,lr.getActiveUniformBlockName(e,a).length+1)}A[t>>2]=e.maxUniformBlockNameLength}else A[t>>2]=lr.getProgramParameter(e,r);else Dr.recordError(1281)},Ya:(e,r,t,n)=>{var o=lr.getShaderInfoLog(Dr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?vr(o,n,r):0;t&&(A[t>>2]=a)},ha:(e,r,t)=>{if(t)if(35716==r){var n=lr.getShaderInfoLog(Dr.shaders[e]);null===n&&(n="(unknown error)"),A[t>>2]=n?n.length+1:0}else if(35720==r){var o=lr.getShaderSource(Dr.shaders[e]);A[t>>2]=o?o.length+1:0}else A[t>>2]=lr.getShaderParameter(Dr.shaders[e],r);else Dr.recordError(1281)},m:(e,r)=>lr.getUniformBlockIndex(Dr.programs[e],K(r)),o:(e,r)=>{if(r=K(r),e=Dr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n){e.uniformLocsById=n={},e.uniformArrayNamesById={};var a=lr.getProgramParameter(e,35718);for(r=0;r<a;++r){var i=lr.getActiveUniform(e,r),s=i.name,u=i.size,c=Vr(s),l=c>0?s.slice(0,c):s,d=e.uniformIdCounter;for(e.uniformIdCounter+=u,o[l]=[u,d],t=0;t<u;++t)n[d]=t,e.uniformArrayNamesById[d++]=l}}})(e);var t=e.uniformLocsById,n=0,o=r,a=Vr(r);a>0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n<i[0]&&(t[n+=i[1]]=t[n]||lr.getUniformLocation(e,r)))return n}else Dr.recordError(1281);var s;return-1},ab:(e,r,t)=>{for(var n=Nr[r],o=0;o<r;o++)n[o]=A[t+4*o>>2];lr.invalidateFramebuffer(e,n)},$b:e=>{lr.linkProgram(e=Dr.programs[e]),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},la:(e,r,t,n,o)=>lr.renderbufferStorageMultisample(e,r,t,n,o),u:(e,r,t,n)=>lr.scissor(e,r,t,n),_a:(e,r,t,n)=>{var o=Dr.getSource(e,r,t,n);lr.shaderSource(Dr.shaders[e],o)},S:(e,r,t)=>lr.stencilFunc(e,r,t),J:(e,r,t,n)=>lr.stencilFuncSeparate(e,r,t,n),R:(e,r,t)=>lr.stencilOp(e,r,t),I:(e,r,t,n)=>lr.stencilOpSeparate(e,r,t,n),oa:(e,r,t,n,o,a,i,s,u)=>{if(Dr.currentContext.version>=2){if(lr.currentPixelUnpackBufferBinding)return void lr.texImage2D(e,r,t,n,o,a,i,s,u);if(u){var c=jr(s),l=zr(u,c);return void lr.texImage2D(e,r,t,n,o,a,i,s,c,l)}}var d=u?((e,r,t,n,o)=>{var a=jr(e),i=(e=>({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*a.BYTES_PER_ELEMENT,s=((e,r,t)=>{var n=function(e,r){return e+r-1&-r}(e*t,Dr.unpackAlignment);return r*n})(t,n,i);return a.subarray(zr(o,a),zr(o+s,a))})(s,i,n,o,u):null;lr.texImage2D(e,r,t,n,o,a,i,s,d)},B:(e,r,t)=>lr.texParameteri(e,r,t),lb:(e,r)=>{lr.uniform1f(Gr(e),r)},ub:(e,r,t)=>{if(Dr.currentContext.version>=2)r&&lr.uniform1iv(Gr(e),A,t>>2,r);else{if(r<=288)for(var n=Wr[r],o=0;o<r;++o)n[o]=A[t+4*o>>2];else n=A.subarray(t>>2,t+4*r>>2);lr.uniform1iv(Gr(e),n)}},hb:(e,r,t)=>{lr.uniformBlockBinding(e=Dr.programs[e],r,t)},zb:e=>{lr.useProgram(e=Dr.programs[e]),lr.currentProgram=e},jb:(e,r,t,n,o,a)=>{var i=Dr.currentContext.clientBuffers[e];if(!lr.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,lr.vertexAttribPointer(e,r,t,!!n,o,a)},A:(e,r,t,n)=>lr.viewport(e,r,t,n),p:function(e,r){var t=Q();try{return er(e)(r)}catch(e){if(X(t),e!==e+0)throw e;at(1,0)}},e:function(e,r,t){var n=Q();try{return er(e)(r,t)}catch(e){if(X(n),e!==e+0)throw e;at(1,0)}},f:function(e,r,t,n){var o=Q();try{return er(e)(r,t,n)}catch(e){if(X(o),e!==e+0)throw e;at(1,0)}},T:function(e,r,t,n,o,a){var i=Q();try{return er(e)(r,t,n,o,a)}catch(e){if(X(i),e!==e+0)throw e;at(1,0)}},sa:function(e){var r=Q();try{er(e)()}catch(e){if(X(r),e!==e+0)throw e;at(1,0)}},c:function(e,r){var t=Q();try{er(e)(r)}catch(e){if(X(t),e!==e+0)throw e;at(1,0)}},b:function(e,r,t){var n=Q();try{er(e)(r,t)}catch(e){if(X(n),e!==e+0)throw e;at(1,0)}},k:function(e,r,t,n){var o=Q();try{er(e)(r,t,n)}catch(e){if(X(o),e!==e+0)throw e;at(1,0)}},G:function(e,r,t,n,o){var a=Q();try{er(e)(r,t,n,o)}catch(e){if(X(a),e!==e+0)throw e;at(1,0)}},wb:Tr,Yb:(e,r)=>{var t=0,n=0;return qr.mgrAdapter.get(e).features.forEach((e=>{var o=qr.FeatureNameString2Enum[e];void 0!==o&&(0!==r&&(A[r+t>>2]=o,t+=4),n++)})),n},Vb:e=>qr.mgrAdapter.release(e),Xb:(e,r,t,n)=>{var o=qr.mgrAdapter.get(e),a={};if(r){var i=$[r+8>>2];if(i){var s=$[r+12>>2];a.requiredFeatures=Array.from($.subarray(s>>2,s+4*i>>2),(e=>qr.FeatureName[e]))}var u=$[r+16>>2];if(u){var c=u+8,l={};function g(e,r){var t=$[c+r>>2];4294967295!=t&&(l[e]=t)}function v(e,r){var t=c+r;4294967295==$[t>>2]&&4294967295==$[t+4>>2]||(l[e]=4294967296*$[t+4>>2]+$[t>>2])}g("maxTextureDimension1D",0),g("maxTextureDimension2D",4),g("maxTextureDimension3D",8),g("maxTextureArrayLayers",12),g("maxBindGroups",16),g("maxBindGroupsPlusVertexBuffers",20),g("maxDynamicUniformBuffersPerPipelineLayout",28),g("maxDynamicStorageBuffersPerPipelineLayout",32),g("maxSampledTexturesPerShaderStage",36),g("maxSamplersPerShaderStage",40),g("maxStorageBuffersPerShaderStage",44),g("maxStorageTexturesPerShaderStage",48),g("maxUniformBuffersPerShaderStage",52),g("minUniformBufferOffsetAlignment",72),g("minStorageBufferOffsetAlignment",76),v("maxUniformBufferBindingSize",56),v("maxStorageBufferBindingSize",64),g("maxVertexBuffers",80),v("maxBufferSize",88),g("maxVertexAttributes",96),g("maxVertexBufferArrayStride",100),g("maxInterStageShaderComponents",104),g("maxInterStageShaderVariables",108),g("maxColorAttachments",112),g("maxColorAttachmentBytesPerSample",116),g("maxComputeWorkgroupStorageSize",120),g("maxComputeInvocationsPerWorkgroup",124),g("maxComputeWorkgroupSizeX",128),g("maxComputeWorkgroupSizeY",132),g("maxComputeWorkgroupSizeZ",136),g("maxComputeWorkgroupsPerDimension",140),a.requiredLimits=l}var d=$[r+20>>2];if(d){var f={};(m=$[d+4>>2])&&(f.label=K(m)),a.defaultQueue=f}var m,p=$[r+28>>2],h=$[r+32>>2];(m=$[r+4>>2])&&(a.label=K(m))}o.requestDevice(a).then((e=>{kr((()=>{var r={queueId:qr.mgrQueue.create(e.queue)},o=qr.mgrDevice.create(e,r);p&&e.lost.then((e=>{kr((()=>qr.errorCallback(p,qr.Int_DeviceLostReason[e.reason],e.message,h)))})),er(t)(0,o,0,n)}))}),(function(e){kr((()=>{var r=Q(),o=Hr(e.message);er(t)(1,0,o,n),X(r)}))}))},Va:e=>qr.mgrBindGroupLayout.release(e),Wa:e=>qr.mgrBindGroup.release(e),Ka:e=>{var r=qr.mgrBuffer.objects[e];if(r.onUnmap){for(var t of r.onUnmap)t();r.onUnmap=void 0}qr.mgrBuffer.get(e).destroy()},y:function(e){var r=qr.mgrBuffer.get(e).size;return BigInt(r)},Ja:e=>qr.mgrBuffer.release(e),Ca:e=>qr.mgrCommandBuffer.release(e),M:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:qr.mgrQuerySet.get($[e>>2]),beginningOfPassWriteIndex:$[e+4>>2],endOfPassWriteIndex:$[e+8>>2]}}($[r+8>>2])};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrCommandEncoder.get(e);return qr.mgrComputePassEncoder.create(o.beginComputePass(t))},da:(e,r)=>{function t(e){var r=$[e+4>>2];if(0!==r){var t=A[e+8>>2];-1==t&&(t=void 0);var n=$[e+16>>2],o=$[e+20>>2],a=qr.makeColor(e+24);return{view:qr.mgrTextureView.get(r),depthSlice:t,resolveTarget:qr.mgrTextureView.get($[e+12>>2]),clearValue:a,loadOp:qr.LoadOp[n],storeOp:qr.StoreOp[o]}}}function n(e,r){for(var n=[],o=0;o<e;++o)n.push(t(r+56*o));return n}function o(e){if(0!==e)return{view:qr.mgrTextureView.get($[e>>2]),depthClearValue:C[e+12>>2],depthLoadOp:qr.LoadOp[$[e+4>>2]],depthStoreOp:qr.StoreOp[$[e+8>>2]],depthReadOnly:!!$[e+16>>2],stencilClearValue:$[e+28>>2],stencilLoadOp:qr.LoadOp[$[e+20>>2]],stencilStoreOp:qr.StoreOp[$[e+24>>2]],stencilReadOnly:!!$[e+32>>2]}}function a(e){if(0!==e)return{querySet:qr.mgrQuerySet.get($[e>>2]),beginningOfPassWriteIndex:$[e+4>>2],endOfPassWriteIndex:$[e+8>>2]}}var i=function(e){var r=$[e>>2],t=void 0;0!==r&&(t=4294967296*$[r+4+8>>2]+$[r+8>>2]);var i={label:void 0,colorAttachments:n($[e+8>>2],$[e+12>>2]),depthStencilAttachment:o($[e+16>>2]),occlusionQuerySet:qr.mgrQuerySet.get($[e+20>>2]),timestampWrites:a($[e+24>>2]),maxDrawCount:t},s=$[e+4>>2];return s&&(i.label=K(s)),i}(r),s=qr.mgrCommandEncoder.get(e);return qr.mgrRenderPassEncoder.create(s.beginRenderPass(i))},Ha:(e,r,t,n)=>{var o=qr.mgrCommandEncoder.get(e),a=qr.makeExtent3D(n);o.copyTextureToTexture(qr.makeImageCopyTexture(r),qr.makeImageCopyTexture(t),a)},Da:(e,r)=>{var t=qr.mgrCommandEncoder.get(e);return qr.mgrCommandBuffer.create(t.finish())},Ba:e=>qr.mgrCommandEncoder.release(e),D:(e,r,t,n)=>{qr.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},L:e=>{qr.mgrComputePassEncoder.get(e).end()},K:e=>qr.mgrComputePassEncoder.release(e),i:(e,r,t,n,o)=>{var a=qr.mgrComputePassEncoder.get(e),i=qr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u<n;u++,o+=4)s.push($[o>>2]);a.setBindGroup(r,i,s)}},E:(e,r)=>{var t=qr.mgrComputePassEncoder.get(e),n=qr.mgrComputePipeline.get(r);t.setPipeline(n)},fc:e=>qr.mgrComputePipeline.release(e),F:(e,r)=>{function t(e){var r,t=$[e+8>>2],n=$[e+32>>2],o=$[e+36>>2],a=$[e+4>>2];if(t){var i=$[(r=e+24)>>2]+4294967296*A[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:qr.mgrBuffer.get(t),offset:4294967296*$[e+4+16>>2]+$[e+16>>2],size:i}}}return n?{binding:a,resource:qr.mgrSampler.get(n)}:{binding:a,resource:qr.mgrTextureView.get(o)}}var n={label:void 0,layout:qr.mgrBindGroupLayout.get($[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o<e;++o)n.push(t(r+40*o));return n}($[r+12>>2],$[r+16>>2])},o=$[r+4>>2];o&&(n.label=K(o));var a=qr.mgrDevice.get(e);return qr.mgrBindGroup.create(a.createBindGroup(n))},r:(e,r)=>{function t(e){var r=$[e+4>>2];if(r)return{type:qr.BufferBindingType[r],hasDynamicOffset:!!$[e+8>>2],minBindingSize:4294967296*$[e+4+16>>2]+$[e+16>>2]}}function n(e){var r=$[e+4>>2];if(r)return{type:qr.SamplerBindingType[r]}}function o(e){var r=$[e+4>>2];if(r)return{sampleType:qr.TextureSampleType[r],viewDimension:qr.TextureViewDimension[$[e+8>>2]],multisampled:!!$[e+12>>2]}}function a(e){var r=$[e+4>>2];if(r)return{access:qr.StorageTextureAccess[r],format:qr.TextureFormat[$[e+8>>2]],viewDimension:qr.TextureViewDimension[$[e+12>>2]]}}var i={entries:function(e,r){for(var i,s=[],u=0;u<e;++u)s.push({binding:$[(i=r+80*u)+4>>2],visibility:$[i+8>>2],buffer:t(i+16),sampler:n(i+40),texture:o(i+48),storageTexture:a(i+64)});return s}($[r+8>>2],$[r+12>>2])},s=$[r+4>>2];s&&(i.label=K(s));var u=qr.mgrDevice.get(e);return qr.mgrBindGroupLayout.create(u.createBindGroupLayout(i))},V:(e,r)=>{var t=!!$[r+24>>2],n={label:void 0,usage:$[r+8>>2],size:4294967296*$[r+4+16>>2]+$[r+16>>2],mappedAtCreation:t},o=$[r+4>>2];o&&(n.label=K(o));var a=qr.mgrDevice.get(e),i={},s=qr.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},Ea:(e,r)=>{var t;if(r){t={label:void 0};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrDevice.get(e);return qr.mgrCommandEncoder.create(o.createCommandEncoder(t))},gc:(e,r)=>{var t=(e=>{var r={label:void 0,layout:qr.makePipelineLayout($[e+8>>2]),compute:qr.makeProgrammableStageDescriptor(e+12)},t=$[e+4>>2];return t&&(r.label=K(t)),r})(r),n=qr.mgrDevice.get(e);return qr.mgrComputePipeline.create(n.createComputePipeline(t))},hc:(e,r)=>{for(var t=$[r+8>>2],n=$[r+12>>2],o=[],a=0;a<t;++a)o.push(qr.mgrBindGroupLayout.get($[n+4*a>>2]));var i={label:void 0,bindGroupLayouts:o},s=$[r+4>>2];s&&(i.label=K(s));var u=qr.mgrDevice.get(e);return qr.mgrPipelineLayout.create(u.createPipelineLayout(i))},l:(e,r)=>{var t=(e=>{function r(e){if(e)return{operation:qr.BlendOperation[$[e>>2]],srcFactor:qr.BlendFactor[$[e+4>>2]],dstFactor:qr.BlendFactor[$[e+8>>2]]}}function t(e){if(e)return{alpha:r(e+12),color:r(e+0)}}function n(e,r){for(var n,o,a=[],i=0;i<e;++i)a.push(0===(o=$[(n=r+16*i)+4>>2])?void 0:{format:qr.TextureFormat[o],blend:t($[n+8>>2]),writeMask:$[n+12>>2]});return a}function o(e){return{compare:qr.CompareFunction[$[e>>2]],failOp:qr.StencilOperation[$[e+4>>2]],depthFailOp:qr.StencilOperation[$[e+8>>2]],passOp:qr.StencilOperation[$[e+12>>2]]}}function a(e,r){for(var t,n=[],o=0;o<e;++o)n.push({format:qr.VertexFormat[$[(t=r+24*o)>>2]],offset:4294967296*$[t+4+8>>2]+$[t+8>>2],shaderLocation:$[t+16>>2]});return n}function i(e){if(e){var r=$[e+8>>2];return 1===r?null:{arrayStride:4294967296*$[e+4>>2]+$[e>>2],stepMode:qr.VertexStepMode[r],attributes:a($[e+12>>2],$[e+16>>2])}}}function s(e,r){if(e){for(var t=[],n=0;n<e;++n)t.push(i(r+24*n));return t}}var u={label:void 0,layout:qr.makePipelineLayout($[e+8>>2]),vertex:function(e){if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2]),buffers:s($[e+20>>2],$[e+24>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}}(e+12),primitive:function(e){if(e){var r=$[e>>2];return{topology:qr.PrimitiveTopology[$[e+4>>2]],stripIndexFormat:qr.IndexFormat[$[e+8>>2]],frontFace:qr.FrontFace[$[e+12>>2]],cullMode:qr.CullMode[$[e+16>>2]],unclippedDepth:7===(r?$[r+4>>2]:0)&&!!$[r+8>>2]}}}(e+40),depthStencil:function(e){if(e)return{format:qr.TextureFormat[$[e+4>>2]],depthWriteEnabled:!!$[e+8>>2],depthCompare:qr.CompareFunction[$[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:$[e+48>>2],stencilWriteMask:$[e+52>>2],depthBias:A[e+56>>2],depthBiasSlopeScale:C[e+60>>2],depthBiasClamp:C[e+64>>2]}}($[e+60>>2]),multisample:function(e){if(e)return{count:$[e+4>>2],mask:$[e+8>>2],alphaToCoverageEnabled:!!$[e+12>>2]}}(e+64),fragment:function(e){if(e){var r={module:qr.mgrShaderModule.get($[e+4>>2]),constants:qr.makePipelineConstants($[e+12>>2],$[e+16>>2]),targets:n($[e+20>>2],$[e+24>>2])},t=$[e+8>>2];return t&&(r.entryPoint=K(t)),r}}($[e+80>>2])},c=$[e+4>>2];return c&&(u.label=K(c)),u})(r),n=qr.mgrDevice.get(e);return qr.mgrRenderPipeline.create(n.createRenderPipeline(t))},Ta:(e,r)=>{var t;if(r){t={label:void 0,addressModeU:qr.AddressMode[$[r+8>>2]],addressModeV:qr.AddressMode[$[r+12>>2]],addressModeW:qr.AddressMode[$[r+16>>2]],magFilter:qr.FilterMode[$[r+20>>2]],minFilter:qr.FilterMode[$[r+24>>2]],mipmapFilter:qr.MipmapFilterMode[$[r+28>>2]],lodMinClamp:C[r+32>>2],lodMaxClamp:C[r+36>>2],compare:qr.CompareFunction[$[r+40>>2]]};var n=$[r+4>>2];n&&(t.label=K(n))}var o=qr.mgrDevice.get(e);return qr.mgrSampler.create(o.createSampler(t))},ic:(e,r)=>{var t=$[r>>2],n=$[t+4>>2],o={label:void 0,code:""},a=$[r+4>>2];switch(a&&(o.label=K(a)),n){case 5:var i=$[t+12>>2]>>2;o.code=$.subarray(i,i+$[t+8>>2]);break;case 6:var s=$[t+8>>2];s&&(o.code=K(s))}var u=qr.mgrDevice.get(e);return qr.mgrShaderModule.create(u.createShaderModule(o))},W:(e,r)=>{var t={label:void 0,size:qr.makeExtent3D(r+16),mipLevelCount:$[r+32>>2],sampleCount:$[r+36>>2],dimension:qr.TextureDimension[$[r+12>>2]],format:qr.TextureFormat[$[r+28>>2]],usage:$[r+8>>2]},n=$[r+4>>2];n&&(t.label=K(n));var o=$[r+40>>2];if(o){var a=$[r+44>>2];t.viewFormats=Array.from(A.subarray(a>>2,a+4*o>>2),(e=>qr.TextureFormat[e]))}var i=qr.mgrDevice.get(e);return qr.mgrTexture.create(i.createTexture(t))},Ua:e=>{var r=qr.mgrDevice.objects[e].queueId;return qr.mgrQueue.reference(r),r},Wb:e=>qr.mgrDevice.release(e),Pb:(e,r)=>{var t=Rr($[$[r>>2]+8>>2]).getContext("webgpu");if(!t)return 0;var n=$[r+4>>2];return n&&(t.surfaceLabelWebGPU=K(n)),qr.mgrSurface.create(t)},Zb:(e,r,t,n)=>{var o;if(r&&(o={powerPreference:qr.PowerPreference[$[r+8>>2]],forceFallbackAdapter:!!$[r+16>>2]}),!("gpu"in navigator)){var a=Q(),i=Hr("WebGPU not available on this browser (navigator.gpu is not available)");return er(t)(1,0,i,n),void X(a)}navigator.gpu.requestAdapter(o).then((e=>{kr((()=>{if(e){var r=qr.mgrAdapter.create(e);er(t)(0,r,0,n)}else{var o=Q(),a=Hr("WebGPU not available on this system (requestAdapter returned null)");er(t)(1,0,a,n),X(o)}}))}),(e=>{kr((()=>{var r=Q(),o=Hr(e.message);er(t)(2,0,o,n),X(r)}))}))},dc:e=>qr.mgrPipelineLayout.release(e),Ia:e=>qr.mgrQueue.release(e),P:(e,r,t)=>{var n=qr.mgrQueue.get(e),o=Array.from(A.subarray(t>>2,t+4*r>>2),(e=>qr.mgrCommandBuffer.get(e)));n.submit(o)},N:function(e,r,t,n,o){t=Mr(t);var a=qr.mgrQueue.get(e),i=qr.mgrBuffer.get(r),s=E.subarray(n,n+o);a.writeBuffer(i,t,s,0,o)},ga:(e,r,t,n,o,a)=>{var i=qr.mgrQueue.get(e),s=qr.makeImageCopyTexture(r),u=qr.makeTextureDataLayout(o),c=qr.makeExtent3D(a),l=E.subarray(t,t+n);i.writeTexture(s,l,u,c)},$:(e,r,t,n,o,a)=>{qr.mgrRenderPassEncoder.get(e).drawIndexed(r,t,n,o,a)},ca:e=>{qr.mgrRenderPassEncoder.get(e).end()},ba:e=>qr.mgrRenderPassEncoder.release(e),d:(e,r,t,n,o)=>{var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u<n;u++,o+=4)s.push($[o>>2]);a.setBindGroup(r,i,s)}},aa:function(e,r,t,n,o){n=Mr(n),o=Mr(o);var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBuffer.get(r);-1==o&&(o=void 0),a.setIndexBuffer(i,qr.IndexFormat[t],n,o)},g:(e,r)=>{var t=qr.mgrRenderPassEncoder.get(e),n=qr.mgrRenderPipeline.get(r);t.setPipeline(n)},q:(e,r,t,n,o)=>{qr.mgrRenderPassEncoder.get(e).setScissorRect(r,t,n,o)},h:(e,r)=>{qr.mgrRenderPassEncoder.get(e).setStencilReference(r)},U:function(e,r,t,n,o){n=Mr(n),o=Mr(o);var a=qr.mgrRenderPassEncoder.get(e),i=qr.mgrBuffer.get(t);-1==o&&(o=void 0),a.setVertexBuffer(r,i,n,o)},ec:e=>qr.mgrRenderPipeline.release(e),Ma:e=>qr.mgrSampler.release(e),cc:e=>qr.mgrShaderModule.release(e),ac:(e,r)=>{var t=$[r+4>>2],n=qr.mgrSurface.get(e),o=[$[r+28>>2],$[r+32>>2]];0!==o[0]&&(n.canvas.width=o[0]),0!==o[1]&&(n.canvas.height=o[1]);var a={device:qr.mgrDevice.get(t),format:qr.TextureFormat[$[r+8>>2]],usage:$[r+12>>2],alphaMode:qr.AlphaMode[$[r+24>>2]]},i=$[r+16>>2];if(i){var s=$[r+20>>2];a.viewFormats=Array.from(A.subarray(s>>2,s+4*i>>2),(e=>qr.TextureFormat[e]))}n.configure(a)},_b:(e,r)=>{var t=qr.mgrSurface.get(e);try{var n=qr.mgrTexture.create(t.getCurrentTexture());$[r>>2]=n,A[r+4>>2]=0,A[r+8>>2]=0}catch(e){$[r>>2]=0,A[r+4>>2]=0,A[r+8>>2]=5}},Qb:e=>qr.mgrSurface.release(e),bc:e=>{qr.mgrSurface.get(e).unconfigure()},Pa:(e,r)=>{var t;if(r){var n=$[r+20>>2],o=$[r+28>>2];t={format:qr.TextureFormat[$[r+8>>2]],dimension:qr.TextureViewDimension[$[r+12>>2]],baseMipLevel:$[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:$[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:qr.TextureAspect[$[r+32>>2]]};var a=$[r+4>>2];a&&(t.label=K(a))}var i=qr.mgrTexture.get(e);return qr.mgrTextureView.create(i.createView(t))},Na:e=>qr.mgrTexture.get(e).destroy(),Qa:e=>{var r=qr.mgrTexture.get(e);return qr.TextureFormat.indexOf(r.format)},Ra:e=>qr.mgrTexture.get(e).height,Sa:e=>qr.mgrTexture.get(e).width,ea:e=>qr.mgrTexture.release(e),Oa:e=>qr.mgrTextureView.release(e)},et=await async function(){function r(e,r){return b=(et=e.exports).lc,O(),Ke=et.qc,V(),et}M();var t,a={a:Yr};if(o.instantiateWasm)return new Promise(((e,t)=>{o.instantiateWasm(a,((t,n)=>{r(t),e(t.exports)}))}));R??=o.locateFile?(t="thorvg-wasm.wasm",o.locateFile?o.locateFile(t,h):h+t):new URL("thorvg-wasm.wasm","undefined"==typeof document?require("url").pathToFileURL(__filename).href:e&&e.src||new URL("lottie-player.cjs.js",document.baseURI).href).href;try{return r((await async function(e,r,t){if(!e&&"function"==typeof WebAssembly.instantiateStreaming&&!L(r)&&!u)try{var n=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(e){w(`wasm streaming compile failed: ${e}`),w("falling back to ArrayBuffer instantiation")}return async function(e,r){try{var t=await async function(e){if(!F)try{var r=await l(e);return new Uint8Array(r)}catch{}return function(e){if(e==R&&F)return new Uint8Array(F);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}(e)}(e);return await WebAssembly.instantiate(t,r)}catch(e){w(`failed to asynchronously prepare wasm: ${e}`),N(e)}}(r,t)}(F,R,a)).instance)}catch(e){return n(e),Promise.reject(e)}}(),rt=et.nc,tt=et.oc,nt=et.pc,ot=et.rc,at=et.sc,it=et.tc,st=et.uc,ut=et.vc;if(o.addRunDependency=M,o.removeRunDependency=V,o.FS_createPreloadedFile=me,o.FS_unlink=e=>ge.unlink(e),o.FS_createPath=Xr,o.FS_createDevice=Zr,o.FS=ge,o.FS_createDataFile=de,o.FS_createLazyFile=Qr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return function e(){function r(){o.calledRun=!0,D||(o.noFSInit||ge.initialized||ge.init(),et.mc(),ge.ignorePermissions=!1,t(o),o.onRuntimeInitialized?.(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),W.unshift(e);var e;G(W)}())}U>0?I=e:(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),H.unshift(e);var e;G(H)}(),U>0?I=e:o.setStatus?(o.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>o.setStatus("")),1),r()}),1)):r())}(),a});function ve(e,r,t,n){var o,a=arguments.length,i=a<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(r,t,i):o(r,t))||i);return a>3&&i&&Object.defineProperty(r,t,i),i}let ye,we=!1;var be,_e,xe,Ee,Se,Pe;exports.Renderer=void 0,(be=exports.Renderer||(exports.Renderer={})).SW="sw",be.WG="wg",be.GL="gl",exports.InitStatus=void 0,(_e=exports.InitStatus||(exports.InitStatus={})).IDLE="idle",_e.FAILED="failed",_e.REQUESTED="requested",_e.INITIALIZED="initialized",exports.FileType=void 0,(xe=exports.FileType||(exports.FileType={})).JSON="json",xe.LOT="lot",xe.JPG="jpg",xe.PNG="png",xe.SVG="svg",exports.PlayerState=void 0,(Ee=exports.PlayerState||(exports.PlayerState={})).Destroyed="destroyed",Ee.Error="error",Ee.Loading="loading",Ee.Paused="paused",Ee.Playing="playing",Ee.Stopped="stopped",Ee.Frozen="frozen",exports.PlayMode=void 0,(Se=exports.PlayMode||(exports.PlayMode={})).Bounce="bounce",Se.Normal="normal",exports.PlayerEvent=void 0,(Pe=exports.PlayerEvent||(exports.PlayerEvent={})).Complete="complete",Pe.Destroyed="destroyed",Pe.Error="error",Pe.Frame="frame",Pe.Freeze="freeze",Pe.Load="load",Pe.Loop="loop",Pe.Pause="pause",Pe.Play="play",Pe.Ready="ready",Pe.Stop="stop";const Ae=async(e,r)=>{const t=new TextEncoder;let n=e;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),t.encode(n));case"string":if("json"===r||"lot"===r)return n=await(async e=>{try{e=JSON.parse(e)}catch(r){const t=await(async e=>{if("string"!=typeof e)throw new Error("The url value must be a string");try{const r=new URL(e),t=await fetch(r.toString());return await t.json()}catch(e){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(e);e=JSON.stringify(t)}return e})(n),t.encode(n);const e=await(async e=>(await fetch(e)).arrayBuffer())(n);return new Uint8Array(e);default:throw new Error("Invalid src type")}},$e=e=>new Promise((r=>setTimeout(r,e))),Ce=(e,r)=>{const t=document.createElement("a");t.setAttribute("href",URL.createObjectURL(r)),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)};let Te="idle";class ke extends ne{src;wasmUrl;fileType="json";renderConfig;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;_canvas;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;async _init(){if(we)for(;!ye;)await $e(100);if(ye||(we=!0,ye=await ge({locateFile:(e,r)=>e.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg-wasm.wasm":r+e})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const e=this.renderConfig?.renderer||"sw";if(await(async e=>{if("wg"===e){for(;"requested"===Te;)await $e(100);if("initialized"!==Te)for(Te="requested";;)switch(ye.init()){case 0:return void(Te="initialized");case 1:return void(Te="failed");case 2:await $e(100)}}})(e),"failed"===Te)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this._TVG=new ye.TvgLottieAnimation(e,`#${this._canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:e,right:r,top:t,bottom:n}=this.getBoundingClientRect(),o=window.innerWidth,a=window.innerHeight;let i=0,s=0,u=this._canvas.width,c=this._canvas.height;e<0&&(i=Math.abs(e),u-=i),t<0&&(s=Math.abs(t),c-=s),r>o&&(u-=r-o),n>a&&(c-=n-a),this._TVG.viewport(i,s,u,c)}_observerCallback(e){const r=e[0],t=r.target;t._observable=r.isIntersecting,r.isIntersecting?"frozen"===t.currentState&&t.play():"playing"===t.currentState&&(t.freeze(),t.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(e){this._canvas=this.querySelector(".thorvg"),this._canvas.id=`thorvg-${pe().replaceAll("-","").substring(0,6)}`,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(e,r=""){if(!this._TVG.load(e,this.fileType,this._canvas.width,this._canvas.height,r))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.renderConfig?.enableDevicePixelRatio){const e=1+.75*(window.devicePixelRatio-1),{width:r,height:t}=this._canvas.getBoundingClientRect();this._canvas.width=r*e,this._canvas.height=t*e}if(this._TVG.resize(this._canvas.width,this._canvas.height),this._viewport(),!this._TVG.update())return;if("wg"===this.renderConfig?.renderer||"gl"===this.renderConfig?.renderer)return void this._TVG.render();const e=this._TVG.render(),r=new Uint8ClampedArray(e.buffer,e.byteOffset,e.byteLength);r.length<1||(this._imageData=new ImageData(r,this._canvas.width,this._canvas.height),this._flush())}async _update(){if("playing"!==this.currentState)return!1;const e=this._TVG.duration(),r=Date.now()/1e3;if(this.currentFrame=(r-this._beginTime)/e*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 e=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||e&&this._counter<e)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 $e(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(e){this.pause(),this.currentFrame=e,this._TVG.frame(e)}async load(e,r="json"){try{await this._init();const t=await Ae(e,r);this.dispatchEvent(new CustomEvent("ready")),this.fileType=r,await this._loadBytes(t)}catch(e){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(!("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(e){this._frame(e),await this._update(),this._render()}resize(e,r){this._canvas.width=e,this._canvas.height=r,"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(){ye.term(),ye=null}setLooping(e){this._TVG&&(this.loop=e)}setDirection(e){this._TVG&&(this.direction=e)}setSpeed(e){this._TVG&&(this.speed=e)}setBgColor(e){this._TVG&&(this._canvas.style.backgroundColor=e)}save2png(){this._TVG&&this._canvas.toBlob((e=>{e&&Ce("output.png",e)}),"image/png")}async save2gif(e){const r=new ye.TvgLottieAnimation("sw",`#${this._canvas.id}`),t=await Ae(e,"json");if(!r.save(t,"gif")){const e=r.error();throw r.delete(),new Error("Unable to save. Error: ",e)}const n=ye.FS.readFile("output.gif");if(n.length<6)throw r.delete(),new Error("Unable to save the GIF data. The generated file size is invalid.");const o=new Blob([n],{type:"application/octet-stream"});Ce("output.gif",o),r.delete()}getVersion(){return{THORVG_VERSION:"1.0.0"}}render(){return N`
2
2
  <canvas class="thorvg" style="width: 100%; height: 100%;" />
3
- `}}ye([se({type:String})],Fe.prototype,"src",void 0),ye([se({type:exports.MimeType})],Fe.prototype,"mimeType",void 0),ye([se({type:Object})],Fe.prototype,"renderConfig",void 0),ye([se({type:Number})],Fe.prototype,"speed",void 0),ye([se({type:Boolean})],Fe.prototype,"autoPlay",void 0),ye([se({type:Number})],Fe.prototype,"count",void 0),ye([se({type:Boolean})],Fe.prototype,"loop",void 0),ye([se({type:Number})],Fe.prototype,"direction",void 0),ye([se()],Fe.prototype,"mode",void 0),ye([se()],Fe.prototype,"intermission",void 0),ye([se({type:Number})],Fe.prototype,"totalFrame",void 0),ye([se({type:Number})],Fe.prototype,"currentFrame",void 0),ye([se({type:Number})],Fe.prototype,"currentState",void 0),ye([se({type:Float32Array})],Fe.prototype,"size",null),Fe=ye([(e=>(t,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)})("lottie-player")],Fe);var Re=Object.freeze({__proto__:null});exports.LottiePlayer=Fe;
3
+ `}}var Be;ve([se({type:String})],ke.prototype,"src",void 0),ve([se({type:String})],ke.prototype,"wasmUrl",void 0),ve([se({type:exports.FileType})],ke.prototype,"fileType",void 0),ve([se({type:Object})],ke.prototype,"renderConfig",void 0),ve([se({type:Number})],ke.prototype,"speed",void 0),ve([se({type:Boolean})],ke.prototype,"autoPlay",void 0),ve([se({type:Number})],ke.prototype,"count",void 0),ve([se({type:Boolean})],ke.prototype,"loop",void 0),ve([se({type:Number})],ke.prototype,"direction",void 0),ve([se()],ke.prototype,"mode",void 0),ve([se()],ke.prototype,"intermission",void 0),ve([se({type:Number})],ke.prototype,"totalFrame",void 0),ve([se({type:Number})],ke.prototype,"currentFrame",void 0),ve([se({type:Number})],ke.prototype,"currentState",void 0),ve([se({type:Float32Array})],ke.prototype,"size",null),ke=ve([(Be="lottie-player",(e,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(Be,e)})):customElements.define(Be,e)})],ke);var Fe=Object.freeze({__proto__:null});exports.LottiePlayer=ke;
4
4
  //# sourceMappingURL=lottie-player.cjs.js.map