@cesdk/engine 1.21.1 → 1.22.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/core/{cesdk-v1.21.1-SHMUI6C6.data → cesdk-v1.22.0-rc.1-GD242ZBP.data} +0 -0
- package/assets/core/{cesdk-v1.21.1-FAWXZVHP.wasm → cesdk-v1.22.0-rc.1-N5OMRNYC.wasm} +0 -0
- package/assets/core/worker-host-v1.22.0-rc.1-UV6YL3VA.js +14 -0
- package/assets/demo/v2/ly.img.video.template/content.json +88 -0
- package/assets/demo/v2/ly.img.video.template/templates/milli-surf-school.scene +1 -0
- package/assets/demo/v2/ly.img.video.template/templates/monthly-review.scene +1 -0
- package/assets/demo/v2/ly.img.video.template/templates/my-plants.scene +1 -0
- package/assets/demo/v2/ly.img.video.template/templates/red-dot.scene +1 -0
- package/assets/demo/v2/ly.img.video.template/thumbnails/milli-surf-school.png +0 -0
- package/assets/demo/v2/ly.img.video.template/thumbnails/monthly-review.png +0 -0
- package/assets/demo/v2/ly.img.video.template/thumbnails/my-plants.png +0 -0
- package/assets/demo/v2/ly.img.video.template/thumbnails/red-dot.png +0 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/assets/core/worker-host-v1.21.1-TYXYYQZC.js +0 -14
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,a=(e,t)=>function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports},s=(e,n,o,i)=>{for(var a,s=i>1?void 0:i?r(n,o):n,u=e.length-1;u>=0;u--)(a=e[u])&&(s=(i?a(n,o,s):a(s))||s);return i&&s&&t(n,o,s),s},u=(e,r,n)=>(((e,r,n)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n})(e,"symbol"!=typeof r?r+"":r,n),n),c=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},l=(e,t,r)=>(c(e,t,"read from private field"),r?r.call(e):t.get(e)),d=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},f=(e,t,r)=>(c(e,t,"access private method"),r),p=a({"../../../node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},e.toByteArray=function(e){var t,r,i=a(e),s=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,d=u>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},e.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,u=0,c=n-o;u<c;u+=a)i.push(s(e,u,u+a>c?c:u+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};var t,r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,64;t<64;++t)r[t]=i[t],n[i.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),h=a({"../../../node_modules/ieee754/index.js"(e){e.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?o-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+p]=255&a,p+=h,a/=256,c-=8);e[r+p-h]|=128*m}}}),m=a({"../../../node_modules/buffer/index.js"(e){var t=p(),r=h(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function i(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=i(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var o=function(e){if(a.isBuffer(e)){var t=0|f(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?i(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),i(e<0?0:0|f(e))}function l(e){for(var t=e.length<0?0:0|f(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,a.prototype),n}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(o)return n?-1:O(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return q(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){d=!1;break}if(d)return i}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(H(s))return a;e[r+a]=s}return a}function E(e,t,r,n){return N(O(t,e.length-r),e,r,n)}function _(e,t,r,n){return N(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return N(U(t),e,r,n)}function S(e,t,r,n){return N(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function k(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,c=e[o],l=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=d}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if($(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if($(i,Uint8Array))o+i.length>n.length?a.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},a.byteLength=m,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,o){if($(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(i,s),c=this.slice(n,o),l=e.slice(t,r),d=0;d<u;++d)if(c[d]!==l[d]){i=c[d],s=l[d];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function P(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function q(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=V[e[i]];return o}function F(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function M(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,0,n,8),r.write(e,t,n,o,52,8),n+8}a.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%u]}return this};var I=/[^+/0-9A-Za-z-_]/g;function O(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function U(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var V=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()}}),g=a({"../../../esbuild/polyfill.noop.js"(){}}),y=a({"../../../_builds/cesdk/wasm32-unknown-emscripten/Release/cesdk.js"(e,t){var r,n=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r=r||__filename),function(e={}){var t,n,o,i,a,s,u=e;if(void 0===globalThis.BigInt64Array){let e=function(e,t){return BigInt(e)|BigInt(t+2*(2147483648&t))<<32n},t=function(e,t){return BigInt(e)|BigInt(t)<<32n},r=function(e){return[0|Number(BigInt(e)&BigInt(4294967295)),0|Number(BigInt(e)>>32n)]},n=function(e){return function t(n){var o;"number"==typeof n&&(n=new Uint32Array(2*n)),ArrayBuffer.isView(n)||(n.constructor&&"ArrayBuffer"===n.constructor.name?n=new Uint32Array(n):(o=n,n=new Uint32Array(2*n.length)));var i=new Proxy({slice:(e,r)=>(void 0===r&&(r=n.length),t(n.slice(2*e,2*r))),subarray:(e,r)=>t(n.subarray(2*e,2*r)),[Symbol.iterator]:function*(){for(var t=0;t<n.length/2;t++)yield e(n[2*t],n[2*t+1])},BYTES_PER_ELEMENT:2*n.BYTES_PER_ELEMENT,buffer:n.buffer,byteLength:n.byteLength,byteOffset:n.byteOffset,length:n.length/2,copyWithin:function(e,t,r){return n.copyWithin(2*e,2*t,2*r),i},set(e,t){if(void 0===t&&(t=0),2*(e.length+t)>n.length)throw new RangeError("offset is out of bounds");for(var o=0;o<e.length;o++){var i=e[o],a=r(i);n.set(a,2*(t+o))}}},{get(t,r,o){if("string"!=typeof r||!/^\d+$/.test(r))return Reflect.get(t,r,o);var i=n[2*r],a=n[2*r+1];return e(i,a)},set(e,t,o,i){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,o,i);if("bigint"!=typeof o)throw new TypeError(`Cannot convert ${o} to a BigInt`);var a=r(o);return n.set(a,2*t),!0}});return o&&i.set(o),i}};globalThis.BigUint64Array=n(t),globalThis.BigInt64Array=n(e)}u.ready=new Promise(((e,r)=>{t=e,n=r})),u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,u.ENVIRONMENT_IS_PTHREAD||u.$ww||function(e){"object"==typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):"undefined"==typeof process&&"undefined"!=typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="cesdk.data";"function"!=typeof u.locateFilePackage||u.locateFile||(u.locateFile=u.locateFilePackage,S("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var r=u.locateFile?u.locateFile(t,""):t,n=e.remote_package_size,o=null,i=u.getPreloadedPackage?u.getPreloadedPackage(r,n):null;function a(){function t(e,t){if(!e)throw t+(new Error).stack}function r(e,t,r){this.start=e,this.end=t,this.audio=r}u.FS_createPath("/","ly.img.cesdk",!0,!0),u.FS_createPath("/ly.img.cesdk","fonts",!0,!0),u.FS_createPath("/ly.img.cesdk","icons",!0,!0),u.FS_createPath("/ly.img.cesdk","icu",!0,!0),u.FS_createPath("/ly.img.cesdk","presets",!0,!0),u.FS_createPath("/ly.img.cesdk","shaders",!0,!0),u.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,u.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){u.FS_createDataFile(this.name,null,e,!0,!0,!0),u.removeRunDependency(`fp ${this.name}`),this.requests[this.name]=null}};for(var n=e.files,a=0;a<n.length;++a)new r(n[a].start,n[a].end,n[a].audio||0).open("GET",n[a].filename);function s(n){t(n,"Loading data file failed."),t(n.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var o=new Uint8Array(n);r.prototype.byteArray=o;for(var i=e.files,a=0;a<i.length;++a)r.prototype.requests[i[a].filename].onload();u.removeRunDependency("datafile_cesdk.data")}u.addRunDependency("datafile_cesdk.data"),u.preloadResults||(u.preloadResults={}),u.preloadResults["cesdk.data"]={fromCache:!1},i?(s(i),i=null):o=s}i||function(e,t,r,n){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onprogress=function(r){var n=e,i=t;if(r.total&&(i=r.total),r.loaded){o.addedTotal?u.dataFileDownloads[n].loaded=r.loaded:(o.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[n]={loaded:r.loaded,total:i});var a=0,s=0,c=0;for(var l in u.dataFileDownloads){var d=u.dataFileDownloads[l];a+=d.total,s+=d.loaded,c++}a=Math.ceil(a*u.expectedDataFileDownloads/c),u.setStatus&&u.setStatus(`Downloading data... (${s}/${a})`)}else u.dataFileDownloads||u.setStatus&&u.setStatus("Downloading data...")},o.onerror=function(t){throw new Error("NetworkError for: "+e)},o.onload=function(e){if(!(200==o.status||304==o.status||206==o.status||0==o.status&&o.response))throw new Error(o.statusText+" : "+o.responseURL);var t=o.response;r(t)},o.send(null)}else g().readFile(e,(function(e,t){e?n(e):r(t.buffer)}))}(r,n,(function(e){o?(o(e),o=null):i=e}),(function(e){console.error("package error:",e)})),u.calledRun?a():(u.preRun||(u.preRun=[]),u.preRun.push(a))}({files:[{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:0,end:270760},{filename:"/ly.img.cesdk/icons/ErrorAudio.svg",start:270760,end:271672},{filename:"/ly.img.cesdk/icons/ErrorConnection.svg",start:271672,end:272620},{filename:"/ly.img.cesdk/icons/ErrorVideo.svg",start:272620,end:273473},{filename:"/ly.img.cesdk/icons/Move.svg",start:273473,end:274748},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274748,end:275745},{filename:"/ly.img.cesdk/icu/icudt74l.dat",start:275745,end:810849},{filename:"/ly.img.cesdk/presets/.keep",start:810849,end:810849},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:810849,end:814738},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:814738,end:821055},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:821055,end:825646},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:825646,end:835631},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:835631,end:836121},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:836121,end:839288},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:839288,end:841926},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:841926,end:842873},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:842873,end:843388},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:843388,end:844352},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:844352,end:846469},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:846469,end:847436},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:847436,end:847930},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:847930,end:861530},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:861530,end:862315},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:862315,end:862797},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:862797,end:865660},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:865660,end:866165},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:866165,end:866619},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:866619,end:868256},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:868256,end:868556},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:868556,end:869244},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:869244,end:869456},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:869456,end:870019},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:870019,end:872324},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:872324,end:873008},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:873008,end:873590},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:873590,end:874308},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:874308,end:874680}],remote_package_size:874680}),"object"==typeof window&&"object"==typeof window.performance?u.performance=performance:"object"==typeof global&&"object"==typeof global.perf_hooks&&"object"==typeof global.perf_hooks.performance?u.performance=global.perf_hooks.performance:u.performance={mark:function(){},measure:function(){}},(i=o||(o={}))[i.PENDING=0]="PENDING",i[i.FINISHED=1]="FINISHED",i[i.ALLOCATED=2]="ALLOCATED",i[i.ERROR=3]="ERROR",(s=a||(a={}))[s.GET=0]="GET",s[s.POST=1]="POST";class FetchProcess{constructor(e,t){this.state=o.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t,this.abortController=new AbortController,this.abortSignal=this.abortController.signal}async readChunks(e){let t=0;const r=[],n=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;if(this.abortSignal.aborted)throw await t.cancel(),t.releaseLock(),new Error(this.abortSignal.reason);n(r)}t.releaseLock()}else{const t=()=>e.destroy(new Error(this.abortSignal.reason));this.abortSignal.addEventListener("abort",t,{once:!0});try{await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}))}finally{this.abortSignal.removeEventListener("abort",t)}}const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}abort(){this.isPending()&&this.abortController.abort("Fetch aborted")}isPending(){return this.state===o.PENDING}isError(){return this.state===o.ERROR}isFinished(){return this.state===o.FINISHED}isAllocated(){return this.state===o.ALLOCATED}allocate(){if(this.isAllocated())return this;if(this.isFinished()){const e=this.result.length,t=u._malloc(e);u.HEAPU8.set(this.result,t);const r=Object.assign(Object.assign({},this),{state:o.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:o.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:o.ERROR,error:e});return Object.assign(this,t)}}u.emscripten_ubq_asyncFetchManager=new class AsyncFetchManager{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){const t=this._processes.get(e);return(null==t?void 0:t.isPending())&&t.abort(),this._processes.delete(e)}clear(){for(const e of this._processes.values())e.isPending()&&e.abort();this._processes.clear(),this._headers.clear()}fetch(e,t,r,n,o,i,a,s,c){const l=u.UTF8ToString(t,r),d=this._nextHandle++,f=new FetchProcess(d,l);return this._processes.set(d,f),l.match(/^file:/)?this._fetchFile(f).catch((e=>{f.fail(e)})):this._fetchRemote(f,e,n,o,i,a,s,c).catch((e=>{f.fail(e)})),f}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=g(),{fileURLToPath:r}=g(),n=t.createReadStream(r(e.uri));return e.readChunks(n)}async _fetchRemote(e,t,r,n,o,i,s,c){const l=u.UTF8ToString(s,c),d=this.getHeaders(r,n),f=t===a.POST?new Uint8Array(u.HEAPU8.buffer,o,i):void 0,p=await this._fetch(e.uri,{method:a[t],headers:d,body:f,mode:"cors",credentials:l,signal:e.abortSignal});if(p.status>=200&&p.status<=209){let t=0;return p.headers.has("Content-Length")&&(t=+p.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(p.body)}return e.fail(p.statusText)}getHeaders(e,t){const r={};for(let n=0;n<t;n++){const t=u.getValue(e+4*n,"i32"),o=this._headers.get(t);r[o.key]=o.value}return r}createHeader(e,t,r,n){const o=u.UTF8ToString(e,t),i=u.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:i}),a}deleteHeader(e){return this._headers.delete(e)}},u.emscripten_ubq_codec_videoDecoders=new Map,u.emscripten_ubq_codec_audioDecoders=new Map,u.emscripten_ubq_codec_videoEncoders=new Map,u.emscripten_ubq_codec_audioEncoders=new Map,u.emscripten_ubq_codec_videoDecoderNextHandle=1,u.emscripten_ubq_codec_audioDecoderNextHandle=1,u.emscripten_ubq_codec_videoEncoderNextHandle=1,u.emscripten_ubq_codec_audioEncoderNextHandle=1,u.emscripten_ubq_codec_createNativeResult=function(e){const t=u._malloc(8),r=u.HEAPU32.subarray(t/4,t/4+2);if(r[0]=e.handle?e.handle:e.code?e.code:0,e.error){const t=(new TextEncoder).encode(e.error),n=u._malloc(t.length+1),o=u.HEAPU8.subarray(n,n+t.length+1);for(let e=0;e<t.length;e++)o[e]=t[e];o[t.length]=0,r[1]=n}else r[1]=0;return t},u.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:n=>{const o=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(i=!0),!i){var a=u.ctx;const e=r.decodedFrames%o.length;a.bindTexture(a.TEXTURE_2D,o[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,n)}n.close(),r.decodedFrames++,u.emscripten_ubq_codec_onOutputDecodedVideoFrame(e,r.decodedFrames,i,t)},error:e=>{r.unexpectedError=e,console.error(e)}});return r.decodedFrames=0,r.requestedFrame=0,r.shouldDropFrames=!1,r},u.emscripten_ubq_codec_createAudioDecoder=function(e,t,r){const n=new AudioDecoder({output:o=>{if(n.flushing)return void o.close();const i=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),s=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(i.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:s,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:s,frameCount:t}),o.copyTo(i,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:s,frameOffset:t})}n.writtenFrames+=o.numberOfFrames}else if("s16-planar"===o.format)if(1===o.numberOfChannels){const e=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0});for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}}else{const e=new Int16Array(o.numberOfFrames),t=new Int16Array(o.numberOfFrames);o.copyTo(e,{planeIndex:0}),o.copyTo(t,{planeIndex:1});for(let s=0;s<o.numberOfFrames;s++){let o=n.writtenFrames%r;i[o]=e[s]/32768,a[o]=t[s]/32768,n.writtenFrames++}}else if("s16"===o.format){const e=new Int16Array(o.numberOfFrames*o.numberOfChannels);if(o.copyTo(e,{planeIndex:0}),1===o.numberOfChannels)for(let t=0;t<o.numberOfFrames;t++){const o=e[t]/32768;let s=n.writtenFrames%r;i[s]=o,a[s]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let s=n.writtenFrames%r;i[s]=e[t*o.numberOfChannels+0]/32768,a[s]=e[t*o.numberOfChannels+1]/32768,n.writtenFrames++}}else console.error("Unsupported audio format:",o.format);o.close()},error:e=>{n.unexpectedError=e,console.error(e)}});return n.writtenFrames=0,n},u.emscripten_ubq_settings_forceWebGL1=!1;var c,l,d,f=Object.assign({},u),p="./this.program",h=(e,t)=>{throw t},m="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";if(b){var w=g(),E=g();v=y?E.dirname(v)+"/":__dirname+"/",c=(e,t)=>(e=ie(e)?new URL(e):E.normalize(e),w.readFileSync(e,t?void 0:"utf8")),d=e=>{var t=c(e,!0);return t.buffer||(t=new Uint8Array(t)),t},l=(e,t,r,n=!0)=>{e=ie(e)?new URL(e):E.normalize(e),w.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!u.thisProgram&&process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),h=(e,t)=>{throw process.exitCode=e,t},u.inspect=()=>"[Emscripten Module object]"}else(m||y)&&(y?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),r&&(v=r),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var _,C=u.print||console.log.bind(console),S=u.printErr||console.error.bind(console);Object.assign(u,f),f=null,u.arguments&&u.arguments,u.thisProgram&&(p=u.thisProgram),u.quit&&(h=u.quit),u.wasmBinary&&(_=u.wasmBinary);var k,x,A=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&ee("no native wasm support detected");var T,P,q,F,D,B,L,R,M,I,O,U=!1;function N(e,t){e||ee(t)}function $(){var e=k.buffer;u.HEAP8=P=new Int8Array(e),u.HEAP16=F=new Int16Array(e),u.HEAP32=B=new Int32Array(e),u.HEAPU8=q=new Uint8Array(e),u.HEAPU16=D=new Uint16Array(e),u.HEAPU32=L=new Uint32Array(e),u.HEAPF32=R=new Float32Array(e),u.HEAPF64=O=new Float64Array(e),u.HEAP64=M=new BigInt64Array(e),u.HEAPU64=I=new BigUint64Array(e)}var H,V=u.INITIAL_MEMORY||16777216;N(V>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+V+"! (STACK_SIZE=65536)"),k=u.wasmMemory?u.wasmMemory:new WebAssembly.Memory({initial:V/65536,maximum:32768}),$(),V=k.buffer.byteLength;var j=[],G=[],W=[],z=[];function Y(){return A||!1}var X=0,Q=null,Z=null;function K(e){X++,u.monitorRunDependencies&&u.monitorRunDependencies(X)}function J(e){if(X--,u.monitorRunDependencies&&u.monitorRunDependencies(X),0==X&&(null!==Q&&(clearInterval(Q),Q=null),Z)){var t=Z;Z=null,t()}}function ee(e){u.onAbort&&u.onAbort(e),S(e="Aborted("+e+")"),U=!0,T=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var te,re,ne="data:application/octet-stream;base64,";function oe(e){return e.startsWith(ne)}function ie(e){return e.startsWith("file://")}function ae(e){if(e==te&&_)return new Uint8Array(_);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function se(e,t,r){return function(e){return _||!m&&!y||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{S("failed to asynchronously prepare wasm: "+e),ee(e)}))}oe(te="cesdk.wasm")||(re=te,te=u.locateFile?u.locateFile(re,v):v+re);var ue={2377080:(e,t,r,n,o)=>"undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext)?0:(void 0===window.miniaudio&&(window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=r,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=n,window.miniaudio.device_state.started=o,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=function(){return["touchstart","touchend","click"]}(),miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2379070:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2379234:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2379338:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2379509:(e,t,r,n,o,i)=>{var a=e,s=t,c=r,l=n,d=o,f=i;if(void 0===window.miniaudio)return-1;var p={},h={};a==window.miniaudio.device_type.playback&&(h.sampleRate=c),p.webaudio=new(window.AudioContext||window.webkitAudioContext)(h),p.webaudio.suspend(),p.state=window.miniaudio.device_state.stopped;var m=0,g=s;return a!=window.miniaudio.device_type.playback&&(m=s),p.scriptNode=p.webaudio.createScriptProcessor(l,m,g),p.scriptNode.onaudioprocess=function(e){if(null!=p.intermediaryBufferView&&0!=p.intermediaryBufferView.length||(p.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,d,l*s)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<s;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=p.intermediaryBufferView,o=0;o<l;o+=1)n[o*s+t]=r[o];Xu(f,l,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Qu(f,l,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(n=p.intermediaryBufferView,o=0;o<l;o+=1)i[o]=n[o*s+t]}else for(t=0;t<e.outputBuffer.numberOfChannels;++t)e.outputBuffer.getChannelData(t).fill(0)},a!=miniaudio.device_type.capture&&a!=miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(e){p.streamNode=p.webaudio.createMediaStreamSource(e),p.streamNode.connect(p.scriptNode),p.scriptNode.connect(p.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&p.scriptNode.connect(p.webaudio.destination),miniaudio.track_device(p)},2382292:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2382358:e=>{var t=miniaudio.get_device_by_index(e);void 0!==t.scriptNode&&(t.scriptNode.onaudioprocess=function(e){},t.scriptNode.disconnect(),t.scriptNode=void 0),void 0!==t.streamNode&&(t.streamNode.disconnect(),t.streamNode=void 0),t.webaudio.close(),t.webaudio=void 0},2382723:e=>{miniaudio.untrack_device_by_index(e)},2382766:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2382891:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2383017:()=>!!globalThis.ubq_browserTabHidden,2383063:()=>P.length};function ce(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var le=e=>{for(;e.length>0;)e.shift()(u)},de=[],fe=0;function pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){L[this.ptr+4>>2]=e},this.get_type=function(){return L[this.ptr+4>>2]},this.set_destructor=function(e){L[this.ptr+8>>2]=e},this.get_destructor=function(){return L[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,P[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=P[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,P[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=P[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){L[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return L[this.ptr+16>>2]},this.get_exception_ptr=function(){if(sc(this.get_type()))return L[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var he=e=>{var t=fe;if(!t)return Zu(0),0;var r=new pe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Zu(0),t;for(var o in e){var i=e[o];if(0===i||i===n)break;var a=r.ptr+16;if(ac(i,n,a))return Zu(i),t}return Zu(n),t},me={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=me.isAbs(e),r="/"===e.substr(-1);return(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=me.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=me.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return me.normalize(e.join("/"))},join2:(e,t)=>me.normalize(e+"/"+t)},ge=e=>(ge=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=g();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}ee("initRandomDevice")})())(e),ye={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Pe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=me.isAbs(n)}return(t?"/":"")+(e=me.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ye.resolve(e).substr(1),t=ye.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},be="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ve=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&be)return be.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},we=[],Ee=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},_e=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function Ce(e,t,r){var n=r>0?r:Ee(e)+1,o=new Array(n),i=_e(e,o,0,o.length);return t&&(o.length=i),o}var Se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Se.ttys[e]={input:[],output:[],ops:t},Pe.registerDevice(e,Se.stream_ops)},stream_ops:{open:function(e){var t=Se.ttys[e.node.rdev];if(!t)throw new Pe.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Pe.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Pe.ErrnoError(29)}if(void 0===s&&0===i)throw new Pe.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Pe.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Pe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!we.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=w.readSync(n,t,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=r>0?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;we=Ce(e,!0)}return we.shift()})()},put_char:function(e,t){null===t||10===t?(C(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(C(ve(e.output,0)),e.output=[])},ioctl_tcgets:function(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets:function(e,t,r){return 0},ioctl_tiocgwinsz:function(e){return[24,80]}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(S(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(S(ve(e.output,0)),e.output=[])}}},ke=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Ju(65536,e);return t?((e,t)=>(q.fill(0,e,e+t),e))(t,e):0},xe={ops_table:null,mount:e=>xe.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Pe.isBlkdev(r)||Pe.isFIFO(r))throw new Pe.ErrnoError(63);xe.ops_table||(xe.ops_table={dir:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr,lookup:xe.node_ops.lookup,mknod:xe.node_ops.mknod,rename:xe.node_ops.rename,unlink:xe.node_ops.unlink,rmdir:xe.node_ops.rmdir,readdir:xe.node_ops.readdir,symlink:xe.node_ops.symlink},stream:{llseek:xe.stream_ops.llseek}},file:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr},stream:{llseek:xe.stream_ops.llseek,read:xe.stream_ops.read,write:xe.stream_ops.write,allocate:xe.stream_ops.allocate,mmap:xe.stream_ops.mmap,msync:xe.stream_ops.msync}},link:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr,readlink:xe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:xe.node_ops.getattr,setattr:xe.node_ops.setattr},stream:Pe.chrdev_stream_ops}});var o=Pe.createNode(e,t,r,n);return Pe.isDir(o.mode)?(o.node_ops=xe.ops_table.dir.node,o.stream_ops=xe.ops_table.dir.stream,o.contents={}):Pe.isFile(o.mode)?(o.node_ops=xe.ops_table.file.node,o.stream_ops=xe.ops_table.file.stream,o.usedBytes=0,o.contents=null):Pe.isLink(o.mode)?(o.node_ops=xe.ops_table.link.node,o.stream_ops=xe.ops_table.link.stream):Pe.isChrdev(o.mode)&&(o.node_ops=xe.ops_table.chrdev.node,o.stream_ops=xe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Pe.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Pe.isDir(e.mode)?t.size=4096:Pe.isFile(e.mode)?t.size=e.usedBytes:Pe.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&xe.resizeFileStorage(e,t.size)},lookup(e,t){throw Pe.genericErrors[44]},mknod:(e,t,r,n)=>xe.createNode(e,t,r,n),rename(e,t,r){if(Pe.isDir(e.mode)){var n;try{n=Pe.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Pe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Pe.lookupNode(e,t);for(var n in r.contents)throw new Pe.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=xe.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Pe.isLink(e.mode))throw new Pe.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write(e,t,r,n,o,i){if(t.buffer===P.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(xe.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Pe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Pe.ErrnoError(28);return n},allocate(e,t,r){xe.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!Pe.isFile(e.node.mode))throw new Pe.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==P.buffer){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=ke(t)))throw new Pe.ErrnoError(48);P.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,n,o)=>(xe.stream_ops.write(e,t,0,n,r,!1),0)}},Ae=u.preloadPlugins||[];function Te(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Pe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ye.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Pe.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Pe.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Pe.lookupNode(n,r[i]),o=me.join2(o,r[i]),Pe.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Pe.isLink(n.mode);){var u=Pe.readlink(o);if(o=ye.resolve(me.dirname(o),u),n=Pe.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Pe.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Pe.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Pe.nameTable.length},hashAddNode:e=>{var t=Pe.hashName(e.parent.id,e.name);e.name_next=Pe.nameTable[t],Pe.nameTable[t]=e},hashRemoveNode:e=>{var t=Pe.hashName(e.parent.id,e.name);if(Pe.nameTable[t]===e)Pe.nameTable[t]=e.name_next;else for(var r=Pe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Pe.mayLookup(e);if(r)throw new Pe.ErrnoError(r,e);for(var n=Pe.hashName(e.id,t),o=Pe.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Pe.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Pe.FSNode(e,t,r,n);return Pe.hashAddNode(o),o},destroyNode:e=>{Pe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Pe.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var t=Pe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return Pe.lookupNode(e,t),20}catch(e){}return Pe.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Pe.lookupNode(e,t)}catch(e){return e.errno}var o=Pe.nodePermissions(e,"wx");if(o)return o;if(r){if(!Pe.isDir(n.mode))return 54;if(Pe.isRoot(n)||Pe.getPath(n)===Pe.cwd())return 10}else if(Pe.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Pe.isLink(e.mode)?32:Pe.isDir(e.mode)&&("r"!==Pe.flagsToPermissionString(t)||512&t)?31:Pe.nodePermissions(e,Pe.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Pe.MAX_OPEN_FDS;e++)if(!Pe.streams[e])return e;throw new Pe.ErrnoError(33)},getStreamChecked:e=>{var t=Pe.getStream(e);if(!t)throw new Pe.ErrnoError(8);return t},getStream:e=>Pe.streams[e],createStream:(e,t=-1)=>(Pe.FSStream||(Pe.FSStream=function(){this.shared={}},Pe.FSStream.prototype={},Object.defineProperties(Pe.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Pe.FSStream,e),-1==t&&(t=Pe.nextfd()),e.fd=t,Pe.streams[t]=e,e),closeStream:e=>{Pe.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Pe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Pe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Pe.devices[e]={stream_ops:t}},getDevice:e=>Pe.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),Pe.syncFSRequests++,Pe.syncFSRequests>1&&S(`warning: ${Pe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Pe.getMounts(Pe.root.mount),n=0;function o(e){return Pe.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&Pe.root)throw new Pe.ErrnoError(10);if(!o&&!i){var a=Pe.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Pe.isMountpoint(n))throw new Pe.ErrnoError(10);if(!Pe.isDir(n.mode))throw new Pe.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Pe.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Pe.lookupPath(e,{follow_mount:!1});if(!Pe.isMountpoint(t.node))throw new Pe.ErrnoError(28);var r=t.node,n=r.mounted,o=Pe.getMounts(n);Object.keys(Pe.nameTable).forEach((e=>{for(var t=Pe.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Pe.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=Pe.lookupPath(e,{parent:!0}).node,o=me.basename(e);if(!o||"."===o||".."===o)throw new Pe.ErrnoError(28);var i=Pe.mayCreate(n,o);if(i)throw new Pe.ErrnoError(i);if(!n.node_ops.mknod)throw new Pe.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Pe.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Pe.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Pe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Pe.mknod(e,t,r)),symlink:(e,t)=>{if(!ye.resolve(e))throw new Pe.ErrnoError(44);var r=Pe.lookupPath(t,{parent:!0}).node;if(!r)throw new Pe.ErrnoError(44);var n=me.basename(t),o=Pe.mayCreate(r,n);if(o)throw new Pe.ErrnoError(o);if(!r.node_ops.symlink)throw new Pe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=me.dirname(e),i=me.dirname(t),a=me.basename(e),s=me.basename(t);if(r=Pe.lookupPath(e,{parent:!0}).node,n=Pe.lookupPath(t,{parent:!0}).node,!r||!n)throw new Pe.ErrnoError(44);if(r.mount!==n.mount)throw new Pe.ErrnoError(75);var u,c=Pe.lookupNode(r,a),l=ye.relative(e,i);if("."!==l.charAt(0))throw new Pe.ErrnoError(28);if("."!==(l=ye.relative(t,o)).charAt(0))throw new Pe.ErrnoError(55);try{u=Pe.lookupNode(n,s)}catch(e){}if(c!==u){var d=Pe.isDir(c.mode),f=Pe.mayDelete(r,a,d);if(f)throw new Pe.ErrnoError(f);if(f=u?Pe.mayDelete(n,s,d):Pe.mayCreate(n,s))throw new Pe.ErrnoError(f);if(!r.node_ops.rename)throw new Pe.ErrnoError(63);if(Pe.isMountpoint(c)||u&&Pe.isMountpoint(u))throw new Pe.ErrnoError(10);if(n!==r&&(f=Pe.nodePermissions(r,"w")))throw new Pe.ErrnoError(f);Pe.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Pe.hashAddNode(c)}}},rmdir:e=>{var t=Pe.lookupPath(e,{parent:!0}).node,r=me.basename(e),n=Pe.lookupNode(t,r),o=Pe.mayDelete(t,r,!0);if(o)throw new Pe.ErrnoError(o);if(!t.node_ops.rmdir)throw new Pe.ErrnoError(63);if(Pe.isMountpoint(n))throw new Pe.ErrnoError(10);t.node_ops.rmdir(t,r),Pe.destroyNode(n)},readdir:e=>{var t=Pe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Pe.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Pe.lookupPath(e,{parent:!0}).node;if(!t)throw new Pe.ErrnoError(44);var r=me.basename(e),n=Pe.lookupNode(t,r),o=Pe.mayDelete(t,r,!1);if(o)throw new Pe.ErrnoError(o);if(!t.node_ops.unlink)throw new Pe.ErrnoError(63);if(Pe.isMountpoint(n))throw new Pe.ErrnoError(10);t.node_ops.unlink(t,r),Pe.destroyNode(n)},readlink:e=>{var t=Pe.lookupPath(e).node;if(!t)throw new Pe.ErrnoError(44);if(!t.node_ops.readlink)throw new Pe.ErrnoError(28);return ye.resolve(Pe.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Pe.lookupPath(e,{follow:!t}).node;if(!r)throw new Pe.ErrnoError(44);if(!r.node_ops.getattr)throw new Pe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Pe.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Pe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Pe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Pe.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Pe.getStreamChecked(e);Pe.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Pe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Pe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Pe.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Pe.getStreamChecked(e);Pe.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Pe.ErrnoError(28);var r;if(!(r="string"==typeof e?Pe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Pe.ErrnoError(63);if(Pe.isDir(r.mode))throw new Pe.ErrnoError(31);if(!Pe.isFile(r.mode))throw new Pe.ErrnoError(28);var n=Pe.nodePermissions(r,"w");if(n)throw new Pe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Pe.getStreamChecked(e);if(0==(2097155&r.flags))throw new Pe.ErrnoError(28);Pe.truncate(r.node,t)},utime:(e,t,r)=>{var n=Pe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Pe.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?function(e){var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t}(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=me.normalize(e);try{n=Pe.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Pe.ErrnoError(20)}else n=Pe.mknod(e,r,0),o=!0;if(!n)throw new Pe.ErrnoError(44);if(Pe.isChrdev(n.mode)&&(t&=-513),65536&t&&!Pe.isDir(n.mode))throw new Pe.ErrnoError(54);if(!o){var i=Pe.mayOpen(n,t);if(i)throw new Pe.ErrnoError(i)}512&t&&!o&&Pe.truncate(n,0),t&=-131713;var a=Pe.createStream({node:n,path:Pe.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!u.logReadFiles||1&t||(Pe.readFiles||(Pe.readFiles={}),e in Pe.readFiles||(Pe.readFiles[e]=1)),a},close:e=>{if(Pe.isClosed(e))throw new Pe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Pe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Pe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Pe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new Pe.ErrnoError(28);if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(1==(2097155&e.flags))throw new Pe.ErrnoError(8);if(Pe.isDir(e.node.mode))throw new Pe.ErrnoError(31);if(!e.stream_ops.read)throw new Pe.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Pe.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new Pe.ErrnoError(28);if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(0==(2097155&e.flags))throw new Pe.ErrnoError(8);if(Pe.isDir(e.node.mode))throw new Pe.ErrnoError(31);if(!e.stream_ops.write)throw new Pe.ErrnoError(28);e.seekable&&1024&e.flags&&Pe.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Pe.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(t<0||r<=0)throw new Pe.ErrnoError(28);if(0==(2097155&e.flags))throw new Pe.ErrnoError(8);if(!Pe.isFile(e.node.mode)&&!Pe.isDir(e.node.mode))throw new Pe.ErrnoError(43);if(!e.stream_ops.allocate)throw new Pe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Pe.ErrnoError(2);if(1==(2097155&e.flags))throw new Pe.ErrnoError(2);if(!e.stream_ops.mmap)throw new Pe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new Pe.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Pe.open(e,t.flags),o=Pe.stat(e).size,i=new Uint8Array(o);return Pe.read(n,i,0,o,0),"utf8"===t.encoding?r=ve(i,0):"binary"===t.encoding&&(r=i),Pe.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Pe.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(Ee(t)+1),i=_e(t,o,0,o.length);Pe.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Pe.write(n,t,0,t.byteLength,void 0,r.canOwn)}Pe.close(n)},cwd:()=>Pe.currentPath,chdir:e=>{var t=Pe.lookupPath(e,{follow:!0});if(null===t.node)throw new Pe.ErrnoError(44);if(!Pe.isDir(t.node.mode))throw new Pe.ErrnoError(54);var r=Pe.nodePermissions(t.node,"x");if(r)throw new Pe.ErrnoError(r);Pe.currentPath=t.path},createDefaultDirectories:()=>{Pe.mkdir("/tmp"),Pe.mkdir("/home"),Pe.mkdir("/home/web_user")},createDefaultDevices:()=>{Pe.mkdir("/dev"),Pe.registerDevice(Pe.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Pe.mkdev("/dev/null",Pe.makedev(1,3)),Se.register(Pe.makedev(5,0),Se.default_tty_ops),Se.register(Pe.makedev(6,0),Se.default_tty1_ops),Pe.mkdev("/dev/tty",Pe.makedev(5,0)),Pe.mkdev("/dev/tty1",Pe.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ge(e).byteLength),e[--t]);Pe.createDevice("/dev","random",r),Pe.createDevice("/dev","urandom",r),Pe.mkdir("/dev/shm"),Pe.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Pe.mkdir("/proc");var e=Pe.mkdir("/proc/self");Pe.mkdir("/proc/self/fd"),Pe.mount({mount:()=>{var t=Pe.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Pe.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{u.stdin?Pe.createDevice("/dev","stdin",u.stdin):Pe.symlink("/dev/tty","/dev/stdin"),u.stdout?Pe.createDevice("/dev","stdout",null,u.stdout):Pe.symlink("/dev/tty","/dev/stdout"),u.stderr?Pe.createDevice("/dev","stderr",null,u.stderr):Pe.symlink("/dev/tty1","/dev/stderr"),Pe.open("/dev/stdin",0),Pe.open("/dev/stdout",1),Pe.open("/dev/stderr",1)},ensureErrnoError:()=>{Pe.ErrnoError||(Pe.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Pe.ErrnoError.prototype=new Error,Pe.ErrnoError.prototype.constructor=Pe.ErrnoError,[44].forEach((e=>{Pe.genericErrors[e]=new Pe.ErrnoError(e),Pe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Pe.ensureErrnoError(),Pe.nameTable=new Array(4096),Pe.mount(xe,{},"/"),Pe.createDefaultDirectories(),Pe.createDefaultDevices(),Pe.createSpecialDirectories(),Pe.filesystems={MEMFS:xe}},init:(e,t,r)=>{Pe.init.initialized=!0,Pe.ensureErrnoError(),u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,Pe.createStandardStreams()},quit:()=>{Pe.init.initialized=!1;for(var e=0;e<Pe.streams.length;e++){var t=Pe.streams[e];t&&Pe.close(t)}},findObject:(e,t)=>{var r=Pe.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Pe.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Pe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=me.basename(e),n=Pe.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:Pe.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=me.join2(e,i);try{Pe.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=me.join2("string"==typeof e?e:Pe.getPath(e),t),a=Te(n,o);return Pe.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Pe.getPath(e),a=t?me.join2(e,t):e);var s=Te(n,o),u=Pe.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}Pe.chmod(u,146|s);var f=Pe.open(u,577);Pe.write(f,r,0,r.length,0,i),Pe.close(f),Pe.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=me.join2("string"==typeof e?e:Pe.getPath(e),t),i=Te(!!r,!!n);Pe.createDevice.major||(Pe.createDevice.major=64);var a=Pe.makedev(Pe.createDevice.major++,0);return Pe.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Pe.ErrnoError(29)}if(void 0===u&&0===a)throw new Pe.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Pe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Pe.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!c)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ce(c(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Pe.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ce(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,C("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Pe.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return Pe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(Pe.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{Pe.forceLoadFile(u);var i=ke(t);if(!i)throw new Pe.ErrnoError(48);return l(e,P,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},qe=(e,t)=>e?ve(q,e,t):"",Fe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(me.isAbs(t))return t;var n;if(n=-100===e?Pe.cwd():Fe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Pe.ErrnoError(44);return n}return me.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&me.normalize(t)!==me.normalize(Pe.getPath(e.node)))return-54;throw e}B[r>>2]=n.dev,B[r+4>>2]=n.mode,L[r+8>>2]=n.nlink,B[r+12>>2]=n.uid,B[r+16>>2]=n.gid,B[r+20>>2]=n.rdev,M[r+24>>3]=BigInt(n.size),B[r+32>>2]=4096,B[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return M[r+40>>3]=BigInt(Math.floor(o/1e3)),L[r+48>>2]=o%1e3*1e3,M[r+56>>3]=BigInt(Math.floor(i/1e3)),L[r+64>>2]=i%1e3*1e3,M[r+72>>3]=BigInt(Math.floor(a/1e3)),L[r+80>>2]=a%1e3*1e3,M[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Pe.isFile(t.node.mode))throw new Pe.ErrnoError(43);if(2&n)return 0;var i=q.slice(e,e+r);Pe.msync(t,i,o,r,n)},varargs:void 0,get:()=>(Fe.varargs+=4,B[Fe.varargs-4>>2]),getStr:e=>qe(e),getStreamFromFD:function(e){return Pe.getStreamChecked(e)}},De={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Le(e){return this.fromWireType(B[e>>2])}var Re={},Me={},Ie={},Oe=void 0;function Ue(e){throw new Oe(e)}function Ne(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Ue("Mismatched type converter count");for(var o=0;o<e.length;++o)ze(e[o],n[o])}e.forEach((function(e){Ie[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Me.hasOwnProperty(e)?o[t]=Me[e]:(i.push(e),Re.hasOwnProperty(e)||(Re[e]=[]),Re[e].push((()=>{o[t]=Me[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var $e={};function He(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var Ve=void 0;function je(e){for(var t="",r=e;q[r];)t+=Ve[q[r++]];return t}var Ge=void 0;function We(e){throw new Ge(e)}function ze(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||We(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;We(`Cannot register type '${n}' twice`)}if(Me[e]=t,delete Ie[e],Re.hasOwnProperty(e)){var o=Re[e];delete Re[e],o.forEach((e=>e()))}}(e,t,r)}function Ye(e,t,r){switch(t){case 0:return r?function(e){return P[e]}:function(e){return q[e]};case 1:return r?function(e){return F[e>>1]}:function(e){return D[e>>1]};case 2:return r?function(e){return B[e>>2]}:function(e){return L[e>>2]};case 3:return r?function(e){return M[e>>3]}:function(e){return I[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Xe(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${e}`)}}function Qe(e){if(!(this instanceof bt))return!1;if(!(e instanceof bt))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function Ze(e){We(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ke=!1;function Je(e){}function et(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function tt(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=tt(e,t,r.baseClass);return null===n?null:r.downcast(n)}var rt={};function nt(){return Object.keys(ct).length}function ot(){var e=[];for(var t in ct)ct.hasOwnProperty(t)&&e.push(ct[t]);return e}var it=[];function at(){for(;it.length;){var e=it.pop();e.$$.deleteScheduled=!1,e.delete()}}var st=void 0;function ut(e){st=e,it.length&&st&&st(at)}var ct={};function lt(e,t){return t=function(e,t){for(void 0===t&&We("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),ct[t]}function dt(e,t){return t.ptrType&&t.ptr||Ue("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ue("Both smartPtrType and smartPtr must be specified"),t.count={value:1},pt(Object.create(e,{$$:{value:t}}))}function ft(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=lt(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?dt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):dt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=rt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=tt(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?dt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):dt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var pt=function(e){return"undefined"==typeof FinalizationRegistry?(pt=e=>e,e):(Ke=new FinalizationRegistry((e=>{et(e.$$)})),Je=e=>Ke.unregister(e),(pt=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ke.register(e,r,e)}return e})(e))};function ht(){if(this.$$.ptr||Ze(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=pt(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function mt(){this.$$.ptr||Ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),Je(this),et(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function gt(){return!this.$$.ptr}function yt(){return this.$$.ptr||Ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&We("Object already scheduled for deletion"),it.push(this),1===it.length&&st&&st(at),this.$$.deleteScheduled=!0,this}function bt(){}var vt=48,wt=57;function Et(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=vt&&t<=wt?`_${e}`:e}function _t(e,t){return{[e=Et(e)]:function(){return t.apply(this,arguments)}}[e]}function Ct(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||We(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function St(e,t,r){u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&We(`Cannot register public name '${e}' twice`),Ct(u,e,e),u.hasOwnProperty(r)&&We(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[e].overloadTable[r]=t):(u[e]=t,void 0!==r&&(u[e].numArguments=r))}function kt(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function xt(e,t,r){for(;t!==r;)t.upcast||We(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function At(e,t){if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),0;t.$$||We(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return xt(t.$$.ptr,r,this.registeredClass)}function Tt(e,t){var r;if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||We(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&We(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=xt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&We("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:We(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Yt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:We("Unsupporting sharing policy")}return r}function Pt(e,t){if(null===t)return this.isReference&&We(`null is not a valid ${this.name}`),0;t.$$||We(`Cannot pass "${He(t)}" as a ${this.name}`),t.$$.ptr||We(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&We(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return xt(t.$$.ptr,r,this.registeredClass)}function qt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Ft(e){this.rawDestructor&&this.rawDestructor(e)}function Dt(e){null!==e&&e.delete()}function Bt(e,t,r,n,o,i,a,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=Tt:n?(this.toWireType=At,this.destructorFunction=null):(this.toWireType=Pt,this.destructorFunction=null)}function Lt(e,t,r){u.hasOwnProperty(e)||Ue("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==r?u[e].overloadTable[r]=t:(u[e]=t,u[e].argCount=r)}var Rt=[],Mt=e=>{var t=Rt[e];return t||(e>=Rt.length&&(Rt.length=e+1),Rt[e]=t=H.get(e)),t};function It(e,t){e=je(e);var r=Mt(t);return"function"!=typeof r&&We(`unknown function pointer with signature ${e}: ${t}`),r}var Ot=void 0;function Ut(e){var t=Ku(e),r=je(t);return zu(t),r}function Nt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Me[t]||(Ie[t]?Ie[t].forEach(e):(r.push(t),n[t]=!0))})),new Ot(`${e}: `+r.map(Ut).join([", "]))}function $t(e,t){for(var r=[],n=0;n<e;n++)r.push(L[t+4*n>>2]);return r}function Ht(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=_t(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Vt(e,t,r,n,o,i){var a=t.length;a<2&&We("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d="",f="";for(c=0;c<a-2;++c)d+=(0!==c?", ":"")+"arg"+c,f+=(0!==c?", ":"")+"arg"+c+"Wired";var p=`\n return function ${Et(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${a-2} args!');\n }`;u&&(p+="var destructors = [];\n");var h=u?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[We,n,o,Be,t[0],t[1]];for(s&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),c=0;c<a-2;++c)p+="var arg"+c+"Wired = argType"+c+".toWireType("+h+", arg"+c+"); // "+t[c+2].name+"\n",m.push("argType"+c),g.push(t[c+2]);if(s&&(f="thisWired"+(f.length>0?", ":"")+f),p+=(l||i?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",u)p+="runDestructors(destructors);\n";else for(c=s?1:2;c<t.length;++c){var y=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(p+=y+"_dtor("+y+"); // "+t[c].name+"\n",m.push(y+"_dtor"),g.push(t[c].destructorFunction))}return l&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),Ht(Function,m).apply(null,g)}function jt(){this.allocated=[void 0],this.freelist=[]}var Gt=new jt;function Wt(e){e>=Gt.reserved&&0==--Gt.get(e).refcount&&Gt.free(e)}function zt(){for(var e=0,t=Gt.reserved;t<Gt.allocated.length;++t)void 0!==Gt.allocated[t]&&++e;return e}var Yt={toValue:e=>(e||We("Cannot use deleted val. handle = "+e),Gt.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Gt.allocate({refcount:1,value:e})}}};function Xt(e,t,r){switch(t){case 0:return function(e){var t=r?P:q;return this.fromWireType(t[e])};case 1:return function(e){var t=r?F:D;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?B:L;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Qt(e,t){var r=Me[e];return void 0===r&&We(t+" has unknown type "+Ut(e)),r}function Zt(e,t){switch(t){case 2:return function(e){return this.fromWireType(R[e>>2])};case 3:return function(e){return this.fromWireType(O[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Kt=(e,t,r)=>_e(e,q,t,r),Jt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,er=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&D[n];)++n;if((r=n<<1)-e>32&&Jt)return Jt.decode(q.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=F[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},tr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);F[t>>1]=a,t+=2}return F[t>>1]=0,t-n},rr=e=>2*e.length,nr=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=B[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},or=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),B[t>>2]=a,(t+=4)+4>o)break}return B[t>>2]=0,t-n},ir=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t};function ar(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Qt(L[t+4*n>>2],"parameter "+n);return r}var sr={};function ur(e){var t=sr[e];return void 0===t?je(e):t}var cr=[];function lr(){return"object"==typeof globalThis?globalThis:function(){return Function}()("return this")()}var dr=[],fr={},pr=9007199254740992,hr=-9007199254740992;function mr(e){return e<hr||e>pr?NaN:Number(e)}var gr,yr=e=>e%4==0&&(e%100!=0||e%400==0),br=[0,31,60,91,121,152,182,213,244,274,305,335],vr=[0,31,59,90,120,151,181,212,243,273,304,334],wr=e=>(yr(e.getFullYear())?br:vr)[e.getMonth()]+e.getDate()-1,Er=e=>{var t=Ee(e)+1,r=Wu(t);return r&&Kt(e,r,t),r};function _r(e,t){if(Ar.mainLoop.timingMode=e,Ar.mainLoop.timingValue=t,!Ar.mainLoop.func)return 1;if(Ar.mainLoop.running||(Ar.mainLoop.running=!0),0==e)Ar.mainLoop.scheduler=function(){var e=0|Math.max(0,Ar.mainLoop.tickStartTime+t-gr());setTimeout(Ar.mainLoop.runner,e)},Ar.mainLoop.method="timeout";else if(1==e)Ar.mainLoop.scheduler=function(){Ar.requestAnimationFrame(Ar.mainLoop.runner)},Ar.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),y?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}Ar.mainLoop.scheduler=function(){setImmediate(Ar.mainLoop.runner)},Ar.mainLoop.method="immediate"}return 0}gr=()=>performance.now();var Cr=e=>{if(e instanceof ce||"unwind"==e)return T;h(1,e)},Sr=(e,t)=>{var r;T=e,T=r=e,Y()||(u.onExit&&u.onExit(r),U=!0),h(r,new ce(r))},kr=e=>{if(!U)try{e(),(()=>{if(!Y())try{Sr(T)}catch(e){Cr(e)}})()}catch(e){Cr(e)}},xr=(e,t)=>setTimeout((()=>{kr(e)}),t),Ar={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Ar.mainLoop.scheduler=null,Ar.mainLoop.currentlyRunningMainloop++},resume:function(){Ar.mainLoop.currentlyRunningMainloop++;var e=Ar.mainLoop.timingMode,t=Ar.mainLoop.timingValue,r=Ar.mainLoop.func;Ar.mainLoop.func=null,function(e,t,r,n,o){N(!Ar.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Ar.mainLoop.func=e,Ar.mainLoop.arg=n;var i=Ar.mainLoop.currentlyRunningMainloop;function a(){return!(i<Ar.mainLoop.currentlyRunningMainloop)}if(Ar.mainLoop.running=!1,Ar.mainLoop.runner=function(){if(!U)if(Ar.mainLoop.queue.length>0){var t=Date.now(),r=Ar.mainLoop.queue.shift();if(r.func(r.arg),Ar.mainLoop.remainingBlockers){var n=Ar.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?Ar.mainLoop.remainingBlockers=o:(o+=.5,Ar.mainLoop.remainingBlockers=(8*n+o)/9)}if(C('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Ar.mainLoop.updateStatus(),!a())return;setTimeout(Ar.mainLoop.runner,0)}else a()&&(Ar.mainLoop.currentFrameNumber=Ar.mainLoop.currentFrameNumber+1|0,1==Ar.mainLoop.timingMode&&Ar.mainLoop.timingValue>1&&Ar.mainLoop.currentFrameNumber%Ar.mainLoop.timingValue!=0?Ar.mainLoop.scheduler():(0==Ar.mainLoop.timingMode&&(Ar.mainLoop.tickStartTime=gr()),Ar.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Ar.mainLoop.scheduler())))},o||(t&&t>0?_r(0,1e3/t):_r(1,1),Ar.mainLoop.scheduler()),r)throw"unwind"}(r,0,!1,Ar.mainLoop.arg,!0),_r(e,t),Ar.mainLoop.scheduler()},updateStatus:function(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=Ar.mainLoop.remainingBlockers,r=Ar.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter:function(e){if(!U){if(u.preMainLoop&&!1===u.preMainLoop())return;kr(e),u.postMainLoop&&u.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!Ar.initted){Ar.initted=!0;var e={canHandle:function(e){return!u.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=new Blob([e],{type:Ar.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:Ar.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{N(a.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=a.width,n.height=a.height,n.getContext("2d").drawImage(a,0,0),Uu[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{C("Image "+i+" could not be decoded"),n&&n()},a.src=i}};Ae.push(e);var t={canHandle:function(e){return!u.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function i(n){o||(o=!0,Nu[t]=n,r&&r(e))}var a=new Blob([e],{type:Ar.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(S("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),i(u))},u.src=s,xr((()=>{i(u)}),1e4)}};Ae.push(t);var r=u.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||(()=>{}),r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),u.elementPointerLock&&r.addEventListener("click",(e=>{!Ar.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){Ar.pointerLock=document.pointerLockElement===u.canvas||document.mozPointerLockElement===u.canvas||document.webkitPointerLockElement===u.canvas||document.msPointerLockElement===u.canvas}},createContext:function(e,t,r,n){if(t&&u.ctx&&e==u.canvas)return u.ctx;var o,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var s in n)a[s]=n[s];void 0!==Rr&&(i=Rr.createContext(e,a))&&(o=Rr.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||N(void 0===Ou,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),u.ctx=o,t&&Rr.makeContextCurrent(i),u.useWebGL=t,Ar.moduleContextCreatedCallbacks.forEach((e=>e())),Ar.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){Ar.lockPointer=e,Ar.resizeCanvas=t,void 0===Ar.lockPointer&&(Ar.lockPointer=!0),void 0===Ar.resizeCanvas&&(Ar.resizeCanvas=!1);var r=u.canvas;function n(){Ar.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=Ar.exitFullscreen,Ar.lockPointer&&r.requestPointerLock(),Ar.isFullscreen=!0,Ar.resizeCanvas?Ar.setFullscreenCanvasSize():Ar.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Ar.resizeCanvas?Ar.setWindowedCanvasSize():Ar.updateCanvasDimensions(r)),u.onFullScreen&&u.onFullScreen(Ar.isFullscreen),u.onFullscreen&&u.onFullscreen(Ar.isFullscreen)}Ar.fullscreenHandlersInstalled||(Ar.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?()=>o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(o.webkitRequestFullScreen?()=>o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),o.requestFullscreen()},exitFullscreen:function(){return!!Ar.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Ar.nextRAF)Ar.nextRAF=t+1e3/60;else for(;t+2>=Ar.nextRAF;)Ar.nextRAF+=1e3/60;var r=Math.max(Ar.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,Ar.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return xr(e,t)},safeRequestAnimationFrame:function(e){return Ar.requestAnimationFrame((()=>{kr(e)}))},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Ar.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Ar.mouseMovementX=Ar.mouseMovementY=0:(Ar.mouseMovementX=Ar.getMovementX(e),Ar.mouseMovementY=Ar.getMovementY(e)),"undefined"!=typeof SDL?(Ar.mouseX=SDL.mouseX+Ar.mouseMovementX,Ar.mouseY=SDL.mouseY+Ar.mouseMovementY):(Ar.mouseX+=Ar.mouseMovementX,Ar.mouseY+=Ar.mouseMovementY);else{var t=u.canvas.getBoundingClientRect(),r=u.canvas.width,n=u.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var s=a.pageX-(o+t.left),c=a.pageY-(i+t.top),l={x:s*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)Ar.lastTouches[a.identifier]=l,Ar.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=Ar.touches[a.identifier];d||(d=l),Ar.lastTouches[a.identifier]=d,Ar.touches[a.identifier]=l}return}var f=e.pageX-(o+t.left),p=e.pageY-(i+t.top);f*=r/t.width,p*=n/t.height,Ar.mouseMovementX=f-Ar.mouseX,Ar.mouseMovementY=p-Ar.mouseY,Ar.mouseX=f,Ar.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=u.canvas;Ar.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=u.canvas;Ar.updateCanvasDimensions(n,e,t),r||Ar.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e|=8388608,B[SDL.screen>>2]=e}Ar.updateCanvasDimensions(u.canvas),Ar.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e&=-8388609,B[SDL.screen>>2]=e}Ar.updateCanvasDimensions(u.canvas),Ar.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,o=r;if(u.forcedAspectRatio&&u.forcedAspectRatio>0&&(n/o<u.forcedAspectRatio?n=Math.round(o*u.forcedAspectRatio):o=Math.round(n/u.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/n,screen.height/o);n=Math.round(n*i),o=Math.round(o*i)}Ar.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=o&&(e.height=o),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||o!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",o+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},Tr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){Tr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return Tr.setErrorCode(12296),0;if(t)for(;;){var i=B[t>>2];if(12321==i){var a=B[t+4>>2];Tr.contextAttributes.alpha=a>0}else if(12325==i){var s=B[t+4>>2];Tr.contextAttributes.depth=s>0}else if(12326==i){var u=B[t+4>>2];Tr.contextAttributes.stencil=u>0}else if(12337==i){var c=B[t+4>>2];Tr.contextAttributes.antialias=c>0}else if(12338==i)c=B[t+4>>2],Tr.contextAttributes.antialias=1==c;else if(12544==i){var l=B[t+4>>2];Tr.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(B[o>>2]=1),r&&n>0&&(B[r>>2]=62002),Tr.setErrorCode(12288),1):(Tr.setErrorCode(12300),0)}};function Pr(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function qr(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function Fr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function Dr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function Br(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function Lr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var Rr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Rr.lastError||(Rr.lastError=e)},getNewId:function(e){for(var t=Rr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?B[n+4*i>>2]:-1;o+=qe(B[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){if(!e.getContextSafariWebGL2Fixed){let t=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null};e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=t}var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?Rr.registerContext(r,t):0},registerContext:function(e,t){var r=Rr.getNewId(Rr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Rr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Rr.initExtensions(n),r},makeContextCurrent:function(e){return Rr.currentContext=Rr.contexts[e],u.ctx=Ou=Rr.currentContext&&Rr.currentContext.GLctx,!(e&&!Ou)},getContext:function(e){return Rr.contexts[e]},deleteContext:function(e){Rr.currentContext===Rr.contexts[e]&&(Rr.currentContext=null),"object"==typeof wu&&wu.removeAllHandlersOnTarget(Rr.contexts[e].GLctx.canvas),Rr.contexts[e]&&Rr.contexts[e].GLctx.canvas&&(Rr.contexts[e].GLctx.canvas.GLctxObject=void 0),Rr.contexts[e]=null},initExtensions:function(e){if(e||(e=Rr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;Pr(t),qr(t),Fr(t),Dr(t),Br(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),Lr(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},Mr=[],Ir=(e,t,r)=>{var n=((e,t)=>{var r;for(Mr.length=0,t>>=2;r=q[e++];)t+=105!=r&t,Mr.push(105==r?B[t]:(106==r?M:O)[t++>>1]),++t;return Mr})(t,r);return ue[e].apply(null,n)},Or=function(e){Ou.activeTexture(e)},Ur=function(e,t){Ou.attachShader(Rr.programs[e],Rr.shaders[t])},Nr=function(e,t){Ou.beginQuery(e,Rr.queries[t])},$r=function(e,t){Ou.disjointTimerQueryExt.beginQueryEXT(e,Rr.queries[t])},Hr=function(e){Ou.beginTransformFeedback(e)},Vr=function(e,t,r){Ou.bindAttribLocation(Rr.programs[e],t,qe(r))},jr=function(e,t){35051==e?Ou.currentPixelPackBufferBinding=t:35052==e&&(Ou.currentPixelUnpackBufferBinding=t),Ou.bindBuffer(e,Rr.buffers[t])},Gr=function(e,t,r){Ou.bindBufferBase(e,t,Rr.buffers[r])},Wr=function(e,t,r,n,o){Ou.bindBufferRange(e,t,Rr.buffers[r],n,o)},zr=function(e,t){Ou.bindFramebuffer(e,Rr.framebuffers[t])},Yr=function(e,t){Ou.bindRenderbuffer(e,Rr.renderbuffers[t])},Xr=function(e,t){Ou.bindSampler(e,Rr.samplers[t])},Qr=function(e,t){Ou.bindTexture(e,Rr.textures[t])},Zr=function(e,t){Ou.bindTransformFeedback(e,Rr.transformFeedbacks[t])};function Kr(e){Ou.bindVertexArray(Rr.vaos[e])}var Jr=Kr,en=Kr,tn=function(e,t,r,n){Ou.blendColor(e,t,r,n)},rn=function(e){Ou.blendEquation(e)},nn=function(e,t){Ou.blendEquationSeparate(e,t)},on=function(e,t){Ou.blendFunc(e,t)},an=function(e,t,r,n){Ou.blendFuncSeparate(e,t,r,n)},sn=function(e,t,r,n,o,i,a,s,u,c){Ou.blitFramebuffer(e,t,r,n,o,i,a,s,u,c)},un=function(e,t,r,n){Rr.currentContext.version>=2?r&&t?Ou.bufferData(e,q,n,r,t):Ou.bufferData(e,t,n):Ou.bufferData(e,r?q.subarray(r,r+t):t,n)},cn=function(e,t,r,n){Rr.currentContext.version>=2?r&&Ou.bufferSubData(e,t,q,n,r):Ou.bufferSubData(e,t,q.subarray(n,n+r))},ln=function(e){return Ou.checkFramebufferStatus(e)},dn=function(e){Ou.clear(e)},fn=function(e,t,r,n){Ou.clearBufferfi(e,t,r,n)},pn=function(e,t,r){Ou.clearBufferfv(e,t,R,r>>2)},hn=function(e,t,r){Ou.clearBufferiv(e,t,B,r>>2)},mn=function(e,t,r){Ou.clearBufferuiv(e,t,L,r>>2)},gn=function(e,t,r,n){Ou.clearColor(e,t,r,n)},yn=function(e){Ou.clearDepth(e)},bn=function(e){Ou.clearStencil(e)},vn=function(e,t,r){return r=Number(r),Ou.clientWaitSync(Rr.syncs[e],t,r)},wn=function(e,t,r,n){Ou.colorMask(!!e,!!t,!!r,!!n)},En=function(e){Ou.compileShader(Rr.shaders[e])},_n=function(e,t,r,n,o,i,a,s){Rr.currentContext.version>=2?Ou.currentPixelUnpackBufferBinding||!a?Ou.compressedTexImage2D(e,t,r,n,o,i,a,s):Ou.compressedTexImage2D(e,t,r,n,o,i,q,s,a):Ou.compressedTexImage2D(e,t,r,n,o,i,s?q.subarray(s,s+a):null)},Cn=function(e,t,r,n,o,i,a,s,u){Ou.currentPixelUnpackBufferBinding?Ou.compressedTexImage3D(e,t,r,n,o,i,a,s,u):Ou.compressedTexImage3D(e,t,r,n,o,i,a,q,u,s)},Sn=function(e,t,r,n,o,i,a,s,u){Rr.currentContext.version>=2?Ou.currentPixelUnpackBufferBinding||!s?Ou.compressedTexSubImage2D(e,t,r,n,o,i,a,s,u):Ou.compressedTexSubImage2D(e,t,r,n,o,i,a,q,u,s):Ou.compressedTexSubImage2D(e,t,r,n,o,i,a,u?q.subarray(u,u+s):null)},kn=function(e,t,r,n,o,i,a,s,u,c,l){Ou.currentPixelUnpackBufferBinding?Ou.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,c,l):Ou.compressedTexSubImage3D(e,t,r,n,o,i,a,s,u,q,l,c)},xn=function(e,t,r,n,o){Ou.copyBufferSubData(e,t,r,n,o)},An=function(e,t,r,n,o,i,a,s){Ou.copyTexImage2D(e,t,r,n,o,i,a,s)},Tn=function(e,t,r,n,o,i,a,s){Ou.copyTexSubImage2D(e,t,r,n,o,i,a,s)},Pn=function(e,t,r,n,o,i,a,s,u){Ou.copyTexSubImage3D(e,t,r,n,o,i,a,s,u)},qn=function(){var e=Rr.getNewId(Rr.programs),t=Ou.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,Rr.programs[e]=t,e},Fn=function(e){var t=Rr.getNewId(Rr.shaders);return Rr.shaders[t]=Ou.createShader(e),t},Dn=function(e){Ou.cullFace(e)},Bn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.buffers[n];o&&(Ou.deleteBuffer(o),o.name=0,Rr.buffers[n]=null,n==Ou.currentPixelPackBufferBinding&&(Ou.currentPixelPackBufferBinding=0),n==Ou.currentPixelUnpackBufferBinding&&(Ou.currentPixelUnpackBufferBinding=0))}},Ln=function(e,t){for(var r=0;r<e;++r){var n=B[t+4*r>>2],o=Rr.framebuffers[n];o&&(Ou.deleteFramebuffer(o),o.name=0,Rr.framebuffers[n]=null)}},Rn=function(e){if(e){var t=Rr.programs[e];t?(Ou.deleteProgram(t),t.name=0,Rr.programs[e]=null):Rr.recordError(1281)}},Mn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.queries[n];o&&(Ou.deleteQuery(o),Rr.queries[n]=null)}},In=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.queries[n];o&&(Ou.disjointTimerQueryExt.deleteQueryEXT(o),Rr.queries[n]=null)}},On=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.renderbuffers[n];o&&(Ou.deleteRenderbuffer(o),o.name=0,Rr.renderbuffers[n]=null)}},Un=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.samplers[n];o&&(Ou.deleteSampler(o),o.name=0,Rr.samplers[n]=null)}},Nn=function(e){if(e){var t=Rr.shaders[e];t?(Ou.deleteShader(t),Rr.shaders[e]=null):Rr.recordError(1281)}},$n=function(e){if(e){var t=Rr.syncs[e];t?(Ou.deleteSync(t),t.name=0,Rr.syncs[e]=null):Rr.recordError(1281)}},Hn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.textures[n];o&&(Ou.deleteTexture(o),o.name=0,Rr.textures[n]=null)}},Vn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Rr.transformFeedbacks[n];o&&(Ou.deleteTransformFeedback(o),o.name=0,Rr.transformFeedbacks[n]=null)}};function jn(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2];Ou.deleteVertexArray(Rr.vaos[n]),Rr.vaos[n]=null}}var Gn=jn,Wn=jn,zn=function(e){Ou.depthFunc(e)},Yn=function(e){Ou.depthMask(!!e)},Xn=function(e,t){Ou.depthRange(e,t)},Qn=function(e,t){Ou.detachShader(Rr.programs[e],Rr.shaders[t])},Zn=function(e){Ou.disable(e)},Kn=function(e){Ou.disableVertexAttribArray(e)},Jn=function(e,t,r){Ou.drawArrays(e,t,r)};function eo(e,t,r,n){Ou.drawArraysInstanced(e,t,r,n)}var to=eo,ro=eo,no=eo,oo=function(e,t,r,n,o){Ou.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},io=eo,ao=eo,so=[];function uo(e,t){for(var r=so[e],n=0;n<e;n++)r[n]=B[t+4*n>>2];Ou.drawBuffers(r)}var co=uo,lo=uo,fo=uo;function po(e,t,r,n){Ou.drawElements(e,t,r,n)}var ho=po;function mo(e,t,r,n,o){Ou.drawElementsInstanced(e,t,r,n,o)}var go=mo,yo=mo,bo=mo,vo=function(e,t,r,n,o,i,a){Ou.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)},wo=mo,Eo=mo,_o=function(e,t,r,n,o,i){po(e,n,o,i)},Co=function(e){Ou.enable(e)},So=function(e){Ou.enableVertexAttribArray(e)},ko=function(e){Ou.endQuery(e)},xo=function(e){Ou.disjointTimerQueryExt.endQueryEXT(e)},Ao=function(){Ou.endTransformFeedback()},To=function(e,t){var r=Ou.fenceSync(e,t);if(r){var n=Rr.getNewId(Rr.syncs);return r.name=n,Rr.syncs[n]=r,n}return 0},Po=function(){Ou.finish()},qo=function(){Ou.flush()},Fo=function(e,t,r,n){Ou.framebufferRenderbuffer(e,t,r,Rr.renderbuffers[n])},Do=function(e,t,r,n,o){Ou.framebufferTexture2D(e,t,r,Rr.textures[n],o)},Bo=function(e,t,r,n,o){Ou.framebufferTextureLayer(e,t,Rr.textures[r],n,o)},Lo=function(e){Ou.frontFace(e)};function Ro(e,t,r,n){for(var o=0;o<e;o++){var i=Ou[r](),a=i&&Rr.getNewId(n);i?(i.name=a,n[a]=i):Rr.recordError(1282),B[t+4*o>>2]=a}}var Mo=function(e,t){Ro(e,t,"createBuffer",Rr.buffers)},Io=function(e,t){Ro(e,t,"createFramebuffer",Rr.framebuffers)},Oo=function(e,t){Ro(e,t,"createQuery",Rr.queries)},Uo=function(e,t){for(var r=0;r<e;r++){var n=Ou.disjointTimerQueryExt.createQueryEXT();if(!n){for(Rr.recordError(1282);r<e;)B[t+4*r++>>2]=0;return}var o=Rr.getNewId(Rr.queries);n.name=o,Rr.queries[o]=n,B[t+4*r>>2]=o}},No=function(e,t){Ro(e,t,"createRenderbuffer",Rr.renderbuffers)},$o=function(e,t){Ro(e,t,"createSampler",Rr.samplers)},Ho=function(e,t){Ro(e,t,"createTexture",Rr.textures)},Vo=function(e,t){Ro(e,t,"createTransformFeedback",Rr.transformFeedbacks)};function jo(e,t){Ro(e,t,"createVertexArray",Rr.vaos)}var Go=jo,Wo=jo,zo=function(e){Ou.generateMipmap(e)};function Yo(e,t,r,n,o,i,a,s){t=Rr.programs[t];var u=Ou[e](t,r);if(u){var c=s&&Kt(u.name,s,n);o&&(B[o>>2]=c),i&&(B[i>>2]=u.size),a&&(B[a>>2]=u.type)}}var Xo=function(e,t,r,n,o,i,a){Yo("getActiveAttrib",e,t,r,n,o,i,a)},Qo=function(e,t,r,n,o,i,a){Yo("getActiveUniform",e,t,r,n,o,i,a)},Zo=function(e,t,r,n,o){e=Rr.programs[e];var i=Ou.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=Kt(i,o,r);n&&(B[n>>2]=a)}else n&&(B[n>>2]=0)},Ko=function(e,t,r,n){if(n)if(e=Rr.programs[e],35393!=r){var o=Ou.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)B[n+4*i>>2]=o[i];else B[n>>2]=o}else{var a=Ou.getActiveUniformBlockName(e,t);B[n>>2]=a.length+1}else Rr.recordError(1281)},Jo=function(e,t,r,n,o){if(o)if(t>0&&0==r)Rr.recordError(1281);else{e=Rr.programs[e];for(var i=[],a=0;a<t;a++)i.push(B[r+4*a>>2]);var s=Ou.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)B[o+4*a>>2]=s[a]}}else Rr.recordError(1281)},ei=function(e,t,r,n){var o=Ou.getAttachedShaders(Rr.programs[e]),i=o.length;i>t&&(i=t),B[r>>2]=i;for(var a=0;a<i;++a){var s=Rr.shaders.indexOf(o[a]);B[n+4*a>>2]=s}},ti=function(e,t){return Ou.getAttribLocation(Rr.programs[e],qe(t))};function ri(e,t){L[e>>2]=t,L[e+4>>2]=(t-L[e>>2])/4294967296}function ni(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&Rr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Ou.getParameter(34467);n=o?o.length:0;break;case 33309:if(Rr.currentContext.version<2)return void Rr.recordError(1282);n=2*(Ou.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(Rr.currentContext.version<2)return void Rr.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=Ou.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void Rr.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Rr.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var a=0;a<i.length;++a)switch(r){case 0:B[t+4*a>>2]=i[a];break;case 2:R[t+4*a>>2]=i[a];break;case 4:P[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return Rr.recordError(1280),void S("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Rr.recordError(1280),void S("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+i+" of type "+typeof i+"!")}}switch(r){case 1:ri(t,n);break;case 0:B[t>>2]=n;break;case 2:R[t>>2]=n;break;case 4:P[t>>0]=n?1:0}}else Rr.recordError(1281)}var oi=function(e,t){ni(e,t,4)},ii=function(e,t,r){r?ri(r,Ou.getBufferParameter(e,t)):Rr.recordError(1281)},ai=function(e,t,r){r?B[r>>2]=Ou.getBufferParameter(e,t):Rr.recordError(1281)},si=function(){var e=Ou.getError()||Rr.lastError;return Rr.lastError=0,e},ui=function(e,t){ni(e,t,2)},ci=function(e,t){return Ou.getFragDataLocation(Rr.programs[e],qe(t))},li=function(e,t,r,n){var o=Ou.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),B[n>>2]=o};function di(e,t,r,n){if(r){var o,i=Ou.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void Rr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void Rr.recordError(1280);o=0|i.name}break;default:return void Rr.recordError(1280)}switch(n){case 1:ri(r,o);break;case 0:B[r>>2]=o;break;case 2:R[r>>2]=o;break;case 4:P[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else Rr.recordError(1281)}var fi=function(e,t,r){di(e,t,r,1)},pi=function(e,t){ni(e,t,1)},hi=function(e,t,r){di(e,t,r,0)},mi=function(e,t){ni(e,t,0)},gi=function(e,t,r,n,o){if(n<0)Rr.recordError(1281);else if(o){var i=Ou.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)B[o+4*a>>2]=i[a]}else Rr.recordError(1281)},yi=function(e,t,r,n,o){Rr.recordError(1282)},bi=function(e,t,r,n){var o=Ou.getProgramInfoLog(Rr.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Kt(o,n,t):0;r&&(B[r>>2]=i)},vi=function(e,t,r){if(r)if(e>=Rr.counter)Rr.recordError(1281);else if(e=Rr.programs[e],35716==t){var n=Ou.getProgramInfoLog(e);null===n&&(n="(unknown error)"),B[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<Ou.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,Ou.getActiveUniform(e,o).name.length+1);B[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<Ou.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,Ou.getActiveAttrib(e,o).name.length+1);B[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<Ou.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Ou.getActiveUniformBlockName(e,o).length+1);B[r>>2]=e.maxUniformBlockNameLength}else B[r>>2]=Ou.getProgramParameter(e,t);else Rr.recordError(1281)};function wi(e,t,r){if(r){var n,o=Rr.queries[e];ri(r,"boolean"==typeof(n=Rr.currentContext.version<2?Ou.disjointTimerQueryExt.getQueryObjectEXT(o,t):Ou.getQueryParameter(o,t))?n?1:0:n)}else Rr.recordError(1281)}var Ei=wi;function _i(e,t,r){if(r){var n,o=Rr.queries[e],i=Ou.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,B[r>>2]=n}else Rr.recordError(1281)}var Ci=_i,Si=wi,ki=function(e,t,r){if(r){var n,o=Rr.queries[e],i=Ou.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,B[r>>2]=n}else Rr.recordError(1281)},xi=_i,Ai=function(e,t,r){r?B[r>>2]=Ou.getQuery(e,t):Rr.recordError(1281)},Ti=function(e,t,r){r?B[r>>2]=Ou.disjointTimerQueryExt.getQueryEXT(e,t):Rr.recordError(1281)},Pi=function(e,t,r){r?B[r>>2]=Ou.getRenderbufferParameter(e,t):Rr.recordError(1281)},qi=function(e,t,r){r?R[r>>2]=Ou.getSamplerParameter(Rr.samplers[e],t):Rr.recordError(1281)},Fi=function(e,t,r){r?B[r>>2]=Ou.getSamplerParameter(Rr.samplers[e],t):Rr.recordError(1281)},Di=function(e,t,r,n){var o=Ou.getShaderInfoLog(Rr.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Kt(o,n,t):0;r&&(B[r>>2]=i)},Bi=function(e,t,r,n){var o=Ou.getShaderPrecisionFormat(e,t);B[r>>2]=o.rangeMin,B[r+4>>2]=o.rangeMax,B[n>>2]=o.precision},Li=function(e,t,r,n){var o=Ou.getShaderSource(Rr.shaders[e]);if(o){var i=t>0&&n?Kt(o,n,t):0;r&&(B[r>>2]=i)}},Ri=function(e,t,r){if(r)if(35716==t){var n=Ou.getShaderInfoLog(Rr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;B[r>>2]=o}else if(35720==t){var i=Ou.getShaderSource(Rr.shaders[e]),a=i?i.length+1:0;B[r>>2]=a}else B[r>>2]=Ou.getShaderParameter(Rr.shaders[e],t);else Rr.recordError(1281)},Mi=function(e){var t=Rr.stringCache[e];if(!t){switch(e){case 7939:var r=Ou.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=Er(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Ou.getParameter(e);n||Rr.recordError(1280),t=n&&Er(n);break;case 7938:var o=Ou.getParameter(7938);o=Rr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=Er(o);break;case 35724:var i=Ou.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=Er(i);break;default:Rr.recordError(1280)}Rr.stringCache[e]=t}return t},Ii=function(e,t){if(Rr.currentContext.version<2)return Rr.recordError(1282),0;var r=Rr.stringiCache[e];if(r)return t<0||t>=r.length?(Rr.recordError(1281),0):r[t];if(7939===e){var n=Ou.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return Er(e)})),r=Rr.stringiCache[e]=n,t<0||t>=r.length?(Rr.recordError(1281),0):r[t]}return Rr.recordError(1280),0},Oi=function(e,t,r,n,o){if(r<0)Rr.recordError(1281);else if(o){var i=Ou.getSyncParameter(Rr.syncs[e],t);null!==i&&(B[o>>2]=i,n&&(B[n>>2]=1))}else Rr.recordError(1281)},Ui=function(e,t,r){r?R[r>>2]=Ou.getTexParameter(e,t):Rr.recordError(1281)},Ni=function(e,t,r){r?B[r>>2]=Ou.getTexParameter(e,t):Rr.recordError(1281)},$i=function(e,t,r,n,o,i,a){e=Rr.programs[e];var s=Ou.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Kt(s.name,a,r);n&&(B[n>>2]=u)}else n&&(B[n>>2]=0);o&&(B[o>>2]=s.size),i&&(B[i>>2]=s.type)}},Hi=function(e,t){return Ou.getUniformBlockIndex(Rr.programs[e],qe(t))},Vi=function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))Rr.recordError(1281);else{e=Rr.programs[e];for(var o=[],i=0;i<t;i++)o.push(qe(B[r+4*i>>2]));var a=Ou.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)B[n+4*i>>2]=a[i]}}else Rr.recordError(1281)};function ji(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function Gi(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<Ou.getProgramParameter(e,35718);++t){var i=Ou.getActiveUniform(e,t),a=i.name,s=i.size,u=ji(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],r=0;r<s;++r)n[l]=r,e.uniformArrayNamesById[l++]=c}}var Wi=function(e,t){if(t=qe(t),e=Rr.programs[e]){Gi(e);var r=e.uniformLocsById,n=0,o=t,i=ji(t);i>0&&(s=t.slice(i+1),n=parseInt(s)>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||Ou.getUniformLocation(e,t)))return n}else Rr.recordError(1281);var s;return-1};function zi(e){var t=Ou.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=Ou.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}Rr.recordError(1282)}function Yi(e,t,r,n){if(r){Gi(e=Rr.programs[e]);var o=Ou.getUniform(e,zi(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:B[r>>2]=o;break;case 2:R[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:B[r+4*i>>2]=o[i];break;case 2:R[r+4*i>>2]=o[i]}}else Rr.recordError(1281)}var Xi=function(e,t,r){Yi(e,t,r,2)},Qi=function(e,t,r){Yi(e,t,r,0)},Zi=function(e,t,r){Yi(e,t,r,0)};function Ki(e,t,r,n){if(r){var o=Ou.getVertexAttrib(e,t);if(34975==t)B[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:B[r>>2]=o;break;case 2:R[r>>2]=o;break;case 5:B[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:B[r+4*i>>2]=o[i];break;case 2:R[r+4*i>>2]=o[i];break;case 5:B[r+4*i>>2]=Math.fround(o[i])}}else Rr.recordError(1281)}function Ji(e,t,r){Ki(e,t,r,0)}var ea=Ji,ta=Ji,ra=function(e,t,r){r?B[r>>2]=Ou.getVertexAttribOffset(e,t):Rr.recordError(1281)},na=function(e,t,r){Ki(e,t,r,2)},oa=function(e,t,r){Ki(e,t,r,5)},ia=function(e,t){Ou.hint(e,t)},aa=function(e,t,r){for(var n=so[t],o=0;o<t;o++)n[o]=B[r+4*o>>2];Ou.invalidateFramebuffer(e,n)},sa=function(e,t,r,n,o,i,a){for(var s=so[t],u=0;u<t;u++)s[u]=B[r+4*u>>2];Ou.invalidateSubFramebuffer(e,s,n,o,i,a)},ua=function(e){var t=Rr.buffers[e];return t?Ou.isBuffer(t):0},ca=function(e){return Ou.isEnabled(e)},la=function(e){var t=Rr.framebuffers[e];return t?Ou.isFramebuffer(t):0},da=function(e){return(e=Rr.programs[e])?Ou.isProgram(e):0},fa=function(e){var t=Rr.queries[e];return t?Ou.isQuery(t):0},pa=function(e){var t=Rr.queries[e];return t?Ou.disjointTimerQueryExt.isQueryEXT(t):0},ha=function(e){var t=Rr.renderbuffers[e];return t?Ou.isRenderbuffer(t):0},ma=function(e){var t=Rr.samplers[e];return t?Ou.isSampler(t):0},ga=function(e){var t=Rr.shaders[e];return t?Ou.isShader(t):0},ya=function(e){return Ou.isSync(Rr.syncs[e])},ba=function(e){var t=Rr.textures[e];return t?Ou.isTexture(t):0},va=function(e){return Ou.isTransformFeedback(Rr.transformFeedbacks[e])};function wa(e){var t=Rr.vaos[e];return t?Ou.isVertexArray(t):0}var Ea=wa,_a=wa,Ca=function(e){Ou.lineWidth(e)},Sa=function(e){e=Rr.programs[e],Ou.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},ka=function(e,t,r,n,o,i){Ou.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,B,t>>2,B,r>>2,B,n>>2,L,o>>2,i)},xa=function(e,t,r,n,o,i,a,s){Ou.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,B,t>>2,r,B,n>>2,B,o>>2,B,i>>2,L,a>>2,s)},Aa=function(){Ou.pauseTransformFeedback()},Ta=function(e,t){3317==e&&(Rr.unpackAlignment=t),Ou.pixelStorei(e,t)},Pa=function(e,t){Ou.polygonOffset(e,t)},qa=function(e,t,r,n){Rr.recordError(1280)},Fa=function(e,t,r){Rr.recordError(1280)},Da=function(e,t){Ou.disjointTimerQueryExt.queryCounterEXT(Rr.queries[e],t)},Ba=function(e){Ou.readBuffer(e)};function La(e){return 0==(e-=5120)?P:1==e?q:2==e?F:4==e?B:6==e?R:5==e||28922==e||28520==e||30779==e||30782==e?L:D}function Ra(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Ma(e,t,r,n,o,i){var a=La(e),s=Ra(a),u=1<<s,c=function(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}(t)*u,l=function(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}(r,n,c,Rr.unpackAlignment);return a.subarray(o>>s,o+l>>s)}var Ia=function(e,t,r,n,o,i,a){if(Rr.currentContext.version>=2)if(Ou.currentPixelPackBufferBinding)Ou.readPixels(e,t,r,n,o,i,a);else{var s=La(i);Ou.readPixels(e,t,r,n,o,i,s,a>>Ra(s))}else{var u=Ma(i,o,r,n,a);u?Ou.readPixels(e,t,r,n,o,i,u):Rr.recordError(1280)}},Oa=function(){},Ua=function(e,t,r,n){Ou.renderbufferStorage(e,t,r,n)},Na=function(e,t,r,n,o){Ou.renderbufferStorageMultisample(e,t,r,n,o)},$a=function(){Ou.resumeTransformFeedback()},Ha=function(e,t){Ou.sampleCoverage(e,!!t)},Va=function(e,t,r){Ou.samplerParameterf(Rr.samplers[e],t,r)},ja=function(e,t,r){var n=R[r>>2];Ou.samplerParameterf(Rr.samplers[e],t,n)},Ga=function(e,t,r){Ou.samplerParameteri(Rr.samplers[e],t,r)},Wa=function(e,t,r){var n=B[r>>2];Ou.samplerParameteri(Rr.samplers[e],t,n)},za=function(e,t,r,n){Ou.scissor(e,t,r,n)},Ya=function(e,t,r,n,o){Rr.recordError(1280)},Xa=function(e,t,r,n){var o=Rr.getSource(e,t,r,n);if(Rr.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}Ou.shaderSource(Rr.shaders[e],o)},Qa=function(e,t,r){Ou.stencilFunc(e,t,r)},Za=function(e,t,r,n){Ou.stencilFuncSeparate(e,t,r,n)},Ka=function(e){Ou.stencilMask(e)},Ja=function(e,t){Ou.stencilMaskSeparate(e,t)},es=function(e,t,r){Ou.stencilOp(e,t,r)},ts=function(e,t,r,n){Ou.stencilOpSeparate(e,t,r,n)},rs=function(e,t,r,n,o,i,a,s,u){if(Rr.currentContext.version>=2&&(6402==a&&6402==r&&5125==s&&(r=33190),36193==s&&(s=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),Rr.currentContext.version>=2)if(Ou.currentPixelUnpackBufferBinding)Ou.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=La(s);Ou.texImage2D(e,t,r,n,o,i,a,s,c,u>>Ra(c))}else Ou.texImage2D(e,t,r,n,o,i,a,s,null);else Ou.texImage2D(e,t,r,n,o,i,a,s,u?Ma(s,a,n,o,u):null)},ns=function(e,t,r,n,o,i,a,s,u,c){if(Ou.currentPixelUnpackBufferBinding)Ou.texImage3D(e,t,r,n,o,i,a,s,u,c);else if(c){var l=La(u);Ou.texImage3D(e,t,r,n,o,i,a,s,u,l,c>>Ra(l))}else Ou.texImage3D(e,t,r,n,o,i,a,s,u,null)},os=function(e,t,r){Ou.texParameterf(e,t,r)},is=function(e,t,r){var n=R[r>>2];Ou.texParameterf(e,t,n)},as=function(e,t,r){Ou.texParameteri(e,t,r)},ss=function(e,t,r){var n=B[r>>2];Ou.texParameteri(e,t,n)},us=function(e,t,r,n,o){Ou.texStorage2D(e,t,r,n,o)},cs=function(e,t,r,n,o,i){Ou.texStorage3D(e,t,r,n,o,i)},ls=function(e,t,r,n,o,i,a,s,u){if(Rr.currentContext.version>=2&&36193==s&&(s=5131),Rr.currentContext.version>=2)if(Ou.currentPixelUnpackBufferBinding)Ou.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=La(s);Ou.texSubImage2D(e,t,r,n,o,i,a,s,c,u>>Ra(c))}else Ou.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var l=null;u&&(l=Ma(s,a,o,i,u)),Ou.texSubImage2D(e,t,r,n,o,i,a,s,l)}},ds=function(e,t,r,n,o,i,a,s,u,c,l){if(Ou.currentPixelUnpackBufferBinding)Ou.texSubImage3D(e,t,r,n,o,i,a,s,u,c,l);else if(l){var d=La(c);Ou.texSubImage3D(e,t,r,n,o,i,a,s,u,c,d,l>>Ra(d))}else Ou.texSubImage3D(e,t,r,n,o,i,a,s,u,c,null)},fs=function(e,t,r,n){e=Rr.programs[e];for(var o=[],i=0;i<t;i++)o.push(qe(B[r+4*i>>2]));Ou.transformFeedbackVaryings(e,o,n)},ps=function(e,t){Ou.uniform1f(zi(e),t)},hs=[],ms=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform1fv(zi(e),R,r>>2,t);else{if(t<=288)for(var n=hs[t-1],o=0;o<t;++o)n[o]=R[r+4*o>>2];else n=R.subarray(r>>2,r+4*t>>2);Ou.uniform1fv(zi(e),n)}},gs=function(e,t){Ou.uniform1i(zi(e),t)},ys=[],bs=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform1iv(zi(e),B,r>>2,t);else{if(t<=288)for(var n=ys[t-1],o=0;o<t;++o)n[o]=B[r+4*o>>2];else n=B.subarray(r>>2,r+4*t>>2);Ou.uniform1iv(zi(e),n)}},vs=function(e,t){Ou.uniform1ui(zi(e),t)},ws=function(e,t,r){t&&Ou.uniform1uiv(zi(e),L,r>>2,t)},Es=function(e,t,r){Ou.uniform2f(zi(e),t,r)},_s=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform2fv(zi(e),R,r>>2,2*t);else{if(t<=144)for(var n=hs[2*t-1],o=0;o<2*t;o+=2)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2];else n=R.subarray(r>>2,r+8*t>>2);Ou.uniform2fv(zi(e),n)}},Cs=function(e,t,r){Ou.uniform2i(zi(e),t,r)},Ss=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform2iv(zi(e),B,r>>2,2*t);else{if(t<=144)for(var n=ys[2*t-1],o=0;o<2*t;o+=2)n[o]=B[r+4*o>>2],n[o+1]=B[r+(4*o+4)>>2];else n=B.subarray(r>>2,r+8*t>>2);Ou.uniform2iv(zi(e),n)}},ks=function(e,t,r){Ou.uniform2ui(zi(e),t,r)},xs=function(e,t,r){t&&Ou.uniform2uiv(zi(e),L,r>>2,2*t)},As=function(e,t,r,n){Ou.uniform3f(zi(e),t,r,n)},Ts=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform3fv(zi(e),R,r>>2,3*t);else{if(t<=96)for(var n=hs[3*t-1],o=0;o<3*t;o+=3)n[o]=R[r+4*o>>2],n[o+1]=R[r+(4*o+4)>>2],n[o+2]=R[r+(4*o+8)>>2];else n=R.subarray(r>>2,r+12*t>>2);Ou.uniform3fv(zi(e),n)}},Ps=function(e,t,r,n){Ou.uniform3i(zi(e),t,r,n)},qs=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform3iv(zi(e),B,r>>2,3*t);else{if(t<=96)for(var n=ys[3*t-1],o=0;o<3*t;o+=3)n[o]=B[r+4*o>>2],n[o+1]=B[r+(4*o+4)>>2],n[o+2]=B[r+(4*o+8)>>2];else n=B.subarray(r>>2,r+12*t>>2);Ou.uniform3iv(zi(e),n)}},Fs=function(e,t,r,n){Ou.uniform3ui(zi(e),t,r,n)},Ds=function(e,t,r){t&&Ou.uniform3uiv(zi(e),L,r>>2,3*t)},Bs=function(e,t,r,n,o){Ou.uniform4f(zi(e),t,r,n,o)},Ls=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform4fv(zi(e),R,r>>2,4*t);else{if(t<=72){var n=hs[4*t-1],o=R;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=R.subarray(r>>2,r+16*t>>2);Ou.uniform4fv(zi(e),n)}},Rs=function(e,t,r,n,o){Ou.uniform4i(zi(e),t,r,n,o)},Ms=function(e,t,r){if(Rr.currentContext.version>=2)t&&Ou.uniform4iv(zi(e),B,r>>2,4*t);else{if(t<=72)for(var n=ys[4*t-1],o=0;o<4*t;o+=4)n[o]=B[r+4*o>>2],n[o+1]=B[r+(4*o+4)>>2],n[o+2]=B[r+(4*o+8)>>2],n[o+3]=B[r+(4*o+12)>>2];else n=B.subarray(r>>2,r+16*t>>2);Ou.uniform4iv(zi(e),n)}},Is=function(e,t,r,n,o){Ou.uniform4ui(zi(e),t,r,n,o)},Os=function(e,t,r){t&&Ou.uniform4uiv(zi(e),L,r>>2,4*t)},Us=function(e,t,r){e=Rr.programs[e],Ou.uniformBlockBinding(e,t,r)},Ns=function(e,t,r,n){if(Rr.currentContext.version>=2)t&&Ou.uniformMatrix2fv(zi(e),!!r,R,n>>2,4*t);else{if(t<=72)for(var o=hs[4*t-1],i=0;i<4*t;i+=4)o[i]=R[n+4*i>>2],o[i+1]=R[n+(4*i+4)>>2],o[i+2]=R[n+(4*i+8)>>2],o[i+3]=R[n+(4*i+12)>>2];else o=R.subarray(n>>2,n+16*t>>2);Ou.uniformMatrix2fv(zi(e),!!r,o)}},$s=function(e,t,r,n){t&&Ou.uniformMatrix2x3fv(zi(e),!!r,R,n>>2,6*t)},Hs=function(e,t,r,n){t&&Ou.uniformMatrix2x4fv(zi(e),!!r,R,n>>2,8*t)},Vs=function(e,t,r,n){if(Rr.currentContext.version>=2)t&&Ou.uniformMatrix3fv(zi(e),!!r,R,n>>2,9*t);else{if(t<=32)for(var o=hs[9*t-1],i=0;i<9*t;i+=9)o[i]=R[n+4*i>>2],o[i+1]=R[n+(4*i+4)>>2],o[i+2]=R[n+(4*i+8)>>2],o[i+3]=R[n+(4*i+12)>>2],o[i+4]=R[n+(4*i+16)>>2],o[i+5]=R[n+(4*i+20)>>2],o[i+6]=R[n+(4*i+24)>>2],o[i+7]=R[n+(4*i+28)>>2],o[i+8]=R[n+(4*i+32)>>2];else o=R.subarray(n>>2,n+36*t>>2);Ou.uniformMatrix3fv(zi(e),!!r,o)}},js=function(e,t,r,n){t&&Ou.uniformMatrix3x2fv(zi(e),!!r,R,n>>2,6*t)},Gs=function(e,t,r,n){t&&Ou.uniformMatrix3x4fv(zi(e),!!r,R,n>>2,12*t)},Ws=function(e,t,r,n){if(Rr.currentContext.version>=2)t&&Ou.uniformMatrix4fv(zi(e),!!r,R,n>>2,16*t);else{if(t<=18){var o=hs[16*t-1],i=R;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=R.subarray(n>>2,n+64*t>>2);Ou.uniformMatrix4fv(zi(e),!!r,o)}},zs=function(e,t,r,n){t&&Ou.uniformMatrix4x2fv(zi(e),!!r,R,n>>2,8*t)},Ys=function(e,t,r,n){t&&Ou.uniformMatrix4x3fv(zi(e),!!r,R,n>>2,12*t)},Xs=function(e){e=Rr.programs[e],Ou.useProgram(e),Ou.currentProgram=e},Qs=function(e){Ou.validateProgram(Rr.programs[e])},Zs=function(e,t){Ou.vertexAttrib1f(e,t)},Ks=function(e,t){Ou.vertexAttrib1f(e,R[t>>2])},Js=function(e,t,r){Ou.vertexAttrib2f(e,t,r)},eu=function(e,t){Ou.vertexAttrib2f(e,R[t>>2],R[t+4>>2])},tu=function(e,t,r,n){Ou.vertexAttrib3f(e,t,r,n)},ru=function(e,t){Ou.vertexAttrib3f(e,R[t>>2],R[t+4>>2],R[t+8>>2])},nu=function(e,t,r,n,o){Ou.vertexAttrib4f(e,t,r,n,o)},ou=function(e,t){Ou.vertexAttrib4f(e,R[t>>2],R[t+4>>2],R[t+8>>2],R[t+12>>2])};function iu(e,t){Ou.vertexAttribDivisor(e,t)}var au=iu,su=iu,uu=iu,cu=iu,lu=iu,du=function(e,t,r,n,o){Ou.vertexAttribI4i(e,t,r,n,o)},fu=function(e,t){Ou.vertexAttribI4i(e,B[t>>2],B[t+4>>2],B[t+8>>2],B[t+12>>2])},pu=function(e,t,r,n,o){Ou.vertexAttribI4ui(e,t,r,n,o)},hu=function(e,t){Ou.vertexAttribI4ui(e,L[t>>2],L[t+4>>2],L[t+8>>2],L[t+12>>2])},mu=function(e,t,r,n,o){Ou.vertexAttribIPointer(e,t,r,n,o)},gu=function(e,t,r,n,o,i){Ou.vertexAttribPointer(e,t,r,!!n,o,i)},yu=function(e,t,r,n){Ou.viewport(e,t,r,n)},bu=function(e,t,r){r=Number(r),Ou.waitSync(Rr.syncs[e],t,r)},vu=e=>{var t=e-k.buffer.byteLength+65535>>>16;try{return k.grow(t),$(),1}catch(e){}},wu={inEventHandler:0,removeAllEventListeners:function(){for(var e=wu.eventHandlers.length-1;e>=0;--e)wu._removeHandler(e);wu.eventHandlers=[],wu.deferredCalls=[]},registerRemoveEventListeners:function(){wu.removeEventListenersRegistered||(W.push(wu.removeAllEventListeners),wu.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in wu.deferredCalls){var i=wu.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}wu.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),wu.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<wu.deferredCalls.length;++t)wu.deferredCalls[t].targetFunction==e&&(wu.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return navigator.userActivation?navigator.userActivation.isActive:wu.inEventHandler&&wu.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(wu.canPerformEventHandlerRequests())for(var e=0;e<wu.deferredCalls.length;++e){var t=wu.deferredCalls[e];wu.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<wu.eventHandlers.length;++r)wu.eventHandlers[r].target!=e||t&&t!=wu.eventHandlers[r].eventTypeString||wu._removeHandler(r--)},_removeHandler:function(e){var t=wu.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),wu.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){if(!e.target)return-4;var t=function(t){++wu.inEventHandler,wu.currentEventHandler=e,wu.runDeferredCalls(),e.handlerFunc(t),wu.runDeferredCalls(),--wu.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),wu.eventHandlers.push(e),wu.registerRemoveEventListeners();else for(var r=0;r<wu.eventHandlers.length;++r)wu.eventHandlers[r].target==e.target&&wu.eventHandlers[r].eventTypeString==e.eventTypeString&&wu._removeHandler(r--);return 0},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Eu=["default","low-power","high-performance"],_u=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];function Cu(e){var t;return e=(t=e)>2?qe(t):t,_u[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}var Su,ku,xu,Au=function(e,t){var r=t>>2,n=B[r+6],o={alpha:!!B[r+0],depth:!!B[r+1],stencil:!!B[r+2],antialias:!!B[r+3],premultipliedAlpha:!!B[r+4],preserveDrawingBuffer:!!B[r+5],powerPreference:Eu[n],failIfMajorPerformanceCaveat:!!B[r+7],majorVersion:B[r+8],minorVersion:B[r+9],enableExtensionsByDefault:B[r+10],explicitSwapControl:B[r+11],proxyContextToMainThread:B[r+12],renderViaOffscreenBackBuffer:B[r+13]},i=function(e){return Cu(e)}(e);return i?o.explicitSwapControl?0:Rr.createContext(i,o):0},Tu={},Pu=()=>{if(!Pu.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in Tu)void 0===Tu[t]?delete e[t]:e[t]=Tu[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);Pu.strings=r}return Pu.strings},qu=(e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Pe.read(e,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;void 0!==n&&(n+=u)}return o},Fu=[31,29,31,30,31,30,31,31,30,31,30,31],Du=[31,28,31,30,31,30,31,31,30,31,30,31],Bu=(e,t)=>{P.set(e,t)},Lu=(e,t,r,n)=>{var o=B[n+40>>2],i={tm_sec:B[n>>2],tm_min:B[n+4>>2],tm_hour:B[n+8>>2],tm_mday:B[n+12>>2],tm_mon:B[n+16>>2],tm_year:B[n+20>>2],tm_wday:B[n+24>>2],tm_yday:B[n+28>>2],tm_isdst:B[n+32>>2],tm_gmtoff:B[n+36>>2],tm_zone:o?qe(o):""},a=qe(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=yr(r.getFullYear()),o=r.getMonth(),i=(n?Fu:Du)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>f((e.tm_year+1900)/100|0,2),"%d":e=>f(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":e=>m(e),"%H":e=>f(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":e=>f(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(yr(e.tm_year+1900)?Fu:Du,e.tm_mon-1),3),"%m":e=>f(e.tm_mon+1,2),"%M":e=>f(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>f(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return f(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&yr(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&yr(e.tm_year%400-1))&&t++}return f(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return f(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=Ce(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(Bu(y,e),y.length-1)},Ru=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Pe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Mu=365,Iu=146;Object.defineProperties(Ru.prototype,{read:{get:function(){return(this.mode&Mu)===Mu},set:function(e){e?this.mode|=Mu:this.mode&=-366}},write:{get:function(){return(this.mode&Iu)===Iu},set:function(e){e?this.mode|=Iu:this.mode&=-147}},isFolder:{get:function(){return Pe.isDir(this.mode)}},isDevice:{get:function(){return Pe.isChrdev(this.mode)}}}),Pe.FSNode=Ru,Pe.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,c){var d=t?ye.resolve(me.join2(e,t)):e;function f(r){function l(r){c&&c(),s||Pe.createDataFile(e,t,r,n,o,u),i&&i(),J()}(function(e,t,r,n){void 0!==Ar&&Ar.init();var o=!1;return Ae.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,d,l,(()=>{a&&a(),J()}))||l(r)}K(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;l(e,(r=>{N(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&J()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&K()})(r,(e=>f(e)),a):f(r)},Pe.staticInit(),u.FS_createPath=Pe.createPath,u.FS_createDataFile=Pe.createDataFile,u.FS_createPreloadedFile=Pe.createPreloadedFile,u.FS_unlink=Pe.unlink,u.FS_createLazyFile=Pe.createLazyFile,u.FS_createDevice=Pe.createDevice,Oe=u.InternalError=class InternalError extends Error{constructor(e){super(e),this.name="InternalError"}},function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Ve=e}(),Ge=u.BindingError=class BindingError extends Error{constructor(e){super(e),this.name="BindingError"}},bt.prototype.isAliasOf=Qe,bt.prototype.clone=ht,bt.prototype.delete=mt,bt.prototype.isDeleted=gt,bt.prototype.deleteLater=yt,u.getInheritedInstanceCount=nt,u.getLiveInheritedInstances=ot,u.flushPendingDeletes=at,u.setDelayFunction=ut,Bt.prototype.getPointee=qt,Bt.prototype.destructor=Ft,Bt.prototype.argPackAdvance=8,Bt.prototype.readValueFromPointer=Le,Bt.prototype.deleteObject=Dt,Bt.prototype.fromWireType=ft,Ot=u.UnboundTypeError=(Su=Error,(xu=_t(ku="UnboundTypeError",(function(e){this.name=ku,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Su.prototype),xu.prototype.constructor=xu,xu.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},xu),Object.assign(jt.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Gt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Gt.reserved=Gt.allocated.length,u.count_emval_handles=zt,u.requestFullscreen=function(e,t){Ar.requestFullscreen(e,t)},u.requestAnimationFrame=function(e){Ar.requestAnimationFrame(e)},u.setCanvasSize=function(e,t,r){Ar.setCanvasSize(e,t,r)},u.pauseMainLoop=function(){Ar.mainLoop.pause()},u.resumeMainLoop=function(){Ar.mainLoop.resume()},u.getUserMedia=function(){Ar.getUserMedia()},u.createContext=function(e,t,r,n){return Ar.createContext(e,t,r,n)};for(var Ou,Uu={},Nu={},$u=0;$u<32;++$u)so.push(new Array($u));var Hu=new Float32Array(288);for($u=0;$u<288;++$u)hs[$u]=Hu.subarray(0,$u+1);var Vu=new Int32Array(288);for($u=0;$u<288;++$u)ys[$u]=Vu.subarray(0,$u+1);var ju,Gu={Ja:function(e){var t=new pe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),de.push(t),ic(t.excPtr),t.get_exception_ptr()},Ia:function(){ec(0,0);var e=de.pop();oc(e.excPtr),fe=0},o:()=>he([]),ba:e=>he([e]),k:function(e,t,r){throw new pe(e).init(t,r),fe=e},M:function(e){throw fe||(fe=e),fe},ea:function(e,t,r){Fe.varargs=r;try{var n=Fe.getStreamFromFD(e);switch(t){case 0:return(o=Fe.get())<0?-28:Pe.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Fe.get();return n.flags|=o,0;case 5:return o=Fe.get(),F[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,B[Yu()>>2]=i,-1}}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}var i},Ab:function(e,t){try{var r=Fe.getStreamFromFD(e);return Fe.doStat(Pe.stat,r.path,t)}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},Fb:function(e,t,r){Fe.varargs=r;try{var n=Fe.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=Fe.get();B[i>>2]=o.c_iflag||0,B[i+4>>2]=o.c_oflag||0,B[i+8>>2]=o.c_cflag||0,B[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)P[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=Fe.get();var s=B[i>>2],u=B[i+4>>2],c=B[i+8>>2],l=B[i+12>>2],d=[];for(a=0;a<32;a++)d.push(P[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(i=Fe.get(),B[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=Fe.get(),Pe.ioctl(n,t,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=Fe.get(),F[i>>1]=f[0],F[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=Fe.getStr(e),Fe.doStat(Pe.lstat,e,t)}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t,r,n){try{t=Fe.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=Fe.calculateAt(e,t,i),Fe.doStat(o?Pe.lstat:Pe.stat,t,r)}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},qa:function(e,t,r,n){Fe.varargs=n;try{t=Fe.getStr(t),t=Fe.calculateAt(e,t);var o=n?Fe.get():0;return Pe.open(t,r,o).fd}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t){try{return e=Fe.getStr(e),Fe.doStat(Pe.stat,e,t)}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},va:function(e){var t=De[e];delete De[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;Ne([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],u=t.setter,c=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(c,e,s.toWireType(r,t)),Be(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${n}, actual=${o.length}`);for(var s=i(),u=0;u<n;++u)r[u].write(s,o[u]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:a}]}))},y:function(e){var t=$e[e];delete $e[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;Ne([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var i={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+o.length],l=t.setter,d=t.setterContext;i[n]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(d,e,c.toWireType(r,t)),Be(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:n}]}))},za:function(e,t,r,n,o){t=je(t);var i=Xe(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),ze(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${He(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${He(r)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${o}]!`);return r},argPackAdvance:8,readValueFromPointer:Ye(t,i,!a),destructorFunction:null})},ke:function(e,t,r,n,o){var i=Xe(r);ze(e,{name:t=je(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=P;else if(2===r)n=F;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=B}return this.fromWireType(n[e>>i])},destructorFunction:null})},v:function(e,t,r,n,o,i,a,s,u,c,l,d,f){l=je(l),i=It(o,i),s&&(s=It(a,s)),c&&(c=It(u,c)),f=It(d,f);var p=Et(l);St(p,(function(){Nt(`Cannot construct ${l} due to unbound types`,[n])})),Ne([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:bt.prototype;var a=_t(p,(function(){if(Object.getPrototypeOf(this)!==u)throw new Ge("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Ge(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Ge(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new kt(l,a,u,f,r,i,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var h=new Bt(l,d,!0,!1,!1),m=new Bt(l+"*",d,!1,!1,!1),g=new Bt(l+" const*",d,!1,!0,!1);return rt[e]={pointerType:m,constPointerType:g},Lt(p,a),[h,m,g]}))},w:function(e,t,r,n,o,i){var a=$t(t,r);o=It(n,o),Ne([],[e],(function(e){var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Ge(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{Nt(`Cannot construct ${e.name} due to unbound types`,a)},Ne([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Vt(r,n,null,o,i),[]})),[]}))},d:function(e,t,r,n,o,i,a,s,u){var c=$t(r,n);t=je(t),i=It(o,i),Ne([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){Nt(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var l=e.registeredClass.instancePrototype,d=l[t];return void 0===d||void 0===d.overloadTable&&d.className!==e.name&&d.argCount===r-2?(o.argCount=r-2,o.className=e.name,l[t]=o):(Ct(l,t,n),l[t].overloadTable[r-2]=o),Ne([],c,(function(o){var s=Vt(n,o,e,i,a,u);return void 0===l[t].overloadTable?(s.argCount=r-2,l[t]=s):l[t].overloadTable[r-2]=s,[]})),[]}))},je:function(e,t){ze(e,{name:t=je(t),fromWireType:function(e){var t=Yt.toValue(e);return Wt(e),t},toWireType:function(e,t){return Yt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:null})},W:function(e,t,r,n){var o=Xe(r);function i(){}t=je(t),i.values={},ze(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Xt(t,o,n),destructorFunction:null}),St(t,i)},I:function(e,t,r){var n=Qt(e,"enum");t=je(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:_t(`${n.name}_${t}`,(function(){}))}});o.values[r]=i,o[t]=i},ya:function(e,t,r){var n=Xe(r);ze(e,{name:t=je(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Zt(t,n),destructorFunction:null})},L:function(e,t,r,n,o,i,a){var s=$t(t,r);e=je(e),o=It(n,o),St(e,(function(){Nt(`Cannot call ${e} due to unbound types`,s)}),t-1),Ne([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return Lt(e,Vt(e,n,null,o,i,a),t-1),[]}))},R:function(e,t,r,n,o){t=je(t),-1===o&&(o=4294967295);var i=Xe(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");ze(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Ye(t,i,0!==n),destructorFunction:null})},C:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=L,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}ze(e,{name:r=je(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},He:function(e,t,r,n,o,i,a,s,u,c,l,d){r=je(r),i=It(o,i),s=It(a,s),c=It(u,c),d=It(l,d),Ne([e],[t],(function(e){return e=e[0],[new Bt(r,e.registeredClass,!1,!1,!0,e,n,i,s,c,d)]}))},xa:function(e,t){var r="std::string"===(t=je(t));ze(e,{name:t,fromWireType:function(e){var t,n=L[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==q[s]){var u=qe(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(q[o+a]);t=c.join("")}return zu(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||We("Cannot pass non-string to std::string"),n=r&&o?Ee(t):t.length;var i=Wu(4+n+1),a=i+4;if(L[i>>2]=n,r&&o)Kt(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(zu(a),We("String has UTF-16 code units that do not fit in 8 bits")),q[a+s]=u}else for(s=0;s<n;++s)q[a+s]=t[s];return null!==e&&e.push(zu,i),i},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:function(e){zu(e)}})},ga:function(e,t,r){var n,o,i,a,s;r=je(r),2===t?(n=er,o=tr,a=rr,i=()=>D,s=1):4===t&&(n=nr,o=or,a=ir,i=()=>L,s=2),ze(e,{name:r,fromWireType:function(e){for(var r,o=L[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var l=e+4+c*t;if(c==o||0==a[l>>s]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return zu(e),r},toWireType:function(e,n){"string"!=typeof n&&We(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Wu(4+i+t);return L[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(zu,u),u},argPackAdvance:8,readValueFromPointer:Le,destructorFunction:function(e){zu(e)}})},wa:function(e,t,r,n,o,i){De[e]={name:je(t),rawConstructor:It(r,n),rawDestructor:It(o,i),elements:[]}},Q:function(e,t,r,n,o,i,a,s,u){De[e].elements.push({getterReturnType:t,getter:It(r,n),getterContext:o,setterArgumentType:i,setter:It(a,s),setterContext:u})},z:function(e,t,r,n,o,i){$e[e]={name:je(t),rawConstructor:It(r,n),rawDestructor:It(o,i),fields:[]}},n:function(e,t,r,n,o,i,a,s,u,c){$e[e].fields.push({fieldName:je(t),getterReturnType:r,getter:It(n,o),getterContext:i,setterArgumentType:a,setter:It(s,u),setterContext:c})},le:function(e,t){ze(e,{isVoid:!0,name:t=je(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Db:()=>!0,jb:()=>{throw 1/0},j:function(e,t,r){e=Yt.toValue(e),t=Qt(t,"emval::as");var n=[],o=Yt.toHandle(n);return L[r>>2]=o,t.toWireType(n,e)},s:function(e,t,r,n){e=Yt.toValue(e);for(var o=ar(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var u=e.apply(void 0,i);return Yt.toHandle(u)},X:function(e,t,r,n,o){return(e=cr[e])(t=Yt.toValue(t),r=ur(r),function(e){var t=[];return L[e>>2]=Yt.toHandle(t),t}(n),o)},P:function(e,t,r,n){(e=cr[e])(t=Yt.toValue(t),r=ur(r),null,n)},c:Wt,fe:function(e,t){return(e=Yt.toValue(e))==(t=Yt.toValue(t))},E:function(e){return 0===e?Yt.toHandle(lr()):(e=ur(e),Yt.toHandle(lr()[e]))},J:function(e,t){var r=ar(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=dr[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),s.push(r[1+c]);var l="return function "+Et("methodCaller_"+o)+"(handle, name, destructors, args) {\n",d=0;for(c=0;c<e-1;++c)l+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=r[c+1].argPackAdvance;for(l+=" var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(l+=" argType"+c+".deleteObject(arg"+c+");\n");n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",a.push(l);var f,p,h=Ht(Function,a).apply(null,s);return f=h,p=cr.length,cr.push(f),i=p,dr[o]=i,i},h:function(e,t){return e=Yt.toValue(e),t=Yt.toValue(t),Yt.toHandle(e[t])},e:function(e){e>4&&(Gt.get(e).refcount+=1)},aa:function(e,t){return(e=Yt.toValue(e))instanceof(t=Yt.toValue(t))},fa:function(e){return"number"==typeof(e=Yt.toValue(e))},N:function(e){return"string"==typeof(e=Yt.toValue(e))},Ae:function(e,t,r,n){e=Yt.toValue(e);var o=fr[t];return o||(o=function(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Qt,u,Yt.toHandle,(()=>L))}(t),fr[t]=o),o(e,r,n)},H:function(){return Yt.toHandle([])},g:function(e){return Yt.toHandle(ur(e))},B:function(){return Yt.toHandle({})},i:function(e){Be(Yt.toValue(e)),Wt(e)},m:function(e,t,r){e=Yt.toValue(e),t=Yt.toValue(t),r=Yt.toValue(r),e[t]=r},f:function(e,t){var r=(e=Qt(e,"_emval_take_value")).readValueFromPointer(t);return Yt.toHandle(r)},ue:function(e){throw e=Yt.toValue(e)},Qc:function(e){return e=Yt.toValue(e),Yt.toHandle(typeof e)},qb:function(e,t){e=mr(e),t=mr(t);var r=new Date(1e3*e);B[t>>2]=r.getUTCSeconds(),B[t+4>>2]=r.getUTCMinutes(),B[t+8>>2]=r.getUTCHours(),B[t+12>>2]=r.getUTCDate(),B[t+16>>2]=r.getUTCMonth(),B[t+20>>2]=r.getUTCFullYear()-1900,B[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;B[t+28>>2]=o},sb:function(e,t){e=mr(e),t=mr(t);var r=new Date(1e3*e);B[t>>2]=r.getSeconds(),B[t+4>>2]=r.getMinutes(),B[t+8>>2]=r.getHours(),B[t+12>>2]=r.getDate(),B[t+16>>2]=r.getMonth(),B[t+20>>2]=r.getFullYear()-1900,B[t+24>>2]=r.getDay();var n=0|wr(r);B[t+28>>2]=n,B[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));B[t+32>>2]=s},tb:function(e){e=mr(e);var t=(()=>{var t=new Date(B[e+20>>2]+1900,B[e+16>>2],B[e+12>>2],B[e+8>>2],B[e+4>>2],B[e>>2],0),r=B[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)B[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var u=Math.max(a,i),c=r>0?s:u;t.setTime(t.getTime()+6e4*(c-n))}B[e+24>>2]=t.getDay();var l=0|wr(t);return B[e+28>>2]=l,B[e>>2]=t.getSeconds(),B[e+4>>2]=t.getMinutes(),B[e+8>>2]=t.getHours(),B[e+12>>2]=t.getDate(),B[e+16>>2]=t.getMonth(),B[e+20>>2]=t.getYear(),t.getTime()/1e3})();return BigInt(t)},ob:function(e,t,r,n,o,i,a){e=mr(e),o=mr(o),i=mr(i),a=mr(a);try{if(isNaN(o))return 61;var s=Fe.getStreamFromFD(n),u=Pe.mmap(s,e,o,t,r),c=u.ptr;return B[i>>2]=u.allocated,L[a>>2]=c,0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},pb:function(e,t,r,n,o,i){e=mr(e),t=mr(t),i=mr(i);try{if(isNaN(i))return 61;var a=Fe.getStreamFromFD(o);2&r&&Fe.doMsync(e,a,t,n,i),Pe.munmap(a)}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}},kb:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}L[e>>2]=60*u,B[t>>2]=Number(a!=s);var l=c(o),d=c(i),f=Er(l),p=Er(d);s<a?(L[r>>2]=f,L[r+4>>2]=p):(L[r>>2]=p,L[r+4>>2]=f)},b:()=>{ee("")},oa:function(e,t,r,n,o){return Tr.chooseConfig(e,t,r,n,o)},pa:function(e,t,r,n){if(62e3!=e)return Tr.setErrorCode(12296),0;for(var o=1;;){var i=B[n>>2];if(12440!=i){if(12344==i)break;return Tr.setErrorCode(12292),0}o=B[n+4>>2],n+=8}return o<2||o>3?(Tr.setErrorCode(12293),0):(Tr.contextAttributes.majorVersion=o-1,Tr.contextAttributes.minorVersion=0,Tr.context=Rr.createContext(u.canvas,Tr.contextAttributes),0!=Tr.context?(Tr.setErrorCode(12288),Rr.makeContextCurrent(Tr.context),u.useWebGL=!0,Ar.moduleContextCreatedCallbacks.forEach((function(e){e()})),Rr.makeContextCurrent(null),62004):(Tr.setErrorCode(12297),0))},bb:function(e,t,r,n){return 62e3!=e?(Tr.setErrorCode(12296),0):62002!=t?(Tr.setErrorCode(12293),0):(Tr.setErrorCode(12288),62006)},lc:function(e,t){return 62e3!=e?(Tr.setErrorCode(12296),0):62004!=t?(Tr.setErrorCode(12294),0):(Rr.deleteContext(Tr.context),Tr.setErrorCode(12288),Tr.currentContext==t&&(Tr.currentContext=0),1)},ac:function(e,t){return 62e3!=e?(Tr.setErrorCode(12296),0):62006!=t?(Tr.setErrorCode(12301),1):(Tr.currentReadSurface==t&&(Tr.currentReadSurface=0),Tr.currentDrawSurface==t&&(Tr.currentDrawSurface=0),Tr.setErrorCode(12288),1)},T:function(e,t,r,n){if(62e3!=e)return Tr.setErrorCode(12296),0;if(62002!=t)return Tr.setErrorCode(12293),0;if(!n)return Tr.setErrorCode(12300),0;switch(Tr.setErrorCode(12288),r){case 12320:return B[n>>2]=Tr.contextAttributes.alpha?32:24,1;case 12321:return B[n>>2]=Tr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return B[n>>2]=8,1;case 12325:return B[n>>2]=Tr.contextAttributes.depth?24:0,1;case 12326:return B[n>>2]=Tr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return B[n>>2]=12344,1;case 12328:return B[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return B[n>>2]=0,1;case 12330:case 12332:return B[n>>2]=4096,1;case 12331:return B[n>>2]=16777216,1;case 12337:return B[n>>2]=Tr.contextAttributes.antialias?4:0,1;case 12338:return B[n>>2]=Tr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return B[n>>2]=4,1;case 12341:case 12342:case 12343:return B[n>>2]=-1,1;case 12348:return B[n>>2]=1,1;case 12351:return B[n>>2]=12430,1;default:return Tr.setErrorCode(12292),0}},rb:function(e){return Tr.setErrorCode(12288),62e3},ta:function(){return Tr.errorCode},gb:function(e,t,r){return 62e3!=e?(Tr.setErrorCode(12296),0):(t&&(B[t>>2]=1),r&&(B[r>>2]=4),Tr.defaultDisplayInitialized=!0,Tr.setErrorCode(12288),1)},Bb:function(e,t,r,n){return 62e3!=e?(Tr.setErrorCode(12296),0):0!=n&&62004!=n?(Tr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(Tr.setErrorCode(12301),0):(Rr.makeContextCurrent(n?Tr.context:null),Tr.currentContext=n,Tr.currentDrawSurface=t,Tr.currentReadSurface=r,Tr.setErrorCode(12288),1)},ua:function(e,t){if(Tr.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return Tr.setErrorCode(12288),1;Tr.setErrorCode(12302)}else Tr.setErrorCode(12290);else Tr.setErrorCode(12289);return 0},Rb:function(e){return 62e3!=e?(Tr.setErrorCode(12296),0):(Tr.currentContext=0,Tr.currentReadSurface=0,Tr.currentDrawSurface=0,Tr.defaultDisplayInitialized=!1,Tr.setErrorCode(12288),1)},K:(e,t,r)=>Ir(e,t,r),xe:e=>{console.error(qe(e))},ye:e=>{console.log(qe(e))},ia:e=>{console.warn(qe(e))},ca:function(){return Date.now()},ne:function(){},lb:()=>2147483648,Cb:gr,Xf:Or,Yf:Ur,Zc:Nr,ee:$r,Lc:Hr,Zf:Vr,_f:jr,Ic:Gr,Jc:Wr,Ze:zr,_e:Yr,Je:Xr,$f:Qr,Xb:Zr,tf:Jr,wf:en,ag:tn,bg:rn,Td:nn,cg:on,Sd:an,Te:sn,dg:un,eg:cn,$e:ln,fg:dn,mc:fn,nc:pn,pc:hn,oc:mn,gg:gn,Rd:yn,hg:bn,Fa:vn,ig:wn,jg:En,kg:_n,cd:Cn,lg:Sn,bd:kn,Re:xn,Qd:An,mg:Tn,dd:Pn,ng:qn,og:Fn,pg:Dn,qg:Bn,af:Ln,rg:Rn,$c:Mn,he:In,bf:On,Ke:Un,sg:Nn,Se:$n,tg:Hn,Wb:Vn,uf:Gn,xf:Wn,Pd:zn,ug:Yn,Od:Xn,Nd:Qn,vg:Zn,wg:Kn,xg:Jn,rf:to,Wd:ro,Ib:no,pf:oo,id:io,Jb:ao,nf:co,gd:lo,Xd:fo,yg:ho,sf:go,Vd:yo,Gb:bo,qf:vo,Hb:wo,hd:Eo,gf:_o,zg:Co,Ag:So,Yc:ko,de:xo,Kc:Ao,Pe:To,Bg:Po,Cg:qo,cf:Fo,df:Do,Oc:Bo,Dg:Lo,Eg:Mo,ef:Io,ad:Oo,ie:Uo,ff:No,Le:$o,Fg:Ho,Vb:Vo,vf:Go,yf:Wo,Ve:zo,Md:Xo,Ld:Qo,gc:Zo,hc:Ko,jc:Jo,Kd:ei,Jd:ti,Id:oi,bc:ii,Gg:ai,Hg:si,Ig:ui,yc:ci,We:li,cc:fi,ec:pi,Mc:hi,hh:mi,Mb:gi,Qb:yi,Jg:bi,Kg:vi,_d:Ei,ae:Ci,Zd:Si,Wc:ki,$d:xi,Xc:Ai,be:Ti,Xe:Pi,Yb:qi,Zb:Fi,Lg:Di,Fe:Bi,Hd:Li,Mg:Ri,Ea:Mi,ih:Ii,dc:Oi,Gd:Ui,Fd:Ni,Gc:$i,ic:Hi,kc:Vi,Ng:Wi,Ed:Xi,Dd:Qi,zc:Zi,Fc:ea,Ec:ta,Ad:ra,Cd:na,Bd:oa,zd:ia,Ge:aa,Ie:sa,yd:ua,xd:ca,wd:la,vd:da,_c:fa,ge:pa,ud:ha,$b:ma,td:ga,Qe:ya,Og:ba,Ub:va,Nc:Ea,Yd:_a,Pg:Ca,Qg:Sa,lf:ka,mf:xa,Tb:Aa,Rg:Ta,sd:Pa,Pb:qa,Ob:Fa,ce:Da,of:Ba,Sg:Ia,rd:Oa,Ye:Ua,Ue:Na,Sb:$a,qd:Ha,Me:Va,_b:ja,Ne:Ga,Oe:Wa,Tg:za,pd:Ya,Ug:Xa,Vg:Qa,Wg:Za,Xg:Ka,Yg:Ja,Zg:es,_g:ts,$g:rs,fd:ns,ah:os,bh:is,ch:as,dh:ss,hf:us,Nb:cs,eh:ls,ed:ds,Hc:fs,fh:ps,gh:ms,Tf:gs,Uf:bs,xc:vs,tc:ws,Vf:Es,Wf:_s,Sf:Cs,Rf:Ss,wc:ks,sc:xs,Qf:As,Pf:Ts,Of:Ps,Nf:qs,vc:Fs,rc:Ds,Mf:Bs,Lf:Ls,zf:Rs,Af:Ms,uc:Is,qc:Os,fc:Us,Bf:Ns,Vc:$s,Tc:Hs,Cf:Vs,Uc:js,Rc:Gs,Df:Ws,Sc:zs,Pc:Ys,Ef:Xs,od:Qs,Ff:Zs,nd:Ks,md:Js,Gf:eu,ld:tu,Hf:ru,kd:nu,If:ou,jf:au,Ud:su,Kb:uu,jd:cu,Lb:lu,Dc:du,Bc:fu,Cc:pu,Ac:hu,kf:mu,Jf:gu,Kf:yu,Ga:bu,Eb:(e,t,r)=>q.copyWithin(e,t,t+r),mb:e=>{var t=q.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o,i=1;i<=4;i*=2){var a=t*(1+.2/i);a=Math.min(a,e+100663296);var s=Math.min(r,(n=Math.max(e,a))+((o=65536)-n%o)%o);if(vu(s))return!0}return!1},Xa:function(e,t,r,n,o,i,a,s,c){const l=u.UTF8ToString(e,e+t),d=u.HEAPU8.subarray(o,o+i),f=u.emscripten_ubq_codec_audioDecoderNextHandle++,p={codec:l,sampleRate:r,numberOfChannels:n,description:d};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,s,c);AudioDecoder.isConfigSupported(p).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(p),u.emscripten_ubq_codec_audioDecoders.set(f,{audioDecoder:e,decoderConfig:p,leftBufferPtr:a,rightBufferPtr:s,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:f})},Oa:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_audioEncoderNextHandle++,c={codec:a,sampleRate:r,numberOfChannels:n,bitrate:o};try{const e=new AudioEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedAudioChunk(s,t,e.byteLength,i),u._free(t)},error:e=>console.error(e)});e.configure(c),u.emscripten_ubq_codec_audioEncoders.set(s,{audioEncoder:e,audioEncoderConfig:c,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; sample rate: "+r,e+="; channels: "+n,e+="; bit rate: "+o,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},ab:function(e,t,r,n,o,i,a){const s=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(o,o+i),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:s,codedWidth:r,codedHeight:n,description:c,optimizeForLatency:!0};try{const e=u.emscripten_ubq_codec_createVideoDecoder(l,a);VideoDecoder.isConfigSupported(d).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(d),u.emscripten_ubq_codec_videoDecoders.set(l,{videoDecoder:e,decoderConfig:d,codecServicePtr:a})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:l})},Sa:function(e,t,r,n,o,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_videoEncoderNextHandle++,c=u.specialHTMLTargets["!canvas"];c.width=r,c.height=n;const l={codec:a,width:r,height:n,avc:{format:"annexb"},framerate:o};try{const e=new VideoEncoder({output:e=>{const t=u._malloc(e.byteLength),r=u.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),u.emscripten_ubq_codec_onOutputEncodedVideoChunk(s,t,e.byteLength,i),u._free(t)},error:e=>console.error(e)});VideoEncoder.isConfigSupported(l).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(l),u.emscripten_ubq_codec_videoEncoders.set(s,{videoEncoder:e,encoderConfig:l,groupOfPictures:150,frameIndex:0})}catch(e){return e+=' Requested codec: "'+a+'"',e+="; resolution: "+r+"x"+n,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},Ta:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_audioDecoders.get(e);if(a.audioDecoder.unexpectedError)return u.emscripten_ubq_codec_createNativeResult({code:2,error:a.audioDecoder.unexpectedError});"closed"===a.audioDecoder.state&&(a.audioDecoder=u.emscripten_ubq_codec_createAudioDecoder(a.leftBufferPtr,a.rightBufferPtr,a.bufferLength),a.audioDecoder.configure(a.decoderConfig));const s=a.audioDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Ka:function(e,t,r,n,o,i){const a=u.emscripten_ubq_codec_videoDecoders.get(e);if(a.videoDecoder.unexpectedError)return u.emscripten_ubq_codec_createNativeResult({code:2,error:a.videoDecoder.unexpectedError});if("closed"===a.videoDecoder.state){const t=a.videoDecoder.textures;return a.videoDecoder=u.emscripten_ubq_codec_createVideoDecoder(e,a.codecServicePtr),a.videoDecoder.textures=t,a.videoDecoder.configure(a.decoderConfig),u.emscripten_ubq_codec_createNativeResult({code:1,error:"VideoDecoder was closed"})}const s=a.videoDecoder,c=u.HEAPU8.subarray(o,o+i),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{s.decode(l)}catch(e){return s.configUnsupported?u.emscripten_ubq_codec_createNativeResult({code:2,error:e}):u.emscripten_ubq_codec_createNativeResult({code:1,error:e})}return u.emscripten_ubq_codec_createNativeResult({code:0})},Wa:function(e){if(u.emscripten_ubq_codec_audioDecoders.has(e)){const t=u.emscripten_ubq_codec_audioDecoders.get(e);"closed"!==t.audioDecoder.state&&t.audioDecoder.close(),u.emscripten_ubq_codec_audioDecoders.delete(e)}},Na:function(e){const t=u.emscripten_ubq_codec_audioEncoders.get(e);"closed"!==t.audioEncoder.state&&t.audioEncoder.close(),u.emscripten_ubq_codec_audioEncoders.delete(e)},_a:function(e){if(u.emscripten_ubq_codec_videoDecoders.has(e)){const t=u.emscripten_ubq_codec_videoDecoders.get(e);"closed"!==t.videoDecoder.state&&t.videoDecoder.close(),u.emscripten_ubq_codec_videoDecoders.delete(e)}},Ra:function(e){const t=u.emscripten_ubq_codec_videoEncoders.get(e);"closed"!==t.videoEncoder.state&&t.videoEncoder.close(),u.emscripten_ubq_codec_videoEncoders.delete(e)},Ma:function(e,t,r){const n=1e6,o=u.emscripten_ubq_codec_audioEncoders.get(e),i=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,s=r/a,c=Math.round(n*(o.frameIndex*s/i)),l=Math.round(n*(s/i)),d=u.HEAPF32.subarray(t/4,t/4+r),f=new AudioData({format:"f32",sampleRate:i,numberOfFrames:s,numberOfChannels:a,duration:l,timestamp:c,data:d});o.audioEncoder.encode(f),o.frameIndex++,f.close()},Qa:function(e,t,r){const n=1e6,o=u.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,s=Math.round(n/o.encoderConfig.framerate),c=u.specialHTMLTargets["!canvas"],l=new VideoFrame(c,{timestamp:i,duration:s});o.videoEncoder.encode(l,{keyFrame:a}),l.close(),o.frameIndex++},La:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Pa:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Va:async function(e,t){const r=u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder;r.flushing=!0;try{await r.flush()}catch{}r.flushing=!1,r.writtenFrames=t},Z:async function(e,t,r){const n=u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;n.shouldDropFrames=r,n.flushing=!0;try{await n.flush()}catch{}n.flushing=!1,n.shouldDropFrames=!1,n.decodedFrames=t},la:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ma:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},Y:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ua:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Za:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},_:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},Ya:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},$a:function(e,t,r){const n=u.emscripten_ubq_codec_videoDecoders.get(e),o=u.HEAPU32.subarray(t/4,t/4+r);n.videoDecoder.textures=[];for(let e=0;e<r;e++)n.videoDecoder.textures[e]=Rr.textures[o[e]]},re:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},Ba:function(){u.emscripten_ubq_asyncFetchManager.clear()},ha:function(e,t,r,n){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ve:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},we:function(e,t,r,n,o,i,a,s,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,i,a,s,c).handle},oe:function(e){return u.emscripten_ubq_asyncFetchManager.deleteProcess(e)},te:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.receivedLength)&&void 0!==r?r:0},qe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},pe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},Aa:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.state)&&void 0!==r?r:-1},se:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},db:function(){return!!u.emscripten_ubq_settings_forceWebGL1},na:Au,$:function(e){Rr.currentContext==e&&(Rr.currentContext=0),Rr.deleteContext(e)},eb:function(e,t){var r=Rr.getContext(e),n=qe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&Pr(Ou),"OES_vertex_array_object"==n&&qr(Ou),"WEBGL_draw_buffers"==n&&Fr(Ou),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&Dr(Ou),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&Br(Ou),"WEBGL_multi_draw"==n&&Lr(Ou),!!r.GLctx.getExtension(n)},cb:function(e){for(var t=e>>2,r=0;r<14;++r)B[t+r]=0;B[t+0]=B[t+1]=B[t+3]=B[t+4]=B[t+8]=B[t+10]=1},fb:function(e){return Rr.makeContextCurrent(e)?0:-5},vb:(e,t)=>{var r=0;return Pu().forEach((function(n,o){var i=t+r;L[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)P[t++>>0]=e.charCodeAt(r);P[t>>0]=0})(n,i),r+=n.length+1})),0},wb:(e,t)=>{var r=Pu();L[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),L[t>>2]=n,0},ze:Sr,da:function(e){try{var t=Fe.getStreamFromFD(e);return Pe.close(t),0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}},nb:function(e,t,r,n,o){t=mr(t),r=mr(r),n=mr(n),o=mr(o);try{if(isNaN(n))return 61;var i=Fe.getStreamFromFD(e),a=qu(i,t,r,n);return L[o>>2]=a,0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}},sa:function(e,t,r,n){try{var o=Fe.getStreamFromFD(e),i=qu(o,t,r);return L[n>>2]=i,0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}},ub:function(e,t,r,n){t=mr(t),n=mr(n);try{if(isNaN(t))return 61;var o=Fe.getStreamFromFD(e);return Pe.llseek(o,t,r),M[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}},ra:function(e,t,r,n){try{var o=((e,t,r,n)=>{for(var o=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Pe.write(e,P,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Fe.getStreamFromFD(e),t,r);return L[n>>2]=o,0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}},me:function(){return"undefined"!=typeof window?Er(window.location.hostname):Er("")},hb:(e,t)=>(ge(q.subarray(e,e+t)),0),x:function(e,t,r){var n=tc();try{return Mt(e)(t,r)}catch(e){if(rc(n),e!==e+0)throw e;ec(1,0)}},O:function(e,t){var r=tc();try{return Mt(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},G:function(e,t,r){var n=tc();try{return Mt(e)(t,r)}catch(e){if(rc(n),e!==e+0)throw e;ec(1,0)}},l:function(e,t,r,n){var o=tc();try{return Mt(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},Ha:function(e){var t=tc();try{return Mt(e)()}catch(e){if(rc(t),e!==e+0)throw e;ec(1,0)}},ja:function(e,t,r){var n=tc();try{return Mt(e)(t,r)}catch(e){if(rc(n),e!==e+0)throw e;ec(1,0)}},r:function(e,t){var r=tc();try{return Mt(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},V:function(e,t,r,n,o,i,a,s,u,c,l,d,f,p,h,m){var g=tc();try{return Mt(e)(t,r,n,o,i,a,s,u,c,l,d,f,p,h,m)}catch(e){if(rc(g),e!==e+0)throw e;ec(1,0)}},q:function(e,t,r){var n=tc();try{return Mt(e)(t,r)}catch(e){if(rc(n),e!==e+0)throw e;ec(1,0)}},t:function(e,t,r,n){var o=tc();try{return Mt(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},U:function(e,t,r,n,o){var i=tc();try{return Mt(e)(t,r,n,o)}catch(e){if(rc(i),e!==e+0)throw e;ec(1,0)}},Ee:function(e,t,r,n,o,i){var a=tc();try{return Mt(e)(t,r,n,o,i)}catch(e){if(rc(a),e!==e+0)throw e;ec(1,0)}},Da:function(e,t,r,n,o,i,a){var s=tc();try{return Mt(e)(t,r,n,o,i,a)}catch(e){if(rc(s),e!==e+0)throw e;ec(1,0)}},Ca:function(e,t,r,n,o,i,a,s,u,c){var l=tc();try{return Mt(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(rc(l),e!==e+0)throw e;ec(1,0)}},S:function(e){var t=tc();try{Mt(e)()}catch(e){if(rc(t),e!==e+0)throw e;ec(1,0)}},u:function(e,t){var r=tc();try{Mt(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},A:function(e,t,r,n){var o=tc();try{Mt(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},F:function(e,t,r){var n=tc();try{Mt(e)(t,r)}catch(e){if(rc(n),e!==e+0)throw e;ec(1,0)}},p:function(e,t,r,n){var o=tc();try{Mt(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},D:function(e,t,r,n,o){var i=tc();try{Mt(e)(t,r,n,o)}catch(e){if(rc(i),e!==e+0)throw e;ec(1,0)}},De:function(e,t,r,n,o,i){var a=tc();try{Mt(e)(t,r,n,o,i)}catch(e){if(rc(a),e!==e+0)throw e;ec(1,0)}},Be:function(e,t,r,n,o,i,a){var s=tc();try{Mt(e)(t,r,n,o,i,a)}catch(e){if(rc(s),e!==e+0)throw e;ec(1,0)}},jh:function(e,t,r,n,o,i,a,s){var u=tc();try{Mt(e)(t,r,n,o,i,a,s)}catch(e){if(rc(u),e!==e+0)throw e;ec(1,0)}},Ce:function(e,t,r,n,o,i,a,s,u,c){var l=tc();try{Mt(e)(t,r,n,o,i,a,s,u,c)}catch(e){if(rc(l),e!==e+0)throw e;ec(1,0)}},ka:function(e,t){const r=Yt.toValue(t),n=u.ctx;n.bindTexture(n.TEXTURE_2D,Rr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:k,ib:(e,t,r,n,o)=>Lu(e,t,r,n)},Wu=(function(){var e,t,r,o,i={a:Gu};function a(e,t){var r,n=e.exports;return H=(x=n).mh,r=x.kh,G.unshift(r),J(),n}if(K(),u.instantiateWasm)try{return u.instantiateWasm(i,a)}catch(e){S("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=_,t=te,r=i,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||b||"function"!=typeof fetch?se(t,r,o):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return S("wasm streaming compile failed: "+e),S("falling back to ArrayBuffer instantiation"),se(t,r,o)}))))).catch(n)}(),u._malloc=e=>(Wu=u._malloc=x.lh)(e)),zu=u._free=e=>(zu=u._free=x.nh)(e),Yu=()=>(Yu=x.oh)(),Xu=(u._ma_malloc_emscripten=(e,t)=>(u._ma_malloc_emscripten=x.ph)(e,t),u._ma_free_emscripten=(e,t)=>(u._ma_free_emscripten=x.qh)(e,t),u._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Xu=u._ma_device_process_pcm_frames_capture__webaudio=x.rh)(e,t,r)),Qu=u._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Qu=u._ma_device_process_pcm_frames_playback__webaudio=x.sh)(e,t,r),Zu=e=>(Zu=x.th)(e),Ku=e=>(Ku=x.uh)(e),Ju=(u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=x.vh)(),(e,t)=>(Ju=x.wh)(e,t)),ec=(e,t)=>(ec=x.xh)(e,t),tc=()=>(tc=x.yh)(),rc=e=>(rc=x.zh)(e),nc=e=>(nc=x.Ah)(e),oc=e=>(oc=x.Bh)(e),ic=e=>(ic=x.Ch)(e),ac=(e,t,r)=>(ac=x.Dh)(e,t,r),sc=e=>(sc=x.Eh)(e);function uc(){function e(){ju||(ju=!0,u.calledRun=!0,U||(u.noFSInit||Pe.init.initialized||Pe.init(),Pe.ignorePermissions=!1,Se.init(),le(G),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),z.unshift(e);var e;le(z)}()))}X>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),j.unshift(e);var e;le(j)}(),X>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),e()}),1)):e()))}if(u.___start_em_js=2383083,u.___stop_em_js=2383447,u.addRunDependency=K,u.removeRunDependency=J,u.FS_createPath=Pe.createPath,u.FS_createDataFile=Pe.createDataFile,u.FS_createLazyFile=Pe.createLazyFile,u.FS_createDevice=Pe.createDevice,u.FS_unlink=Pe.unlink,u.ccall=function(e,t,r,n,o){var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=Ee(e)+1,r=nc(t);return Kt(e,r,t),r})(e)),t},array:e=>{var t=nc(e.length);return Bu(e,t),t}},a=function(e){return u["_"+e]}(e),s=[],c=0;if(n)for(var l=0;l<n.length;l++){var d=i[r[l]];d?(0===c&&(c=tc()),s[l]=d(n[l])):s[l]=n[l]}var f,p=a.apply(null,s);return f=p,0!==c&&rc(c),p=function(e){return"string"===t?qe(e):"boolean"===t?Boolean(e):e}(f),p},u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return P[e>>0];case"i16":return F[e>>1];case"i32":return B[e>>2];case"i64":return M[e>>3];case"float":return R[e>>2];case"double":return O[e>>3];case"*":return L[e>>2];default:ee(`invalid type for getValue: ${t}`)}},u.UTF8ToString=qe,u.specialHTMLTargets=_u,u.FS_createPreloadedFile=Pe.createPreloadedFile,Z=function e(){ju||uc(),ju||(Z=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return uc(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=n:"function"==typeof define&&define.amd&&define([],(()=>n))}});var b=Symbol("NO_VALUE");var v,w=(e=>(e.Png="image/png",e.Jpeg="image/jpeg",e.WebP="image/webp",e.Tga="image/x-tga",e.Mp4="video/mp4",e.QuickTime="video/quicktime",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip",e))(w||{}),E=w,_=Symbol("PROXY");Symbol("RESTORE");function C(e,t){Object.defineProperty(e[t],_,{value:{type:"getter"},writable:!1})}function S(e,t){Object.defineProperty(e[t],_,{value:{type:"setter"},writable:!1})}(e=>{let t;var r;(r=t=e.ColorSpace||(e.ColorSpace={}))[r.sRGB=0]="sRGB",r[r.CMYK=1]="CMYK",r[r.SpotColor=2]="SpotColor",e.toColor=function(e){switch(e.colorSpace){case 0:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case 2:return{name:e.spotColorName,tint:e.tint,externalReference:e.externalReference};case 1:return{c:e.components.x,m:e.components.y,y:e.components.z,k:e.components.w,tint:e.tint};default:throw new Error("Unknown color space!")}},e.fromColor=function(e){if(function(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}(e))return{colorSpace:0,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(function(e){return"c"in e&&"m"in e&&"y"in e&&"k"in e&&void 0!==e.c&&void 0!==e.m&&void 0!==e.y&&void 0!==e.k}(e))return{colorSpace:1,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(function(e){return"name"in e&&void 0!==e.name}(e))return{colorSpace:2,components:{x:0,y:0,z:0,w:0},spotColorName:e.name,tint:e.tint,externalReference:e.externalReference};throw new Error("Unknown color space!")}})(v||(v={}));var k=class{ubq;constructor(e){this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}setValue(e,t,r,n){return this.useInternalAPI((o=>x(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>x(n.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,n)=>{this.useInternalAPI((o=>o.ubqExecute(e,t,(e=>{try{const t=x(e);r(t)}catch(e){n(e)}})))).delete()}))}};function x(e){if(e.isValid()){const t=e.value();return e.delete(),t}{const t=e.error(),r=t.publicMessage();throw t.delete(),e.delete(),new Error(r)}}function A(e){return new Promise(((t,r)=>{e((e=>{try{const r=x(e);t(r)}catch(e){r(e)}}))}))}s([S],k.prototype,"setValue",1),s([C],k.prototype,"getValue",1);var T,P,q,F,D,B,L,R=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r},M=new WeakMap,I={assets:[],total:0,currentPage:0,nextPage:void 0},AssetAPI=class{constructor(e){var t,r,n,o;d(this,P),d(this,F),d(this,B),d(this,T,void 0),u(this,"onAssetSourceAdded",(e=>{const t=l(this,T).subscribeToAssetSourceAdded(e);return()=>{l(this,T).isDeleted()||x(l(this,T).unsubscribe(t))}})),u(this,"onAssetSourceRemoved",(e=>{const t=l(this,T).subscribeToAssetSourceRemoved(e);return()=>{l(this,T).isDeleted()||x(l(this,T).unsubscribe(t))}})),n=e,c(t=this,r=T,"write to private field"),o?o.call(t,n):r.set(t,n)}addSource(e){const t=e.getSupportedMimeTypes?.bind(e),r=e.getGroups?.bind(e),n=e.applyAsset?.bind(e),o=e.applyAssetToBlock?.bind(e),i=e.addAsset?.bind(e),a=e.removeAsset?.bind(e),s=e.credits,u=e.license;x(l(this,T).addAssetSource(e.id,(async(t,r)=>{try{const n={...t,tags:R(t.tags),groups:R(t.groups),excludeGroups:R(t.excludeGroups)},o=await e.findAssets(n);if(o){const t={...o,assets:o.assets.map((t=>O(t,e.id)))};r.invoke(t)}else r.invoke(I)}catch(e){r.invoke(e.message??"Unknown error in user-defined `findAssets`")}}),r?async e=>{try{const t=await r();e.invoke(t)}catch(t){e.invoke(t.message??"Unknown error in user-defined `getGroups`")}}:null,s?()=>({name:s.name,url:s.url??""}):null,u?()=>({name:u.name,url:u.url??""}):null,t?()=>t()??[]:null,n?async(e,t)=>{try{const r=await n(f(this,P,q).call(this,e));t.invoke(r)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,o?async(e,t,r)=>{try{await o(f(this,P,q).call(this,e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null,i?async e=>{i(e)}:null,a?async e=>{a(e)}:null)),f(this,F,D).call(this,e.id,e)}addLocalSource(e,t,r,n){x(l(this,T).addLocalAssetSource(e,t??[],r?async(e,t)=>{try{const n=await r(f(this,P,q).call(this,e));t.invoke(n)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{try{await n(f(this,P,q).call(this,e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){x(l(this,T).removeAssetSource(e)),f(this,B,L).call(this,e)}findAllSources(){return R(l(this,T).findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{let o=t?.tags??[];Array.isArray(o)||(o=[o]);const i={perPage:t?.perPage??0,page:t?.page??0,query:t?.query??"",tags:o,groups:t?.groups??[],excludeGroups:t?.excludeGroups??[],locale:t?.locale??""};l(this,T).findAssetSourceAssets(e,i,(e=>{try{const t=x(e);r({...t,nextPage:-1===t.nextPage?void 0:t.nextPage})}catch(e){n(e)}}))}))}async getGroups(e){return A((t=>l(this,T).getAssetSourceGroups(e,t))).then((e=>R(e)))}getSupportedMimeTypes(e){return R(x(l(this,T).getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=x(l(this,T).getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=x(l(this,T).getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){return!!M.get(l(this,T))?.get(e)?.canManageAssets}addAssetToSource(e,t){x(l(this,T).addAssetToSource(e,t))}removeAssetFromSource(e,t){x(l(this,T).removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,n)=>{l(this,T).applyAssetSourceAsset(e,O(t,e),(e=>{try{const t=x(e);l(this,T).isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return A((n=>l(this,T).applyAssetSourceAssetToBlock(e,O(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{l(this,T).defaultApplyAsset(O(e,""),(e=>{try{const r=x(e);l(this,T).isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return A((r=>l(this,T).defaultApplyAssetToBlock(O(e,""),t,r)))}dispose(){M.delete(l(this,T))}};function O(e,t){return"context"in e&&e.context.sourceId===t?e:{...e,context:{sourceId:t}}}T=new WeakMap,P=new WeakSet,q=function(e){const t={...e};return 0===t.groups?.length&&delete t.groups,t.locale||delete t.locale,t.label||delete t.label,0===t.tags?.length&&delete t.tags,t.credits?.name||t.credits?.url?t.credits.url||delete t.credits.url:delete t.credits,t.license?.name||t.license?.url?t.license.url||delete t.license.url:delete t.license,t.utm?.source||t.utm?.medium?(t.utm.source||delete t.utm.source,t.utm.medium||delete t.utm.medium):delete t.utm,t},F=new WeakSet,D=function(e,t){M.has(l(this,T))||M.set(l(this,T),new Map),t.canManageAssets&&console.warn(`\nDEPRECATION WARNING:\n\n'canManageAssets' flag was found for asset source with the id '${e}'.\n\nThis flag is deprecated and will be removed in the next version. If you have used it to control if an upload buttons is rendered in the asset library, use the 'canAdd' options on an asset library entry. See documentation here: https://img.ly/docs/cesdk/ui/guides/customize-asset-library/`),M.get(l(this,T)).set(e,{canManageAssets:t.canManageAssets})},B=new WeakSet,L=function(e){M.get(l(this,T))?.delete(e)};var U=class extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}};function N(e){return"object"==typeof e&&null!=e}function $(e){return"string"==typeof e?JSON.stringify(e):""+e}function H(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+$(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*V(e,t,r,n){var o;N(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=H(o,t,r,n);e&&(yield e)}}function*j(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&N(t.schema)&&N(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,c,l]of t.entries(e,s)){const t=j(c,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,c],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):N(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}var G=class{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>V(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>V(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=W(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=W(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){const r=W(e,t);return!r[0]}(e,this)}mask(e){return function(e,t){const r=W(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return W(e,this,t)}};function W(e,t,r={}){const n=j(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(o[0]){return[new U(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function z(e,t){return new G({type:e,schema:null,validator:t})}function Y(e){return new G({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+$(e)})}function X(){return z("boolean",(e=>"boolean"==typeof e))}function Q(){return z("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+$(e)))}function Z(){return z("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+$(e)))}function K(e){const t=e?Object.keys(e):[],r=z("never",(()=>!1));return new G({type:"object",schema:e||null,*entries(n){if(e&&N(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>N(e)||"Expected an object, but received: "+$(e),coercer:e=>N(e)?{...e}:e})}function J(){return z("string",(e=>"string"==typeof e||"Expected a string, but received: "+$(e)))}function ee(e,t,r={}){const{exclusive:n}=r;return ne(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function te(e,t,r={}){const{exclusive:n}=r;return ne(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function re(e){return ne(e,"nonempty",(t=>{const r=function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t);return r>0||"Expected a nonempty "+e.type+" but received an empty one"}))}function ne(e,t,r){return new G({...e,*refiner(n,o){yield*e.refiner(n,o);const i=V(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function oe(e,t,r){const[n]=W(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function ie(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return z("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/webp", "image/x-tga", "video/mp4", "video/quicktime", "application/pdf" or "application/octet-stream", but got "${t}"`}))}function ae(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return z("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var se="undefined"!=typeof Blob?Blob:(()=>{try{return m().Blob}catch(e){return function(){throw new Error("Could not find Blob constructor and failed to require('buffer').Blob")}}})(),BlockAPI=class{#e;constructor(e){this.#e=e}async export(e,t=E.Png,r={}){oe("handle",e,Z()),oe("mimeType",t,ie()),oe("options",r,K());const n=null!=r.targetWidth&&null!=r.targetHeight,o=r.jpegQuality??.9,i=r.webpQuality??1,a=r.pngCompressionLevel??5;return oe("jpegQuality",o,te(ee(Z(),1),0,{exclusive:!0})),oe("webpQuality",i,te(ee(Z(),1),0,{exclusive:!0})),oe("pngCompressionLevel",a,te(ee(Q(),9),0)),null==r.targetWidth&&null==r.targetHeight||(oe("targetWidth",r.targetWidth,Z()),oe("targetHeight",r.targetHeight,Z())),new Promise(((s,u)=>{this.#e.exportToBuffer(e,t,(e=>{"error"in e?u(e.error):s(new se([e],{type:t}))}),{pngCompressionLevel:a,jpegQuality:o,webpQuality:i,useTargetSize:n,targetWidth:r.targetWidth??0,targetHeight:r.targetHeight??0,exportPdfWithHighCompatibility:r.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:r.exportPdfWithUnderlayer??!1,underlayerSpotColorName:r.underlayerSpotColorName??"",underlayerOffset:r.underlayerOffset??0})}))}async exportWithColorMask(e,t=E.Png,r,n,o,i={}){oe("handle",e,Z()),oe("mimeType",t,ie()),oe("options",i,K());const a=null!=i.targetWidth&&null!=i.targetHeight,s=i.jpegQuality??.9,u=i.webpQuality??1,c=i.pngCompressionLevel??5;return oe("jpegQuality",s,te(ee(Z(),1),0,{exclusive:!0})),oe("webpQuality",u,te(ee(Z(),1),0,{exclusive:!0})),oe("pngCompressionLevel",c,te(ee(Q(),9),0)),null==i.targetWidth&&null==i.targetHeight||(oe("targetWidth",i.targetWidth,Z()),oe("targetHeight",i.targetHeight,Z())),new Promise(((l,d)=>{this.#e.exportWithColorMaskToBuffer(e,t,r,n,o,((e,r)=>{if("error"in e)d(e.error);else if("error"in r)d(r.error);else{const n=new se([e],{type:t}),o=new se([r],{type:t});l([n,o])}}),{pngCompressionLevel:c,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:i.targetWidth??0,targetHeight:i.targetHeight??0,exportPdfWithHighCompatibility:i.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:i.exportPdfWithUnderlayer??!1,underlayerSpotColorName:i.underlayerSpotColorName??"",underlayerOffset:i.underlayerOffset??0})}))}async exportVideo(e,t=E.Mp4,r,n){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return oe("content",e,J()),A((t=>this.#e.loadBlocksFromString(e,t))).then((e=>R(e)))}async saveToString(e){return oe("blocks",e,Y(Z())),A((t=>this.#e.saveBlocksToString(e,t)))}create(e){return oe("type",e,J()),x(this.#e.create(e))}createFill(e){return oe("type",e,J()),x(this.#e.createFill(e))}getType(e){return oe("id",e,Q()),x(this.#e.getType(e))}getKind(e){return oe("id",e,Q()),x(this.#e.getKind(e))}setKind(e,t){oe("id",e,Q()),x(this.#e.setKind(e,t))}select(e){return oe("id",e,Q()),x(this.#e.select(e))}setSelected(e,t){return oe("id",e,Q()),oe("selected",t,X()),x(this.#e.setSelected(e,t))}isSelected(e){return oe("id",e,Q()),x(this.#e.isSelected(e))}findAllSelected(){return R(this.#e.findAllSelected())}onSelectionChanged=e=>{const t=this.#e.subscribeToSelectionChange(e);return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(t))}};onClicked=e=>{const t=this.#e.subscribeToBlockClicked(e);return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(t))}};isGroupable(e){return oe("ids",e,Y(Z())),x(this.#e.isGroupable(e))}group(e){return oe("ids",e,re(Y(Z()))),x(this.#e.group(e))}ungroup(e){return oe("id",e,Z()),x(this.#e.ungroup(e))}enterGroup(e){return oe("id",e,Z()),x(this.#e.enterGroup(e))}exitGroup(e){return oe("id",e,Z()),x(this.#e.exitGroup(e))}isCombinable(e){return oe("ids",e,Y(Z())),x(this.#e.isCombinable(e))}combine(e,t){return oe("ids",e,Y(Z())),oe("op",t,J()),x(this.#e.combine(e,t))}setName(e,t){return oe("id",e,Q()),oe("name",t,J()),x(this.#e.setName(e,t))}getName(e){return oe("id",e,Q()),x(this.#e.getName(e))}getUUID(e){return oe("id",e,Q()),x(this.#e.getUUID(e))}findByName(e){oe("name",e,J());const t=this.#e.findByName(e);return R(t)}findByType(e){oe("type",e,J());const t=x(this.#e.findByType(e));return R(t)}findByKind(e){oe("kind",e,J());const t=x(this.#e.findByKind(e));return R(t)}findAll(){return R(this.#e.findAll())}findAllPlaceholders(){return R(this.#e.findAllPlaceholders())}createShape(e){return oe("type",e,J()),x(this.#e.createShape(e))}hasShape(e){return oe("id",e,Q()),x(this.#e.hasShape(e))}getShape(e){return oe("id",e,Q()),x(this.#e.getShape(e))}setShape(e,t){return oe("id",e,Q()),oe("shape",t,Q()),x(this.#e.setShape(e,t))}isVisible(e){return oe("id",e,Q()),x(this.#e.isVisible(e))}setVisible(e,t){return oe("id",e,Q()),oe("visible",t,X()),x(this.#e.setVisible(e,t))}isClipped(e){return oe("id",e,Q()),x(this.#e.isClipped(e))}setClipped(e,t){return oe("id",e,Q()),oe("clipped",t,X()),x(this.#e.setClipped(e,t))}isTransformLocked(e){return oe("id",e,Q()),x(this.#e.isTransformLocked(e))}setTransformLocked(e,t){return oe("id",e,Q()),oe("locked",t,X()),x(this.#e.setTransformLocked(e,t))}getPositionX(e){return oe("id",e,Q()),x(this.#e.getPositionX(e))}getPositionXMode(e){return oe("id",e,Q()),x(this.#e.getPositionXMode(e))}getPositionY(e){return oe("id",e,Q()),x(this.#e.getPositionY(e))}getPositionYMode(e){return oe("id",e,Q()),x(this.#e.getPositionYMode(e))}setPositionX(e,t){return oe("id",e,Q()),oe("value",t,Z()),x(this.#e.setPositionX(e,t))}setPositionXMode(e,t){return oe("id",e,Q()),x(this.#e.setPositionXMode(e,t))}setPositionY(e,t){return oe("id",e,Q()),oe("value",t,Z()),x(this.#e.setPositionY(e,t))}setPositionYMode(e,t){return oe("id",e,Q()),x(this.#e.setPositionYMode(e,t))}setAlwaysOnTop(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return oe("id",e,Q()),x(this.#e.isAlwaysOnTop(e))}isAlwaysOnBottom(e){return oe("id",e,Q()),x(this.#e.isAlwaysOnBottom(e))}bringToFront(e){return oe("id",e,Z()),x(this.#e.bringToFront(e))}sendToBack(e){return oe("id",e,Z()),x(this.#e.sendToBack(e))}bringForward(e){return oe("id",e,Z()),x(this.#e.bringForward(e))}sendBackward(e){return oe("id",e,Z()),x(this.#e.sendBackward(e))}getRotation(e){return oe("id",e,Q()),x(this.#e.getRotation(e))}setRotation(e,t){return oe("id",e,Q()),oe("radians",t,Z()),x(this.#e.setRotation(e,t))}getFlipHorizontal(e){return oe("id",e,Q()),x(this.#e.getFlip(e)).horizontal}getFlipVertical(e){return oe("id",e,Q()),x(this.#e.getFlip(e)).vertical}setFlipHorizontal(e,t){return oe("id",e,Q()),oe("flip",t,X()),x(this.#e.setFlipHorizontal(e,t))}setFlipVertical(e,t){return oe("id",e,Q()),oe("flip",t,X()),x(this.#e.setFlipVertical(e,t))}hasContentFillMode(e){return oe("id",e,Q()),x(this.#e.hasContentFillMode(e))}getWidth(e){return oe("id",e,Q()),x(this.#e.getWidth(e))}getWidthMode(e){return oe("id",e,Q()),x(this.#e.getWidthMode(e))}getHeight(e){return oe("id",e,Q()),x(this.#e.getHeight(e))}getHeightMode(e){return oe("id",e,Q()),x(this.#e.getHeightMode(e))}setWidth(e,t){return oe("id",e,Q()),oe("value",t,Z()),x(this.#e.setWidth(e,t))}setWidthMode(e,t){return oe("id",e,Q()),x(this.#e.setWidthMode(e,t))}setHeight(e,t){return oe("id",e,Q()),oe("value",t,Z()),x(this.#e.setHeight(e,t))}setHeightMode(e,t){return oe("id",e,Q()),x(this.#e.setHeightMode(e,t))}getFrameX(e){return oe("id",e,Q()),x(this.#e.getLastFrameX(e))}getFrameY(e){return oe("id",e,Q()),x(this.#e.getLastFrameY(e))}getFrameWidth(e){return oe("id",e,Q()),x(this.#e.getLastFrameWidth(e))}getFrameHeight(e){return oe("id",e,Q()),x(this.#e.getLastFrameHeight(e))}setContentFillMode(e,t){return oe("id",e,Q()),x(this.#e.setContentFillMode(e,t))}getContentFillMode(e){return oe("id",e,Q()),x(this.#e.getContentFillMode(e))}duplicate(e){return oe("id",e,Q()),x(this.#e.duplicate(e))}destroy(e){return oe("id",e,Q()),x(this.#e.destroy(e))}isValid(e){return oe("id",e,Q()),this.#e.isValid(e)}getParent(e){return oe("id",e,Q()),x(this.#e.hasParent(e))?x(this.#e.getParent(e)):null}getChildren(e){oe("id",e,Q());const t=x(this.#e.getChildren(e));return R(t)}insertChild(e,t,r){return oe("parent",e,Z()),oe("child",t,Z()),oe("index",r,te(Z(),0)),x(this.#e.insertChild(e,t,r))}appendChild(e,t){return oe("parent",e,Z()),oe("child",t,Z()),x(this.#e.appendChild(e,t))}referencesAnyVariables(e){return oe("id",e,Q()),x(this.#e.referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return oe("id",e,Q()),x(this.#e.getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return oe("id",e,Q()),x(this.#e.getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return oe("id",e,Q()),x(this.#e.getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return oe("id",e,Q()),x(this.#e.getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return oe("ids",e,Y(Z())),x(this.#e.getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return oe("ids",e,re(Y(Z()))),x(this.#e.alignHorizontally(e,t))}alignVertically(e,t){return oe("ids",e,re(Y(Z()))),x(this.#e.alignVertically(e,t))}isAlignable(e){return oe("ids",e,Y(Z())),x(this.#e.isAlignable(e))}distributeHorizontally(e){return oe("ids",e,re(Y(Z()))),x(this.#e.distributeHorizontally(e))}distributeVertically(e){return oe("ids",e,re(Y(Z()))),x(this.#e.distributeVertically(e))}isDistributable(e){return oe("ids",e,Y(Z())),x(this.#e.isDistributable(e))}fillParent(e){return oe("id",e,Q()),x(this.#e.fillParent(e))}resizeContentAware(e,t,r){return oe("ids",e,Y(Z())),oe("width",t,Z()),oe("height",r,Z()),x(this.#e.resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return oe("id",e,Q()),x(this.#e.scale(e,t,r,n))}findAllProperties(e){return oe("id",e,Q()),R(x(this.#e.findAllProperties(e)))}isPropertyReadable(e){return oe("property",e,J()),this.#e.isPropertyReadable(e)}isPropertyWritable(e){return oe("property",e,J()),this.#e.isPropertyWritable(e)}getPropertyType(e){oe("property",e,J());return x(this.#e.getPropertyType(e))}getEnumValues(e){return oe("enumProperty",e,J()),R(x(this.#e.getEnumValues(e)))}setBool(e,t,r){return oe("id",e,Q()),oe("property",t,J()),oe("value",r,X()),x(this.#e.setBool(e,t,r))}getBool(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getBool(e,t))}setInt(e,t,r){return oe("id",e,Q()),oe("property",t,J()),oe("value",r,Q()),x(this.#e.setInt(e,t,r))}getInt(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getInt(e,t))}setFloat(e,t,r){return oe("id",e,Q()),oe("property",t,J()),oe("value",r,Z()),x(this.#e.setFloat(e,t,r))}getFloat(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getFloat(e,t))}setDouble(e,t,r){return oe("id",e,Q()),oe("property",t,J()),oe("value",r,Z()),x(this.#e.setDouble(e,t,r))}getDouble(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getDouble(e,t))}setString(e,t,r){return oe("id",e,Q()),oe("property",t,J()),oe("value",r,J()),x(this.#e.setString(e,t,r))}getString(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getString(e,t))}setColor(e,t,r){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.setColor(e,t,v.fromColor(r)))}getColor(e,t){return oe("id",e,Q()),oe("property",t,J()),v.toColor(x(this.#e.getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return oe("id",e,Q()),oe("property",t,J()),oe("r",r,Z()),oe("g",n,Z()),oe("b",o,Z()),oe("a",i,Z()),x(this.#e.setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return oe("id",e,Q()),oe("property",t,J()),oe("name",r,J()),oe("tint",n,Z()),x(this.#e.setColorSpot(e,t,r,n))}getColorSpotName(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getColorSpotName(e,t))}getColorSpotTint(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getColorSpotTint(e,t))}setGradientColorStops(e,t,r){oe("id",e,Q()),oe("property",t,J());const n=r.map((e=>({color:v.fromColor(e.color),stop:e.stop})));return x(this.#e.setGradientColorStops(e,t,n))}getGradientColorStops(e,t){oe("id",e,Q()),oe("property",t,J());const r=x(this.#e.getGradientColorStops(e,t));return R(r).map((e=>({color:v.toColor(e.color),stop:e.stop})))}getSourceSet(e,t){return oe("id",e,Q()),oe("property",t,J()),R(x(this.#e.getSourceSet(e,t)))}setSourceSet(e,t,r){oe("id",e,Q()),oe("property",t,J()),oe("sourceSet",r,Y(K({uri:J(),width:Z(),height:Z()}))),x(this.#e.setSourceSet(e,t,r))}setEnum(e,t,r){return oe("id",e,Q()),oe("property",t,J()),oe("value",r,J()),x(this.#e.setEnum(e,t,r))}getEnum(e,t){return oe("id",e,Q()),oe("property",t,J()),x(this.#e.getEnum(e,t))}hasCrop(e){return oe("id",e,Q()),x(this.#e.hasCrop(e))}setCropScaleX(e,t){return oe("id",e,Q()),oe("scaleX",t,Z()),x(this.#e.setCropScaleX(e,t))}setCropScaleY(e,t){return oe("id",e,Q()),oe("scaleY",t,Z()),x(this.#e.setCropScaleY(e,t))}setCropRotation(e,t){return oe("id",e,Q()),oe("rotation",t,Z()),x(this.#e.setCropRotation(e,t))}setCropScaleRatio(e,t){return oe("id",e,Q()),oe("scaleRatio",t,Z()),x(this.#e.setCropScaleRatio(e,t))}setCropTranslationX(e,t){return oe("id",e,Q()),oe("translationX",t,Z()),x(this.#e.setCropTranslationX(e,t))}setCropTranslationY(e,t){return oe("id",e,Q()),oe("translationY",t,Z()),x(this.#e.setCropTranslationY(e,t))}resetCrop(e){return oe("id",e,Q()),x(this.#e.resetCrop(e))}getCropScaleX(e){return oe("id",e,Q()),x(this.#e.getCropScaleX(e))}getCropScaleY(e){return oe("id",e,Q()),x(this.#e.getCropScaleY(e))}getCropRotation(e){return oe("id",e,Q()),x(this.#e.getCropRotation(e))}getCropScaleRatio(e){return oe("id",e,Q()),x(this.#e.getCropScaleRatio(e))}getCropTranslationX(e){return oe("id",e,Q()),x(this.#e.getCropTranslationX(e))}getCropTranslationY(e){return oe("id",e,Q()),x(this.#e.getCropTranslationY(e))}adjustCropToFillFrame(e,t){return oe("id",e,Q()),oe("minScaleRatio",t,Z()),x(this.#e.adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return oe("id",e,Q()),x(this.#e.flipCropHorizontal(e))}flipCropVertical(e){return oe("id",e,Q()),x(this.#e.flipCropVertical(e))}hasOpacity(e){return oe("id",e,Q()),x(this.#e.hasOpacity(e))}setOpacity(e,t){return oe("id",e,Q()),oe("opacity",t,Z()),x(this.#e.setOpacity(e,t))}getOpacity(e){return oe("id",e,Q()),x(this.#e.getOpacity(e))}hasBlendMode(e){return oe("id",e,Q()),x(this.#e.hasBlendMode(e))}setBlendMode(e,t){return oe("id",e,Q()),oe("blendMode",t,J()),x(this.#e.setBlendMode(e,t))}getBlendMode(e){return oe("id",e,Q()),x(this.#e.getBlendMode(e))}hasFillColor(e){return oe("id",e,Q()),x(this.#e.hasFillColor(e))}isIncludedInExport(e){return oe("id",e,Q()),x(this.#e.isIncludedInExport(e))}setIncludedInExport(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,n,o=1){return oe("id",e,Q()),oe("r",t,Z()),oe("g",r,Z()),oe("b",n,Z()),oe("a",o,Z()),x(this.#e.setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return oe("id",e,Q()),x(this.#e.getFillColorRGBA(e))}setFillColorEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setFillColorEnabled(e,t))}isFillColorEnabled(e){return oe("id",e,Q()),x(this.#e.isFillColorEnabled(e))}createEffect(e){return oe("type",e,J()),x(this.#e.createEffect(e))}hasEffects(e){return oe("id",e,Q()),x(this.#e.hasEffects(e))}getEffects(e){oe("id",e,Q());const t=x(this.#e.getEffects(e));return R(t)}insertEffect(e,t,r){oe("id",e,Q()),oe("effectId",t,Q()),oe("index",r,te(Q(),0)),x(this.#e.insertEffect(e,t,r))}appendEffect(e,t){oe("id",e,Q()),oe("effectId",t,Q()),x(this.#e.appendEffect(e,t))}removeEffect(e,t){oe("id",e,Q()),oe("index",t,te(Q(),0)),x(this.#e.removeEffect(e,t))}hasEffectEnabled(e){return oe("effectId",e,Q()),x(this.#e.hasEffectEnabled(e))}setEffectEnabled(e,t){oe("effectId",e,Q()),oe("enabled",t,X()),x(this.#e.setEffectEnabled(e,t))}isEffectEnabled(e){return oe("effectId",e,Q()),x(this.#e.isEffectEnabled(e))}createBlur(e){return oe("type",e,J()),x(this.#e.createBlur(e))}hasBlur(e){return oe("id",e,Q()),x(this.#e.hasBlur(e))}setBlur(e,t){oe("id",e,Q()),oe("blurId",t,Q()),x(this.#e.setBlur(e,t))}getBlur(e){return oe("id",e,Q()),x(this.#e.getBlur(e))}setBlurEnabled(e,t){oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setBlurEnabled(e,t))}isBlurEnabled(e){return oe("id",e,Q()),x(this.#e.isBlurEnabled(e))}hasBackgroundColor(e){return oe("id",e,Q()),x(this.#e.hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return oe("id",e,Q()),oe("r",t,Z()),oe("g",r,Z()),oe("b",n,Z()),oe("a",o,Z()),x(this.#e.setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return oe("id",e,Q()),x(this.#e.getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return oe("id",e,Q()),x(this.#e.isBackgroundColorEnabled(e))}hasStroke(e){return oe("id",e,Q()),x(this.#e.hasStroke(e))}setStrokeEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setStrokeEnabled(e,t))}isStrokeEnabled(e){return oe("id",e,Q()),x(this.#e.isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return oe("id",e,Q()),oe("r",t,Z()),oe("g",r,Z()),oe("b",n,Z()),oe("a",o,Z()),x(this.#e.setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return oe("id",e,Q()),x(this.#e.setStrokeColor(e,v.fromColor(t)))}getStrokeColorRGBA(e){return oe("id",e,Q()),x(this.#e.getStrokeColorRGBA(e))}getStrokeColor(e){return oe("id",e,Q()),v.toColor(x(this.#e.getStrokeColor(e)))}setStrokeWidth(e,t){return oe("id",e,Q()),oe("width",t,Z()),x(this.#e.setStrokeWidth(e,t))}getStrokeWidth(e){return oe("id",e,Q()),x(this.#e.getStrokeWidth(e))}setStrokeStyle(e,t){return oe("id",e,Q()),x(this.#e.setStrokeStyle(e,t))}getStrokeStyle(e){oe("id",e,Q());return x(this.#e.getStrokeStyle(e))}setStrokePosition(e,t){return oe("id",e,Q()),x(this.#e.setStrokePosition(e,t))}getStrokePosition(e){oe("id",e,Q());return x(this.#e.getStrokePosition(e))}setStrokeCornerGeometry(e,t){return oe("id",e,Q()),x(this.#e.setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){oe("id",e,Q());return x(this.#e.getStrokeCornerGeometry(e))}hasDropShadow(e){return oe("id",e,Q()),x(this.#e.hasDropShadow(e))}setDropShadowEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return oe("id",e,Q()),x(this.#e.isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return oe("id",e,Q()),oe("r",t,Z()),oe("g",r,Z()),oe("b",n,Z()),oe("a",o,Z()),x(this.#e.setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return oe("id",e,Q()),x(this.#e.setDropShadowColor(e,v.fromColor(t)))}getDropShadowColorRGBA(e){return oe("id",e,Q()),x(this.#e.getDropShadowColorRGBA(e))}getDropShadowColor(e){return oe("id",e,Q()),v.toColor(x(this.#e.getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return oe("id",e,Q()),oe("offsetX",t,Z()),x(this.#e.setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return oe("id",e,Q()),x(this.#e.getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return oe("id",e,Q()),oe("offsetY",t,Z()),x(this.#e.setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return oe("id",e,Q()),x(this.#e.getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return oe("id",e,Q()),oe("blurRadiusX",t,Z()),x(this.#e.setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return oe("id",e,Q()),x(this.#e.getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return oe("id",e,Q()),oe("blurRadiusY",t,Z()),x(this.#e.setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return oe("id",e,Q()),x(this.#e.getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return oe("id",e,Q()),x(this.#e.setDropShadowClip(e,t))}getDropShadowClip(e){return oe("id",e,Q()),x(this.#e.getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return oe("ids",e,Y(Q())),oe("vectorizeDistanceThreshold",t,Z()),oe("maxSmoothingDistance",r,Z()),x(this.#e.createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return oe("path",e,J()),x(this.#e.createCutoutFromPath(e))}createCutoutFromOperation(e,t){return oe("ids",e,Y(Q())),oe("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return z("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),x(this.#e.createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){oe("id",e,Q()),oe("text",t,J()),oe("from",r,Q()),oe("to",n,Q()),x(this.#e.replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){oe("id",e,Q()),oe("from",t,Q()),oe("to",r,Q()),x(this.#e.removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){oe("id",e,Q()),oe("from",r,Q()),oe("to",n,Q()),x(this.#e.setTextColor(e,v.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){oe("id",e,Q()),oe("from",t,Q()),oe("to",r,Q());const n=this.#e.getTextColors(e,t,r);return R(x(n)).map((e=>v.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return oe("id",e,Q()),oe("from",t,Q()),oe("to",r,Q()),R(x(this.#e.getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return oe("id",e,Q()),oe("from",t,Q()),oe("to",r,Q()),R(x(this.#e.getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return oe("id",e,Q()),oe("from",t,Q()),oe("to",r,Q()),R(x(this.#e.getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){oe("id",e,Q()),oe("textCase",t,J()),oe("from",r,Q()),oe("to",n,Q()),x(this.#e.setTextCase(e,t,r,n))}getTextCursorRange(){return x(this.#e.getTextCursorRange())}hasFill(e){return oe("id",e,Q()),x(this.#e.hasFill(e))}isFillEnabled(e){return oe("id",e,Q()),x(this.#e.isFillEnabled(e))}setFillEnabled(e,t){return oe("id",e,Q()),x(this.#e.setFillEnabled(e,t))}getFill(e){return oe("id",e,Q()),x(this.#e.getFill(e))}setFill(e,t){return oe("id",e,Q()),oe("fill",t,Q()),x(this.#e.setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){oe("id",e,Q()),x(this.#e.setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return oe("id",e,Q()),x(this.#e.getFillSolidColor(e))}setPlaceholderEnabled(e,t){oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return oe("id",e,Q()),x(this.#e.isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return oe("id",e,Q()),x(this.#e.hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){oe("id",e,Q()),x(this.#e.setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return oe("id",e,Q()),x(this.#e.isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return oe("id",e,Q()),x(this.#e.hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return oe("id",e,Q()),x(this.#e.isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return oe("id",e,Q()),x(this.#e.isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){oe("id",e,Q()),oe("key",t,J()),oe("value",r,J()),x(this.#e.setMetadata(e,t,r))}getMetadata(e,t){return oe("id",e,Q()),oe("key",t,J()),x(this.#e.getMetadata(e,t))}hasMetadata(e,t){return oe("id",e,Q()),oe("key",t,J()),x(this.#e.hasMetadata(e,t))}findAllMetadata(e){return oe("id",e,Q()),R(x(this.#e.findAllMetadata(e)))}removeMetadata(e,t){oe("id",e,Q()),oe("key",t,J()),x(this.#e.removeMetadata(e,t))}setScopeEnabled(e,t,r){oe("id",e,Q()),oe("key",t,J()),oe("enabled",r,X()),x(this.#e.setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return oe("id",e,Q()),oe("key",t,J()),x(this.#e.isScopeEnabled(e,t))}isAllowedByScope(e,t){return oe("id",e,Q()),oe("key",t,J()),x(this.#e.isAllowedByScope(e,t))}hasDuration(e){return oe("id",e,Q()),x(this.#e.hasDuration(e))}setDuration(e,t){return oe("id",e,Q()),oe("duration",t,Z()),x(this.#e.setDuration(e,t))}getDuration(e){return oe("id",e,Q()),x(this.#e.getDuration(e))}hasTimeOffset(e){return oe("id",e,Q()),x(this.#e.hasTimeOffset(e))}setTimeOffset(e,t){return oe("id",e,Q()),oe("offset",t,Z()),x(this.#e.setTimeOffset(e,t))}getTimeOffset(e){return oe("id",e,Q()),x(this.#e.getTimeOffset(e))}hasTrim(e){return oe("id",e,Q()),x(this.#e.hasTrim(e))}setTrimOffset(e,t){return oe("id",e,Q()),oe("offset",t,Z()),x(this.#e.setTrimOffset(e,t))}getTrimOffset(e){return oe("id",e,Q()),x(this.#e.getTrimOffset(e))}setTrimLength(e,t){return oe("id",e,Q()),oe("length",t,Z()),x(this.#e.setTrimLength(e,t))}getTrimLength(e){return oe("id",e,Q()),x(this.#e.getTrimLength(e))}getTotalSceneDuration(e){return oe("scene",e,Q()),x(this.#e.getTotalSceneDuration(e))}setPlaying(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setPlaying(e,t))}isPlaying(e){return oe("id",e,Q()),x(this.#e.isPlaying(e))}hasPlaybackTime(e){return oe("id",e,Q()),x(this.#e.hasPlaybackTime(e))}setPlaybackTime(e,t){return oe("id",e,Q()),oe("time",t,Z()),x(this.#e.setPlaybackTime(e,t))}getPlaybackTime(e){return oe("id",e,Q()),x(this.#e.getPlaybackTime(e))}isVisibleAtCurrentPlaybackTime(e){return oe("id",e,Q()),x(this.#e.isVisibleAtCurrentPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return oe("id",e,Q()),oe("enabled",t,X()),x(this.#e.setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return oe("id",e,Q()),x(this.#e.isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return oe("id",e,Q()),x(this.#e.hasPlaybackControl(e))}setLooping(e,t){oe("id",e,Q()),oe("looping",t,X()),x(this.#e.setLooping(e,t))}isLooping(e){return oe("id",e,Q()),x(this.#e.isLooping(e))}setMuted(e,t){oe("id",e,Q()),oe("muted",t,X()),x(this.#e.setMuted(e,t))}isMuted(e){return oe("id",e,Q()),x(this.#e.isMuted(e))}setVolume(e,t){oe("id",e,Q()),oe("volume",t,Z()),x(this.#e.setVolume(e,t))}getVolume(e){return oe("id",e,Q()),x(this.#e.getVolume(e))}async forceLoadAVResource(e){return oe("id",e,Q()),A((t=>this.#e.forceLoadAVResource(e,t)))}unstable_isAVResourceLoaded(e){return oe("id",e,Q()),x(this.#e.unstable_isAVResourceLoaded(e))}getAVResourceTotalDuration(e){return oe("id",e,Q()),x(this.#e.getAVResourceTotalDuration(e))}getVideoWidth(e){return oe("id",e,Q()),x(this.#e.getVideoWidth(e))}getVideoHeight(e){return oe("id",e,Q()),x(this.#e.getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return oe("id",e,Q()),oe("thumbnailHeight",t,Q()),oe("timeBegin",r,Z()),oe("timeEnd",n,Z()),oe("numberOfFrames",o,Q()),this.#e.generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))})),()=>{this.#e.cancelVideoThumbnailSequenceGeneration(e)}}async getVideoFillThumbnail(e,t){return oe("id",e,Q()),oe("thumbnailHeight",t,Q()),new Promise(((r,n)=>{this.#e.getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new se([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return oe("id",e,Q()),oe("numberOfColumns",t,Q()),oe("numberOfRows",r,Q()),oe("thumbnailHeight",n,Q()),new Promise(((o,i)=>{this.#e.getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new se([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return oe("id",e,Q()),oe("numberOfColumns",t,Q()),oe("numberOfRows",r,Q()),new Promise(((o,i)=>{this.#e.getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new se([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),x(this.#e.setNativePixelBuffer(e,t))}};s([S],BlockAPI.prototype,"loadFromString",1),s([S],BlockAPI.prototype,"create",1),s([S],BlockAPI.prototype,"createFill",1),s([C],BlockAPI.prototype,"getType",1),s([S],BlockAPI.prototype,"select",1),s([S],BlockAPI.prototype,"setSelected",1),s([C],BlockAPI.prototype,"isSelected",1),s([C],BlockAPI.prototype,"findAllSelected",1),s([C],BlockAPI.prototype,"isGroupable",1),s([S],BlockAPI.prototype,"group",1),s([S],BlockAPI.prototype,"ungroup",1),s([S],BlockAPI.prototype,"enterGroup",1),s([S],BlockAPI.prototype,"exitGroup",1),s([C],BlockAPI.prototype,"isCombinable",1),s([S],BlockAPI.prototype,"combine",1),s([S],BlockAPI.prototype,"setName",1),s([C],BlockAPI.prototype,"getName",1),s([C],BlockAPI.prototype,"getUUID",1),s([C],BlockAPI.prototype,"findByName",1),s([C],BlockAPI.prototype,"findByType",1),s([C],BlockAPI.prototype,"findAll",1),s([C],BlockAPI.prototype,"findAllPlaceholders",1),s([S],BlockAPI.prototype,"createShape",1),s([C],BlockAPI.prototype,"hasShape",1),s([C],BlockAPI.prototype,"getShape",1),s([S],BlockAPI.prototype,"setShape",1),s([C],BlockAPI.prototype,"isVisible",1),s([S],BlockAPI.prototype,"setVisible",1),s([C],BlockAPI.prototype,"isClipped",1),s([S],BlockAPI.prototype,"setClipped",1),s([C],BlockAPI.prototype,"isTransformLocked",1),s([S],BlockAPI.prototype,"setTransformLocked",1),s([C],BlockAPI.prototype,"getPositionX",1),s([C],BlockAPI.prototype,"getPositionXMode",1),s([C],BlockAPI.prototype,"getPositionY",1),s([C],BlockAPI.prototype,"getPositionYMode",1),s([S],BlockAPI.prototype,"setPositionX",1),s([S],BlockAPI.prototype,"setPositionXMode",1),s([S],BlockAPI.prototype,"setPositionY",1),s([S],BlockAPI.prototype,"setPositionYMode",1),s([S],BlockAPI.prototype,"setAlwaysOnTop",1),s([S],BlockAPI.prototype,"setAlwaysOnBottom",1),s([C],BlockAPI.prototype,"isAlwaysOnTop",1),s([C],BlockAPI.prototype,"isAlwaysOnBottom",1),s([S],BlockAPI.prototype,"bringToFront",1),s([S],BlockAPI.prototype,"sendToBack",1),s([S],BlockAPI.prototype,"bringForward",1),s([S],BlockAPI.prototype,"sendBackward",1),s([C],BlockAPI.prototype,"getRotation",1),s([S],BlockAPI.prototype,"setRotation",1),s([C],BlockAPI.prototype,"getFlipHorizontal",1),s([C],BlockAPI.prototype,"getFlipVertical",1),s([S],BlockAPI.prototype,"setFlipHorizontal",1),s([S],BlockAPI.prototype,"setFlipVertical",1),s([C],BlockAPI.prototype,"hasContentFillMode",1),s([C],BlockAPI.prototype,"getWidth",1),s([C],BlockAPI.prototype,"getWidthMode",1),s([C],BlockAPI.prototype,"getHeight",1),s([C],BlockAPI.prototype,"getHeightMode",1),s([S],BlockAPI.prototype,"setWidth",1),s([S],BlockAPI.prototype,"setWidthMode",1),s([S],BlockAPI.prototype,"setHeight",1),s([S],BlockAPI.prototype,"setHeightMode",1),s([C],BlockAPI.prototype,"getFrameX",1),s([C],BlockAPI.prototype,"getFrameY",1),s([C],BlockAPI.prototype,"getFrameWidth",1),s([C],BlockAPI.prototype,"getFrameHeight",1),s([S],BlockAPI.prototype,"setContentFillMode",1),s([C],BlockAPI.prototype,"getContentFillMode",1),s([S],BlockAPI.prototype,"duplicate",1),s([S],BlockAPI.prototype,"destroy",1),s([C],BlockAPI.prototype,"isValid",1),s([C],BlockAPI.prototype,"getParent",1),s([C],BlockAPI.prototype,"getChildren",1),s([S],BlockAPI.prototype,"insertChild",1),s([S],BlockAPI.prototype,"appendChild",1),s([C],BlockAPI.prototype,"referencesAnyVariables",1),s([C],BlockAPI.prototype,"getGlobalBoundingBoxX",1),s([C],BlockAPI.prototype,"getGlobalBoundingBoxY",1),s([C],BlockAPI.prototype,"getGlobalBoundingBoxWidth",1),s([C],BlockAPI.prototype,"getGlobalBoundingBoxHeight",1),s([C],BlockAPI.prototype,"getScreenSpaceBoundingBoxXYWH",1),s([S],BlockAPI.prototype,"alignHorizontally",1),s([S],BlockAPI.prototype,"alignVertically",1),s([C],BlockAPI.prototype,"isAlignable",1),s([S],BlockAPI.prototype,"distributeHorizontally",1),s([S],BlockAPI.prototype,"distributeVertically",1),s([S],BlockAPI.prototype,"isDistributable",1),s([S],BlockAPI.prototype,"fillParent",1),s([S],BlockAPI.prototype,"resizeContentAware",1),s([S],BlockAPI.prototype,"scale",1),s([C],BlockAPI.prototype,"findAllProperties",1),s([C],BlockAPI.prototype,"isPropertyReadable",1),s([C],BlockAPI.prototype,"isPropertyWritable",1),s([C],BlockAPI.prototype,"getPropertyType",1),s([C],BlockAPI.prototype,"getEnumValues",1),s([S],BlockAPI.prototype,"setBool",1),s([C],BlockAPI.prototype,"getBool",1),s([S],BlockAPI.prototype,"setInt",1),s([C],BlockAPI.prototype,"getInt",1),s([S],BlockAPI.prototype,"setFloat",1),s([C],BlockAPI.prototype,"getFloat",1),s([S],BlockAPI.prototype,"setDouble",1),s([C],BlockAPI.prototype,"getDouble",1),s([S],BlockAPI.prototype,"setString",1),s([C],BlockAPI.prototype,"getString",1),s([S],BlockAPI.prototype,"setColor",1),s([C],BlockAPI.prototype,"getColor",1),s([S],BlockAPI.prototype,"setColorRGBA",1),s([C],BlockAPI.prototype,"getColorRGBA",1),s([S],BlockAPI.prototype,"setColorSpot",1),s([C],BlockAPI.prototype,"getColorSpotName",1),s([C],BlockAPI.prototype,"getColorSpotTint",1),s([S],BlockAPI.prototype,"setGradientColorStops",1),s([C],BlockAPI.prototype,"getGradientColorStops",1),s([C],BlockAPI.prototype,"getSourceSet",1),s([S],BlockAPI.prototype,"setSourceSet",1),s([S],BlockAPI.prototype,"setEnum",1),s([C],BlockAPI.prototype,"getEnum",1),s([C],BlockAPI.prototype,"hasCrop",1),s([S],BlockAPI.prototype,"setCropScaleX",1),s([S],BlockAPI.prototype,"setCropScaleY",1),s([S],BlockAPI.prototype,"setCropRotation",1),s([S],BlockAPI.prototype,"setCropScaleRatio",1),s([S],BlockAPI.prototype,"setCropTranslationX",1),s([S],BlockAPI.prototype,"setCropTranslationY",1),s([S],BlockAPI.prototype,"resetCrop",1),s([C],BlockAPI.prototype,"getCropScaleX",1),s([C],BlockAPI.prototype,"getCropScaleY",1),s([C],BlockAPI.prototype,"getCropRotation",1),s([C],BlockAPI.prototype,"getCropScaleRatio",1),s([C],BlockAPI.prototype,"getCropTranslationX",1),s([C],BlockAPI.prototype,"getCropTranslationY",1),s([S],BlockAPI.prototype,"adjustCropToFillFrame",1),s([S],BlockAPI.prototype,"flipCropHorizontal",1),s([S],BlockAPI.prototype,"flipCropVertical",1),s([C],BlockAPI.prototype,"hasOpacity",1),s([S],BlockAPI.prototype,"setOpacity",1),s([C],BlockAPI.prototype,"getOpacity",1),s([C],BlockAPI.prototype,"hasBlendMode",1),s([S],BlockAPI.prototype,"setBlendMode",1),s([C],BlockAPI.prototype,"getBlendMode",1),s([C],BlockAPI.prototype,"hasFillColor",1),s([C],BlockAPI.prototype,"isIncludedInExport",1),s([S],BlockAPI.prototype,"setIncludedInExport",1),s([S],BlockAPI.prototype,"setFillColorRGBA",1),s([C],BlockAPI.prototype,"getFillColorRGBA",1),s([S],BlockAPI.prototype,"setFillColorEnabled",1),s([C],BlockAPI.prototype,"isFillColorEnabled",1),s([S],BlockAPI.prototype,"createEffect",1),s([C],BlockAPI.prototype,"hasEffects",1),s([C],BlockAPI.prototype,"getEffects",1),s([S],BlockAPI.prototype,"insertEffect",1),s([S],BlockAPI.prototype,"appendEffect",1),s([S],BlockAPI.prototype,"removeEffect",1),s([C],BlockAPI.prototype,"hasEffectEnabled",1),s([S],BlockAPI.prototype,"setEffectEnabled",1),s([C],BlockAPI.prototype,"isEffectEnabled",1),s([S],BlockAPI.prototype,"createBlur",1),s([C],BlockAPI.prototype,"hasBlur",1),s([S],BlockAPI.prototype,"setBlur",1),s([C],BlockAPI.prototype,"getBlur",1),s([S],BlockAPI.prototype,"setBlurEnabled",1),s([C],BlockAPI.prototype,"isBlurEnabled",1),s([C],BlockAPI.prototype,"hasBackgroundColor",1),s([S],BlockAPI.prototype,"setBackgroundColorRGBA",1),s([C],BlockAPI.prototype,"getBackgroundColorRGBA",1),s([S],BlockAPI.prototype,"setBackgroundColorEnabled",1),s([C],BlockAPI.prototype,"isBackgroundColorEnabled",1),s([C],BlockAPI.prototype,"hasStroke",1),s([S],BlockAPI.prototype,"setStrokeEnabled",1),s([C],BlockAPI.prototype,"isStrokeEnabled",1),s([S],BlockAPI.prototype,"setStrokeColorRGBA",1),s([S],BlockAPI.prototype,"setStrokeColor",1),s([C],BlockAPI.prototype,"getStrokeColorRGBA",1),s([C],BlockAPI.prototype,"getStrokeColor",1),s([S],BlockAPI.prototype,"setStrokeWidth",1),s([C],BlockAPI.prototype,"getStrokeWidth",1),s([S],BlockAPI.prototype,"setStrokeStyle",1),s([C],BlockAPI.prototype,"getStrokeStyle",1),s([S],BlockAPI.prototype,"setStrokePosition",1),s([C],BlockAPI.prototype,"getStrokePosition",1),s([S],BlockAPI.prototype,"setStrokeCornerGeometry",1),s([C],BlockAPI.prototype,"getStrokeCornerGeometry",1),s([C],BlockAPI.prototype,"hasDropShadow",1),s([S],BlockAPI.prototype,"setDropShadowEnabled",1),s([C],BlockAPI.prototype,"isDropShadowEnabled",1),s([S],BlockAPI.prototype,"setDropShadowColorRGBA",1),s([S],BlockAPI.prototype,"setDropShadowColor",1),s([C],BlockAPI.prototype,"getDropShadowColorRGBA",1),s([C],BlockAPI.prototype,"getDropShadowColor",1),s([S],BlockAPI.prototype,"setDropShadowOffsetX",1),s([C],BlockAPI.prototype,"getDropShadowOffsetX",1),s([S],BlockAPI.prototype,"setDropShadowOffsetY",1),s([C],BlockAPI.prototype,"getDropShadowOffsetY",1),s([S],BlockAPI.prototype,"setDropShadowBlurRadiusX",1),s([C],BlockAPI.prototype,"getDropShadowBlurRadiusX",1),s([S],BlockAPI.prototype,"setDropShadowBlurRadiusY",1),s([C],BlockAPI.prototype,"getDropShadowBlurRadiusY",1),s([S],BlockAPI.prototype,"setDropShadowClip",1),s([C],BlockAPI.prototype,"getDropShadowClip",1),s([S],BlockAPI.prototype,"createCutoutFromBlocks",1),s([S],BlockAPI.prototype,"createCutoutFromPath",1),s([S],BlockAPI.prototype,"createCutoutFromOperation",1),s([S],BlockAPI.prototype,"replaceText",1),s([S],BlockAPI.prototype,"removeText",1),s([S],BlockAPI.prototype,"setTextColor",1),s([C],BlockAPI.prototype,"getTextColors",1),s([C],BlockAPI.prototype,"getTextFontWeights",1),s([C],BlockAPI.prototype,"getTextFontStyles",1),s([C],BlockAPI.prototype,"getTextCases",1),s([S],BlockAPI.prototype,"setTextCase",1),s([C],BlockAPI.prototype,"getTextCursorRange",1),s([C],BlockAPI.prototype,"hasFill",1),s([C],BlockAPI.prototype,"isFillEnabled",1),s([S],BlockAPI.prototype,"setFillEnabled",1),s([C],BlockAPI.prototype,"getFill",1),s([S],BlockAPI.prototype,"setFill",1),s([S],BlockAPI.prototype,"setFillSolidColor",1),s([C],BlockAPI.prototype,"getFillSolidColor",1),s([S],BlockAPI.prototype,"setPlaceholderEnabled",1),s([C],BlockAPI.prototype,"isPlaceholderEnabled",1),s([C],BlockAPI.prototype,"hasPlaceholderBehavior",1),s([S],BlockAPI.prototype,"setPlaceholderBehaviorEnabled",1),s([C],BlockAPI.prototype,"isPlaceholderBehaviorEnabled",1),s([C],BlockAPI.prototype,"hasPlaceholderControls",1),s([S],BlockAPI.prototype,"setPlaceholderControlsOverlayEnabled",1),s([C],BlockAPI.prototype,"isPlaceholderControlsOverlayEnabled",1),s([S],BlockAPI.prototype,"setPlaceholderControlsButtonEnabled",1),s([C],BlockAPI.prototype,"isPlaceholderControlsButtonEnabled",1),s([S],BlockAPI.prototype,"setMetadata",1),s([C],BlockAPI.prototype,"getMetadata",1),s([C],BlockAPI.prototype,"hasMetadata",1),s([C],BlockAPI.prototype,"findAllMetadata",1),s([S],BlockAPI.prototype,"removeMetadata",1),s([S],BlockAPI.prototype,"setScopeEnabled",1),s([C],BlockAPI.prototype,"isScopeEnabled",1),s([C],BlockAPI.prototype,"isAllowedByScope",1),s([C],BlockAPI.prototype,"hasDuration",1),s([S],BlockAPI.prototype,"setDuration",1),s([C],BlockAPI.prototype,"getDuration",1),s([C],BlockAPI.prototype,"hasTimeOffset",1),s([S],BlockAPI.prototype,"setTimeOffset",1),s([C],BlockAPI.prototype,"getTimeOffset",1),s([C],BlockAPI.prototype,"hasTrim",1),s([S],BlockAPI.prototype,"setTrimOffset",1),s([C],BlockAPI.prototype,"getTrimOffset",1),s([S],BlockAPI.prototype,"setTrimLength",1),s([C],BlockAPI.prototype,"getTrimLength",1),s([C],BlockAPI.prototype,"getTotalSceneDuration",1),s([S],BlockAPI.prototype,"setPlaying",1),s([C],BlockAPI.prototype,"isPlaying",1),s([C],BlockAPI.prototype,"hasPlaybackTime",1),s([S],BlockAPI.prototype,"setPlaybackTime",1),s([C],BlockAPI.prototype,"getPlaybackTime",1),s([C],BlockAPI.prototype,"isVisibleAtCurrentPlaybackTime",1),s([S],BlockAPI.prototype,"setSoloPlaybackEnabled",1),s([C],BlockAPI.prototype,"isSoloPlaybackEnabled",1),s([C],BlockAPI.prototype,"hasPlaybackControl",1),s([S],BlockAPI.prototype,"setLooping",1),s([C],BlockAPI.prototype,"isLooping",1),s([S],BlockAPI.prototype,"setMuted",1),s([C],BlockAPI.prototype,"isMuted",1),s([S],BlockAPI.prototype,"setVolume",1),s([C],BlockAPI.prototype,"getVolume",1),s([S],BlockAPI.prototype,"forceLoadAVResource",1),s([C],BlockAPI.prototype,"unstable_isAVResourceLoaded",1),s([C],BlockAPI.prototype,"getAVResourceTotalDuration",1),s([C],BlockAPI.prototype,"getVideoWidth",1),s([C],BlockAPI.prototype,"getVideoHeight",1),s([C],BlockAPI.prototype,"getVideoFillThumbnail",1),s([C],BlockAPI.prototype,"getVideoFillThumbnailAtlas",1),s([C],BlockAPI.prototype,"getPageThumbnailAtlas",1);var EditorAPI=class{#e;constructor(e){this.#e=e}unlockWithLicense(e){x(this.#e.unlockWithLicense(e))}getActiveLicense(){return x(this.#e.getActiveLicense())}onStateChanged=e=>{const t=this.#e.subscribeToEditorState(e);return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(t))}};setEditMode(e){oe("keypath",e,J()),this.#e.setEditMode(e)}getEditMode(){return this.#e.getEditMode()}getCursorType(){return this.#e.getCursorType()}getCursorRotation(){return this.#e.getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return this.#e.getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return this.#e.getTextCursorPositionInScreenSpaceY()}createHistory(){return this.#e.createHistory()}destroyHistory(e){x(this.#e.destroyHistory(e))}setActiveHistory(e){x(this.#e.setActiveHistory(e))}getActiveHistory(){return this.#e.getActiveHistory()}addUndoStep(){x(this.#e.addUndoStep())}undo(){x(this.#e.undo())}redo(){x(this.#e.redo())}canUndo(){return x(this.#e.canUndo())}canRedo(){return x(this.#e.canRedo())}onHistoryUpdated=e=>{const t=this.#e.subscribeToHistory(e);return()=>{this.#e.isDeleted()||this.#e.unsubscribe(t)}};onSettingsChanged=e=>{const t=this.#e.subscribeToSettings(e);return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(t))}};setSettingBool(e,t){return oe("keypath",e,J()),oe("value",t,X()),x(this.#e.setSettingBool(e,t))}getSettingBool(e){return oe("keypath",e,J()),x(this.#e.getSettingBool(e))}setSettingInt(e,t){return oe("keypath",e,J()),oe("value",t,Q()),x(this.#e.setSettingInt(e,t))}getSettingInt(e){return oe("keypath",e,J()),x(this.#e.getSettingInt(e))}setSettingFloat(e,t){return oe("keypath",e,J()),oe("value",t,Z()),x(this.#e.setSettingFloat(e,t))}getSettingFloat(e){return oe("keypath",e,J()),x(this.#e.getSettingFloat(e))}setSettingString(e,t){return oe("keypath",e,J()),oe("value",t,J()),x(this.#e.setSettingString(e,t))}getSettingString(e){return oe("keypath",e,J()),x(this.#e.getSettingString(e))}setSettingColor(e,t){return oe("keypath",e,J()),x(this.#e.setSettingColor(e,v.fromColor(t)))}getSettingColor(e){return oe("keypath",e,J()),v.toColor(x(this.#e.getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return oe("keypath",e,J()),oe("r",t,Z()),oe("g",r,Z()),oe("b",n,Z()),oe("a",o,Z()),x(this.#e.setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return oe("keypath",e,J()),x(this.#e.getSettingColorRGBA(e))}setSettingEnum(e,t){return oe("keypath",e,J()),oe("value",t,J()),x(this.#e.setSettingEnum(e,t))}getSettingEnum(e){return oe("keypath",e,J()),x(this.#e.getSettingEnum(e))}getSettingEnumOptions(e){return oe("keypath",e,J()),R(x(this.#e.getSettingEnumOptions(e)))}findAllSettings(){return R(this.#e.findAllSettings())}getSettingType(e){oe("keypath",e,J());return x(this.#e.getSettingType(e))}getAvailableMemory(){return x(this.#e.getAvailableMemory())}getUsedMemory(){return x(this.#e.getUsedMemory())}getMaxExportSize(){return x(this.#e.getMaxExportSize())}setURIResolver(e){return x(this.#e.setURIResolver(e))}defaultURIResolver(e){return this.#e.defaultURIResolver(e)}getAbsoluteURI(e){return x(this.#e.getAbsoluteURI(e))}setGlobalScope(e,t){oe("key",e,J()),oe("value",t,J()),x(this.#e.setGlobalScope(e,t))}getGlobalScope(e){return oe("key",e,J()),x(this.#e.getGlobalScope(e))}findAllSpotColors(){return R(this.#e.findAllSpotColors())}getSpotColorRGBA(e){return oe("name",e,J()),this.#e.getSpotColorRGB(e)}getSpotColorCMYK(e){return oe("name",e,J()),this.#e.getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return oe("name",e,J()),oe("r",t,Z()),oe("g",r,Z()),oe("b",n,Z()),this.#e.setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return oe("name",e,J()),oe("c",t,Z()),oe("m",r,Z()),oe("y",n,Z()),oe("k",o,Z()),this.#e.setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return oe("name",e,J()),x(this.#e.removeSpotColor(e))}setSpotColorForCutoutType(e,t){return oe("type",e,J()),oe("color",t,J()),x(this.#e.setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return oe("type",e,J()),x(this.#e.getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return oe("colorSpace",t,J()),v.toColor(x(this.#e.convertColorToColorSpace(v.fromColor(e),t)))}};s([S],EditorAPI.prototype,"setEditMode",1),s([C],EditorAPI.prototype,"getEditMode",1),s([C],EditorAPI.prototype,"getCursorType",1),s([C],EditorAPI.prototype,"getCursorRotation",1),s([C],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceX",1),s([C],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceY",1),s([S],EditorAPI.prototype,"createHistory",1),s([S],EditorAPI.prototype,"destroyHistory",1),s([S],EditorAPI.prototype,"setActiveHistory",1),s([C],EditorAPI.prototype,"getActiveHistory",1),s([S],EditorAPI.prototype,"addUndoStep",1),s([S],EditorAPI.prototype,"undo",1),s([S],EditorAPI.prototype,"redo",1),s([C],EditorAPI.prototype,"canUndo",1),s([C],EditorAPI.prototype,"canRedo",1),s([S],EditorAPI.prototype,"setSettingBool",1),s([C],EditorAPI.prototype,"getSettingBool",1),s([S],EditorAPI.prototype,"setSettingInt",1),s([C],EditorAPI.prototype,"getSettingInt",1),s([S],EditorAPI.prototype,"setSettingFloat",1),s([C],EditorAPI.prototype,"getSettingFloat",1),s([S],EditorAPI.prototype,"setSettingString",1),s([C],EditorAPI.prototype,"getSettingString",1),s([S],EditorAPI.prototype,"setSettingColor",1),s([C],EditorAPI.prototype,"getSettingColor",1),s([S],EditorAPI.prototype,"setSettingColorRGBA",1),s([C],EditorAPI.prototype,"getSettingColorRGBA",1),s([S],EditorAPI.prototype,"setSettingEnum",1),s([C],EditorAPI.prototype,"getSettingEnum",1),s([C],EditorAPI.prototype,"getAvailableMemory",1),s([C],EditorAPI.prototype,"getUsedMemory",1),s([C],EditorAPI.prototype,"getMaxExportSize",1),s([S],EditorAPI.prototype,"setURIResolver",1),s([C],EditorAPI.prototype,"defaultURIResolver",1),s([C],EditorAPI.prototype,"getAbsoluteURI",1),s([S],EditorAPI.prototype,"setGlobalScope",1),s([C],EditorAPI.prototype,"getGlobalScope",1),s([C],EditorAPI.prototype,"findAllSpotColors",1),s([C],EditorAPI.prototype,"getSpotColorRGBA",1),s([C],EditorAPI.prototype,"getSpotColorCMYK",1),s([S],EditorAPI.prototype,"setSpotColorRGB",1),s([S],EditorAPI.prototype,"setSpotColorCMYK",1),s([S],EditorAPI.prototype,"removeSpotColor",1),s([S],EditorAPI.prototype,"setSpotColorForCutoutType",1),s([S],EditorAPI.prototype,"getSpotColorForCutoutType",1);var EventAPI=class{#e;constructor(e){this.#e=e}subscribe=(e,t)=>{oe("blocks",e,Y());const r=this.#e.subscribe(e,(e=>{try{t(R(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(r))}}},VariableAPI=class{#e;constructor(e){this.#e=e}findAll(){return R(this.#e.findAllVariables())}setString(e,t){return oe("key",e,J()),oe("value",t,J()),x(this.#e.setVariableString(e,t))}getString(e){return oe("key",e,J()),x(this.#e.getVariableString(e))}remove(e){return oe("key",e,J()),x(this.#e.removeVariable(e))}},ue=!1;var ce="https://api.img.ly/activate";var le,de,fe,pe=(le=y(),fe=null!=le?e(o(le)):{},((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let u of n(o))i.call(e,u)||u===a||t(e,u,{get:()=>o[u],enumerable:!(s=r(o,u))||s.enumerable});return e})(!de&&le&&le.__esModule?fe:t(fe,"default",{value:le,enumerable:!0}),le)),he="../../cesdk-v1.21.1-SHMUI6C6.data",me="../../cesdk-v1.21.1-FAWXZVHP.wasm",ge=pe.default,ye=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",be=(ye.indexOf("Edge"),ye.match(/msie|trident/i),/\b(iPad|iPhone|iPod)\b/.test(ye)&&/WebKit/.test(ye)&&!/Edge/.test(ye)&&("undefined"==typeof window||!("MSStream"in window))),ve=(e,t)=>{if(null!=t){return[t,e.split("/").pop()].join("")}return new URL(e,window.location.origin)};function we(){try{return new WebAssembly.Memory({initial:Ee(be?512:32),maximum:Ee(2048)})}catch(e){return new WebAssembly.Memory({initial:Ee(32),maximum:Ee(2048)})}}function Ee(e){return 1024*e*1024/65536}async function _e(e,t){const{core:r}=t,n=t.logger,o=ve(me,r.baseURL).toString(),i=ve(he,r.baseURL).toString(),a=/electron/i.test(navigator.userAgent),s=function(e,t=fetch){if(!e.license)throw new Error("Missing license key in config");return e.license.length<128?t(ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:e.license,userId:e.userId})}).then((e=>{if(e.ok)return e.json();throw new Error("Unfortunately we are experiencing a server down time and your License key cannot be validated. We're already working on a fix and will restore service soon. Should services not restore within the hour, kindly get in touch with our support team.")})).then((e=>{if("valid"===e.status)return e.license;throw"expired"===e.status?new Error("Thanks for using IMG.LY for creative editing. Please note that your license file or commercial use is expired. Please get in touch with our sales team to discuss extension of your commercial license."):new Error("The License Key (API Key) you are using to access the IMG.LY SDK is invalid. Please ensure that you are using the license key tied to your subscription and get in touch with our support team.")})):Promise.resolve(e.license)}(t),u=a?await fetch(i,{credentials:"same-origin"}).then((e=>e.arrayBuffer())).then((e=>function(t,r){if(t!==i)return null;if(r===e.byteLength)return e;throw new Error(`Attempt to get preloaded package of unknown name or size: ${t} ${r}`)})):void 0;return new Promise(((r,a)=>{const c={getPreloadedPackage:u,locateFile:(e,t)=>e.endsWith(".wasm")?o:e.endsWith(".data")?i:t+e,print:e=>{e&&"undefined"!==e&&n(e,"Info")},printErr:e=>{e&&"undefined"!==e&&n(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:we()};ge(c).then((async n=>{n.specialHTMLTargets["!canvas"]=e;n.emscripten_ubq_settings_forceWebGL1=!!t?.forceWebGL1;const o=x(n.createEngine("!canvas",t.audioOutput??"auto"));!function(e,t){if(!t)throw new Error("Missing license key");x(e.unlockWithLicense(t))}(o,await s),function(e,t){const r=new k(e),n=new EditorAPI(e),o=new AssetAPI(e);n.setSettingEnum("role",t.role??"Creator"),"Adopter"===t.role&&n.setSettingEnum("doubleClickSelectionMode","Direct"),ue&&(r.execute("cesdk/getVersionInfo").then((e=>console.debug(e))),r.execute("cesdk/getCapabilitiesInfo").then((e=>console.debug(e)))),n.setSettingString("basePath",t.baseURL),n.setSettingBool("showBuildVersion",ue||!1),t.featureFlags?.preventScrolling&&(n.setSettingBool("touch/singlePointPanning",!1),n.setSettingBool("touch/dragStartCanSelect",!1)),o.addLocalSource("ly.img.text"),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((n=>{const o=`${e}_${n.weight}_${n.style}`;r.execute("ubq/assets/registerFont",[o,n.fontURL,t.family,n.weight,n.style])}))})),function(){ue&&(n.setSettingBool("features/hspSelectiveAdjustmentsEnabled",!1),n.setSettingBool("features/layerListEnabled",!1),n.setSettingBool("features/templatingEnabled",!0));const e=!!t.featureFlags?.singlePageMode;n.setSettingBool("features/singlePageModeEnabled",e),n.setSettingBool("features/effectsEnabled",!0)}(),function(){const e=t.extensions??[];e.entries.forEach((t=>{r.execute("ubq/extension/register",`${e.baseURL+t}`)}))}(),function(){const t=new VariableAPI(e);(ue||"undefined"!=typeof window&&window.Cypress)&&(t.setString("company_name","img.ly"),t.setString("first_name","Charly"),t.setString("last_name","Williams"),t.setString("address","742 Evergreen Terrace"),t.setString("city","Springfield"))}()}(o,t),r(o)})).catch(a)}))}var SceneAPI=class{#e;constructor(e){this.#e=e}async loadFromString(e){return oe("sceneContent",e,J()),A((t=>this.#e.loadSceneFromString(e,t)))}async loadFromURL(e){return oe("url",e,J()),A((t=>this.#e.loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return A((t=>{this.#e.saveSceneToString(e,t)}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):this.#e.saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new se([r],{type:E.Zip}))}))}))}create(e="Free"){oe("sceneLayout",e,ae());return x(this.#e.createScene(e))}createVideo(){return x(this.#e.createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return oe("url",e,J()),oe("dpi",t,te(Z(),0)),oe("pixelScaleFactor",r,te(Z(),0)),oe("sceneLayout",n,ae()),A((a=>this.#e.createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return oe("url",e,J()),A((t=>this.#e.createSceneFromVideo(e,t)))}get(){const e=x(this.#e.findByType("scene")),t=R(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return oe("content",e,J()),A((t=>this.#e.applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return oe("url",e,J()),A((t=>this.#e.applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return x(this.#e.getSceneMode(e))}setDesignUnit(e){oe("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return z("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();x(this.#e.setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return x(this.#e.getDesignUnit(e))}getPages(){return R(x(this.#e.getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=x(this.#e.findNearestToViewPortCenterByKind(e,"page")),r=R(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){oe("type",e,J());const t=this.get();if(null==t)return[];const r=x(this.#e.findNearestToViewPortCenterByType(t,e));return R(r)}findNearestToViewPortCenterByKind(e){oe("kind",e,J());const t=this.get();if(null==t)return[];const r=x(this.#e.findNearestToViewPortCenterByKind(t,e));return R(r)}setZoomLevel(e=1){const t=this.get();oe("zoomLevel",e,te(Z(),0)),this.#e.setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return x(this.#e.getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return oe("id",e,Q()),A((i=>this.#e.zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return oe("id",e,Q()),oe("axis",t,function(){const e=["Horizontal","Vertical","Both"];return z("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(oe("paddingBefore",r,Z()),oe("paddingAfter",n,Z()),x(this.#e.enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(oe("paddingBefore",r,Z()),oe("paddingAfter",n,Z()),x(this.#e.enableZoomAutoFit(e,t,0,r,0,n))):(oe("paddingLeft",r,Z()),oe("paddingTop",n,Z()),oe("paddingRight",o,Z()),oe("paddingBottom",i,Z()),x(this.#e.enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return oe("blockOrScene",e,Q()),x(this.#e.disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return oe("blockOrScene",e,Q()),x(this.#e.isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return oe("ids",e,Y(Z())),oe("paddingLeft",t,Z()),oe("paddingTop",r,Z()),oe("paddingRight",n,Z()),oe("paddingBottom",o,Z()),oe("scaledPaddingLeft",t,Z()),oe("scaledPaddingTop",r,Z()),oe("scaledPaddingRight",n,Z()),oe("scaledPaddingBottom",o,Z()),x(this.#e.unstable_enableCameraPositionClamping(e,t,r,n,o,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return x(this.#e.unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return x(this.#e.unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return oe("ids",e,Y(Z())),oe("minZoomLimit",t,Z()),oe("maxZoomLimit",r,Z()),oe("paddingLeft",n,Z()),oe("paddingTop",o,Z()),oe("paddingRight",i,Z()),oe("paddingBottom",a,Z()),x(this.#e.unstable_enableCameraZoomClamping(e,t,r,n,o,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return x(this.#e.unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return x(this.#e.unstable_isCameraZoomClampingEnabled(e))}onZoomLevelChanged=e=>{const t=this.#e.subscribeToZoomLevel(e);return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(t))}};onActiveChanged=e=>{const t=this.#e.subscribeToActiveSceneChange(e);return()=>{this.#e.isDeleted()||x(this.#e.unsubscribe(t))}}};s([S],SceneAPI.prototype,"loadFromString",1),s([S],SceneAPI.prototype,"loadFromURL",1),s([S],SceneAPI.prototype,"create",1),s([S],SceneAPI.prototype,"createVideo",1),s([S],SceneAPI.prototype,"createFromImage",1),s([S],SceneAPI.prototype,"createFromVideo",1),s([C],SceneAPI.prototype,"get",1),s([S],SceneAPI.prototype,"applyTemplateFromString",1),s([S],SceneAPI.prototype,"applyTemplateFromURL",1),s([C],SceneAPI.prototype,"getMode",1),s([S],SceneAPI.prototype,"setDesignUnit",1),s([C],SceneAPI.prototype,"getDesignUnit",1),s([C],SceneAPI.prototype,"getPages",1),s([C],SceneAPI.prototype,"getCurrentPage",1),s([C],SceneAPI.prototype,"findNearestToViewPortCenterByType",1),s([C],SceneAPI.prototype,"findNearestToViewPortCenterByKind",1),s([S],SceneAPI.prototype,"setZoomLevel",1),s([C],SceneAPI.prototype,"getZoomLevel",1),s([S],SceneAPI.prototype,"zoomToBlock",1),s([S],SceneAPI.prototype,"enableZoomAutoFit",1),s([S],SceneAPI.prototype,"disableZoomAutoFit",1),s([C],SceneAPI.prototype,"isZoomAutoFitEnabled",1);async function Ce(e,t,r,n,o={},i){let a,s,u=0,c=null;const l=i?.visibility??xe;globalThis.ubq_exportVideoTimeout=i?.inactivityTimeout;const d=l.subscribe((()=>{null!==c&&(c=Date.now()),globalThis.ubq_browserTabHidden=!l.value()}));let f=null;function p(){clearTimeout(s),d(),f?.()}try{let d=function(){if(!0===l.value()&&null!==c&&Date.now()-c>1e4)a(new Error("Video export timed out due to inactivity."));else{if(u<10){for(const e of C)e.update?.(S);m.update()}s=setTimeout(d,1)}};const h=new OffscreenCanvas(64,64),m=await _e(h,{...e,audioOutput:"none"}),g=new AssetAPI(m),y=new SceneAPI(m),b=new BlockAPI(m),v=new EditorAPI(m),w=new EventAPI(m),_=new VariableAPI(m);f=()=>{m.delete()},function(e,t){for(const[r,n]of t)switch(e.getSettingType(r)){case"Bool":e.setSettingBool(r,n);break;case"Int":e.setSettingInt(r,n);break;case"Float":e.setSettingFloat(r,n);break;case"String":e.setSettingString(r,n);break;case"Color":e.setSettingColor(r,n);break;case"Enum":{const t=r,o=n;e.setSettingEnum(t,o)}}}(v,t);const C=await Promise.all(r.map((e=>async function(e){const t=new Function("url","return import(url)"),r=await t(e);if(void 0!==r.initialize&&"function"!=typeof r.initialize)throw new Error(`Plugin ${e} exports an 'initialize' property, but is is not a function`);if(void 0!==r.update&&"function"!=typeof r.update)throw new Error(`Plugin ${e} exports an 'update' property, but it is not a function`);return r}(e)))),S={asset:g,block:b,scene:y,editor:v,event:w,variable:_};for(const e of C)e.initialize?.(S);const k=await y.loadFromString(n),x=o.block?b.getDuration(o.block):b.getTotalSceneDuration(y.get());d();const A=await new Promise(((t,r)=>{a=r,e.abortSignal?.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),m.exportVideoToBuffer(o.block??k,o.timeOffset??0,o.duration??x,E.Mp4,((e,t,r)=>{u=e-t,c=Date.now(),i?.onProgress?.(e,t,r)}),(e=>{"error"in e?r(e.error):t(e)}),{h264Profile:o.h264Profile??77,h264Level:o.h264Level??52,framerate:o.framerate??30,useTargetSize:void 0!==o.width&&void 0!==o.height,targetWidth:o.width??0,targetHeight:o.height??0})})),T=new Uint8Array(A.byteLength);return T.set(A),p(),T}catch(e){throw p(),e}}globalThis.ubq_browserTabHidden=!0;var Se,ke,xe={value:()=>"undefined"==typeof document||"visible"===document.visibilityState,subscribe(e){if("undefined"==typeof document)return()=>{};{const t=()=>{e("visible"===document.visibilityState)};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}}}};if((ke=Se||(Se={})).start=function(e){return{...e,msg:"exportVideo"}},ke.abort=function(){return{msg:"exportVideoAbort"}},ke.finished=function(e){return{...e,msg:"exportVideoFinished"}},ke.error=function(e){return{...e,msg:"exportVideoError"}},ke.progress=function(e){return{...e,msg:"exportVideoProgress"}},ke.log=function(e){return{...e,msg:"exportLog"}},"undefined"!=typeof WorkerGlobalScope){const e=function(e){let t=b;const r=function(e,t){const r=new Set;function n(n){return r.add(n),e?.(((e,...t)=>{n(e);for(const e of t)n(e)})),()=>{r.delete(n),t?.()}}return n.emit=function(e,...t){for(const n of r){n(e);for(const e of t)n(e)}},n.handlers=r,n}();return{subscribe:r,value:()=>(t===b&&(t=e()),t),update(e){t=e,r.emit(t)}}}((()=>!0)),t=new AbortController;self.onmessage=async({data:r})=>{const n=(e,t)=>{self.postMessage(Se.log({logLevel:t,message:e}))};"setVisibility"===r.msg?e.update(r.visible):"exportVideo"===r.msg?Ce({...r.config,logger:n,abortSignal:t.signal},r.engineSettings,r.pluginURLs,r.sceneString,r.exportOptions,{onProgress:(e,t,r)=>{self.postMessage(Se.progress({renderedFrames:e,encodedFrames:t,totalFrames:r}))},visibility:e,inactivityTimeout:r.inactivityTimeout}).then((e=>{self.postMessage(Se.finished({data:e,mimeType:E.Mp4}))}),(e=>{self.postMessage(Se.error({error:e}))})):"exportVideoAbort"===r.msg&&t.abort()}}
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
ieee754/index.js:
|
|
5
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
6
|
-
|
|
7
|
-
buffer/index.js:
|
|
8
|
-
(*!
|
|
9
|
-
* The buffer module from node.js, for the browser.
|
|
10
|
-
*
|
|
11
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12
|
-
* @license MIT
|
|
13
|
-
*)
|
|
14
|
-
*/
|