@thorvg/lottie-player 1.0.2 → 1.0.4

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.
Files changed (51) hide show
  1. package/dist/gl/lottie-player.cjs.js +2 -2
  2. package/dist/gl/lottie-player.cjs.js.map +1 -1
  3. package/dist/gl/lottie-player.esm.js +2 -2
  4. package/dist/gl/lottie-player.esm.js.map +1 -1
  5. package/dist/gl/lottie-player.js +2 -2
  6. package/dist/gl/lottie-player.js.map +1 -1
  7. package/dist/gl/thorvg.wasm +0 -0
  8. package/dist/gl-lite/lottie-player.cjs.js +2 -2
  9. package/dist/gl-lite/lottie-player.cjs.js.map +1 -1
  10. package/dist/gl-lite/lottie-player.esm.js +2 -2
  11. package/dist/gl-lite/lottie-player.esm.js.map +1 -1
  12. package/dist/gl-lite/lottie-player.js +2 -2
  13. package/dist/gl-lite/lottie-player.js.map +1 -1
  14. package/dist/gl-lite/thorvg.wasm +0 -0
  15. package/dist/lottie-player.cjs.js +2 -2
  16. package/dist/lottie-player.cjs.js.map +1 -1
  17. package/dist/lottie-player.d.ts +5 -0
  18. package/dist/lottie-player.esm.js +2 -2
  19. package/dist/lottie-player.esm.js.map +1 -1
  20. package/dist/lottie-player.js +2 -2
  21. package/dist/lottie-player.js.map +1 -1
  22. package/dist/sw/lottie-player.cjs.js +2 -2
  23. package/dist/sw/lottie-player.cjs.js.map +1 -1
  24. package/dist/sw/lottie-player.esm.js +2 -2
  25. package/dist/sw/lottie-player.esm.js.map +1 -1
  26. package/dist/sw/lottie-player.js +2 -2
  27. package/dist/sw/lottie-player.js.map +1 -1
  28. package/dist/sw/thorvg.wasm +0 -0
  29. package/dist/sw-lite/lottie-player.cjs.js +2 -2
  30. package/dist/sw-lite/lottie-player.cjs.js.map +1 -1
  31. package/dist/sw-lite/lottie-player.esm.js +2 -2
  32. package/dist/sw-lite/lottie-player.esm.js.map +1 -1
  33. package/dist/sw-lite/lottie-player.js +2 -2
  34. package/dist/sw-lite/lottie-player.js.map +1 -1
  35. package/dist/sw-lite/thorvg.wasm +0 -0
  36. package/dist/thorvg.wasm +0 -0
  37. package/dist/wg/lottie-player.cjs.js +2 -2
  38. package/dist/wg/lottie-player.cjs.js.map +1 -1
  39. package/dist/wg/lottie-player.esm.js +2 -2
  40. package/dist/wg/lottie-player.esm.js.map +1 -1
  41. package/dist/wg/lottie-player.js +2 -2
  42. package/dist/wg/lottie-player.js.map +1 -1
  43. package/dist/wg/thorvg.wasm +0 -0
  44. package/dist/wg-lite/lottie-player.cjs.js +2 -2
  45. package/dist/wg-lite/lottie-player.cjs.js.map +1 -1
  46. package/dist/wg-lite/lottie-player.esm.js +2 -2
  47. package/dist/wg-lite/lottie-player.esm.js.map +1 -1
  48. package/dist/wg-lite/lottie-player.js +2 -2
  49. package/dist/wg-lite/lottie-player.js.map +1 -1
  50. package/dist/wg-lite/thorvg.wasm +0 -0
  51. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let a=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const r=this.t;if(e&&void 0===t){const e=void 0!==r&&1===r.length;e&&(t=n.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(r,t))}return t}toString(){return this.cssText}};const i=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:o,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:u,getOwnPropertySymbols:c,getPrototypeOf:h}=Object,d=globalThis,f=d.trustedTypes,p=f?f.emptyScript:"",m=d.reactiveElementPolyfillSupport,b=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},y=(t,e)=>!o(t,e),w={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let g=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&s(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:a}=l(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=n?.call(this);a?.call(this,e),this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...u(t),...c(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(i(t))}else void 0!==t&&e.push(i(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(e)r.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),a=t.litNonce;void 0!==a&&n.setAttribute("nonce",a),n.textContent=e.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(e,r.type);this._$Em=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const i=a.fromAttribute(e,t.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,a=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??y)(a,e)||r.useDefault&&r.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:a},i){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==a||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};g.elementStyles=[],g.shadowRootOptions={mode:"open"},g[b("elementProperties")]=new Map,g[b("finalized")]=new Map,m?.({ReactiveElement:g}),(d.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_=(t=$,e,r)=>{const{kind:n,metadata:a}=r;let i=globalThis.litPropertyMetadata.get(a);if(void 0===i&&globalThis.litPropertyMetadata.set(a,i=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),i.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const a=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,a,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const a=this[n];e.call(this,r),this.requestUpdate(n,a,t)}}throw Error("Unsupported decorator location: "+n)};function A(t){return(e,r)=>"object"==typeof r?_(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const x=globalThis,S=x.trustedTypes,C=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,E="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+k,O=`<${T}>`,z=document,P=()=>z.createComment(""),B=t=>null===t||"object"!=typeof t&&"function"!=typeof t,D=Array.isArray,R="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,F=/>/g,L=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,j=/"/g,V=/^(?:script|style|textarea|title)$/i,I=(t,...e)=>({_$litType$:1,strings:t,values:e}),G=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),W=new WeakMap,q=z.createTreeWalker(z,129);function K(t,e){if(!D(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}const Z=(t,e)=>{const r=t.length-1,n=[];let a,i=2===e?"<svg>":3===e?"<math>":"",o=M;for(let e=0;e<r;e++){const r=t[e];let s,l,u=-1,c=0;for(;c<r.length&&(o.lastIndex=c,l=o.exec(r),null!==l);)c=o.lastIndex,o===M?"!--"===l[1]?o=U:void 0!==l[1]?o=F:void 0!==l[2]?(V.test(l[2])&&(a=RegExp("</"+l[2],"g")),o=L):void 0!==l[3]&&(o=L):o===L?">"===l[0]?(o=a??M,u=-1):void 0===l[1]?u=-2:(u=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?L:'"'===l[3]?j:N):o===j||o===N?o=L:o===U||o===F?o=M:(o=L,a=void 0);const h=o===L&&t[e+1].startsWith("/>")?" ":"";i+=o===M?r+O:u>=0?(n.push(s),r.slice(0,u)+E+r.slice(u)+k+h):r+k+(-2===u?e:h)}return[K(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Y{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let a=0,i=0;const o=t.length-1,s=this.parts,[l,u]=Z(t,e);if(this.el=Y.createElement(l,r),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=q.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(E)){const e=u[i++],r=n.getAttribute(t).split(k),o=/([.?@])?(.*)/.exec(e);s.push({type:1,index:a,name:o[2],strings:r,ctor:"."===o[1]?et:"?"===o[1]?rt:"@"===o[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(k)&&(s.push({type:6,index:a}),n.removeAttribute(t));if(V.test(n.tagName)){const t=n.textContent.split(k),e=t.length-1;if(e>0){n.textContent=S?S.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],P()),q.nextNode(),s.push({type:2,index:++a});n.append(t[e],P())}}}else if(8===n.nodeType)if(n.data===T)s.push({type:2,index:a});else{let t=-1;for(;-1!==(t=n.data.indexOf(k,t+1));)s.push({type:7,index:a}),t+=k.length-1}a++}}static createElement(t,e){const r=z.createElement("template");return r.innerHTML=t,r}}function X(t,e,r=t,n){if(e===G)return e;let a=void 0!==n?r._$Co?.[n]:r._$Cl;const i=B(e)?void 0:e._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),void 0===i?a=void 0:(a=new i(t),a._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=a:r._$Cl=a),void 0!==a&&(e=X(t,a._$AS(t,e.values),a,n)),e}class J{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??z).importNode(e,!0);q.currentNode=n;let a=q.nextNode(),i=0,o=0,s=r[0];for(;void 0!==s;){if(i===s.index){let e;2===s.type?e=new Q(a,a.nextSibling,this,t):1===s.type?e=new s.ctor(a,s.name,s.strings,this,t):6===s.type&&(e=new at(a,this,t)),this._$AV.push(e),s=r[++o]}i!==s?.index&&(a=q.nextNode(),i++)}return q.currentNode=z,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),B(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>D(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==H&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Y.createElement(K(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new J(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Y(t)),e}k(t){D(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const a of t)n===e.length?e.push(r=new Q(this.O(P()),this.O(P()),this,this.options)):r=e[n],r._$AI(a),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,a){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=H}_$AI(t,e=this,r,n){const a=this.strings;let i=!1;if(void 0===a)t=X(this,t,e,0),i=!B(t)||t!==this._$AH&&t!==G,i&&(this._$AH=t);else{const n=t;let o,s;for(t=a[0],o=0;o<a.length-1;o++)s=X(this,n[r+o],e,o),s===G&&(s=this._$AH[o]),i||=!B(s)||s!==this._$AH[o],s===H?t=H:t!==H&&(t+=(s??"")+a[o+1]),this._$AH[o]=s}i&&!n&&this.j(t)}j(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===H?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==H)}}class nt extends tt{constructor(t,e,r,n,a){super(t,e,r,n,a),this.type=5}_$AI(t,e=this){if((t=X(this,t,e,0)??H)===G)return;const r=this._$AH,n=t===H&&r!==H||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,a=t!==H&&(r===H||n);n&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const it=x.litHtmlPolyfillSupport;it?.(Y,Q),(x.litHtmlVersions??=[]).push("3.3.1");const ot=globalThis;class st extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let a=n._$litPart$;if(void 0===a){const t=r?.renderBefore??null;n._$litPart$=a=new Q(e.insertBefore(P(),t),t,void 0,r??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}}st._$litElement$=!0,st.finalized=!0,ot.litElementHydrateSupport?.({LitElement:st});const lt=ot.litElementPolyfillSupport;function ut(t,e,r,n){var a,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,r,o):a(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}lt?.({LitElement:st}),(ot.litElementVersions??=[]).push("4.2.1");let ct=null,ht=!1;var dt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const ft=t=>new Promise(e=>setTimeout(e,t));let pt="idle";class mt extends st{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ht)for(;!ct;)await ft(100);if(ct||(ht=!0,ct=await async function(t={}){var e,r=t,n=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(i){const{createRequire:t}=await Promise.resolve().then(function(){return yt});var o=t(import.meta.url)}var s,l,u=(t,e)=>{throw e},c=import.meta.url,h="";if(i){var d=o("fs");c.startsWith("file:")&&(h=o("path").dirname(o("url").fileURLToPath(c))+"/"),l=t=>(t=z(t)?new URL(t):t,d.readFileSync(t)),s=async t=>(t=z(t)?new URL(t):t,d.readFileSync(t,void 0)),process.argv.slice(2),u=(t,e)=>{throw process.exitCode=t,e}}else if(n||a){try{h=new URL(".",c).href}catch{}a&&(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=async t=>{if(z(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var f,p,m,b,v,y,w,g,$,_,A,x,S,C,E,k=function(){}.bind(),T=function(){}.bind(),O=!1,z=t=>t.startsWith("file://"),P=!1;function B(){var t=on.buffer;v=new Int8Array(t),w=new Int16Array(t),y=new Uint8Array(t),g=new Uint16Array(t),$=new Int32Array(t),_=new Uint32Array(t),A=new Float32Array(t),x=new Float64Array(t),S=new BigInt64Array(t),C=new BigUint64Array(t)}function D(t){throw r.onAbort?.(t),T(t="Aborted("+t+")"),O=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),b?.(t),t}class R{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var M=t=>{for(;0<t.length;)t.shift()(r)},U=[],F=[],L=()=>{var t=r.preRun.shift();F.push(t)},N=!0,j=new TextDecoder,V=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},I=(t,e,r)=>t?j.decode(y.subarray(t,V(y,t,e,r))):"",G=t=>{for(var e="";;){var r=y[t++];if(!r)return e;e+=String.fromCharCode(r)}},H={},W={},q={},K=class extends Error{constructor(t){super(t),this.name="BindingError"}},Z=t=>{throw new K(t)};function Y(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new K(`type "${n}" must have a positive integer typeid pointer`);if(W.hasOwnProperty(t)){if(r.xc)return;throw new K(`Cannot register type '${n}' twice`)}W[t]=e,delete q[t],H.hasOwnProperty(t)&&(e=H[t],delete H[t],e.forEach(t=>t()))}(t,e,r)}var X=(t,e,r)=>{switch(e){case 1:return r?t=>v[t]:t=>y[t];case 2:return r?t=>w[t>>1]:t=>g[t>>1];case 4:return r?t=>$[t>>2]:t=>_[t>>2];case 8:return r?t=>S[t>>3]:t=>C[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},J=t=>{throw new K(t.za.Na.Ka.name+" instance already deleted")},Q=!1,tt=()=>{},et=t=>globalThis.FinalizationRegistry?(Q=new FinalizationRegistry(t=>{--(t=t.za).count.value,0===t.count.value&&(t.Za?t.cb.qb(t.Za):t.Na.Ka.qb(t.La))}),et=t=>{var e=t.za;return e.Za&&Q.register(t,{za:e},t),t},tt=t=>{Q.unregister(t)},et(t)):(et=t=>t,t);function rt(){}var nt=(t,e)=>Object.defineProperty(e,"name",{value:t}),at={},it=(t,e,r)=>{if(void 0===t[e].Ya){var n=t[e];t[e]=function(...n){if(!t[e].Ya.hasOwnProperty(n.length))throw new K(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].Ya})!`);return t[e].Ya[n.length].apply(this,n)},t[e].Ya=[],t[e].Ya[n.yb]=n}},ot=(t,e,n)=>{if(r.hasOwnProperty(t)){if(void 0===n||void 0!==r[t].Ya&&void 0!==r[t].Ya[n])throw new K(`Cannot register public name '${t}' twice`);if(it(r,t,t),r[t].Ya.hasOwnProperty(n))throw new K(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].Ya[n]=e}else r[t]=e,r[t].yb=n};function st(t,e,r,n,a,i,o,s){this.name=t,this.constructor=e,this.vb=r,this.qb=n,this.ab=a,this.tc=i,this.Db=o,this.qc=s,this.Dc=[]}var lt=(t,e,r)=>{for(;e!==r;){if(!e.Db)throw new K(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Db(t),e=e.ab}return t},ut=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ct(t,e){if(null===e){if(this.Mb)throw new K(`null is not a valid ${this.name}`);return 0}if(!e.za)throw new K(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.za.La)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);return lt(e.za.La,e.za.Na.Ka,this.Ka)}function ht(t,e){if(null===e){if(this.Mb)throw new K(`null is not a valid ${this.name}`);if(this.Gb){var r=this.Ec();return null!==t&&t.push(this.qb,r),r}return 0}if(!e||!e.za)throw new K(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.za.La)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Fb&&e.za.Na.Fb)throw new K(`Cannot convert argument of type ${e.za.cb?e.za.cb.name:e.za.Na.name} to parameter type ${this.name}`);if(r=lt(e.za.La,e.za.Na.Ka,this.Ka),this.Gb){if(void 0===e.za.Za)throw new K("Passing raw pointer to smart pointer is illegal");switch(this.Gc){case 0:if(e.za.cb!==this)throw new K(`Cannot convert argument of type ${e.za.cb?e.za.cb.name:e.za.Na.name} to parameter type ${this.name}`);r=e.za.Za;break;case 1:r=e.za.Za;break;case 2:if(e.za.cb===this)r=e.za.Za;else{var n=e.clone();r=this.Fc(r,Rt(()=>n.delete())),null!==t&&t.push(this.qb,r)}break;default:throw new K("Unsupporting sharing policy")}}return r}function dt(t,e){if(null===e){if(this.Mb)throw new K(`null is not a valid ${this.name}`);return 0}if(!e.za)throw new K(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.za.La)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.za.Na.Fb)throw new K(`Cannot convert argument of type ${e.za.Na.name} to parameter type ${this.name}`);return lt(e.za.La,e.za.Na.Ka,this.Ka)}function ft(t){return this.$a(_[t>>2])}var pt=(t,e,r)=>e===r?t:void 0===r.ab||null===(t=pt(t,e,r.ab))?null:r.qc(t),mt={},bt=class extends Error{constructor(t){super(t),this.name="InternalError"}},vt=(t,e)=>{if(!e.Na||!e.La)throw new bt("makeClassHandle requires ptr and ptrType");if(!!e.cb!=!!e.Za)throw new bt("Both smartPtrType and smartPtr must be specified");return e.count={value:1},et(Object.create(t,{za:{value:e,writable:!0}}))};function wt(t,e,r,n,a,i,o,s,l,u,c){this.name=t,this.Ka=e,this.Mb=r,this.Fb=n,this.Gb=a,this.Cc=i,this.Gc=o,this.fc=s,this.Ec=l,this.Fc=u,this.qb=c,a||void 0!==e.ab?this.eb=ht:(this.eb=n?ct:dt,this.fb=null)}var gt=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new bt("Replacing nonexistent public symbol");void 0!==r[t].Ya&&void 0!==n?r[t].Ya[n]=e:(r[t]=e,r[t].yb=n)},$t=(t,e)=>{t=G(t);var r=sn.get(e);if("function"!=typeof r)throw new K(`unknown function pointer with signature ${t}: ${e}`);return r};class _t extends Error{}var At=t=>{t=Fr(t);var e=G(t);return Lr(t),e},xt=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||W[e]||(q[e]?q[e].forEach(t):(r.push(e),n[e]=!0))}),new _t(`${t}: `+r.map(At).join([", "]))},St=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new bt("Mismatched type converter count");for(var n=0;n<t.length;++n)Y(t[n],e[n])}t.forEach(t=>q[t]=e);var a=Array(e.length),i=[],o=0;for(let[t,r]of e.entries())W.hasOwnProperty(r)?a[t]=W[r]:(i.push(r),H.hasOwnProperty(r)||(H[r]=[]),H[r].push(()=>{a[t]=W[r],++o===i.length&&n(a)}));0===i.length&&n(a)},Ct=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+4*n>>2]);return r},Et=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function kt(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].fb)return!0;return!1}function Tt(t,e,r,n,a,i){var o=e.length;if(2>o)throw new K("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==e[1]&&null!==r,l=kt(e);r=!e[0].dc;var u=e[0],c=e[1];for(n=[t,Z,n,a,Et,u.$a.bind(u),c?.eb.bind(c)],a=2;a<o;++a)n.push((u=e[a]).eb.bind(u));if(!l)for(a=s?1:2;a<e.length;++a)null!==e[a].fb&&n.push(e[a].fb);for(l=kt(e),a=e.length-2,c=[],u=["fn"],s&&u.push("thisWired"),o=0;o<a;++o)c.push(`arg${o}`),u.push(`arg${o}Wired`);c=c.join(","),u=u.join(","),c=`return function (${c}) {\n`,l&&(c+="var destructors = [];\n");var h=l?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(c+=`var thisWired = toClassParamWire(${h}, this);\n`),o=0;o<a;++o){var f=`toArg${o}Wire`;c+=`var arg${o}Wired = ${f}(${h}, arg${o});\n`,d.push(f)}if(c+=(r||i?"var rv = ":"")+`invoker(${u});\n`,l)c+="runDestructors(destructors);\n";else for(o=s?1:2;o<e.length;++o)i=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==e[o].fb&&(c+=`${i}_dtor(${i});\n`,d.push(`${i}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,c+"}\n")(...n),nt(t,e)}var Ot=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},zt=[],Pt=[0,1,,1,null,1,!0,1,!1,1],Bt=t=>{9<t&&0===--Pt[t+1]&&(Pt[t]=void 0,zt.push(t))},Dt=t=>{if(!t)throw new K(`Cannot use deleted val. handle = ${t}`);return Pt[t]},Rt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=zt.pop()||Pt.length;return Pt[e]=t,Pt[e+1]=1,e}},Mt={name:"emscripten::val",$a:t=>{var e=Dt(t);return Bt(t),e},eb:(t,e)=>Rt(e),nb:ft,fb:null},Ut=(t,e)=>{switch(e){case 4:return function(t){return this.$a(A[t>>2])};case 8:return function(t){return this.$a(x[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Ft=(t,e,r,n)=>{if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<t.length;++i){var o=t.codePointAt(i);if(127>=o){if(r>=n)break;e[r++]=o}else if(2047>=o){if(r+1>=n)break;e[r++]=192|o>>6,e[r++]=128|63&o}else if(65535>=o){if(r+2>=n)break;e[r++]=224|o>>12,e[r++]=128|o>>6&63,e[r++]=128|63&o}else{if(r+3>=n)break;e[r++]=240|o>>18,e[r++]=128|o>>12&63,e[r++]=128|o>>6&63,e[r++]=128|63&o,i++}}return e[r]=0,r-a},Lt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},Nt=new TextDecoder("utf-16le"),jt=(t,e,r)=>Nt.decode(g.subarray(t>>=1,V(g,t,e/2,r))),Vt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var a=0;a<r;++a)w[e>>1]=t.charCodeAt(a),e+=2;return w[e>>1]=0,e-n},It=t=>2*t.length,Gt=(t,e,r)=>{var n="";t>>=2;for(var a=0;!(a>=e/4);a++){var i=_[t+a];if(!i&&!r)break;n+=String.fromCodePoint(i)}return n},Ht=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var a=0;a<t.length;++a){var i=t.codePointAt(a);if(65535<i&&a++,$[e>>2]=i,(e+=4)+4>r)break}return $[e>>2]=0,e-n},Wt=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},qt=0,Kt=[],Zt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(_[e>>2]=Rt(n)),t},Yt={},Xt=t=>{var e=Yt[t];return void 0===e?G(t):e},Jt={},Qt=t=>{p=t,N||0<qt||(r.onExit?.(t),O=!0),u(t,new R(t))},te=t=>{if(!O)try{if(t(),!(N||0<qt))try{p=t=p,Qt(t)}catch(t){t instanceof R||"unwind"==t||u(1,t)}}catch(t){t instanceof R||"unwind"==t||u(1,t)}},ee=t=>{var e=Lt(t)+1,r=nn(e);return Ft(t,y,r,e),r},re=[],ne=[],ae=t=>{if(t)return re[t>>>0]},ie=t=>I(_[t>>2],_[t+4>>2]),oe=t=>{var e=_[t>>2];return t=_[t+4>>2],e?I(e,t):0===t?"":void 0},se=t=>({width:_[t>>2],height:_[t+4>>2],depthOrArrayLayers:_[t+8>>2]}),le=t=>{var e=t+8;return{texture:ae(_[t>>2]),mipLevel:_[t+4>>2],origin:{x:_[e>>2],y:_[e+4>>2],z:_[e+8>>2]},aspect:Pe[_[t+20>>2]]}},ue=(t,e)=>{if(t){for(var r={},n=0;n<t;++n){var a=e+24*n;r[ie(a+4)]=x[a+16>>3]}return r}},ce=t=>t?ae(t):"auto",he=[,"clamp-to-edge","repeat","mirror-repeat"],de=[,"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","src1","one-minus-src1","src1alpha","one-minus-src1alpha"],fe=[,"add","subtract","reverse-subtract","min","max"],pe=["binding-not-used",,"uniform","storage","read-only-storage"],me=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],be=[,"opaque","premultiplied","unpremultiplied","inherit"],ve=[,"none","front","back"],ye=[,"compatibility","core"],we={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},ge=[,"nearest","linear"],$e=[,"ccw","cw"],_e=[,"uint16","uint32"],Ae=[,"load","clear"],xe=[,"nearest","linear"],Se=[,"low-power","high-performance"],Ce=[,"srgb","display-p3"],Ee=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],ke=["binding-not-used",,"filtering","non-filtering","comparison"],Te=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],Oe=["binding-not-used",,"write-only","read-only","read-write"],ze=[,"store","discard"],Pe=[,"all","stencil-only","depth-only"],Be=[,"1d","2d","3d"],De=[,"r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16unorm","rgba16snorm","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"],Re=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Me=[,"1d","2d","2d-array","cube","cube-array","3d"],Ue=[,"standard","extended"],Fe=[,"uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],Le=[,"vertex","instance"],Ne={undefined:1,unknown:1,destroyed:2},je=t=>-9007199254740992>t||9007199254740992<t?NaN:Number(t),Ve=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var a=t[n];"."===a?t.splice(n,1):".."===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},Ie=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=Ve(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},Ge=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},He=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],We=t=>{(We=(()=>{if(i){var t=o("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},qe=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:Rr.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=Ve(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},Ke=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=qe(t).slice(1),e=qe(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),a=n,i=0;i<n;i++)if(t[i]!==e[i]){a=i;break}for(n=[],i=a;i<t.length;i++)n.push("..");return(n=n.concat(e.slice(a))).join("/")},Ze=t=>{var e=V(t,0);return j.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},Ye=[],Xe=t=>{var e=Array(Lt(t)+1);return t=Ft(t,e,0,e.length),e.length=t,e},Je=[];function Qe(t,e){Je[t]={input:[],output:[],xb:e},dr(t,tr)}var tr={open(t){var e=Je[t.node.rdev];if(!e)throw new Rr.ya(43);t.tty=e,t.seekable=!1},close(t){t.tty.xb.fsync(t.tty)},fsync(t){t.tty.xb.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.xb.ac)throw new Rr.ya(60);for(var a=0,i=0;i<n;i++){try{var o=t.tty.xb.ac(t.tty)}catch(t){throw new Rr.ya(29)}if(void 0===o&&0===a)throw new Rr.ya(6);if(null==o)break;a++,e[r+i]=o}return a&&(t.node.atime=Date.now()),a},write(t,e,r,n){if(!t.tty||!t.tty.xb.Qb)throw new Rr.ya(60);try{for(var a=0;a<n;a++)t.tty.xb.Qb(t.tty,e[r+a])}catch(t){throw new Rr.ya(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),a}},er={ac(){t:{if(!Ye.length){var t=null;if(i){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=d.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}Ye=Xe(t)}t=Ye.shift()}return t},Qb(t,e){null===e||10===e?(k(Ze(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(k(Ze(t.output)),t.output=[])},ad:()=>({Oc:25856,Qc:5,Nc:191,Pc:35387,Mc:[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]}),bd:()=>0,cd:()=>[24,80]},rr={Qb(t,e){null===e||10===e?(T(Ze(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(T(Ze(t.output)),t.output=[])}},nr={kb:null,Ma:()=>nr.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||Rr.isFIFO(r))throw new Rr.ya(63);return nr.kb||(nr.kb={dir:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb,lookup:nr.Ba.lookup,lb:nr.Ba.lb,rename:nr.Ba.rename,unlink:nr.Ba.unlink,rmdir:nr.Ba.rmdir,readdir:nr.Ba.readdir,symlink:nr.Ba.symlink},stream:{bb:nr.Ca.bb}},file:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb},stream:{bb:nr.Ca.bb,read:nr.Ca.read,write:nr.Ca.write,wb:nr.Ca.wb,Bb:nr.Ca.Bb}},link:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb,readlink:nr.Ba.readlink},stream:{}},Wb:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb},stream:Rr.oc}}),fr((r=Rr.createNode(t,e,r,n)).mode)?(r.Ba=nr.kb.dir.node,r.Ca=nr.kb.dir.stream,r.Da={}):Rr.isFile(r.mode)?(r.Ba=nr.kb.file.node,r.Ca=nr.kb.file.stream,r.Oa=0,r.Da=null):40960==(61440&r.mode)?(r.Ba=nr.kb.link.node,r.Ca=nr.kb.link.stream):8192==(61440&r.mode)&&(r.Ba=nr.kb.Wb.node,r.Ca=nr.kb.Wb.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.Da[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},$c:t=>t.Da?t.Da.subarray?t.Da.subarray(0,t.Oa):new Uint8Array(t.Da):new Uint8Array(0),Ba:{hb(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=fr(t.mode)?4096:Rr.isFile(t.mode)?t.Oa:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},jb(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.Oa!=(e=e.size)&&(0==e?(t.Da=null,t.Oa=0):(r=t.Da,t.Da=new Uint8Array(e),r&&t.Da.set(r.subarray(0,Math.min(e,t.Oa))),t.Oa=e))},lookup(){throw nr.Jb||(nr.Jb=new Rr.ya(44),nr.Jb.stack="<generic error, no stack>"),nr.Jb},lb:(t,e,r,n)=>nr.createNode(t,e,r,n),rename(t,e,r){try{var n=pr(e,r)}catch(t){}if(n){if(fr(t.mode))for(var a in n.Da)throw new Rr.ya(55);mr(n)}delete t.parent.Da[t.name],e.Da[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.Da[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=pr(t,e);for(r in n.Da)throw new Rr.ya(55);delete t.Da[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.Da)],symlink:(t,e,r)=>((t=nr.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new Rr.ya(28);return t.link}},Ca:{read(t,e,r,n,a){var i=t.node.Da;if(a>=t.node.Oa)return 0;if(8<(t=Math.min(t.node.Oa-a,n))&&i.subarray)e.set(i.subarray(a,a+t),r);else for(n=0;n<t;n++)e[r+n]=i[a+n];return t},write(t,e,r,n,a,i){if(e.buffer===v.buffer&&(i=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.Da||t.Da.subarray)){if(i)return t.Da=e.subarray(r,r+n),t.Oa=n;if(0===t.Oa&&0===a)return t.Da=e.slice(r,r+n),t.Oa=n;if(a+n<=t.Oa)return t.Da.set(e.subarray(r,r+n),a),n}var o=t.Da?t.Da.length:0;if(o>=(i=a+n)||(i=Math.max(i,o*(1048576>o?2:1.125)>>>0),0!=o&&(i=Math.max(i,256)),o=t.Da,t.Da=new Uint8Array(i),0<t.Oa&&t.Da.set(o.subarray(0,t.Oa),0)),t.Da.subarray&&e.subarray)t.Da.set(e.subarray(r,r+n),a);else for(i=0;i<n;i++)t.Da[a+i]=e[r+i];return t.Oa=Math.max(t.Oa,a+n),n},bb(t,e,r){if(1===r?e+=t.position:2===r&&Rr.isFile(t.node.mode)&&(e+=t.node.Oa),0>e)throw new Rr.ya(28);return e},wb(t,e,r,n,a){if(!Rr.isFile(t.node.mode))throw new Rr.ya(43);if(t=t.node.Da,2&a||!t||t.buffer!==v.buffer){if(n=!0,D(),!(a=void 0))throw new Rr.ya(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),v.set(t,a))}else n=!1,a=t.byteOffset;return{La:a,Ic:n}},Bb:(t,e,r,n)=>(nr.Ca.write(t,e,0,n,r,!1),0)}},ar=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},ir=0,or=null,sr=()=>{if(ir--,r.monitorRunDependencies?.(ir),0==ir&&or){var t=or;or=null,t()}},lr=()=>{ir++,r.monitorRunDependencies?.(ir)},ur=[],cr=async(t,e,r,n,a,i,o,l)=>{var u=e?qe(Ie(t+"/"+e)):t;lr();try{var c=r;"string"==typeof r&&(c=await(async t=>(t=await s(t),new Uint8Array(t)))(r)),c=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&hr(),ur))if(r.canHandle(e))return r.handle(t,e);return t})(c,u),l?.(),i||br(t,e,c,n,a,o)}finally{sr()}};function hr(){var t,e,n;Rr.Lb=!0,t??=r.stdin,e??=r.stdout,n??=r.stderr,t?Rr.pb("/dev","stdin",t):Rr.symlink("/dev/tty","/dev/stdin"),e?Rr.pb("/dev","stdout",null,e):Rr.symlink("/dev/tty","/dev/stdout"),n?Rr.pb("/dev","stderr",null,n):Rr.symlink("/dev/tty1","/dev/stderr"),Rr.open("/dev/stdin",0),Rr.open("/dev/stdout",1),Rr.open("/dev/stderr",1)}function dr(t,e){Rr.Zb[t]={Ca:e}}function fr(t){return 16384==(61440&t)}function pr(t,e){var r=fr(t.mode)?(r=_r(t,"x"))?r:t.Ba.lookup?0:2:54;if(r)throw new Rr.ya(r);for(r=Rr.mb[wr(t.id,e)];r;r=r.ub)if(r.parent.id===t.id&&r.name===e)return r;return Rr.lookup(t,e)}function mr(t){var e=wr(t.parent.id,t.name);if(Rr.mb[e]===t)Rr.mb[e]=t.ub;else for(e=Rr.mb[e];e;){if(e.ub===t){e.ub=t.ub;break}e=e.ub}}function br(t,e,r,n,a,i){var o=e;if(t&&(t="string"==typeof t?t:yr(t),o=e?Ie(t+"/"+e):t),t=ar(n,a),o=Rr.create(o,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,a=r.length;n<a;++n)e[n]=r.charCodeAt(n);r=e}Rr.chmod(o,146|t),e=Rr.open(o,577),Rr.write(e,r,0,r.length,0,i),Rr.close(e),Rr.chmod(o,t)}}function vr(t,e={}){if(!t)throw new Rr.ya(44);e.Eb??(e.Eb=!0),"/"===t.charAt(0)||(t=Rr.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=Rr.root,a="/",i=0;i<t.length;i++){var o=i===t.length-1;if(o&&e.parent)break;if("."!==t[i])if(".."===t[i]){if(a=Ge(a),Rr.Nb(n)){t=a+"/"+t.slice(i+1).join("/"),r--;continue t}n=n.parent}else{a=Ie(a+"/"+t[i]);try{n=pr(n,t[i])}catch(t){if(44===t?.sb&&o&&e.Ac)return{path:a};throw t}if(!n.ib||o&&!e.Eb||(n=n.ib.root),40960==(61440&n.mode)&&(!o||e.gb)){if(!n.Ba.readlink)throw new Rr.ya(52);"/"===(n=n.Ba.readlink(n)).charAt(0)||(n=Ge(a)+"/"+n),t=n+"/"+t.slice(i+1).join("/");continue t}}}return{path:a,node:n}}throw new Rr.ya(32)}function yr(t){for(var e;;){if(Rr.Nb(t))return t=t.Ma.ec,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function wr(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%Rr.mb.length}function gr(t){var e=wr(t.parent.id,t.name);t.ub=Rr.mb[e],Rr.mb[e]=t}function $r(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function _r(t,e){return Rr.bc?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function Ar(t,e){if(!fr(t.mode))return 54;try{return pr(t,e),20}catch(t){}return _r(t,"wx")}function xr(t,e,r){try{var n=pr(t,e)}catch(t){return t.sb}if(t=_r(t,"wx"))return t;if(r){if(!fr(n.mode))return 54;if(Rr.Nb(n)||yr(n)===Rr.cwd())return 10}else if(fr(n.mode))return 31;return 0}function Sr(t,e){if(!t)throw new Rr.ya(e);return t}function Cr(t){if(!(t=Rr.wc(t)))throw new Rr.ya(8);return t}function Er(t,e=-1){if(t=Object.assign(new Rr.lc,t),-1==e)t:{for(e=0;e<=Rr.nc;e++)if(!Rr.streams[e])break t;throw new Rr.ya(33)}return t.fd=e,Rr.streams[e]=t}function kr(t,e,r){var n=t?.Ca.jb;t=n?t:e,n??=e.Ba.jb,Sr(n,63),n(t,r)}function Tr(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.Ab)}return e}function Or(t){var e={Lc:4096,Xc:4096,blocks:1e6,Kc:5e5,Jc:5e5,files:Rr.Pb,Vc:Rr.Pb-1,Yc:42,flags:2,gd:255};return t.Ba.ic&&Object.assign(e,t.Ba.ic(t.Ma.Bc.root)),e}function zr(t,e,r){return void 0===r&&(r=e,e=438),Rr.lb(t,8192|e,r)}function Pr(t,e,r,n){kr(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),$b:n})}function Br(t,e,r){if(fr(e.mode))throw new Rr.ya(31);if(!Rr.isFile(e.mode))throw new Rr.ya(28);var n=_r(e,"w");if(n)throw new Rr.ya(n);kr(t,e,{size:r,timestamp:Date.now()})}function Dr(t){if(!(t.yc||t.zc||t.link||t.Da))if(globalThis.XMLHttpRequest)D("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{t.Da=l(t.url)}catch(t){throw new Rr.ya(29)}}var Rr={root:null,Ab:[],Zb:{},streams:[],Pb:1,mb:null,Xb:"/",Lb:!1,bc:!0,sc:null,Hb:0,hc:{},ya:class{name="ErrnoError";constructor(t){this.sb=t}},lc:class{ob={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.ob.flags}set flags(t){this.ob.flags=t}get position(){return this.ob.position}set position(t){this.ob.position=t}},kc:class{Ba={};Ca={};ib=null;constructor(t,e,r,n){t||=this,this.parent=t,this.Ma=t.Ma,this.id=Rr.Pb++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get zc(){return fr(this.mode)}get yc(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>(gr(t=new Rr.kc(t,e,r,n)),t),Nb:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),nc:4096,wc:t=>Rr.streams[t],Uc:(t,e=-1)=>(t=Er(t,e),t.Ca?.Tc?.(t),t),oc:{open(t){t.Ca=Rr.uc(t.node.rdev).Ca,t.Ca.open?.(t)},bb(){throw new Rr.ya(70)}},Ob:t=>t>>8,dd:t=>255&t,tb:(t,e)=>t<<8|e,uc:t=>Rr.Zb[t],jc(t,e){function r(t){return Rr.Hb--,e(t)}function n(t){if(t){if(!n.rc)return n.rc=!0,r(t)}else++o>=i.length&&r(null)}"function"==typeof t&&(e=t,t=!1),Rr.Hb++,1<Rr.Hb&&T(`warning: ${Rr.Hb} FS.syncfs operations in flight at once, probably just doing extra work`);var a,i=Tr(Rr.root.Ma),o=0;for(a of i)a.type.jc?a.type.jc(a,t,n):n(null)},Ma(t,e,r){var n="/"===r;if(n&&Rr.root)throw new Rr.ya(10);if(!n&&r){var a=vr(r,{Eb:!1});if(r=a.path,(a=a.node).ib)throw new Rr.ya(10);if(!fr(a.mode))throw new Rr.ya(54)}return(t=t.Ma(e={type:t,Bc:e,ec:r,Ab:[]})).Ma=e,e.root=t,n?Rr.root=t:a&&(a.ib=e,a.Ma&&a.Ma.Ab.push(e)),t},od(t){if(!(t=vr(t,{Eb:!1})).node.ib)throw new Rr.ya(28);var e=(t=t.node).ib,r=Tr(e);for([,a]of Object.entries(Rr.mb))for(;a;){var n=a.ub;r.includes(a.Ma)&&mr(a);var a=n}t.ib=null,t.Ma.Ab.splice(t.Ma.Ab.indexOf(e),1)},lookup:(t,e)=>t.Ba.lookup(t,e),lb(t,e,r){var n=vr(t,{parent:!0}).node;if(!(t=He(t)))throw new Rr.ya(28);if("."===t||".."===t)throw new Rr.ya(20);var a=Ar(n,t);if(a)throw new Rr.ya(a);if(!n.Ba.lb)throw new Rr.ya(63);return n.Ba.lb(n,t,e,r)},ic:t=>Or(vr(t,{gb:!0}).node),kd:t=>Or(t.node),create:(t,e=438)=>Rr.lb(t,4095&e|32768,0),mkdir:(t,e=511)=>Rr.lb(t,1023&e|16384,0),ed(t,e){var r,n=t.split("/"),a="";for(r of n)if(r){(a||"/"===t.charAt(0))&&(a+="/"),a+=r;try{Rr.mkdir(a,e)}catch(t){if(20!=t.sb)throw t}}},symlink(t,e){if(!qe(t))throw new Rr.ya(44);var r=vr(e,{parent:!0}).node;if(!r)throw new Rr.ya(44);var n=Ar(r,e=He(e));if(n)throw new Rr.ya(n);if(!r.Ba.symlink)throw new Rr.ya(63);return r.Ba.symlink(r,e,t)},rename(t,e){var r=Ge(t),n=Ge(e),a=He(t),i=He(e),o=vr(t,{parent:!0}),s=o.node;if(o=(o=vr(e,{parent:!0})).node,!s||!o)throw new Rr.ya(44);if(s.Ma!==o.Ma)throw new Rr.ya(75);var l=pr(s,a);if("."!==(t=Ke(t,n)).charAt(0))throw new Rr.ya(28);if("."!==(t=Ke(e,r)).charAt(0))throw new Rr.ya(55);try{var u=pr(o,i)}catch(t){}if(l!==u){if(a=xr(s,a,e=fr(l.mode)))throw new Rr.ya(a);if(a=u?xr(o,i,e):Ar(o,i))throw new Rr.ya(a);if(!s.Ba.rename)throw new Rr.ya(63);if(l.ib||u&&u.ib)throw new Rr.ya(10);if(o!==s&&(a=_r(s,"w")))throw new Rr.ya(a);mr(l);try{s.Ba.rename(l,o,i),l.parent=o}catch(t){throw t}finally{gr(l)}}},rmdir(t){var e=vr(t,{parent:!0}).node,r=pr(e,t=He(t)),n=xr(e,t,!0);if(n)throw new Rr.ya(n);if(!e.Ba.rmdir)throw new Rr.ya(63);if(r.ib)throw new Rr.ya(10);e.Ba.rmdir(e,t),mr(r)},readdir:t=>Sr((t=vr(t,{gb:!0}).node).Ba.readdir,54)(t),unlink(t){var e=vr(t,{parent:!0}).node;if(!e)throw new Rr.ya(44);var r=pr(e,t=He(t)),n=xr(e,t,!1);if(n)throw new Rr.ya(n);if(!e.Ba.unlink)throw new Rr.ya(63);if(r.ib)throw new Rr.ya(10);e.Ba.unlink(e,t),mr(r)},readlink(t){if(!(t=vr(t).node))throw new Rr.ya(44);if(!t.Ba.readlink)throw new Rr.ya(28);return t.Ba.readlink(t)},stat:(t,e)=>Sr((t=vr(t,{gb:!e}).node).Ba.hb,63)(t),fstat(t){var e=Cr(t);t=e.node;var r=e.Ca.hb;return e=r?e:t,r??=t.Ba.hb,Sr(r,63),r(e)},lstat:t=>Rr.stat(t,!0),chmod(t,e,r){Pr(null,t="string"==typeof t?vr(t,{gb:!r}).node:t,e,r)},lchmod(t,e){Rr.chmod(t,e,!0)},fchmod(t,e){Pr(t=Cr(t),t.node,e,!1)},chown(t,e,r,n){kr(null,t="string"==typeof t?vr(t,{gb:!n}).node:t,{timestamp:Date.now(),$b:n})},lchown(t,e,r){Rr.chown(t,e,r,!0)},fchown(t){kr(t=Cr(t),t.node,{timestamp:Date.now(),$b:!1})},truncate(t,e){if(0>e)throw new Rr.ya(28);Br(null,t="string"==typeof t?vr(t,{gb:!0}).node:t,e)},Zc(t,e){if(t=Cr(t),0>e||!(2097155&t.flags))throw new Rr.ya(28);Br(t,t.node,e)},pd(t,e,r){Sr((t=vr(t,{gb:!0}).node).Ba.jb,63)(t,{atime:e,mtime:r})},open(t,e,n=438){if(""===t)throw new Rr.ya(44);if("string"==typeof e){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===a)throw Error(`Unknown file open mode: ${e}`);e=a}if(n=64&e?4095&n|32768:0,"object"==typeof t)a=t;else{var i=t.endsWith("/");a=(t=vr(t,{gb:!(131072&e),Ac:!0})).node,t=t.path}var o=!1;if(64&e)if(a){if(128&e)throw new Rr.ya(20)}else{if(i)throw new Rr.ya(31);a=Rr.lb(t,511|n,0),o=!0}if(!a)throw new Rr.ya(44);if(8192==(61440&a.mode)&&(e&=-513),65536&e&&!fr(a.mode))throw new Rr.ya(54);if(!o&&(i=a?40960==(61440&a.mode)?32:fr(a.mode)&&("r"!==$r(e)||576&e)?31:_r(a,$r(e)):44))throw new Rr.ya(i);return 512&e&&!o&&Rr.truncate(a,0),e&=-131713,(i=Er({node:a,path:yr(a),flags:e,seekable:!0,position:0,Ca:a.Ca,Hc:[],error:!1})).Ca.open&&i.Ca.open(i),o&&Rr.chmod(a,511&n),!r.logReadFiles||1&e||t in Rr.hc||(Rr.hc[t]=1),i},close(t){if(null===t.fd)throw new Rr.ya(8);t.Kb&&(t.Kb=null);try{t.Ca.close&&t.Ca.close(t)}catch(t){throw t}finally{Rr.streams[t.fd]=null}t.fd=null},bb(t,e,r){if(null===t.fd)throw new Rr.ya(8);if(!t.seekable||!t.Ca.bb)throw new Rr.ya(70);if(0!=r&&1!=r&&2!=r)throw new Rr.ya(28);return t.position=t.Ca.bb(t,e,r),t.Hc=[],t.position},read(t,e,r,n,a){if(0>n||0>a)throw new Rr.ya(28);if(null===t.fd)throw new Rr.ya(8);if(1==(2097155&t.flags))throw new Rr.ya(8);if(fr(t.node.mode))throw new Rr.ya(31);if(!t.Ca.read)throw new Rr.ya(28);var i=void 0!==a;if(i){if(!t.seekable)throw new Rr.ya(70)}else a=t.position;return e=t.Ca.read(t,e,r,n,a),i||(t.position+=e),e},write(t,e,r,n,a,i){if(0>n||0>a)throw new Rr.ya(28);if(null===t.fd)throw new Rr.ya(8);if(!(2097155&t.flags))throw new Rr.ya(8);if(fr(t.node.mode))throw new Rr.ya(31);if(!t.Ca.write)throw new Rr.ya(28);t.seekable&&1024&t.flags&&Rr.bb(t,0,2);var o=void 0!==a;if(o){if(!t.seekable)throw new Rr.ya(70)}else a=t.position;return e=t.Ca.write(t,e,r,n,a,i),o||(t.position+=e),e},wb(t,e,r,n,a){if(2&n&&!(2&a)&&2!=(2097155&t.flags))throw new Rr.ya(2);if(1==(2097155&t.flags))throw new Rr.ya(2);if(!t.Ca.wb)throw new Rr.ya(43);if(!e)throw new Rr.ya(28);return t.Ca.wb(t,e,r,n,a)},Bb:(t,e,r,n,a)=>t.Ca.Bb?t.Ca.Bb(t,e,r,n,a):0,cc(t,e,r){if(!t.Ca.cc)throw new Rr.ya(59);return t.Ca.cc(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding&&D(`Invalid encoding type "${e.encoding}"`);var r=Rr.open(t,e.flags);t=Rr.stat(t).size;var n=new Uint8Array(t);return Rr.read(r,n,0,t,0),"utf8"===e.encoding&&(n=Ze(n)),Rr.close(r),n},writeFile(t,e,r={}){r.flags=r.flags||577,t=Rr.open(t,r.flags,r.mode),"string"==typeof e&&(e=new Uint8Array(Xe(e))),ArrayBuffer.isView(e)?Rr.write(t,e,0,e.byteLength,void 0,r.Rc):D("Unsupported data type"),Rr.close(t)},cwd:()=>Rr.Xb,chdir(t){if(null===(t=vr(t,{gb:!0})).node)throw new Rr.ya(44);if(!fr(t.node.mode))throw new Rr.ya(54);var e=_r(t.node,"x");if(e)throw new Rr.ya(e);Rr.Xb=t.path},jd(){for(var t of(Rr.Lb=!1,Rr.streams))t&&Rr.close(t)},Wc(t,e){try{var r=vr(t,{gb:!e});t=r.path}catch(t){}var n=!1,a=null;try{r=vr(t,{parent:!0}),He(t),r=vr(t,{gb:!e}),n=!0,a=r.node}catch(t){}return n?a:null},pb(t,e,r,n){var a;return t=((t,e)=>Ie(t+"/"+e))("string"==typeof t?t:yr(t),e),e=ar(!!r,!!n),(a=Rr.pb).Ob??(a.Ob=64),dr(a=Rr.tb(Rr.pb.Ob++,0),{open(t){t.seekable=!1},close(){n?.buffer?.length&&n(10)},read(t,e,n,a){for(var i=0,o=0;o<a;o++){try{var s=r()}catch(t){throw new Rr.ya(29)}if(void 0===s&&0===i)throw new Rr.ya(6);if(null==s)break;i++,e[n+o]=s}return i&&(t.node.atime=Date.now()),i},write(t,e,r,a){for(var i=0;i<a;i++)try{n(e[r+i])}catch(t){throw new Rr.ya(29)}return a&&(t.node.mtime=t.node.ctime=Date.now()),i}}),zr(t,e,a)}},Mr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];if((()=>{let t=rt.prototype;Object.assign(t,{isAliasOf:function(t){if(!(this instanceof rt&&t instanceof rt))return!1;var e=this.za.Na.Ka,r=this.za.La;t.za=t.za;var n=t.za.Na.Ka;for(t=t.za.La;e.ab;)r=e.Db(r),e=e.ab;for(;n.ab;)t=n.Db(t),n=n.ab;return e===n&&r===t},clone:function(){if(this.za.La||J(this),this.za.Cb)return this.za.count.value+=1,this;var t=et,e=Object,r=e.create,n=Object.getPrototypeOf(this),a=this.za;return(t=t(r.call(e,n,{za:{value:{count:a.count,zb:a.zb,Cb:a.Cb,La:a.La,Na:a.Na,Za:a.Za,cb:a.cb}}}))).za.count.value+=1,t.za.zb=!1,t},delete(){if(this.za.La||J(this),this.za.zb&&!this.za.Cb)throw new K("Object already scheduled for deletion");tt(this);var t=this.za;--t.count.value,0===t.count.value&&(t.Za?t.cb.qb(t.Za):t.Na.Ka.qb(t.La)),this.za.Cb||(this.za.Za=void 0,this.za.La=void 0)},isDeleted:function(){return!this.za.La},deleteLater:function(){if(this.za.La||J(this),this.za.zb&&!this.za.Cb)throw new K("Object already scheduled for deletion");return this.za.zb=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)})(),Object.assign(wt.prototype,{vc(t){return this.fc&&(t=this.fc(t)),t},Yb(t){this.qb?.(t)},nb:ft,$a:function(t){function e(){return vt(this.Ka.vb,this.Gb?{Na:this.Cc,La:r,cb:this,Za:t}:{Na:this,La:t})}var r=this.vc(t);if(!r)return this.Yb(t),null;var n=((t,e)=>{if(void 0===e)throw new K("ptr should not be undefined");for(;t.ab;)e=t.Db(e),t=t.ab;return mt[e]})(this.Ka,r);if(void 0!==n)return 0===n.za.count.value?(n.za.La=r,n.za.Za=t,n.clone()):(n=n.clone(),this.Yb(t),n);if(n=this.Ka.tc(r),!(n=at[n]))return e.call(this);var a=pt(r,this.Ka,(n=this.Fb?n.pc:n.pointerType).Ka);return null===a?e.call(this):vt(n.Ka.vb,this.Gb?{Na:n,La:a,cb:this,Za:t}:{Na:n,La:a})}}),Rr.Sc=(t,e,r,n,a,i,o,s,l,u)=>{cr(t,e,r,n,a,s,l,u).then(i).catch(o)},Rr.hd=cr,Rr.mb=Array(4096),Rr.Ma(nr,{},"/"),Rr.mkdir("/tmp"),Rr.mkdir("/home"),Rr.mkdir("/home/web_user"),function(){Rr.mkdir("/dev"),dr(Rr.tb(1,3),{read:()=>0,write:(t,e,r,n)=>n,bb:()=>0}),zr("/dev/null",Rr.tb(1,3)),Qe(Rr.tb(5,0),er),Qe(Rr.tb(6,0),rr),zr("/dev/tty",Rr.tb(5,0)),zr("/dev/tty1",Rr.tb(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(We(t),e=t.byteLength),t[--e]);Rr.pb("/dev","random",r),Rr.pb("/dev","urandom",r),Rr.mkdir("/dev/shm"),Rr.mkdir("/dev/shm/tmp")}(),function(){Rr.mkdir("/proc");var t=Rr.mkdir("/proc/self");Rr.mkdir("/proc/self/fd"),Rr.Ma({Ma(){var e=Rr.createNode(t,"fd",16895,73);return e.Ca={bb:nr.Ca.bb},e.Ba={lookup(t,e){var r=Cr(t=+e);return(t={parent:null,Ma:{ec:"fake"},Ba:{readlink:()=>r.path},id:t+1}).parent=t},readdir:()=>Array.from(Rr.streams.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},{},"/proc/self/fd")}(),Rr.sc={MEMFS:nr},r.noExitRuntime&&(N=r.noExitRuntime),r.preloadPlugins&&(ur=r.preloadPlugins),r.print&&(k=r.print),r.printErr&&(T=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=lr,r.removeRunDependency=sr,r.FS_preloadFile=cr,r.FS_unlink=(...t)=>Rr.unlink(...t),r.FS_createPath=(...t)=>function(t,e){for(t="string"==typeof t?t:yr(t),e=e.split("/").reverse();e.length;){var r=e.pop();if(r){var n=Ie(t+"/"+r);try{Rr.mkdir(n)}catch(t){if(20!=t.sb)throw t}t=n}}return n}(...t),r.FS_createDevice=(...t)=>Rr.pb(...t),r.FS=Rr,r.FS_createDataFile=(...t)=>br(...t),r.FS_createLazyFile=(...t)=>function(t,e,r,n,i){class o{Ib=!1;ob=[];Rb=void 0;Tb=0;Sb=0;get(t){if(!(t>this.length-1||0>t)){var e=t%this.chunkSize;return this.Rb(t/this.chunkSize|0)[e]}}mc(t){this.Rb=t}Ub(){var t=new XMLHttpRequest;t.open("HEAD",r,!1),t.send(null),200<=t.status&&300>t.status||304===t.status||D("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),a=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e;t=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e;var i=1048576;a||(i=n);var o=this;o.mc(t=>{var e=t*i,a=(t+1)*i-1;if(a=Math.min(a,n-1),void 0===o.ob[t]){var s=o.ob;e>a&&D("invalid range ("+e+", "+a+") or no bytes requested!"),a>n-1&&D("only "+n+" bytes available! programmer error!");var l=new XMLHttpRequest;l.open("GET",r,!1),n!==i&&l.setRequestHeader("Range","bytes="+e+"-"+a),l.responseType="arraybuffer",l.overrideMimeType&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send(null),200<=l.status&&300>l.status||304===l.status||D("Couldn't load "+r+". Status: "+l.status),e=void 0!==l.response?new Uint8Array(l.response||[]):Xe(l.responseText||""),s[t]=e}return void 0===o.ob[t]&&D("doXHR failed!"),o.ob[t]}),!t&&n||(i=n=1,i=n=this.Rb(0).length,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Tb=n,this.Sb=i,this.Ib=!0}get length(){return this.Ib||this.Ub(),this.Tb}get chunkSize(){return this.Ib||this.Ub(),this.Sb}}if(globalThis.XMLHttpRequest){a||D("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new o,l=void 0}else l=r,s=void 0;var u=function(t,e,r,n){return t="string"==typeof t?t:yr(t),e=Ie(t+"/"+e),Rr.create(e,ar(r,n))}(t,e,n,i);s?u.Da=s:l&&(u.Da=null,u.url=l),Object.defineProperties(u,{Oa:{get:function(){return this.Da.length}}}),t={};for(const[e,r]of Object.entries(u.Ca))t[e]=(...t)=>(Dr(u),r(...t));return t.read=(t,e,r,n,a)=>{if(Dr(u),a>=(t=t.node.Da).length)e=0;else{if(n=Math.min(t.length-a,n),t.slice)for(var i=0;i<n;i++)e[r+i]=t[a+i];else for(i=0;i<n;i++)e[r+i]=t.get(a+i);e=n}return e},t.wb=()=>{throw Dr(u),D(),new Rr.ya(48)},u.Ca=t,u}(...t);var Ur,Fr,Lr,Nr,jr,Vr,Ir,Gr,Hr,Wr,qr,Kr,Zr,Yr,Xr,Jr,Qr,tn,en,rn,nn,an,on,sn,ln,un={b:(t,e,r,n)=>D(`Assertion failed: ${I(t)}, at: `+[e?I(e):"unknown filename",r,n?I(n):"unknown function"]),P:()=>D(""),F:(t,e,r,n,a)=>{e=G(e);let i=t=>t;if(n=0n===n){const t=8*r;i=e=>BigInt.asUintN(t,e),a=i(a)}Y(t,{name:e,$a:i,eb:(t,e)=>("number"==typeof e&&(e=BigInt(e)),e),nb:X(e,r,!n),fb:null})},la:(t,e,r,n)=>{Y(t,{name:e=G(e),$a:function(t){return!!t},eb:function(t,e){return e?r:n},nb:function(t){return this.$a(y[t])},fb:null})},ia:(t,e,r,n,a,i,o,s,l,u,c,h,d)=>{c=G(c),i=$t(a,i),s&&=$t(o,s),u&&=$t(l,u),d=$t(h,d);var f=(t=>{var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(c);ot(f,function(){xt(`Cannot construct ${c} due to unbound types`,[n])}),St([t,e,r],n?[n]:[],e=>{if(e=e[0],n)var r=e.Ka,a=r.vb;else a=rt.prototype;e=nt(c,function(...t){if(Object.getPrototypeOf(this)!==o)throw new K(`Use 'new' to construct ${c}`);if(void 0===h.rb)throw new K(`${c} has no accessible constructor`);var e=h.rb[t.length];if(void 0===e)throw new K(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(h.rb).toString()}) parameters instead!`);return e.apply(this,t)});var o=Object.create(a,{constructor:{value:e}});e.prototype=o;var l,h=new st(c,e,o,d,r,i,s,u);return h.ab&&((l=h.ab).Vb??(l.Vb=[]),h.ab.Vb.push(h)),r=new wt(c,h,!0,!1,!1),l=new wt(c+"*",h,!1,!1,!1),a=new wt(c+" const*",h,!1,!0,!1),at[t]={pointerType:l,pc:a},gt(f,e),[r,l,a]})},$:(t,e,r,n,a,i)=>{var o=Ct(e,r);a=$t(n,a),St([],[t],t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.Ka.rb&&(t.Ka.rb=[]),void 0!==t.Ka.rb[e-1])throw new K(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.Ka.rb[e-1]=()=>{xt(`Cannot construct ${t.name} due to unbound types`,o)},St([],o,n=>(n.splice(1,0,null),t.Ka.rb[e-1]=Tt(r,n,null,a,i),[])),[]})},i:(t,e,r,n,a,i,o,s,l)=>{var u=Ct(r,n);e=G(e),e=Ot(e),i=$t(a,i),St([],[t],t=>{function n(){xt(`Cannot call ${a} due to unbound types`,u)}var a=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.Ka.Dc.push(e);var c=t.Ka.vb,h=c[e];return void 0===h||void 0===h.Ya&&h.className!==t.name&&h.yb===r-2?(n.yb=r-2,n.className=t.name,c[e]=n):(it(c,e,a),c[e].Ya[r-2]=n),St([],u,n=>(n=Tt(a,n,t,i,o,l),void 0===c[e].Ya?(n.yb=r-2,c[e]=n):c[e].Ya[r-2]=n,[])),[]})},ja:t=>Y(t,Mt),E:(t,e,r)=>{Y(t,{name:e=G(e),$a:t=>t,eb:(t,e)=>e,nb:Ut(e,r),fb:null})},G:(t,e,r,n,a,i,o)=>{var s=Ct(e,r);t=G(t),t=Ot(t),a=$t(n,a),ot(t,function(){xt(`Cannot call ${t} due to unbound types`,s)},e-1),St([],s,r=>(r=[r[0],null].concat(r.slice(1)),gt(t,Tt(t,r,null,a,i,o),e-1),[]))},k:(t,e,r,n,a)=>{e=G(e);let i=t=>t;if(0===n){var o=32-8*r;i=t=>t<<o>>>o,a=i(a)}Y(t,{name:e,$a:i,eb:(t,e)=>e,nb:X(e,r,0!==n),fb:null})},h:(t,e,r)=>{function n(t){return new a(v.buffer,_[t+4>>2],_[t>>2])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];Y(t,{name:r=G(r),$a:n,nb:n},{xc:!0})},ka:(t,e)=>{Y(t,{name:e=G(e),$a(t){var e=I(t+4,_[t>>2],!0);return Lr(t),e},eb(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;if(!(r||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT))throw new K("Cannot pass non-string to std::string");var n=r?Lt(e):e.length,a=Ur(4+n+1),i=a+4;return _[a>>2]=n,r?Ft(e,y,i,n+1):y.set(e,i),null!==t&&t.push(Lr,a),a},nb:ft,fb(t){Lr(t)}})},w:(t,e,r)=>{if(r=G(r),2===e)var n=jt,a=Vt,i=It;else n=Gt,a=Ht,i=Wt;Y(t,{name:r,$a:t=>{var r=n(t+4,_[t>>2]*e,!0);return Lr(t),r},eb:(t,n)=>{if("string"!=typeof n)throw new K(`Cannot pass non-string to C++ string type ${r}`);var o=i(n),s=Ur(4+o+e);return _[s>>2]=o/e,a(n,s+4,o+e),null!==t&&t.push(Lr,s),s},nb:ft,fb(t){Lr(t)}})},x:t=>{Y(t,Mt)},ma:(t,e)=>{Y(t,{dc:!0,name:e=G(e),$a:()=>{},eb:()=>{}})},J:()=>{N=!1,qt=0},m:(t,e,r)=>{var[n,...a]=((t,e)=>{for(var r=Array(t),n=0;n<t;++n){var a=n,i=_[e+4*n>>2],o=W[i];if(void 0===o)throw t=`parameter ${n} has unknown type ${At(i)}`,new K(t);r[a]=o}return r})(t,e);e=n.eb.bind(n);var i=a.map(t=>t.nb.bind(t));t--;var o={toValue:Dt};switch(t=i.map((t,e)=>{var r=`argFromPtr${e}`;return o[r]=t,`${r}(args${e?"+"+8*e:""})`}),r){case 0:var s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:o.getStringOrSymbol=Xt,s="toValue(handle)[getStringOrSymbol(methodName)]"}return s+=`(${t})`,n.dc||(o.toReturnWire=e,o.emval_returnValue=Zt,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\n ${s}\n }`,r=new Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${a.map(t=>t.name)}) => ${n.name}>`,(t=>{var e=Kt.length;return Kt.push(t),e})(nt(s,r))},ga:Bt,na:t=>t?(t=Xt(t),Rt(globalThis[t])):Rt(globalThis),o:(t,e)=>(t=Dt(t),e=Dt(e),Rt(t[e])),y:t=>{9<t&&(Pt[t+1]+=1)},l:(t,e,r,n,a)=>Kt[t](e,r,n,a),oa:t=>Rt(Xt(t)),H:t=>{var e=Dt(t);Et(e),Bt(t)},K:(t,e)=>{if(Jt[t]&&(clearTimeout(Jt[t].id),delete Jt[t]),!e)return 0;var r=setTimeout(()=>{delete Jt[t],te(()=>en(t,performance.now()))},e);return Jt[t]={id:r,md:e},0},O:t=>{var e=y.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=e*(1+.2/r);n=Math.min(n,t+100663296);t:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(t,n)/65536))-on.buffer.byteLength+65535)/65536|0;try{on.grow(n),B();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},T:function(t,e,r,n,a,i){e=je(e),r=je(r),t=ae(t);var o={};if(i){var s=_[i+12>>2];if(s){var l=_[i+16>>2];o.requiredFeatures=Array.from(_.subarray(l>>2,l+4*s>>2),t=>we[t])}var u=_[i+20>>2];if(u){var c={};function h(t,e,r=!1){4294967295==(e=_[u+e>>2])||r&&0==e||(c[t]=e)}function d(t,e){4294967295==_[(e=u+e)>>2]&&4294967295==_[e+4>>2]||(c[t]=4294967296*_[e+4>>2]+_[e>>2])}h("maxTextureDimension1D",4),h("maxTextureDimension2D",8),h("maxTextureDimension3D",12),h("maxTextureArrayLayers",16),h("maxBindGroups",20),h("maxBindGroupsPlusVertexBuffers",24),h("maxDynamicUniformBuffersPerPipelineLayout",32),h("maxDynamicStorageBuffersPerPipelineLayout",36),h("maxSampledTexturesPerShaderStage",40),h("maxSamplersPerShaderStage",44),h("maxStorageBuffersPerShaderStage",48),h("maxStorageTexturesPerShaderStage",52),h("maxUniformBuffersPerShaderStage",56),h("minUniformBufferOffsetAlignment",80),h("minStorageBufferOffsetAlignment",84),d("maxUniformBufferBindingSize",64),d("maxStorageBufferBindingSize",72),h("maxVertexBuffers",88),d("maxBufferSize",96),h("maxVertexAttributes",104),h("maxVertexBufferArrayStride",108),h("maxInterStageShaderVariables",112),h("maxColorAttachments",116),h("maxColorAttachmentBytesPerSample",120),h("maxComputeWorkgroupStorageSize",124),h("maxComputeInvocationsPerWorkgroup",128),h("maxComputeWorkgroupSizeX",132),h("maxComputeWorkgroupSizeY",136),h("maxComputeWorkgroupSizeZ",140),h("maxComputeWorkgroupsPerDimension",144),h("maxImmediateSize",148,!0),o.requiredLimits=c}(s=_[i+24>>2])&&(s={label:oe(s+4)},o.defaultQueue=s),o.label=oe(i+4)}t.requestDevice(o).then(t=>{te(()=>{re[a>>>0]=t.queue,re[n>>>0]=t,t.lost.then(e=>{te(()=>{t.onuncapturederror=()=>{};var n=an(),a=ee(e.message);Xr(r,Ne[e.reason],a),rn(n)})}),t.onuncapturederror=t=>{var e=5;t.error instanceof GPUValidationError?e=2:t.error instanceof GPUOutOfMemoryError?e=3:t.error instanceof GPUInternalError&&(e=4);var r=an();t=ee(t.error.message),tn(n,e,t),rn(r)},Qr(e,1,n,0)})},t=>{te(()=>{var a=an(),i=ee(t.message);Qr(e,3,n,i),r&&Xr(r,4,i),rn(a)})})},V:t=>{var e=ae(t),r=ne[t];if(r){for(var n=0;n<r.length;++n)r[n]();delete ne[t]}e.destroy()},d:t=>{delete re[t]},S:(t,e,r)=>{var n=!!_[e+32>>2];e={label:oe(e+4),usage:_[e+16>>2],size:4294967296*_[e+4+24>>2]+_[e+24>>2],mappedAtCreation:n},t=ae(t);try{var a=t.createBuffer(e)}catch(t){return!1}return re[r>>>0]=a,n&&(ne[r]=[]),!0},R:(t,e,r)=>{var n=_[e>>2],a=_[n+4>>2];e={label:oe(e+4),code:""},2===a&&(e.code=ie(n+8)),t=ae(t).createShaderModule(e),re[r>>>0]=t},U:t=>{(t=ae(t)).onuncapturederror=null,t.destroy()},Q:function(t,e,r,n){if(e=je(e),r){var a={featureLevel:ye[_[r+4>>2]],powerPreference:Se[_[r+8>>2]],forceFallbackAdapter:!!_[r+12>>2]};0!==(t=_[r>>2])&&(a.qd=!!_[t+8>>2])}"gpu"in navigator?navigator.gpu.requestAdapter(a).then(t=>{te(()=>{if(t)re[n>>>0]=t,Jr(e,1,n,0);else{var r=an(),a=ee("WebGPU not available on this browser (requestAdapter returned null)");Jr(e,3,n,a),rn(r)}})},t=>{te(()=>{var r=an(),a=ee(t.message);Jr(e,4,n,a),rn(r)})}):(a=an(),t=ee("WebGPU not available on this browser (navigator.gpu is not available)"),Jr(e,3,n,t),rn(a))},N:function(t){try{var e=Cr(t);return Rr.close(e),0}catch(t){if(void 0===Rr||"ErrnoError"!==t.name)throw t;return t.sb}},L:function(t,e,r,n){e=je(e);try{if(isNaN(e))return 61;var a=Cr(t);return Rr.bb(a,e,r),S[n>>3]=BigInt(a.position),a.Kb&&0===e&&0===r&&(a.Kb=null),0}catch(t){if(void 0===Rr||"ErrnoError"!==t.name)throw t;return t.sb}},M:function(t,e,r,n){try{t:{var a=Cr(t);t=e;for(var i,o=e=0;o<r;o++){var s=_[t>>2],l=_[t+4>>2];t+=8;var u=Rr.write(a,v,s,l,i);if(0>u){var c=-1;break t}if(e+=u,u<l)break;void 0!==i&&(i+=u)}c=e}return _[n>>2]=c,0}catch(t){if(void 0===Rr||"ErrnoError"!==t.name)throw t;return t.sb}},I:Qt,r:function(t){return BigInt(ae(t).size)},u:(t,e)=>{var r=_[e>>2],n=void 0;0!==r&&(n=4294967296*_[r+12>>2]+_[r+8>>2]),r=oe(e+4);for(var a=_[e+12>>2],i=_[e+16>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+56*s,h=_[c+4>>2];if(0!==h){var d=$[c+8>>2];-1==d&&(d=void 0);var f=c+24;c={view:ae(h),depthSlice:d,resolveTarget:ae(_[c+12>>2]),clearValue:{r:x[f>>3],g:x[f+8>>3],b:x[f+16>>3],a:x[f+24>>3]},loadOp:Ae[_[c+16>>2]],storeOp:ze[_[c+20>>2]]}}else c=void 0;u.call(l,c)}return a=0!==(a=_[e+20>>2])?{view:ae(_[a+4>>2]),depthClearValue:A[a+16>>2],depthLoadOp:Ae[_[a+8>>2]],depthStoreOp:ze[_[a+12>>2]],depthReadOnly:!!_[a+20>>2],stencilClearValue:_[a+32>>2],stencilLoadOp:Ae[_[a+24>>2]],stencilStoreOp:ze[_[a+28>>2]],stencilReadOnly:!!_[a+36>>2]}:void 0,i=0!==(i=_[e+28>>2])?{querySet:ae(_[i+4>>2]),beginningOfPassWriteIndex:_[i+8>>2],endOfPassWriteIndex:_[i+12>>2]}:void 0,e={label:r,colorAttachments:o,depthStencilAttachment:a,occlusionQuerySet:ae(_[e+24>>2]),timestampWrites:i,maxDrawCount:n},n=ae(t),t=Hr(0),e=n.beginRenderPass(e),re[t>>>0]=e,t},_:(t,e,r,n)=>{ae(t).copyTextureToTexture(le(e),le(r),se(n))},ba:t=>{var e=ae(t);return t=Vr(0),e=e.finish(),re[t>>>0]=e,t},q:(t,e)=>{var r=oe(e+4),n=ae(_[e+12>>2]),a=_[e+16>>2];e=_[e+20>>2];for(var i=[],o=0;o<a;++o){var s=i,l=s.push,u=e+40*o,c=_[u+8>>2],h=_[u+32>>2],d=_[u+36>>2],f=_[u+4>>2];c?(-1==(h=_[(h=u+24)>>2]+4294967296*$[h+4>>2])&&(h=void 0),u={binding:f,resource:{buffer:ae(c),offset:4294967296*_[u+4+16>>2]+_[u+16>>2],size:h}}):u=h?{binding:f,resource:ae(h)}:{binding:f,resource:ae(d)},l.call(s,u)}return r={label:r,layout:n,entries:i},n=ae(t),t=Nr(0),r=n.createBindGroup(r),re[t>>>0]=r,t},j:(t,e)=>{var r=oe(e+4),n=_[e+12>>2];e=_[e+16>>2];for(var a=[],i=0;i<n;++i){var o=e+88*i,s=_[o+4>>2],l=_[o+8>>2],u=o+24,c=_[u+4>>2];u=c?{type:pe[c],hasDynamicOffset:!!_[u+8>>2],minBindingSize:4294967296*_[u+4+16>>2]+_[u+16>>2]}:void 0,c=(c=_[o+48+4>>2])?{type:ke[c]}:void 0;var h=o+56,d=_[h+4>>2];h=d?{sampleType:Re[d],viewDimension:Me[_[h+8>>2]],multisampled:!!_[h+12>>2]}:void 0,o=(d=_[(o+=72)+4>>2])?{access:Oe[d],format:De[_[o+8>>2]],viewDimension:Me[_[o+12>>2]]}:void 0,a.push.call(a,{binding:s,visibility:l,buffer:u,sampler:c,texture:h,storageTexture:o})}return r={label:r,entries:a},n=ae(t),t=jr(0),r=n.createBindGroupLayout(r),re[t>>>0]=r,t},ca:(t,e)=>{var r;return e&&(r={label:oe(e+4)}),e=ae(t),t=Ir(0),r=e.createCommandEncoder(r),re[t>>>0]=r,t},aa:(t,e)=>{for(var r=_[e+12>>2],n=_[e+16>>2],a=[],i=0;i<r;++i)a.push(ae(_[n+4*i>>2]));return e={label:oe(e+4),bindGroupLayouts:a},r=ae(t),t=Gr(0),e=r.createPipelineLayout(e),re[t>>>0]=e,t},f:(t,e)=>{e=(t=>{function e(t){if(t)return{operation:fe[_[t>>2]],srcFactor:de[_[t+4>>2]],dstFactor:de[_[t+8>>2]]}}function r(t){return{compare:me[_[t>>2]],failOp:Te[_[t+4>>2]],depthFailOp:Te[_[t+8>>2]],passOp:Te[_[t+12>>2]]}}return{label:oe(t+4),layout:ce(_[t+12>>2]),vertex:function(t){if(t){var e=ae(_[t+4>>2]),r=ue(_[t+16>>2],_[t+20>>2]),n=_[t+24>>2],a=_[t+28>>2];if(n){for(var i=[],o=0;o<n;++o){var s=i,l=s.push,u=a+24*o;if(u){var c=_[u+4>>2],h=_[u+16>>2];if(0===c&&0===h)var d=null;else{d=4294967296*_[u+4+8>>2]+_[u+8>>2],c=Le[c],u=_[u+20>>2];for(var f=[],p=0;p<h;++p){var m=u+24*p;f.push.call(f,{format:Fe[_[m+4>>2]],offset:4294967296*_[m+4+8>>2]+_[m+8>>2],shaderLocation:_[m+16>>2]})}d={arrayStride:d,stepMode:c,attributes:f}}}else d=void 0;l.call(s,d)}n=i}else n=void 0;return{module:e,constants:r,buffers:n,entryPoint:oe(t+8)}}}(t+16),primitive:function(t){if(t)return{topology:Ee[_[t+4>>2]],stripIndexFormat:_e[_[t+8>>2]],frontFace:$e[_[t+12>>2]],cullMode:ve[_[t+16>>2]],unclippedDepth:!!_[t+20>>2]}}(t+48),depthStencil:function(t){if(t)return{format:De[_[t+4>>2]],depthWriteEnabled:!!_[t+8>>2],depthCompare:me[_[t+12>>2]],stencilFront:r(t+16),stencilBack:r(t+32),stencilReadMask:_[t+48>>2],stencilWriteMask:_[t+52>>2],depthBias:$[t+56>>2],depthBiasSlopeScale:A[t+60>>2],depthBiasClamp:A[t+64>>2]}}(_[t+72>>2]),multisample:function(t){if(t)return{count:_[t+4>>2],mask:_[t+8>>2],alphaToCoverageEnabled:!!_[t+12>>2]}}(t+76),fragment:function(t){if(t){for(var r=ae(_[t+4>>2]),n=ue(_[t+16>>2],_[t+20>>2]),a=_[t+24>>2],i=_[t+28>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+24*s,h=_[c+4>>2];if(0===h)c=void 0;else{h=De[h];var d=(d=_[c+8>>2])?{alpha:e(d+12),color:e(d+0)}:void 0;c={format:h,blend:d,writeMask:_[c+16>>2]}}u.call(l,c)}return{module:r,constants:n,targets:o,entryPoint:oe(t+8)}}}(_[t+92>>2])}})(e);var r=ae(t);return t=Wr(0),e=r.createRenderPipeline(e),re[t>>>0]=e,t},ha:(t,e)=>{var r;return e&&(r={label:oe(e+4),addressModeU:he[_[e+12>>2]],addressModeV:he[_[e+16>>2]],addressModeW:he[_[e+20>>2]],magFilter:ge[_[e+24>>2]],minFilter:ge[_[e+28>>2]],mipmapFilter:xe[_[e+32>>2]],lodMinClamp:A[e+36>>2],lodMaxClamp:A[e+40>>2],compare:me[_[e+44>>2]],maxAnisotropy:g[e+48>>1]}),e=ae(t),t=qr(0),r=e.createSampler(r),re[t>>>0]=r,t},v:(t,e)=>{var r={label:oe(e+4),size:se(e+28),mipLevelCount:_[e+44>>2],sampleCount:_[e+48>>2],dimension:Be[_[e+24>>2]],format:De[_[e+40>>2]],usage:_[e+16>>2]},n=_[e+52>>2];return n&&(e=_[e+56>>2],r.viewFormats=Array.from($.subarray(e>>2,e+4*n>>2),t=>De[t])),t=ae(t),((t,e)=>{re[t>>>0]=e})(n=Zr(0),t.createTexture(r)),n},Z:(t,e)=>(t=2<(t=_[_[e>>2]+8>>2])?I(t):t,(t=(Mr[t]||("undefined"!=typeof document?document.querySelector(t):null)).getContext("webgpu"))?(t.ld=oe(e+4),e=Kr(0),re[e>>>0]=t,e):0),A:(t,e,r)=>{t=ae(t),e=Array.from($.subarray(r>>2,r+4*e>>2),t=>ae(t)),t.submit(e)},n:function(t,e,r,n,a){r=je(r),ae(t).writeBuffer(ae(e),r,y.subarray(n,n+a),0,a)},B:(t,e,r,n,a,i)=>{var o=_[a+8>>2],s=_[a+12>>2];ae(t).writeTexture(le(e),y.subarray(r,r+n),{offset:4294967296*_[a+4>>2]+_[a>>2],bytesPerRow:4294967295===o?void 0:o,rowsPerImage:4294967295===s?void 0:s},se(i))},s:(t,e,r,n,a,i)=>{ae(t).drawIndexed(e,r,n>>>0,a,i>>>0)},z:t=>{ae(t).end()},a:(t,e,r,n,a)=>{t=ae(t),r=ae(r),0==n?t.setBindGroup(e,r):t.setBindGroup(e,r,_,a>>2,n)},t:function(t,e,r,n,a){n=je(n),a=je(a),t=ae(t),e=ae(e),-1==a&&(a=void 0),t.setIndexBuffer(e,_e[r],n,a)},c:(t,e)=>{ae(t).setPipeline(ae(e))},g:(t,e,r,n,a)=>{ae(t).setScissorRect(e,r,n,a)},e:(t,e)=>{ae(t).setStencilReference(e>>>0)},p:function(t,e,r,n,a){n=je(n),a=je(a),t=ae(t),r=ae(r),-1==a&&(a=void 0),t.setVertexBuffer(e,r,n,a)},X:(t,e)=>{var r=_[e+4>>2];t=ae(t);var n=[_[e+24>>2],_[e+28>>2]];if(0!==n[0]&&(t.canvas.width=n[0]),0!==n[1]&&(t.canvas.height=n[1]),r={device:ae(r),format:De[_[e+8>>2]],usage:_[e+16>>2],alphaMode:be[_[e+40>>2]]},n=_[e+32>>2]){var a=_[e+36>>2];r.viewFormats=Array.from($.subarray(a>>2,a+4*n>>2),t=>De[t])}0!==(e=_[e>>2])&&(r.colorSpace=Ce[_[e+8>>2]],r.nd={mode:Ue[_[e+12>>2]]}),t.configure(r)},W:(t,e)=>{t=ae(t);try{var r=Zr(0),n=t.getCurrentTexture();re[r>>>0]=n,_[e+4>>2]=r,$[e+8>>2]=1}catch(t){_[e+4>>2]=0,$[e+8>>2]=6}},Y:t=>{ae(t).unconfigure()},ea:(t,e)=>{if(e){var r=_[e+24>>2],n=_[e+32>>2];r={label:oe(e+4),format:De[_[e+12>>2]],dimension:Me[_[e+16>>2]],baseMipLevel:_[e+20>>2],mipLevelCount:4294967295===r?void 0:r,baseArrayLayer:_[e+28>>2],arrayLayerCount:4294967295===n?void 0:n,aspect:Pe[_[e+36>>2]]}}return e=ae(t),t=Yr(0),e=e.createView(r),re[t>>>0]=e,t},da:t=>{ae(t).destroy()},fa:t=>De.indexOf(ae(t).format),C:t=>ae(t).height,D:t=>ae(t).width};return ln=await async function(){function t(t){return t=ln=t.exports,Ur=t.ra,Fr=t.sa,Lr=t.ta,Nr=t.ua,jr=t.va,Vr=t.wa,Ir=t.xa,Gr=t.Aa,Hr=t.Ea,Wr=t.Fa,qr=t.Ga,Kr=t.Ha,Zr=t.Ia,Yr=t.Ja,Xr=t.Pa,Jr=t.Qa,Qr=t.Ra,tn=t.Sa,en=t.Ta,rn=t.Va,nn=t.Wa,an=t.Xa,on=t.pa,sn=t.Ua,B(),ln}var e={a:un};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(e,(e,r)=>{n(t(e))})}):(E??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",h):h+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,t((await async function(t){var e=E;if(!f&&!z(e)&&!i)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){T(`wasm streaming compile failed: ${t}`),T("falling back to ArrayBuffer instantiation")}return async function(t,e){try{var r=await async function(t){if(!f)try{var e=await s(t);return new Uint8Array(e)}catch{}if(t==E&&f)t=new Uint8Array(f);else{if(!l)throw"both async and sync fetching of the wasm failed";t=l(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){T(`failed to asynchronously prepare wasm: ${t}`),D(t)}}(e,t)}(e)).instance))}(),function t(){function e(){if(r.calledRun=!0,!O){if(P=!0,r.noFSInit||Rr.Lb||hr(),ln.qa(),Rr.bc=!1,m?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();U.push(t)}M(U)}}if(0<ir)or=t;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)L();M(F),0<ir?or=t:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),e()},1)):e()}}(),e=P?r:new Promise((t,e)=>{m=t,b=e}),e}({locateFile:(t,e)=>t.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":e+t})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const t=this.config?.renderer||"wg";if(await(async t=>{if("wg"===t){for(;"requested"===pt;)await ft(100);if("initialized"!==pt&&(pt="requested",ct))for(;;)switch(ct.init()){case 0:return void(pt="initialized");case 1:return void(pt="failed");case 2:await ft(100)}}})(t),"failed"===pt)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ct.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:t,right:e,top:r,bottom:n}=this.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight;let o=0,s=0,l=this.canvas.width,u=this.canvas.height;t<0&&(o=Math.abs(t),l-=o),r<0&&(s=Math.abs(r),u-=s),e>a&&(l-=e-a),n>i&&(u-=n-i),this.TVG.viewport(o,s,l,u)}_observerCallback(t){const e=t[0],r=e.target;r._observable=e.isIntersecting,e.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(t){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(t){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(t,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const t=1+.75*(window.devicePixelRatio-1),{width:e,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=e*t,this.canvas.height=r*t}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const t=this.TVG.render(),e=new Uint8ClampedArray(t,0,t.byteLength);e.length<1||(this._imageData=new ImageData(e,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const t=this.TVG.duration(),e=Date.now()/1e3;if(this.currentFrame=(e-this._beginTime)/t*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const t=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||t&&this._counter<t)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ft(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(t){this.TVG&&(this.pause(),this.currentFrame=t,this.TVG.frame(t))}async load(t,e="json"){try{await this._init();const r=await(async(t,e)=>{const r=new TextEncoder;let n=t;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===e||"lot"===e)return n=await(async t=>{try{t=JSON.parse(t)}catch(e){const r=await(async t=>{if("string"!=typeof t)throw new Error("The url value must be a string");try{const e=new URL(t),r=await fetch(e.toString());return await r.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(t);t=JSON.stringify(r)}return t})(n),r.encode(n);const t=await(async t=>(await fetch(t)).arrayBuffer())(n);return new Uint8Array(t);default:throw new Error("Invalid src type")}})(t,e);this.dispatchEvent(new CustomEvent("ready")),this.fileType=e,await this._loadBytes(r)}catch(t){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(this.totalFrame=this.TVG.totalFrame(),this.totalFrame<1||(this._beginTime=Date.now()/1e3,"playing"===this.currentState))))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(t){this._frame(t),await this._update(),this._render()}resize(t,e){this.canvas.width=t,this.canvas.height=e,"playing"!==this.currentState&&this._render()}destroy(){this.TVG&&(this.TVG.delete(),this.TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ct&&(ct.term(),ct=null)}setLooping(t){this.TVG&&(this.loop=t)}setDirection(t){this.TVG&&(this.direction=t)}setSpeed(t){this.TVG&&(this.speed=t)}setBgColor(t){this.TVG&&(this.canvas.style.backgroundColor=t)}setQuality(t){this.TVG&&this.TVG.quality(t)&&"playing"!==this.currentState&&this._render()}setAssetResolver(t,e){this._assetResolverCallback=t,this._assetResolverData=e,this.TVG&&this.TVG.setAssetResolver(t,e)}getVersion(){return{THORVG_VERSION:"1.0.2"}}render(){return I`
1
+ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let a=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const r=this.t;if(e&&void 0===t){const e=void 0!==r&&1===r.length;e&&(t=n.get(r)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n.set(r,t))}return t}toString(){return this.cssText}};const i=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:o,defineProperty:s,getOwnPropertyDescriptor:l,getOwnPropertyNames:u,getOwnPropertySymbols:c,getPrototypeOf:h}=Object,d=globalThis,f=d.trustedTypes,p=f?f.emptyScript:"",m=d.reactiveElementPolyfillSupport,b=(t,e)=>t,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},y=(t,e)=>!o(t,e),w={attribute:!0,type:String,converter:v,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let g=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&s(this.prototype,t,n)}}static getPropertyDescriptor(t,e,r){const{get:n,set:a}=l(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=n?.call(this);a?.call(this,e),this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...u(t),...c(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(i(t))}else void 0!==t&&e.push(i(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(e)r.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of n){const n=document.createElement("style"),a=t.litNonce;void 0!==a&&n.setAttribute("nonce",a),n.textContent=e.cssText,r.appendChild(n)}})(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==r.converter?.toAttribute?r.converter:v).toAttribute(e,r.type);this._$Em=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$Em=null}}_$AK(t,e){const r=this.constructor,n=r._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=r.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:v;this._$Em=n;const i=a.fromAttribute(e,t.type);this[n]=i??this._$Ej?.get(n)??i,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const n=this.constructor,a=this[t];if(r??=n.getPropertyOptions(t),!((r.hasChanged??y)(a,e)||r.useDefault&&r.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:n,wrapped:a},i){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==a||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===n&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,r,n)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};g.elementStyles=[],g.shadowRootOptions={mode:"open"},g[b("elementProperties")]=new Map,g[b("finalized")]=new Map,m?.({ReactiveElement:g}),(d.reactiveElementVersions??=[]).push("2.1.1");const $={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_=(t=$,e,r)=>{const{kind:n,metadata:a}=r;let i=globalThis.litPropertyMetadata.get(a);if(void 0===i&&globalThis.litPropertyMetadata.set(a,i=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),i.set(r.name,t),"accessor"===n){const{name:n}=r;return{set(r){const a=e.get.call(this);e.set.call(this,r),this.requestUpdate(n,a,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){const{name:n}=r;return function(r){const a=this[n];e.call(this,r),this.requestUpdate(n,a,t)}}throw Error("Unsupported decorator location: "+n)};function A(t){return(e,r)=>"object"==typeof r?_(t,e,r):((t,e,r)=>{const n=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),n?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}const x=globalThis,S=x.trustedTypes,C=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,E="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+k,O=`<${T}>`,z=document,P=()=>z.createComment(""),B=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,D="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,F=/>/g,L=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,j=/"/g,V=/^(?:script|style|textarea|title)$/i,I=(t,...e)=>({_$litType$:1,strings:t,values:e}),G=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),W=new WeakMap,q=z.createTreeWalker(z,129);function K(t,e){if(!R(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}const Z=(t,e)=>{const r=t.length-1,n=[];let a,i=2===e?"<svg>":3===e?"<math>":"",o=M;for(let e=0;e<r;e++){const r=t[e];let s,l,u=-1,c=0;for(;c<r.length&&(o.lastIndex=c,l=o.exec(r),null!==l);)c=o.lastIndex,o===M?"!--"===l[1]?o=U:void 0!==l[1]?o=F:void 0!==l[2]?(V.test(l[2])&&(a=RegExp("</"+l[2],"g")),o=L):void 0!==l[3]&&(o=L):o===L?">"===l[0]?(o=a??M,u=-1):void 0===l[1]?u=-2:(u=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?L:'"'===l[3]?j:N):o===j||o===N?o=L:o===U||o===F?o=M:(o=L,a=void 0);const h=o===L&&t[e+1].startsWith("/>")?" ":"";i+=o===M?r+O:u>=0?(n.push(s),r.slice(0,u)+E+r.slice(u)+k+h):r+k+(-2===u?e:h)}return[K(t,i+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Y{constructor({strings:t,_$litType$:e},r){let n;this.parts=[];let a=0,i=0;const o=t.length-1,s=this.parts,[l,u]=Z(t,e);if(this.el=Y.createElement(l,r),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=q.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(E)){const e=u[i++],r=n.getAttribute(t).split(k),o=/([.?@])?(.*)/.exec(e);s.push({type:1,index:a,name:o[2],strings:r,ctor:"."===o[1]?et:"?"===o[1]?rt:"@"===o[1]?nt:tt}),n.removeAttribute(t)}else t.startsWith(k)&&(s.push({type:6,index:a}),n.removeAttribute(t));if(V.test(n.tagName)){const t=n.textContent.split(k),e=t.length-1;if(e>0){n.textContent=S?S.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],P()),q.nextNode(),s.push({type:2,index:++a});n.append(t[e],P())}}}else if(8===n.nodeType)if(n.data===T)s.push({type:2,index:a});else{let t=-1;for(;-1!==(t=n.data.indexOf(k,t+1));)s.push({type:7,index:a}),t+=k.length-1}a++}}static createElement(t,e){const r=z.createElement("template");return r.innerHTML=t,r}}function X(t,e,r=t,n){if(e===G)return e;let a=void 0!==n?r._$Co?.[n]:r._$Cl;const i=B(e)?void 0:e._$litDirective$;return a?.constructor!==i&&(a?._$AO?.(!1),void 0===i?a=void 0:(a=new i(t),a._$AT(t,r,n)),void 0!==n?(r._$Co??=[])[n]=a:r._$Cl=a),void 0!==a&&(e=X(t,a._$AS(t,e.values),a,n)),e}class J{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,n=(t?.creationScope??z).importNode(e,!0);q.currentNode=n;let a=q.nextNode(),i=0,o=0,s=r[0];for(;void 0!==s;){if(i===s.index){let e;2===s.type?e=new Q(a,a.nextSibling,this,t):1===s.type?e=new s.ctor(a,s.name,s.strings,this,t):6===s.type&&(e=new at(a,this,t)),this._$AV.push(e),s=r[++o]}i!==s?.index&&(a=q.nextNode(),i++)}return q.currentNode=z,n}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,n){this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),B(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==G&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>R(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==H&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,n="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Y.createElement(K(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new J(n,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Y(t)),e}k(t){R(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,n=0;for(const a of t)n===e.length?e.push(r=new Q(this.O(P()),this.O(P()),this,this.options)):r=e[n],r._$AI(a),n++;n<e.length&&(this._$AR(r&&r._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,n,a){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=H}_$AI(t,e=this,r,n){const a=this.strings;let i=!1;if(void 0===a)t=X(this,t,e,0),i=!B(t)||t!==this._$AH&&t!==G,i&&(this._$AH=t);else{const n=t;let o,s;for(t=a[0],o=0;o<a.length-1;o++)s=X(this,n[r+o],e,o),s===G&&(s=this._$AH[o]),i||=!B(s)||s!==this._$AH[o],s===H?t=H:t!==H&&(t+=(s??"")+a[o+1]),this._$AH[o]=s}i&&!n&&this.j(t)}j(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===H?void 0:t}}class rt extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==H)}}class nt extends tt{constructor(t,e,r,n,a){super(t,e,r,n,a),this.type=5}_$AI(t,e=this){if((t=X(this,t,e,0)??H)===G)return;const r=this._$AH,n=t===H&&r!==H||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,a=t!==H&&(r===H||n);n&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class at{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const it=x.litHtmlPolyfillSupport;it?.(Y,Q),(x.litHtmlVersions??=[]).push("3.3.1");const ot=globalThis;class st extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const n=r?.renderBefore??e;let a=n._$litPart$;if(void 0===a){const t=r?.renderBefore??null;n._$litPart$=a=new Q(e.insertBefore(P(),t),t,void 0,r??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}}st._$litElement$=!0,st.finalized=!0,ot.litElementHydrateSupport?.({LitElement:st});const lt=ot.litElementPolyfillSupport;function ut(t,e,r,n){var a,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,r,o):a(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}lt?.({LitElement:st}),(ot.litElementVersions??=[]).push("4.2.1");let ct=null,ht=!1;var dt=function(t){return t.JSON="json",t.LOT="lot",t.JPG="jpg",t.PNG="png",t.SVG="svg",t}({});const ft=t=>new Promise(e=>setTimeout(e,t));let pt="idle";class mt extends st{src;wasmUrl;fileType="json";speed=1;autoPlay=!1;count;loop=!1;direction=1;mode="normal";intermission=1;totalFrame=0;currentFrame=0;currentState="loading";get size(){return Float32Array.from(this.TVG?.size()||[0,0])}get dpr(){return!1===this.config?.enableDevicePixelRatio?1:1+.75*(window.devicePixelRatio-1)}TVG=null;canvas;config;_imageData;_beginTime=Date.now();_counter=1;_timer;_observer;_observable=!1;_assetResolverCallback;_assetResolverData;async _init(){if(ht)for(;!ct;)await ft(100);if(ct||(ht=!0,ct=await async function(t={}){var e,r=t,n=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(i){const{createRequire:t}=await Promise.resolve().then(function(){return yt});var o=t(import.meta.url)}var s,l,u=(t,e)=>{throw e},c=import.meta.url,h="";if(i){var d=o("fs");c.startsWith("file:")&&(h=o("path").dirname(o("url").fileURLToPath(c))+"/"),l=t=>(t=z(t)?new URL(t):t,d.readFileSync(t)),s=async t=>(t=z(t)?new URL(t):t,d.readFileSync(t,void 0)),process.argv.slice(2),u=(t,e)=>{throw process.exitCode=t,e}}else if(n||a){try{h=new URL(".",c).href}catch{}a&&(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=async t=>{if(z(t))return new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r(n.status)},n.onerror=r,n.send(null)});var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw Error(e.status+" : "+e.url)}}var f,p,m,b,v,y,w,g,$,_,A,x,S,C,E,k=function(){}.bind(),T=function(){}.bind(),O=!1,z=t=>t.startsWith("file://"),P=!1;function B(){var t=on.buffer;v=new Int8Array(t),w=new Int16Array(t),y=new Uint8Array(t),g=new Uint16Array(t),$=new Int32Array(t),_=new Uint32Array(t),A=new Float32Array(t),x=new Float64Array(t),S=new BigInt64Array(t),C=new BigUint64Array(t)}function R(t){throw r.onAbort?.(t),T(t="Aborted("+t+")"),O=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),b?.(t),t}class D{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var M=t=>{for(;0<t.length;)t.shift()(r)},U=[],F=[],L=()=>{var t=r.preRun.shift();F.push(t)},N=!0,j=new TextDecoder,V=(t,e,r,n)=>{if(r=e+r,n)return r;for(;t[e]&&!(e>=r);)++e;return e},I=(t,e,r)=>t?j.decode(y.subarray(t,V(y,t,e,r))):"",G=t=>{for(var e="";;){var r=y[t++];if(!r)return e;e+=String.fromCharCode(r)}},H={},W={},q={},K=class extends Error{constructor(t){super(t),this.name="BindingError"}},Z=t=>{throw new K(t)};function Y(t,e,r={}){return function(t,e,r={}){var n=e.name;if(!t)throw new K(`type "${n}" must have a positive integer typeid pointer`);if(W.hasOwnProperty(t)){if(r.xc)return;throw new K(`Cannot register type '${n}' twice`)}W[t]=e,delete q[t],H.hasOwnProperty(t)&&(e=H[t],delete H[t],e.forEach(t=>t()))}(t,e,r)}var X=(t,e,r)=>{switch(e){case 1:return r?t=>v[t]:t=>y[t];case 2:return r?t=>w[t>>1]:t=>g[t>>1];case 4:return r?t=>$[t>>2]:t=>_[t>>2];case 8:return r?t=>S[t>>3]:t=>C[t>>3];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},J=t=>{throw new K(t.za.Na.Ka.name+" instance already deleted")},Q=!1,tt=()=>{},et=t=>globalThis.FinalizationRegistry?(Q=new FinalizationRegistry(t=>{--(t=t.za).count.value,0===t.count.value&&(t.Za?t.cb.qb(t.Za):t.Na.Ka.qb(t.La))}),et=t=>{var e=t.za;return e.Za&&Q.register(t,{za:e},t),t},tt=t=>{Q.unregister(t)},et(t)):(et=t=>t,t);function rt(){}var nt=(t,e)=>Object.defineProperty(e,"name",{value:t}),at={},it=(t,e,r)=>{if(void 0===t[e].Ya){var n=t[e];t[e]=function(...n){if(!t[e].Ya.hasOwnProperty(n.length))throw new K(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${t[e].Ya})!`);return t[e].Ya[n.length].apply(this,n)},t[e].Ya=[],t[e].Ya[n.yb]=n}},ot=(t,e,n)=>{if(r.hasOwnProperty(t)){if(void 0===n||void 0!==r[t].Ya&&void 0!==r[t].Ya[n])throw new K(`Cannot register public name '${t}' twice`);if(it(r,t,t),r[t].Ya.hasOwnProperty(n))throw new K(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);r[t].Ya[n]=e}else r[t]=e,r[t].yb=n};function st(t,e,r,n,a,i,o,s){this.name=t,this.constructor=e,this.vb=r,this.qb=n,this.ab=a,this.tc=i,this.Db=o,this.qc=s,this.Dc=[]}var lt=(t,e,r)=>{for(;e!==r;){if(!e.Db)throw new K(`Expected null or instance of ${r.name}, got an instance of ${e.name}`);t=e.Db(t),e=e.ab}return t},ut=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t};function ct(t,e){if(null===e){if(this.Mb)throw new K(`null is not a valid ${this.name}`);return 0}if(!e.za)throw new K(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.za.La)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);return lt(e.za.La,e.za.Na.Ka,this.Ka)}function ht(t,e){if(null===e){if(this.Mb)throw new K(`null is not a valid ${this.name}`);if(this.Gb){var r=this.Ec();return null!==t&&t.push(this.qb,r),r}return 0}if(!e||!e.za)throw new K(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.za.La)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Fb&&e.za.Na.Fb)throw new K(`Cannot convert argument of type ${e.za.cb?e.za.cb.name:e.za.Na.name} to parameter type ${this.name}`);if(r=lt(e.za.La,e.za.Na.Ka,this.Ka),this.Gb){if(void 0===e.za.Za)throw new K("Passing raw pointer to smart pointer is illegal");switch(this.Gc){case 0:if(e.za.cb!==this)throw new K(`Cannot convert argument of type ${e.za.cb?e.za.cb.name:e.za.Na.name} to parameter type ${this.name}`);r=e.za.Za;break;case 1:r=e.za.Za;break;case 2:if(e.za.cb===this)r=e.za.Za;else{var n=e.clone();r=this.Fc(r,Dt(()=>n.delete())),null!==t&&t.push(this.qb,r)}break;default:throw new K("Unsupporting sharing policy")}}return r}function dt(t,e){if(null===e){if(this.Mb)throw new K(`null is not a valid ${this.name}`);return 0}if(!e.za)throw new K(`Cannot pass "${ut(e)}" as a ${this.name}`);if(!e.za.La)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(e.za.Na.Fb)throw new K(`Cannot convert argument of type ${e.za.Na.name} to parameter type ${this.name}`);return lt(e.za.La,e.za.Na.Ka,this.Ka)}function ft(t){return this.$a(_[t>>2])}var pt=(t,e,r)=>e===r?t:void 0===r.ab||null===(t=pt(t,e,r.ab))?null:r.qc(t),mt={},bt=class extends Error{constructor(t){super(t),this.name="InternalError"}},vt=(t,e)=>{if(!e.Na||!e.La)throw new bt("makeClassHandle requires ptr and ptrType");if(!!e.cb!=!!e.Za)throw new bt("Both smartPtrType and smartPtr must be specified");return e.count={value:1},et(Object.create(t,{za:{value:e,writable:!0}}))};function wt(t,e,r,n,a,i,o,s,l,u,c){this.name=t,this.Ka=e,this.Mb=r,this.Fb=n,this.Gb=a,this.Cc=i,this.Gc=o,this.fc=s,this.Ec=l,this.Fc=u,this.qb=c,a||void 0!==e.ab?this.eb=ht:(this.eb=n?ct:dt,this.fb=null)}var gt=(t,e,n)=>{if(!r.hasOwnProperty(t))throw new bt("Replacing nonexistent public symbol");void 0!==r[t].Ya&&void 0!==n?r[t].Ya[n]=e:(r[t]=e,r[t].yb=n)},$t=(t,e)=>{t=G(t);var r=sn.get(e);if("function"!=typeof r)throw new K(`unknown function pointer with signature ${t}: ${e}`);return r};class _t extends Error{}var At=t=>{t=Fr(t);var e=G(t);return Lr(t),e},xt=(t,e)=>{var r=[],n={};throw e.forEach(function t(e){n[e]||W[e]||(q[e]?q[e].forEach(t):(r.push(e),n[e]=!0))}),new _t(`${t}: `+r.map(At).join([", "]))},St=(t,e,r)=>{function n(e){if((e=r(e)).length!==t.length)throw new bt("Mismatched type converter count");for(var n=0;n<t.length;++n)Y(t[n],e[n])}t.forEach(t=>q[t]=e);var a=Array(e.length),i=[],o=0;for(let[t,r]of e.entries())W.hasOwnProperty(r)?a[t]=W[r]:(i.push(r),H.hasOwnProperty(r)||(H[r]=[]),H[r].push(()=>{a[t]=W[r],++o===i.length&&n(a)}));0===i.length&&n(a)},Ct=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+4*n>>2]);return r},Et=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function kt(t){for(var e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].fb)return!0;return!1}function Tt(t,e,r,n,a,i){var o=e.length;if(2>o)throw new K("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==e[1]&&null!==r,l=kt(e);r=!e[0].dc;var u=e[0],c=e[1];for(n=[t,Z,n,a,Et,u.$a.bind(u),c?.eb.bind(c)],a=2;a<o;++a)n.push((u=e[a]).eb.bind(u));if(!l)for(a=s?1:2;a<e.length;++a)null!==e[a].fb&&n.push(e[a].fb);for(l=kt(e),a=e.length-2,c=[],u=["fn"],s&&u.push("thisWired"),o=0;o<a;++o)c.push(`arg${o}`),u.push(`arg${o}Wired`);c=c.join(","),u=u.join(","),c=`return function (${c}) {\n`,l&&(c+="var destructors = [];\n");var h=l?"destructors":"null",d="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(s&&(c+=`var thisWired = toClassParamWire(${h}, this);\n`),o=0;o<a;++o){var f=`toArg${o}Wire`;c+=`var arg${o}Wired = ${f}(${h}, arg${o});\n`,d.push(f)}if(c+=(r||i?"var rv = ":"")+`invoker(${u});\n`,l)c+="runDestructors(destructors);\n";else for(o=s?1:2;o<e.length;++o)i=1===o?"thisWired":"arg"+(o-2)+"Wired",null!==e[o].fb&&(c+=`${i}_dtor(${i});\n`,d.push(`${i}_dtor`));return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),e=new Function(d,c+"}\n")(...n),nt(t,e)}var Ot=t=>{const e=(t=t.trim()).indexOf("(");return-1===e?t:t.slice(0,e)},zt=[],Pt=[0,1,,1,null,1,!0,1,!1,1],Bt=t=>{9<t&&0===--Pt[t+1]&&(Pt[t]=void 0,zt.push(t))},Rt=t=>{if(!t)throw new K(`Cannot use deleted val. handle = ${t}`);return Pt[t]},Dt=t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const e=zt.pop()||Pt.length;return Pt[e]=t,Pt[e+1]=1,e}},Mt={name:"emscripten::val",$a:t=>{var e=Rt(t);return Bt(t),e},eb:(t,e)=>Dt(e),nb:ft,fb:null},Ut=(t,e)=>{switch(e){case 4:return function(t){return this.$a(A[t>>2])};case 8:return function(t){return this.$a(x[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Ft=(t,e,r,n)=>{if(!(0<n))return 0;var a=r;n=r+n-1;for(var i=0;i<t.length;++i){var o=t.codePointAt(i);if(127>=o){if(r>=n)break;e[r++]=o}else if(2047>=o){if(r+1>=n)break;e[r++]=192|o>>6,e[r++]=128|63&o}else if(65535>=o){if(r+2>=n)break;e[r++]=224|o>>12,e[r++]=128|o>>6&63,e[r++]=128|63&o}else{if(r+3>=n)break;e[r++]=240|o>>18,e[r++]=128|o>>12&63,e[r++]=128|o>>6&63,e[r++]=128|63&o,i++}}return e[r]=0,r-a},Lt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},Nt=new TextDecoder("utf-16le"),jt=(t,e,r)=>Nt.decode(g.subarray(t>>=1,V(g,t,e/2,r))),Vt=(t,e,r)=>{if(r??=2147483647,2>r)return 0;var n=e;r=(r-=2)<2*t.length?r/2:t.length;for(var a=0;a<r;++a)w[e>>1]=t.charCodeAt(a),e+=2;return w[e>>1]=0,e-n},It=t=>2*t.length,Gt=(t,e,r)=>{var n="";t>>=2;for(var a=0;!(a>=e/4);a++){var i=_[t+a];if(!i&&!r)break;n+=String.fromCodePoint(i)}return n},Ht=(t,e,r)=>{if(r??=2147483647,4>r)return 0;var n=e;r=n+r-4;for(var a=0;a<t.length;++a){var i=t.codePointAt(a);if(65535<i&&a++,$[e>>2]=i,(e+=4)+4>r)break}return $[e>>2]=0,e-n},Wt=t=>{for(var e=0,r=0;r<t.length;++r)65535<t.codePointAt(r)&&r++,e+=4;return e},qt=0,Kt=[],Zt=(t,e,r)=>{var n=[];return t=t(n,r),n.length&&(_[e>>2]=Dt(n)),t},Yt={},Xt=t=>{var e=Yt[t];return void 0===e?G(t):e},Jt={},Qt=t=>{p=t,N||0<qt||(r.onExit?.(t),O=!0),u(t,new D(t))},te=t=>{if(!O)try{if(t(),!(N||0<qt))try{p=t=p,Qt(t)}catch(t){t instanceof D||"unwind"==t||u(1,t)}}catch(t){t instanceof D||"unwind"==t||u(1,t)}},ee=t=>{var e=Lt(t)+1,r=nn(e);return Ft(t,y,r,e),r},re=[],ne=[],ae=t=>{if(t)return re[t>>>0]},ie=t=>I(_[t>>2],_[t+4>>2]),oe=t=>{var e=_[t>>2];return t=_[t+4>>2],e?I(e,t):0===t?"":void 0},se=t=>({width:_[t>>2],height:_[t+4>>2],depthOrArrayLayers:_[t+8>>2]}),le=t=>{var e=t+8;return{texture:ae(_[t>>2]),mipLevel:_[t+4>>2],origin:{x:_[e>>2],y:_[e+4>>2],z:_[e+8>>2]},aspect:Pe[_[t+20>>2]]}},ue=(t,e)=>{if(t){for(var r={},n=0;n<t;++n){var a=e+24*n;r[ie(a+4)]=x[a+16>>3]}return r}},ce=t=>t?ae(t):"auto",he=[,"clamp-to-edge","repeat","mirror-repeat"],de=[,"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","src1","one-minus-src1","src1alpha","one-minus-src1alpha"],fe=[,"add","subtract","reverse-subtract","min","max"],pe=["binding-not-used",,"uniform","storage","read-only-storage"],me=[,"never","less","equal","less-equal","greater","not-equal","greater-equal","always"],be=[,"opaque","premultiplied","unpremultiplied","inherit"],ve=[,"none","front","back"],ye=[,"compatibility","core"],we={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},ge=[,"nearest","linear"],$e=[,"ccw","cw"],_e=[,"uint16","uint32"],Ae=[,"load","clear"],xe=[,"nearest","linear"],Se=[,"low-power","high-performance"],Ce=[,"srgb","display-p3"],Ee=[,"point-list","line-list","line-strip","triangle-list","triangle-strip"],ke=["binding-not-used",,"filtering","non-filtering","comparison"],Te=[,"keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],Oe=["binding-not-used",,"write-only","read-only","read-write"],ze=[,"store","discard"],Pe=[,"all","stencil-only","depth-only"],Be=[,"1d","2d","3d"],Re=[,"r8unorm","r8snorm","r8uint","r8sint","r16unorm","r16snorm","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16unorm","rg16snorm","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2uint","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16unorm","rgba16snorm","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"],De=["binding-not-used",,"float","unfilterable-float","depth","sint","uint"],Me=[,"1d","2d","2d-array","cube","cube-array","3d"],Ue=[,"standard","extended"],Fe=[,"uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],Le=[,"vertex","instance"],Ne={undefined:1,unknown:1,destroyed:2},je=t=>-9007199254740992>t||9007199254740992<t?NaN:Number(t),Ve=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var a=t[n];"."===a?t.splice(n,1):".."===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},Ie=t=>{var e="/"===t.charAt(0),r="/"===t.slice(-1);return(t=Ve(t.split("/").filter(t=>!!t),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},Ge=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&=e.slice(0,-1),t+e):"."},He=t=>t&&t.match(/([^\/]+|\/)\/*$/)[1],We=t=>{(We=(()=>{if(i){var t=o("crypto");return e=>t.randomFillSync(e)}return t=>crypto.getRandomValues(t)})())(t)},qe=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){if("string"!=typeof(r=0<=n?t[n]:Dr.cwd()))throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,r="/"===r.charAt(0)}return e=Ve(e.split("/").filter(t=>!!t),!r).join("/"),(r?"/":"")+e||"."},Ke=(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=qe(t).slice(1),e=qe(e).slice(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),a=n,i=0;i<n;i++)if(t[i]!==e[i]){a=i;break}for(n=[],i=a;i<t.length;i++)n.push("..");return(n=n.concat(e.slice(a))).join("/")},Ze=t=>{var e=V(t,0);return j.decode(t.buffer?t.subarray(0,e):new Uint8Array(t.slice(0,e)))},Ye=[],Xe=t=>{var e=Array(Lt(t)+1);return t=Ft(t,e,0,e.length),e.length=t,e},Je=[];function Qe(t,e){Je[t]={input:[],output:[],xb:e},dr(t,tr)}var tr={open(t){var e=Je[t.node.rdev];if(!e)throw new Dr.ya(43);t.tty=e,t.seekable=!1},close(t){t.tty.xb.fsync(t.tty)},fsync(t){t.tty.xb.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.xb.ac)throw new Dr.ya(60);for(var a=0,i=0;i<n;i++){try{var o=t.tty.xb.ac(t.tty)}catch(t){throw new Dr.ya(29)}if(void 0===o&&0===a)throw new Dr.ya(6);if(null==o)break;a++,e[r+i]=o}return a&&(t.node.atime=Date.now()),a},write(t,e,r,n){if(!t.tty||!t.tty.xb.Qb)throw new Dr.ya(60);try{for(var a=0;a<n;a++)t.tty.xb.Qb(t.tty,e[r+a])}catch(t){throw new Dr.ya(29)}return n&&(t.node.mtime=t.node.ctime=Date.now()),a}},er={ac(){t:{if(!Ye.length){var t=null;if(i){var e=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=d.readSync(n,e,0,256)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}0<r&&(t=e.slice(0,r).toString("utf-8"))}else globalThis.window?.prompt&&null!==(t=window.prompt("Input: "))&&(t+="\n");if(!t){t=null;break t}Ye=Xe(t)}t=Ye.shift()}return t},Qb(t,e){null===e||10===e?(k(Ze(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(k(Ze(t.output)),t.output=[])},ad:()=>({Oc:25856,Qc:5,Nc:191,Pc:35387,Mc:[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]}),bd:()=>0,cd:()=>[24,80]},rr={Qb(t,e){null===e||10===e?(T(Ze(t.output)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){0<t.output?.length&&(T(Ze(t.output)),t.output=[])}},nr={kb:null,Ma:()=>nr.createNode(null,"/",16895,0),createNode(t,e,r,n){if(24576==(61440&r)||Dr.isFIFO(r))throw new Dr.ya(63);return nr.kb||(nr.kb={dir:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb,lookup:nr.Ba.lookup,lb:nr.Ba.lb,rename:nr.Ba.rename,unlink:nr.Ba.unlink,rmdir:nr.Ba.rmdir,readdir:nr.Ba.readdir,symlink:nr.Ba.symlink},stream:{bb:nr.Ca.bb}},file:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb},stream:{bb:nr.Ca.bb,read:nr.Ca.read,write:nr.Ca.write,wb:nr.Ca.wb,Bb:nr.Ca.Bb}},link:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb,readlink:nr.Ba.readlink},stream:{}},Wb:{node:{hb:nr.Ba.hb,jb:nr.Ba.jb},stream:Dr.oc}}),fr((r=Dr.createNode(t,e,r,n)).mode)?(r.Ba=nr.kb.dir.node,r.Ca=nr.kb.dir.stream,r.Da={}):Dr.isFile(r.mode)?(r.Ba=nr.kb.file.node,r.Ca=nr.kb.file.stream,r.Oa=0,r.Da=null):40960==(61440&r.mode)?(r.Ba=nr.kb.link.node,r.Ca=nr.kb.link.stream):8192==(61440&r.mode)&&(r.Ba=nr.kb.Wb.node,r.Ca=nr.kb.Wb.stream),r.atime=r.mtime=r.ctime=Date.now(),t&&(t.Da[e]=r,t.atime=t.mtime=t.ctime=r.atime),r},$c:t=>t.Da?t.Da.subarray?t.Da.subarray(0,t.Oa):new Uint8Array(t.Da):new Uint8Array(0),Ba:{hb(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,e.size=fr(t.mode)?4096:Dr.isFile(t.mode)?t.Oa:40960==(61440&t.mode)?t.link.length:0,e.atime=new Date(t.atime),e.mtime=new Date(t.mtime),e.ctime=new Date(t.ctime),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},jb(t,e){for(var r of["mode","atime","mtime","ctime"])null!=e[r]&&(t[r]=e[r]);void 0!==e.size&&t.Oa!=(e=e.size)&&(0==e?(t.Da=null,t.Oa=0):(r=t.Da,t.Da=new Uint8Array(e),r&&t.Da.set(r.subarray(0,Math.min(e,t.Oa))),t.Oa=e))},lookup(){throw nr.Jb||(nr.Jb=new Dr.ya(44),nr.Jb.stack="<generic error, no stack>"),nr.Jb},lb:(t,e,r,n)=>nr.createNode(t,e,r,n),rename(t,e,r){try{var n=pr(e,r)}catch(t){}if(n){if(fr(t.mode))for(var a in n.Da)throw new Dr.ya(55);mr(n)}delete t.parent.Da[t.name],e.Da[r]=t,t.name=r,e.ctime=e.mtime=t.parent.ctime=t.parent.mtime=Date.now()},unlink(t,e){delete t.Da[e],t.ctime=t.mtime=Date.now()},rmdir(t,e){var r,n=pr(t,e);for(r in n.Da)throw new Dr.ya(55);delete t.Da[e],t.ctime=t.mtime=Date.now()},readdir:t=>[".","..",...Object.keys(t.Da)],symlink:(t,e,r)=>((t=nr.createNode(t,e,41471,0)).link=r,t),readlink(t){if(40960!=(61440&t.mode))throw new Dr.ya(28);return t.link}},Ca:{read(t,e,r,n,a){var i=t.node.Da;if(a>=t.node.Oa)return 0;if(8<(t=Math.min(t.node.Oa-a,n))&&i.subarray)e.set(i.subarray(a,a+t),r);else for(n=0;n<t;n++)e[r+n]=i[a+n];return t},write(t,e,r,n,a,i){if(e.buffer===v.buffer&&(i=!1),!n)return 0;if((t=t.node).mtime=t.ctime=Date.now(),e.subarray&&(!t.Da||t.Da.subarray)){if(i)return t.Da=e.subarray(r,r+n),t.Oa=n;if(0===t.Oa&&0===a)return t.Da=e.slice(r,r+n),t.Oa=n;if(a+n<=t.Oa)return t.Da.set(e.subarray(r,r+n),a),n}var o=t.Da?t.Da.length:0;if(o>=(i=a+n)||(i=Math.max(i,o*(1048576>o?2:1.125)>>>0),0!=o&&(i=Math.max(i,256)),o=t.Da,t.Da=new Uint8Array(i),0<t.Oa&&t.Da.set(o.subarray(0,t.Oa),0)),t.Da.subarray&&e.subarray)t.Da.set(e.subarray(r,r+n),a);else for(i=0;i<n;i++)t.Da[a+i]=e[r+i];return t.Oa=Math.max(t.Oa,a+n),n},bb(t,e,r){if(1===r?e+=t.position:2===r&&Dr.isFile(t.node.mode)&&(e+=t.node.Oa),0>e)throw new Dr.ya(28);return e},wb(t,e,r,n,a){if(!Dr.isFile(t.node.mode))throw new Dr.ya(43);if(t=t.node.Da,2&a||!t||t.buffer!==v.buffer){if(n=!0,R(),!(a=void 0))throw new Dr.ya(48);t&&((0<r||r+e<t.length)&&(t=t.subarray?t.subarray(r,r+e):Array.prototype.slice.call(t,r,r+e)),v.set(t,a))}else n=!1,a=t.byteOffset;return{La:a,Ic:n}},Bb:(t,e,r,n)=>(nr.Ca.write(t,e,0,n,r,!1),0)}},ar=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},ir=0,or=null,sr=()=>{if(ir--,r.monitorRunDependencies?.(ir),0==ir&&or){var t=or;or=null,t()}},lr=()=>{ir++,r.monitorRunDependencies?.(ir)},ur=[],cr=async(t,e,r,n,a,i,o,l)=>{var u=e?qe(Ie(t+"/"+e)):t;lr();try{var c=r;"string"==typeof r&&(c=await(async t=>(t=await s(t),new Uint8Array(t)))(r)),c=await(async(t,e)=>{for(var r of("undefined"!=typeof Browser&&hr(),ur))if(r.canHandle(e))return r.handle(t,e);return t})(c,u),l?.(),i||br(t,e,c,n,a,o)}finally{sr()}};function hr(){var t,e,n;Dr.Lb=!0,t??=r.stdin,e??=r.stdout,n??=r.stderr,t?Dr.pb("/dev","stdin",t):Dr.symlink("/dev/tty","/dev/stdin"),e?Dr.pb("/dev","stdout",null,e):Dr.symlink("/dev/tty","/dev/stdout"),n?Dr.pb("/dev","stderr",null,n):Dr.symlink("/dev/tty1","/dev/stderr"),Dr.open("/dev/stdin",0),Dr.open("/dev/stdout",1),Dr.open("/dev/stderr",1)}function dr(t,e){Dr.Zb[t]={Ca:e}}function fr(t){return 16384==(61440&t)}function pr(t,e){var r=fr(t.mode)?(r=_r(t,"x"))?r:t.Ba.lookup?0:2:54;if(r)throw new Dr.ya(r);for(r=Dr.mb[wr(t.id,e)];r;r=r.ub)if(r.parent.id===t.id&&r.name===e)return r;return Dr.lookup(t,e)}function mr(t){var e=wr(t.parent.id,t.name);if(Dr.mb[e]===t)Dr.mb[e]=t.ub;else for(e=Dr.mb[e];e;){if(e.ub===t){e.ub=t.ub;break}e=e.ub}}function br(t,e,r,n,a,i){var o=e;if(t&&(t="string"==typeof t?t:yr(t),o=e?Ie(t+"/"+e):t),t=ar(n,a),o=Dr.create(o,t),r){if("string"==typeof r){for(e=Array(r.length),n=0,a=r.length;n<a;++n)e[n]=r.charCodeAt(n);r=e}Dr.chmod(o,146|t),e=Dr.open(o,577),Dr.write(e,r,0,r.length,0,i),Dr.close(e),Dr.chmod(o,t)}}function vr(t,e={}){if(!t)throw new Dr.ya(44);e.Eb??(e.Eb=!0),"/"===t.charAt(0)||(t=Dr.cwd()+"/"+t);var r=0;t:for(;40>r;r++){t=t.split("/").filter(t=>!!t);for(var n=Dr.root,a="/",i=0;i<t.length;i++){var o=i===t.length-1;if(o&&e.parent)break;if("."!==t[i])if(".."===t[i]){if(a=Ge(a),Dr.Nb(n)){t=a+"/"+t.slice(i+1).join("/"),r--;continue t}n=n.parent}else{a=Ie(a+"/"+t[i]);try{n=pr(n,t[i])}catch(t){if(44===t?.sb&&o&&e.Ac)return{path:a};throw t}if(!n.ib||o&&!e.Eb||(n=n.ib.root),40960==(61440&n.mode)&&(!o||e.gb)){if(!n.Ba.readlink)throw new Dr.ya(52);"/"===(n=n.Ba.readlink(n)).charAt(0)||(n=Ge(a)+"/"+n),t=n+"/"+t.slice(i+1).join("/");continue t}}}return{path:a,node:n}}throw new Dr.ya(32)}function yr(t){for(var e;;){if(Dr.Nb(t))return t=t.Ma.ec,e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t;e=e?`${t.name}/${e}`:t.name,t=t.parent}}function wr(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%Dr.mb.length}function gr(t){var e=wr(t.parent.id,t.name);t.ub=Dr.mb[e],Dr.mb[e]=t}function $r(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e}function _r(t,e){return Dr.bc?0:!e.includes("r")||292&t.mode?e.includes("w")&&!(146&t.mode)||e.includes("x")&&!(73&t.mode)?2:0:2}function Ar(t,e){if(!fr(t.mode))return 54;try{return pr(t,e),20}catch(t){}return _r(t,"wx")}function xr(t,e,r){try{var n=pr(t,e)}catch(t){return t.sb}if(t=_r(t,"wx"))return t;if(r){if(!fr(n.mode))return 54;if(Dr.Nb(n)||yr(n)===Dr.cwd())return 10}else if(fr(n.mode))return 31;return 0}function Sr(t,e){if(!t)throw new Dr.ya(e);return t}function Cr(t){if(!(t=Dr.wc(t)))throw new Dr.ya(8);return t}function Er(t,e=-1){if(t=Object.assign(new Dr.lc,t),-1==e)t:{for(e=0;e<=Dr.nc;e++)if(!Dr.streams[e])break t;throw new Dr.ya(33)}return t.fd=e,Dr.streams[e]=t}function kr(t,e,r){var n=t?.Ca.jb;t=n?t:e,n??=e.Ba.jb,Sr(n,63),n(t,r)}function Tr(t){var e=[];for(t=[t];t.length;){var r=t.pop();e.push(r),t.push(...r.Ab)}return e}function Or(t){var e={Lc:4096,Xc:4096,blocks:1e6,Kc:5e5,Jc:5e5,files:Dr.Pb,Vc:Dr.Pb-1,Yc:42,flags:2,gd:255};return t.Ba.ic&&Object.assign(e,t.Ba.ic(t.Ma.Bc.root)),e}function zr(t,e,r){return void 0===r&&(r=e,e=438),Dr.lb(t,8192|e,r)}function Pr(t,e,r,n){kr(t,e,{mode:4095&r|-4096&e.mode,ctime:Date.now(),$b:n})}function Br(t,e,r){if(fr(e.mode))throw new Dr.ya(31);if(!Dr.isFile(e.mode))throw new Dr.ya(28);var n=_r(e,"w");if(n)throw new Dr.ya(n);kr(t,e,{size:r,timestamp:Date.now()})}function Rr(t){if(!(t.yc||t.zc||t.link||t.Da))if(globalThis.XMLHttpRequest)R("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{t.Da=l(t.url)}catch(t){throw new Dr.ya(29)}}var Dr={root:null,Ab:[],Zb:{},streams:[],Pb:1,mb:null,Xb:"/",Lb:!1,bc:!0,sc:null,Hb:0,hc:{},ya:class{name="ErrnoError";constructor(t){this.sb=t}},lc:class{ob={};node=null;get object(){return this.node}set object(t){this.node=t}get flags(){return this.ob.flags}set flags(t){this.ob.flags=t}get position(){return this.ob.position}set position(t){this.ob.position=t}},kc:class{Ba={};Ca={};ib=null;constructor(t,e,r,n){t||=this,this.parent=t,this.Ma=t.Ma,this.id=Dr.Pb++,this.name=e,this.mode=r,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return!(365&~this.mode)}set read(t){t?this.mode|=365:this.mode&=-366}get write(){return!(146&~this.mode)}set write(t){t?this.mode|=146:this.mode&=-147}get zc(){return fr(this.mode)}get yc(){return 8192==(61440&this.mode)}},createNode:(t,e,r,n)=>(gr(t=new Dr.kc(t,e,r,n)),t),Nb:t=>t===t.parent,isFile:t=>32768==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>!(49152&~t),nc:4096,wc:t=>Dr.streams[t],Uc:(t,e=-1)=>(t=Er(t,e),t.Ca?.Tc?.(t),t),oc:{open(t){t.Ca=Dr.uc(t.node.rdev).Ca,t.Ca.open?.(t)},bb(){throw new Dr.ya(70)}},Ob:t=>t>>8,dd:t=>255&t,tb:(t,e)=>t<<8|e,uc:t=>Dr.Zb[t],jc(t,e){function r(t){return Dr.Hb--,e(t)}function n(t){if(t){if(!n.rc)return n.rc=!0,r(t)}else++o>=i.length&&r(null)}"function"==typeof t&&(e=t,t=!1),Dr.Hb++,1<Dr.Hb&&T(`warning: ${Dr.Hb} FS.syncfs operations in flight at once, probably just doing extra work`);var a,i=Tr(Dr.root.Ma),o=0;for(a of i)a.type.jc?a.type.jc(a,t,n):n(null)},Ma(t,e,r){var n="/"===r;if(n&&Dr.root)throw new Dr.ya(10);if(!n&&r){var a=vr(r,{Eb:!1});if(r=a.path,(a=a.node).ib)throw new Dr.ya(10);if(!fr(a.mode))throw new Dr.ya(54)}return(t=t.Ma(e={type:t,Bc:e,ec:r,Ab:[]})).Ma=e,e.root=t,n?Dr.root=t:a&&(a.ib=e,a.Ma&&a.Ma.Ab.push(e)),t},od(t){if(!(t=vr(t,{Eb:!1})).node.ib)throw new Dr.ya(28);var e=(t=t.node).ib,r=Tr(e);for([,a]of Object.entries(Dr.mb))for(;a;){var n=a.ub;r.includes(a.Ma)&&mr(a);var a=n}t.ib=null,t.Ma.Ab.splice(t.Ma.Ab.indexOf(e),1)},lookup:(t,e)=>t.Ba.lookup(t,e),lb(t,e,r){var n=vr(t,{parent:!0}).node;if(!(t=He(t)))throw new Dr.ya(28);if("."===t||".."===t)throw new Dr.ya(20);var a=Ar(n,t);if(a)throw new Dr.ya(a);if(!n.Ba.lb)throw new Dr.ya(63);return n.Ba.lb(n,t,e,r)},ic:t=>Or(vr(t,{gb:!0}).node),kd:t=>Or(t.node),create:(t,e=438)=>Dr.lb(t,4095&e|32768,0),mkdir:(t,e=511)=>Dr.lb(t,1023&e|16384,0),ed(t,e){var r,n=t.split("/"),a="";for(r of n)if(r){(a||"/"===t.charAt(0))&&(a+="/"),a+=r;try{Dr.mkdir(a,e)}catch(t){if(20!=t.sb)throw t}}},symlink(t,e){if(!qe(t))throw new Dr.ya(44);var r=vr(e,{parent:!0}).node;if(!r)throw new Dr.ya(44);var n=Ar(r,e=He(e));if(n)throw new Dr.ya(n);if(!r.Ba.symlink)throw new Dr.ya(63);return r.Ba.symlink(r,e,t)},rename(t,e){var r=Ge(t),n=Ge(e),a=He(t),i=He(e),o=vr(t,{parent:!0}),s=o.node;if(o=(o=vr(e,{parent:!0})).node,!s||!o)throw new Dr.ya(44);if(s.Ma!==o.Ma)throw new Dr.ya(75);var l=pr(s,a);if("."!==(t=Ke(t,n)).charAt(0))throw new Dr.ya(28);if("."!==(t=Ke(e,r)).charAt(0))throw new Dr.ya(55);try{var u=pr(o,i)}catch(t){}if(l!==u){if(a=xr(s,a,e=fr(l.mode)))throw new Dr.ya(a);if(a=u?xr(o,i,e):Ar(o,i))throw new Dr.ya(a);if(!s.Ba.rename)throw new Dr.ya(63);if(l.ib||u&&u.ib)throw new Dr.ya(10);if(o!==s&&(a=_r(s,"w")))throw new Dr.ya(a);mr(l);try{s.Ba.rename(l,o,i),l.parent=o}catch(t){throw t}finally{gr(l)}}},rmdir(t){var e=vr(t,{parent:!0}).node,r=pr(e,t=He(t)),n=xr(e,t,!0);if(n)throw new Dr.ya(n);if(!e.Ba.rmdir)throw new Dr.ya(63);if(r.ib)throw new Dr.ya(10);e.Ba.rmdir(e,t),mr(r)},readdir:t=>Sr((t=vr(t,{gb:!0}).node).Ba.readdir,54)(t),unlink(t){var e=vr(t,{parent:!0}).node;if(!e)throw new Dr.ya(44);var r=pr(e,t=He(t)),n=xr(e,t,!1);if(n)throw new Dr.ya(n);if(!e.Ba.unlink)throw new Dr.ya(63);if(r.ib)throw new Dr.ya(10);e.Ba.unlink(e,t),mr(r)},readlink(t){if(!(t=vr(t).node))throw new Dr.ya(44);if(!t.Ba.readlink)throw new Dr.ya(28);return t.Ba.readlink(t)},stat:(t,e)=>Sr((t=vr(t,{gb:!e}).node).Ba.hb,63)(t),fstat(t){var e=Cr(t);t=e.node;var r=e.Ca.hb;return e=r?e:t,r??=t.Ba.hb,Sr(r,63),r(e)},lstat:t=>Dr.stat(t,!0),chmod(t,e,r){Pr(null,t="string"==typeof t?vr(t,{gb:!r}).node:t,e,r)},lchmod(t,e){Dr.chmod(t,e,!0)},fchmod(t,e){Pr(t=Cr(t),t.node,e,!1)},chown(t,e,r,n){kr(null,t="string"==typeof t?vr(t,{gb:!n}).node:t,{timestamp:Date.now(),$b:n})},lchown(t,e,r){Dr.chown(t,e,r,!0)},fchown(t){kr(t=Cr(t),t.node,{timestamp:Date.now(),$b:!1})},truncate(t,e){if(0>e)throw new Dr.ya(28);Br(null,t="string"==typeof t?vr(t,{gb:!0}).node:t,e)},Zc(t,e){if(t=Cr(t),0>e||!(2097155&t.flags))throw new Dr.ya(28);Br(t,t.node,e)},pd(t,e,r){Sr((t=vr(t,{gb:!0}).node).Ba.jb,63)(t,{atime:e,mtime:r})},open(t,e,n=438){if(""===t)throw new Dr.ya(44);if("string"==typeof e){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===a)throw Error(`Unknown file open mode: ${e}`);e=a}if(n=64&e?4095&n|32768:0,"object"==typeof t)a=t;else{var i=t.endsWith("/");a=(t=vr(t,{gb:!(131072&e),Ac:!0})).node,t=t.path}var o=!1;if(64&e)if(a){if(128&e)throw new Dr.ya(20)}else{if(i)throw new Dr.ya(31);a=Dr.lb(t,511|n,0),o=!0}if(!a)throw new Dr.ya(44);if(8192==(61440&a.mode)&&(e&=-513),65536&e&&!fr(a.mode))throw new Dr.ya(54);if(!o&&(i=a?40960==(61440&a.mode)?32:fr(a.mode)&&("r"!==$r(e)||576&e)?31:_r(a,$r(e)):44))throw new Dr.ya(i);return 512&e&&!o&&Dr.truncate(a,0),e&=-131713,(i=Er({node:a,path:yr(a),flags:e,seekable:!0,position:0,Ca:a.Ca,Hc:[],error:!1})).Ca.open&&i.Ca.open(i),o&&Dr.chmod(a,511&n),!r.logReadFiles||1&e||t in Dr.hc||(Dr.hc[t]=1),i},close(t){if(null===t.fd)throw new Dr.ya(8);t.Kb&&(t.Kb=null);try{t.Ca.close&&t.Ca.close(t)}catch(t){throw t}finally{Dr.streams[t.fd]=null}t.fd=null},bb(t,e,r){if(null===t.fd)throw new Dr.ya(8);if(!t.seekable||!t.Ca.bb)throw new Dr.ya(70);if(0!=r&&1!=r&&2!=r)throw new Dr.ya(28);return t.position=t.Ca.bb(t,e,r),t.Hc=[],t.position},read(t,e,r,n,a){if(0>n||0>a)throw new Dr.ya(28);if(null===t.fd)throw new Dr.ya(8);if(1==(2097155&t.flags))throw new Dr.ya(8);if(fr(t.node.mode))throw new Dr.ya(31);if(!t.Ca.read)throw new Dr.ya(28);var i=void 0!==a;if(i){if(!t.seekable)throw new Dr.ya(70)}else a=t.position;return e=t.Ca.read(t,e,r,n,a),i||(t.position+=e),e},write(t,e,r,n,a,i){if(0>n||0>a)throw new Dr.ya(28);if(null===t.fd)throw new Dr.ya(8);if(!(2097155&t.flags))throw new Dr.ya(8);if(fr(t.node.mode))throw new Dr.ya(31);if(!t.Ca.write)throw new Dr.ya(28);t.seekable&&1024&t.flags&&Dr.bb(t,0,2);var o=void 0!==a;if(o){if(!t.seekable)throw new Dr.ya(70)}else a=t.position;return e=t.Ca.write(t,e,r,n,a,i),o||(t.position+=e),e},wb(t,e,r,n,a){if(2&n&&!(2&a)&&2!=(2097155&t.flags))throw new Dr.ya(2);if(1==(2097155&t.flags))throw new Dr.ya(2);if(!t.Ca.wb)throw new Dr.ya(43);if(!e)throw new Dr.ya(28);return t.Ca.wb(t,e,r,n,a)},Bb:(t,e,r,n,a)=>t.Ca.Bb?t.Ca.Bb(t,e,r,n,a):0,cc(t,e,r){if(!t.Ca.cc)throw new Dr.ya(59);return t.Ca.cc(t,e,r)},readFile(t,e={}){e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding&&R(`Invalid encoding type "${e.encoding}"`);var r=Dr.open(t,e.flags);t=Dr.stat(t).size;var n=new Uint8Array(t);return Dr.read(r,n,0,t,0),"utf8"===e.encoding&&(n=Ze(n)),Dr.close(r),n},writeFile(t,e,r={}){r.flags=r.flags||577,t=Dr.open(t,r.flags,r.mode),"string"==typeof e&&(e=new Uint8Array(Xe(e))),ArrayBuffer.isView(e)?Dr.write(t,e,0,e.byteLength,void 0,r.Rc):R("Unsupported data type"),Dr.close(t)},cwd:()=>Dr.Xb,chdir(t){if(null===(t=vr(t,{gb:!0})).node)throw new Dr.ya(44);if(!fr(t.node.mode))throw new Dr.ya(54);var e=_r(t.node,"x");if(e)throw new Dr.ya(e);Dr.Xb=t.path},jd(){for(var t of(Dr.Lb=!1,Dr.streams))t&&Dr.close(t)},Wc(t,e){try{var r=vr(t,{gb:!e});t=r.path}catch(t){}var n=!1,a=null;try{r=vr(t,{parent:!0}),He(t),r=vr(t,{gb:!e}),n=!0,a=r.node}catch(t){}return n?a:null},pb(t,e,r,n){var a;return t=((t,e)=>Ie(t+"/"+e))("string"==typeof t?t:yr(t),e),e=ar(!!r,!!n),(a=Dr.pb).Ob??(a.Ob=64),dr(a=Dr.tb(Dr.pb.Ob++,0),{open(t){t.seekable=!1},close(){n?.buffer?.length&&n(10)},read(t,e,n,a){for(var i=0,o=0;o<a;o++){try{var s=r()}catch(t){throw new Dr.ya(29)}if(void 0===s&&0===i)throw new Dr.ya(6);if(null==s)break;i++,e[n+o]=s}return i&&(t.node.atime=Date.now()),i},write(t,e,r,a){for(var i=0;i<a;i++)try{n(e[r+i])}catch(t){throw new Dr.ya(29)}return a&&(t.node.mtime=t.node.ctime=Date.now()),i}}),zr(t,e,a)}},Mr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];if((()=>{let t=rt.prototype;Object.assign(t,{isAliasOf:function(t){if(!(this instanceof rt&&t instanceof rt))return!1;var e=this.za.Na.Ka,r=this.za.La;t.za=t.za;var n=t.za.Na.Ka;for(t=t.za.La;e.ab;)r=e.Db(r),e=e.ab;for(;n.ab;)t=n.Db(t),n=n.ab;return e===n&&r===t},clone:function(){if(this.za.La||J(this),this.za.Cb)return this.za.count.value+=1,this;var t=et,e=Object,r=e.create,n=Object.getPrototypeOf(this),a=this.za;return(t=t(r.call(e,n,{za:{value:{count:a.count,zb:a.zb,Cb:a.Cb,La:a.La,Na:a.Na,Za:a.Za,cb:a.cb}}}))).za.count.value+=1,t.za.zb=!1,t},delete(){if(this.za.La||J(this),this.za.zb&&!this.za.Cb)throw new K("Object already scheduled for deletion");tt(this);var t=this.za;--t.count.value,0===t.count.value&&(t.Za?t.cb.qb(t.Za):t.Na.Ka.qb(t.La)),this.za.Cb||(this.za.Za=void 0,this.za.La=void 0)},isDeleted:function(){return!this.za.La},deleteLater:function(){if(this.za.La||J(this),this.za.zb&&!this.za.Cb)throw new K("Object already scheduled for deletion");return this.za.zb=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)})(),Object.assign(wt.prototype,{vc(t){return this.fc&&(t=this.fc(t)),t},Yb(t){this.qb?.(t)},nb:ft,$a:function(t){function e(){return vt(this.Ka.vb,this.Gb?{Na:this.Cc,La:r,cb:this,Za:t}:{Na:this,La:t})}var r=this.vc(t);if(!r)return this.Yb(t),null;var n=((t,e)=>{if(void 0===e)throw new K("ptr should not be undefined");for(;t.ab;)e=t.Db(e),t=t.ab;return mt[e]})(this.Ka,r);if(void 0!==n)return 0===n.za.count.value?(n.za.La=r,n.za.Za=t,n.clone()):(n=n.clone(),this.Yb(t),n);if(n=this.Ka.tc(r),!(n=at[n]))return e.call(this);var a=pt(r,this.Ka,(n=this.Fb?n.pc:n.pointerType).Ka);return null===a?e.call(this):vt(n.Ka.vb,this.Gb?{Na:n,La:a,cb:this,Za:t}:{Na:n,La:a})}}),Dr.Sc=(t,e,r,n,a,i,o,s,l,u)=>{cr(t,e,r,n,a,s,l,u).then(i).catch(o)},Dr.hd=cr,Dr.mb=Array(4096),Dr.Ma(nr,{},"/"),Dr.mkdir("/tmp"),Dr.mkdir("/home"),Dr.mkdir("/home/web_user"),function(){Dr.mkdir("/dev"),dr(Dr.tb(1,3),{read:()=>0,write:(t,e,r,n)=>n,bb:()=>0}),zr("/dev/null",Dr.tb(1,3)),Qe(Dr.tb(5,0),er),Qe(Dr.tb(6,0),rr),zr("/dev/tty",Dr.tb(5,0)),zr("/dev/tty1",Dr.tb(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(We(t),e=t.byteLength),t[--e]);Dr.pb("/dev","random",r),Dr.pb("/dev","urandom",r),Dr.mkdir("/dev/shm"),Dr.mkdir("/dev/shm/tmp")}(),function(){Dr.mkdir("/proc");var t=Dr.mkdir("/proc/self");Dr.mkdir("/proc/self/fd"),Dr.Ma({Ma(){var e=Dr.createNode(t,"fd",16895,73);return e.Ca={bb:nr.Ca.bb},e.Ba={lookup(t,e){var r=Cr(t=+e);return(t={parent:null,Ma:{ec:"fake"},Ba:{readlink:()=>r.path},id:t+1}).parent=t},readdir:()=>Array.from(Dr.streams.entries()).filter(([,t])=>t).map(([t])=>t.toString())},e}},{},"/proc/self/fd")}(),Dr.sc={MEMFS:nr},r.noExitRuntime&&(N=r.noExitRuntime),r.preloadPlugins&&(ur=r.preloadPlugins),r.print&&(k=r.print),r.printErr&&(T=r.printErr),r.wasmBinary&&(f=r.wasmBinary),r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.shift()();r.addRunDependency=lr,r.removeRunDependency=sr,r.FS_preloadFile=cr,r.FS_unlink=(...t)=>Dr.unlink(...t),r.FS_createPath=(...t)=>function(t,e){for(t="string"==typeof t?t:yr(t),e=e.split("/").reverse();e.length;){var r=e.pop();if(r){var n=Ie(t+"/"+r);try{Dr.mkdir(n)}catch(t){if(20!=t.sb)throw t}t=n}}return n}(...t),r.FS_createDevice=(...t)=>Dr.pb(...t),r.FS=Dr,r.FS_createDataFile=(...t)=>br(...t),r.FS_createLazyFile=(...t)=>function(t,e,r,n,i){class o{Ib=!1;ob=[];Rb=void 0;Tb=0;Sb=0;get(t){if(!(t>this.length-1||0>t)){var e=t%this.chunkSize;return this.Rb(t/this.chunkSize|0)[e]}}mc(t){this.Rb=t}Ub(){var t=new XMLHttpRequest;t.open("HEAD",r,!1),t.send(null),200<=t.status&&300>t.status||304===t.status||R("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),a=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e;t=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e;var i=1048576;a||(i=n);var o=this;o.mc(t=>{var e=t*i,a=(t+1)*i-1;if(a=Math.min(a,n-1),void 0===o.ob[t]){var s=o.ob;e>a&&R("invalid range ("+e+", "+a+") or no bytes requested!"),a>n-1&&R("only "+n+" bytes available! programmer error!");var l=new XMLHttpRequest;l.open("GET",r,!1),n!==i&&l.setRequestHeader("Range","bytes="+e+"-"+a),l.responseType="arraybuffer",l.overrideMimeType&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send(null),200<=l.status&&300>l.status||304===l.status||R("Couldn't load "+r+". Status: "+l.status),e=void 0!==l.response?new Uint8Array(l.response||[]):Xe(l.responseText||""),s[t]=e}return void 0===o.ob[t]&&R("doXHR failed!"),o.ob[t]}),!t&&n||(i=n=1,i=n=this.Rb(0).length,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this.Tb=n,this.Sb=i,this.Ib=!0}get length(){return this.Ib||this.Ub(),this.Tb}get chunkSize(){return this.Ib||this.Ub(),this.Sb}}if(globalThis.XMLHttpRequest){a||R("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new o,l=void 0}else l=r,s=void 0;var u=function(t,e,r,n){return t="string"==typeof t?t:yr(t),e=Ie(t+"/"+e),Dr.create(e,ar(r,n))}(t,e,n,i);s?u.Da=s:l&&(u.Da=null,u.url=l),Object.defineProperties(u,{Oa:{get:function(){return this.Da.length}}}),t={};for(const[e,r]of Object.entries(u.Ca))t[e]=(...t)=>(Rr(u),r(...t));return t.read=(t,e,r,n,a)=>{if(Rr(u),a>=(t=t.node.Da).length)e=0;else{if(n=Math.min(t.length-a,n),t.slice)for(var i=0;i<n;i++)e[r+i]=t[a+i];else for(i=0;i<n;i++)e[r+i]=t.get(a+i);e=n}return e},t.wb=()=>{throw Rr(u),R(),new Dr.ya(48)},u.Ca=t,u}(...t);var Ur,Fr,Lr,Nr,jr,Vr,Ir,Gr,Hr,Wr,qr,Kr,Zr,Yr,Xr,Jr,Qr,tn,en,rn,nn,an,on,sn,ln,un={b:(t,e,r,n)=>R(`Assertion failed: ${I(t)}, at: `+[e?I(e):"unknown filename",r,n?I(n):"unknown function"]),P:()=>R(""),F:(t,e,r,n,a)=>{e=G(e);let i=t=>t;if(n=0n===n){const t=8*r;i=e=>BigInt.asUintN(t,e),a=i(a)}Y(t,{name:e,$a:i,eb:(t,e)=>("number"==typeof e&&(e=BigInt(e)),e),nb:X(e,r,!n),fb:null})},la:(t,e,r,n)=>{Y(t,{name:e=G(e),$a:function(t){return!!t},eb:function(t,e){return e?r:n},nb:function(t){return this.$a(y[t])},fb:null})},ia:(t,e,r,n,a,i,o,s,l,u,c,h,d)=>{c=G(c),i=$t(a,i),s&&=$t(o,s),u&&=$t(l,u),d=$t(h,d);var f=(t=>{var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?`_${t}`:t})(c);ot(f,function(){xt(`Cannot construct ${c} due to unbound types`,[n])}),St([t,e,r],n?[n]:[],e=>{if(e=e[0],n)var r=e.Ka,a=r.vb;else a=rt.prototype;e=nt(c,function(...t){if(Object.getPrototypeOf(this)!==o)throw new K(`Use 'new' to construct ${c}`);if(void 0===h.rb)throw new K(`${c} has no accessible constructor`);var e=h.rb[t.length];if(void 0===e)throw new K(`Tried to invoke ctor of ${c} with invalid number of parameters (${t.length}) - expected (${Object.keys(h.rb).toString()}) parameters instead!`);return e.apply(this,t)});var o=Object.create(a,{constructor:{value:e}});e.prototype=o;var l,h=new st(c,e,o,d,r,i,s,u);return h.ab&&((l=h.ab).Vb??(l.Vb=[]),h.ab.Vb.push(h)),r=new wt(c,h,!0,!1,!1),l=new wt(c+"*",h,!1,!1,!1),a=new wt(c+" const*",h,!1,!0,!1),at[t]={pointerType:l,pc:a},gt(f,e),[r,l,a]})},$:(t,e,r,n,a,i)=>{var o=Ct(e,r);a=$t(n,a),St([],[t],t=>{var r=`constructor ${(t=t[0]).name}`;if(void 0===t.Ka.rb&&(t.Ka.rb=[]),void 0!==t.Ka.rb[e-1])throw new K(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.Ka.rb[e-1]=()=>{xt(`Cannot construct ${t.name} due to unbound types`,o)},St([],o,n=>(n.splice(1,0,null),t.Ka.rb[e-1]=Tt(r,n,null,a,i),[])),[]})},i:(t,e,r,n,a,i,o,s,l)=>{var u=Ct(r,n);e=G(e),e=Ot(e),i=$t(a,i),St([],[t],t=>{function n(){xt(`Cannot call ${a} due to unbound types`,u)}var a=`${(t=t[0]).name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.Ka.Dc.push(e);var c=t.Ka.vb,h=c[e];return void 0===h||void 0===h.Ya&&h.className!==t.name&&h.yb===r-2?(n.yb=r-2,n.className=t.name,c[e]=n):(it(c,e,a),c[e].Ya[r-2]=n),St([],u,n=>(n=Tt(a,n,t,i,o,l),void 0===c[e].Ya?(n.yb=r-2,c[e]=n):c[e].Ya[r-2]=n,[])),[]})},ja:t=>Y(t,Mt),E:(t,e,r)=>{Y(t,{name:e=G(e),$a:t=>t,eb:(t,e)=>e,nb:Ut(e,r),fb:null})},G:(t,e,r,n,a,i,o)=>{var s=Ct(e,r);t=G(t),t=Ot(t),a=$t(n,a),ot(t,function(){xt(`Cannot call ${t} due to unbound types`,s)},e-1),St([],s,r=>(r=[r[0],null].concat(r.slice(1)),gt(t,Tt(t,r,null,a,i,o),e-1),[]))},k:(t,e,r,n,a)=>{e=G(e);let i=t=>t;if(0===n){var o=32-8*r;i=t=>t<<o>>>o,a=i(a)}Y(t,{name:e,$a:i,eb:(t,e)=>e,nb:X(e,r,0!==n),fb:null})},h:(t,e,r)=>{function n(t){return new a(v.buffer,_[t+4>>2],_[t>>2])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];Y(t,{name:r=G(r),$a:n,nb:n},{xc:!0})},ka:(t,e)=>{Y(t,{name:e=G(e),$a(t){var e=I(t+4,_[t>>2],!0);return Lr(t),e},eb(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;if(!(r||ArrayBuffer.isView(e)&&1==e.BYTES_PER_ELEMENT))throw new K("Cannot pass non-string to std::string");var n=r?Lt(e):e.length,a=Ur(4+n+1),i=a+4;return _[a>>2]=n,r?Ft(e,y,i,n+1):y.set(e,i),null!==t&&t.push(Lr,a),a},nb:ft,fb(t){Lr(t)}})},w:(t,e,r)=>{if(r=G(r),2===e)var n=jt,a=Vt,i=It;else n=Gt,a=Ht,i=Wt;Y(t,{name:r,$a:t=>{var r=n(t+4,_[t>>2]*e,!0);return Lr(t),r},eb:(t,n)=>{if("string"!=typeof n)throw new K(`Cannot pass non-string to C++ string type ${r}`);var o=i(n),s=Ur(4+o+e);return _[s>>2]=o/e,a(n,s+4,o+e),null!==t&&t.push(Lr,s),s},nb:ft,fb(t){Lr(t)}})},x:t=>{Y(t,Mt)},ma:(t,e)=>{Y(t,{dc:!0,name:e=G(e),$a:()=>{},eb:()=>{}})},J:()=>{N=!1,qt=0},m:(t,e,r)=>{var[n,...a]=((t,e)=>{for(var r=Array(t),n=0;n<t;++n){var a=n,i=_[e+4*n>>2],o=W[i];if(void 0===o)throw t=`parameter ${n} has unknown type ${At(i)}`,new K(t);r[a]=o}return r})(t,e);e=n.eb.bind(n);var i=a.map(t=>t.nb.bind(t));t--;var o={toValue:Rt};switch(t=i.map((t,e)=>{var r=`argFromPtr${e}`;return o[r]=t,`${r}(args${e?"+"+8*e:""})`}),r){case 0:var s="toValue(handle)";break;case 2:s="new (toValue(handle))";break;case 3:s="";break;case 1:o.getStringOrSymbol=Xt,s="toValue(handle)[getStringOrSymbol(methodName)]"}return s+=`(${t})`,n.dc||(o.toReturnWire=e,o.emval_returnValue=Zt,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) {\n ${s}\n }`,r=new Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${a.map(t=>t.name)}) => ${n.name}>`,(t=>{var e=Kt.length;return Kt.push(t),e})(nt(s,r))},ga:Bt,na:t=>t?(t=Xt(t),Dt(globalThis[t])):Dt(globalThis),o:(t,e)=>(t=Rt(t),e=Rt(e),Dt(t[e])),y:t=>{9<t&&(Pt[t+1]+=1)},l:(t,e,r,n,a)=>Kt[t](e,r,n,a),oa:t=>Dt(Xt(t)),H:t=>{var e=Rt(t);Et(e),Bt(t)},K:(t,e)=>{if(Jt[t]&&(clearTimeout(Jt[t].id),delete Jt[t]),!e)return 0;var r=setTimeout(()=>{delete Jt[t],te(()=>en(t,performance.now()))},e);return Jt[t]={id:r,md:e},0},O:t=>{var e=y.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var n=e*(1+.2/r);n=Math.min(n,t+100663296);t:{n=(Math.min(2147483648,65536*Math.ceil(Math.max(t,n)/65536))-on.buffer.byteLength+65535)/65536|0;try{on.grow(n),B();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},T:function(t,e,r,n,a,i){e=je(e),r=je(r),t=ae(t);var o={};if(i){var s=_[i+12>>2];if(s){var l=_[i+16>>2];o.requiredFeatures=Array.from(_.subarray(l>>2,l+4*s>>2),t=>we[t])}var u=_[i+20>>2];if(u){var c={};function h(t,e,r=!1){4294967295==(e=_[u+e>>2])||r&&0==e||(c[t]=e)}function d(t,e){4294967295==_[(e=u+e)>>2]&&4294967295==_[e+4>>2]||(c[t]=4294967296*_[e+4>>2]+_[e>>2])}h("maxTextureDimension1D",4),h("maxTextureDimension2D",8),h("maxTextureDimension3D",12),h("maxTextureArrayLayers",16),h("maxBindGroups",20),h("maxBindGroupsPlusVertexBuffers",24),h("maxDynamicUniformBuffersPerPipelineLayout",32),h("maxDynamicStorageBuffersPerPipelineLayout",36),h("maxSampledTexturesPerShaderStage",40),h("maxSamplersPerShaderStage",44),h("maxStorageBuffersPerShaderStage",48),h("maxStorageTexturesPerShaderStage",52),h("maxUniformBuffersPerShaderStage",56),h("minUniformBufferOffsetAlignment",80),h("minStorageBufferOffsetAlignment",84),d("maxUniformBufferBindingSize",64),d("maxStorageBufferBindingSize",72),h("maxVertexBuffers",88),d("maxBufferSize",96),h("maxVertexAttributes",104),h("maxVertexBufferArrayStride",108),h("maxInterStageShaderVariables",112),h("maxColorAttachments",116),h("maxColorAttachmentBytesPerSample",120),h("maxComputeWorkgroupStorageSize",124),h("maxComputeInvocationsPerWorkgroup",128),h("maxComputeWorkgroupSizeX",132),h("maxComputeWorkgroupSizeY",136),h("maxComputeWorkgroupSizeZ",140),h("maxComputeWorkgroupsPerDimension",144),h("maxImmediateSize",148,!0),o.requiredLimits=c}(s=_[i+24>>2])&&(s={label:oe(s+4)},o.defaultQueue=s),o.label=oe(i+4)}t.requestDevice(o).then(t=>{te(()=>{re[a>>>0]=t.queue,re[n>>>0]=t,t.lost.then(e=>{te(()=>{t.onuncapturederror=()=>{};var n=an(),a=ee(e.message);Xr(r,Ne[e.reason],a),rn(n)})}),t.onuncapturederror=t=>{var e=5;t.error instanceof GPUValidationError?e=2:t.error instanceof GPUOutOfMemoryError?e=3:t.error instanceof GPUInternalError&&(e=4);var r=an();t=ee(t.error.message),tn(n,e,t),rn(r)},Qr(e,1,n,0)})},t=>{te(()=>{var a=an(),i=ee(t.message);Qr(e,3,n,i),r&&Xr(r,4,i),rn(a)})})},V:t=>{var e=ae(t),r=ne[t];if(r){for(var n=0;n<r.length;++n)r[n]();delete ne[t]}e.destroy()},d:t=>{delete re[t]},S:(t,e,r)=>{var n=!!_[e+32>>2];e={label:oe(e+4),usage:_[e+16>>2],size:4294967296*_[e+4+24>>2]+_[e+24>>2],mappedAtCreation:n},t=ae(t);try{var a=t.createBuffer(e)}catch(t){return!1}return re[r>>>0]=a,n&&(ne[r]=[]),!0},R:(t,e,r)=>{var n=_[e>>2],a=_[n+4>>2];e={label:oe(e+4),code:""},2===a&&(e.code=ie(n+8)),t=ae(t).createShaderModule(e),re[r>>>0]=t},U:t=>{(t=ae(t)).onuncapturederror=null,t.destroy()},Q:function(t,e,r,n){if(e=je(e),r){var a={featureLevel:ye[_[r+4>>2]],powerPreference:Se[_[r+8>>2]],forceFallbackAdapter:!!_[r+12>>2]};0!==(t=_[r>>2])&&(a.qd=!!_[t+8>>2])}"gpu"in navigator?navigator.gpu.requestAdapter(a).then(t=>{te(()=>{if(t)re[n>>>0]=t,Jr(e,1,n,0);else{var r=an(),a=ee("WebGPU not available on this browser (requestAdapter returned null)");Jr(e,3,n,a),rn(r)}})},t=>{te(()=>{var r=an(),a=ee(t.message);Jr(e,4,n,a),rn(r)})}):(a=an(),t=ee("WebGPU not available on this browser (navigator.gpu is not available)"),Jr(e,3,n,t),rn(a))},N:function(t){try{var e=Cr(t);return Dr.close(e),0}catch(t){if(void 0===Dr||"ErrnoError"!==t.name)throw t;return t.sb}},L:function(t,e,r,n){e=je(e);try{if(isNaN(e))return 61;var a=Cr(t);return Dr.bb(a,e,r),S[n>>3]=BigInt(a.position),a.Kb&&0===e&&0===r&&(a.Kb=null),0}catch(t){if(void 0===Dr||"ErrnoError"!==t.name)throw t;return t.sb}},M:function(t,e,r,n){try{t:{var a=Cr(t);t=e;for(var i,o=e=0;o<r;o++){var s=_[t>>2],l=_[t+4>>2];t+=8;var u=Dr.write(a,v,s,l,i);if(0>u){var c=-1;break t}if(e+=u,u<l)break;void 0!==i&&(i+=u)}c=e}return _[n>>2]=c,0}catch(t){if(void 0===Dr||"ErrnoError"!==t.name)throw t;return t.sb}},I:Qt,r:function(t){return BigInt(ae(t).size)},u:(t,e)=>{var r=_[e>>2],n=void 0;0!==r&&(n=4294967296*_[r+12>>2]+_[r+8>>2]),r=oe(e+4);for(var a=_[e+12>>2],i=_[e+16>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+56*s,h=_[c+4>>2];if(0!==h){var d=$[c+8>>2];-1==d&&(d=void 0);var f=c+24;c={view:ae(h),depthSlice:d,resolveTarget:ae(_[c+12>>2]),clearValue:{r:x[f>>3],g:x[f+8>>3],b:x[f+16>>3],a:x[f+24>>3]},loadOp:Ae[_[c+16>>2]],storeOp:ze[_[c+20>>2]]}}else c=void 0;u.call(l,c)}return a=0!==(a=_[e+20>>2])?{view:ae(_[a+4>>2]),depthClearValue:A[a+16>>2],depthLoadOp:Ae[_[a+8>>2]],depthStoreOp:ze[_[a+12>>2]],depthReadOnly:!!_[a+20>>2],stencilClearValue:_[a+32>>2],stencilLoadOp:Ae[_[a+24>>2]],stencilStoreOp:ze[_[a+28>>2]],stencilReadOnly:!!_[a+36>>2]}:void 0,i=0!==(i=_[e+28>>2])?{querySet:ae(_[i+4>>2]),beginningOfPassWriteIndex:_[i+8>>2],endOfPassWriteIndex:_[i+12>>2]}:void 0,e={label:r,colorAttachments:o,depthStencilAttachment:a,occlusionQuerySet:ae(_[e+24>>2]),timestampWrites:i,maxDrawCount:n},n=ae(t),t=Hr(0),e=n.beginRenderPass(e),re[t>>>0]=e,t},_:(t,e,r,n)=>{ae(t).copyTextureToTexture(le(e),le(r),se(n))},ba:t=>{var e=ae(t);return t=Vr(0),e=e.finish(),re[t>>>0]=e,t},q:(t,e)=>{var r=oe(e+4),n=ae(_[e+12>>2]),a=_[e+16>>2];e=_[e+20>>2];for(var i=[],o=0;o<a;++o){var s=i,l=s.push,u=e+40*o,c=_[u+8>>2],h=_[u+32>>2],d=_[u+36>>2],f=_[u+4>>2];c?(-1==(h=_[(h=u+24)>>2]+4294967296*$[h+4>>2])&&(h=void 0),u={binding:f,resource:{buffer:ae(c),offset:4294967296*_[u+4+16>>2]+_[u+16>>2],size:h}}):u=h?{binding:f,resource:ae(h)}:{binding:f,resource:ae(d)},l.call(s,u)}return r={label:r,layout:n,entries:i},n=ae(t),t=Nr(0),r=n.createBindGroup(r),re[t>>>0]=r,t},j:(t,e)=>{var r=oe(e+4),n=_[e+12>>2];e=_[e+16>>2];for(var a=[],i=0;i<n;++i){var o=e+88*i,s=_[o+4>>2],l=_[o+8>>2],u=o+24,c=_[u+4>>2];u=c?{type:pe[c],hasDynamicOffset:!!_[u+8>>2],minBindingSize:4294967296*_[u+4+16>>2]+_[u+16>>2]}:void 0,c=(c=_[o+48+4>>2])?{type:ke[c]}:void 0;var h=o+56,d=_[h+4>>2];h=d?{sampleType:De[d],viewDimension:Me[_[h+8>>2]],multisampled:!!_[h+12>>2]}:void 0,o=(d=_[(o+=72)+4>>2])?{access:Oe[d],format:Re[_[o+8>>2]],viewDimension:Me[_[o+12>>2]]}:void 0,a.push.call(a,{binding:s,visibility:l,buffer:u,sampler:c,texture:h,storageTexture:o})}return r={label:r,entries:a},n=ae(t),t=jr(0),r=n.createBindGroupLayout(r),re[t>>>0]=r,t},ca:(t,e)=>{var r;return e&&(r={label:oe(e+4)}),e=ae(t),t=Ir(0),r=e.createCommandEncoder(r),re[t>>>0]=r,t},aa:(t,e)=>{for(var r=_[e+12>>2],n=_[e+16>>2],a=[],i=0;i<r;++i)a.push(ae(_[n+4*i>>2]));return e={label:oe(e+4),bindGroupLayouts:a},r=ae(t),t=Gr(0),e=r.createPipelineLayout(e),re[t>>>0]=e,t},f:(t,e)=>{e=(t=>{function e(t){if(t)return{operation:fe[_[t>>2]],srcFactor:de[_[t+4>>2]],dstFactor:de[_[t+8>>2]]}}function r(t){return{compare:me[_[t>>2]],failOp:Te[_[t+4>>2]],depthFailOp:Te[_[t+8>>2]],passOp:Te[_[t+12>>2]]}}return{label:oe(t+4),layout:ce(_[t+12>>2]),vertex:function(t){if(t){var e=ae(_[t+4>>2]),r=ue(_[t+16>>2],_[t+20>>2]),n=_[t+24>>2],a=_[t+28>>2];if(n){for(var i=[],o=0;o<n;++o){var s=i,l=s.push,u=a+24*o;if(u){var c=_[u+4>>2],h=_[u+16>>2];if(0===c&&0===h)var d=null;else{d=4294967296*_[u+4+8>>2]+_[u+8>>2],c=Le[c],u=_[u+20>>2];for(var f=[],p=0;p<h;++p){var m=u+24*p;f.push.call(f,{format:Fe[_[m+4>>2]],offset:4294967296*_[m+4+8>>2]+_[m+8>>2],shaderLocation:_[m+16>>2]})}d={arrayStride:d,stepMode:c,attributes:f}}}else d=void 0;l.call(s,d)}n=i}else n=void 0;return{module:e,constants:r,buffers:n,entryPoint:oe(t+8)}}}(t+16),primitive:function(t){if(t)return{topology:Ee[_[t+4>>2]],stripIndexFormat:_e[_[t+8>>2]],frontFace:$e[_[t+12>>2]],cullMode:ve[_[t+16>>2]],unclippedDepth:!!_[t+20>>2]}}(t+48),depthStencil:function(t){if(t)return{format:Re[_[t+4>>2]],depthWriteEnabled:!!_[t+8>>2],depthCompare:me[_[t+12>>2]],stencilFront:r(t+16),stencilBack:r(t+32),stencilReadMask:_[t+48>>2],stencilWriteMask:_[t+52>>2],depthBias:$[t+56>>2],depthBiasSlopeScale:A[t+60>>2],depthBiasClamp:A[t+64>>2]}}(_[t+72>>2]),multisample:function(t){if(t)return{count:_[t+4>>2],mask:_[t+8>>2],alphaToCoverageEnabled:!!_[t+12>>2]}}(t+76),fragment:function(t){if(t){for(var r=ae(_[t+4>>2]),n=ue(_[t+16>>2],_[t+20>>2]),a=_[t+24>>2],i=_[t+28>>2],o=[],s=0;s<a;++s){var l=o,u=l.push,c=i+24*s,h=_[c+4>>2];if(0===h)c=void 0;else{h=Re[h];var d=(d=_[c+8>>2])?{alpha:e(d+12),color:e(d+0)}:void 0;c={format:h,blend:d,writeMask:_[c+16>>2]}}u.call(l,c)}return{module:r,constants:n,targets:o,entryPoint:oe(t+8)}}}(_[t+92>>2])}})(e);var r=ae(t);return t=Wr(0),e=r.createRenderPipeline(e),re[t>>>0]=e,t},ha:(t,e)=>{var r;return e&&(r={label:oe(e+4),addressModeU:he[_[e+12>>2]],addressModeV:he[_[e+16>>2]],addressModeW:he[_[e+20>>2]],magFilter:ge[_[e+24>>2]],minFilter:ge[_[e+28>>2]],mipmapFilter:xe[_[e+32>>2]],lodMinClamp:A[e+36>>2],lodMaxClamp:A[e+40>>2],compare:me[_[e+44>>2]],maxAnisotropy:g[e+48>>1]}),e=ae(t),t=qr(0),r=e.createSampler(r),re[t>>>0]=r,t},v:(t,e)=>{var r={label:oe(e+4),size:se(e+28),mipLevelCount:_[e+44>>2],sampleCount:_[e+48>>2],dimension:Be[_[e+24>>2]],format:Re[_[e+40>>2]],usage:_[e+16>>2]},n=_[e+52>>2];return n&&(e=_[e+56>>2],r.viewFormats=Array.from($.subarray(e>>2,e+4*n>>2),t=>Re[t])),t=ae(t),((t,e)=>{re[t>>>0]=e})(n=Zr(0),t.createTexture(r)),n},Z:(t,e)=>(t=2<(t=_[_[e>>2]+8>>2])?I(t):t,(t=(Mr[t]||("undefined"!=typeof document?document.querySelector(t):null)).getContext("webgpu"))?(t.ld=oe(e+4),e=Kr(0),re[e>>>0]=t,e):0),A:(t,e,r)=>{t=ae(t),e=Array.from($.subarray(r>>2,r+4*e>>2),t=>ae(t)),t.submit(e)},n:function(t,e,r,n,a){r=je(r),ae(t).writeBuffer(ae(e),r,y.subarray(n,n+a),0,a)},B:(t,e,r,n,a,i)=>{var o=_[a+8>>2],s=_[a+12>>2];ae(t).writeTexture(le(e),y.subarray(r,r+n),{offset:4294967296*_[a+4>>2]+_[a>>2],bytesPerRow:4294967295===o?void 0:o,rowsPerImage:4294967295===s?void 0:s},se(i))},s:(t,e,r,n,a,i)=>{ae(t).drawIndexed(e,r,n>>>0,a,i>>>0)},z:t=>{ae(t).end()},a:(t,e,r,n,a)=>{t=ae(t),r=ae(r),0==n?t.setBindGroup(e,r):t.setBindGroup(e,r,_,a>>2,n)},t:function(t,e,r,n,a){n=je(n),a=je(a),t=ae(t),e=ae(e),-1==a&&(a=void 0),t.setIndexBuffer(e,_e[r],n,a)},c:(t,e)=>{ae(t).setPipeline(ae(e))},g:(t,e,r,n,a)=>{ae(t).setScissorRect(e,r,n,a)},e:(t,e)=>{ae(t).setStencilReference(e>>>0)},p:function(t,e,r,n,a){n=je(n),a=je(a),t=ae(t),r=ae(r),-1==a&&(a=void 0),t.setVertexBuffer(e,r,n,a)},X:(t,e)=>{var r=_[e+4>>2];t=ae(t);var n=[_[e+24>>2],_[e+28>>2]];if(0!==n[0]&&(t.canvas.width=n[0]),0!==n[1]&&(t.canvas.height=n[1]),r={device:ae(r),format:Re[_[e+8>>2]],usage:_[e+16>>2],alphaMode:be[_[e+40>>2]]},n=_[e+32>>2]){var a=_[e+36>>2];r.viewFormats=Array.from($.subarray(a>>2,a+4*n>>2),t=>Re[t])}0!==(e=_[e>>2])&&(r.colorSpace=Ce[_[e+8>>2]],r.nd={mode:Ue[_[e+12>>2]]}),t.configure(r)},W:(t,e)=>{t=ae(t);try{var r=Zr(0),n=t.getCurrentTexture();re[r>>>0]=n,_[e+4>>2]=r,$[e+8>>2]=1}catch(t){_[e+4>>2]=0,$[e+8>>2]=6}},Y:t=>{ae(t).unconfigure()},ea:(t,e)=>{if(e){var r=_[e+24>>2],n=_[e+32>>2];r={label:oe(e+4),format:Re[_[e+12>>2]],dimension:Me[_[e+16>>2]],baseMipLevel:_[e+20>>2],mipLevelCount:4294967295===r?void 0:r,baseArrayLayer:_[e+28>>2],arrayLayerCount:4294967295===n?void 0:n,aspect:Pe[_[e+36>>2]]}}return e=ae(t),t=Yr(0),e=e.createView(r),re[t>>>0]=e,t},da:t=>{ae(t).destroy()},fa:t=>Re.indexOf(ae(t).format),C:t=>ae(t).height,D:t=>ae(t).width};return ln=await async function(){function t(t){return t=ln=t.exports,Ur=t.ra,Fr=t.sa,Lr=t.ta,Nr=t.ua,jr=t.va,Vr=t.wa,Ir=t.xa,Gr=t.Aa,Hr=t.Ea,Wr=t.Fa,qr=t.Ga,Kr=t.Ha,Zr=t.Ia,Yr=t.Ja,Xr=t.Pa,Jr=t.Qa,Qr=t.Ra,tn=t.Sa,en=t.Ta,rn=t.Va,nn=t.Wa,an=t.Xa,on=t.pa,sn=t.Ua,B(),ln}var e={a:un};return r.instantiateWasm?new Promise(n=>{r.instantiateWasm(e,(e,r)=>{n(t(e))})}):(E??=r.locateFile?r.locateFile?r.locateFile("thorvg.wasm",h):h+"thorvg.wasm":new URL("thorvg.wasm",import.meta.url).href,t((await async function(t){var e=E;if(!f&&!z(e)&&!i)try{var r=fetch(e,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(r,t)}catch(t){T(`wasm streaming compile failed: ${t}`),T("falling back to ArrayBuffer instantiation")}return async function(t,e){try{var r=await async function(t){if(!f)try{var e=await s(t);return new Uint8Array(e)}catch{}if(t==E&&f)t=new Uint8Array(f);else{if(!l)throw"both async and sync fetching of the wasm failed";t=l(t)}return t}(t);return await WebAssembly.instantiate(r,e)}catch(t){T(`failed to asynchronously prepare wasm: ${t}`),R(t)}}(e,t)}(e)).instance))}(),function t(){function e(){if(r.calledRun=!0,!O){if(P=!0,r.noFSInit||Dr.Lb||hr(),ln.qa(),Dr.bc=!1,m?.(r),r.onRuntimeInitialized?.(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();U.push(t)}M(U)}}if(0<ir)or=t;else{if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)L();M(F),0<ir?or=t:r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),e()},1)):e()}}(),e=P?r:new Promise((t,e)=>{m=t,b=e}),e}({locateFile:(t,e)=>t.endsWith(".wasm")?this.wasmUrl||"https://unpkg.com/@thorvg/lottie-player@latest/dist/thorvg.wasm":e+t})),!this._timer)return;clearInterval(this._timer),this._timer=void 0;const t=this.config?.renderer||"wg";if(await(async t=>{if("wg"===t){for(;"requested"===pt;)await ft(100);if("initialized"!==pt&&(pt="requested",ct))for(;;)switch(ct.init()){case 0:return void(pt="initialized");case 1:return void(pt="failed");case 2:await ft(100)}}})(t),"failed"===pt)return this.currentState="error",void this.dispatchEvent(new CustomEvent("error"));this.TVG=new ct.TvgLottieAnimation(t,`#${this.canvas.id}`),this.src&&this.load(this.src,this.fileType)}_viewport(){const{left:t,right:e,top:r,bottom:n}=this.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight;let o=0,s=0,l=this.canvas.width,u=this.canvas.height;t<0&&(o=Math.abs(t),l-=o),r<0&&(s=Math.abs(r),u-=s),e>a&&(l-=e-a),n>i&&(u-=n-i),this.TVG.viewport(o,s,l,u)}_observerCallback(t){const e=t[0],r=e.target;r._observable=e.isIntersecting,e.isIntersecting?"frozen"===r.currentState&&r.play():"playing"===r.currentState&&(r.freeze(),r.dispatchEvent(new CustomEvent("freeze")))}firstUpdated(t){this.canvas=this.querySelector(".thorvg"),this.canvas.id=`thorvg-${Date.now().toString(36)+Math.random().toString(36).substring(2)}`,this.canvas.width=this.canvas.offsetWidth,this.canvas.height=this.canvas.offsetHeight,this._observer=new IntersectionObserver(this._observerCallback),this._observer.observe(this),this.TVG?this.src&&this.load(this.src,this.fileType):this._timer=setInterval(this._init.bind(this),100)}createRenderRoot(){return this.style.display="block",this}async _animLoop(){this.TVG&&await this._update()&&(this._render(),window.requestAnimationFrame(this._animLoop.bind(this)))}_loadBytes(t){if(!this.TVG)throw new Error("TVG is not initialized");if(this._assetResolverCallback&&this.TVG.setAssetResolver(this._assetResolverCallback,this._assetResolverData),!this.TVG.load(t,this.fileType,this.canvas.width,this.canvas.height))throw new Error(`Unable to load an image. Error: ${this.TVG.error()}`);this._render(),this.dispatchEvent(new CustomEvent("load")),this.autoPlay&&this.play()}_flush(){this.canvas.getContext("2d").putImageData(this._imageData,0,0)}_render(){if(!this.TVG)return;if(!1!==this.config?.enableDevicePixelRatio){const t=1+.75*(window.devicePixelRatio-1),{width:e,height:r}=this.canvas.getBoundingClientRect();this.canvas.width=e*t,this.canvas.height=r*t}if(this.TVG.resize(this.canvas.width,this.canvas.height),this._viewport(),!this.TVG.update())return;if("wg"===this.config?.renderer||"gl"===this.config?.renderer)return void this.TVG.render();const t=this.TVG.render(),e=new Uint8ClampedArray(t,0,t.byteLength);e.length<1||(this._imageData=new ImageData(e,this.canvas.width,this.canvas.height),this._flush())}async _update(){if(!this.TVG)return!1;if("playing"!==this.currentState)return!1;const t=this.TVG.duration(),e=Date.now()/1e3;if(this.currentFrame=(e-this._beginTime)/t*this.totalFrame*this.speed,-1===this.direction&&(this.currentFrame=this.totalFrame-this.currentFrame),1===this.direction&&this.currentFrame>=this.totalFrame||-1===this.direction&&this.currentFrame<=0){const t=this.count?"bounce"===this.mode?2*this.count:this.count:0;if(this.loop||t&&this._counter<t)return"bounce"===this.mode&&(this.direction=1===this.direction?-1:1,this.currentFrame=1===this.direction?0:this.totalFrame),this.count&&(this._counter+=1),await ft(this.intermission),this.play(),!0;this.dispatchEvent(new CustomEvent("complete")),this.currentState="stopped"}return this.dispatchEvent(new CustomEvent("frame",{detail:{frame:this.currentFrame}})),this.TVG.frame(this.currentFrame)}_frame(t){this.TVG&&(this.pause(),this.currentFrame=t,this.TVG.frame(t))}async load(t,e="json"){try{this.currentState="loading",await this._init();const r=await(async(t,e)=>{const r=new TextEncoder;let n=t;switch(typeof n){case"object":return n instanceof ArrayBuffer?new Uint8Array(n):(n=JSON.stringify(n),r.encode(n));case"string":if("json"===e||"lot"===e)return n=await(async t=>{try{t=JSON.parse(t)}catch(e){const r=await(async t=>{if("string"!=typeof t)throw new Error("The url value must be a string");try{const e=new URL(t),r=await fetch(e.toString());return await r.json()}catch(t){throw new Error("An error occurred while trying to load the Lottie file from URL")}})(t);t=JSON.stringify(r)}return t})(n),r.encode(n);const t=await(async t=>(await fetch(t)).arrayBuffer())(n);return new Uint8Array(t);default:throw new Error("Invalid src type")}})(t,e);this.dispatchEvent(new CustomEvent("ready")),this.fileType=e,await this._loadBytes(r)}catch(t){this.currentState="error",this.dispatchEvent(new CustomEvent("error"))}}play(){if(this.TVG&&!("json"!==this.fileType&&"lot"!==this.fileType||(this.totalFrame=this.TVG.totalFrame(),this.totalFrame<1||(this._beginTime=Date.now()/1e3,"playing"===this.currentState))))return this._observable?(this.currentState="playing",void window.requestAnimationFrame(this._animLoop.bind(this))):void(this.currentState="frozen")}pause(){this.currentState="paused",this.dispatchEvent(new CustomEvent("pause"))}stop(){this.currentState="stopped",this.currentFrame=0,this._counter=1,this.seek(0),this.dispatchEvent(new CustomEvent("stop"))}freeze(){this.currentState="frozen",this.dispatchEvent(new CustomEvent("freeze"))}async seek(t){this._frame(t),await this._update(),this._render()}resize(t,e){this.canvas.width=t,this.canvas.height=e,"playing"!==this.currentState&&this._render()}destroy(){this.TVG&&(this.TVG.delete(),this.TVG=null,this.currentState="destroyed",this._observer&&(this._observer.disconnect(),this._observer=void 0),this.dispatchEvent(new CustomEvent("destroyed")),this.remove())}term(){ct&&(ct.term(),ct=null)}setLooping(t){this.TVG&&(this.loop=t)}setDirection(t){this.TVG&&(this.direction=t)}setSpeed(t){this.TVG&&(this.speed=t)}setBgColor(t){this.TVG&&(this.canvas.style.backgroundColor=t)}setQuality(t){this.TVG&&this.TVG.quality(t)&&"playing"!==this.currentState&&this._render()}setAssetResolver(t,e){this._assetResolverCallback=t,this._assetResolverData=e,this.TVG&&this.TVG.setAssetResolver(t,e)}getVersion(){return{THORVG_VERSION:"1.0.4"}}render(){return I`
2
2
  <canvas class="thorvg" style="width: 100%; height: 100%;" />
3
- `}}function bt(t,e,r,n){var a,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,r,o):a(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}ut([A({type:String})],mt.prototype,"src",void 0),ut([A({type:String})],mt.prototype,"wasmUrl",void 0),ut([A({type:dt})],mt.prototype,"fileType",void 0),ut([A({type:Number})],mt.prototype,"speed",void 0),ut([A({type:Boolean})],mt.prototype,"autoPlay",void 0),ut([A({type:Number})],mt.prototype,"count",void 0),ut([A({type:Boolean})],mt.prototype,"loop",void 0),ut([A({type:Number})],mt.prototype,"direction",void 0),ut([A()],mt.prototype,"mode",void 0),ut([A()],mt.prototype,"intermission",void 0),ut([A({type:Number})],mt.prototype,"totalFrame",void 0),ut([A({type:Number})],mt.prototype,"currentFrame",void 0),ut([A({type:Number})],mt.prototype,"currentState",void 0),ut([A({type:Float32Array})],mt.prototype,"size",null);class vt extends mt{set renderConfig(t){this.config={renderer:"wg",enableDevicePixelRatio:t.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}bt([A({type:Object})],vt.prototype,"renderConfig",null),vt=bt([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("lottie-player")],vt);var yt=Object.freeze({__proto__:null});export{vt as LottiePresetPlayer};
3
+ `}}function bt(t,e,r,n){var a,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,r,o):a(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}ut([A({type:String})],mt.prototype,"src",void 0),ut([A({type:String})],mt.prototype,"wasmUrl",void 0),ut([A({type:dt})],mt.prototype,"fileType",void 0),ut([A({type:Number})],mt.prototype,"speed",void 0),ut([A({type:Boolean})],mt.prototype,"autoPlay",void 0),ut([A({type:Number})],mt.prototype,"count",void 0),ut([A({type:Boolean})],mt.prototype,"loop",void 0),ut([A({type:Number})],mt.prototype,"direction",void 0),ut([A()],mt.prototype,"mode",void 0),ut([A()],mt.prototype,"intermission",void 0),ut([A({type:Number})],mt.prototype,"totalFrame",void 0),ut([A({type:Number})],mt.prototype,"currentFrame",void 0),ut([A({type:Number})],mt.prototype,"currentState",void 0),ut([A({type:Float32Array})],mt.prototype,"size",null),ut([A({type:Number})],mt.prototype,"dpr",null);class vt extends mt{set renderConfig(t){this.config={renderer:"wg",enableDevicePixelRatio:t.enableDevicePixelRatio}}get renderConfig(){return this.config||{}}}bt([A({type:Object})],vt.prototype,"renderConfig",null),vt=bt([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("lottie-player")],vt);var yt=Object.freeze({__proto__:null});export{vt as LottiePresetPlayer};
4
4
  //# sourceMappingURL=lottie-player.esm.js.map