@cesdk/engine 1.20.0-rc.0 → 1.20.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.20.0-rc.0-OXMA3Z6S.wasm → cesdk-v1.20.0-rc.1-PVCJXNLE.wasm} +0 -0
- package/assets/core/worker-host-v1.20.0-rc.1-HLK2ZNSZ.js +14 -0
- package/index.d.ts +6 -4
- package/index.js +1 -1
- package/integrations/react.js +1 -1
- package/package.json +1 -1
- package/assets/core/worker-host-v1.20.0-rc.0-GRE6CDSD.js +0 -14
- /package/assets/core/{cesdk-v1.20.0-rc.0-DTDUIA7U.data → cesdk-v1.20.0-rc.1-DTDUIA7U.data} +0 -0
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJS=(e,t)=>function(){return t||(0,e[__getOwnPropNames(e)[0]])((t={exports:{}}).exports,t),t.exports},__copyProps=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames(t))__hasOwnProp.call(e,o)||o===r||__defProp(e,o,{get:()=>t[o],enumerable:!(n=__getOwnPropDesc(t,o))||n.enumerable});return e},__toESM=(e,t,r)=>(r=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?r:__defProp(r,"default",{value:e,enumerable:!0}),e)),__decorateClass=(e,t,r,n)=>{for(var o,s=n>1?void 0:n?__getOwnPropDesc(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n?o(t,r,s):o(s))||s);return n&&s&&__defProp(t,r,s),s},require_isObject=__commonJS({"../../../node_modules/lodash/isObject.js"(e,t){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}}),require_freeGlobal=__commonJS({"../../../node_modules/lodash/_freeGlobal.js"(e,t){var r="object"==typeof global&&global&&global.Object===Object&&global;t.exports=r}}),require_root=__commonJS({"../../../node_modules/lodash/_root.js"(e,t){var r=require_freeGlobal(),n="object"==typeof self&&self&&self.Object===Object&&self,o=r||n||Function("return this")();t.exports=o}}),require_now=__commonJS({"../../../node_modules/lodash/now.js"(e,t){var r=require_root();t.exports=function(){return r.Date.now()}}}),require_trimmedEndIndex=__commonJS({"../../../node_modules/lodash/_trimmedEndIndex.js"(e,t){var r=/\s/;t.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}}}),require_baseTrim=__commonJS({"../../../node_modules/lodash/_baseTrim.js"(e,t){var r=require_trimmedEndIndex(),n=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(n,""):e}}}),require_Symbol=__commonJS({"../../../node_modules/lodash/_Symbol.js"(e,t){var r=require_root().Symbol;t.exports=r}}),require_getRawTag=__commonJS({"../../../node_modules/lodash/_getRawTag.js"(e,t){var r=require_Symbol(),n=Object.prototype,o=n.hasOwnProperty,s=n.toString,a=r?r.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}}}),require_objectToString=__commonJS({"../../../node_modules/lodash/_objectToString.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}}}),require_baseGetTag=__commonJS({"../../../node_modules/lodash/_baseGetTag.js"(e,t){var r=require_Symbol(),n=require_getRawTag(),o=require_objectToString(),s=r?r.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?n(e):o(e)}}}),require_isObjectLike=__commonJS({"../../../node_modules/lodash/isObjectLike.js"(e,t){t.exports=function(e){return null!=e&&"object"==typeof e}}}),require_isSymbol=__commonJS({"../../../node_modules/lodash/isSymbol.js"(e,t){var r=require_baseGetTag(),n=require_isObjectLike();t.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==r(e)}}}),require_toNumber=__commonJS({"../../../node_modules/lodash/toNumber.js"(e,t){var r=require_baseTrim(),n=require_isObject(),o=require_isSymbol(),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var c=a.test(e);return c||i.test(e)?u(e.slice(2),c?2:8):s.test(e)?NaN:+e}}}),require_debounce=__commonJS({"../../../node_modules/lodash/debounce.js"(e,t){var r=require_isObject(),n=require_now(),o=require_toNumber(),s=Math.max,a=Math.min;t.exports=function(e,t,i){var u,c,l,d,p,f,h=0,g=!1,m=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var r=u,n=c;return u=c=void 0,h=t,d=e.apply(n,r)}function _(e){var r=e-f;return void 0===f||r>=t||r<0||m&&e-h>=l}function v(){var e=n();if(_(e))return k(e);p=setTimeout(v,function(e){var r=t-(e-f);return m?a(r,l-(e-h)):r}(e))}function k(e){return p=void 0,y&&u?b(e):(u=c=void 0,d)}function w(){var e=n(),r=_(e);if(u=arguments,c=this,f=e,r){if(void 0===p)return function(e){return h=e,p=setTimeout(v,t),g?b(e):d}(f);if(m)return clearTimeout(p),p=setTimeout(v,t),b(f)}return void 0===p&&(p=setTimeout(v,t)),d}return t=o(t)||0,r(i)&&(g=!!i.leading,l=(m="maxWait"in i)?s(o(i.maxWait)||0,t):l,y="trailing"in i?!!i.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=f=c=p=void 0},w.flush=function(){return void 0===p?d:k(n())},w}}}),require_listCacheClear=__commonJS({"../../../node_modules/lodash/_listCacheClear.js"(e,t){t.exports=function(){this.__data__=[],this.size=0}}}),require_eq=__commonJS({"../../../node_modules/lodash/eq.js"(e,t){t.exports=function(e,t){return e===t||e!=e&&t!=t}}}),require_assocIndexOf=__commonJS({"../../../node_modules/lodash/_assocIndexOf.js"(e,t){var r=require_eq();t.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}}}),require_listCacheDelete=__commonJS({"../../../node_modules/lodash/_listCacheDelete.js"(e,t){var r=require_assocIndexOf(),n=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=r(t,e);return!(o<0)&&(o==t.length-1?t.pop():n.call(t,o,1),--this.size,!0)}}}),require_listCacheGet=__commonJS({"../../../node_modules/lodash/_listCacheGet.js"(e,t){var r=require_assocIndexOf();t.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}}}),require_listCacheHas=__commonJS({"../../../node_modules/lodash/_listCacheHas.js"(e,t){var r=require_assocIndexOf();t.exports=function(e){return r(this.__data__,e)>-1}}}),require_listCacheSet=__commonJS({"../../../node_modules/lodash/_listCacheSet.js"(e,t){var r=require_assocIndexOf();t.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}}}),require_ListCache=__commonJS({"../../../node_modules/lodash/_ListCache.js"(e,t){var r=require_listCacheClear(),n=require_listCacheDelete(),o=require_listCacheGet(),s=require_listCacheHas(),a=require_listCacheSet();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}i.prototype.clear=r,i.prototype.delete=n,i.prototype.get=o,i.prototype.has=s,i.prototype.set=a,t.exports=i}}),require_stackClear=__commonJS({"../../../node_modules/lodash/_stackClear.js"(e,t){var r=require_ListCache();t.exports=function(){this.__data__=new r,this.size=0}}}),require_stackDelete=__commonJS({"../../../node_modules/lodash/_stackDelete.js"(e,t){t.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}}}),require_stackGet=__commonJS({"../../../node_modules/lodash/_stackGet.js"(e,t){t.exports=function(e){return this.__data__.get(e)}}}),require_stackHas=__commonJS({"../../../node_modules/lodash/_stackHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),require_isFunction=__commonJS({"../../../node_modules/lodash/isFunction.js"(e,t){var r=require_baseGetTag(),n=require_isObject();t.exports=function(e){if(!n(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}}}),require_coreJsData=__commonJS({"../../../node_modules/lodash/_coreJsData.js"(e,t){var r=require_root()["__core-js_shared__"];t.exports=r}}),require_isMasked=__commonJS({"../../../node_modules/lodash/_isMasked.js"(e,t){var r,n=require_coreJsData(),o=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!o&&o in e}}}),require_toSource=__commonJS({"../../../node_modules/lodash/_toSource.js"(e,t){var r=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}}}),require_baseIsNative=__commonJS({"../../../node_modules/lodash/_baseIsNative.js"(e,t){var r=require_isFunction(),n=require_isMasked(),o=require_isObject(),s=require_toSource(),a=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,c=i.toString,l=u.hasOwnProperty,d=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||n(e))&&(r(e)?d:a).test(s(e))}}}),require_getValue=__commonJS({"../../../node_modules/lodash/_getValue.js"(e,t){t.exports=function(e,t){return null==e?void 0:e[t]}}}),require_getNative=__commonJS({"../../../node_modules/lodash/_getNative.js"(e,t){var r=require_baseIsNative(),n=require_getValue();t.exports=function(e,t){var o=n(e,t);return r(o)?o:void 0}}}),require_Map=__commonJS({"../../../node_modules/lodash/_Map.js"(e,t){var r=require_getNative()(require_root(),"Map");t.exports=r}}),require_nativeCreate=__commonJS({"../../../node_modules/lodash/_nativeCreate.js"(e,t){var r=require_getNative()(Object,"create");t.exports=r}}),require_hashClear=__commonJS({"../../../node_modules/lodash/_hashClear.js"(e,t){var r=require_nativeCreate();t.exports=function(){this.__data__=r?r(null):{},this.size=0}}}),require_hashDelete=__commonJS({"../../../node_modules/lodash/_hashDelete.js"(e,t){t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}}}),require_hashGet=__commonJS({"../../../node_modules/lodash/_hashGet.js"(e,t){var r=require_nativeCreate(),n=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(r){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(t,e)?t[e]:void 0}}}),require_hashHas=__commonJS({"../../../node_modules/lodash/_hashHas.js"(e,t){var r=require_nativeCreate(),n=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:n.call(t,e)}}}),require_hashSet=__commonJS({"../../../node_modules/lodash/_hashSet.js"(e,t){var r=require_nativeCreate();t.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}}}),require_Hash=__commonJS({"../../../node_modules/lodash/_Hash.js"(e,t){var r=require_hashClear(),n=require_hashDelete(),o=require_hashGet(),s=require_hashHas(),a=require_hashSet();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}i.prototype.clear=r,i.prototype.delete=n,i.prototype.get=o,i.prototype.has=s,i.prototype.set=a,t.exports=i}}),require_mapCacheClear=__commonJS({"../../../node_modules/lodash/_mapCacheClear.js"(e,t){var r=require_Hash(),n=require_ListCache(),o=require_Map();t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||n),string:new r}}}}),require_isKeyable=__commonJS({"../../../node_modules/lodash/_isKeyable.js"(e,t){t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}}}),require_getMapData=__commonJS({"../../../node_modules/lodash/_getMapData.js"(e,t){var r=require_isKeyable();t.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}}}),require_mapCacheDelete=__commonJS({"../../../node_modules/lodash/_mapCacheDelete.js"(e,t){var r=require_getMapData();t.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}}}),require_mapCacheGet=__commonJS({"../../../node_modules/lodash/_mapCacheGet.js"(e,t){var r=require_getMapData();t.exports=function(e){return r(this,e).get(e)}}}),require_mapCacheHas=__commonJS({"../../../node_modules/lodash/_mapCacheHas.js"(e,t){var r=require_getMapData();t.exports=function(e){return r(this,e).has(e)}}}),require_mapCacheSet=__commonJS({"../../../node_modules/lodash/_mapCacheSet.js"(e,t){var r=require_getMapData();t.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}}}),require_MapCache=__commonJS({"../../../node_modules/lodash/_MapCache.js"(e,t){var r=require_mapCacheClear(),n=require_mapCacheDelete(),o=require_mapCacheGet(),s=require_mapCacheHas(),a=require_mapCacheSet();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}i.prototype.clear=r,i.prototype.delete=n,i.prototype.get=o,i.prototype.has=s,i.prototype.set=a,t.exports=i}}),require_stackSet=__commonJS({"../../../node_modules/lodash/_stackSet.js"(e,t){var r=require_ListCache(),n=require_Map(),o=require_MapCache();t.exports=function(e,t){var s=this.__data__;if(s instanceof r){var a=s.__data__;if(!n||a.length<199)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new o(a)}return s.set(e,t),this.size=s.size,this}}}),require_Stack=__commonJS({"../../../node_modules/lodash/_Stack.js"(e,t){var r=require_ListCache(),n=require_stackClear(),o=require_stackDelete(),s=require_stackGet(),a=require_stackHas(),i=require_stackSet();function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=a,u.prototype.set=i,t.exports=u}}),require_setCacheAdd=__commonJS({"../../../node_modules/lodash/_setCacheAdd.js"(e,t){t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}}),require_setCacheHas=__commonJS({"../../../node_modules/lodash/_setCacheHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),require_SetCache=__commonJS({"../../../node_modules/lodash/_SetCache.js"(e,t){var r=require_MapCache(),n=require_setCacheAdd(),o=require_setCacheHas();function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=n,s.prototype.has=o,t.exports=s}}),require_arraySome=__commonJS({"../../../node_modules/lodash/_arraySome.js"(e,t){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}}}),require_cacheHas=__commonJS({"../../../node_modules/lodash/_cacheHas.js"(e,t){t.exports=function(e,t){return e.has(t)}}}),require_equalArrays=__commonJS({"../../../node_modules/lodash/_equalArrays.js"(e,t){var r=require_SetCache(),n=require_arraySome(),o=require_cacheHas();t.exports=function(e,t,s,a,i,u){var c=1&s,l=e.length,d=t.length;if(l!=d&&!(c&&d>l))return!1;var p=u.get(e),f=u.get(t);if(p&&f)return p==t&&f==e;var h=-1,g=!0,m=2&s?new r:void 0;for(u.set(e,t),u.set(t,e);++h<l;){var y=e[h],b=t[h];if(a)var _=c?a(b,y,h,t,e,u):a(y,b,h,e,t,u);if(void 0!==_){if(_)continue;g=!1;break}if(m){if(!n(t,(function(e,t){if(!o(m,t)&&(y===e||i(y,e,s,a,u)))return m.push(t)}))){g=!1;break}}else if(y!==b&&!i(y,b,s,a,u)){g=!1;break}}return u.delete(e),u.delete(t),g}}}),require_Uint8Array=__commonJS({"../../../node_modules/lodash/_Uint8Array.js"(e,t){var r=require_root().Uint8Array;t.exports=r}}),require_mapToArray=__commonJS({"../../../node_modules/lodash/_mapToArray.js"(e,t){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}}}),require_setToArray=__commonJS({"../../../node_modules/lodash/_setToArray.js"(e,t){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}}}),require_equalByTag=__commonJS({"../../../node_modules/lodash/_equalByTag.js"(e,t){var r=require_Symbol(),n=require_Uint8Array(),o=require_eq(),s=require_equalArrays(),a=require_mapToArray(),i=require_setToArray(),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;t.exports=function(e,t,r,u,l,d,p){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new n(e),new n(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var h=1&u;if(f||(f=i),e.size!=t.size&&!h)return!1;var g=p.get(e);if(g)return g==t;u|=2,p.set(e,t);var m=s(f(e),f(t),u,l,d,p);return p.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}}}),require_arrayPush=__commonJS({"../../../node_modules/lodash/_arrayPush.js"(e,t){t.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}}}),require_isArray=__commonJS({"../../../node_modules/lodash/isArray.js"(e,t){var r=Array.isArray;t.exports=r}}),require_baseGetAllKeys=__commonJS({"../../../node_modules/lodash/_baseGetAllKeys.js"(e,t){var r=require_arrayPush(),n=require_isArray();t.exports=function(e,t,o){var s=t(e);return n(e)?s:r(s,o(e))}}}),require_arrayFilter=__commonJS({"../../../node_modules/lodash/_arrayFilter.js"(e,t){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[o++]=a)}return s}}}),require_stubArray=__commonJS({"../../../node_modules/lodash/stubArray.js"(e,t){t.exports=function(){return[]}}}),require_getSymbols=__commonJS({"../../../node_modules/lodash/_getSymbols.js"(e,t){var r=require_arrayFilter(),n=require_stubArray(),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return o.call(e,t)})))}:n;t.exports=a}}),require_baseTimes=__commonJS({"../../../node_modules/lodash/_baseTimes.js"(e,t){t.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}}}),require_baseIsArguments=__commonJS({"../../../node_modules/lodash/_baseIsArguments.js"(e,t){var r=require_baseGetTag(),n=require_isObjectLike();t.exports=function(e){return n(e)&&"[object Arguments]"==r(e)}}}),require_isArguments=__commonJS({"../../../node_modules/lodash/isArguments.js"(e,t){var r=require_baseIsArguments(),n=require_isObjectLike(),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(e){return n(e)&&s.call(e,"callee")&&!a.call(e,"callee")};t.exports=i}}),require_stubFalse=__commonJS({"../../../node_modules/lodash/stubFalse.js"(e,t){t.exports=function(){return!1}}}),require_isBuffer=__commonJS({"../../../node_modules/lodash/isBuffer.js"(e,t){var r=require_root(),n=require_stubFalse(),o="object"==typeof e&&e&&!e.nodeType&&e,s=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===o?r.Buffer:void 0,i=(a?a.isBuffer:void 0)||n;t.exports=i}}),require_isIndex=__commonJS({"../../../node_modules/lodash/_isIndex.js"(e,t){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<t}}}),require_isLength=__commonJS({"../../../node_modules/lodash/isLength.js"(e,t){t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}}),require_baseIsTypedArray=__commonJS({"../../../node_modules/lodash/_baseIsTypedArray.js"(e,t){var r=require_baseGetTag(),n=require_isLength(),o=require_isObjectLike(),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&n(e.length)&&!!s[r(e)]}}}),require_baseUnary=__commonJS({"../../../node_modules/lodash/_baseUnary.js"(e,t){t.exports=function(e){return function(t){return e(t)}}}}),require_nodeUtil=__commonJS({"../../../node_modules/lodash/_nodeUtil.js"(e,t){var r=require_freeGlobal(),n="object"==typeof e&&e&&!e.nodeType&&e,o=n&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===n&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();t.exports=a}}),require_isTypedArray=__commonJS({"../../../node_modules/lodash/isTypedArray.js"(e,t){var r=require_baseIsTypedArray(),n=require_baseUnary(),o=require_nodeUtil(),s=o&&o.isTypedArray,a=s?n(s):r;t.exports=a}}),require_arrayLikeKeys=__commonJS({"../../../node_modules/lodash/_arrayLikeKeys.js"(e,t){var r=require_baseTimes(),n=require_isArguments(),o=require_isArray(),s=require_isBuffer(),a=require_isIndex(),i=require_isTypedArray(),u=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),l=!c&&n(e),d=!c&&!l&&s(e),p=!c&&!l&&!d&&i(e),f=c||l||d||p,h=f?r(e.length,String):[],g=h.length;for(var m in e)!t&&!u.call(e,m)||f&&("length"==m||d&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g))||h.push(m);return h}}}),require_isPrototype=__commonJS({"../../../node_modules/lodash/_isPrototype.js"(e,t){var r=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}}}),require_overArg=__commonJS({"../../../node_modules/lodash/_overArg.js"(e,t){t.exports=function(e,t){return function(r){return e(t(r))}}}}),require_nativeKeys=__commonJS({"../../../node_modules/lodash/_nativeKeys.js"(e,t){var r=require_overArg()(Object.keys,Object);t.exports=r}}),require_baseKeys=__commonJS({"../../../node_modules/lodash/_baseKeys.js"(e,t){var r=require_isPrototype(),n=require_nativeKeys(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return n(e);var t=[];for(var s in Object(e))o.call(e,s)&&"constructor"!=s&&t.push(s);return t}}}),require_isArrayLike=__commonJS({"../../../node_modules/lodash/isArrayLike.js"(e,t){var r=require_isFunction(),n=require_isLength();t.exports=function(e){return null!=e&&n(e.length)&&!r(e)}}}),require_keys=__commonJS({"../../../node_modules/lodash/keys.js"(e,t){var r=require_arrayLikeKeys(),n=require_baseKeys(),o=require_isArrayLike();t.exports=function(e){return o(e)?r(e):n(e)}}}),require_getAllKeys=__commonJS({"../../../node_modules/lodash/_getAllKeys.js"(e,t){var r=require_baseGetAllKeys(),n=require_getSymbols(),o=require_keys();t.exports=function(e){return r(e,o,n)}}}),require_equalObjects=__commonJS({"../../../node_modules/lodash/_equalObjects.js"(e,t){var r=require_getAllKeys(),n=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,s,a,i){var u=1&o,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var d=l;d--;){var p=c[d];if(!(u?p in t:n.call(t,p)))return!1}var f=i.get(e),h=i.get(t);if(f&&h)return f==t&&h==e;var g=!0;i.set(e,t),i.set(t,e);for(var m=u;++d<l;){var y=e[p=c[d]],b=t[p];if(s)var _=u?s(b,y,p,t,e,i):s(y,b,p,e,t,i);if(!(void 0===_?y===b||a(y,b,o,s,i):_)){g=!1;break}m||(m="constructor"==p)}if(g&&!m){var v=e.constructor,k=t.constructor;v==k||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof k&&k instanceof k||(g=!1)}return i.delete(e),i.delete(t),g}}}),require_DataView=__commonJS({"../../../node_modules/lodash/_DataView.js"(e,t){var r=require_getNative()(require_root(),"DataView");t.exports=r}}),require_Promise=__commonJS({"../../../node_modules/lodash/_Promise.js"(e,t){var r=require_getNative()(require_root(),"Promise");t.exports=r}}),require_Set=__commonJS({"../../../node_modules/lodash/_Set.js"(e,t){var r=require_getNative()(require_root(),"Set");t.exports=r}}),require_WeakMap=__commonJS({"../../../node_modules/lodash/_WeakMap.js"(e,t){var r=require_getNative()(require_root(),"WeakMap");t.exports=r}}),require_getTag=__commonJS({"../../../node_modules/lodash/_getTag.js"(e,t){var r=require_DataView(),n=require_Map(),o=require_Promise(),s=require_Set(),a=require_WeakMap(),i=require_baseGetTag(),u=require_toSource(),c="[object Map]",l="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",h=u(r),g=u(n),m=u(o),y=u(s),b=u(a),_=i;(r&&_(new r(new ArrayBuffer(1)))!=f||n&&_(new n)!=c||o&&_(o.resolve())!=l||s&&_(new s)!=d||a&&_(new a)!=p)&&(_=function(e){var t=i(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case h:return f;case g:return c;case m:return l;case y:return d;case b:return p}return t}),t.exports=_}}),require_baseIsEqualDeep=__commonJS({"../../../node_modules/lodash/_baseIsEqualDeep.js"(e,t){var r=require_Stack(),n=require_equalArrays(),o=require_equalByTag(),s=require_equalObjects(),a=require_getTag(),i=require_isArray(),u=require_isBuffer(),c=require_isTypedArray(),l="[object Arguments]",d="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;t.exports=function(e,t,h,g,m,y){var b=i(e),_=i(t),v=b?d:a(e),k=_?d:a(t),w=(v=v==l?p:v)==p,C=(k=k==l?p:k)==p,E=v==k;if(E&&u(e)){if(!u(t))return!1;b=!0,w=!1}if(E&&!w)return y||(y=new r),b||c(e)?n(e,t,h,g,m,y):o(e,t,v,h,g,m,y);if(!(1&h)){var A=w&&f.call(e,"__wrapped__"),S=C&&f.call(t,"__wrapped__");if(A||S){var P=A?e.value():e,x=S?t.value():t;return y||(y=new r),m(P,x,h,g,y)}}return!!E&&(y||(y=new r),s(e,t,h,g,m,y))}}}),require_baseIsEqual=__commonJS({"../../../node_modules/lodash/_baseIsEqual.js"(e,t){var r=require_baseIsEqualDeep(),n=require_isObjectLike();t.exports=function e(t,o,s,a,i){return t===o||(null==t||null==o||!n(t)&&!n(o)?t!=t&&o!=o:r(t,o,s,a,e,i))}}}),require_isEqual=__commonJS({"../../../node_modules/lodash/isEqual.js"(e,t){var r=require_baseIsEqual();t.exports=function(e,t){return r(e,t)}}}),require_base64_js=__commonJS({"../../../node_modules/base64-js/index.js"(e){"use strict";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,s=a(e),i=s[0],u=s[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,u)),l=0,d=u>0?i-4:i;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,s=[],a=16383,u=0,c=n-o;u<c;u+=a)s.push(i(e,u,u+a>c?c:u+a));1===o?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};var t,r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,64;t<64;++t)r[t]=s[t],n[s.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 i(e,t,n){for(var o,s,a=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(r[(s=o)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),require_ieee754=__commonJS({"../../../node_modules/ieee754/index.js"(e){e.read=function(e,t,r,n,o){var s,a,i=8*o-n-1,u=(1<<i)-1,c=u>>1,l=-7,d=r?o-1:0,p=r?-1:1,f=e[t+d];for(d+=p,s=f&(1<<-l)-1,f>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=p,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=n;l>0;a=256*a+e[t+d],d+=p,l-=8);if(0===s)s=1-c;else{if(s===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=c}return(f?-1:1)*a*Math.pow(2,s-n)},e.write=function(e,t,r,n,o,s){var a,i,u,c=8*s-o-1,l=(1<<c)-1,d=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=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?p/u:p*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(i=0,a=l):a+d>=1?(i=(t*u-1)*Math.pow(2,o),a+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+f]=255&i,f+=h,i/=256,o-=8);for(a=a<<o|i,c+=o;c>0;e[r+f]=255&a,f+=h,a/=256,c-=8);e[r+f-h]|=128*g}}}),require_buffer=__commonJS({"../../../node_modules/buffer/index.js"(e){"use strict";var t=require_base64_js(),r=require_ieee754(),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 s(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 i(e,t,r)}function i(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|f(e,t),n=s(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(j(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(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(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|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||U(e.length)?s(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),s(e<0?0:0|p(e))}function l(e){for(var t=e.length<0?0:0|p(e.length),r=s(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 p(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(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 D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(e).length;default:if(o)return n?-1:D(e).length;t=(""+t).toLowerCase(),o=!0}}function h(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 x(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(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),U(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:y(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):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var s,a=1,i=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,i/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(s=r;s<i;s++)if(c(e,s)===c(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(r+u>i&&(r=i-u),s=r;s>=0;s--){for(var d=!0,p=0;p<u;p++)if(c(e,s+p)!==c(t,p)){d=!1;break}if(d)return s}return-1}function b(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var i=parseInt(t.substr(2*a,2),16);if(U(i))return a;e[r+a]=i}return a}function _(e,t,r,n){return O(D(t,e.length-r),e,r,n)}function v(e,t,r,n){return O(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return O(M(t),e,r,n)}function w(e,t,r,n){return O(function(e,t){for(var r,n,o,s=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,s.push(o),s.push(n);return s}(t,e.length-r),e,r,n)}function C(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var s,a,i,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&(s=e[o+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=e[o+1],a=e[o+2],128==(192&s)&&128==(192&a)&&(u=(15&c)<<12|(63&s)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=e[o+1],a=e[o+2],i=e[o+3],128==(192&s)&&128==(192&a)&&128==(192&i)&&(u=(15&c)<<18|(63&s)<<12|(63&a)<<6|63&i)>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 i(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?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(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(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),j(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,s=Math.min(r,n);o<s;++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 s=e[r];if(j(s,Uint8Array))o+s.length>n.length?a.from(s).copy(n,o):Uint8Array.prototype.set.call(n,s,o);else{if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o)}o+=s.length}return n},a.byteLength=f,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)g(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)g(this,t,t+3),g(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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):h.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(j(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 s=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),u=Math.min(s,i),c=this.slice(n,o),l=e.slice(t,r),d=0;d<u;++d)if(c[d]!==l[d]){s=c[d],i=l[d];break}return s<i?-1:i<s?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(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 s=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function S(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 x(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",s=t;s<r;++s)o+=V[e[s]];return o}function q(e,t,r){for(var n=e.slice(t,r),o="",s=0;s<n.length-1;s+=2)o+=String.fromCharCode(n[s]+256*n[s+1]);return o}function R(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 T(e,t,r,n,o,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,o,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(e,t,n,o,s){return t=+t,n>>>=0,s||B(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function L(e,t,n,o,s){return t=+t,n>>>=0,s||B(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||R(e,t,this.length);for(var n=this[e],o=1,s=0;++s<t&&(o*=256);)n+=this[e+s]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(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||R(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(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||R(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||R(e,t,this.length);for(var n=this[e],o=1,s=0;++s<t&&(o*=256);)n+=this[e+s]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,o=1,s=this[e+--n];n>0&&(o*=256);)s+=this[e+--n]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||R(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||R(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||R(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||R(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||R(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(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)||T(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||T(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(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||T(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||T(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||T(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||T(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);T(this,e,t,r,o-1,-o)}var s=0,a=1,i=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/a>>0)-i&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);T(this,e,t,r,o-1,-o)}var s=r-1,a=1,i=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/a>>0)-i&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(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||T(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||T(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||T(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||T(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 I(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return L(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 s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var i=a.isBuffer(e)?e:a.from(e,n),u=i.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=i[s%u]}return this};var F=/[^+/0-9A-Za-z-_]/g;function D(e,t){var r;t=t||1/0;for(var n=e.length,o=null,s=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function M(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(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 j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function U(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}()}}),require_toFinite=__commonJS({"../../../node_modules/lodash/toFinite.js"(e,t){var r=require_toNumber(),n=1/0;t.exports=function(e){return e?(e=r(e))===n||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}}),require_toInteger=__commonJS({"../../../node_modules/lodash/toInteger.js"(e,t){var r=require_toFinite();t.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}}}),require_before=__commonJS({"../../../node_modules/lodash/before.js"(e,t){var r=require_toInteger();t.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}}}),require_once=__commonJS({"../../../node_modules/lodash/once.js"(e,t){var r=require_before();t.exports=function(e){return r(2,e)}}}),require_polyfill_noop=__commonJS({"../../../esbuild/polyfill.noop.js"(){}}),require_cesdk=__commonJS({"../../../_builds/cesdk/wasm32-unknown-emscripten/Release/cesdk.js"(e,t){"use strict";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,s,a,i,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 s=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),s},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 s=e[o],a=r(s);n.set(a,2*(t+o))}}},{get(t,r,o){if("string"!=typeof r||!/^\d+$/.test(r))return Reflect.get(t,r,o);var s=n[2*r],a=n[2*r+1];return e(s,a)},set(e,t,o,s){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,o,s);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&&s.set(o),s}};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,C("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,s=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 i(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 s=e.files,a=0;a<s.length;++a)r.prototype.requests[s[a].filename].onload();u.removeRunDependency("datafile_cesdk.data")}u.addRunDependency("datafile_cesdk.data"),u.preloadResults||(u.preloadResults={}),u.preloadResults["cesdk.data"]={fromCache:!1},s?(i(s),s=null):o=i}s||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,s=t;if(r.total&&(s=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:s});var a=0,i=0,c=0;for(var l in u.dataFileDownloads){var d=u.dataFileDownloads[l];a+=d.total,i+=d.loaded,c++}a=Math.ceil(a*u.expectedDataFileDownloads/c),u.setStatus&&u.setStatus(`Downloading data... (${i}/${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 require_polyfill_noop().readFile(e,(function(e,t){e?n(e):r(t.buffer)}))}(r,n,(function(e){o?(o(e),o=null):s=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/icudt71l.dat",start:275745,end:710017},{filename:"/ly.img.cesdk/presets/.keep",start:710017,end:710017},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:710017,end:713906},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:713906,end:720223},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:720223,end:724814},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:724814,end:734799},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:734799,end:735289},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:735289,end:738456},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:738456,end:741094},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:741094,end:742041},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:742041,end:742556},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:742556,end:743520},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:743520,end:745637},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:745637,end:746604},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:746604,end:747098},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:747098,end:760698},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:760698,end:761483},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:761483,end:761965},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:761965,end:764828},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:764828,end:765333},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:765333,end:765787},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:765787,end:767424},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:767424,end:767724},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:767724,end:768412},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:768412,end:768624},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:768624,end:769187},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:769187,end:771492},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:771492,end:772176},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:772176,end:772758},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:772758,end:773476},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:773476,end:773848}],remote_package_size:773848}),"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(){}},(s=o||(o={}))[s.PENDING=0]="PENDING",s[s.FINISHED=1]="FINISHED",s[s.ALLOCATED=2]="ALLOCATED",s[s.ERROR=3]="ERROR",(i=a||(a={}))[i.GET=0]="GET",i[i.POST=1]="POST";class FetchProcess{constructor(e,t){this.state=o.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t}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;n(r)}}else await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}));const o=new Uint8Array(t);let s=0;for(const e of r)o.set(e,s),s+=e.length;return this.finish(o)}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){return this._processes.delete(e)}fetch(e,t,r,n,o,s,a,i,c){const l=u.UTF8ToString(t,r),d=this._nextHandle++,p=new FetchProcess(d,l);return this._processes.set(d,p),l.match(/^file:/)?this._fetchFile(p).catch((e=>(p.fail(e),Promise.reject(e)))):this._fetchRemote(p,e,n,o,s,a,i,c).catch((e=>(p.fail(e),Promise.reject(e)))),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=require_polyfill_noop(),{fileURLToPath:r}=require_polyfill_noop(),n=t.createReadStream(r(e.uri));return e.readChunks(n)}async _fetchRemote(e,t,r,n,o,s,i,c){const l=u.UTF8ToString(i,c),d=this.getHeaders(r,n),p=t===a.POST?new Uint8Array(u.HEAPU8.buffer,o,s):void 0,f=await this._fetch(e.uri,{method:a[t],headers:d,body:p,mode:"cors",credentials:l});if(f.status>=200&&f.status<=209){let t=0;return f.headers.has("Content-Length")&&(t=+f.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(f.body)}return e.fail(f.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),s=u.UTF8ToString(r,n),a=this._nextHeaderHandle++;return this._headers.set(a,{key:o,value:s}),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 s=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=o.length)&&(s=!0),!s){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,s,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 s=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),i=1===o.numberOfChannels?0:1;if("f32-planar"===o.format){let e=n.writtenFrames%r;if(e+o.numberOfFrames<=r)o.copyTo(s.subarray(e),{planeIndex:0,frameCount:o.numberOfFrames}),o.copyTo(a.subarray(e),{planeIndex:i,frameCount:o.numberOfFrames});else{const t=r-e;o.copyTo(s.subarray(e),{planeIndex:0,frameCount:t}),o.copyTo(a.subarray(e),{planeIndex:i,frameCount:t}),o.copyTo(s,{planeIndex:0,frameOffset:t}),o.copyTo(a,{planeIndex:i,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 i=n.writtenFrames%r;s[i]=o,a[i]=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 i=0;i<o.numberOfFrames;i++){let o=n.writtenFrames%r;s[o]=e[i]/32768,a[o]=t[i]/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 i=n.writtenFrames%r;s[i]=o,a[i]=o,n.writtenFrames++}else for(let t=0;t<o.numberOfFrames;t++){let i=n.writtenFrames%r;s[i]=e[t*o.numberOfChannels+0]/32768,a[i]=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,p=Object.assign({},u),f="./this.program",h=(e,t)=>{throw t},g="object"==typeof window,m="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,b="";if(y){var _=require_polyfill_noop(),v=require_polyfill_noop();b=m?v.dirname(b)+"/":__dirname+"/",c=(e,t)=>(e=oe(e)?new URL(e):v.normalize(e),_.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=oe(e)?new URL(e):v.normalize(e),_.readFile(e,n?void 0:"utf8",((e,o)=>{e?r(e):t(n?o.buffer:o)}))},!u.thisProgram&&process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),h=(e,t)=>{throw process.exitCode=e,t},u.inspect=()=>"[Emscripten Module object]"}else(g||m)&&(m?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),r&&(b=r),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(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 k,w=u.print||console.log.bind(console),C=u.printErr||console.error.bind(console);Object.assign(u,p),p=null,u.arguments&&u.arguments,u.thisProgram&&(f=u.thisProgram),u.quit&&(h=u.quit),u.wasmBinary&&(k=u.wasmBinary);var E,A,S=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&Q("no native wasm support detected");var P,x,q,R,T,B,I,L,F,D,M,O=!1;function j(e,t){e||Q(t)}function U(){var e=E.buffer;u.HEAP8=x=new Int8Array(e),u.HEAP16=R=new Int16Array(e),u.HEAP32=B=new Int32Array(e),u.HEAPU8=q=new Uint8Array(e),u.HEAPU16=T=new Uint16Array(e),u.HEAPU32=I=new Uint32Array(e),u.HEAPF32=L=new Float32Array(e),u.HEAPF64=M=new Float64Array(e),u.HEAP64=F=new BigInt64Array(e),u.HEAPU64=D=new BigUint64Array(e)}var V,H=u.INITIAL_MEMORY||16777216;j(H>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+H+"! (STACK_SIZE=65536)"),E=u.wasmMemory?u.wasmMemory:new WebAssembly.Memory({initial:H/65536,maximum:32768}),U(),H=E.buffer.byteLength;var N=[],$=[],z=[],W=[];function G(){return S||!1}var Y=0,X=null,J=null;function K(e){Y++,u.monitorRunDependencies&&u.monitorRunDependencies(Y)}function Z(e){if(Y--,u.monitorRunDependencies&&u.monitorRunDependencies(Y),0==Y&&(null!==X&&(clearInterval(X),X=null),J)){var t=J;J=null,t()}}function Q(e){u.onAbort&&u.onAbort(e),C(e="Aborted("+e+")"),O=!0,P=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var ee,te,re="data:application/octet-stream;base64,";function ne(e){return e.startsWith(re)}function oe(e){return e.startsWith("file://")}function se(e){if(e==ee&&k)return new Uint8Array(k);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function ae(e,t,r){return function(e){return k||!g&&!m||"function"!=typeof fetch?Promise.resolve().then((()=>se(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>se(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{C("failed to asynchronously prepare wasm: "+e),Q(e)}))}ne(ee="cesdk.wasm")||(te=ee,ee=u.locateFile?u.locateFile(te,b):b+te);var ie={2350008:(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=["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),2351998:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2352162:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2352266:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2352437:(e,t,r,n,o,s)=>{var a=e,i=t,c=r,l=n,d=o,p=s;if(void 0===window.miniaudio)return-1;var f={},h={};a==window.miniaudio.device_type.playback&&(h.sampleRate=c),f.webaudio=new(window.AudioContext||window.webkitAudioContext)(h),f.webaudio.suspend(),f.state=window.miniaudio.device_state.stopped;var g=0,m=i;return a!=window.miniaudio.device_type.playback&&(g=i),f.scriptNode=f.webaudio.createScriptProcessor(l,g,m),f.scriptNode.onaudioprocess=function(e){if(null!=f.intermediaryBufferView&&0!=f.intermediaryBufferView.length||(f.intermediaryBufferView=new Float32Array(u.HEAPF32.buffer,d,l*i)),a==miniaudio.device_type.capture||a==miniaudio.device_type.duplex){for(var t=0;t<i;t+=1)for(var r=e.inputBuffer.getChannelData(t),n=f.intermediaryBufferView,o=0;o<l;o+=1)n[o*i+t]=r[o];Xu(p,l,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Ju(p,l,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var s=e.outputBuffer.getChannelData(t);for(n=f.intermediaryBufferView,o=0;o<l;o+=1)s[o]=n[o*i+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){f.streamNode=f.webaudio.createMediaStreamSource(e),f.streamNode.connect(f.scriptNode),f.scriptNode.connect(f.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&f.scriptNode.connect(f.webaudio.destination),miniaudio.track_device(f)},2355220:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2355286: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},2355651:e=>{miniaudio.untrack_device_by_index(e)},2355694:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2355819:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2355945:()=>!!globalThis.ubq_browserTabHidden,2355991:()=>x.length};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{for(;e.length>0;)e.shift()(u)},le=[],de=0;function pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){I[this.ptr+4>>2]=e},this.get_type=function(){return I[this.ptr+4>>2]},this.set_destructor=function(e){I[this.ptr+8>>2]=e},this.get_destructor=function(){return I[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,x[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,x[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=x[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){I[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return I[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ic(this.get_type()))return I[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var fe=e=>{var t=de;if(!t)return Ku(0),0;var r=new pe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ku(0),t;for(var o in e){var s=e[o];if(0===s||s===n)break;var a=r.ptr+16;if(ac(s,n,a))return Ku(s),t}return Ku(n),t},he={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=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.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=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},ge=e=>(ge=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(y)try{var e=require_polyfill_noop();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}Q("initRandomDevice")})())(e),me={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:xe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.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=me.resolve(e).substr(1),t=me.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),s=Math.min(n.length,o.length),a=s,i=0;i<s;i++)if(n[i]!==o[i]){a=i;break}var u=[];for(i=a;i<n.length;i++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},ye="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,be=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ye)return ye.decode(e.subarray(t,o));for(var s="";t<o;){var a=e[t++];if(128&a){var i=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|i<<6|u:(7&a)<<18|i<<12|u<<6|63&e[t++])<65536)s+=String.fromCharCode(a);else{var c=a-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&a)<<6|i)}else s+=String.fromCharCode(a)}return s},_e=[],ve=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},ke=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),i<=127){if(r>=s)break;t[r++]=i}else if(i<=2047){if(r+1>=s)break;t[r++]=192|i>>6,t[r++]=128|63&i}else if(i<=65535){if(r+2>=s)break;t[r++]=224|i>>12,t[r++]=128|i>>6&63,t[r++]=128|63&i}else{if(r+3>=s)break;t[r++]=240|i>>18,t[r++]=128|i>>12&63,t[r++]=128|i>>6&63,t[r++]=128|63&i}}return t[r]=0,r-o};function we(e,t,r){var n=r>0?r:ve(e)+1,o=new Array(n),s=ke(e,o,0,o.length);return t&&(o.length=s),o}var Ce={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Ce.ttys[e]={input:[],output:[],ops:t},xe.registerDevice(e,Ce.stream_ops)},stream_ops:{open:function(e){var t=Ce.ttys[e.node.rdev];if(!t)throw new xe.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 xe.ErrnoError(60);for(var s=0,a=0;a<n;a++){var i;try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new xe.ErrnoError(29)}if(void 0===i&&0===s)throw new xe.ErrnoError(6);if(null==i)break;s++,t[r+a]=i}return s&&(e.node.timestamp=Date.now()),s},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new xe.ErrnoError(60);try{for(var s=0;s<n;s++)e.tty.ops.put_char(e.tty,t[r+s])}catch(e){throw new xe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:function(e){return(()=>{if(!_e.length){var e=null;if(y){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=_.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;_e=we(e,!0)}return _e.shift()})()},put_char:function(e,t){null===t||10===t?(w(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(w(be(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?(C(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(C(be(e.output,0)),e.output=[])}}},Ee=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Qu(65536,e);return t?((e,t)=>(q.fill(0,e,e+t),e))(t,e):0},Ae={ops_table:null,mount:e=>Ae.createNode(null,"/",16895,0),createNode(e,t,r,n){if(xe.isBlkdev(r)||xe.isFIFO(r))throw new xe.ErrnoError(63);Ae.ops_table||(Ae.ops_table={dir:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr,lookup:Ae.node_ops.lookup,mknod:Ae.node_ops.mknod,rename:Ae.node_ops.rename,unlink:Ae.node_ops.unlink,rmdir:Ae.node_ops.rmdir,readdir:Ae.node_ops.readdir,symlink:Ae.node_ops.symlink},stream:{llseek:Ae.stream_ops.llseek}},file:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr},stream:{llseek:Ae.stream_ops.llseek,read:Ae.stream_ops.read,write:Ae.stream_ops.write,allocate:Ae.stream_ops.allocate,mmap:Ae.stream_ops.mmap,msync:Ae.stream_ops.msync}},link:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr,readlink:Ae.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ae.node_ops.getattr,setattr:Ae.node_ops.setattr},stream:xe.chrdev_stream_ops}});var o=xe.createNode(e,t,r,n);return xe.isDir(o.mode)?(o.node_ops=Ae.ops_table.dir.node,o.stream_ops=Ae.ops_table.dir.stream,o.contents={}):xe.isFile(o.mode)?(o.node_ops=Ae.ops_table.file.node,o.stream_ops=Ae.ops_table.file.stream,o.usedBytes=0,o.contents=null):xe.isLink(o.mode)?(o.node_ops=Ae.ops_table.link.node,o.stream_ops=Ae.ops_table.link.stream):xe.isChrdev(o.mode)&&(o.node_ops=Ae.ops_table.chrdev.node,o.stream_ops=Ae.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=xe.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,xe.isDir(e.mode)?t.size=4096:xe.isFile(e.mode)?t.size=e.usedBytes:xe.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&&Ae.resizeFileStorage(e,t.size)},lookup(e,t){throw xe.genericErrors[44]},mknod:(e,t,r,n)=>Ae.createNode(e,t,r,n),rename(e,t,r){if(xe.isDir(e.mode)){var n;try{n=xe.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new xe.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=xe.lookupNode(e,t);for(var n in r.contents)throw new xe.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=Ae.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!xe.isLink(e.mode))throw new xe.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var s=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&s.subarray)t.set(s.subarray(o,o+a),r);else for(var i=0;i<a;i++)t[r+i]=s[o+i];return a},write(e,t,r,n,o,s){if(t.buffer===x.buffer&&(s=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(s)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(Ae.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var i=0;i<n;i++)a.contents[o+i]=t[r+i];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&&xe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new xe.ErrnoError(28);return n},allocate(e,t,r){Ae.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,n,o){if(!xe.isFile(e.node.mode))throw new xe.ErrnoError(43);var s,a,i=e.node.contents;if(2&o||i.buffer!==x.buffer){if((r>0||r+t<i.length)&&(i=i.subarray?i.subarray(r,r+t):Array.prototype.slice.call(i,r,r+t)),a=!0,!(s=Ee(t)))throw new xe.ErrnoError(48);x.set(i,s)}else a=!1,s=i.byteOffset;return{ptr:s,allocated:a}},msync:(e,t,r,n,o)=>(Ae.stream_ops.write(e,t,0,n,r,!1),0)}},Se=u.preloadPlugins||[];function Pe(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var xe={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=me.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new xe.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=xe.root,o="/",s=0;s<r.length;s++){var a=s===r.length-1;if(a&&t.parent)break;if(n=xe.lookupNode(n,r[s]),o=he.join2(o,r[s]),xe.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var i=0;xe.isLink(n.mode);){var u=xe.readlink(o);if(o=me.resolve(he.dirname(o),u),n=xe.lookupPath(o,{recurse_count:t.recurse_count+1}).node,i++>40)throw new xe.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(xe.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)%xe.nameTable.length},hashAddNode:e=>{var t=xe.hashName(e.parent.id,e.name);e.name_next=xe.nameTable[t],xe.nameTable[t]=e},hashRemoveNode:e=>{var t=xe.hashName(e.parent.id,e.name);if(xe.nameTable[t]===e)xe.nameTable[t]=e.name_next;else for(var r=xe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=xe.mayLookup(e);if(r)throw new xe.ErrnoError(r,e);for(var n=xe.hashName(e.id,t),o=xe.nameTable[n];o;o=o.name_next){var s=o.name;if(o.parent.id===e.id&&s===t)return o}return xe.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new xe.FSNode(e,t,r,n);return xe.hashAddNode(o),o},destroyNode:e=>{xe.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)=>xe.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=xe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return xe.lookupNode(e,t),20}catch(e){}return xe.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=xe.lookupNode(e,t)}catch(e){return e.errno}var o=xe.nodePermissions(e,"wx");if(o)return o;if(r){if(!xe.isDir(n.mode))return 54;if(xe.isRoot(n)||xe.getPath(n)===xe.cwd())return 10}else if(xe.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?xe.isLink(e.mode)?32:xe.isDir(e.mode)&&("r"!==xe.flagsToPermissionString(t)||512&t)?31:xe.nodePermissions(e,xe.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=xe.MAX_OPEN_FDS;e++)if(!xe.streams[e])return e;throw new xe.ErrnoError(33)},getStreamChecked:e=>{var t=xe.getStream(e);if(!t)throw new xe.ErrnoError(8);return t},getStream:e=>xe.streams[e],createStream:(e,t=-1)=>(xe.FSStream||(xe.FSStream=function(){this.shared={}},xe.FSStream.prototype={},Object.defineProperties(xe.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 xe.FSStream,e),-1==t&&(t=xe.nextfd()),e.fd=t,xe.streams[t]=e,e),closeStream:e=>{xe.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=xe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new xe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{xe.devices[e]={stream_ops:t}},getDevice:e=>xe.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),xe.syncFSRequests++,xe.syncFSRequests>1&&C(`warning: ${xe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=xe.getMounts(xe.root.mount),n=0;function o(e){return xe.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount:(e,t,r)=>{var n,o="/"===r,s=!r;if(o&&xe.root)throw new xe.ErrnoError(10);if(!o&&!s){var a=xe.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,xe.isMountpoint(n))throw new xe.ErrnoError(10);if(!xe.isDir(n.mode))throw new xe.ErrnoError(54)}var i={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(i);return u.mount=i,i.root=u,o?xe.root=u:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),u},unmount:e=>{var t=xe.lookupPath(e,{follow_mount:!1});if(!xe.isMountpoint(t.node))throw new xe.ErrnoError(28);var r=t.node,n=r.mounted,o=xe.getMounts(n);Object.keys(xe.nameTable).forEach((e=>{for(var t=xe.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&xe.destroyNode(t),t=r}})),r.mounted=null;var s=r.mount.mounts.indexOf(n);r.mount.mounts.splice(s,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=xe.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new xe.ErrnoError(28);var s=xe.mayCreate(n,o);if(s)throw new xe.ErrnoError(s);if(!n.node_ops.mknod)throw new xe.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,xe.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,xe.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{xe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,xe.mknod(e,t,r)),symlink:(e,t)=>{if(!me.resolve(e))throw new xe.ErrnoError(44);var r=xe.lookupPath(t,{parent:!0}).node;if(!r)throw new xe.ErrnoError(44);var n=he.basename(t),o=xe.mayCreate(r,n);if(o)throw new xe.ErrnoError(o);if(!r.node_ops.symlink)throw new xe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=he.dirname(e),s=he.dirname(t),a=he.basename(e),i=he.basename(t);if(r=xe.lookupPath(e,{parent:!0}).node,n=xe.lookupPath(t,{parent:!0}).node,!r||!n)throw new xe.ErrnoError(44);if(r.mount!==n.mount)throw new xe.ErrnoError(75);var u,c=xe.lookupNode(r,a),l=me.relative(e,s);if("."!==l.charAt(0))throw new xe.ErrnoError(28);if("."!==(l=me.relative(t,o)).charAt(0))throw new xe.ErrnoError(55);try{u=xe.lookupNode(n,i)}catch(e){}if(c!==u){var d=xe.isDir(c.mode),p=xe.mayDelete(r,a,d);if(p)throw new xe.ErrnoError(p);if(p=u?xe.mayDelete(n,i,d):xe.mayCreate(n,i))throw new xe.ErrnoError(p);if(!r.node_ops.rename)throw new xe.ErrnoError(63);if(xe.isMountpoint(c)||u&&xe.isMountpoint(u))throw new xe.ErrnoError(10);if(n!==r&&(p=xe.nodePermissions(r,"w")))throw new xe.ErrnoError(p);xe.hashRemoveNode(c);try{r.node_ops.rename(c,n,i)}catch(e){throw e}finally{xe.hashAddNode(c)}}},rmdir:e=>{var t=xe.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=xe.lookupNode(t,r),o=xe.mayDelete(t,r,!0);if(o)throw new xe.ErrnoError(o);if(!t.node_ops.rmdir)throw new xe.ErrnoError(63);if(xe.isMountpoint(n))throw new xe.ErrnoError(10);t.node_ops.rmdir(t,r),xe.destroyNode(n)},readdir:e=>{var t=xe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new xe.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=xe.lookupPath(e,{parent:!0}).node;if(!t)throw new xe.ErrnoError(44);var r=he.basename(e),n=xe.lookupNode(t,r),o=xe.mayDelete(t,r,!1);if(o)throw new xe.ErrnoError(o);if(!t.node_ops.unlink)throw new xe.ErrnoError(63);if(xe.isMountpoint(n))throw new xe.ErrnoError(10);t.node_ops.unlink(t,r),xe.destroyNode(n)},readlink:e=>{var t=xe.lookupPath(e).node;if(!t)throw new xe.ErrnoError(44);if(!t.node_ops.readlink)throw new xe.ErrnoError(28);return me.resolve(xe.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=xe.lookupPath(e,{follow:!t}).node;if(!r)throw new xe.ErrnoError(44);if(!r.node_ops.getattr)throw new xe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>xe.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?xe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new xe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{xe.chmod(e,t,!0)},fchmod:(e,t)=>{var r=xe.getStreamChecked(e);xe.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?xe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new xe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{xe.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=xe.getStreamChecked(e);xe.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new xe.ErrnoError(28);var r;if(!(r="string"==typeof e?xe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new xe.ErrnoError(63);if(xe.isDir(r.mode))throw new xe.ErrnoError(31);if(!xe.isFile(r.mode))throw new xe.ErrnoError(28);var n=xe.nodePermissions(r,"w");if(n)throw new xe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=xe.getStreamChecked(e);if(0==(2097155&r.flags))throw new xe.ErrnoError(28);xe.truncate(r.node,t)},utime:(e,t,r)=>{var n=xe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new xe.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=he.normalize(e);try{n=xe.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new xe.ErrnoError(20)}else n=xe.mknod(e,r,0),o=!0;if(!n)throw new xe.ErrnoError(44);if(xe.isChrdev(n.mode)&&(t&=-513),65536&t&&!xe.isDir(n.mode))throw new xe.ErrnoError(54);if(!o){var s=xe.mayOpen(n,t);if(s)throw new xe.ErrnoError(s)}512&t&&!o&&xe.truncate(n,0),t&=-131713;var a=xe.createStream({node:n,path:xe.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||(xe.readFiles||(xe.readFiles={}),e in xe.readFiles||(xe.readFiles[e]=1)),a},close:e=>{if(xe.isClosed(e))throw new xe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{xe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(xe.isClosed(e))throw new xe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new xe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new xe.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 xe.ErrnoError(28);if(xe.isClosed(e))throw new xe.ErrnoError(8);if(1==(2097155&e.flags))throw new xe.ErrnoError(8);if(xe.isDir(e.node.mode))throw new xe.ErrnoError(31);if(!e.stream_ops.read)throw new xe.ErrnoError(28);var s=void 0!==o;if(s){if(!e.seekable)throw new xe.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return s||(e.position+=a),a},write:(e,t,r,n,o,s)=>{if(n<0||o<0)throw new xe.ErrnoError(28);if(xe.isClosed(e))throw new xe.ErrnoError(8);if(0==(2097155&e.flags))throw new xe.ErrnoError(8);if(xe.isDir(e.node.mode))throw new xe.ErrnoError(31);if(!e.stream_ops.write)throw new xe.ErrnoError(28);e.seekable&&1024&e.flags&&xe.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new xe.ErrnoError(70)}else o=e.position;var i=e.stream_ops.write(e,t,r,n,o,s);return a||(e.position+=i),i},allocate:(e,t,r)=>{if(xe.isClosed(e))throw new xe.ErrnoError(8);if(t<0||r<=0)throw new xe.ErrnoError(28);if(0==(2097155&e.flags))throw new xe.ErrnoError(8);if(!xe.isFile(e.node.mode)&&!xe.isDir(e.node.mode))throw new xe.ErrnoError(43);if(!e.stream_ops.allocate)throw new xe.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 xe.ErrnoError(2);if(1==(2097155&e.flags))throw new xe.ErrnoError(2);if(!e.stream_ops.mmap)throw new xe.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 xe.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=xe.open(e,t.flags),o=xe.stat(e).size,s=new Uint8Array(o);return xe.read(n,s,0,o,0),"utf8"===t.encoding?r=be(s,0):"binary"===t.encoding&&(r=s),xe.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=xe.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(ve(t)+1),s=ke(t,o,0,o.length);xe.write(n,o,0,s,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");xe.write(n,t,0,t.byteLength,void 0,r.canOwn)}xe.close(n)},cwd:()=>xe.currentPath,chdir:e=>{var t=xe.lookupPath(e,{follow:!0});if(null===t.node)throw new xe.ErrnoError(44);if(!xe.isDir(t.node.mode))throw new xe.ErrnoError(54);var r=xe.nodePermissions(t.node,"x");if(r)throw new xe.ErrnoError(r);xe.currentPath=t.path},createDefaultDirectories:()=>{xe.mkdir("/tmp"),xe.mkdir("/home"),xe.mkdir("/home/web_user")},createDefaultDevices:()=>{xe.mkdir("/dev"),xe.registerDevice(xe.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),xe.mkdev("/dev/null",xe.makedev(1,3)),Ce.register(xe.makedev(5,0),Ce.default_tty_ops),Ce.register(xe.makedev(6,0),Ce.default_tty1_ops),xe.mkdev("/dev/tty",xe.makedev(5,0)),xe.mkdev("/dev/tty1",xe.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=ge(e).byteLength),e[--t]);xe.createDevice("/dev","random",r),xe.createDevice("/dev","urandom",r),xe.mkdir("/dev/shm"),xe.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{xe.mkdir("/proc");var e=xe.mkdir("/proc/self");xe.mkdir("/proc/self/fd"),xe.mount({mount:()=>{var t=xe.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=xe.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?xe.createDevice("/dev","stdin",u.stdin):xe.symlink("/dev/tty","/dev/stdin"),u.stdout?xe.createDevice("/dev","stdout",null,u.stdout):xe.symlink("/dev/tty","/dev/stdout"),u.stderr?xe.createDevice("/dev","stderr",null,u.stderr):xe.symlink("/dev/tty1","/dev/stderr"),xe.open("/dev/stdin",0),xe.open("/dev/stdout",1),xe.open("/dev/stderr",1)},ensureErrnoError:()=>{xe.ErrnoError||(xe.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},xe.ErrnoError.prototype=new Error,xe.ErrnoError.prototype.constructor=xe.ErrnoError,[44].forEach((e=>{xe.genericErrors[e]=new xe.ErrnoError(e),xe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{xe.ensureErrnoError(),xe.nameTable=new Array(4096),xe.mount(Ae,{},"/"),xe.createDefaultDirectories(),xe.createDefaultDevices(),xe.createSpecialDirectories(),xe.filesystems={MEMFS:Ae}},init:(e,t,r)=>{xe.init.initialized=!0,xe.ensureErrnoError(),u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,xe.createStandardStreams()},quit:()=>{xe.init.initialized=!1;for(var e=0;e<xe.streams.length;e++){var t=xe.streams[e];t&&xe.close(t)}},findObject:(e,t)=>{var r=xe.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=xe.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=xe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=xe.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:xe.getPath(e);for(var o=t.split("/").reverse();o.length;){var s=o.pop();if(s){var a=he.join2(e,s);try{xe.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var s=he.join2("string"==typeof e?e:xe.getPath(e),t),a=Pe(n,o);return xe.create(s,a)},createDataFile:(e,t,r,n,o,s)=>{var a=t;e&&(e="string"==typeof e?e:xe.getPath(e),a=t?he.join2(e,t):e);var i=Pe(n,o),u=xe.create(a,i);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}xe.chmod(u,146|i);var p=xe.open(u,577);xe.write(p,r,0,r.length,0,s),xe.close(p),xe.chmod(u,i)}return u},createDevice:(e,t,r,n)=>{var o=he.join2("string"==typeof e?e:xe.getPath(e),t),s=Pe(!!r,!!n);xe.createDevice.major||(xe.createDevice.major=64);var a=xe.makedev(xe.createDevice.major++,0);return xe.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,s)=>{for(var a=0,i=0;i<o;i++){var u;try{u=r()}catch(e){throw new xe.ErrnoError(29)}if(void 0===u&&0===a)throw new xe.ErrnoError(6);if(null==u)break;a++,t[n+i]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,s)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new xe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),xe.mkdev(o,s,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=we(c(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new xe.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function s(){this.lengthKnown=!1,this.chunks=[]}if(s.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]}},s.prototype.setDataGetter=function(e){this.getter=e},s.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,s=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var i=this;i.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===i.chunks[e]&&(i.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||[]):we(o.responseText||"",!0)})(t,o)),void 0===i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]})),!s&&n||(a=n=1,n=this.getter(0).length,a=n,w("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(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new s;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var i={isDevice:!1,contents:a}}else i={isDevice:!1,url:r};var u=xe.createFile(e,t,i,n,o);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,t,r,n,o){var s=e.node.contents;if(o>=s.length)return 0;var a=Math.min(s.length-o,n);if(s.slice)for(var i=0;i<a;i++)t[r+i]=s[o+i];else for(i=0;i<a;i++)t[r+i]=s.get(o+i);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return xe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(xe.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{xe.forceLoadFile(u);var s=Ee(t);if(!s)throw new xe.ErrnoError(48);return l(e,x,s,t,r),{ptr:s,allocated:!0}},u.stream_ops=c,u}},qe=(e,t)=>e?be(q,e,t):"",Re={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?xe.cwd():Re.getStreamFromFD(e).path,0==t.length){if(!r)throw new xe.ErrnoError(44);return n}return he.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(xe.getPath(e.node)))return-54;throw e}B[r>>2]=n.dev,B[r+4>>2]=n.mode,I[r+8>>2]=n.nlink,B[r+12>>2]=n.uid,B[r+16>>2]=n.gid,B[r+20>>2]=n.rdev,F[r+24>>3]=BigInt(n.size),B[r+32>>2]=4096,B[r+36>>2]=n.blocks;var o=n.atime.getTime(),s=n.mtime.getTime(),a=n.ctime.getTime();return F[r+40>>3]=BigInt(Math.floor(o/1e3)),I[r+48>>2]=o%1e3*1e3,F[r+56>>3]=BigInt(Math.floor(s/1e3)),I[r+64>>2]=s%1e3*1e3,F[r+72>>3]=BigInt(Math.floor(a/1e3)),I[r+80>>2]=a%1e3*1e3,F[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!xe.isFile(t.node.mode))throw new xe.ErrnoError(43);if(2&n)return 0;var s=q.slice(e,e+r);xe.msync(t,s,o,r,n)},varargs:void 0,get:()=>(Re.varargs+=4,B[Re.varargs-4>>2]),getStr:e=>qe(e),getStreamFromFD:function(e){return xe.getStreamChecked(e)}},Te={};function Be(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Ie(e){return this.fromWireType(B[e>>2])}var Le={},Fe={},De={},Me=void 0;function Oe(e){throw new Me(e)}function je(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Oe("Mismatched type converter count");for(var o=0;o<e.length;++o)We(e[o],n[o])}e.forEach((function(e){De[e]=t}));var o=new Array(t.length),s=[],a=0;t.forEach(((e,t)=>{Fe.hasOwnProperty(e)?o[t]=Fe[e]:(s.push(e),Le.hasOwnProperty(e)||(Le[e]=[]),Le[e].push((()=>{o[t]=Fe[e],++a===s.length&&n(o)})))})),0===s.length&&n(o)}var Ue={};function Ve(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var He=void 0;function Ne(e){for(var t="",r=e;q[r];)t+=He[q[r++]];return t}var $e=void 0;function ze(e){throw new $e(e)}function We(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||ze(`type "${n}" must have a positive integer typeid pointer`),Fe.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ze(`Cannot register type '${n}' twice`)}if(Fe[e]=t,delete De[e],Le.hasOwnProperty(e)){var o=Le[e];delete Le[e],o.forEach((e=>e()))}}(e,t,r)}function Ge(e,t,r){switch(t){case 0:return r?function(e){return x[e]}:function(e){return q[e]};case 1:return r?function(e){return R[e>>1]}:function(e){return T[e>>1]};case 2:return r?function(e){return B[e>>2]}:function(e){return I[e>>2]};case 3:return r?function(e){return F[e>>3]}:function(e){return D[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Ye(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 Xe(e){if(!(this instanceof yt))return!1;if(!(e instanceof yt))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 Je(e){ze(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ke=!1;function Ze(e){}function Qe(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 et(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=et(e,t,r.baseClass);return null===n?null:r.downcast(n)}var tt={};function rt(){return Object.keys(ut).length}function nt(){var e=[];for(var t in ut)ut.hasOwnProperty(t)&&e.push(ut[t]);return e}var ot=[];function st(){for(;ot.length;){var e=ot.pop();e.$$.deleteScheduled=!1,e.delete()}}var at=void 0;function it(e){at=e,ot.length&&at&&at(st)}var ut={};function ct(e,t){return t=function(e,t){for(void 0===t&&ze("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),ut[t]}function lt(e,t){return t.ptrType&&t.ptr||Oe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Oe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},pt(Object.create(e,{$$:{value:t}}))}function dt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=ct(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?lt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):lt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,a=this.registeredClass.getActualType(t),i=tt[a];if(!i)return o.call(this);s=this.isConst?i.constPointerType:i.pointerType;var u=et(t,this.registeredClass,s.registeredClass);return null===u?o.call(this):this.isSmartPointer?lt(s.registeredClass.instancePrototype,{ptrType:s,ptr:u,smartPtrType:this,smartPtr:e}):lt(s.registeredClass.instancePrototype,{ptrType:s,ptr:u})}var pt=function(e){return"undefined"==typeof FinalizationRegistry?(pt=e=>e,e):(Ke=new FinalizationRegistry((e=>{Qe(e.$$)})),Ze=e=>Ke.unregister(e),(pt=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ke.register(e,r,e)}return e})(e))};function ft(){if(this.$$.ptr||Je(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 ht(){this.$$.ptr||Je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ze("Object already scheduled for deletion"),Ze(this),Qe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function gt(){return!this.$$.ptr}function mt(){return this.$$.ptr||Je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ze("Object already scheduled for deletion"),ot.push(this),1===ot.length&&at&&at(st),this.$$.deleteScheduled=!0,this}function yt(){}var bt=48,_t=57;function vt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=bt&&t<=_t?`_${e}`:e}function kt(e,t){return{[e=vt(e)]:function(){return t.apply(this,arguments)}}[e]}function wt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||ze(`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 Ct(e,t,r){u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&ze(`Cannot register public name '${e}' twice`),wt(u,e,e),u.hasOwnProperty(r)&&ze(`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 Et(e,t,r,n,o,s,a,i){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=s,this.upcast=a,this.downcast=i,this.pureVirtualFunctions=[]}function At(e,t,r){for(;t!==r;)t.upcast||ze(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function St(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return At(t.$$.ptr,r,this.registeredClass)}function Pt(e,t){var r;if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||ze(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ze(`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=At(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ze("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ze(`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,Gt.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:ze("Unsupporting sharing policy")}return r}function xt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${Ve(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ze(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return At(t.$$.ptr,r,this.registeredClass)}function qt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Rt(e){this.rawDestructor&&this.rawDestructor(e)}function Tt(e){null!==e&&e.delete()}function Bt(e,t,r,n,o,s,a,i,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=s,this.sharingPolicy=a,this.rawGetPointee=i,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=Pt:n?(this.toWireType=St,this.destructorFunction=null):(this.toWireType=xt,this.destructorFunction=null)}function It(e,t,r){u.hasOwnProperty(e)||Oe("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 Lt=[],Ft=e=>{var t=Lt[e];return t||(e>=Lt.length&&(Lt.length=e+1),Lt[e]=t=V.get(e)),t};function Dt(e,t){e=Ne(e);var r=Ft(t);return"function"!=typeof r&&ze(`unknown function pointer with signature ${e}: ${t}`),r}var Mt=void 0;function Ot(e){var t=Zu(e),r=Ne(t);return Gu(t),r}function jt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Fe[t]||(De[t]?De[t].forEach(e):(r.push(t),n[t]=!0))})),new Mt(`${e}: `+r.map(Ot).join([", "]))}function Ut(e,t){for(var r=[],n=0;n<e;n++)r.push(I[t+4*n>>2]);return r}function Vt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=kt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Ht(e,t,r,n,o,s){var a=t.length;a<2&&ze("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=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="",p="";for(c=0;c<a-2;++c)d+=(0!==c?", ":"")+"arg"+c,p+=(0!==c?", ":"")+"arg"+c+"Wired";var f=`\n return function ${vt(e)}(${d}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ${arguments.length} arguments, expected ${a-2} args!');\n }`;u&&(f+="var destructors = [];\n");var h=u?"destructors":"null",g=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[ze,n,o,Be,t[0],t[1]];for(i&&(f+="var thisWired = classParam.toWireType("+h+", this);\n"),c=0;c<a-2;++c)f+="var arg"+c+"Wired = argType"+c+".toWireType("+h+", arg"+c+"); // "+t[c+2].name+"\n",g.push("argType"+c),m.push(t[c+2]);if(i&&(p="thisWired"+(p.length>0?", ":"")+p),f+=(l||s?"var rv = ":"")+"invoker(fn"+(p.length>0?", ":"")+p+");\n",u)f+="runDestructors(destructors);\n";else for(c=i?1:2;c<t.length;++c){var y=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(f+=y+"_dtor("+y+"); // "+t[c].name+"\n",g.push(y+"_dtor"),m.push(t[c].destructorFunction))}return l&&(f+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f+="}\n",g.push(f),Vt(Function,g).apply(null,m)}function Nt(){this.allocated=[void 0],this.freelist=[]}var $t=new Nt;function zt(e){e>=$t.reserved&&0==--$t.get(e).refcount&&$t.free(e)}function Wt(){for(var e=0,t=$t.reserved;t<$t.allocated.length;++t)void 0!==$t.allocated[t]&&++e;return e}var Gt={toValue:e=>(e||ze("Cannot use deleted val. handle = "+e),$t.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 $t.allocate({refcount:1,value:e})}}};function Yt(e,t,r){switch(t){case 0:return function(e){var t=r?x:q;return this.fromWireType(t[e])};case 1:return function(e){var t=r?R:T;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?B:I;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Xt(e,t){var r=Fe[e];return void 0===r&&ze(t+" has unknown type "+Ot(e)),r}function Jt(e,t){switch(t){case 2:return function(e){return this.fromWireType(L[e>>2])};case 3:return function(e){return this.fromWireType(M[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Kt=(e,t,r)=>ke(e,q,t,r),Zt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Qt=(e,t)=>{for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&T[n];)++n;if((r=n<<1)-e>32&&Zt)return Zt.decode(q.subarray(e,r));for(var s="",a=0;!(a>=t/2);++a){var i=R[e+2*a>>1];if(0==i)break;s+=String.fromCharCode(i)}return s},er=(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,s=0;s<o;++s){var a=e.charCodeAt(s);R[t>>1]=a,t+=2}return R[t>>1]=0,t-n},tr=e=>2*e.length,rr=(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 s=o-65536;n+=String.fromCharCode(55296|s>>10,56320|1023&s)}else n+=String.fromCharCode(o)}return n},nr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),B[t>>2]=a,(t+=4)+4>o)break}return B[t>>2]=0,t-n},or=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 sr(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Xt(I[t+4*n>>2],"parameter "+n);return r}var ar={};function ir(e){var t=ar[e];return void 0===t?Ne(e):t}var ur=[];function cr(){return"object"==typeof globalThis?globalThis:Function("return this")()}var lr=[],dr={},pr=9007199254740992,fr=-9007199254740992;function hr(e){return e<fr||e>pr?NaN:Number(e)}var gr,mr=e=>e%4==0&&(e%100!=0||e%400==0),yr=[0,31,60,91,121,152,182,213,244,274,305,335],br=[0,31,59,90,120,151,181,212,243,273,304,334],_r=e=>(mr(e.getFullYear())?yr:br)[e.getMonth()]+e.getDate()-1,vr=e=>{var t=ve(e)+1,r=Wu(t);return r&&Kt(e,r,t),r};function kr(e,t){if(Sr.mainLoop.timingMode=e,Sr.mainLoop.timingValue=t,!Sr.mainLoop.func)return 1;if(Sr.mainLoop.running||(Sr.mainLoop.running=!0),0==e)Sr.mainLoop.scheduler=function(){var e=0|Math.max(0,Sr.mainLoop.tickStartTime+t-gr());setTimeout(Sr.mainLoop.runner,e)},Sr.mainLoop.method="timeout";else if(1==e)Sr.mainLoop.scheduler=function(){Sr.requestAnimationFrame(Sr.mainLoop.runner)},Sr.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),m?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}Sr.mainLoop.scheduler=function(){setImmediate(Sr.mainLoop.runner)},Sr.mainLoop.method="immediate"}return 0}gr=()=>performance.now();var wr=e=>{if(e instanceof ue||"unwind"==e)return P;h(1,e)},Cr=(e,t)=>{var r;P=e,P=r=e,G()||(u.onExit&&u.onExit(r),O=!0),h(r,new ue(r))},Er=e=>{if(!O)try{e(),(()=>{if(!G())try{Cr(P)}catch(e){wr(e)}})()}catch(e){wr(e)}},Ar=(e,t)=>setTimeout((()=>{Er(e)}),t),Sr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Sr.mainLoop.scheduler=null,Sr.mainLoop.currentlyRunningMainloop++},resume:function(){Sr.mainLoop.currentlyRunningMainloop++;var e=Sr.mainLoop.timingMode,t=Sr.mainLoop.timingValue,r=Sr.mainLoop.func;Sr.mainLoop.func=null,function(e,t,r,n,o){j(!Sr.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."),Sr.mainLoop.func=e,Sr.mainLoop.arg=n;var s=Sr.mainLoop.currentlyRunningMainloop;function a(){return!(s<Sr.mainLoop.currentlyRunningMainloop)}if(Sr.mainLoop.running=!1,Sr.mainLoop.runner=function(){if(!O)if(Sr.mainLoop.queue.length>0){var t=Date.now(),r=Sr.mainLoop.queue.shift();if(r.func(r.arg),Sr.mainLoop.remainingBlockers){var n=Sr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?Sr.mainLoop.remainingBlockers=o:(o+=.5,Sr.mainLoop.remainingBlockers=(8*n+o)/9)}if(w('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Sr.mainLoop.updateStatus(),!a())return;setTimeout(Sr.mainLoop.runner,0)}else a()&&(Sr.mainLoop.currentFrameNumber=Sr.mainLoop.currentFrameNumber+1|0,1==Sr.mainLoop.timingMode&&Sr.mainLoop.timingValue>1&&Sr.mainLoop.currentFrameNumber%Sr.mainLoop.timingValue!=0?Sr.mainLoop.scheduler():(0==Sr.mainLoop.timingMode&&(Sr.mainLoop.tickStartTime=gr()),Sr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Sr.mainLoop.scheduler())))},o||(t&&t>0?kr(0,1e3/t):kr(1,1),Sr.mainLoop.scheduler()),r)throw"unwind"}(r,0,!1,Sr.mainLoop.arg,!0),kr(e,t),Sr.mainLoop.scheduler()},updateStatus:function(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=Sr.mainLoop.remainingBlockers,r=Sr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter:function(e){if(!O){if(u.preMainLoop&&!1===u.preMainLoop())return;Er(e),u.postMainLoop&&u.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!Sr.initted){Sr.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:Sr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:Sr.getMimetype(t)}));var s=URL.createObjectURL(o),a=new Image;a.onload=()=>{j(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),ju[t]=n,URL.revokeObjectURL(s),r&&r(e)},a.onerror=e=>{w("Image "+s+" could not be decoded"),n&&n()},a.src=s}};Se.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 s(n){o||(o=!0,Uu[t]=n,r&&r(e))}var a=new Blob([e],{type:Sr.getMimetype(t)}),i=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>s(u)),!1),u.onerror=function(r){o||(C("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,s=0;s<e.length;s++)for(n=n<<8|e[s],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),s(u))},u.src=i,Ar((()=>{s(u)}),1e4)}};Se.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=>{!Sr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){Sr.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,s;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var i in n)a[i]=n[i];void 0!==Lr&&(s=Lr.createContext(e,a))&&(o=Lr.getContext(s).GLctx)}else o=e.getContext("2d");return o?(r&&(t||j(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&&Lr.makeContextCurrent(s),u.useWebGL=t,Sr.moduleContextCreatedCallbacks.forEach((e=>e())),Sr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){Sr.lockPointer=e,Sr.resizeCanvas=t,void 0===Sr.lockPointer&&(Sr.lockPointer=!0),void 0===Sr.resizeCanvas&&(Sr.resizeCanvas=!1);var r=u.canvas;function n(){Sr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=Sr.exitFullscreen,Sr.lockPointer&&r.requestPointerLock(),Sr.isFullscreen=!0,Sr.resizeCanvas?Sr.setFullscreenCanvasSize():Sr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Sr.resizeCanvas?Sr.setWindowedCanvasSize():Sr.updateCanvasDimensions(r)),u.onFullScreen&&u.onFullScreen(Sr.isFullscreen),u.onFullscreen&&u.onFullscreen(Sr.isFullscreen)}Sr.fullscreenHandlersInstalled||(Sr.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!!Sr.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===Sr.nextRAF)Sr.nextRAF=t+1e3/60;else for(;t+2>=Sr.nextRAF;)Sr.nextRAF+=1e3/60;var r=Math.max(Sr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,Sr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return Ar(e,t)},safeRequestAnimationFrame:function(e){return Sr.requestAnimationFrame((()=>{Er(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(Sr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Sr.mouseMovementX=Sr.mouseMovementY=0:(Sr.mouseMovementX=Sr.getMovementX(e),Sr.mouseMovementY=Sr.getMovementY(e)),"undefined"!=typeof SDL?(Sr.mouseX=SDL.mouseX+Sr.mouseMovementX,Sr.mouseY=SDL.mouseY+Sr.mouseMovementY):(Sr.mouseX+=Sr.mouseMovementX,Sr.mouseY+=Sr.mouseMovementY);else{var t=u.canvas.getBoundingClientRect(),r=u.canvas.width,n=u.canvas.height,o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,s=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 i=a.pageX-(o+t.left),c=a.pageY-(s+t.top),l={x:i*=r/t.width,y:c*=n/t.height};if("touchstart"===e.type)Sr.lastTouches[a.identifier]=l,Sr.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=Sr.touches[a.identifier];d||(d=l),Sr.lastTouches[a.identifier]=d,Sr.touches[a.identifier]=l}return}var p=e.pageX-(o+t.left),f=e.pageY-(s+t.top);p*=r/t.width,f*=n/t.height,Sr.mouseMovementX=p-Sr.mouseX,Sr.mouseMovementY=f-Sr.mouseY,Sr.mouseX=p,Sr.mouseY=f}},resizeListeners:[],updateResizeListeners:function(){var e=u.canvas;Sr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=u.canvas;Sr.updateCanvasDimensions(n,e,t),r||Sr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=I[SDL.screen>>2];e|=8388608,B[SDL.screen>>2]=e}Sr.updateCanvasDimensions(u.canvas),Sr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=I[SDL.screen>>2];e&=-8388609,B[SDL.screen>>2]=e}Sr.updateCanvasDimensions(u.canvas),Sr.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 s=Math.min(screen.width/n,screen.height/o);n=Math.round(n*s),o=Math.round(o*s)}Sr.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"))))}},Pr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){Pr.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return Pr.setErrorCode(12296),0;if(t)for(;;){var s=B[t>>2];if(12321==s){var a=B[t+4>>2];Pr.contextAttributes.alpha=a>0}else if(12325==s){var i=B[t+4>>2];Pr.contextAttributes.depth=i>0}else if(12326==s){var u=B[t+4>>2];Pr.contextAttributes.stencil=u>0}else if(12337==s){var c=B[t+4>>2];Pr.contextAttributes.antialias=c>0}else if(12338==s)c=B[t+4>>2],Pr.contextAttributes.antialias=1==c;else if(12544==s){var l=B[t+4>>2];Pr.contextAttributes.lowLatency=12547!=l}else if(12344==s)break;t+=8}return r&&n||o?(o&&(B[o>>2]=1),r&&n>0&&(B[r>>2]=62002),Pr.setErrorCode(12288),1):(Pr.setErrorCode(12300),0)}};function xr(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,s){t.drawElementsInstancedANGLE(e,r,n,o,s)},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 Rr(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function Tr(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 Ir(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var Lr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Lr.lastError||(Lr.lastError=e)},getNewId:function(e){for(var t=Lr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",s=0;s<t;++s){var a=n?B[n+4*s>>2]:-1;o+=qe(B[r+4*s>>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?Lr.registerContext(r,t):0},registerContext:function(e,t){var r=Lr.getNewId(Lr.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Lr.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Lr.initExtensions(n),r},makeContextCurrent:function(e){return Lr.currentContext=Lr.contexts[e],u.ctx=Ou=Lr.currentContext&&Lr.currentContext.GLctx,!(e&&!Ou)},getContext:function(e){return Lr.contexts[e]},deleteContext:function(e){Lr.currentContext===Lr.contexts[e]&&(Lr.currentContext=null),"object"==typeof vu&&vu.removeAllHandlersOnTarget(Lr.contexts[e].GLctx.canvas),Lr.contexts[e]&&Lr.contexts[e].GLctx.canvas&&(Lr.contexts[e].GLctx.canvas.GLctxObject=void 0),Lr.contexts[e]=null},initExtensions:function(e){if(e||(e=Lr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;xr(t),qr(t),Rr(t),Tr(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")),Ir(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},Fr=[],Dr=(e,t,r)=>{var n=((e,t)=>{var r;for(Fr.length=0,t>>=2;r=q[e++];)t+=105!=r&t,Fr.push(105==r?B[t]:(106==r?F:M)[t++>>1]),++t;return Fr})(t,r);return ie[e].apply(null,n)},Mr=function(e){Ou.activeTexture(e)},Or=function(e,t){Ou.attachShader(Lr.programs[e],Lr.shaders[t])},jr=function(e,t){Ou.beginQuery(e,Lr.queries[t])},Ur=function(e,t){Ou.disjointTimerQueryExt.beginQueryEXT(e,Lr.queries[t])},Vr=function(e){Ou.beginTransformFeedback(e)},Hr=function(e,t,r){Ou.bindAttribLocation(Lr.programs[e],t,qe(r))},Nr=function(e,t){35051==e?Ou.currentPixelPackBufferBinding=t:35052==e&&(Ou.currentPixelUnpackBufferBinding=t),Ou.bindBuffer(e,Lr.buffers[t])},$r=function(e,t,r){Ou.bindBufferBase(e,t,Lr.buffers[r])},zr=function(e,t,r,n,o){Ou.bindBufferRange(e,t,Lr.buffers[r],n,o)},Wr=function(e,t){Ou.bindFramebuffer(e,Lr.framebuffers[t])},Gr=function(e,t){Ou.bindRenderbuffer(e,Lr.renderbuffers[t])},Yr=function(e,t){Ou.bindSampler(e,Lr.samplers[t])},Xr=function(e,t){Ou.bindTexture(e,Lr.textures[t])},Jr=function(e,t){Ou.bindTransformFeedback(e,Lr.transformFeedbacks[t])};function Kr(e){Ou.bindVertexArray(Lr.vaos[e])}var Zr=Kr,Qr=Kr,en=function(e,t,r,n){Ou.blendColor(e,t,r,n)},tn=function(e){Ou.blendEquation(e)},rn=function(e,t){Ou.blendEquationSeparate(e,t)},nn=function(e,t){Ou.blendFunc(e,t)},on=function(e,t,r,n){Ou.blendFuncSeparate(e,t,r,n)},sn=function(e,t,r,n,o,s,a,i,u,c){Ou.blitFramebuffer(e,t,r,n,o,s,a,i,u,c)},an=function(e,t,r,n){Lr.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)},un=function(e,t,r,n){Lr.currentContext.version>=2?r&&Ou.bufferSubData(e,t,q,n,r):Ou.bufferSubData(e,t,q.subarray(n,n+r))},cn=function(e){return Ou.checkFramebufferStatus(e)},ln=function(e){Ou.clear(e)},dn=function(e,t,r,n){Ou.clearBufferfi(e,t,r,n)},pn=function(e,t,r){Ou.clearBufferfv(e,t,L,r>>2)},fn=function(e,t,r){Ou.clearBufferiv(e,t,B,r>>2)},hn=function(e,t,r){Ou.clearBufferuiv(e,t,I,r>>2)},gn=function(e,t,r,n){Ou.clearColor(e,t,r,n)},mn=function(e){Ou.clearDepth(e)},yn=function(e){Ou.clearStencil(e)},bn=function(e,t,r){return r=Number(r),Ou.clientWaitSync(Lr.syncs[e],t,r)},_n=function(e,t,r,n){Ou.colorMask(!!e,!!t,!!r,!!n)},vn=function(e){Ou.compileShader(Lr.shaders[e])},kn=function(e,t,r,n,o,s,a,i){Lr.currentContext.version>=2?Ou.currentPixelUnpackBufferBinding||!a?Ou.compressedTexImage2D(e,t,r,n,o,s,a,i):Ou.compressedTexImage2D(e,t,r,n,o,s,q,i,a):Ou.compressedTexImage2D(e,t,r,n,o,s,i?q.subarray(i,i+a):null)},wn=function(e,t,r,n,o,s,a,i,u){Ou.currentPixelUnpackBufferBinding?Ou.compressedTexImage3D(e,t,r,n,o,s,a,i,u):Ou.compressedTexImage3D(e,t,r,n,o,s,a,q,u,i)},Cn=function(e,t,r,n,o,s,a,i,u){Lr.currentContext.version>=2?Ou.currentPixelUnpackBufferBinding||!i?Ou.compressedTexSubImage2D(e,t,r,n,o,s,a,i,u):Ou.compressedTexSubImage2D(e,t,r,n,o,s,a,q,u,i):Ou.compressedTexSubImage2D(e,t,r,n,o,s,a,u?q.subarray(u,u+i):null)},En=function(e,t,r,n,o,s,a,i,u,c,l){Ou.currentPixelUnpackBufferBinding?Ou.compressedTexSubImage3D(e,t,r,n,o,s,a,i,u,c,l):Ou.compressedTexSubImage3D(e,t,r,n,o,s,a,i,u,q,l,c)},An=function(e,t,r,n,o){Ou.copyBufferSubData(e,t,r,n,o)},Sn=function(e,t,r,n,o,s,a,i){Ou.copyTexImage2D(e,t,r,n,o,s,a,i)},Pn=function(e,t,r,n,o,s,a,i){Ou.copyTexSubImage2D(e,t,r,n,o,s,a,i)},xn=function(e,t,r,n,o,s,a,i,u){Ou.copyTexSubImage3D(e,t,r,n,o,s,a,i,u)},qn=function(){var e=Lr.getNewId(Lr.programs),t=Ou.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,Lr.programs[e]=t,e},Rn=function(e){var t=Lr.getNewId(Lr.shaders);return Lr.shaders[t]=Ou.createShader(e),t},Tn=function(e){Ou.cullFace(e)},Bn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.buffers[n];o&&(Ou.deleteBuffer(o),o.name=0,Lr.buffers[n]=null,n==Ou.currentPixelPackBufferBinding&&(Ou.currentPixelPackBufferBinding=0),n==Ou.currentPixelUnpackBufferBinding&&(Ou.currentPixelUnpackBufferBinding=0))}},In=function(e,t){for(var r=0;r<e;++r){var n=B[t+4*r>>2],o=Lr.framebuffers[n];o&&(Ou.deleteFramebuffer(o),o.name=0,Lr.framebuffers[n]=null)}},Ln=function(e){if(e){var t=Lr.programs[e];t?(Ou.deleteProgram(t),t.name=0,Lr.programs[e]=null):Lr.recordError(1281)}},Fn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.queries[n];o&&(Ou.deleteQuery(o),Lr.queries[n]=null)}},Dn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.queries[n];o&&(Ou.disjointTimerQueryExt.deleteQueryEXT(o),Lr.queries[n]=null)}},Mn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.renderbuffers[n];o&&(Ou.deleteRenderbuffer(o),o.name=0,Lr.renderbuffers[n]=null)}},On=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.samplers[n];o&&(Ou.deleteSampler(o),o.name=0,Lr.samplers[n]=null)}},jn=function(e){if(e){var t=Lr.shaders[e];t?(Ou.deleteShader(t),Lr.shaders[e]=null):Lr.recordError(1281)}},Un=function(e){if(e){var t=Lr.syncs[e];t?(Ou.deleteSync(t),t.name=0,Lr.syncs[e]=null):Lr.recordError(1281)}},Vn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.textures[n];o&&(Ou.deleteTexture(o),o.name=0,Lr.textures[n]=null)}},Hn=function(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2],o=Lr.transformFeedbacks[n];o&&(Ou.deleteTransformFeedback(o),o.name=0,Lr.transformFeedbacks[n]=null)}};function Nn(e,t){for(var r=0;r<e;r++){var n=B[t+4*r>>2];Ou.deleteVertexArray(Lr.vaos[n]),Lr.vaos[n]=null}}var $n=Nn,zn=Nn,Wn=function(e){Ou.depthFunc(e)},Gn=function(e){Ou.depthMask(!!e)},Yn=function(e,t){Ou.depthRange(e,t)},Xn=function(e,t){Ou.detachShader(Lr.programs[e],Lr.shaders[t])},Jn=function(e){Ou.disable(e)},Kn=function(e){Ou.disableVertexAttribArray(e)},Zn=function(e,t,r){Ou.drawArrays(e,t,r)};function Qn(e,t,r,n){Ou.drawArraysInstanced(e,t,r,n)}var eo=Qn,to=Qn,ro=Qn,no=function(e,t,r,n,o){Ou.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)},oo=Qn,so=Qn,ao=[];function io(e,t){for(var r=ao[e],n=0;n<e;n++)r[n]=B[t+4*n>>2];Ou.drawBuffers(r)}var uo=io,co=io,lo=io;function po(e,t,r,n){Ou.drawElements(e,t,r,n)}var fo=po;function ho(e,t,r,n,o){Ou.drawElementsInstanced(e,t,r,n,o)}var go=ho,mo=ho,yo=ho,bo=function(e,t,r,n,o,s,a){Ou.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,s,a)},_o=ho,vo=ho,ko=function(e,t,r,n,o,s){po(e,n,o,s)},wo=function(e){Ou.enable(e)},Co=function(e){Ou.enableVertexAttribArray(e)},Eo=function(e){Ou.endQuery(e)},Ao=function(e){Ou.disjointTimerQueryExt.endQueryEXT(e)},So=function(){Ou.endTransformFeedback()},Po=function(e,t){var r=Ou.fenceSync(e,t);if(r){var n=Lr.getNewId(Lr.syncs);return r.name=n,Lr.syncs[n]=r,n}return 0},xo=function(){Ou.finish()},qo=function(){Ou.flush()},Ro=function(e,t,r,n){Ou.framebufferRenderbuffer(e,t,r,Lr.renderbuffers[n])},To=function(e,t,r,n,o){Ou.framebufferTexture2D(e,t,r,Lr.textures[n],o)},Bo=function(e,t,r,n,o){Ou.framebufferTextureLayer(e,t,Lr.textures[r],n,o)},Io=function(e){Ou.frontFace(e)};function Lo(e,t,r,n){for(var o=0;o<e;o++){var s=Ou[r](),a=s&&Lr.getNewId(n);s?(s.name=a,n[a]=s):Lr.recordError(1282),B[t+4*o>>2]=a}}var Fo=function(e,t){Lo(e,t,"createBuffer",Lr.buffers)},Do=function(e,t){Lo(e,t,"createFramebuffer",Lr.framebuffers)},Mo=function(e,t){Lo(e,t,"createQuery",Lr.queries)},Oo=function(e,t){for(var r=0;r<e;r++){var n=Ou.disjointTimerQueryExt.createQueryEXT();if(!n){for(Lr.recordError(1282);r<e;)B[t+4*r++>>2]=0;return}var o=Lr.getNewId(Lr.queries);n.name=o,Lr.queries[o]=n,B[t+4*r>>2]=o}},jo=function(e,t){Lo(e,t,"createRenderbuffer",Lr.renderbuffers)},Uo=function(e,t){Lo(e,t,"createSampler",Lr.samplers)},Vo=function(e,t){Lo(e,t,"createTexture",Lr.textures)},Ho=function(e,t){Lo(e,t,"createTransformFeedback",Lr.transformFeedbacks)};function No(e,t){Lo(e,t,"createVertexArray",Lr.vaos)}var $o=No,zo=No,Wo=function(e){Ou.generateMipmap(e)};function Go(e,t,r,n,o,s,a,i){t=Lr.programs[t];var u=Ou[e](t,r);if(u){var c=i&&Kt(u.name,i,n);o&&(B[o>>2]=c),s&&(B[s>>2]=u.size),a&&(B[a>>2]=u.type)}}var Yo=function(e,t,r,n,o,s,a){Go("getActiveAttrib",e,t,r,n,o,s,a)},Xo=function(e,t,r,n,o,s,a){Go("getActiveUniform",e,t,r,n,o,s,a)},Jo=function(e,t,r,n,o){e=Lr.programs[e];var s=Ou.getActiveUniformBlockName(e,t);if(s)if(o&&r>0){var a=Kt(s,o,r);n&&(B[n>>2]=a)}else n&&(B[n>>2]=0)},Ko=function(e,t,r,n){if(n)if(e=Lr.programs[e],35393!=r){var o=Ou.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var s=0;s<o.length;s++)B[n+4*s>>2]=o[s];else B[n>>2]=o}else{var a=Ou.getActiveUniformBlockName(e,t);B[n>>2]=a.length+1}else Lr.recordError(1281)},Zo=function(e,t,r,n,o){if(o)if(t>0&&0==r)Lr.recordError(1281);else{e=Lr.programs[e];for(var s=[],a=0;a<t;a++)s.push(B[r+4*a>>2]);var i=Ou.getActiveUniforms(e,s,n);if(i){var u=i.length;for(a=0;a<u;a++)B[o+4*a>>2]=i[a]}}else Lr.recordError(1281)},Qo=function(e,t,r,n){var o=Ou.getAttachedShaders(Lr.programs[e]),s=o.length;s>t&&(s=t),B[r>>2]=s;for(var a=0;a<s;++a){var i=Lr.shaders.indexOf(o[a]);B[n+4*a>>2]=i}},es=function(e,t){return Ou.getAttribLocation(Lr.programs[e],qe(t))};function ts(e,t){I[e>>2]=t,I[e+4>>2]=(t-I[e>>2])/4294967296}function rs(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&Lr.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(Lr.currentContext.version<2)return void Lr.recordError(1282);n=2*(Ou.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(Lr.currentContext.version<2)return void Lr.recordError(1280);n=33307==e?3:0}if(void 0===n){var s=Ou.getParameter(e);switch(typeof s){case"number":n=s;break;case"boolean":n=s?1:0;break;case"string":return void Lr.recordError(1280);case"object":if(null===s)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 Lr.recordError(1280)}else{if(s instanceof Float32Array||s instanceof Uint32Array||s instanceof Int32Array||s instanceof Array){for(var a=0;a<s.length;++a)switch(r){case 0:B[t+4*a>>2]=s[a];break;case 2:L[t+4*a>>2]=s[a];break;case 4:x[t+a>>0]=s[a]?1:0}return}try{n=0|s.name}catch(t){return Lr.recordError(1280),void C("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Lr.recordError(1280),void C("GL_INVALID_ENUM in glGet"+r+"v: Native code calling glGet"+r+"v("+e+") and it returns "+s+" of type "+typeof s+"!")}}switch(r){case 1:ts(t,n);break;case 0:B[t>>2]=n;break;case 2:L[t>>2]=n;break;case 4:x[t>>0]=n?1:0}}else Lr.recordError(1281)}var ns=function(e,t){rs(e,t,4)},os=function(e,t,r){r?ts(r,Ou.getBufferParameter(e,t)):Lr.recordError(1281)},ss=function(e,t,r){r?B[r>>2]=Ou.getBufferParameter(e,t):Lr.recordError(1281)},as=function(){var e=Ou.getError()||Lr.lastError;return Lr.lastError=0,e},us=function(e,t){rs(e,t,2)},cs=function(e,t){return Ou.getFragDataLocation(Lr.programs[e],qe(t))},ls=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 ds(e,t,r,n){if(r){var o,s=Ou.getIndexedParameter(e,t);switch(typeof s){case"boolean":o=s?1:0;break;case"number":o=s;break;case"object":if(null===s)switch(e){case 35983:case 35368:o=0;break;default:return void Lr.recordError(1280)}else{if(!(s instanceof WebGLBuffer))return void Lr.recordError(1280);o=0|s.name}break;default:return void Lr.recordError(1280)}switch(n){case 1:ts(r,o);break;case 0:B[r>>2]=o;break;case 2:L[r>>2]=o;break;case 4:x[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else Lr.recordError(1281)}var ps=function(e,t,r){ds(e,t,r,1)},fs=function(e,t){rs(e,t,1)},hs=function(e,t,r){ds(e,t,r,0)},gs=function(e,t){rs(e,t,0)},ms=function(e,t,r,n,o){if(n<0)Lr.recordError(1281);else if(o){var s=Ou.getInternalformatParameter(e,t,r);if(null!==s)for(var a=0;a<s.length&&a<n;++a)B[o+4*a>>2]=s[a]}else Lr.recordError(1281)},ys=function(e,t,r,n,o){Lr.recordError(1282)},bs=function(e,t,r,n){var o=Ou.getProgramInfoLog(Lr.programs[e]);null===o&&(o="(unknown error)");var s=t>0&&n?Kt(o,n,t):0;r&&(B[r>>2]=s)},_s=function(e,t,r){if(r)if(e>=Lr.counter)Lr.recordError(1281);else if(e=Lr.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 Lr.recordError(1281)};function vs(e,t,r){if(r){var n,o=Lr.queries[e];ts(r,"boolean"==typeof(n=Lr.currentContext.version<2?Ou.disjointTimerQueryExt.getQueryObjectEXT(o,t):Ou.getQueryParameter(o,t))?n?1:0:n)}else Lr.recordError(1281)}var ks=vs;function ws(e,t,r){if(r){var n,o=Lr.queries[e],s=Ou.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof s?s?1:0:s,B[r>>2]=n}else Lr.recordError(1281)}var Cs=ws,Es=vs,As=function(e,t,r){if(r){var n,o=Lr.queries[e],s=Ou.getQueryParameter(o,t);n="boolean"==typeof s?s?1:0:s,B[r>>2]=n}else Lr.recordError(1281)},Ss=ws,Ps=function(e,t,r){r?B[r>>2]=Ou.getQuery(e,t):Lr.recordError(1281)},xs=function(e,t,r){r?B[r>>2]=Ou.disjointTimerQueryExt.getQueryEXT(e,t):Lr.recordError(1281)},qs=function(e,t,r){r?B[r>>2]=Ou.getRenderbufferParameter(e,t):Lr.recordError(1281)},Rs=function(e,t,r){r?L[r>>2]=Ou.getSamplerParameter(Lr.samplers[e],t):Lr.recordError(1281)},Ts=function(e,t,r){r?B[r>>2]=Ou.getSamplerParameter(Lr.samplers[e],t):Lr.recordError(1281)},Bs=function(e,t,r,n){var o=Ou.getShaderInfoLog(Lr.shaders[e]);null===o&&(o="(unknown error)");var s=t>0&&n?Kt(o,n,t):0;r&&(B[r>>2]=s)},Is=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},Ls=function(e,t,r,n){var o=Ou.getShaderSource(Lr.shaders[e]);if(o){var s=t>0&&n?Kt(o,n,t):0;r&&(B[r>>2]=s)}},Fs=function(e,t,r){if(r)if(35716==t){var n=Ou.getShaderInfoLog(Lr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;B[r>>2]=o}else if(35720==t){var s=Ou.getShaderSource(Lr.shaders[e]),a=s?s.length+1:0;B[r>>2]=a}else B[r>>2]=Ou.getShaderParameter(Lr.shaders[e],t);else Lr.recordError(1281)},Ds=function(e){var t=Lr.stringCache[e];if(!t){switch(e){case 7939:var r=Ou.getSupportedExtensions()||[];r=r.concat(r.map((function(e){return"GL_"+e}))),t=vr(r.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Ou.getParameter(e);n||Lr.recordError(1280),t=n&&vr(n);break;case 7938:var o=Ou.getParameter(7938);o=Lr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",t=vr(o);break;case 35724:var s=Ou.getParameter(35724),a=s.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),s="OpenGL ES GLSL ES "+a[1]+" ("+s+")"),t=vr(s);break;default:Lr.recordError(1280)}Lr.stringCache[e]=t}return t},Ms=function(e,t){if(Lr.currentContext.version<2)return Lr.recordError(1282),0;var r=Lr.stringiCache[e];if(r)return t<0||t>=r.length?(Lr.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 vr(e)})),r=Lr.stringiCache[e]=n,t<0||t>=r.length?(Lr.recordError(1281),0):r[t]}return Lr.recordError(1280),0},Os=function(e,t,r,n,o){if(r<0)Lr.recordError(1281);else if(o){var s=Ou.getSyncParameter(Lr.syncs[e],t);null!==s&&(B[o>>2]=s,n&&(B[n>>2]=1))}else Lr.recordError(1281)},js=function(e,t,r){r?L[r>>2]=Ou.getTexParameter(e,t):Lr.recordError(1281)},Us=function(e,t,r){r?B[r>>2]=Ou.getTexParameter(e,t):Lr.recordError(1281)},Vs=function(e,t,r,n,o,s,a){e=Lr.programs[e];var i=Ou.getTransformFeedbackVarying(e,t);if(i){if(a&&r>0){var u=Kt(i.name,a,r);n&&(B[n>>2]=u)}else n&&(B[n>>2]=0);o&&(B[o>>2]=i.size),s&&(B[s>>2]=i.type)}},Hs=function(e,t){return Ou.getUniformBlockIndex(Lr.programs[e],qe(t))},Ns=function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))Lr.recordError(1281);else{e=Lr.programs[e];for(var o=[],s=0;s<t;s++)o.push(qe(B[r+4*s>>2]));var a=Ou.getUniformIndices(e,o);if(a){var i=a.length;for(s=0;s<i;s++)B[n+4*s>>2]=a[s]}}else Lr.recordError(1281)};function $s(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function zs(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 s=Ou.getActiveUniform(e,t),a=s.name,i=s.size,u=$s(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=i,o[c]=[i,l],r=0;r<i;++r)n[l]=r,e.uniformArrayNamesById[l++]=c}}var Ws=function(e,t){if(t=qe(t),e=Lr.programs[e]){zs(e);var r=e.uniformLocsById,n=0,o=t,s=$s(t);s>0&&(i=t.slice(s+1),n=parseInt(i)>>>0,o=t.slice(0,s));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||Ou.getUniformLocation(e,t)))return n}else Lr.recordError(1281);var i;return-1};function Gs(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}Lr.recordError(1282)}function Ys(e,t,r,n){if(r){zs(e=Lr.programs[e]);var o=Ou.getUniform(e,Gs(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:B[r>>2]=o;break;case 2:L[r>>2]=o}else for(var s=0;s<o.length;s++)switch(n){case 0:B[r+4*s>>2]=o[s];break;case 2:L[r+4*s>>2]=o[s]}}else Lr.recordError(1281)}var Xs=function(e,t,r){Ys(e,t,r,2)},Js=function(e,t,r){Ys(e,t,r,0)},Ks=function(e,t,r){Ys(e,t,r,0)};function Zs(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:L[r>>2]=o;break;case 5:B[r>>2]=Math.fround(o)}else for(var s=0;s<o.length;s++)switch(n){case 0:B[r+4*s>>2]=o[s];break;case 2:L[r+4*s>>2]=o[s];break;case 5:B[r+4*s>>2]=Math.fround(o[s])}}else Lr.recordError(1281)}function Qs(e,t,r){Zs(e,t,r,0)}var ea=Qs,ta=Qs,ra=function(e,t,r){r?B[r>>2]=Ou.getVertexAttribOffset(e,t):Lr.recordError(1281)},na=function(e,t,r){Zs(e,t,r,2)},oa=function(e,t,r){Zs(e,t,r,5)},sa=function(e,t){Ou.hint(e,t)},aa=function(e,t,r){for(var n=ao[t],o=0;o<t;o++)n[o]=B[r+4*o>>2];Ou.invalidateFramebuffer(e,n)},ia=function(e,t,r,n,o,s,a){for(var i=ao[t],u=0;u<t;u++)i[u]=B[r+4*u>>2];Ou.invalidateSubFramebuffer(e,i,n,o,s,a)},ua=function(e){var t=Lr.buffers[e];return t?Ou.isBuffer(t):0},ca=function(e){return Ou.isEnabled(e)},la=function(e){var t=Lr.framebuffers[e];return t?Ou.isFramebuffer(t):0},da=function(e){return(e=Lr.programs[e])?Ou.isProgram(e):0},pa=function(e){var t=Lr.queries[e];return t?Ou.isQuery(t):0},fa=function(e){var t=Lr.queries[e];return t?Ou.disjointTimerQueryExt.isQueryEXT(t):0},ha=function(e){var t=Lr.renderbuffers[e];return t?Ou.isRenderbuffer(t):0},ga=function(e){var t=Lr.samplers[e];return t?Ou.isSampler(t):0},ma=function(e){var t=Lr.shaders[e];return t?Ou.isShader(t):0},ya=function(e){return Ou.isSync(Lr.syncs[e])},ba=function(e){var t=Lr.textures[e];return t?Ou.isTexture(t):0},_a=function(e){return Ou.isTransformFeedback(Lr.transformFeedbacks[e])};function va(e){var t=Lr.vaos[e];return t?Ou.isVertexArray(t):0}var ka=va,wa=va,Ca=function(e){Ou.lineWidth(e)},Ea=function(e){e=Lr.programs[e],Ou.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},Aa=function(e,t,r,n,o,s){Ou.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,B,t>>2,B,r>>2,B,n>>2,I,o>>2,s)},Sa=function(e,t,r,n,o,s,a,i){Ou.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,B,t>>2,r,B,n>>2,B,o>>2,B,s>>2,I,a>>2,i)},Pa=function(){Ou.pauseTransformFeedback()},xa=function(e,t){3317==e&&(Lr.unpackAlignment=t),Ou.pixelStorei(e,t)},qa=function(e,t){Ou.polygonOffset(e,t)},Ra=function(e,t,r,n){Lr.recordError(1280)},Ta=function(e,t,r){Lr.recordError(1280)},Ba=function(e,t){Ou.disjointTimerQueryExt.queryCounterEXT(Lr.queries[e],t)},Ia=function(e){Ou.readBuffer(e)};function La(e){return 0==(e-=5120)?x:1==e?q:2==e?R:4==e?B:6==e?L:5==e||28922==e||28520==e||30779==e||30782==e?I:T}function Fa(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Da(e,t,r,n,o,s){var a=La(e),i=Fa(a),u=1<<i,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,Lr.unpackAlignment);return a.subarray(o>>i,o+l>>i)}var Ma=function(e,t,r,n,o,s,a){if(Lr.currentContext.version>=2)if(Ou.currentPixelPackBufferBinding)Ou.readPixels(e,t,r,n,o,s,a);else{var i=La(s);Ou.readPixels(e,t,r,n,o,s,i,a>>Fa(i))}else{var u=Da(s,o,r,n,a);u?Ou.readPixels(e,t,r,n,o,s,u):Lr.recordError(1280)}},Oa=function(){},ja=function(e,t,r,n){Ou.renderbufferStorage(e,t,r,n)},Ua=function(e,t,r,n,o){Ou.renderbufferStorageMultisample(e,t,r,n,o)},Va=function(){Ou.resumeTransformFeedback()},Ha=function(e,t){Ou.sampleCoverage(e,!!t)},Na=function(e,t,r){Ou.samplerParameterf(Lr.samplers[e],t,r)},$a=function(e,t,r){var n=L[r>>2];Ou.samplerParameterf(Lr.samplers[e],t,n)},za=function(e,t,r){Ou.samplerParameteri(Lr.samplers[e],t,r)},Wa=function(e,t,r){var n=B[r>>2];Ou.samplerParameteri(Lr.samplers[e],t,n)},Ga=function(e,t,r,n){Ou.scissor(e,t,r,n)},Ya=function(e,t,r,n,o){Lr.recordError(1280)},Xa=function(e,t,r,n){var o=Lr.getSource(e,t,r,n);if(Lr.currentContext.version>=2&&o.includes("#version 100")){var s="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(s+="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"+s)}Ou.shaderSource(Lr.shaders[e],o)},Ja=function(e,t,r){Ou.stencilFunc(e,t,r)},Ka=function(e,t,r,n){Ou.stencilFuncSeparate(e,t,r,n)},Za=function(e){Ou.stencilMask(e)},Qa=function(e,t){Ou.stencilMaskSeparate(e,t)},ei=function(e,t,r){Ou.stencilOp(e,t,r)},ti=function(e,t,r,n){Ou.stencilOpSeparate(e,t,r,n)},ri=function(e,t,r,n,o,s,a,i,u){if(Lr.currentContext.version>=2&&(6402==a&&6402==r&&5125==i&&(r=33190),36193==i&&(i=5131,6408==a&&6408==r&&(r=34842)),34041==r&&(r=35056)),Lr.currentContext.version>=2)if(Ou.currentPixelUnpackBufferBinding)Ou.texImage2D(e,t,r,n,o,s,a,i,u);else if(u){var c=La(i);Ou.texImage2D(e,t,r,n,o,s,a,i,c,u>>Fa(c))}else Ou.texImage2D(e,t,r,n,o,s,a,i,null);else Ou.texImage2D(e,t,r,n,o,s,a,i,u?Da(i,a,n,o,u):null)},ni=function(e,t,r,n,o,s,a,i,u,c){if(Ou.currentPixelUnpackBufferBinding)Ou.texImage3D(e,t,r,n,o,s,a,i,u,c);else if(c){var l=La(u);Ou.texImage3D(e,t,r,n,o,s,a,i,u,l,c>>Fa(l))}else Ou.texImage3D(e,t,r,n,o,s,a,i,u,null)},oi=function(e,t,r){Ou.texParameterf(e,t,r)},si=function(e,t,r){var n=L[r>>2];Ou.texParameterf(e,t,n)},ai=function(e,t,r){Ou.texParameteri(e,t,r)},ii=function(e,t,r){var n=B[r>>2];Ou.texParameteri(e,t,n)},ui=function(e,t,r,n,o){Ou.texStorage2D(e,t,r,n,o)},ci=function(e,t,r,n,o,s){Ou.texStorage3D(e,t,r,n,o,s)},li=function(e,t,r,n,o,s,a,i,u){if(Lr.currentContext.version>=2&&36193==i&&(i=5131),Lr.currentContext.version>=2)if(Ou.currentPixelUnpackBufferBinding)Ou.texSubImage2D(e,t,r,n,o,s,a,i,u);else if(u){var c=La(i);Ou.texSubImage2D(e,t,r,n,o,s,a,i,c,u>>Fa(c))}else Ou.texSubImage2D(e,t,r,n,o,s,a,i,null);else{var l=null;u&&(l=Da(i,a,o,s,u)),Ou.texSubImage2D(e,t,r,n,o,s,a,i,l)}},di=function(e,t,r,n,o,s,a,i,u,c,l){if(Ou.currentPixelUnpackBufferBinding)Ou.texSubImage3D(e,t,r,n,o,s,a,i,u,c,l);else if(l){var d=La(c);Ou.texSubImage3D(e,t,r,n,o,s,a,i,u,c,d,l>>Fa(d))}else Ou.texSubImage3D(e,t,r,n,o,s,a,i,u,c,null)},pi=function(e,t,r,n){e=Lr.programs[e];for(var o=[],s=0;s<t;s++)o.push(qe(B[r+4*s>>2]));Ou.transformFeedbackVaryings(e,o,n)},fi=function(e,t){Ou.uniform1f(Gs(e),t)},hi=[],gi=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform1fv(Gs(e),L,r>>2,t);else{if(t<=288)for(var n=hi[t-1],o=0;o<t;++o)n[o]=L[r+4*o>>2];else n=L.subarray(r>>2,r+4*t>>2);Ou.uniform1fv(Gs(e),n)}},mi=function(e,t){Ou.uniform1i(Gs(e),t)},yi=[],bi=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform1iv(Gs(e),B,r>>2,t);else{if(t<=288)for(var n=yi[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(Gs(e),n)}},_i=function(e,t){Ou.uniform1ui(Gs(e),t)},vi=function(e,t,r){t&&Ou.uniform1uiv(Gs(e),I,r>>2,t)},ki=function(e,t,r){Ou.uniform2f(Gs(e),t,r)},wi=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform2fv(Gs(e),L,r>>2,2*t);else{if(t<=144)for(var n=hi[2*t-1],o=0;o<2*t;o+=2)n[o]=L[r+4*o>>2],n[o+1]=L[r+(4*o+4)>>2];else n=L.subarray(r>>2,r+8*t>>2);Ou.uniform2fv(Gs(e),n)}},Ci=function(e,t,r){Ou.uniform2i(Gs(e),t,r)},Ei=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform2iv(Gs(e),B,r>>2,2*t);else{if(t<=144)for(var n=yi[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(Gs(e),n)}},Ai=function(e,t,r){Ou.uniform2ui(Gs(e),t,r)},Si=function(e,t,r){t&&Ou.uniform2uiv(Gs(e),I,r>>2,2*t)},Pi=function(e,t,r,n){Ou.uniform3f(Gs(e),t,r,n)},xi=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform3fv(Gs(e),L,r>>2,3*t);else{if(t<=96)for(var n=hi[3*t-1],o=0;o<3*t;o+=3)n[o]=L[r+4*o>>2],n[o+1]=L[r+(4*o+4)>>2],n[o+2]=L[r+(4*o+8)>>2];else n=L.subarray(r>>2,r+12*t>>2);Ou.uniform3fv(Gs(e),n)}},qi=function(e,t,r,n){Ou.uniform3i(Gs(e),t,r,n)},Ri=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform3iv(Gs(e),B,r>>2,3*t);else{if(t<=96)for(var n=yi[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(Gs(e),n)}},Ti=function(e,t,r,n){Ou.uniform3ui(Gs(e),t,r,n)},Bi=function(e,t,r){t&&Ou.uniform3uiv(Gs(e),I,r>>2,3*t)},Ii=function(e,t,r,n,o){Ou.uniform4f(Gs(e),t,r,n,o)},Li=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform4fv(Gs(e),L,r>>2,4*t);else{if(t<=72){var n=hi[4*t-1],o=L;r>>=2;for(var s=0;s<4*t;s+=4){var a=r+s;n[s]=o[a],n[s+1]=o[a+1],n[s+2]=o[a+2],n[s+3]=o[a+3]}}else n=L.subarray(r>>2,r+16*t>>2);Ou.uniform4fv(Gs(e),n)}},Fi=function(e,t,r,n,o){Ou.uniform4i(Gs(e),t,r,n,o)},Di=function(e,t,r){if(Lr.currentContext.version>=2)t&&Ou.uniform4iv(Gs(e),B,r>>2,4*t);else{if(t<=72)for(var n=yi[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(Gs(e),n)}},Mi=function(e,t,r,n,o){Ou.uniform4ui(Gs(e),t,r,n,o)},Oi=function(e,t,r){t&&Ou.uniform4uiv(Gs(e),I,r>>2,4*t)},ji=function(e,t,r){e=Lr.programs[e],Ou.uniformBlockBinding(e,t,r)},Ui=function(e,t,r,n){if(Lr.currentContext.version>=2)t&&Ou.uniformMatrix2fv(Gs(e),!!r,L,n>>2,4*t);else{if(t<=72)for(var o=hi[4*t-1],s=0;s<4*t;s+=4)o[s]=L[n+4*s>>2],o[s+1]=L[n+(4*s+4)>>2],o[s+2]=L[n+(4*s+8)>>2],o[s+3]=L[n+(4*s+12)>>2];else o=L.subarray(n>>2,n+16*t>>2);Ou.uniformMatrix2fv(Gs(e),!!r,o)}},Vi=function(e,t,r,n){t&&Ou.uniformMatrix2x3fv(Gs(e),!!r,L,n>>2,6*t)},Hi=function(e,t,r,n){t&&Ou.uniformMatrix2x4fv(Gs(e),!!r,L,n>>2,8*t)},Ni=function(e,t,r,n){if(Lr.currentContext.version>=2)t&&Ou.uniformMatrix3fv(Gs(e),!!r,L,n>>2,9*t);else{if(t<=32)for(var o=hi[9*t-1],s=0;s<9*t;s+=9)o[s]=L[n+4*s>>2],o[s+1]=L[n+(4*s+4)>>2],o[s+2]=L[n+(4*s+8)>>2],o[s+3]=L[n+(4*s+12)>>2],o[s+4]=L[n+(4*s+16)>>2],o[s+5]=L[n+(4*s+20)>>2],o[s+6]=L[n+(4*s+24)>>2],o[s+7]=L[n+(4*s+28)>>2],o[s+8]=L[n+(4*s+32)>>2];else o=L.subarray(n>>2,n+36*t>>2);Ou.uniformMatrix3fv(Gs(e),!!r,o)}},$i=function(e,t,r,n){t&&Ou.uniformMatrix3x2fv(Gs(e),!!r,L,n>>2,6*t)},zi=function(e,t,r,n){t&&Ou.uniformMatrix3x4fv(Gs(e),!!r,L,n>>2,12*t)},Wi=function(e,t,r,n){if(Lr.currentContext.version>=2)t&&Ou.uniformMatrix4fv(Gs(e),!!r,L,n>>2,16*t);else{if(t<=18){var o=hi[16*t-1],s=L;n>>=2;for(var a=0;a<16*t;a+=16){var i=n+a;o[a]=s[i],o[a+1]=s[i+1],o[a+2]=s[i+2],o[a+3]=s[i+3],o[a+4]=s[i+4],o[a+5]=s[i+5],o[a+6]=s[i+6],o[a+7]=s[i+7],o[a+8]=s[i+8],o[a+9]=s[i+9],o[a+10]=s[i+10],o[a+11]=s[i+11],o[a+12]=s[i+12],o[a+13]=s[i+13],o[a+14]=s[i+14],o[a+15]=s[i+15]}}else o=L.subarray(n>>2,n+64*t>>2);Ou.uniformMatrix4fv(Gs(e),!!r,o)}},Gi=function(e,t,r,n){t&&Ou.uniformMatrix4x2fv(Gs(e),!!r,L,n>>2,8*t)},Yi=function(e,t,r,n){t&&Ou.uniformMatrix4x3fv(Gs(e),!!r,L,n>>2,12*t)},Xi=function(e){e=Lr.programs[e],Ou.useProgram(e),Ou.currentProgram=e},Ji=function(e){Ou.validateProgram(Lr.programs[e])},Ki=function(e,t){Ou.vertexAttrib1f(e,t)},Zi=function(e,t){Ou.vertexAttrib1f(e,L[t>>2])},Qi=function(e,t,r){Ou.vertexAttrib2f(e,t,r)},eu=function(e,t){Ou.vertexAttrib2f(e,L[t>>2],L[t+4>>2])},tu=function(e,t,r,n){Ou.vertexAttrib3f(e,t,r,n)},ru=function(e,t){Ou.vertexAttrib3f(e,L[t>>2],L[t+4>>2],L[t+8>>2])},nu=function(e,t,r,n,o){Ou.vertexAttrib4f(e,t,r,n,o)},ou=function(e,t){Ou.vertexAttrib4f(e,L[t>>2],L[t+4>>2],L[t+8>>2],L[t+12>>2])};function su(e,t){Ou.vertexAttribDivisor(e,t)}var au=su,iu=su,uu=su,cu=su,lu=su,du=function(e,t,r,n,o){Ou.vertexAttribI4i(e,t,r,n,o)},pu=function(e,t){Ou.vertexAttribI4i(e,B[t>>2],B[t+4>>2],B[t+8>>2],B[t+12>>2])},fu=function(e,t,r,n,o){Ou.vertexAttribI4ui(e,t,r,n,o)},hu=function(e,t){Ou.vertexAttribI4ui(e,I[t>>2],I[t+4>>2],I[t+8>>2],I[t+12>>2])},gu=function(e,t,r,n,o){Ou.vertexAttribIPointer(e,t,r,n,o)},mu=function(e,t,r,n,o,s){Ou.vertexAttribPointer(e,t,r,!!n,o,s)},yu=function(e,t,r,n){Ou.viewport(e,t,r,n)},bu=function(e,t,r){r=Number(r),Ou.waitSync(Lr.syncs[e],t,r)},_u=e=>{var t=e-E.buffer.byteLength+65535>>>16;try{return E.grow(t),U(),1}catch(e){}},vu={inEventHandler:0,removeAllEventListeners:function(){for(var e=vu.eventHandlers.length-1;e>=0;--e)vu._removeHandler(e);vu.eventHandlers=[],vu.deferredCalls=[]},registerRemoveEventListeners:function(){vu.removeEventListenersRegistered||(z.push(vu.removeAllEventListeners),vu.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 vu.deferredCalls){var s=vu.deferredCalls[o];if(s.targetFunction==e&&n(s.argsList,r))return}vu.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),vu.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<vu.deferredCalls.length;++t)vu.deferredCalls[t].targetFunction==e&&(vu.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return navigator.userActivation?navigator.userActivation.isActive:vu.inEventHandler&&vu.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(vu.canPerformEventHandlerRequests())for(var e=0;e<vu.deferredCalls.length;++e){var t=vu.deferredCalls[e];vu.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<vu.eventHandlers.length;++r)vu.eventHandlers[r].target!=e||t&&t!=vu.eventHandlers[r].eventTypeString||vu._removeHandler(r--)},_removeHandler:function(e){var t=vu.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),vu.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){if(!e.target)return-4;var t=function(t){++vu.inEventHandler,vu.currentEventHandler=e,vu.runDeferredCalls(),e.handlerFunc(t),vu.runDeferredCalls(),--vu.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),vu.eventHandlers.push(e),vu.registerRemoveEventListeners();else for(var r=0;r<vu.eventHandlers.length;++r)vu.eventHandlers[r].target==e.target&&vu.eventHandlers[r].eventTypeString==e.eventTypeString&&vu._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}},ku=["default","low-power","high-performance"],wu=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];function Cu(e){var t;return e=(t=e)>2?qe(t):t,wu[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}var Eu,Au,Su,Pu=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:ku[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]},s=function(e){return Cu(e)}(e);return s?o.explicitSwapControl?0:Lr.createContext(s,o):0},xu={},qu=()=>{if(!qu.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",_:f||"./this.program"};for(var t in xu)void 0===xu[t]?delete e[t]:e[t]=xu[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);qu.strings=r}return qu.strings},Ru=(e,t,r,n)=>{for(var o=0,s=0;s<r;s++){var a=I[t>>2],i=I[t+4>>2];t+=8;var u=xe.read(e,x,a,i,n);if(u<0)return-1;if(o+=u,u<i)break;void 0!==n&&(n+=u)}return o},Tu=[31,29,31,30,31,30,31,31,30,31,30,31],Bu=[31,28,31,30,31,30,31,31,30,31,30,31],Iu=(e,t)=>{x.set(e,t)},Lu=(e,t,r,n)=>{var o=B[n+40>>2],s={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),i={"%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 i)a=a.replace(new RegExp(u,"g"),i[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 p(e,t){return d(e,t,"0")}function f(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 g(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=mr(r.getFullYear()),o=r.getMonth(),s=(n?Tu:Bu)[o];if(!(t>s-r.getDate()))return r.setDate(r.getDate()+t),r;t-=s-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),s=h(n);return f(o,t)<=0?f(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var m={"%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=>p((e.tm_year+1900)/100|0,2),"%d":e=>p(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>p(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":e=>p(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(mr(e.tm_year+1900)?Tu:Bu,e.tm_mon-1),3),"%m":e=>p(e.tm_mon+1,2),"%M":e=>p(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>p(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return p(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&&mr(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&mr(e.tm_year%400-1))&&t++}return p(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return p(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"),m)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),m[u](s)));var y=we(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(Iu(y,e),y.length-1)},Fu=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=xe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Du=365,Mu=146;Object.defineProperties(Fu.prototype,{read:{get:function(){return(this.mode&Du)===Du},set:function(e){e?this.mode|=Du:this.mode&=-366}},write:{get:function(){return(this.mode&Mu)===Mu},set:function(e){e?this.mode|=Mu:this.mode&=-147}},isFolder:{get:function(){return xe.isDir(this.mode)}},isDevice:{get:function(){return xe.isChrdev(this.mode)}}}),xe.FSNode=Fu,xe.createPreloadedFile=function(e,t,r,n,o,s,a,i,u,c){var d=t?me.resolve(he.join2(e,t)):e;function p(r){function l(r){c&&c(),i||xe.createDataFile(e,t,r,n,o,u),s&&s(),Z()}(function(e,t,r,n){void 0!==Sr&&Sr.init();var o=!1;return Se.forEach((function(s){o||s.canHandle(t)&&(s.handle(e,t,r,n),o=!0)})),o})(r,d,l,(()=>{a&&a(),Z()}))||l(r)}K(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;l(e,(r=>{j(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&Z()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&K()})(r,(e=>p(e)),a):p(r)},xe.staticInit(),u.FS_createPath=xe.createPath,u.FS_createDataFile=xe.createDataFile,u.FS_createPreloadedFile=xe.createPreloadedFile,u.FS_unlink=xe.unlink,u.FS_createLazyFile=xe.createLazyFile,u.FS_createDevice=xe.createDevice,Me=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);He=e}(),$e=u.BindingError=class BindingError extends Error{constructor(e){super(e),this.name="BindingError"}},yt.prototype.isAliasOf=Xe,yt.prototype.clone=ft,yt.prototype.delete=ht,yt.prototype.isDeleted=gt,yt.prototype.deleteLater=mt,u.getInheritedInstanceCount=rt,u.getLiveInheritedInstances=nt,u.flushPendingDeletes=st,u.setDelayFunction=it,Bt.prototype.getPointee=qt,Bt.prototype.destructor=Rt,Bt.prototype.argPackAdvance=8,Bt.prototype.readValueFromPointer=Ie,Bt.prototype.deleteObject=Tt,Bt.prototype.fromWireType=dt,Mt=u.UnboundTypeError=(Eu=Error,(Su=kt(Au="UnboundTypeError",(function(e){this.name=Au,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(Eu.prototype),Su.prototype.constructor=Su,Su.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},Su),Object.assign(Nt.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)}}),$t.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),$t.reserved=$t.allocated.length,u.count_emval_handles=Wt,u.requestFullscreen=function(e,t){Sr.requestFullscreen(e,t)},u.requestAnimationFrame=function(e){Sr.requestAnimationFrame(e)},u.setCanvasSize=function(e,t,r){Sr.setCanvasSize(e,t,r)},u.pauseMainLoop=function(){Sr.mainLoop.pause()},u.resumeMainLoop=function(){Sr.mainLoop.resume()},u.getUserMedia=function(){Sr.getUserMedia()},u.createContext=function(e,t,r,n){return Sr.createContext(e,t,r,n)};for(var Ou,ju={},Uu={},Vu=0;Vu<32;++Vu)ao.push(new Array(Vu));var Hu=new Float32Array(288);for(Vu=0;Vu<288;++Vu)hi[Vu]=Hu.subarray(0,Vu+1);var Nu=new Int32Array(288);for(Vu=0;Vu<288;++Vu)yi[Vu]=Nu.subarray(0,Vu+1);var $u,zu={Ha:function(e){var t=new pe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),le.push(t),sc(t.excPtr),t.get_exception_ptr()},Ga:function(){ec(0,0);var e=le.pop();oc(e.excPtr),de=0},o:()=>fe([]),aa:e=>fe([e]),k:function(e,t,r){throw new pe(e).init(t,r),de=e},M:function(e){throw de||(de=e),de},da:function(e,t,r){Re.varargs=r;try{var n=Re.getStreamFromFD(e);switch(t){case 0:return(o=Re.get())<0?-28:xe.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Re.get();return n.flags|=o,0;case 5:return o=Re.get(),R[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return s=28,B[Yu()>>2]=s,-1}}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}var s},yb:function(e,t){try{var r=Re.getStreamFromFD(e);return Re.doStat(xe.stat,r.path,t)}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},Db:function(e,t,r){Re.varargs=r;try{var n=Re.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),s=Re.get();B[s>>2]=o.c_iflag||0,B[s+4>>2]=o.c_oflag||0,B[s+8>>2]=o.c_cflag||0,B[s+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)x[s+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){s=Re.get();var i=B[s>>2],u=B[s+4>>2],c=B[s+8>>2],l=B[s+12>>2],d=[];for(a=0;a<32;a++)d.push(x[s+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,t,{c_iflag:i,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(s=Re.get(),B[s>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return s=Re.get(),xe.ioctl(n,t,s);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var p=n.tty.ops.ioctl_tiocgwinsz(n.tty);s=Re.get(),R[s>>1]=p[0],R[s+2>>1]=p[1]}return 0;default:return-28}}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t){try{return e=Re.getStr(e),Re.doStat(xe.lstat,e,t)}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,r,n){try{t=Re.getStr(t);var o=256&n,s=4096&n;return n&=-6401,t=Re.calculateAt(e,t,s),Re.doStat(o?xe.lstat:xe.stat,t,r)}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},qa:function(e,t,r,n){Re.varargs=n;try{t=Re.getStr(t),t=Re.calculateAt(e,t);var o=n?Re.get():0;return xe.open(t,r,o).fd}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=Re.getStr(e),Re.doStat(xe.stat,e,t)}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},ua:function(e){var t=Te[e];delete Te[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),s=t.rawConstructor,a=t.rawDestructor;je([e],o,(function(e){return r.forEach(((t,r)=>{var o=e[r],s=t.getter,a=t.getterContext,i=e[r+n],u=t.setter,c=t.setterContext;t.read=e=>o.fromWireType(s(a,e)),t.write=(e,t)=>{var r=[];u(c,e,i.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 i=s(),u=0;u<n;++u)r[u].write(i,o[u]);return null!==e&&e.push(a,i),i},argPackAdvance:8,readValueFromPointer:Ie,destructorFunction:a}]}))},y:function(e){var t=Ue[e];delete Ue[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;je([e],o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType))),(e=>{var s={};return o.forEach(((t,r)=>{var n=t.fieldName,a=e[r],i=t.getter,u=t.getterContext,c=e[r+o.length],l=t.setter,d=t.setterContext;s[n]={read:e=>a.fromWireType(i(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 s)t[r]=s[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in s)if(!(o in t))throw new TypeError(`Missing field: "${o}"`);var a=r();for(o in s)s[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Ie,destructorFunction:n}]}))},ya:function(e,t,r,n,o){t=Ne(t);var s=Ye(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),We(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${Ve(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${Ve(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:Ge(t,s,!a),destructorFunction:null})},je:function(e,t,r,n,o){var s=Ye(r);We(e,{name:t=Ne(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=x;else if(2===r)n=R;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=B}return this.fromWireType(n[e>>s])},destructorFunction:null})},v:function(e,t,r,n,o,s,a,i,u,c,l,d,p){l=Ne(l),s=Dt(o,s),i&&(i=Dt(a,i)),c&&(c=Dt(u,c)),p=Dt(d,p);var f=vt(l);Ct(f,(function(){jt(`Cannot construct ${l} due to unbound types`,[n])})),je([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:yt.prototype;var a=kt(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new $e("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new $e(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new $e(`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 Et(l,a,u,p,r,s,i,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),g=new Bt(l+"*",d,!1,!1,!1),m=new Bt(l+" const*",d,!1,!0,!1);return tt[e]={pointerType:g,constPointerType:m},It(f,a),[h,g,m]}))},w:function(e,t,r,n,o,s){var a=Ut(t,r);o=Dt(n,o),je([],[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 $e(`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]=()=>{jt(`Cannot construct ${e.name} due to unbound types`,a)},je([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ht(r,n,null,o,s),[]})),[]}))},d:function(e,t,r,n,o,s,a,i,u){var c=Ut(r,n);t=Ne(t),s=Dt(o,s),je([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){jt(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),i&&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):(wt(l,t,n),l[t].overloadTable[r-2]=o),je([],c,(function(o){var i=Ht(n,o,e,s,a,u);return void 0===l[t].overloadTable?(i.argCount=r-2,l[t]=i):l[t].overloadTable[r-2]=i,[]})),[]}))},ie:function(e,t){We(e,{name:t=Ne(t),fromWireType:function(e){var t=Gt.toValue(e);return zt(e),t},toWireType:function(e,t){return Gt.toHandle(t)},argPackAdvance:8,readValueFromPointer:Ie,destructorFunction:null})},V:function(e,t,r,n){var o=Ye(r);function s(){}t=Ne(t),s.values={},We(e,{name:t,constructor:s,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:Yt(t,o,n),destructorFunction:null}),Ct(t,s)},A:function(e,t,r){var n=Xt(e,"enum");t=Ne(t);var o=n.constructor,s=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:kt(`${n.name}_${t}`,(function(){}))}});o.values[r]=s,o[t]=s},xa:function(e,t,r){var n=Ye(r);We(e,{name:t=Ne(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Jt(t,n),destructorFunction:null})},L:function(e,t,r,n,o,s,a){var i=Ut(t,r);e=Ne(e),o=Dt(n,o),Ct(e,(function(){jt(`Cannot call ${e} due to unbound types`,i)}),t-1),je([],i,(function(r){var n=[r[0],null].concat(r.slice(1));return It(e,Ht(e,n,null,o,s,a),t-1),[]}))},R:function(e,t,r,n,o){t=Ne(t),-1===o&&(o=4294967295);var s=Ye(r),a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var u=t.includes("unsigned");We(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:Ge(t,s,0!==n),destructorFunction:null})},D:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=I,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}We(e,{name:r=Ne(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ge:function(e,t,r,n,o,s,a,i,u,c,l,d){r=Ne(r),s=Dt(o,s),i=Dt(a,i),c=Dt(u,c),d=Dt(l,d),je([e],[t],(function(e){return e=e[0],[new Bt(r,e.registeredClass,!1,!1,!0,e,n,s,i,c,d)]}))},wa:function(e,t){var r="std::string"===(t=Ne(t));We(e,{name:t,fromWireType:function(e){var t,n=I[e>>2],o=e+4;if(r)for(var s=o,a=0;a<=n;++a){var i=o+a;if(a==n||0==q[i]){var u=qe(s,i-s);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),s=i+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(q[o+a]);t=c.join("")}return Gu(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||ze("Cannot pass non-string to std::string"),n=r&&o?ve(t):t.length;var s=Wu(4+n+1),a=s+4;if(I[s>>2]=n,r&&o)Kt(t,a,n+1);else if(o)for(var i=0;i<n;++i){var u=t.charCodeAt(i);u>255&&(Gu(a),ze("String has UTF-16 code units that do not fit in 8 bits")),q[a+i]=u}else for(i=0;i<n;++i)q[a+i]=t[i];return null!==e&&e.push(Gu,s),s},argPackAdvance:8,readValueFromPointer:Ie,destructorFunction:function(e){Gu(e)}})},fa:function(e,t,r){var n,o,s,a,i;r=Ne(r),2===t?(n=Qt,o=er,a=tr,s=()=>T,i=1):4===t&&(n=rr,o=nr,a=or,s=()=>I,i=2),We(e,{name:r,fromWireType:function(e){for(var r,o=I[e>>2],a=s(),u=e+4,c=0;c<=o;++c){var l=e+4+c*t;if(c==o||0==a[l>>i]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return Gu(e),r},toWireType:function(e,n){"string"!=typeof n&&ze(`Cannot pass non-string to C++ string type ${r}`);var s=a(n),u=Wu(4+s+t);return I[u>>2]=s>>i,o(n,u+4,s+t),null!==e&&e.push(Gu,u),u},argPackAdvance:8,readValueFromPointer:Ie,destructorFunction:function(e){Gu(e)}})},va:function(e,t,r,n,o,s){Te[e]={name:Ne(t),rawConstructor:Dt(r,n),rawDestructor:Dt(o,s),elements:[]}},Q:function(e,t,r,n,o,s,a,i,u){Te[e].elements.push({getterReturnType:t,getter:Dt(r,n),getterContext:o,setterArgumentType:s,setter:Dt(a,i),setterContext:u})},z:function(e,t,r,n,o,s){Ue[e]={name:Ne(t),rawConstructor:Dt(r,n),rawDestructor:Dt(o,s),fields:[]}},n:function(e,t,r,n,o,s,a,i,u,c){Ue[e].fields.push({fieldName:Ne(t),getterReturnType:r,getter:Dt(n,o),getterContext:s,setterArgumentType:a,setter:Dt(i,u),setterContext:c})},ke:function(e,t){We(e,{isVoid:!0,name:t=Ne(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Bb:()=>!0,hb:()=>{throw 1/0},j:function(e,t,r){e=Gt.toValue(e),t=Xt(t,"emval::as");var n=[],o=Gt.toHandle(n);return I[r>>2]=o,t.toWireType(n,e)},u:function(e,t,r,n){e=Gt.toValue(e);for(var o=sr(t,r),s=new Array(t),a=0;a<t;++a){var i=o[a];s[a]=i.readValueFromPointer(n),n+=i.argPackAdvance}var u=e.apply(void 0,s);return Gt.toHandle(u)},X:function(e,t,r,n,o){return(e=ur[e])(t=Gt.toValue(t),r=ir(r),function(e){var t=[];return I[e>>2]=Gt.toHandle(t),t}(n),o)},P:function(e,t,r,n){(e=ur[e])(t=Gt.toValue(t),r=ir(r),null,n)},c:zt,de:function(e,t){return(e=Gt.toValue(e))==(t=Gt.toValue(t))},F:function(e){return 0===e?Gt.toHandle(cr()):(e=ir(e),Gt.toHandle(cr()[e]))},J:function(e,t){var r=sr(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",s=lr[o];if(void 0!==s)return s;for(var a=["retType"],i=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),i.push(r[1+c]);var l="return function "+vt("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 p,f,h=Vt(Function,a).apply(null,i);return p=h,f=ur.length,ur.push(p),s=f,lr[o]=s,s},h:function(e,t){return e=Gt.toValue(e),t=Gt.toValue(t),Gt.toHandle(e[t])},e:function(e){e>4&&($t.get(e).refcount+=1)},$:function(e,t){return(e=Gt.toValue(e))instanceof(t=Gt.toValue(t))},ea:function(e){return"number"==typeof(e=Gt.toValue(e))},N:function(e){return"string"==typeof(e=Gt.toValue(e))},ze:function(e,t,r,n){e=Gt.toValue(e);var o=dr[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)(Xt,u,Gt.toHandle,(()=>I))}(t),dr[t]=o),o(e,r,n)},I:function(){return Gt.toHandle([])},g:function(e){return Gt.toHandle(ir(e))},C:function(){return Gt.toHandle({})},i:function(e){Be(Gt.toValue(e)),zt(e)},m:function(e,t,r){e=Gt.toValue(e),t=Gt.toValue(t),r=Gt.toValue(r),e[t]=r},f:function(e,t){var r=(e=Xt(e,"_emval_take_value")).readValueFromPointer(t);return Gt.toHandle(r)},se:function(e){throw e=Gt.toValue(e)},Oc:function(e){return e=Gt.toValue(e),Gt.toHandle(typeof e)},pb:function(e,t){e=hr(e),t=hr(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},qb:function(e,t){e=hr(e),t=hr(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|_r(r);B[t+28>>2]=n,B[t+36>>2]=-60*r.getTimezoneOffset();var o=new Date(r.getFullYear(),0,1),s=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),i=0|(s!=a&&r.getTimezoneOffset()==Math.min(a,s));B[t+32>>2]=i},rb:function(e){e=hr(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),s=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),i=Math.min(a,s);if(r<0)B[e+32>>2]=Number(s!=a&&i==n);else if(r>0!=(i==n)){var u=Math.max(a,s),c=r>0?i:u;t.setTime(t.getTime()+6e4*(c-n))}B[e+24>>2]=t.getDay();var l=0|_r(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)},mb:function(e,t,r,n,o,s,a){e=hr(e),o=hr(o),s=hr(s),a=hr(a);try{if(isNaN(o))return 61;var i=Re.getStreamFromFD(n),u=xe.mmap(i,e,o,t,r),c=u.ptr;return B[s>>2]=u.allocated,I[a>>2]=c,0}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},nb:function(e,t,r,n,o,s){e=hr(e),t=hr(t),s=hr(s);try{if(isNaN(s))return 61;var a=Re.getStreamFromFD(o);2&r&&Re.doMsync(e,a,t,n,s),xe.munmap(a)}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return-e.errno}},ib:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),s=new Date(n,6,1),a=o.getTimezoneOffset(),i=s.getTimezoneOffset(),u=Math.max(a,i);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[e>>2]=60*u,B[t>>2]=Number(a!=i);var l=c(o),d=c(s),p=vr(l),f=vr(d);i<a?(I[r>>2]=p,I[r+4>>2]=f):(I[r>>2]=f,I[r+4>>2]=p)},b:()=>{Q("")},oa:function(e,t,r,n,o){return Pr.chooseConfig(e,t,r,n,o)},pa:function(e,t,r,n){if(62e3!=e)return Pr.setErrorCode(12296),0;for(var o=1;;){var s=B[n>>2];if(12440!=s){if(12344==s)break;return Pr.setErrorCode(12292),0}o=B[n+4>>2],n+=8}return o<2||o>3?(Pr.setErrorCode(12293),0):(Pr.contextAttributes.majorVersion=o-1,Pr.contextAttributes.minorVersion=0,Pr.context=Lr.createContext(u.canvas,Pr.contextAttributes),0!=Pr.context?(Pr.setErrorCode(12288),Lr.makeContextCurrent(Pr.context),u.useWebGL=!0,Sr.moduleContextCreatedCallbacks.forEach((function(e){e()})),Lr.makeContextCurrent(null),62004):(Pr.setErrorCode(12297),0))},$a:function(e,t,r,n){return 62e3!=e?(Pr.setErrorCode(12296),0):62002!=t?(Pr.setErrorCode(12293),0):(Pr.setErrorCode(12288),62006)},ic:function(e,t){return 62e3!=e?(Pr.setErrorCode(12296),0):62004!=t?(Pr.setErrorCode(12294),0):(Lr.deleteContext(Pr.context),Pr.setErrorCode(12288),Pr.currentContext==t&&(Pr.currentContext=0),1)},Zb:function(e,t){return 62e3!=e?(Pr.setErrorCode(12296),0):62006!=t?(Pr.setErrorCode(12301),1):(Pr.currentReadSurface==t&&(Pr.currentReadSurface=0),Pr.currentDrawSurface==t&&(Pr.currentDrawSurface=0),Pr.setErrorCode(12288),1)},T:function(e,t,r,n){if(62e3!=e)return Pr.setErrorCode(12296),0;if(62002!=t)return Pr.setErrorCode(12293),0;if(!n)return Pr.setErrorCode(12300),0;switch(Pr.setErrorCode(12288),r){case 12320:return B[n>>2]=Pr.contextAttributes.alpha?32:24,1;case 12321:return B[n>>2]=Pr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return B[n>>2]=8,1;case 12325:return B[n>>2]=Pr.contextAttributes.depth?24:0,1;case 12326:return B[n>>2]=Pr.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]=Pr.contextAttributes.antialias?4:0,1;case 12338:return B[n>>2]=Pr.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 Pr.setErrorCode(12292),0}},ob:function(e){return Pr.setErrorCode(12288),62e3},ta:function(){return Pr.errorCode},eb:function(e,t,r){return 62e3!=e?(Pr.setErrorCode(12296),0):(t&&(B[t>>2]=1),r&&(B[r>>2]=4),Pr.defaultDisplayInitialized=!0,Pr.setErrorCode(12288),1)},zb:function(e,t,r,n){return 62e3!=e?(Pr.setErrorCode(12296),0):0!=n&&62004!=n?(Pr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(Pr.setErrorCode(12301),0):(Lr.makeContextCurrent(n?Pr.context:null),Pr.currentContext=n,Pr.currentDrawSurface=t,Pr.currentReadSurface=r,Pr.setErrorCode(12288),1)},tc:function(e,t){if(Pr.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return Pr.setErrorCode(12288),1;Pr.setErrorCode(12302)}else Pr.setErrorCode(12290);else Pr.setErrorCode(12289);return 0},Ob:function(e){return 62e3!=e?(Pr.setErrorCode(12296),0):(Pr.currentContext=0,Pr.currentReadSurface=0,Pr.currentDrawSurface=0,Pr.defaultDisplayInitialized=!1,Pr.setErrorCode(12288),1)},K:(e,t,r)=>Dr(e,t,r),we:e=>{console.error(qe(e))},xe:e=>{console.log(qe(e))},ha:e=>{console.warn(qe(e))},ba:function(){return Date.now()},me:function(){},jb:()=>2147483648,Ab:gr,Wf:Mr,Xf:Or,Yc:jr,ee:Ur,Kc:Vr,Yf:Hr,Zf:Nr,Hc:$r,Ic:zr,Ye:Wr,Ze:Gr,Ie:Yr,_f:Xr,Vb:Jr,sf:Zr,vf:Qr,$f:en,ag:tn,Sd:rn,bg:nn,Rd:on,Se:sn,cg:an,dg:un,_e:cn,eg:ln,kc:dn,lc:pn,nc:fn,mc:hn,fg:gn,Qd:mn,gg:yn,Da:bn,hg:_n,ig:vn,jg:kn,bd:wn,kg:Cn,ad:En,Qe:An,Pd:Sn,lg:Pn,cd:xn,mg:qn,ng:Rn,og:Tn,pg:Bn,$e:In,qg:Ln,_c:Fn,ge:Dn,af:Mn,Je:On,rg:jn,Re:Un,sg:Vn,Ub:Hn,tf:$n,wf:zn,Od:Wn,tg:Gn,Nd:Yn,Md:Xn,ug:Jn,vg:Kn,wg:Zn,qf:eo,Vd:to,Gb:ro,of:no,hd:oo,Hb:so,mf:uo,fd:co,Wd:lo,xg:fo,rf:go,Ud:mo,Eb:yo,pf:bo,Fb:_o,gd:vo,ff:ko,yg:wo,zg:Co,Xc:Eo,ce:Ao,Jc:So,Oe:Po,Ag:xo,Bg:qo,bf:Ro,cf:To,Nc:Bo,Cg:Io,Dg:Fo,df:Do,$c:Mo,he:Oo,ef:jo,Ke:Uo,Eg:Vo,Tb:Ho,uf:$o,xf:zo,Ue:Wo,Ld:Yo,Kd:Xo,ec:Jo,fc:Ko,hc:Zo,Jd:Qo,Id:es,Hd:ns,$b:os,Fg:ss,Gg:as,Hg:us,xc:cs,Ve:ls,ac:ps,cc:fs,Lc:hs,gh:gs,Kb:ms,Pb:ys,Ig:bs,Jg:_s,Zd:ks,$d:Cs,Yd:Es,Vc:As,_d:Ss,Wc:Ps,ae:xs,We:qs,Wb:Rs,Xb:Ts,Kg:Bs,Ee:Is,Gd:Ls,Lg:Fs,Ca:Ds,hh:Ms,bc:Os,Fd:js,Ed:Us,Fc:Vs,gc:Hs,jc:Ns,Mg:Ws,Dd:Xs,Cd:Js,yc:Ks,Ec:ea,Dc:ta,zd:ra,Bd:na,Ad:oa,yd:sa,Fe:aa,He:ia,xd:ua,wd:ca,vd:la,ud:da,Zc:pa,fe:fa,td:ha,_b:ga,sd:ma,Pe:ya,Ng:ba,Sb:_a,Mc:ka,Xd:wa,Og:Ca,Pg:Ea,kf:Aa,lf:Sa,Rb:Pa,Qg:xa,rd:qa,Nb:Ra,Mb:Ta,be:Ba,nf:Ia,Rg:Ma,qd:Oa,Xe:ja,Te:Ua,Qb:Va,pd:Ha,Le:Na,Yb:$a,Me:za,Ne:Wa,Sg:Ga,od:Ya,Tg:Xa,Ug:Ja,Vg:Ka,Wg:Za,Xg:Qa,Yg:ei,Zg:ti,_g:ri,ed:ni,$g:oi,ah:si,bh:ai,ch:ii,gf:ui,Lb:ci,dh:li,dd:di,Gc:pi,eh:fi,fh:gi,Sf:mi,Tf:bi,wc:_i,rc:vi,Uf:ki,Vf:wi,Rf:Ci,Qf:Ei,vc:Ai,qc:Si,Pf:Pi,Of:xi,Nf:qi,Mf:Ri,uc:Ti,pc:Bi,Lf:Ii,Kf:Li,yf:Fi,zf:Di,sc:Mi,oc:Oi,dc:ji,Af:Ui,Uc:Vi,Sc:Hi,Bf:Ni,Tc:$i,Qc:zi,Cf:Wi,Rc:Gi,Pc:Yi,Df:Xi,nd:Ji,Ef:Ki,md:Zi,ld:Qi,Ff:eu,kd:tu,Gf:ru,jd:nu,Hf:ou,hf:au,Td:iu,Ib:uu,id:cu,Jb:lu,Cc:du,Ac:pu,Bc:fu,zc:hu,jf:gu,If:mu,Jf:yu,Ea:bu,Cb:(e,t,r)=>q.copyWithin(e,t,t+r),kb:e=>{var t=q.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n,o,s=1;s<=4;s*=2){var a=t*(1+.2/s);a=Math.min(a,e+100663296);var i=Math.min(r,(n=Math.max(e,a))+((o=65536)-n%o)%o);if(_u(i))return!0}return!1},Va:function(e,t,r,n,o,s,a,i,c){const l=u.UTF8ToString(e,e+t),d=u.HEAPU8.subarray(o,o+s),p=u.emscripten_ubq_codec_audioDecoderNextHandle++,f={codec:l,sampleRate:r,numberOfChannels:n,description:d};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,i,c);AudioDecoder.isConfigSupported(f).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(f),u.emscripten_ubq_codec_audioDecoders.set(p,{audioDecoder:e,decoderConfig:f,leftBufferPtr:a,rightBufferPtr:i,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:p})},Ma:function(e,t,r,n,o,s){const a=u.UTF8ToString(e,e+t),i=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(i,t,e.byteLength,s),u._free(t)},error:e=>console.error(e)});e.configure(c),u.emscripten_ubq_codec_audioEncoders.set(i,{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:i})},_a:function(e,t,r,n,o,s,a){const i=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(o,o+s),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:i,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})},Qa:function(e,t,r,n,o,s){const a=u.UTF8ToString(e,e+t),i=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(i,t,e.byteLength,s),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(i,{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:i})},Ra:function(e,t,r,n,o,s){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 i=a.audioDecoder,c=u.HEAPU8.subarray(o,o+s),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{i.decode(l)}catch(e){return i.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})},Ia:function(e,t,r,n,o,s){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 i=a.videoDecoder,c=u.HEAPU8.subarray(o,o+s),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:c});try{i.decode(l)}catch(e){return i.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})},Ua: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)}},La: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)},Ya: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)}},Pa: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)},Ka:function(e,t,r){const n=1e6,o=u.emscripten_ubq_codec_audioEncoders.get(e),s=o.audioEncoderConfig.sampleRate,a=o.audioEncoderConfig.numberOfChannels,i=r/a,c=Math.round(n*(o.frameIndex*i/s)),l=Math.round(n*(i/s)),d=u.HEAPF32.subarray(t/4,t/4+r),p=new AudioData({format:"f32",sampleRate:s,numberOfFrames:i,numberOfChannels:a,duration:l,timestamp:c,data:d});o.audioEncoder.encode(p),o.frameIndex++,p.close()},Oa:function(e,t,r){const n=1e6,o=u.emscripten_ubq_codec_videoEncoders.get(e),s=Math.round(n*(o.frameIndex/o.encoderConfig.framerate)),a=o.frameIndex%o.groupOfPictures==0,i=Math.round(n/o.encoderConfig.framerate),c=u.specialHTMLTargets["!canvas"],l=new VideoFrame(c,{timestamp:s,duration:i});o.videoEncoder.encode(l,{keyFrame:a}),l.close(),o.frameIndex++},Ja:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Na:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Ta: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},ka:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},la: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},Sa:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Xa: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},Wa:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za: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]=Lr.textures[o[e]]},qe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},ga:function(e,t,r,n){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ue:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ve:function(e,t,r,n,o,s,a,i,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,n,o,s,a,i,c).handle},ne: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},pe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},oe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},za: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},re: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},bb:function(){return!!u.emscripten_ubq_settings_forceWebGL1},na:Pu,ma:function(e){Lr.currentContext==e&&(Lr.currentContext=0),Lr.deleteContext(e)},cb:function(e,t){var r=Lr.getContext(e),n=qe(t);return n.startsWith("GL_")&&(n=n.substr(3)),"ANGLE_instanced_arrays"==n&&xr(Ou),"OES_vertex_array_object"==n&&qr(Ou),"WEBGL_draw_buffers"==n&&Rr(Ou),"WEBGL_draw_instanced_base_vertex_base_instance"==n&&Tr(Ou),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&Br(Ou),"WEBGL_multi_draw"==n&&Ir(Ou),!!r.GLctx.getExtension(n)},ab: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},db:function(e){return Lr.makeContextCurrent(e)?0:-5},tb:(e,t)=>{var r=0;return qu().forEach((function(n,o){var s=t+r;I[e+4*o>>2]=s,((e,t)=>{for(var r=0;r<e.length;++r)x[t++>>0]=e.charCodeAt(r);x[t>>0]=0})(n,s),r+=n.length+1})),0},ub:(e,t)=>{var r=qu();I[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),I[t>>2]=n,0},ye:Cr,ca:function(e){try{var t=Re.getStreamFromFD(e);return xe.close(t),0}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return e.errno}},lb:function(e,t,r,n,o){t=hr(t),r=hr(r),n=hr(n),o=hr(o);try{if(isNaN(n))return 61;var s=Re.getStreamFromFD(e),a=Ru(s,t,r,n);return I[o>>2]=a,0}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return e.errno}},sa:function(e,t,r,n){try{var o=Re.getStreamFromFD(e),s=Ru(o,t,r);return I[n>>2]=s,0}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return e.errno}},sb:function(e,t,r,n){t=hr(t),n=hr(n);try{if(isNaN(t))return 61;var o=Re.getStreamFromFD(e);return xe.llseek(o,t,r),F[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===xe||"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,s=0;s<r;s++){var a=I[t>>2],i=I[t+4>>2];t+=8;var u=xe.write(e,x,a,i,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(Re.getStreamFromFD(e),t,r);return I[n>>2]=o,0}catch(e){if(void 0===xe||"ErrnoError"!==e.name)throw e;return e.errno}},le:function(){return"undefined"!=typeof window?vr(window.location.hostname):vr("")},fb:(e,t)=>(ge(q.subarray(e,e+t)),0),x:function(e,t,r){var n=tc();try{return Ft(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 Ft(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},H:function(e,t,r){var n=tc();try{return Ft(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 Ft(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},Fa:function(e){var t=tc();try{return Ft(e)()}catch(e){if(rc(t),e!==e+0)throw e;ec(1,0)}},ia:function(e,t,r){var n=tc();try{return Ft(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 Ft(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},W:function(e,t,r,n,o,s,a,i,u,c,l,d,p,f,h,g){var m=tc();try{return Ft(e)(t,r,n,o,s,a,i,u,c,l,d,p,f,h,g)}catch(e){if(rc(m),e!==e+0)throw e;ec(1,0)}},q:function(e,t,r){var n=tc();try{return Ft(e)(t,r)}catch(e){if(rc(n),e!==e+0)throw e;ec(1,0)}},s:function(e,t,r,n){var o=tc();try{return Ft(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 s=tc();try{return Ft(e)(t,r,n,o)}catch(e){if(rc(s),e!==e+0)throw e;ec(1,0)}},De:function(e,t,r,n,o,s){var a=tc();try{return Ft(e)(t,r,n,o,s)}catch(e){if(rc(a),e!==e+0)throw e;ec(1,0)}},Ba:function(e,t,r,n,o,s,a){var i=tc();try{return Ft(e)(t,r,n,o,s,a)}catch(e){if(rc(i),e!==e+0)throw e;ec(1,0)}},Aa:function(e,t,r,n,o,s,a,i,u,c){var l=tc();try{return Ft(e)(t,r,n,o,s,a,i,u,c)}catch(e){if(rc(l),e!==e+0)throw e;ec(1,0)}},S:function(e){var t=tc();try{Ft(e)()}catch(e){if(rc(t),e!==e+0)throw e;ec(1,0)}},t:function(e,t){var r=tc();try{Ft(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},B:function(e,t,r,n){var o=tc();try{Ft(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},G:function(e,t,r){var n=tc();try{Ft(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{Ft(e)(t,r,n)}catch(e){if(rc(o),e!==e+0)throw e;ec(1,0)}},E:function(e,t,r,n,o){var s=tc();try{Ft(e)(t,r,n,o)}catch(e){if(rc(s),e!==e+0)throw e;ec(1,0)}},Ce:function(e,t,r,n,o,s){var a=tc();try{Ft(e)(t,r,n,o,s)}catch(e){if(rc(a),e!==e+0)throw e;ec(1,0)}},Ae:function(e,t,r,n,o,s,a){var i=tc();try{Ft(e)(t,r,n,o,s,a)}catch(e){if(rc(i),e!==e+0)throw e;ec(1,0)}},ih:function(e,t,r,n,o,s,a,i){var u=tc();try{Ft(e)(t,r,n,o,s,a,i)}catch(e){if(rc(u),e!==e+0)throw e;ec(1,0)}},Be:function(e,t,r,n,o,s,a,i,u,c){var l=tc();try{Ft(e)(t,r,n,o,s,a,i,u,c)}catch(e){if(rc(l),e!==e+0)throw e;ec(1,0)}},ja:function(e,t){const r=Gt.toValue(t),n=u.ctx;n.bindTexture(n.TEXTURE_2D,Lr.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:E,gb:(e,t,r,n,o)=>Lu(e,t,r,n)},Wu=(function(){var e,t,r,o,s={a:zu};function a(e,t){var r,n=e.exports;return V=(A=n).lh,r=A.jh,$.unshift(r),Z(),n}if(K(),u.instantiateWasm)try{return u.instantiateWasm(s,a)}catch(e){C("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=k,t=ee,r=s,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||ne(t)||y||"function"!=typeof fetch?ae(t,r,o):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return C("wasm streaming compile failed: "+e),C("falling back to ArrayBuffer instantiation"),ae(t,r,o)}))))).catch(n)}(),u._malloc=e=>(Wu=u._malloc=A.kh)(e)),Gu=u._free=e=>(Gu=u._free=A.mh)(e),Yu=()=>(Yu=A.nh)(),Xu=(u._ma_malloc_emscripten=(e,t)=>(u._ma_malloc_emscripten=A.oh)(e,t),u._ma_free_emscripten=(e,t)=>(u._ma_free_emscripten=A.ph)(e,t),u._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Xu=u._ma_device_process_pcm_frames_capture__webaudio=A.qh)(e,t,r)),Ju=u._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Ju=u._ma_device_process_pcm_frames_playback__webaudio=A.rh)(e,t,r),Ku=e=>(Ku=A.sh)(e),Zu=e=>(Zu=A.th)(e),Qu=(u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=A.uh)(),(e,t)=>(Qu=A.vh)(e,t)),ec=(e,t)=>(ec=A.wh)(e,t),tc=()=>(tc=A.xh)(),rc=e=>(rc=A.yh)(e),nc=e=>(nc=A.zh)(e),oc=e=>(oc=A.Ah)(e),sc=e=>(sc=A.Bh)(e),ac=(e,t,r)=>(ac=A.Ch)(e,t,r),ic=e=>(ic=A.Dh)(e);function uc(){function e(){$u||($u=!0,u.calledRun=!0,O||(u.noFSInit||xe.init.initialized||xe.init(),xe.ignorePermissions=!1,Ce.init(),ce($),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(),W.unshift(e);var e;ce(W)}()))}Y>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),N.unshift(e);var e;ce(N)}(),Y>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),e()}),1)):e()))}if(u.___start_em_js=2356011,u.___stop_em_js=2356375,u.addRunDependency=K,u.removeRunDependency=Z,u.FS_createPath=xe.createPath,u.FS_createDataFile=xe.createDataFile,u.FS_createLazyFile=xe.createLazyFile,u.FS_createDevice=xe.createDevice,u.FS_unlink=xe.unlink,u.ccall=function(e,t,r,n,o){var s={string:e=>{var t=0;return null!=e&&0!==e&&(t=(e=>{var t=ve(e)+1,r=nc(t);return Kt(e,r,t),r})(e)),t},array:e=>{var t=nc(e.length);return Iu(e,t),t}},a=function(e){return u["_"+e]}(e),i=[],c=0;if(n)for(var l=0;l<n.length;l++){var d=s[r[l]];d?(0===c&&(c=tc()),i[l]=d(n[l])):i[l]=n[l]}var p,f=a.apply(null,i);return p=f,0!==c&&rc(c),f=function(e){return"string"===t?qe(e):"boolean"===t?Boolean(e):e}(p),f},u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return x[e>>0];case"i16":return R[e>>1];case"i32":return B[e>>2];case"i64":return F[e>>3];case"float":return L[e>>2];case"double":return M[e>>3];case"*":return I[e>>2];default:Q(`invalid type for getValue: ${t}`)}},u.UTF8ToString=qe,u.specialHTMLTargets=wu,u.FS_createPreloadedFile=xe.createPreloadedFile,J=function e(){$u||uc(),$u||(J=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))}}),import_debounce=__toESM(require_debounce()),import_isEqual3=__toESM(require_isEqual()),PROXY=Symbol("PROXY"),RESTORE=Symbol("RESTORE");function isFnProxy(e){return"function"==typeof e&&PROXY in e}function getter(e,t){Object.defineProperty(e[t],PROXY,{value:{type:"getter"},writable:!1})}function setter(e,t){Object.defineProperty(e[t],PROXY,{value:{type:"setter"},writable:!1})}function decorateFunction(e,t,r=t.name){readFunctionProxyCounter[r]??=0;const n=readFunctionProxyCounter[r]++;return function(...o){const s=this,a=`${r}${n}-${JSON.stringify(o,null,0)}`;function i(){return Reflect.apply(t,s,o)}return e._getterCalled(a,i),e._readThroughCache(a,i)}}var ColorInternal,readFunctionProxyCounter={};function decorateObject(e,t){const r=t.constructor?.name??crypto.randomUUID(),n=[];let o=!1;const s=Object.getOwnPropertyNames(t.constructor.prototype).concat(Object.getOwnPropertyNames(t));for(const a of s){const s=t[a];if(isFnProxy(s))if("getter"===s[PROXY].type){let i=function(...t){if(o)throw new Error("Disposed @getter proxy called");const n=this,i=`${r}-${a.toString()}-${JSON.stringify(t,null,0)}`;function u(){return Reflect.apply(s,n,t)}return e._getterCalled(i,u),e._readThroughCache(i,u)};const u=Object.hasOwnProperty.call(t,"fnName")?()=>{t[a]=s}:()=>delete t[a];n.push(u),t[a]=i}else if("setter"===s[PROXY].type){let r=function(...t){if(o)throw new Error("Disposed @setter proxy called");const r=this;return e._setterCalled(),Reflect.apply(s,r,t)};const i=Object.hasOwnProperty.call(t,"fnName")?()=>{t[a]=s}:()=>delete t[a];n.push(i),t[a]=r}}return function(){o=!0;for(const e of n)e();n.length=0}}function isRGBAColor(e){return"r"in e&&"a"in e&&void 0!==e.r&&void 0!==e.a}function isSpotColor(e){return"name"in e&&void 0!==e.name}function isCMYKColor(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=>{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(isRGBAColor(e))return{colorSpace:0,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColorName:"",tint:1,externalReference:""};if(isCMYKColor(e))return{colorSpace:1,components:{x:e.c,y:e.m,z:e.y,w:e.k},spotColorName:"",tint:e.tint,externalReference:""};if(isSpotColor(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!")}})(ColorInternal||(ColorInternal={}));var UBQHelper=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=>unpackResult(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>unpackResult(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=unpackResult(e);r(t)}catch(e){n(e)}})))).delete()}))}};function unpackResult(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 unpackAsync(e){return new Promise(((t,r)=>{e((e=>{try{const r=unpackResult(e);t(r)}catch(e){r(e)}}))}))}__decorateClass([setter],UBQHelper.prototype,"setValue",1),__decorateClass([getter],UBQHelper.prototype,"getValue",1);var cppVectorToArray_default=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r},assetCallbacks=new WeakMap,EMPTY_RESULT={assets:[],total:0,currentPage:0,nextPage:void 0},AssetAPI=class{#e;constructor(e){this.#e=e}addSource(e){const t=e.getSupportedMimeTypes?.bind(e),r=e.getGroups?.bind(e),n=e.applyAsset?.bind(e),o=e.applyAssetToBlock?.bind(e),s=e.addAsset?.bind(e),a=e.removeAsset?.bind(e),i=e.credits,u=e.license;unpackResult(this.#e.addAssetSource(e.id,(async(t,r)=>{try{const n={...t,tags:cppVectorToArray_default(t.tags),groups:cppVectorToArray_default(t.groups),excludeGroups:cppVectorToArray_default(t.excludeGroups)},o=await e.findAssets(n);if(o){const t={...o,assets:o.assets.map((t=>ensureContext(t,e.id)))};r.invoke(t)}else r.invoke(EMPTY_RESULT)}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,i?()=>({name:i.name,url:i.url??""}):null,u?()=>({name:u.name,url:u.url??""}):null,t?()=>t()??[]:null,n?async(e,t)=>{try{const r=await n(this.#t(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(this.#t(e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null,s?async e=>{s(e)}:null,a?async e=>{a(e)}:null)),this.#r(e.id,e)}addLocalSource(e,t,r,n){unpackResult(this.#e.addLocalAssetSource(e,t??[],r?async(e,t)=>{try{const n=await r(this.#t(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(this.#t(e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){unpackResult(this.#e.removeAssetSource(e)),this.#n(e)}findAllSources(){return cppVectorToArray_default(this.#e.findAllAssetSources())}findAssets(e,t){return new Promise(((r,n)=>{let o=t?.tags??[];Array.isArray(o)||(o=[o]);const s={perPage:t?.perPage??0,page:t?.page??0,query:t?.query??"",tags:o,groups:t?.groups??[],excludeGroups:t?.excludeGroups??[],locale:t?.locale??""};this.#e.findAssetSourceAssets(e,s,(e=>{try{const t=unpackResult(e);r({...t,nextPage:-1===t.nextPage?void 0:t.nextPage})}catch(e){n(e)}}))}))}#t(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}async getGroups(e){return unpackAsync((t=>this.#e.getAssetSourceGroups(e,t))).then((e=>cppVectorToArray_default(e)))}getSupportedMimeTypes(e){return cppVectorToArray_default(unpackResult(this.#e.getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=unpackResult(this.#e.getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=unpackResult(this.#e.getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){return!!assetCallbacks.get(this.#e)?.get(e)?.canManageAssets}addAssetToSource(e,t){unpackResult(this.#e.addAssetToSource(e,t))}removeAssetFromSource(e,t){unpackResult(this.#e.removeAssetFromSource(e,t))}#r(e,t){assetCallbacks.has(this.#e)||assetCallbacks.set(this.#e,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/`),assetCallbacks.get(this.#e).set(e,{canManageAssets:t.canManageAssets})}#n(e){assetCallbacks.get(this.#e)?.delete(e)}async apply(e,t){return new Promise(((r,n)=>{this.#e.applyAssetSourceAsset(e,ensureContext(t,e),(e=>{try{const t=unpackResult(e);this.#e.isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return unpackAsync((n=>this.#e.applyAssetSourceAssetToBlock(e,ensureContext(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{this.#e.defaultApplyAsset(ensureContext(e,""),(e=>{try{const r=unpackResult(e);this.#e.isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return unpackAsync((r=>this.#e.defaultApplyAssetToBlock(ensureContext(e,""),t,r)))}onAssetSourceAdded=e=>{const t=this.#e.subscribeToAssetSourceAdded(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}};onAssetSourceRemoved=e=>{const t=this.#e.subscribeToAssetSourceRemoved(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}};dispose(){assetCallbacks.delete(this.#e)}};function ensureContext(e,t){return"context"in e&&e.context.sourceId===t?e:{...e,context:{sourceId:t}}}var StructError=class extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:s}=e;super(0===s.length?n:"At path: "+s.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 isIterable(e){return isObject(e)&&"function"==typeof e[Symbol.iterator]}function isObject(e){return"object"==typeof e&&null!=e}function print(e){return"string"==typeof e?JSON.stringify(e):""+e}function shiftIterator(e){const{done:t,value:r}=e.next();return t?void 0:r}function toFailure(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:s}=t,{type:a}=r,{refinement:i,message:u="Expected a value of type `"+a+"`"+(i?" with refinement `"+i+"`":"")+", but received: `"+print(n)+"`"}=e;return{value:n,type:a,refinement:i,key:o[o.length-1],path:o,branch:s,...e,message:u}}function*toFailures(e,t,r,n){isIterable(e)||(e=[e]);for(const o of e){const e=toFailure(o,t,r,n);e&&(yield e)}}function*run(e,t,r={}){const{path:n=[],branch:o=[e],coerce:s=!1,mask:a=!1}=r,i={path:n,branch:o};if(s&&(e=t.coercer(e,i),a&&"type"!==t.type&&isObject(t.schema)&&isObject(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,i))u=!1,yield[r,void 0];for(let[r,c,l]of t.entries(e,i)){const t=run(c,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,c],coerce:s,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):s&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):isObject(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,i))u=!1,yield[r,void 0];u&&(yield[void 0,e])}var Struct=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:s=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=s,this.validator=n?(e,t)=>toFailures(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>toFailures(o(e,t),t,this,e):()=>[]}assert(e){return assert(e,this)}create(e){return create(e,this)}is(e){return is(e,this)}mask(e){return mask(e,this)}validate(e,t={}){return validate(e,this,t)}};function assert(e,t){const r=validate(e,t);if(r[0])throw r[0]}function create(e,t){const r=validate(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function mask(e,t){const r=validate(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function is(e,t){return!validate(e,t)[0]}function validate(e,t,r={}){const n=run(e,t,r),o=shiftIterator(n);if(o[0]){return[new StructError(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function define2(e,t){return new Struct({type:e,schema:null,validator:t})}function array(e){return new Struct({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: "+print(e)})}function boolean(){return define2("boolean",(e=>"boolean"==typeof e))}function integer(){return define2("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+print(e)))}function never(){return define2("never",(()=>!1))}function number(){return define2("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+print(e)))}function object(e){const t=e?Object.keys(e):[],r=never();return new Struct({type:"object",schema:e||null,*entries(n){if(e&&isObject(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=>isObject(e)||"Expected an object, but received: "+print(e),coercer:e=>isObject(e)?{...e}:e})}function string(){return define2("string",(e=>"string"==typeof e||"Expected a string, but received: "+print(e)))}function getSize(e){return e instanceof Map||e instanceof Set?e.size:e.length}function max(e,t,r={}){const{exclusive:n}=r;return refine(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function min(e,t,r={}){const{exclusive:n}=r;return refine(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function nonempty(e){return refine(e,"nonempty",(t=>getSize(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function refine(e,t,r){return new Struct({...e,*refiner(n,o){yield*e.refiner(n,o);const s=toFailures(r(n,o),o,e,n);for(const e of s)yield{...e,refinement:t}}})}function assert2(e,t,r){const[n]=validate(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function mimeType(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return define2("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 sceneLayoutShape(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return define2("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}function zoomAutoFitAxisShape(){const e=["Horizontal","Vertical","Both"];return define2("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}function designUnitShape(){const e=["Pixel","Millimeter","Inch"];return define2("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}function cutoutOperationShape(){const e=["Difference","Intersection","Union","XOR"];return define2("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var MimeType=(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))(MimeType||{}),MimeType_default=MimeType,Blob_default="undefined"!=typeof Blob?Blob:(()=>{try{return require_buffer().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=MimeType_default.Png,r={}){assert2("handle",e,number()),assert2("mimeType",t,mimeType()),assert2("options",r,object());const n=null!=r.targetWidth&&null!=r.targetHeight,o=r.jpegQuality??.9,s=r.webpQuality??1,a=r.pngCompressionLevel??5;return assert2("jpegQuality",o,min(max(number(),1),0,{exclusive:!0})),assert2("webpQuality",s,min(max(number(),1),0,{exclusive:!0})),assert2("pngCompressionLevel",a,min(max(integer(),9),0)),null==r.targetWidth&&null==r.targetHeight||(assert2("targetWidth",r.targetWidth,number()),assert2("targetHeight",r.targetHeight,number())),new Promise(((i,u)=>{this.#e.exportToBuffer(e,t,(e=>{"error"in e?u(e.error):i(new Blob_default([e],{type:t}))}),{pngCompressionLevel:a,jpegQuality:o,webpQuality:s,useTargetSize:n,targetWidth:r.targetWidth??0,targetHeight:r.targetHeight??0,exportPdfWithHighCompatibility:r.exportPdfWithHighCompatibility??!0})}))}async exportWithColorMask(e,t=MimeType_default.Png,r,n,o,s={}){assert2("handle",e,number()),assert2("mimeType",t,mimeType()),assert2("options",s,object());const a=null!=s.targetWidth&&null!=s.targetHeight,i=s.jpegQuality??.9,u=s.webpQuality??1,c=s.pngCompressionLevel??5;return assert2("jpegQuality",i,min(max(number(),1),0,{exclusive:!0})),assert2("webpQuality",u,min(max(number(),1),0,{exclusive:!0})),assert2("pngCompressionLevel",c,min(max(integer(),9),0)),null==s.targetWidth&&null==s.targetHeight||(assert2("targetWidth",s.targetWidth,number()),assert2("targetHeight",s.targetHeight,number())),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 Blob_default([e],{type:t}),o=new Blob_default([r],{type:t});l([n,o])}}),{pngCompressionLevel:c,jpegQuality:i,webpQuality:u,useTargetSize:a,targetWidth:s.targetWidth??0,targetHeight:s.targetHeight??0,exportPdfWithHighCompatibility:s.exportPdfWithHighCompatibility??!0})}))}async exportVideo(e,t=MimeType_default.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 assert2("content",e,string()),unpackAsync((t=>this.#e.loadBlocksFromString(e,t))).then((e=>cppVectorToArray_default(e)))}async saveToString(e){return assert2("blocks",e,array(number())),unpackAsync((t=>this.#e.saveBlocksToString(e,t)))}create(e){return assert2("type",e,string()),unpackResult(this.#e.create(e))}createFill(e){return assert2("type",e,string()),unpackResult(this.#e.createFill(e))}getType(e){return assert2("id",e,integer()),unpackResult(this.#e.getType(e))}getKind(e){return assert2("id",e,integer()),unpackResult(this.#e.getKind(e))}setKind(e,t){assert2("id",e,integer()),unpackResult(this.#e.setKind(e,t))}select(e){return assert2("id",e,integer()),unpackResult(this.#e.select(e))}setSelected(e,t){return assert2("id",e,integer()),assert2("selected",t,boolean()),unpackResult(this.#e.setSelected(e,t))}isSelected(e){return assert2("id",e,integer()),unpackResult(this.#e.isSelected(e))}findAllSelected(){return cppVectorToArray_default(this.#e.findAllSelected())}onSelectionChanged=e=>{const t=this.#e.subscribeToSelectionChange(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}};onClicked=e=>{const t=this.#e.subscribeToBlockClicked(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}};isGroupable(e){return assert2("ids",e,array(number())),unpackResult(this.#e.isGroupable(e))}group(e){return assert2("ids",e,nonempty(array(number()))),unpackResult(this.#e.group(e))}ungroup(e){return assert2("id",e,number()),unpackResult(this.#e.ungroup(e))}enterGroup(e){return assert2("id",e,number()),unpackResult(this.#e.enterGroup(e))}exitGroup(e){return assert2("id",e,number()),unpackResult(this.#e.exitGroup(e))}isCombinable(e){return assert2("ids",e,array(number())),unpackResult(this.#e.isCombinable(e))}combine(e,t){return assert2("ids",e,array(number())),assert2("op",t,string()),unpackResult(this.#e.combine(e,t))}setName(e,t){return assert2("id",e,integer()),assert2("name",t,string()),unpackResult(this.#e.setName(e,t))}getName(e){return assert2("id",e,integer()),unpackResult(this.#e.getName(e))}getUUID(e){return assert2("id",e,integer()),unpackResult(this.#e.getUUID(e))}findByName(e){assert2("name",e,string());const t=this.#e.findByName(e);return cppVectorToArray_default(t)}findByType(e){assert2("type",e,string());const t=unpackResult(this.#e.findByType(e));return cppVectorToArray_default(t)}findByKind(e){assert2("kind",e,string());const t=unpackResult(this.#e.findByKind(e));return cppVectorToArray_default(t)}findAll(){return cppVectorToArray_default(this.#e.findAll())}findAllPlaceholders(){return cppVectorToArray_default(this.#e.findAllPlaceholders())}createShape(e){return assert2("type",e,string()),unpackResult(this.#e.createShape(e))}hasShape(e){return assert2("id",e,integer()),unpackResult(this.#e.hasShape(e))}getShape(e){return assert2("id",e,integer()),unpackResult(this.#e.getShape(e))}setShape(e,t){return assert2("id",e,integer()),assert2("shape",t,integer()),unpackResult(this.#e.setShape(e,t))}isVisible(e){return assert2("id",e,integer()),unpackResult(this.#e.isVisible(e))}setVisible(e,t){return assert2("id",e,integer()),assert2("visible",t,boolean()),unpackResult(this.#e.setVisible(e,t))}isClipped(e){return assert2("id",e,integer()),unpackResult(this.#e.isClipped(e))}setClipped(e,t){return assert2("id",e,integer()),assert2("clipped",t,boolean()),unpackResult(this.#e.setClipped(e,t))}isTransformLocked(e){return assert2("id",e,integer()),unpackResult(this.#e.isTransformLocked(e))}setTransformLocked(e,t){return assert2("id",e,integer()),assert2("locked",t,boolean()),unpackResult(this.#e.setTransformLocked(e,t))}getPositionX(e){return assert2("id",e,integer()),unpackResult(this.#e.getPositionX(e))}getPositionXMode(e){return assert2("id",e,integer()),unpackResult(this.#e.getPositionXMode(e))}getPositionY(e){return assert2("id",e,integer()),unpackResult(this.#e.getPositionY(e))}getPositionYMode(e){return assert2("id",e,integer()),unpackResult(this.#e.getPositionYMode(e))}setPositionX(e,t){return assert2("id",e,integer()),assert2("value",t,number()),unpackResult(this.#e.setPositionX(e,t))}setPositionXMode(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setPositionXMode(e,t))}setPositionY(e,t){return assert2("id",e,integer()),assert2("value",t,number()),unpackResult(this.#e.setPositionY(e,t))}setPositionYMode(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setPositionYMode(e,t))}setAlwaysOnTop(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return assert2("id",e,integer()),unpackResult(this.#e.isAlwaysOnTop(e))}isAlwaysOnBottom(e){return assert2("id",e,integer()),unpackResult(this.#e.isAlwaysOnBottom(e))}bringToFront(e){return assert2("id",e,number()),unpackResult(this.#e.bringToFront(e))}sendToBack(e){return assert2("id",e,number()),unpackResult(this.#e.sendToBack(e))}bringForward(e){return assert2("id",e,number()),unpackResult(this.#e.bringForward(e))}sendBackward(e){return assert2("id",e,number()),unpackResult(this.#e.sendBackward(e))}getRotation(e){return assert2("id",e,integer()),unpackResult(this.#e.getRotation(e))}setRotation(e,t){return assert2("id",e,integer()),assert2("radians",t,number()),unpackResult(this.#e.setRotation(e,t))}getFlipHorizontal(e){return assert2("id",e,integer()),unpackResult(this.#e.getFlip(e)).horizontal}getFlipVertical(e){return assert2("id",e,integer()),unpackResult(this.#e.getFlip(e)).vertical}setFlipHorizontal(e,t){return assert2("id",e,integer()),assert2("flip",t,boolean()),unpackResult(this.#e.setFlipHorizontal(e,t))}setFlipVertical(e,t){return assert2("id",e,integer()),assert2("flip",t,boolean()),unpackResult(this.#e.setFlipVertical(e,t))}hasContentFillMode(e){return assert2("id",e,integer()),unpackResult(this.#e.hasContentFillMode(e))}getWidth(e){return assert2("id",e,integer()),unpackResult(this.#e.getWidth(e))}getWidthMode(e){return assert2("id",e,integer()),unpackResult(this.#e.getWidthMode(e))}getHeight(e){return assert2("id",e,integer()),unpackResult(this.#e.getHeight(e))}getHeightMode(e){return assert2("id",e,integer()),unpackResult(this.#e.getHeightMode(e))}setWidth(e,t){return assert2("id",e,integer()),assert2("value",t,number()),unpackResult(this.#e.setWidth(e,t))}setWidthMode(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setWidthMode(e,t))}setHeight(e,t){return assert2("id",e,integer()),assert2("value",t,number()),unpackResult(this.#e.setHeight(e,t))}setHeightMode(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setHeightMode(e,t))}getFrameX(e){return assert2("id",e,integer()),unpackResult(this.#e.getLastFrameX(e))}getFrameY(e){return assert2("id",e,integer()),unpackResult(this.#e.getLastFrameY(e))}getFrameWidth(e){return assert2("id",e,integer()),unpackResult(this.#e.getLastFrameWidth(e))}getFrameHeight(e){return assert2("id",e,integer()),unpackResult(this.#e.getLastFrameHeight(e))}setContentFillMode(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setContentFillMode(e,t))}getContentFillMode(e){return assert2("id",e,integer()),unpackResult(this.#e.getContentFillMode(e))}duplicate(e){return assert2("id",e,integer()),unpackResult(this.#e.duplicate(e))}destroy(e){return assert2("id",e,integer()),unpackResult(this.#e.destroy(e))}isValid(e){return assert2("id",e,integer()),this.#e.isValid(e)}getParent(e){return assert2("id",e,integer()),unpackResult(this.#e.hasParent(e))?unpackResult(this.#e.getParent(e)):null}getChildren(e){assert2("id",e,integer());const t=unpackResult(this.#e.getChildren(e));return cppVectorToArray_default(t)}insertChild(e,t,r){return assert2("parent",e,number()),assert2("child",t,number()),assert2("index",r,min(number(),0)),unpackResult(this.#e.insertChild(e,t,r))}appendChild(e,t){return assert2("parent",e,number()),assert2("child",t,number()),unpackResult(this.#e.appendChild(e,t))}referencesAnyVariables(e){return assert2("id",e,integer()),unpackResult(this.#e.referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return assert2("id",e,integer()),unpackResult(this.#e.getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return assert2("id",e,integer()),unpackResult(this.#e.getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return assert2("id",e,integer()),unpackResult(this.#e.getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return assert2("id",e,integer()),unpackResult(this.#e.getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return assert2("ids",e,array(number())),unpackResult(this.#e.getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return assert2("ids",e,nonempty(array(number()))),unpackResult(this.#e.alignHorizontally(e,t))}alignVertically(e,t){return assert2("ids",e,nonempty(array(number()))),unpackResult(this.#e.alignVertically(e,t))}isAlignable(e){return assert2("ids",e,array(number())),unpackResult(this.#e.isAlignable(e))}distributeHorizontally(e){return assert2("ids",e,nonempty(array(number()))),unpackResult(this.#e.distributeHorizontally(e))}distributeVertically(e){return assert2("ids",e,nonempty(array(number()))),unpackResult(this.#e.distributeVertically(e))}isDistributable(e){return assert2("ids",e,array(number())),unpackResult(this.#e.isDistributable(e))}fillParent(e){return assert2("id",e,integer()),unpackResult(this.#e.fillParent(e))}resizeContentAware(e,t,r){return assert2("ids",e,array(number())),assert2("width",t,number()),assert2("height",r,number()),unpackResult(this.#e.resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return assert2("id",e,integer()),unpackResult(this.#e.scale(e,t,r,n))}findAllProperties(e){return assert2("id",e,integer()),cppVectorToArray_default(unpackResult(this.#e.findAllProperties(e)))}isPropertyReadable(e){return assert2("property",e,string()),this.#e.isPropertyReadable(e)}isPropertyWritable(e){return assert2("property",e,string()),this.#e.isPropertyWritable(e)}getPropertyType(e){assert2("property",e,string());return unpackResult(this.#e.getPropertyType(e))}getEnumValues(e){return assert2("enumProperty",e,string()),cppVectorToArray_default(unpackResult(this.#e.getEnumValues(e)))}setBool(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),assert2("value",r,boolean()),unpackResult(this.#e.setBool(e,t,r))}getBool(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getBool(e,t))}setInt(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),assert2("value",r,integer()),unpackResult(this.#e.setInt(e,t,r))}getInt(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getInt(e,t))}setFloat(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),assert2("value",r,number()),unpackResult(this.#e.setFloat(e,t,r))}getFloat(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getFloat(e,t))}setDouble(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),assert2("value",r,number()),unpackResult(this.#e.setDouble(e,t,r))}getDouble(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getDouble(e,t))}setString(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),assert2("value",r,string()),unpackResult(this.#e.setString(e,t,r))}getString(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getString(e,t))}setColor(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.setColor(e,t,ColorInternal.fromColor(r)))}getColor(e,t){return assert2("id",e,integer()),assert2("property",t,string()),ColorInternal.toColor(unpackResult(this.#e.getColor(e,t)))}setColorRGBA(e,t,r,n,o,s=1){return assert2("id",e,integer()),assert2("property",t,string()),assert2("r",r,number()),assert2("g",n,number()),assert2("b",o,number()),assert2("a",s,number()),unpackResult(this.#e.setColorRGBA(e,t,r,n,o,s))}getColorRGBA(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return assert2("id",e,integer()),assert2("property",t,string()),assert2("name",r,string()),assert2("tint",n,number()),unpackResult(this.#e.setColorSpot(e,t,r,n))}getColorSpotName(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getColorSpotName(e,t))}getColorSpotTint(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getColorSpotTint(e,t))}setGradientColorStops(e,t,r){assert2("id",e,integer()),assert2("property",t,string());const n=r.map((e=>({color:ColorInternal.fromColor(e.color),stop:e.stop})));return unpackResult(this.#e.setGradientColorStops(e,t,n))}getGradientColorStops(e,t){assert2("id",e,integer()),assert2("property",t,string());const r=unpackResult(this.#e.getGradientColorStops(e,t));return cppVectorToArray_default(r).map((e=>({color:ColorInternal.toColor(e.color),stop:e.stop})))}getSourceSet(e,t){return assert2("id",e,integer()),assert2("property",t,string()),cppVectorToArray_default(unpackResult(this.#e.getSourceSet(e,t)))}setSourceSet(e,t,r){assert2("id",e,integer()),assert2("property",t,string()),assert2("sourceSet",r,array(object({uri:string(),width:number(),height:number()}))),unpackResult(this.#e.setSourceSet(e,t,r))}setEnum(e,t,r){return assert2("id",e,integer()),assert2("property",t,string()),assert2("value",r,string()),unpackResult(this.#e.setEnum(e,t,r))}getEnum(e,t){return assert2("id",e,integer()),assert2("property",t,string()),unpackResult(this.#e.getEnum(e,t))}hasCrop(e){return assert2("id",e,integer()),unpackResult(this.#e.hasCrop(e))}setCropScaleX(e,t){return assert2("id",e,integer()),assert2("scaleX",t,number()),unpackResult(this.#e.setCropScaleX(e,t))}setCropScaleY(e,t){return assert2("id",e,integer()),assert2("scaleY",t,number()),unpackResult(this.#e.setCropScaleY(e,t))}setCropRotation(e,t){return assert2("id",e,integer()),assert2("rotation",t,number()),unpackResult(this.#e.setCropRotation(e,t))}setCropScaleRatio(e,t){return assert2("id",e,integer()),assert2("scaleRatio",t,number()),unpackResult(this.#e.setCropScaleRatio(e,t))}setCropTranslationX(e,t){return assert2("id",e,integer()),assert2("translationX",t,number()),unpackResult(this.#e.setCropTranslationX(e,t))}setCropTranslationY(e,t){return assert2("id",e,integer()),assert2("translationY",t,number()),unpackResult(this.#e.setCropTranslationY(e,t))}resetCrop(e){return assert2("id",e,integer()),unpackResult(this.#e.resetCrop(e))}getCropScaleX(e){return assert2("id",e,integer()),unpackResult(this.#e.getCropScaleX(e))}getCropScaleY(e){return assert2("id",e,integer()),unpackResult(this.#e.getCropScaleY(e))}getCropRotation(e){return assert2("id",e,integer()),unpackResult(this.#e.getCropRotation(e))}getCropScaleRatio(e){return assert2("id",e,integer()),unpackResult(this.#e.getCropScaleRatio(e))}getCropTranslationX(e){return assert2("id",e,integer()),unpackResult(this.#e.getCropTranslationX(e))}getCropTranslationY(e){return assert2("id",e,integer()),unpackResult(this.#e.getCropTranslationY(e))}adjustCropToFillFrame(e,t){return assert2("id",e,integer()),assert2("minScaleRatio",t,number()),unpackResult(this.#e.adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return assert2("id",e,integer()),unpackResult(this.#e.flipCropHorizontal(e))}flipCropVertical(e){return assert2("id",e,integer()),unpackResult(this.#e.flipCropVertical(e))}hasOpacity(e){return assert2("id",e,integer()),unpackResult(this.#e.hasOpacity(e))}setOpacity(e,t){return assert2("id",e,integer()),assert2("opacity",t,number()),unpackResult(this.#e.setOpacity(e,t))}getOpacity(e){return assert2("id",e,integer()),unpackResult(this.#e.getOpacity(e))}hasBlendMode(e){return assert2("id",e,integer()),unpackResult(this.#e.hasBlendMode(e))}setBlendMode(e,t){return assert2("id",e,integer()),assert2("blendMode",t,string()),unpackResult(this.#e.setBlendMode(e,t))}getBlendMode(e){return assert2("id",e,integer()),unpackResult(this.#e.getBlendMode(e))}hasFillColor(e){return assert2("id",e,integer()),unpackResult(this.#e.hasFillColor(e))}isIncludedInExport(e){return assert2("id",e,integer()),unpackResult(this.#e.isIncludedInExport(e))}setIncludedInExport(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,n,o=1){return assert2("id",e,integer()),assert2("r",t,number()),assert2("g",r,number()),assert2("b",n,number()),assert2("a",o,number()),unpackResult(this.#e.setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return assert2("id",e,integer()),unpackResult(this.#e.getFillColorRGBA(e))}setFillColorEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setFillColorEnabled(e,t))}isFillColorEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isFillColorEnabled(e))}createEffect(e){return assert2("type",e,string()),unpackResult(this.#e.createEffect(e))}hasEffects(e){return assert2("id",e,integer()),unpackResult(this.#e.hasEffects(e))}getEffects(e){assert2("id",e,integer());const t=unpackResult(this.#e.getEffects(e));return cppVectorToArray_default(t)}insertEffect(e,t,r){assert2("id",e,integer()),assert2("effectId",t,integer()),assert2("index",r,min(integer(),0)),unpackResult(this.#e.insertEffect(e,t,r))}appendEffect(e,t){assert2("id",e,integer()),assert2("effectId",t,integer()),unpackResult(this.#e.appendEffect(e,t))}removeEffect(e,t){assert2("id",e,integer()),assert2("index",t,min(integer(),0)),unpackResult(this.#e.removeEffect(e,t))}hasEffectEnabled(e){return assert2("effectId",e,integer()),unpackResult(this.#e.hasEffectEnabled(e))}setEffectEnabled(e,t){assert2("effectId",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setEffectEnabled(e,t))}isEffectEnabled(e){return assert2("effectId",e,integer()),unpackResult(this.#e.isEffectEnabled(e))}createBlur(e){return assert2("type",e,string()),unpackResult(this.#e.createBlur(e))}hasBlur(e){return assert2("id",e,integer()),unpackResult(this.#e.hasBlur(e))}setBlur(e,t){assert2("id",e,integer()),assert2("blurId",t,integer()),unpackResult(this.#e.setBlur(e,t))}getBlur(e){return assert2("id",e,integer()),unpackResult(this.#e.getBlur(e))}setBlurEnabled(e,t){assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setBlurEnabled(e,t))}isBlurEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isBlurEnabled(e))}hasBackgroundColor(e){return assert2("id",e,integer()),unpackResult(this.#e.hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return assert2("id",e,integer()),assert2("r",t,number()),assert2("g",r,number()),assert2("b",n,number()),assert2("a",o,number()),unpackResult(this.#e.setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return assert2("id",e,integer()),unpackResult(this.#e.getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isBackgroundColorEnabled(e))}hasStroke(e){return assert2("id",e,integer()),unpackResult(this.#e.hasStroke(e))}setStrokeEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setStrokeEnabled(e,t))}isStrokeEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return assert2("id",e,integer()),assert2("r",t,number()),assert2("g",r,number()),assert2("b",n,number()),assert2("a",o,number()),unpackResult(this.#e.setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setStrokeColor(e,ColorInternal.fromColor(t)))}getStrokeColorRGBA(e){return assert2("id",e,integer()),unpackResult(this.#e.getStrokeColorRGBA(e))}getStrokeColor(e){return assert2("id",e,integer()),ColorInternal.toColor(unpackResult(this.#e.getStrokeColor(e)))}setStrokeWidth(e,t){return assert2("id",e,integer()),assert2("width",t,number()),unpackResult(this.#e.setStrokeWidth(e,t))}getStrokeWidth(e){return assert2("id",e,integer()),unpackResult(this.#e.getStrokeWidth(e))}setStrokeStyle(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setStrokeStyle(e,t))}getStrokeStyle(e){assert2("id",e,integer());return unpackResult(this.#e.getStrokeStyle(e))}setStrokePosition(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setStrokePosition(e,t))}getStrokePosition(e){assert2("id",e,integer());return unpackResult(this.#e.getStrokePosition(e))}setStrokeCornerGeometry(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){assert2("id",e,integer());return unpackResult(this.#e.getStrokeCornerGeometry(e))}hasDropShadow(e){return assert2("id",e,integer()),unpackResult(this.#e.hasDropShadow(e))}setDropShadowEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return assert2("id",e,integer()),assert2("r",t,number()),assert2("g",r,number()),assert2("b",n,number()),assert2("a",o,number()),unpackResult(this.#e.setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setDropShadowColor(e,ColorInternal.fromColor(t)))}getDropShadowColorRGBA(e){return assert2("id",e,integer()),unpackResult(this.#e.getDropShadowColorRGBA(e))}getDropShadowColor(e){return assert2("id",e,integer()),ColorInternal.toColor(unpackResult(this.#e.getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return assert2("id",e,integer()),assert2("offsetX",t,number()),unpackResult(this.#e.setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return assert2("id",e,integer()),unpackResult(this.#e.getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return assert2("id",e,integer()),assert2("offsetY",t,number()),unpackResult(this.#e.setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return assert2("id",e,integer()),unpackResult(this.#e.getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return assert2("id",e,integer()),assert2("blurRadiusX",t,number()),unpackResult(this.#e.setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return assert2("id",e,integer()),unpackResult(this.#e.getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return assert2("id",e,integer()),assert2("blurRadiusY",t,number()),unpackResult(this.#e.setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return assert2("id",e,integer()),unpackResult(this.#e.getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setDropShadowClip(e,t))}getDropShadowClip(e){return assert2("id",e,integer()),unpackResult(this.#e.getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return assert2("ids",e,array(integer())),assert2("vectorizeDistanceThreshold",t,number()),assert2("maxSmoothingDistance",r,number()),unpackResult(this.#e.createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return assert2("path",e,string()),unpackResult(this.#e.createCutoutFromPath(e))}createCutoutFromOperation(e,t){return assert2("ids",e,array(integer())),assert2("op",t,cutoutOperationShape()),unpackResult(this.#e.createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){assert2("id",e,integer()),assert2("text",t,string()),assert2("from",r,integer()),assert2("to",n,integer()),unpackResult(this.#e.replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){assert2("id",e,integer()),assert2("from",t,integer()),assert2("to",r,integer()),unpackResult(this.#e.removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){assert2("id",e,integer()),assert2("from",r,integer()),assert2("to",n,integer()),unpackResult(this.#e.setTextColor(e,ColorInternal.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){assert2("id",e,integer()),assert2("from",t,integer()),assert2("to",r,integer());const n=this.#e.getTextColors(e,t,r);return cppVectorToArray_default(unpackResult(n)).map((e=>ColorInternal.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return assert2("id",e,integer()),assert2("from",t,integer()),assert2("to",r,integer()),cppVectorToArray_default(unpackResult(this.#e.getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return assert2("id",e,integer()),assert2("from",t,integer()),assert2("to",r,integer()),cppVectorToArray_default(unpackResult(this.#e.getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return assert2("id",e,integer()),assert2("from",t,integer()),assert2("to",r,integer()),cppVectorToArray_default(unpackResult(this.#e.getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){assert2("id",e,integer()),assert2("textCase",t,string()),assert2("from",r,integer()),assert2("to",n,integer()),unpackResult(this.#e.setTextCase(e,t,r,n))}getTextCursorRange(){return unpackResult(this.#e.getTextCursorRange())}hasFill(e){return assert2("id",e,integer()),unpackResult(this.#e.hasFill(e))}isFillEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isFillEnabled(e))}setFillEnabled(e,t){return assert2("id",e,integer()),unpackResult(this.#e.setFillEnabled(e,t))}getFill(e){return assert2("id",e,integer()),unpackResult(this.#e.getFill(e))}setFill(e,t){return assert2("id",e,integer()),assert2("fill",t,integer()),unpackResult(this.#e.setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){assert2("id",e,integer()),unpackResult(this.#e.setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return assert2("id",e,integer()),unpackResult(this.#e.getFillSolidColor(e))}setPlaceholderEnabled(e,t){assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return assert2("id",e,integer()),unpackResult(this.#e.hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){assert2("id",e,integer()),unpackResult(this.#e.setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return assert2("id",e,integer()),unpackResult(this.#e.hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){assert2("id",e,integer()),assert2("key",t,string()),assert2("value",r,string()),unpackResult(this.#e.setMetadata(e,t,r))}getMetadata(e,t){return assert2("id",e,integer()),assert2("key",t,string()),unpackResult(this.#e.getMetadata(e,t))}hasMetadata(e,t){return assert2("id",e,integer()),assert2("key",t,string()),unpackResult(this.#e.hasMetadata(e,t))}findAllMetadata(e){return assert2("id",e,integer()),cppVectorToArray_default(unpackResult(this.#e.findAllMetadata(e)))}removeMetadata(e,t){assert2("id",e,integer()),assert2("key",t,string()),unpackResult(this.#e.removeMetadata(e,t))}setScopeEnabled(e,t,r){assert2("id",e,integer()),assert2("key",t,string()),assert2("enabled",r,boolean()),unpackResult(this.#e.setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return assert2("id",e,integer()),assert2("key",t,string()),unpackResult(this.#e.isScopeEnabled(e,t))}isAllowedByScope(e,t){return assert2("id",e,integer()),assert2("key",t,string()),unpackResult(this.#e.isAllowedByScope(e,t))}hasDuration(e){return assert2("id",e,integer()),unpackResult(this.#e.hasDuration(e))}setDuration(e,t){return assert2("id",e,integer()),assert2("duration",t,number()),unpackResult(this.#e.setDuration(e,t))}getDuration(e){return assert2("id",e,integer()),unpackResult(this.#e.getDuration(e))}hasTimeOffset(e){return assert2("id",e,integer()),unpackResult(this.#e.hasTimeOffset(e))}setTimeOffset(e,t){return assert2("id",e,integer()),assert2("offset",t,number()),unpackResult(this.#e.setTimeOffset(e,t))}getTimeOffset(e){return assert2("id",e,integer()),unpackResult(this.#e.getTimeOffset(e))}hasTrim(e){return assert2("id",e,integer()),unpackResult(this.#e.hasTrim(e))}setTrimOffset(e,t){return assert2("id",e,integer()),assert2("offset",t,number()),unpackResult(this.#e.setTrimOffset(e,t))}getTrimOffset(e){return assert2("id",e,integer()),unpackResult(this.#e.getTrimOffset(e))}setTrimLength(e,t){return assert2("id",e,integer()),assert2("length",t,number()),unpackResult(this.#e.setTrimLength(e,t))}getTrimLength(e){return assert2("id",e,integer()),unpackResult(this.#e.getTrimLength(e))}getTotalSceneDuration(e){return assert2("scene",e,integer()),unpackResult(this.#e.getTotalSceneDuration(e))}setPlaying(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setPlaying(e,t))}isPlaying(e){return assert2("id",e,integer()),unpackResult(this.#e.isPlaying(e))}hasPlaybackTime(e){return assert2("id",e,integer()),unpackResult(this.#e.hasPlaybackTime(e))}setPlaybackTime(e,t){return assert2("id",e,integer()),assert2("time",t,number()),unpackResult(this.#e.setPlaybackTime(e,t))}getPlaybackTime(e){return assert2("id",e,integer()),unpackResult(this.#e.getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return assert2("id",e,integer()),assert2("enabled",t,boolean()),unpackResult(this.#e.setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return assert2("id",e,integer()),unpackResult(this.#e.isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return assert2("id",e,integer()),unpackResult(this.#e.hasPlaybackControl(e))}setLooping(e,t){assert2("id",e,integer()),assert2("looping",t,boolean()),unpackResult(this.#e.setLooping(e,t))}isLooping(e){return assert2("id",e,integer()),unpackResult(this.#e.isLooping(e))}setMuted(e,t){assert2("id",e,integer()),assert2("muted",t,boolean()),unpackResult(this.#e.setMuted(e,t))}isMuted(e){return assert2("id",e,integer()),unpackResult(this.#e.isMuted(e))}setVolume(e,t){assert2("id",e,integer()),assert2("volume",t,number()),unpackResult(this.#e.setVolume(e,t))}getVolume(e){return assert2("id",e,integer()),unpackResult(this.#e.getVolume(e))}async forceLoadAVResource(e){return assert2("id",e,integer()),unpackAsync((t=>this.#e.forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return assert2("id",e,integer()),unpackResult(this.#e.getAVResourceTotalDuration(e))}getVideoWidth(e){return assert2("id",e,integer()),unpackResult(this.#e.getVideoWidth(e))}getVideoHeight(e){return assert2("id",e,integer()),unpackResult(this.#e.getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,s){return assert2("id",e,integer()),assert2("thumbnailHeight",t,integer()),assert2("timeBegin",r,number()),assert2("timeEnd",n,number()),assert2("numberOfFrames",o,integer()),this.#e.generateVideoThumbnailSequence(e,t,r,n,o,(e=>{"error"in e?s(0,new Error(e.error)):s(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))})),()=>{unpackResult(this.#e.cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return assert2("id",e,integer()),assert2("thumbnailHeight",t,integer()),new Promise(((r,n)=>{this.#e.getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new Blob_default([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return assert2("id",e,integer()),assert2("numberOfColumns",t,integer()),assert2("numberOfRows",r,integer()),assert2("thumbnailHeight",n,integer()),new Promise(((o,s)=>{this.#e.getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?s(e.error):o(new Blob_default([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return assert2("id",e,integer()),assert2("numberOfColumns",t,integer()),assert2("numberOfRows",r,integer()),new Promise(((o,s)=>{this.#e.getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?s(e.error):o(new Blob_default([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),unpackResult(this.#e.setNativePixelBuffer(e,t))}};__decorateClass([setter],BlockAPI.prototype,"loadFromString",1),__decorateClass([setter],BlockAPI.prototype,"create",1),__decorateClass([setter],BlockAPI.prototype,"createFill",1),__decorateClass([getter],BlockAPI.prototype,"getType",1),__decorateClass([setter],BlockAPI.prototype,"select",1),__decorateClass([setter],BlockAPI.prototype,"setSelected",1),__decorateClass([getter],BlockAPI.prototype,"isSelected",1),__decorateClass([getter],BlockAPI.prototype,"findAllSelected",1),__decorateClass([getter],BlockAPI.prototype,"isGroupable",1),__decorateClass([setter],BlockAPI.prototype,"group",1),__decorateClass([setter],BlockAPI.prototype,"ungroup",1),__decorateClass([setter],BlockAPI.prototype,"enterGroup",1),__decorateClass([setter],BlockAPI.prototype,"exitGroup",1),__decorateClass([getter],BlockAPI.prototype,"isCombinable",1),__decorateClass([setter],BlockAPI.prototype,"combine",1),__decorateClass([setter],BlockAPI.prototype,"setName",1),__decorateClass([getter],BlockAPI.prototype,"getName",1),__decorateClass([getter],BlockAPI.prototype,"getUUID",1),__decorateClass([getter],BlockAPI.prototype,"findByName",1),__decorateClass([getter],BlockAPI.prototype,"findByType",1),__decorateClass([getter],BlockAPI.prototype,"findAll",1),__decorateClass([getter],BlockAPI.prototype,"findAllPlaceholders",1),__decorateClass([setter],BlockAPI.prototype,"createShape",1),__decorateClass([getter],BlockAPI.prototype,"hasShape",1),__decorateClass([getter],BlockAPI.prototype,"getShape",1),__decorateClass([setter],BlockAPI.prototype,"setShape",1),__decorateClass([getter],BlockAPI.prototype,"isVisible",1),__decorateClass([setter],BlockAPI.prototype,"setVisible",1),__decorateClass([getter],BlockAPI.prototype,"isClipped",1),__decorateClass([setter],BlockAPI.prototype,"setClipped",1),__decorateClass([getter],BlockAPI.prototype,"isTransformLocked",1),__decorateClass([setter],BlockAPI.prototype,"setTransformLocked",1),__decorateClass([getter],BlockAPI.prototype,"getPositionX",1),__decorateClass([getter],BlockAPI.prototype,"getPositionXMode",1),__decorateClass([getter],BlockAPI.prototype,"getPositionY",1),__decorateClass([getter],BlockAPI.prototype,"getPositionYMode",1),__decorateClass([setter],BlockAPI.prototype,"setPositionX",1),__decorateClass([setter],BlockAPI.prototype,"setPositionXMode",1),__decorateClass([setter],BlockAPI.prototype,"setPositionY",1),__decorateClass([setter],BlockAPI.prototype,"setPositionYMode",1),__decorateClass([setter],BlockAPI.prototype,"setAlwaysOnTop",1),__decorateClass([setter],BlockAPI.prototype,"setAlwaysOnBottom",1),__decorateClass([getter],BlockAPI.prototype,"isAlwaysOnTop",1),__decorateClass([getter],BlockAPI.prototype,"isAlwaysOnBottom",1),__decorateClass([setter],BlockAPI.prototype,"bringToFront",1),__decorateClass([setter],BlockAPI.prototype,"sendToBack",1),__decorateClass([setter],BlockAPI.prototype,"bringForward",1),__decorateClass([setter],BlockAPI.prototype,"sendBackward",1),__decorateClass([getter],BlockAPI.prototype,"getRotation",1),__decorateClass([setter],BlockAPI.prototype,"setRotation",1),__decorateClass([getter],BlockAPI.prototype,"getFlipHorizontal",1),__decorateClass([getter],BlockAPI.prototype,"getFlipVertical",1),__decorateClass([setter],BlockAPI.prototype,"setFlipHorizontal",1),__decorateClass([setter],BlockAPI.prototype,"setFlipVertical",1),__decorateClass([getter],BlockAPI.prototype,"hasContentFillMode",1),__decorateClass([getter],BlockAPI.prototype,"getWidth",1),__decorateClass([getter],BlockAPI.prototype,"getWidthMode",1),__decorateClass([getter],BlockAPI.prototype,"getHeight",1),__decorateClass([getter],BlockAPI.prototype,"getHeightMode",1),__decorateClass([setter],BlockAPI.prototype,"setWidth",1),__decorateClass([setter],BlockAPI.prototype,"setWidthMode",1),__decorateClass([setter],BlockAPI.prototype,"setHeight",1),__decorateClass([setter],BlockAPI.prototype,"setHeightMode",1),__decorateClass([getter],BlockAPI.prototype,"getFrameX",1),__decorateClass([getter],BlockAPI.prototype,"getFrameY",1),__decorateClass([getter],BlockAPI.prototype,"getFrameWidth",1),__decorateClass([getter],BlockAPI.prototype,"getFrameHeight",1),__decorateClass([setter],BlockAPI.prototype,"setContentFillMode",1),__decorateClass([getter],BlockAPI.prototype,"getContentFillMode",1),__decorateClass([setter],BlockAPI.prototype,"duplicate",1),__decorateClass([setter],BlockAPI.prototype,"destroy",1),__decorateClass([getter],BlockAPI.prototype,"isValid",1),__decorateClass([getter],BlockAPI.prototype,"getParent",1),__decorateClass([getter],BlockAPI.prototype,"getChildren",1),__decorateClass([setter],BlockAPI.prototype,"insertChild",1),__decorateClass([setter],BlockAPI.prototype,"appendChild",1),__decorateClass([getter],BlockAPI.prototype,"referencesAnyVariables",1),__decorateClass([getter],BlockAPI.prototype,"getGlobalBoundingBoxX",1),__decorateClass([getter],BlockAPI.prototype,"getGlobalBoundingBoxY",1),__decorateClass([getter],BlockAPI.prototype,"getGlobalBoundingBoxWidth",1),__decorateClass([getter],BlockAPI.prototype,"getGlobalBoundingBoxHeight",1),__decorateClass([getter],BlockAPI.prototype,"getScreenSpaceBoundingBoxXYWH",1),__decorateClass([setter],BlockAPI.prototype,"alignHorizontally",1),__decorateClass([setter],BlockAPI.prototype,"alignVertically",1),__decorateClass([getter],BlockAPI.prototype,"isAlignable",1),__decorateClass([setter],BlockAPI.prototype,"distributeHorizontally",1),__decorateClass([setter],BlockAPI.prototype,"distributeVertically",1),__decorateClass([setter],BlockAPI.prototype,"isDistributable",1),__decorateClass([setter],BlockAPI.prototype,"fillParent",1),__decorateClass([setter],BlockAPI.prototype,"resizeContentAware",1),__decorateClass([setter],BlockAPI.prototype,"scale",1),__decorateClass([getter],BlockAPI.prototype,"findAllProperties",1),__decorateClass([getter],BlockAPI.prototype,"isPropertyReadable",1),__decorateClass([getter],BlockAPI.prototype,"isPropertyWritable",1),__decorateClass([getter],BlockAPI.prototype,"getPropertyType",1),__decorateClass([getter],BlockAPI.prototype,"getEnumValues",1),__decorateClass([setter],BlockAPI.prototype,"setBool",1),__decorateClass([getter],BlockAPI.prototype,"getBool",1),__decorateClass([setter],BlockAPI.prototype,"setInt",1),__decorateClass([getter],BlockAPI.prototype,"getInt",1),__decorateClass([setter],BlockAPI.prototype,"setFloat",1),__decorateClass([getter],BlockAPI.prototype,"getFloat",1),__decorateClass([setter],BlockAPI.prototype,"setDouble",1),__decorateClass([getter],BlockAPI.prototype,"getDouble",1),__decorateClass([setter],BlockAPI.prototype,"setString",1),__decorateClass([getter],BlockAPI.prototype,"getString",1),__decorateClass([setter],BlockAPI.prototype,"setColor",1),__decorateClass([getter],BlockAPI.prototype,"getColor",1),__decorateClass([setter],BlockAPI.prototype,"setColorRGBA",1),__decorateClass([getter],BlockAPI.prototype,"getColorRGBA",1),__decorateClass([setter],BlockAPI.prototype,"setColorSpot",1),__decorateClass([getter],BlockAPI.prototype,"getColorSpotName",1),__decorateClass([getter],BlockAPI.prototype,"getColorSpotTint",1),__decorateClass([setter],BlockAPI.prototype,"setGradientColorStops",1),__decorateClass([getter],BlockAPI.prototype,"getGradientColorStops",1),__decorateClass([getter],BlockAPI.prototype,"getSourceSet",1),__decorateClass([setter],BlockAPI.prototype,"setSourceSet",1),__decorateClass([setter],BlockAPI.prototype,"setEnum",1),__decorateClass([getter],BlockAPI.prototype,"getEnum",1),__decorateClass([getter],BlockAPI.prototype,"hasCrop",1),__decorateClass([setter],BlockAPI.prototype,"setCropScaleX",1),__decorateClass([setter],BlockAPI.prototype,"setCropScaleY",1),__decorateClass([setter],BlockAPI.prototype,"setCropRotation",1),__decorateClass([setter],BlockAPI.prototype,"setCropScaleRatio",1),__decorateClass([setter],BlockAPI.prototype,"setCropTranslationX",1),__decorateClass([setter],BlockAPI.prototype,"setCropTranslationY",1),__decorateClass([setter],BlockAPI.prototype,"resetCrop",1),__decorateClass([getter],BlockAPI.prototype,"getCropScaleX",1),__decorateClass([getter],BlockAPI.prototype,"getCropScaleY",1),__decorateClass([getter],BlockAPI.prototype,"getCropRotation",1),__decorateClass([getter],BlockAPI.prototype,"getCropScaleRatio",1),__decorateClass([getter],BlockAPI.prototype,"getCropTranslationX",1),__decorateClass([getter],BlockAPI.prototype,"getCropTranslationY",1),__decorateClass([setter],BlockAPI.prototype,"adjustCropToFillFrame",1),__decorateClass([setter],BlockAPI.prototype,"flipCropHorizontal",1),__decorateClass([setter],BlockAPI.prototype,"flipCropVertical",1),__decorateClass([getter],BlockAPI.prototype,"hasOpacity",1),__decorateClass([setter],BlockAPI.prototype,"setOpacity",1),__decorateClass([getter],BlockAPI.prototype,"getOpacity",1),__decorateClass([getter],BlockAPI.prototype,"hasBlendMode",1),__decorateClass([setter],BlockAPI.prototype,"setBlendMode",1),__decorateClass([getter],BlockAPI.prototype,"getBlendMode",1),__decorateClass([getter],BlockAPI.prototype,"hasFillColor",1),__decorateClass([getter],BlockAPI.prototype,"isIncludedInExport",1),__decorateClass([setter],BlockAPI.prototype,"setIncludedInExport",1),__decorateClass([setter],BlockAPI.prototype,"setFillColorRGBA",1),__decorateClass([getter],BlockAPI.prototype,"getFillColorRGBA",1),__decorateClass([setter],BlockAPI.prototype,"setFillColorEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isFillColorEnabled",1),__decorateClass([setter],BlockAPI.prototype,"createEffect",1),__decorateClass([getter],BlockAPI.prototype,"hasEffects",1),__decorateClass([getter],BlockAPI.prototype,"getEffects",1),__decorateClass([setter],BlockAPI.prototype,"insertEffect",1),__decorateClass([setter],BlockAPI.prototype,"appendEffect",1),__decorateClass([setter],BlockAPI.prototype,"removeEffect",1),__decorateClass([getter],BlockAPI.prototype,"hasEffectEnabled",1),__decorateClass([setter],BlockAPI.prototype,"setEffectEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isEffectEnabled",1),__decorateClass([setter],BlockAPI.prototype,"createBlur",1),__decorateClass([getter],BlockAPI.prototype,"hasBlur",1),__decorateClass([setter],BlockAPI.prototype,"setBlur",1),__decorateClass([getter],BlockAPI.prototype,"getBlur",1),__decorateClass([setter],BlockAPI.prototype,"setBlurEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isBlurEnabled",1),__decorateClass([getter],BlockAPI.prototype,"hasBackgroundColor",1),__decorateClass([setter],BlockAPI.prototype,"setBackgroundColorRGBA",1),__decorateClass([getter],BlockAPI.prototype,"getBackgroundColorRGBA",1),__decorateClass([setter],BlockAPI.prototype,"setBackgroundColorEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isBackgroundColorEnabled",1),__decorateClass([getter],BlockAPI.prototype,"hasStroke",1),__decorateClass([setter],BlockAPI.prototype,"setStrokeEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isStrokeEnabled",1),__decorateClass([setter],BlockAPI.prototype,"setStrokeColorRGBA",1),__decorateClass([setter],BlockAPI.prototype,"setStrokeColor",1),__decorateClass([getter],BlockAPI.prototype,"getStrokeColorRGBA",1),__decorateClass([getter],BlockAPI.prototype,"getStrokeColor",1),__decorateClass([setter],BlockAPI.prototype,"setStrokeWidth",1),__decorateClass([getter],BlockAPI.prototype,"getStrokeWidth",1),__decorateClass([setter],BlockAPI.prototype,"setStrokeStyle",1),__decorateClass([getter],BlockAPI.prototype,"getStrokeStyle",1),__decorateClass([setter],BlockAPI.prototype,"setStrokePosition",1),__decorateClass([getter],BlockAPI.prototype,"getStrokePosition",1),__decorateClass([setter],BlockAPI.prototype,"setStrokeCornerGeometry",1),__decorateClass([getter],BlockAPI.prototype,"getStrokeCornerGeometry",1),__decorateClass([getter],BlockAPI.prototype,"hasDropShadow",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isDropShadowEnabled",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowColorRGBA",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowColor",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowColorRGBA",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowColor",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowOffsetX",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowOffsetX",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowOffsetY",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowOffsetY",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowBlurRadiusX",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowBlurRadiusX",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowBlurRadiusY",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowBlurRadiusY",1),__decorateClass([setter],BlockAPI.prototype,"setDropShadowClip",1),__decorateClass([getter],BlockAPI.prototype,"getDropShadowClip",1),__decorateClass([setter],BlockAPI.prototype,"createCutoutFromBlocks",1),__decorateClass([setter],BlockAPI.prototype,"createCutoutFromPath",1),__decorateClass([setter],BlockAPI.prototype,"createCutoutFromOperation",1),__decorateClass([setter],BlockAPI.prototype,"replaceText",1),__decorateClass([setter],BlockAPI.prototype,"removeText",1),__decorateClass([setter],BlockAPI.prototype,"setTextColor",1),__decorateClass([getter],BlockAPI.prototype,"getTextColors",1),__decorateClass([getter],BlockAPI.prototype,"getTextFontWeights",1),__decorateClass([getter],BlockAPI.prototype,"getTextFontStyles",1),__decorateClass([getter],BlockAPI.prototype,"getTextCases",1),__decorateClass([setter],BlockAPI.prototype,"setTextCase",1),__decorateClass([getter],BlockAPI.prototype,"getTextCursorRange",1),__decorateClass([getter],BlockAPI.prototype,"hasFill",1),__decorateClass([getter],BlockAPI.prototype,"isFillEnabled",1),__decorateClass([setter],BlockAPI.prototype,"setFillEnabled",1),__decorateClass([getter],BlockAPI.prototype,"getFill",1),__decorateClass([setter],BlockAPI.prototype,"setFill",1),__decorateClass([setter],BlockAPI.prototype,"setFillSolidColor",1),__decorateClass([getter],BlockAPI.prototype,"getFillSolidColor",1),__decorateClass([setter],BlockAPI.prototype,"setPlaceholderEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isPlaceholderEnabled",1),__decorateClass([getter],BlockAPI.prototype,"hasPlaceholderBehavior",1),__decorateClass([setter],BlockAPI.prototype,"setPlaceholderBehaviorEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isPlaceholderBehaviorEnabled",1),__decorateClass([getter],BlockAPI.prototype,"hasPlaceholderControls",1),__decorateClass([setter],BlockAPI.prototype,"setPlaceholderControlsOverlayEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isPlaceholderControlsOverlayEnabled",1),__decorateClass([setter],BlockAPI.prototype,"setPlaceholderControlsButtonEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isPlaceholderControlsButtonEnabled",1),__decorateClass([setter],BlockAPI.prototype,"setMetadata",1),__decorateClass([getter],BlockAPI.prototype,"getMetadata",1),__decorateClass([getter],BlockAPI.prototype,"hasMetadata",1),__decorateClass([getter],BlockAPI.prototype,"findAllMetadata",1),__decorateClass([setter],BlockAPI.prototype,"removeMetadata",1),__decorateClass([setter],BlockAPI.prototype,"setScopeEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isScopeEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isAllowedByScope",1),__decorateClass([getter],BlockAPI.prototype,"hasDuration",1),__decorateClass([setter],BlockAPI.prototype,"setDuration",1),__decorateClass([getter],BlockAPI.prototype,"getDuration",1),__decorateClass([getter],BlockAPI.prototype,"hasTimeOffset",1),__decorateClass([setter],BlockAPI.prototype,"setTimeOffset",1),__decorateClass([getter],BlockAPI.prototype,"getTimeOffset",1),__decorateClass([getter],BlockAPI.prototype,"hasTrim",1),__decorateClass([setter],BlockAPI.prototype,"setTrimOffset",1),__decorateClass([getter],BlockAPI.prototype,"getTrimOffset",1),__decorateClass([setter],BlockAPI.prototype,"setTrimLength",1),__decorateClass([getter],BlockAPI.prototype,"getTrimLength",1),__decorateClass([getter],BlockAPI.prototype,"getTotalSceneDuration",1),__decorateClass([setter],BlockAPI.prototype,"setPlaying",1),__decorateClass([getter],BlockAPI.prototype,"isPlaying",1),__decorateClass([getter],BlockAPI.prototype,"hasPlaybackTime",1),__decorateClass([setter],BlockAPI.prototype,"setPlaybackTime",1),__decorateClass([getter],BlockAPI.prototype,"getPlaybackTime",1),__decorateClass([setter],BlockAPI.prototype,"setSoloPlaybackEnabled",1),__decorateClass([getter],BlockAPI.prototype,"isSoloPlaybackEnabled",1),__decorateClass([getter],BlockAPI.prototype,"hasPlaybackControl",1),__decorateClass([setter],BlockAPI.prototype,"setLooping",1),__decorateClass([getter],BlockAPI.prototype,"isLooping",1),__decorateClass([setter],BlockAPI.prototype,"setMuted",1),__decorateClass([getter],BlockAPI.prototype,"isMuted",1),__decorateClass([setter],BlockAPI.prototype,"setVolume",1),__decorateClass([getter],BlockAPI.prototype,"getVolume",1),__decorateClass([setter],BlockAPI.prototype,"forceLoadAVResource",1),__decorateClass([getter],BlockAPI.prototype,"getAVResourceTotalDuration",1),__decorateClass([getter],BlockAPI.prototype,"getVideoWidth",1),__decorateClass([getter],BlockAPI.prototype,"getVideoHeight",1),__decorateClass([getter],BlockAPI.prototype,"getVideoFillThumbnail",1),__decorateClass([getter],BlockAPI.prototype,"getVideoFillThumbnailAtlas",1),__decorateClass([getter],BlockAPI.prototype,"getPageThumbnailAtlas",1);var EditorAPI=class{#e;constructor(e){this.#e=e}unlockWithLicense(e){unpackResult(this.#e.unlockWithLicense(e))}getActiveLicense(){return unpackResult(this.#e.getActiveLicense())}onStateChanged=e=>{const t=this.#e.subscribeToEditorState(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}};setEditMode(e){assert2("keypath",e,string()),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){unpackResult(this.#e.destroyHistory(e))}setActiveHistory(e){unpackResult(this.#e.setActiveHistory(e))}getActiveHistory(){return this.#e.getActiveHistory()}addUndoStep(){unpackResult(this.#e.addUndoStep())}undo(){unpackResult(this.#e.undo())}redo(){unpackResult(this.#e.redo())}canUndo(){return unpackResult(this.#e.canUndo())}canRedo(){return unpackResult(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()||unpackResult(this.#e.unsubscribe(t))}};setSettingBool(e,t){return assert2("keypath",e,string()),assert2("value",t,boolean()),unpackResult(this.#e.setSettingBool(e,t))}getSettingBool(e){return assert2("keypath",e,string()),unpackResult(this.#e.getSettingBool(e))}setSettingInt(e,t){return assert2("keypath",e,string()),assert2("value",t,integer()),unpackResult(this.#e.setSettingInt(e,t))}getSettingInt(e){return assert2("keypath",e,string()),unpackResult(this.#e.getSettingInt(e))}setSettingFloat(e,t){return assert2("keypath",e,string()),assert2("value",t,number()),unpackResult(this.#e.setSettingFloat(e,t))}getSettingFloat(e){return assert2("keypath",e,string()),unpackResult(this.#e.getSettingFloat(e))}setSettingString(e,t){return assert2("keypath",e,string()),assert2("value",t,string()),unpackResult(this.#e.setSettingString(e,t))}getSettingString(e){return assert2("keypath",e,string()),unpackResult(this.#e.getSettingString(e))}setSettingColor(e,t){return assert2("keypath",e,string()),unpackResult(this.#e.setSettingColor(e,ColorInternal.fromColor(t)))}getSettingColor(e){return assert2("keypath",e,string()),ColorInternal.toColor(unpackResult(this.#e.getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return assert2("keypath",e,string()),assert2("r",t,number()),assert2("g",r,number()),assert2("b",n,number()),assert2("a",o,number()),unpackResult(this.#e.setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return assert2("keypath",e,string()),unpackResult(this.#e.getSettingColorRGBA(e))}setSettingEnum(e,t){return assert2("keypath",e,string()),assert2("value",t,string()),unpackResult(this.#e.setSettingEnum(e,t))}getSettingEnum(e){return assert2("keypath",e,string()),unpackResult(this.#e.getSettingEnum(e))}getSettingEnumOptions(e){return assert2("keypath",e,string()),cppVectorToArray_default(unpackResult(this.#e.getSettingEnumOptions(e)))}findAllSettings(){return cppVectorToArray_default(this.#e.findAllSettings())}getSettingType(e){assert2("keypath",e,string());return unpackResult(this.#e.getSettingType(e))}getAvailableMemory(){return unpackResult(this.#e.getAvailableMemory())}getUsedMemory(){return unpackResult(this.#e.getUsedMemory())}setURIResolver(e){return unpackResult(this.#e.setURIResolver(e))}defaultURIResolver(e){return this.#e.defaultURIResolver(e)}getAbsoluteURI(e){return unpackResult(this.#e.getAbsoluteURI(e))}setGlobalScope(e,t){assert2("key",e,string()),assert2("value",t,string()),unpackResult(this.#e.setGlobalScope(e,t))}getGlobalScope(e){return assert2("key",e,string()),unpackResult(this.#e.getGlobalScope(e))}findAllSpotColors(){return cppVectorToArray_default(this.#e.findAllSpotColors())}getSpotColorRGBA(e){return assert2("name",e,string()),this.#e.getSpotColorRGB(e)}getSpotColorCMYK(e){return assert2("name",e,string()),this.#e.getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return assert2("name",e,string()),assert2("r",t,number()),assert2("g",r,number()),assert2("b",n,number()),this.#e.setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return assert2("name",e,string()),assert2("c",t,number()),assert2("m",r,number()),assert2("y",n,number()),assert2("k",o,number()),this.#e.setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return assert2("name",e,string()),unpackResult(this.#e.removeSpotColor(e))}setSpotColorForCutoutType(e,t){return assert2("type",e,string()),assert2("color",t,string()),unpackResult(this.#e.setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return assert2("type",e,string()),unpackResult(this.#e.getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return assert2("colorSpace",t,string()),ColorInternal.toColor(unpackResult(this.#e.convertColorToColorSpace(ColorInternal.fromColor(e),t)))}};__decorateClass([setter],EditorAPI.prototype,"setEditMode",1),__decorateClass([getter],EditorAPI.prototype,"getEditMode",1),__decorateClass([getter],EditorAPI.prototype,"getCursorType",1),__decorateClass([getter],EditorAPI.prototype,"getCursorRotation",1),__decorateClass([getter],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceX",1),__decorateClass([getter],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceY",1),__decorateClass([setter],EditorAPI.prototype,"createHistory",1),__decorateClass([setter],EditorAPI.prototype,"destroyHistory",1),__decorateClass([setter],EditorAPI.prototype,"setActiveHistory",1),__decorateClass([getter],EditorAPI.prototype,"getActiveHistory",1),__decorateClass([setter],EditorAPI.prototype,"addUndoStep",1),__decorateClass([setter],EditorAPI.prototype,"undo",1),__decorateClass([setter],EditorAPI.prototype,"redo",1),__decorateClass([getter],EditorAPI.prototype,"canUndo",1),__decorateClass([getter],EditorAPI.prototype,"canRedo",1),__decorateClass([setter],EditorAPI.prototype,"setSettingBool",1),__decorateClass([getter],EditorAPI.prototype,"getSettingBool",1),__decorateClass([setter],EditorAPI.prototype,"setSettingInt",1),__decorateClass([getter],EditorAPI.prototype,"getSettingInt",1),__decorateClass([setter],EditorAPI.prototype,"setSettingFloat",1),__decorateClass([getter],EditorAPI.prototype,"getSettingFloat",1),__decorateClass([setter],EditorAPI.prototype,"setSettingString",1),__decorateClass([getter],EditorAPI.prototype,"getSettingString",1),__decorateClass([setter],EditorAPI.prototype,"setSettingColor",1),__decorateClass([getter],EditorAPI.prototype,"getSettingColor",1),__decorateClass([setter],EditorAPI.prototype,"setSettingColorRGBA",1),__decorateClass([getter],EditorAPI.prototype,"getSettingColorRGBA",1),__decorateClass([setter],EditorAPI.prototype,"setSettingEnum",1),__decorateClass([getter],EditorAPI.prototype,"getSettingEnum",1),__decorateClass([getter],EditorAPI.prototype,"getAvailableMemory",1),__decorateClass([getter],EditorAPI.prototype,"getUsedMemory",1),__decorateClass([setter],EditorAPI.prototype,"setURIResolver",1),__decorateClass([getter],EditorAPI.prototype,"defaultURIResolver",1),__decorateClass([getter],EditorAPI.prototype,"getAbsoluteURI",1),__decorateClass([setter],EditorAPI.prototype,"setGlobalScope",1),__decorateClass([getter],EditorAPI.prototype,"getGlobalScope",1),__decorateClass([getter],EditorAPI.prototype,"findAllSpotColors",1),__decorateClass([getter],EditorAPI.prototype,"getSpotColorRGBA",1),__decorateClass([getter],EditorAPI.prototype,"getSpotColorCMYK",1),__decorateClass([setter],EditorAPI.prototype,"setSpotColorRGB",1),__decorateClass([setter],EditorAPI.prototype,"setSpotColorCMYK",1),__decorateClass([setter],EditorAPI.prototype,"removeSpotColor",1),__decorateClass([setter],EditorAPI.prototype,"setSpotColorForCutoutType",1),__decorateClass([setter],EditorAPI.prototype,"getSpotColorForCutoutType",1);var EventAPI=class{#e;constructor(e){this.#e=e}subscribe=(e,t)=>{assert2("blocks",e,array());const r=this.#e.subscribe(e,(e=>{try{t(cppVectorToArray_default(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(r))}}},SceneAPI=class{#e;constructor(e){this.#e=e}async loadFromString(e){return assert2("sceneContent",e,string()),unpackAsync((t=>this.#e.loadSceneFromString(e,t)))}async loadFromURL(e){return assert2("url",e,string()),unpackAsync((t=>this.#e.loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return unpackAsync((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 Blob_default([r],{type:MimeType_default.Zip}))}))}))}create(e="Free"){assert2("sceneLayout",e,sceneLayoutShape());return unpackResult(this.#e.createScene(e))}createVideo(){return unpackResult(this.#e.createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,s=!1){return assert2("url",e,string()),assert2("dpi",t,min(number(),0)),assert2("pixelScaleFactor",r,min(number(),0)),assert2("sceneLayout",n,sceneLayoutShape()),unpackAsync((a=>this.#e.createSceneFromImage(e,t,r,n,o,s,a)))}createFromVideo(e){return assert2("url",e,string()),unpackAsync((t=>this.#e.createSceneFromVideo(e,t)))}get(){const e=unpackResult(this.#e.findByType("scene")),t=cppVectorToArray_default(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return assert2("content",e,string()),unpackAsync((t=>this.#e.applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return assert2("url",e,string()),unpackAsync((t=>this.#e.applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return unpackResult(this.#e.getSceneMode(e))}setDesignUnit(e){assert2("designUnit",e,designUnitShape());const t=this.get();unpackResult(this.#e.setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return unpackResult(this.#e.getDesignUnit(e))}getPages(){return cppVectorToArray_default(unpackResult(this.#e.getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=unpackResult(this.#e.findNearestToViewPortCenterByKind(e,"page")),r=cppVectorToArray_default(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){assert2("type",e,string());const t=this.get();if(null==t)return[];const r=unpackResult(this.#e.findNearestToViewPortCenterByType(t,e));return cppVectorToArray_default(r)}findNearestToViewPortCenterByKind(e){assert2("kind",e,string());const t=this.get();if(null==t)return[];const r=unpackResult(this.#e.findNearestToViewPortCenterByKind(t,e));return cppVectorToArray_default(r)}setZoomLevel(e=1){const t=this.get();assert2("zoomLevel",e,min(number(),0)),this.#e.setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return unpackResult(this.#e.getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return assert2("id",e,integer()),unpackAsync((s=>this.#e.zoomToBlock(e,t,r,n,o,s)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,s=0){return assert2("id",e,integer()),assert2("axis",t,zoomAutoFitAxisShape()),"Horizontal"===t?(assert2("paddingBefore",r,number()),assert2("paddingAfter",n,number()),unpackResult(this.#e.enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(assert2("paddingBefore",r,number()),assert2("paddingAfter",n,number()),unpackResult(this.#e.enableZoomAutoFit(e,t,0,r,0,n))):(assert2("paddingLeft",r,number()),assert2("paddingTop",n,number()),assert2("paddingRight",o,number()),assert2("paddingBottom",s,number()),unpackResult(this.#e.enableZoomAutoFit(e,t,r,n,o,s)))}disableZoomAutoFit(e){return assert2("blockOrScene",e,integer()),unpackResult(this.#e.disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return assert2("blockOrScene",e,integer()),unpackResult(this.#e.isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,s=0,a=0,i=0,u=0){return assert2("ids",e,array(number())),assert2("paddingLeft",t,number()),assert2("paddingTop",r,number()),assert2("paddingRight",n,number()),assert2("paddingBottom",o,number()),assert2("scaledPaddingLeft",t,number()),assert2("scaledPaddingTop",r,number()),assert2("scaledPaddingRight",n,number()),assert2("scaledPaddingBottom",o,number()),unpackResult(this.#e.unstable_enableCameraPositionClamping(e,t,r,n,o,s,a,i,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return unpackResult(this.#e.unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return unpackResult(this.#e.unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,s=0,a=0){return assert2("ids",e,array(number())),assert2("minZoomLimit",t,number()),assert2("maxZoomLimit",r,number()),assert2("paddingLeft",n,number()),assert2("paddingTop",o,number()),assert2("paddingRight",s,number()),assert2("paddingBottom",a,number()),unpackResult(this.#e.unstable_enableCameraZoomClamping(e,t,r,n,o,s,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return unpackResult(this.#e.unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return unpackResult(this.#e.unstable_isCameraZoomClampingEnabled(e))}onZoomLevelChanged=e=>{const t=this.#e.subscribeToZoomLevel(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}};onActiveChanged=e=>{const t=this.#e.subscribeToActiveSceneChange(e);return()=>{this.#e.isDeleted()||unpackResult(this.#e.unsubscribe(t))}}};function makeSource(e,t){const r=new Set;function n(n){r.add(n);e?.(((e,...t)=>{n(e);for(const e of t)n(e)}));return()=>{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}__decorateClass([setter],SceneAPI.prototype,"loadFromString",1),__decorateClass([setter],SceneAPI.prototype,"loadFromURL",1),__decorateClass([setter],SceneAPI.prototype,"create",1),__decorateClass([setter],SceneAPI.prototype,"createVideo",1),__decorateClass([setter],SceneAPI.prototype,"createFromImage",1),__decorateClass([setter],SceneAPI.prototype,"createFromVideo",1),__decorateClass([getter],SceneAPI.prototype,"get",1),__decorateClass([setter],SceneAPI.prototype,"applyTemplateFromString",1),__decorateClass([setter],SceneAPI.prototype,"applyTemplateFromURL",1),__decorateClass([getter],SceneAPI.prototype,"getMode",1),__decorateClass([setter],SceneAPI.prototype,"setDesignUnit",1),__decorateClass([getter],SceneAPI.prototype,"getDesignUnit",1),__decorateClass([getter],SceneAPI.prototype,"getPages",1),__decorateClass([getter],SceneAPI.prototype,"getCurrentPage",1),__decorateClass([getter],SceneAPI.prototype,"findNearestToViewPortCenterByType",1),__decorateClass([getter],SceneAPI.prototype,"findNearestToViewPortCenterByKind",1),__decorateClass([setter],SceneAPI.prototype,"setZoomLevel",1),__decorateClass([getter],SceneAPI.prototype,"getZoomLevel",1),__decorateClass([setter],SceneAPI.prototype,"zoomToBlock",1),__decorateClass([setter],SceneAPI.prototype,"enableZoomAutoFit",1),__decorateClass([setter],SceneAPI.prototype,"disableZoomAutoFit",1),__decorateClass([getter],SceneAPI.prototype,"isZoomAutoFitEnabled",1);var map=e=>t=>function(r){return t((function(t){r(e(t))}))};function startWith(e){return t=>function(r){let n=!1;const o=t((function(e){n=!0,r(e)}));return n||r(e instanceof Function?e():e),o}}var memo=(e=((e,t)=>e===t))=>t=>function(r){let n;return t((function(t){e(t,n)||(n=t,r(t))}))},fan=e=>{const t=new Set;let r=null;return function(n){return t.add(n),null===r&&(r=e((function(e){t.forEach((t=>t(e)))}))),function(){t.delete(n),0===t.size&&(r?.(),r=null)}}};function pipe(e,...t){return t.reduce(((e,t)=>t(e)),e)}var merge=(...e)=>{const t=Array.from(e);return function(e){const r=t.map((function(t){return t(e)}));return function(){for(const e of r)e()}}};function switchAll(e){return function(t){let r=null;const n=e((function(e){r?.(),r=e?e(t):e}));return function(){n(),r?.(),r=null}}}function combineLatest(...e){const t=Array.from(e);return function(e){const r=new Array(t.length),n=t.map(((t,n)=>t((function(t){r[n]=t,e(r)}))));return function(){n.forEach((e=>e())),r.length=0}}}var NO_VALUE=Symbol("NO_VALUE");function makeValueChannel(e){let t=NO_VALUE;const r=makeSource();return{subscribe:r,value:()=>(t===NO_VALUE&&(t=e()),t),update(e){t=e,r.emit(t)}}}var Settings=class{#o;#s=null;#a;constructor(e){this.#o=e;const t=makeSource((()=>{1===t.handlers.size&&this.#i()}),(()=>{0===t.handlers.size&&this.#s?.()}));this.#a=t}dispose(){this.#a.handlers.clear(),this.#s?.()}#i(){if(this.#s)throw new Error("Settings Changed Event callback is already registered.");const e=this.#o.onSettingsChanged((()=>{this.#a.emit()}));this.#s=()=>{e(),this.#s=null}}#u(e){const t=()=>this.#o.getSettingBool(e);return{subscribe:pipe((e=>this.#a(e)),map(t),memo(),fan),update:t=>{this.#o.setSettingBool(e,t),this.#a.emit()},value:t}}#c(e){const t=()=>this.#o.getSettingEnum(e);return{subscribe:pipe((e=>this.#a(e)),map(t),memo(),fan),update:t=>{this.#o.setSettingEnum(e,t),this.#a.emit()},value:t}}#l(e){const t=()=>this.#o.getSettingString(e);return{subscribe:pipe((e=>this.#a(e)),map(t),memo(),fan),update:t=>{this.#o.setSettingString(e,t),this.#a.emit()},value:t}}singlePageMode=this.#u("features/singlePageModeEnabled");role=this.#c("role");pageTitleShow=this.#u("page/title/show");pageTitleshowPageTitleTemplate=this.#u("page/title/showPageTitleTemplate");pageTitleAppendPageName=this.#u("page/title/appendPageName");pageTitleShowOnSinglePage=this.#u("page/title/showOnSinglePage");separator=this.#l("page/title/separator");pageTitleFont=this.#l("page/title/fontFileUri");dimOutOfPageAreas=this.#u("page/dimOutOfPageAreas");singlePointPanning=this.#u("touch/singlePointPanning");touchPinchAction=this.#c("touch/pinchAction");touchRotateAction=this.#c("touch/rotateAction");dragStartCanSelect=this.#u("touch/dragStartCanSelect");featureHspSelectiveAdjustmentsEnabled=this.#u("features/hspSelectiveAdjustmentsEnabled");featureLayerListEnabled=this.#u("features/layerListEnabled");unstable_videoExportInactivityTimeout=makeValueChannel((()=>1e4))},VariableAPI=class{#e;constructor(e){this.#e=e}findAll(){return cppVectorToArray_default(this.#e.findAllVariables())}setString(e,t){return assert2("key",e,string()),assert2("value",t,string()),unpackResult(this.#e.setVariableString(e,t))}getString(e){return assert2("key",e,string()),unpackResult(this.#e.getVariableString(e))}remove(e){return assert2("key",e,string()),unpackResult(this.#e.removeVariable(e))}},LogLevel={Info:"Info",Warning:"Warning",Error:"Error"};function defaultLogger(e,t){const r=`[UBQ] ${e}`;switch(t){case"Warning":console.warn(r);break;case"Error":console.error(r);break;case"Info":console.info(r);break;default:console.log(r)}}var BASE_URL_DEFAULT="https://cdn.img.ly/packages/imgly/cesdk-engine/1.20.0-rc.0/assets",defaultExtensions={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function ensureIsAbsoluteURL(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function ensureIsValidDirectoryURL(e){return"/"!==e[e.length-1]?`${e}/`:e}function joinPaths(e,t){const r=e.endsWith("/"),n=t.startsWith("/");return r&&n?`${e.substring(0,e.length-1)}${t}`:r||n?`${e}${t}`:`${e}/${t}`}function initWithDefaults(e={},t=BASE_URL_DEFAULT){const r={...e,license:e.license??"",featureFlags:e.featureFlags??{},baseURL:e.baseURL??t,core:e.core??{baseURL:"core/"},extensions:e.extensions??{...defaultExtensions},logger:e.logger??defaultLogger,presets:e.presets??{}};return r.extensions.baseURL??=defaultExtensions.baseURL,r.extensions.entries??={...defaultExtensions.entries},r.baseURL=ensureIsAbsoluteURL(r.baseURL),r.baseURL=ensureIsValidDirectoryURL(r.baseURL),r.core.baseURL=ensureIsAbsoluteURL(r.core.baseURL,r.baseURL),r.core.baseURL=ensureIsValidDirectoryURL(r.core.baseURL),r.extensions.baseURL=ensureIsValidDirectoryURL(r.extensions.baseURL),r.extensions.entries=r.extensions.entries.map((e=>ensureIsValidDirectoryURL(e))),r}async function loadAssetSourcesFromContentJSON(e,t,r=fetch,n,o=new Set(n.findAllSources())){const s=e.map((async e=>{const s=joinPaths(t,`/${e}/content.json`);return r(s).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})).then((r=>{if(void 0===r.assets)throw new Error(`Invalid content.json for assets: ${e}`);const s=r.assets;o.has(e)||n.addLocalSource(e),s.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,n])=>{const o=n.toString();if(o.includes("{{base_url}}")){const n=o.replace("{{base_url}}",t);r.meta&&(r.meta[e]=n)}})),r.payload?.sourceSet&&r.payload.sourceSet.forEach((e=>{e.uri.includes("{{base_url}}")&&(e.uri=e.uri.replace("{{base_url}}",t))})),n.addAssetToSource(e,r)}))}))}));await Promise.all(s)}var loadAssetSourcesFromContentJSON_default=loadAssetSourcesFromContentJSON;async function addDefaultAssetSources(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.colors.defaultPalette","ly.img.filter.lut","ly.img.filter.duotone","ly.img.effect","ly.img.blur"].filter((e=>!r.includes(e)));await loadAssetSourcesFromContentJSON_default(o,t,n,e)}var addDefaultAssetSources_default=addDefaultAssetSources,DEFAULT_DEMO_ASSET_SOURCE_BASE_URL="https://cdn.img.ly/assets/demo/v2";async function addDemoAssetSources(e,t,r,n,o,s,a=DEFAULT_DEMO_ASSET_SOURCE_BASE_URL){const i=new Set(e.findAllSources()),u="ly.img.image.upload";!o||r.includes(u)||i.has(u)||e.addLocalSource(u,["image/jpeg","image/png","image/webp","image/svg+xml","image/gif","image/bmp"]);const c="ly.img.video.upload";"Video"!==n||!o||r.includes(c)||i.has(c)||e.addLocalSource(c,["video/mp4","video/quicktime"]);const l="ly.img.audio.upload";"Video"!==n||!o||r.includes(l)||i.has(l)||e.addLocalSource(l,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const d=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!r.includes(e)));i.has("ly.img.template")||r.includes("ly.img.template")||(e.addLocalSource("ly.img.template",void 0,(async e=>{const r=e.meta?.uri;if(r)if(r.startsWith("UBQ1"))t.applyTemplateFromString(r);else{const e=new URL(r,window.location.href);t.applyTemplateFromURL(e.href)}})),d.push("ly.img.template")),await loadAssetSourcesFromContentJSON_default(d,a,s,e)}var addDemoAssetSources_default=addDemoAssetSources;function defineElement(){customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",class HTMLCreativeEngineCanvasElement extends HTMLElement{#d;constructor(){super(),this.#d=document.createElement("canvas");const e=document.createElement("style");e.textContent=":host {display: block; width: 100%; height: 100%; contain: content;} canvas {position: absolute; inset: 0; width: 100%; height:100%; display: block; touch-action: none;}",this.attachShadow({mode:"closed"}).append(e,this.#d)}getInternalCanvas(){if(!this.#d)throw new Error("Internal canvas element is undefined");return this.#d}dispose(){this.#d?.remove(),this.#d=void 0}clear(){if(!this.#d)return;const e=this.#d.width;this.#d.width=1,this.#d.width=e}})}function initResizeHandlers(e,t){let r;const n=new Set;function o(){const n=window.devicePixelRatio,{width:s,height:a}=e.getBoundingClientRect();t(s*n,a*n,n),r=matchMedia(`(resolution: ${n}dppx)`),r.addEventListener("change",o,{once:!0})}o();const s=new ResizeObserver((function([e]){const{width:r,height:o}=e.target.getBoundingClientRect();if(r<=0||o<=0)return;const s=window.devicePixelRatio,a=setTimeout((function(){n.delete(a),t(r*s,o*s,s)}),0);n.add(a)}));return s.observe(e),()=>{r.removeEventListener("change",o),s.disconnect();for(const e of n)clearTimeout(e);n.clear(),e=null,t=null}}var import_isEqual=__toESM(require_isEqual()),PropsComponentType=(e=>(e.Scene="ubq/designblocks/SceneProps",e.Camera="ubq/designblocks/Camera",e.Common="ubq/designblocks/CommonDesignBlockProps",e.Page="ubq/designblocks/Page",e.Image="ubq/designblocks/Image",e.Video="ubq/designblocks/Video",e.Audio="ubq/designblocks/Audio",e.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/Text",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState",e.DesignBlockFrame="ubq/designblocks/DesignBlockFrame",e.Size="ubq/layout/Size",e.Position="ubq/layout/Position",e.EulerRotation="ubq/scene/EulerRotation",e.Children="ubq/scene/Children",e))(PropsComponentType||{}),PropsComponentType_default=PropsComponentType,import_once=__toESM(require_once());function getBlockStream(e,t){const{block:r,event:n}=t;return pipe((t=>{const o=r.getType(e),s=(0,import_once.default)(n.subscribe([e],(n=>{n.some((e=>"Destroyed"===e.type))&&!r.isValid(e)||r.getType(e)!==o?s():t(n)})));return s}),fan)}function memoizeResult(e,t){if(!t)return e;let r;return(...n)=>{const o=e(...n);return t(o,r)||(r=o),r}}var makeEngineChannel_default=makeEngineChannel;function makeEngineChannel(e,t,r,n){const o=memoizeResult(t,n?.equals),s=makeSource();return{subscribe:pipe(merge(e,s),map(o),memo(),fan),update:r,value:o,flush:()=>s.emit()}}var Camera=class{settings;clampCamera=!1;clampResult=makeValueChannel((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})));zoomLevel;#p;viewportPadding=makeValueChannel((()=>({x:40,y:48})));autoFit;scrollPercentage;sceneSize;scroll;constructor(e){const{block:t,scene:r,_ubq:n}=e,o=pipe(r.onActiveChanged,startWith(),map((()=>r.get()))),s=pipe(o,map((r=>null!=r&&t.isValid(r)?pipe(getBlockStream(r,e),startWith([]),map((()=>t.getFloat(r,"scene/dpi")))):()=>()=>{})),switchAll),a=pipe(o,map((()=>{const r=t.findByType("camera")[0];return null==r?()=>()=>{}:pipe(getBlockStream(r,e),startWith([]),map((()=>r)))})),switchAll);this.settings={subscribe:pipe(a,map((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),memo(import_isEqual.default),fan),update({width:e,height:r,pixelRatio:n}){const o=t.findByType("camera")[0];null!=o&&(t.setFloat(o,"camera/resolution/width",e),t.setFloat(o,"camera/resolution/height",r),t.setFloat(o,"camera/pixelRatio",n))},value(){const e=t.findByType("camera")[0];return null==e?{width:0,height:0,pixelRatio:1}:{width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}}},this.zoomLevel=makeEngineChannel_default(merge(r.onZoomLevelChanged,s),(()=>{const e=r.get();return null!=e&&t.isValid(e)?r.getZoomLevel():1}),(e=>{const n=r.get();null!=n&&t.isValid(n)&&r.setZoomLevel(e)})),this.#p={subscribe:pipe(a,map((e=>new UBQHelper(n).getValue(e,PropsComponentType_default.Camera,"zoomLevel"))),memo()),value(){const e=t.findByType("camera")[0];return null==e?1:new UBQHelper(n).getValue(e,PropsComponentType_default.Camera,"zoomLevel")}},this.autoFit=makeEngineChannel_default(r.onZoomLevelChanged,(()=>{const e=r.get();return null!=e&&r.isZoomAutoFitEnabled(e)})),this.scrollPercentage={subscribe:pipe(this.clampResult.subscribe,map((e=>e.scrollPercentage)),memo(import_isEqual.default)),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:pipe(combineLatest(this.clampResult.subscribe,this.#p.subscribe,this.settings.subscribe),map((([e,t,r])=>{const n=e?.sceneSize??this.clampResult.value().sceneSize??{x:0,y:0},o=t??this.#p.value()??10,s=r?.pixelRatio??this.settings.value().pixelRatio??1;return{x:n.x*o/s,y:n.y*o/s}})),memo(import_isEqual.default)),value:()=>{const e=this.clampResult.value().sceneSize??{x:0,y:0},t=this.#p.value()??10,r=this.settings.value().pixelRatio??1;return{x:e.x*t/r,y:e.y*t/r}}},this.scroll=e=>{const r=t.findByType("camera")[0];if(null==r)return;const n=this.#p.value(),o=this.settings.value().pixelRatio,s=e.x*o/n,a=e.y*o/n,i={x:t.getPositionX(r)+s,y:t.getPositionY(r)+a};t.setPositionX(r,i.x),t.setPositionY(r,i.y)}}};function migrateConfigObject(e){return e&&"callbacks"in e&&e.callbacks?.log&&!e.logger?{...e,logger:e.callbacks.log}:e}function apiFallback(e,t){if(e)try{const r=t.editor;if(null!=e.page?.title?.show&&r.setSettingBool("page/title/show",e.page.title.show),null!=e.page?.title?.fontFileUri&&r.setSettingString("page/title/fontFileUri",e.page?.title?.fontFileUri),null!=e.page?.dimOutOfPageAreas&&r.setSettingBool("page/dimOutOfPageAreas",e.page?.dimOutOfPageAreas),e.variables)for(const r in e.variables)if(Object.prototype.hasOwnProperty.call(e.variables,r)){const n=e.variables[r];t.variable.setString(r,String(n.value))}}catch(e){console.error(e)}}function warnKeys(e){const t=[];return e?("callbacks"in e&&e.callbacks?.log&&t.push("config.callbacks.log has been moved to config.logger"),e.scene&&t.push("config.scene options have been removed. You can set a scene's dpi and pixelScaleFactor via the BlockApi's setInt(sceneId, 'scene/dpi', dpi) and setInt(sceneId, 'scene/pixelScaleFactor', factor)."),e.page&&t.push("config.page options have been moved to the EditorAPI"),e.variables&&t.push("config.variables has been removed. Please use the VariableAPI instead"),t):t}function initContextLossHandlers(e,t,r=void 0){const n=e=>{unpackResult(t.setContext("")),e.preventDefault()},o=e=>{unpackResult(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",o,!1),()=>{e.removeEventListener("webglcontextlost",n),e.removeEventListener("webglcontextrestored",o)}}var isDevelopment=!1;function configureEngine(e,t){const r=new UBQHelper(e),n=new EditorAPI(e),o=new AssetAPI(e);n.setSettingEnum("role",t.role??"Creator"),"Adopter"===t.role&&n.setSettingEnum("doubleClickSelectionMode","Direct"),isDevelopment&&(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",isDevelopment||!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(){isDevelopment&&(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);(isDevelopment||"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"))}()}var licenseEndpoint="https://api.img.ly/activate";function downloadAndCheckLicense(e,t=window.fetch){if(!e.license)throw new Error("Missing license key in config");return e.license.length<128?t(licenseEndpoint,{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)}function unlockUbq(e,t){if(!t)throw new Error("Missing license key");unpackResult(e.unlockWithLicense(t))}var import_cesdk=__toESM(require_cesdk()),cesdk_default="./cesdk-v1.20.0-rc.0-DTDUIA7U.data",cesdk_default2="./cesdk-v1.20.0-rc.0-OXMA3Z6S.wasm",CESDK_JS=import_cesdk.default,canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),userAgent=canUseDOM&&navigator&&navigator.userAgent||"",isEdge=-1!==userAgent.indexOf("Edge"),isIE=!!userAgent.match(/msie|trident/i),isWebKit=/\b(iPad|iPhone|iPod)\b/.test(userAgent)&&/WebKit/.test(userAgent)&&!/Edge/.test(userAgent)&&("undefined"==typeof window||!("MSStream"in window)),changeAssetPath=(e,t)=>{if(null!=t){return[t,e.split("/").pop()].join("")}return new URL(e,window.location.origin)};function getWasmMemory(){try{return new WebAssembly.Memory({initial:getWasmPageLimitFromMegabytes(isWebKit?512:32),maximum:getWasmPageLimitFromMegabytes(2048)})}catch(e){return new WebAssembly.Memory({initial:getWasmPageLimitFromMegabytes(32),maximum:getWasmPageLimitFromMegabytes(2048)})}}function getWasmPageLimitFromMegabytes(e){return 1024*e*1024/65536}async function init(e,t){const{core:r}=t,n=t.logger,o=changeAssetPath(cesdk_default2,r.baseURL).toString(),s=changeAssetPath(cesdk_default,r.baseURL).toString(),a=/electron/i.test(navigator.userAgent),i=downloadAndCheckLicense(t),u=a?await fetch(s,{credentials:"same-origin"}).then((e=>e.arrayBuffer())).then((e=>function(t,r){if(t!==s)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")?s:t+e,print:e=>{e&&"undefined"!==e&&n(e,"Info")},printErr:e=>{e&&"undefined"!==e&&n(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:getWasmMemory()};CESDK_JS(c).then((async n=>{n.specialHTMLTargets["!canvas"]=e;n.emscripten_ubq_settings_forceWebGL1=!!t?.forceWebGL1;const o=unpackResult(n.createEngine("!canvas",t.audioOutput??"auto"));unlockUbq(o,await i),configureEngine(o,t),r(o)})).catch(a)}))}async function loadPlugin(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}var Reaction=class{_reactor;_updateHandler=null;debugName;dirty=!0;readCalls=new Set;constructor(e,t){this.debugName=t,this._reactor=e}dispose(){this._updateHandler=null,this._reactor._unregisterReaction(this),this._reactor=null}track(e){return this._reactor._trackReaction(this,e)}subscribe(e){return this._reactor._registerReaction(this),this._updateHandler=e,()=>{this._updateHandler=null,this._reactor._unregisterReaction(this)}}update(){this._updateHandler?.()}},import_isEqual2=__toESM(require_isEqual()),NO_VALUE2=Symbol("NO_VALUE"),ReadCall=class{callId;_value;_readCurrentValue;constructor(e,t){this.callId=e,this._value=t(),this._readCurrentValue=t}updateValueAndCheckDirty(){try{const e=this._readCurrentValue();return(0,import_isEqual2.default)(this._value,e)?(this._value=e,!1):(this._value=e,!0)}catch(e){return this._value=NO_VALUE2,!0}}update(e){this._readCurrentValue=e}},Reactor=class{readCalls=new Map;readCache=new Map;registeredReactions=new Set;activeReactions=new Set;updatingDirtyReactions=0;_getterCalled(e,t){if(this.activeReactions.size<=0)return;const r=this._readThroughCache.bind(this,e,t);if(this.readCalls.has(e)){this.readCalls.get(e).update(r)}else this.readCalls.set(e,new ReadCall(e,r));for(const t of this.activeReactions)t.readCalls.add(e)}_setterCalled(){this._clearReadCache()}_readThroughCache(e,t){if(this.updatingDirtyReactions&&this.readCache.has(e))return this.readCache.get(e);const r=t();return this.readCache.set(e,r),r}wrapUpdateReactor=function(e){if(this.#f>10)throw new Error("Too many nested engine updates");const t=this.#f++;t>1&&console.warn("wrapUpdateReactor: nested update detected",t);try{e(),this._updateDirtyReactions()}finally{if(--this.#f!==t)throw new Error("Unexpected engine update nesting")}}.bind(this);#f=0;createReaction(e){return new Reaction(this,e)}_registerReaction(e){this.registeredReactions.add(e)}_unregisterReaction(e){this.registeredReactions.delete(e)}_clearReadCache(){this.readCache.clear()}_cleanupReadCalls(){const e=new Set;for(const t of this.registeredReactions)for(const r of t.readCalls)e.add(r);for(const[t]of this.readCalls)e.has(t)||this.readCalls.delete(t)}#h=new Set;_updateDirtyReactions(){try{this.updatingDirtyReactions++,this._clearReadCache();const e=new Set;for(const[t,r]of this.readCalls)r.updateValueAndCheckDirty()&&e.add(t);if(e.size>0)for(const t of this.registeredReactions)for(const r of t.readCalls)if(e.has(r)){t.dirty=!0;break}for(const e of this.registeredReactions)if(!this.#h.has(e)&&e.dirty){this.#h.add(e);try{e.update()}finally{this.#h.delete(e)}e.dirty=!1}this._cleanupReadCalls()}finally{this.updatingDirtyReactions--}}_trackReaction(e,t){try{return this.activeReactions.add(e),e.readCalls.clear(),t()}finally{e.dirty=!1,this.activeReactions.delete(e)}}decorateFunction(e,t){return decorateFunction(this,e,t)}decorateObject(e){return decorateObject(this,e)}dispose(){this.registeredReactions.forEach((e=>e.dispose())),this.registeredReactions.clear(),this.readCalls.clear(),this.activeReactions.clear(),this.readCache.clear()}},rotationCursor='url("data:image/svg+xml,%3Csvg width=%2722%27 height=%2725%27 viewBox=%270 0 22 25%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg filter=%27url(%23filter0_d)%27%3E%3Cpath d=%27M18 11.1071C18 14.5637 15.5566 17.4515 12.3314 18.0846V20L7.20308 17.0145L12.3314 14.0289V15.7825C14.3292 15.1951 15.7946 13.3221 15.7946 11.107C15.7946 8.42285 13.6437 6.23908 11 6.23908C8.35629 6.23908 6.20542 8.42285 6.20542 11.107C6.20542 11.8299 6.35745 12.5252 6.65738 13.1736L4.66118 14.1255C4.22245 13.1771 4 12.1616 4 11.1071C4.00007 7.18825 7.1403 4 11.0001 4C14.8599 4 18 7.18825 18 11.1071Z%27 fill=%27black%27/%3E%3Cpath d=%27M12.8314 15.0559V14.0289V13.1593L12.0799 13.5968L6.95152 16.5824L6.20927 17.0145L6.95152 17.4466L12.0799 20.4321L12.8314 20.8696V20V18.4841C16.0889 17.6521 18.5 14.6573 18.5 11.1071C18.5 6.9193 15.1431 3.5 11.0001 3.5C6.85702 3.5 3.50008 6.91929 3.5 11.1071V11.1071C3.5 12.2334 3.73793 13.3206 4.20739 14.3354L4.41978 14.7946L4.8764 14.5768L6.8726 13.6249L7.31866 13.4122L7.11118 12.9637C6.84206 12.3819 6.70542 11.7584 6.70542 11.107C6.70542 8.69181 8.63956 6.73908 11 6.73908C13.3604 6.73908 15.2946 8.69181 15.2946 11.107C15.2946 12.8513 14.2837 14.3564 12.8314 15.0559Z%27 stroke=%27white%27/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id=%27filter0_d%27 x=%270.0599999%27 y=%270.0599999%27 width=%2721.88%27 height=%2724.6193%27 filterUnits=%27userSpaceOnUse%27 color-interpolation-filters=%27sRGB%27%3E%3CfeFlood flood-opacity=%270%27 result=%27BackgroundImageFix%27/%3E%3CfeColorMatrix in=%27SourceAlpha%27 type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0%27/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation=%271.47%27/%3E%3CfeColorMatrix type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0%27/%3E%3CfeBlend mode=%27normal%27 in2=%27BackgroundImageFix%27 result=%27effect1_dropShadow%27/%3E%3CfeBlend mode=%27normal%27 in=%27SourceGraphic%27 in2=%27effect1_dropShadow%27 result=%27shape%27/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer';function getCursorStyle(e,t){switch(e){case"Arrow":return"default";case"Move":return"move";case"MoveNotPermitted":return"auto";case"Resize":{const e=180*t/Math.PI+45;if(!isIE&&!isEdge)return`url("data:image/svg+xml,%3Csvg style='transform: rotate(${e}deg)' width ='22' height ='22' viewBox ='0 0 22 22' fill ='none' xmlns ='http://www.w3.org/2000/svg'%3E%3Cg filter ='url(%23filter0_d)'%3E%3Cpath d ='M13.7 11.1L9.7 15.2L12.5 18H4V9.5L6.9 12.3L10.9 8.3L12.3 6.9L9.5 4H18V12.5L15.2 9.7L13.7 11.1Z' fill ='white'/%3E%3C/g%3E%3Cpath d ='M12.7 10.7L8.3 15.2L10.1 17H5V11.9L6.9 13.8L11.3 9.3L13.8 6.9L11.9 5H17V10.1L15.2 8.3L12.7 10.7Z' fill ='black'/%3E%3Cdefs%3E%3Cfilter id ='filter0_d' x ='0' y ='0' width ='22' height ='22' filterUnits ='userSpaceOnUse' color-interpolation-filters ='sRGB'%3E%3CfeFlood flood-opacity ='0' result ='BackgroundImageFix'/%3E%3CfeColorMatrix in ='SourceAlpha' type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation ='2'/%3E%3CfeColorMatrix type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0'/%3E%3CfeBlend mode ='normal' in2 ='BackgroundImageFix' result ='effect1_dropShadow'/%3E%3CfeBlend mode ='normal' in ='SourceGraphic' in2 ='effect1_dropShadow' result ='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer`;switch(e){case 90:case 270:return"nwse-resize";case 135:case 315:return"ns-resize";case 180:case 360:return"nesw-resize";case 225:return"ew-resize";default:return"move"}}case"Rotate":return rotationCursor;case"Text":return"text";default:return"auto"}}function initCursorStyling(e,t){let r;return t.onStateChanged((()=>{const n=getCursorStyle(t.getCursorType(),t.getCursorRotation());if(n!==r){r=n;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(t)&&e.style.setProperty("cursor",n)}}))}function mapToEngineKey(e){const t={key:255,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=0;break;case"1":t.key=1;break;case"2":t.key=2;break;case"3":t.key=3;break;case"4":t.key=4;break;case"5":t.key=5;break;case"6":t.key=6;break;case"7":t.key=7;break;case"8":t.key=8;break;case"9":t.key=9;break;case"A":t.key=10;break;case"B":t.key=11;break;case"C":t.key=12;break;case"D":t.key=13;break;case"E":t.key=14;break;case"F":t.key=15;break;case"G":t.key=16;break;case"H":t.key=17;break;case"I":t.key=18;break;case"J":t.key=19;break;case"K":t.key=20;break;case"L":t.key=21;break;case"M":t.key=22;break;case"N":t.key=23;break;case"O":t.key=24;break;case"P":t.key=25;break;case"Q":t.key=26;break;case"R":t.key=27;break;case"S":t.key=28;break;case"T":t.key=29;break;case"U":t.key=30;break;case"V":t.key=31;break;case"W":t.key=32;break;case"X":t.key=33;break;case"Y":t.key=34;break;case"Z":t.key=35;break;case" ":t.key=42;break;case"ESCAPE":t.key=43,t.characters="";break;case"BACKSPACE":t.key=40,t.characters="";break;case"DELETE":t.key=44,t.characters="";break;case"ENTER":t.key=41,t.characters=t.shiftIsHeld?"\u2028":"\n";break;case"CONTROL":t.key=45,t.characters="";break;case"ALT":t.key=46,t.characters="";break;case"SHIFT":t.key=47,t.characters="";break;case"ARROWLEFT":t.key=36,t.characters="";break;case"ARROWRIGHT":t.key=37,t.characters="";break;case"ARROWUP":t.key=38,t.characters="";break;case"ARROWDOWN":t.key=39,t.characters="";break;case"DEAD":t.key=255,t.characters=""}return t}function initInlineTextEditing(e,t,r){let n,o=null;const s=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||o?"Text"!==n&&o&&(o(),o=null):o=function(){let n=o();return()=>{n?.()};function o(){let s=!1,a="";if(null==e.parentElement)return console.warn('Could not attach hidden text input to the DOM: Canvas has no parentElement. This can happen if edit mode is switched to "Text", while the canvas is removed from the DOM.'),()=>{};const i=c();d();const u=p();return e.parentElement.appendChild(i),f(),()=>{u(),l()};function c(){const e=document.createElement("textarea");return e.id="ubq_internal-inline_text_editing_html_representation",e.setAttribute("data-cy","inline-text-editing-input"),e.autocapitalize="none",e.spellcheck=!1,e.cols=4096,e.style.contain="strict",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.border="0",e}function l(){i.blur(),i.remove()}function d(){const t=r.getTextCursorPositionInScreenSpaceX(),n=r.getTextCursorPositionInScreenSpaceY(),{left:o,top:s}=e.getBoundingClientRect();i.style.left=`${o+t/window.devicePixelRatio}px`,i.style.top=`${s+n/window.devicePixelRatio}px`}function p(){const t=e.getRootNode();i.addEventListener("input",k),i.addEventListener("keydown",C),i.addEventListener("copy",b),i.addEventListener("cut",_),i.addEventListener("compositionstart",E),i.addEventListener("compositionend",A),i.addEventListener("beforeinput",q),i.addEventListener("focusout",R),t.addEventListener("touchend",x),t.addEventListener("mousedown",x),t.addEventListener("mouseup",P);const n=r.onStateChanged((()=>{d()}));return()=>{i.removeEventListener("input",k),i.removeEventListener("keydown",C),i.removeEventListener("copy",b),i.removeEventListener("cut",_),i.removeEventListener("compositionstart",E),i.removeEventListener("compositionend",A),i.removeEventListener("beforeinput",q),i.removeEventListener("focusout",R),t.removeEventListener("mousedown",x),t.removeEventListener("mouseup",P),t.removeEventListener("touchend",x),n()}}function f(){null!==i.parentElement&&(i.focus(),h()||setTimeout((()=>i.focus()),0))}function h(){return i.getRootNode().activeElement===i}function g(){s=!1,n(),n=o()}function m(e){return[...e].length}function y(e){const t=e.selectionEnd??e.selectionStart??0;return m(e.value.substring(0,t))}function b(e){try{t.useInternalAPI((t=>{const r=unpackResult(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function _(e){try{t.useInternalAPI((r=>{const n=unpackResult(r.getSelectedText());if(""!==n&&e.clipboardData){e.clipboardData.setData("text/plain",n),e.preventDefault();const r={key:44,characters:"",shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}}))}catch(e){console.error(e)}}async function v(){return!(!s||t.ubq.unstable_isTextCursorInCompositionRange())&&(await A(),!0)}function k(e){const r=e.target,{value:n}=r;if(s){const e=y(i);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&(r.value="")}function w(e){const r={key:255,characters:e,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}async function C(e){if(v(),1===e.key.length&&(a=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return s&&A(),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void L();if("Backspace"!==e.key&&"Delete"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key)return;const r=mapToEngineKey(e);await t.execute("ubq/inputs/keyboardkey",r),e.currentTarget&&(i.value="")}async function E(){s=!0,await t.execute("ubq/text/compositionStart")}async function A(){s?(s=!1,i.value="",g(),t.execute("ubq/text/compositionEnd")):i.value=""}async function S(){if(!s)return;t.ubq.update();if(await v())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),n=e.end-r.start,o=y(i);e.start>=r.start&&e.start<=1+r.end&&n!==o&&A()}async function P(){S()}async function x(t){S(),t.target===e&&"Text"===r.getEditMode()&&(f(),t.preventDefault())}async function q(e){if(s&&!e.isComposing&&A(),null===e.data)return;const r=e.target,n=e.data;if(await v())w(a);else if(s){const e=m(n);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&("\n"!==n[0]&&w(n),r.value="")}function R(e){if(I(e.relatedTarget)&&T(e.relatedTarget));else{B(e)}}function T(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}function B(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),n=e.dispatchEvent(r);return n&&f(),n}function I(e){return null!=e&&(e instanceof HTMLElement&&(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&e.type.match("^(text|number|url|email|search|tel)$")||e.isContentEditable))}async function L(){r.setEditMode("Transform")}}}()}));return()=>{o?.(),s()}}var inlineTextEditing_default=initInlineTextEditing;function initMouseHandling(e,t){const r=[],n=r=>{if("touch"===r.pointerType)return;const n=getBaseEvent(e,r);t.execute("ubq/inputs/mousemove",n)},o=n=>{if("touch"===n.pointerType)return;const o={...getBaseEvent(e,n),button:mapToEngineMouseButton(n.button),state:0,shiftIsHeld:!!n.shiftKey};r[n.button]=!1,n.currentTarget.releasePointerCapture(n.pointerId),t.execute("ubq/inputs/mousebutton",o),t.ubq.update()},s=n=>{if("touch"===n.pointerType)return;const o={...getBaseEvent(e,n),button:mapToEngineMouseButton(n.button),state:1,shiftIsHeld:!!n.shiftKey};r[n.button]=!0,n.currentTarget.setPointerCapture(n.pointerId),t.execute("ubq/inputs/mousebutton",o)},a=n=>{if("touch"===n.pointerType)return;const o={...getBaseEvent(e,n),shiftIsHeld:!!n.shiftKey};r.forEach(((e,r)=>{if(e){const e={...o,button:r,state:0};t.execute("ubq/inputs/mousebutton",e)}})),r.length=0},i=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",s),e.addEventListener("pointerup",o),e.addEventListener("pointercancel",o),e.addEventListener("pointermove",n),e.addEventListener("lostpointercapture",a),e.addEventListener("touchmove",i,{passive:!1}),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointerup",o),e.removeEventListener("pointercancel",o),e.removeEventListener("pointermove",n),e.removeEventListener("lostpointercapture",a),e.removeEventListener("touchmove",i),e=null}}function getBaseEvent(e,t){const r=e.getBoundingClientRect(),n=r?.top??0,o=r?.left??0;return{position:{x:(t.clientX-o)*window.devicePixelRatio,y:(t.clientY-n)*window.devicePixelRatio},isTouch:!1,timestamp:t.timeStamp}}function mapToEngineMouseButton(e){switch(e){case 0:return 0;case 1:return 2;case 2:return 1;default:return 255}}var MouseWheelManager=class{ubq;enabled;initialTarget;target;dispose;constructor(e,t){this.ubq=t,this.enabled=makeEngineChannel_default(e.editor.onSettingsChanged,(()=>{const t=e.editor.getSettingBool("mouse/enableZoom"),r=e.editor.getSettingBool("mouse/enableScroll");return t||r})),this.target=makeValueChannel((()=>{})),this.dispose=()=>{this.target.update(void 0),this.target=null,this.enabled=null,this.ubq=null,this.initialTarget=null,e=null,t=null}}initialize(e){let t;this.initialTarget=e;const r=merge(this.enabled.subscribe,this.target.subscribe)((()=>{t?.(),t=void 0;const e=this.target.value();this.enabled.value()&&e&&(t=this.addWheelListener(e))}));this.target.update(e);return()=>{r(),t?.()}}setTarget(e){this.target.update(e);return()=>{this.target.update(this.initialTarget)}}addWheelListener(e){const t=e=>{if(!this.initialTarget)throw new Error("initialTarget is not set");const t={...getBaseEvent(this.initialTarget,e),deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode,shiftIsHeld:!!e.shiftKey,ctrlOrMetaIsHeld:!!e.ctrlKey||!!e.metaKey};this.ubq.mouseWheel(t)&&(e.stopPropagation(),e.preventDefault())};e.addEventListener("wheel",t,{passive:!1,capture:!0});return()=>{e.removeEventListener("wheel",t,{capture:!0}),e=null}}},BaseRecognizer=class{active=!1;enableDebug=!1;timestamp=0;baseTouches=[];touches=[];currentTransform;constructor(){this.currentTransform=this.emptyTransform()}touchAddRemove(e){const t=new Array(e.touches.length);for(let r=0;r<e.touches.length;r++){const n=e.touches.item(r);t[r]=copyTouch(n)}this.touches=t}touchUpdate(e){for(let t=0;t<e.touches.length;t++){const r=e.touches.item(t),n=this.touches.find((e=>e.identifier===r.identifier));if(!n)return;n.x=r.clientX,n.y=r.clientY}}listen(e){return e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel),e.addEventListener("touchmove",this.touchmove),()=>{e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel),e.removeEventListener("touchmove",this.touchmove)}}touchstart=e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchstart")};touchend=e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchend")};touchcancel=e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchcancel")};touchmove=e=>{this.touchUpdate(e),this.timestamp=e.timeStamp,this.process("touchmove")};debugState;debug(){if(!this.enableDebug)return;const e=JSON.stringify(this.currentTransform);function t(e,[t,r,n],o){const s=document.createElement("div");return s.style.position="fixed",s.style.top="-25px",s.style.left="-25px",s.style.width="50px",s.style.height="50px",s.style.border=`3px ${o} rgb(${t},${r},${n})`,s.style.borderRadius="50%",s.style.borderStyle=o,s.style.backgroundColor=`rgba(${t},${r},${n}, 0.5)`,s.style.transformOrigin="center",s.style.textAlign="center",s.innerHTML=e,s.style.display="none",document.body.appendChild(s),s}this.debugState||(this.debugState={touches:[t("T1",[218,212,104],"solid"),t("T2",[218,212,104],"solid")],value:this.debugValueDiv(void 0,e,this.touches,[218,212,104]),baseTouches:[t("B1",[128,128,128],"solid"),t("B2",[128,128,128],"solid")]}),this.debugState.touches[0].style.display=this.touches[0]?"block":"none",this.debugState.touches[1].style.display=this.touches[1]?"block":"none",this.debugState.baseTouches[0].style.display=this.baseTouches[0]?"block":"none",this.debugState.baseTouches[1].style.display=this.baseTouches[1]?"block":"none",this.touches[0]&&(this.debugState.touches[0].style.transform=`translate(${this.touches[0]?.x}px, ${this.touches[0]?.y}px)`),this.touches[1]&&(this.debugState.touches[1].style.transform=`translate(${this.touches[1]?.x}px, ${this.touches[1]?.y}px)`),this.baseTouches[0]&&(this.debugState.baseTouches[0].style.transform=`translate(${this.baseTouches[0]?.x}px, ${this.baseTouches[0]?.y}px)`),this.baseTouches[1]&&(this.debugState.baseTouches[1].style.transform=`translate(${this.baseTouches[1]?.x}px, ${this.baseTouches[1]?.y}px)`),this.debugState.value=this.debugValueDiv(this.debugState.value,e,this.touches)}debugValueDiv(e,t,r,n){if(!e){const[t,r,o]=n??[128,128,128];(e=document.createElement("div")).style.position="fixed",e.style.top="50px",e.style.left="50px",e.style.width="300px",e.style.height="100px",e.style.border=`3px solid rgb(${t},${r},${o})`,e.style.borderStyle="dashed",e.style.backgroundColor=`rgba(${t},${r},${o}, 0.5)`,e.style.transformOrigin="center",e.style.overflow="visible",e.style.textOverflow="visible",e.style.display="none",document.body.appendChild(e)}return this.active?e.style.borderStyle="solid":e.style.borderStyle="dashed",0===r.length?(e.style.display="none",e):(e.style.display="block",e.innerHTML=t,e)}resetBaseTouches(){this.baseTouches=this.touches.map(copyTouch)}process(e){if("touchcancel"===e)return this.resetBaseTouches(),this.reset(),this.debug(),void this.emit(2);"touchstart"!==e&&"touchend"!==e||(this.resetBaseTouches(),this.debug()),!this.active&&this.shouldStart()&&(this.active=!0,this.emit(0)),"touchmove"===e&&(this.currentTransform=this.calculateTransform(),this.active&&this.emit(1)),this.debug(),this.active&&this.shouldStop()&&(this.active=!1,this.emit(2),this.reset())}shouldStart(){return 2===this.touches.length}shouldStop(){return 2!==this.touches.length}emit(e){const t={timestamp:this.timestamp,state:e,touchPoints:this.touches},r=this.makeEvent(t);for(const e of this.handlers)e(r)}handlers=new Set;addListener(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this.active=!1,this.currentTransform=this.emptyTransform()}};function copyTouch(e){if(null!=e)return e instanceof Touch?{identifier:e.identifier,x:e.clientX,y:e.clientY}:{identifier:e.identifier,x:e.x,y:e.y}}var PanRecognizer=class _PanRecognizer extends BaseRecognizer{static PAN_THRESHOLD=10;makeEvent(e){const t=0===e.state?{x:0,y:0}:this.currentTransform;return{...e,panDistance:t}}calculateTransform(){const e=getCenter(this.touches),t=getCenter(this.baseTouches);return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return super.shouldStart()&&distance(this.calculateTransform())>_PanRecognizer.PAN_THRESHOLD}};function distance(e){return Math.sqrt(e.x**2+e.y**2)}function getCenter(e){let t=0,r=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.x,r+=o.y}return t/=e.length,r/=e.length,{x:t,y:r}}var PinchRecognizer=class _PinchRecognizer extends BaseRecognizer{static PINCH_THRESHOLD=.2;makeEvent(e){return{...e,scale:this.currentTransform}}calculateTransform(){const e=this.baseTouches,t=this.touches;if(2!==e.length||2!==t.length)return 1;const r=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2));return Math.sqrt(Math.pow(t[0].x-t[1].x,2)+Math.pow(t[0].y-t[1].y,2))/r}emptyTransform(){return 1}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform()-1)>_PinchRecognizer.PINCH_THRESHOLD}},PointRecognizer=class _PointRecognizer extends BaseRecognizer{static DISTANCE_THRESHOLD=5;static TAP_MAX_TIME=250;lastPosition={x:0,y:0};makeEvent(e){const t=this.tapDetected?this.tapLocation:e.touchPoints[0];return 0===e.state?(this.lastPosition=t,{button:0,state:1,position:t,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}):2===e.state?{button:0,state:0,position:t??this.lastPosition,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}:(this.lastPosition=t,{position:t,isTouch:!0,timestamp:e.timestamp})}previousNumTouches=0;fingerDownTimestamp=0;tapDetected=!1;tapLocation={x:0,y:0};process(e){if("touchstart"===e||"touchend"===e){this.tapDetected=!1;const e=1===this.touches.length&&0===this.previousNumTouches,t=0===this.touches.length&&1===this.previousNumTouches;e&&(this.fingerDownTimestamp=performance.now(),this.tapLocation=this.touches[0]),t&&performance.now()-this.fingerDownTimestamp<_PointRecognizer.TAP_MAX_TIME&&(this.tapDetected=!0),this.previousNumTouches=this.touches.length}super.process(e)}calculateTransform(){if(0===this.touches.length||0===this.baseTouches.length)return{x:0,y:0};const e=this.touches[0],t=this.baseTouches[0];return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return this.tapDetected||1===this.touches.length&&distance(this.calculateTransform())>_PointRecognizer.DISTANCE_THRESHOLD}shouldStop(){return 1!==this.touches.length}},RotateRecognizer=class _RotateRecognizer extends BaseRecognizer{static ROTATE_THRESHOLD=.1;makeEvent(e){return{...e,rotation:this.currentTransform}}calculateTransform(){const e=this.baseTouches,t=this.touches;if(e.length<2||t.length<2)return 0;const r=Math.atan2(e[1].y-e[0].y,e[1].x-e[0].x);return Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x)-r}emptyTransform(){return 0}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform())>_RotateRecognizer.ROTATE_THRESHOLD}};function initTouchGestures(e,t){const r=[],n=new PointRecognizer;r.push(n.listen(e)),r.push(n.addListener((r=>{"button"in r?t.execute("ubq/inputs/mousebutton",convertToEngineCoordinates(e,r)):t.execute("ubq/inputs/mousemove",convertToEngineCoordinates(e,r))})));const o=new PanRecognizer;r.push(o.listen(e)),r.push(o.addListener((r=>{t.execute("ubq/inputs/touchpan",convertToEngineCoordinates(e,r))})));const s=new PinchRecognizer;r.push(s.listen(e)),r.push(s.addListener((r=>{t.execute("ubq/inputs/touchpinch",convertToEngineCoordinates(e,r))})));const a=new RotateRecognizer;return r.push(a.listen(e)),r.push(a.addListener((r=>{t.execute("ubq/inputs/touchrotate",convertToEngineCoordinates(e,r))}))),()=>{r.forEach((e=>e()))}}function convertToEngineCoordinates(e,t){const r=window.devicePixelRatio??1,{top:n,left:o}=e.getBoundingClientRect();if(1===r&&0===n&&0===o)return t;const s=e=>({x:(e.x-o)*r,y:(e.y-n)*r});if("position"in t)return{...t,position:s(t.position)};const a=t.touchPoints.map(s);return"panDistance"in t?{...t,touchPoints:a,panDistance:s(t.panDistance)}:{...t,touchPoints:a}}function almostEqual(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}function exportSettings(e){const t=new Map,r=e.findAllSettings();for(const n of r)switch(e.getSettingType(n)){case"Bool":t.set(n,e.getSettingBool(n));break;case"Int":t.set(n,e.getSettingInt(n));break;case"Float":t.set(n,e.getSettingFloat(n));break;case"String":t.set(n,e.getSettingString(n));break;case"Color":t.set(n,e.getSettingColor(n));break;case"Enum":t.set(n,e.getSettingEnum(n))}return t}var ExportVideo,worker_host_v1_20_0_rc_0_GRE6CDSD_default="assets/core/worker-host-v1.20.0-rc.0-GRE6CDSD.js";function setVisibility(e){return{msg:"setVisibility",visible:e}}(e=>{e.start=function(e){return{...e,msg:"exportVideo"}},e.abort=function(){return{msg:"exportVideoAbort"}},e.finished=function(e){return{...e,msg:"exportVideoFinished"}},e.error=function(e){return{...e,msg:"exportVideoError"}},e.progress=function(e){return{...e,msg:"exportVideoProgress"}},e.log=function(e){return{...e,msg:"exportLog"}}})(ExportVideo||(ExportVideo={}));var WorkerClient=class{configuration;constructor(e){this.configuration=e}exportVideo(e,t,r,n,o){const{abortSignal:s,inactivityTimeout:a}=o??{},i=makeWorker(this.configuration),u=stripConfig(this.configuration),c=new Promise(((e,t)=>{if(i.onmessage=({data:r})=>{if("exportVideoFinished"===r.msg){const t=new Blob([r.data],{type:r.mimeType});e(t)}else"exportVideoError"===r.msg?t(r.error):"exportVideoProgress"===r.msg||("exportLog"===r.msg?this.configuration.logger(r.message,r.logLevel):console.error("Unknown message received ",r))},s){let e=!1;const t=()=>{e||(e=!0,i.postMessage(ExportVideo.abort()))};s.addEventListener("abort",t,{once:!0})}}));i.postMessage(ExportVideo.start({sceneString:e,engineSettings:t,pluginURLs:r,config:u,exportOptions:n,inactivityTimeout:a}));const l=()=>{i.postMessage(setVisibility("visible"===document.visibilityState))};return document.addEventListener("visibilitychange",l),c.finally((()=>{i.terminate(),document.removeEventListener("visibilitychange",l)})),c}};function stripConfig(e){return{baseURL:e.baseURL,license:e.license,core:e.core,presets:e.presets,featureFlags:e.featureFlags,forceWebGL1:e.forceWebGL1,audioOutput:e.audioOutput,extensions:e.extensions}}function makeWorker(e){const t=worker_host_v1_20_0_rc_0_GRE6CDSD_default.toString().split("/").pop();return new Worker(new URL(t,e.core.baseURL))}function make_BlockAPI_exportVideo(e,t,r){return async(n,o,s,a)=>{const i=t.scene.get();if(null==i||!t.block.isValid(i))throw new Error("No valid scene available.");const u=await t.scene.saveToString(),c=exportSettings(t.editor),l=t.settings.unstable_videoExportInactivityTimeout.value(),d=t.editor.getActiveLicense();return new WorkerClient({...e,license:d}).exportVideo(u,c,r,a,{abortSignal:a.abortSignal,inactivityTimeout:l})}}var ASSET_SOURCE_BASE_URL="https://cdn.img.ly/assets/v2",CreativeEngine=class{asset;block;editor;event;scene;variable;#g;reactor;#m;#y;#d;#b;#_;#v=[];#k=[];#e;#w=[];constructor(e,t,r){this.#e=e,this.#y=new UBQHelper(e),this.asset=new AssetAPI(e),this.block=new BlockAPI(e),this.editor=new EditorAPI(e),this.event=new EventAPI(e),this.scene=new SceneAPI(e),this.variable=new VariableAPI(e),this.#g=new Settings(this.editor),this.#_=new MouseWheelManager(this,e),this.#w.push(this.#_.dispose);const n=new Reactor;this.reactor=n;const o=[this.reactor.decorateObject(this.#y),this.reactor.decorateObject(this.block),this.reactor.decorateObject(this.editor),this.reactor.decorateObject(this.scene)],s=this.wrapUpdate(n.wrapUpdateReactor);this.#w.push((()=>{o.forEach((e=>e())),s(),this.reactor.dispose()})),this.block.exportVideo=make_BlockAPI_exportVideo(r,{block:this.block,scene:this.scene,editor:this.editor,settings:this.#g},this.#v),"getInternalCanvas"in t?(this.#d=t.getInternalCanvas(),this.#b=t):this.#d=t,this.#m=new Camera(this),this.#C(),"undefined"!=typeof window&&window.Cypress&&(this.config=r,this.helper=this.#y)}async unstable_addPlugin(e){null!=e.url&&this.#v.push(e.url);const t=e.url?await loadPlugin(e.url):e;if(t.initialize){const e={asset:this.asset,block:this.block,scene:this.scene,editor:this.editor,event:this.event,variable:this.variable};t.initialize(e)}this.#k.push(t)}unstable_setVideoExportInactivityTimeout(e){this.#g.unstable_videoExportInactivityTimeout.update(e)}#E(){if(!this.#b)return;const e=this.#b.getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,n=t.width*r,o=t.height*r;e.width!==n&&(e.width=n),e.height!==o&&(e.height=o)}#A(){const{width:e,height:t}=this.#d,r="undefined"!=typeof window?window.devicePixelRatio:1,{height:n,width:o,pixelRatio:s}=this.#m.settings.value();almostEqual(o,e,1e-4)&&almostEqual(n,t,1e-4)&&almostEqual(s,r,1e-4)||this.#m.settings.update({height:t,width:e,pixelRatio:window.devicePixelRatio})}#S=[];wrapUpdate(e){return this.#S.push(e),()=>{const t=this.#S.indexOf(e);-1!==t&&this.#S.splice(t,1)}}#P(){return e=>{this.#S.reduce(((e,t)=>function(){let r=!1;if(t((function(){r=!0,e()})),!r)throw new Error(`Wrapper did not call update: ${t.toString()}`)}),this.#x.bind(this,e))()}}#q;#C(e=!0){this.#R(e),this.#T()}#R(e=!0){let t,r=!1,n=0;if(this.#q)return;const o=()=>{const s=this.#P();if(this.#q=requestAnimationFrame(o),!r)try{s(e),n=0}catch(e){throw n++,n>=10&&(console.error("Repeated exceptions in update loop. Stopping loop."),t?.(),this.#B()),e}};this.#q=requestAnimationFrame(o)}#T(){if(!isHTMLCanvas(this.#d))return;const e=this.#b??this.#d,t=[initMouseHandling(e,this.#y),this.#_.initialize(e),inlineTextEditing_default(e,this.#y,this.editor),initCursorStyling(e,this.editor),initTouchGestures(e,this.#y),initContextLossHandlers(this.#d,this.#e,(()=>{this.#d.width=this.#d.width})),initResizeHandlers(e,this.#I)];this.#L=()=>{t.reverse().forEach((e=>e()))}}setWheelEventTarget(e){return this.#_.setTarget(e)}#I=(0,import_debounce.default)(function(){this.#x()}.bind(this),100,{leading:!0,trailing:!1});#L;#B(){this.#L?.(),this.#L=void 0,this.#q&&(cancelAnimationFrame(this.#q),this.#q=0)}#x(e=!0){for(const e of this.#k)e.update?.(this);if(e){1===this.block.findByType("scene").length&&this.#F()}this.#E(),this.#A(),this.#e.update()}#F(){if(this.#m.clampCamera){const e={sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}};this.#y.execute("cesdk/clampCameraAndRender",{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y}).then((e=>{(0,import_isEqual3.default)(this.#m.clampResult.value(),e)||this.#m.clampResult.update(e)}),(()=>{(0,import_isEqual3.default)(this.#m.clampResult.value(),e)||this.#m.clampResult.update(e)}))}else this.#y.execute("ubq/render")}get element(){return this.#b}dispose(){this.#w.forEach((e=>e())),this.#B(),this.asset.dispose(),this.#d=null,this.#b?.dispose(),this.#b=void 0,this.#y=null,this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,this.#S.length=0,this.#e.delete(),this.#e=null}static async init(e,t){let r=getCanvas(t,e);const n="1f01d4498b";let o;n&&console.log(`[CreativeEngine] Revision ${n}`),r||(o=createEngineElement(),r=o.getInternalCanvas());const s=initWithDefaults(migrateConfigObject(e));if(!skipConfigWarnings(e))for(const t of warnKeys(e))s.logger(t,"Warning");const a=new this(await init(r,s),o??r,s);return apiFallback(e,a),a}async addDefaultAssetSources({baseURL:e=ASSET_SOURCE_BASE_URL,excludeAssetSourceIds:t=[]}={}){return addDefaultAssetSources_default(this.asset,e,t)}async addDemoAssetSources({baseURL:e="https://cdn.img.ly/assets/demo/v2",excludeAssetSourceIds:t=[],sceneMode:r="Design",withUploadAssetSources:n=!1}={}){return addDemoAssetSources_default(this.asset,this.scene,t,r,n,void 0,e)}get _ubq(){return this.#e}get _camera(){return this.#m}get _helper(){return this.#y}};function getCanvas(e,t){return r(t?.canvas)?t?.canvas:r(e)?(console.warn("Passing an existing HTMLCanvasElement as a second parameter to CreativeEngine.init() is deprecated. Use the element property on the CreativeEngine instance to access a fully managed canvas to append into the DOM instead. For more information, have a look into our documentation at https://img.ly/docs/cesdk/next/engine/quickstart/#initialization."),e):void 0;function r(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}}function skipConfigWarnings(e){return!0===e?._skipConfigWarnings}function createEngineElement(){defineElement();return document.createElement("cesdk-canvas")}function isHTMLCanvas(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}function supportsWasm(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return console.error(e),!1}return!1}var supportsWasm_default=supportsWasm,TIMEOUT=1e4,MICROSECONDS=1e6;async function supportsVideoCodec(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window))throw new Error("Missing required web video APIs");const e={codec:"avc1.4D0034",width:1920,height:1080,avc:{format:"annexb"},framerate:30};if(!await VideoEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");const t=new OffscreenCanvas(e.width,e.height),r=t.getContext("webgl2");if(!r)throw new Error("Could not create WebGL2 context");return r.clearColor(1,0,1,1),r.clear(r.COLOR_BUFFER_BIT),new Promise(((r,n)=>{setTimeout((()=>{n(new Error("Timed out during video export"))}),TIMEOUT);const o=new VideoEncoder({output:()=>r(!0),error:e=>n(e)});o.configure(e);const s=new VideoFrame(t,{timestamp:0,duration:MICROSECONDS/e.framerate});o.encode(s,{keyFrame:!0}),s.close(),o.flush().then((()=>{"closed"!==o.state&&o.close()}))}))}async function supportsAudioCodec(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("AudioDecoder"in window&&"AudioEncoder"in window))throw new Error("Missing required web audio APIs");const e={codec:"mp4a.40.02",sampleRate:48e3,numberOfChannels:2,bitrate:128e3};if(!await AudioEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");return new Promise(((t,r)=>{setTimeout((()=>{r(new Error("Timed out during audio export"))}),TIMEOUT);const n=new AudioEncoder({output:()=>t(!0),error:r});n.configure(e);const o=1024,s=new Float32Array(o*e.numberOfChannels);for(let e=0;e<o;++e){const t=e/o;s[2*e+0]=Math.sin(880*Math.PI*t),s[2*e+1]=Math.sin(888*Math.PI*t)}for(let t=0;t<10;++t){const r=new AudioData({format:"f32",sampleRate:e.sampleRate,numberOfFrames:o,numberOfChannels:e.numberOfChannels,timestamp:t*o/e.sampleRate*MICROSECONDS,data:s});n.encode(r),r.close()}n.flush().then((()=>{"closed"!==n.state&&n.close()}))}))}function supportsVideo(){if("undefined"==typeof window)return!1;return"VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window&&"AudioDecoder"in window&&"AudioEncoder"in window}function supportsVideoExport(){return Promise.all([supportsVideoCodec(),supportsAudioCodec()]).then((e=>e.every((e=>e))),(()=>!1))}function supportsBrowser(){try{const e=!0,t=!0,r="globalThis"in window,n="BigInt"in window,o="allSettled"in Promise,s="matchAll"in String.prototype,a=CSS.supports("(display: flex) and (gap: 8px)"),i="MediaRecorder"in window&&"pause"in window.MediaRecorder.prototype,u=CSS.supports("selector(:not(a, .b))"),c=CSS.supports("selector(:is(a))");return supportsWasm_default()&&e&&t&&r&&n&&o&&s&&a&&i&&u&&c}catch{return!1}}var supportsBrowser_default=supportsBrowser;export{LogLevel,MimeType_default as MimeType,WorkerClient,CreativeEngine as default,supportsBrowser_default as supportsBrowser,supportsVideo,supportsVideoExport,supportsWasm_default as supportsWasm};
|
|
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=(a,s,u)=>(u=null!=a?e(o(a)):{},((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})(!s&&a&&a.__esModule?u:t(u,"default",{value:a,enumerable:!0}),a)),u=(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},c=a({"../../../node_modules/lodash/isObject.js"(e,t){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}}),l=a({"../../../node_modules/lodash/_freeGlobal.js"(e,t){var r="object"==typeof global&&global&&global.Object===Object&&global;t.exports=r}}),d=a({"../../../node_modules/lodash/_root.js"(e,t){var r=l(),n="object"==typeof self&&self&&self.Object===Object&&self,o=r||n||Function("return this")();t.exports=o}}),f=a({"../../../node_modules/lodash/now.js"(e,t){var r=d();t.exports=function(){return r.Date.now()}}}),p=a({"../../../node_modules/lodash/_trimmedEndIndex.js"(e,t){var r=/\s/;t.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}}}),h=a({"../../../node_modules/lodash/_baseTrim.js"(e,t){var r=p(),n=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(n,""):e}}}),m=a({"../../../node_modules/lodash/_Symbol.js"(e,t){var r=d().Symbol;t.exports=r}}),g=a({"../../../node_modules/lodash/_getRawTag.js"(e,t){var r=m(),n=Object.prototype,o=n.hasOwnProperty,i=n.toString,a=r?r.toStringTag:void 0;t.exports=function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var s=i.call(e);return n&&(t?e[a]=r:delete e[a]),s}}}),y=a({"../../../node_modules/lodash/_objectToString.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}}}),b=a({"../../../node_modules/lodash/_baseGetTag.js"(e,t){var r=m(),n=g(),o=y(),i=r?r.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?n(e):o(e)}}}),v=a({"../../../node_modules/lodash/isObjectLike.js"(e,t){t.exports=function(e){return null!=e&&"object"==typeof e}}}),w=a({"../../../node_modules/lodash/isSymbol.js"(e,t){var r=b(),n=v();t.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==r(e)}}}),E=a({"../../../node_modules/lodash/toNumber.js"(e,t){var r=h(),n=c(),o=w(),i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var c=a.test(e);return c||s.test(e)?u(e.slice(2),c?2:8):i.test(e)?NaN:+e}}}),_=a({"../../../node_modules/lodash/debounce.js"(e,t){var r=c(),n=f(),o=E(),i=Math.max,a=Math.min;t.exports=function(e,t,s){var u,c,l,d,f,p,h=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var r=u,n=c;return u=c=void 0,h=t,d=e.apply(n,r)}function v(e){var r=e-p;return void 0===p||r>=t||r<0||g&&e-h>=l}function w(){var e=n();if(v(e))return E(e);f=setTimeout(w,function(e){var r=t-(e-p);return g?a(r,l-(e-h)):r}(e))}function E(e){return f=void 0,y&&u?b(e):(u=c=void 0,d)}function _(){var e=n(),r=v(e);if(u=arguments,c=this,p=e,r){if(void 0===f)return function(e){return h=e,f=setTimeout(w,t),m?b(e):d}(p);if(g)return clearTimeout(f),f=setTimeout(w,t),b(p)}return void 0===f&&(f=setTimeout(w,t)),d}return t=o(t)||0,r(s)&&(m=!!s.leading,l=(g="maxWait"in s)?i(o(s.maxWait)||0,t):l,y="trailing"in s?!!s.trailing:y),_.cancel=function(){void 0!==f&&clearTimeout(f),h=0,u=p=c=f=void 0},_.flush=function(){return void 0===f?d:E(n())},_}}}),C=a({"../../../node_modules/lodash/_listCacheClear.js"(e,t){t.exports=function(){this.__data__=[],this.size=0}}}),S=a({"../../../node_modules/lodash/eq.js"(e,t){t.exports=function(e,t){return e===t||e!=e&&t!=t}}}),x=a({"../../../node_modules/lodash/_assocIndexOf.js"(e,t){var r=S();t.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}}}),k=a({"../../../node_modules/lodash/_listCacheDelete.js"(e,t){var r=x(),n=Array.prototype.splice;t.exports=function(e){var t=this.__data__,o=r(t,e);return!(o<0)&&(o==t.length-1?t.pop():n.call(t,o,1),--this.size,!0)}}}),T=a({"../../../node_modules/lodash/_listCacheGet.js"(e,t){var r=x();t.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}}}),A=a({"../../../node_modules/lodash/_listCacheHas.js"(e,t){var r=x();t.exports=function(e){return r(this.__data__,e)>-1}}}),P=a({"../../../node_modules/lodash/_listCacheSet.js"(e,t){var r=x();t.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}}}),q=a({"../../../node_modules/lodash/_ListCache.js"(e,t){var r=C(),n=k(),o=T(),i=A(),a=P();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=r,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),F=a({"../../../node_modules/lodash/_stackClear.js"(e,t){var r=q();t.exports=function(){this.__data__=new r,this.size=0}}}),L=a({"../../../node_modules/lodash/_stackDelete.js"(e,t){t.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}}}),D=a({"../../../node_modules/lodash/_stackGet.js"(e,t){t.exports=function(e){return this.__data__.get(e)}}}),R=a({"../../../node_modules/lodash/_stackHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),B=a({"../../../node_modules/lodash/isFunction.js"(e,t){var r=b(),n=c();t.exports=function(e){if(!n(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}}}),M=a({"../../../node_modules/lodash/_coreJsData.js"(e,t){var r=d()["__core-js_shared__"];t.exports=r}}),I=a({"../../../node_modules/lodash/_isMasked.js"(e,t){var r,n=M(),o=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!o&&o in e}}}),O=a({"../../../node_modules/lodash/_toSource.js"(e,t){var r=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}}}),j=a({"../../../node_modules/lodash/_baseIsNative.js"(e,t){var r=B(),n=I(),o=c(),i=O(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,l=s.toString,d=u.hasOwnProperty,f=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||n(e))&&(r(e)?f:a).test(i(e))}}}),U=a({"../../../node_modules/lodash/_getValue.js"(e,t){t.exports=function(e,t){return null==e?void 0:e[t]}}}),$=a({"../../../node_modules/lodash/_getNative.js"(e,t){var r=j(),n=U();t.exports=function(e,t){var o=n(e,t);return r(o)?o:void 0}}}),H=a({"../../../node_modules/lodash/_Map.js"(e,t){var r=$()(d(),"Map");t.exports=r}}),N=a({"../../../node_modules/lodash/_nativeCreate.js"(e,t){var r=$()(Object,"create");t.exports=r}}),V=a({"../../../node_modules/lodash/_hashClear.js"(e,t){var r=N();t.exports=function(){this.__data__=r?r(null):{},this.size=0}}}),z=a({"../../../node_modules/lodash/_hashDelete.js"(e,t){t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}}}),W=a({"../../../node_modules/lodash/_hashGet.js"(e,t){var r=N(),n=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(r){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(t,e)?t[e]:void 0}}}),G=a({"../../../node_modules/lodash/_hashHas.js"(e,t){var r=N(),n=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:n.call(t,e)}}}),Y=a({"../../../node_modules/lodash/_hashSet.js"(e,t){var r=N();t.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}}}),X=a({"../../../node_modules/lodash/_Hash.js"(e,t){var r=V(),n=z(),o=W(),i=G(),a=Y();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=r,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),Z=a({"../../../node_modules/lodash/_mapCacheClear.js"(e,t){var r=X(),n=q(),o=H();t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||n),string:new r}}}}),K=a({"../../../node_modules/lodash/_isKeyable.js"(e,t){t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}}}),Q=a({"../../../node_modules/lodash/_getMapData.js"(e,t){var r=K();t.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}}}),J=a({"../../../node_modules/lodash/_mapCacheDelete.js"(e,t){var r=Q();t.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}}}),ee=a({"../../../node_modules/lodash/_mapCacheGet.js"(e,t){var r=Q();t.exports=function(e){return r(this,e).get(e)}}}),te=a({"../../../node_modules/lodash/_mapCacheHas.js"(e,t){var r=Q();t.exports=function(e){return r(this,e).has(e)}}}),re=a({"../../../node_modules/lodash/_mapCacheSet.js"(e,t){var r=Q();t.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}}}),ne=a({"../../../node_modules/lodash/_MapCache.js"(e,t){var r=Z(),n=J(),o=ee(),i=te(),a=re();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=r,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),oe=a({"../../../node_modules/lodash/_stackSet.js"(e,t){var r=q(),n=H(),o=ne();t.exports=function(e,t){var i=this.__data__;if(i instanceof r){var a=i.__data__;if(!n||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(e,t),this.size=i.size,this}}}),ie=a({"../../../node_modules/lodash/_Stack.js"(e,t){var r=q(),n=F(),o=L(),i=D(),a=R(),s=oe();function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u}}),ae=a({"../../../node_modules/lodash/_setCacheAdd.js"(e,t){t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}}),se=a({"../../../node_modules/lodash/_setCacheHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),ue=a({"../../../node_modules/lodash/_SetCache.js"(e,t){var r=ne(),n=ae(),o=se();function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=n,i.prototype.has=o,t.exports=i}}),ce=a({"../../../node_modules/lodash/_arraySome.js"(e,t){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}}}),le=a({"../../../node_modules/lodash/_cacheHas.js"(e,t){t.exports=function(e,t){return e.has(t)}}}),de=a({"../../../node_modules/lodash/_equalArrays.js"(e,t){var r=ue(),n=ce(),o=le();t.exports=function(e,t,i,a,s,u){var c=1&i,l=e.length,d=t.length;if(l!=d&&!(c&&d>l))return!1;var f=u.get(e),p=u.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&i?new r:void 0;for(u.set(e,t),u.set(t,e);++h<l;){var y=e[h],b=t[h];if(a)var v=c?a(b,y,h,t,e,u):a(y,b,h,e,t,u);if(void 0!==v){if(v)continue;m=!1;break}if(g){if(!n(t,(function(e,t){if(!o(g,t)&&(y===e||s(y,e,i,a,u)))return g.push(t)}))){m=!1;break}}else if(y!==b&&!s(y,b,i,a,u)){m=!1;break}}return u.delete(e),u.delete(t),m}}}),fe=a({"../../../node_modules/lodash/_Uint8Array.js"(e,t){var r=d().Uint8Array;t.exports=r}}),pe=a({"../../../node_modules/lodash/_mapToArray.js"(e,t){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}}}),he=a({"../../../node_modules/lodash/_setToArray.js"(e,t){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}}}),me=a({"../../../node_modules/lodash/_equalByTag.js"(e,t){var r=m(),n=fe(),o=S(),i=de(),a=pe(),s=he(),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;t.exports=function(e,t,r,u,l,d,f){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new n(e),new n(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=a;case"[object Set]":var h=1&u;if(p||(p=s),e.size!=t.size&&!h)return!1;var m=f.get(e);if(m)return m==t;u|=2,f.set(e,t);var g=i(p(e),p(t),u,l,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}}}),ge=a({"../../../node_modules/lodash/_arrayPush.js"(e,t){t.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}}}),ye=a({"../../../node_modules/lodash/isArray.js"(e,t){var r=Array.isArray;t.exports=r}}),be=a({"../../../node_modules/lodash/_baseGetAllKeys.js"(e,t){var r=ge(),n=ye();t.exports=function(e,t,o){var i=t(e);return n(e)?i:r(i,o(e))}}}),ve=a({"../../../node_modules/lodash/_arrayFilter.js"(e,t){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}}}),we=a({"../../../node_modules/lodash/stubArray.js"(e,t){t.exports=function(){return[]}}}),Ee=a({"../../../node_modules/lodash/_getSymbols.js"(e,t){var r=ve(),n=we(),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),r(i(e),(function(t){return o.call(e,t)})))}:n;t.exports=a}}),_e=a({"../../../node_modules/lodash/_baseTimes.js"(e,t){t.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}}}),Ce=a({"../../../node_modules/lodash/_baseIsArguments.js"(e,t){var r=b(),n=v();t.exports=function(e){return n(e)&&"[object Arguments]"==r(e)}}}),Se=a({"../../../node_modules/lodash/isArguments.js"(e,t){var r=Ce(),n=v(),o=Object.prototype,i=o.hasOwnProperty,a=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return n(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s}}),xe=a({"../../../node_modules/lodash/stubFalse.js"(e,t){t.exports=function(){return!1}}}),ke=a({"../../../node_modules/lodash/isBuffer.js"(e,t){var r=d(),n=xe(),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,s=(a?a.isBuffer:void 0)||n;t.exports=s}}),Te=a({"../../../node_modules/lodash/_isIndex.js"(e,t){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<t}}}),Ae=a({"../../../node_modules/lodash/isLength.js"(e,t){t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}}),Pe=a({"../../../node_modules/lodash/_baseIsTypedArray.js"(e,t){var r=b(),n=Ae(),o=v(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&n(e.length)&&!!i[r(e)]}}}),qe=a({"../../../node_modules/lodash/_baseUnary.js"(e,t){t.exports=function(e){return function(t){return e(t)}}}}),Fe=a({"../../../node_modules/lodash/_nodeUtil.js"(e,t){var r=l(),n="object"==typeof e&&e&&!e.nodeType&&e,o=n&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===n&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();t.exports=a}}),Le=a({"../../../node_modules/lodash/isTypedArray.js"(e,t){var r=Pe(),n=qe(),o=Fe(),i=o&&o.isTypedArray,a=i?n(i):r;t.exports=a}}),De=a({"../../../node_modules/lodash/_arrayLikeKeys.js"(e,t){var r=_e(),n=Se(),o=ye(),i=ke(),a=Te(),s=Le(),u=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=o(e),l=!c&&n(e),d=!c&&!l&&i(e),f=!c&&!l&&!d&&s(e),p=c||l||d||f,h=p?r(e.length,String):[],m=h.length;for(var g in e)!t&&!u.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||h.push(g);return h}}}),Re=a({"../../../node_modules/lodash/_isPrototype.js"(e,t){var r=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}}}),Be=a({"../../../node_modules/lodash/_overArg.js"(e,t){t.exports=function(e,t){return function(r){return e(t(r))}}}}),Me=a({"../../../node_modules/lodash/_nativeKeys.js"(e,t){var r=Be()(Object.keys,Object);t.exports=r}}),Ie=a({"../../../node_modules/lodash/_baseKeys.js"(e,t){var r=Re(),n=Me(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return n(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}}}),Oe=a({"../../../node_modules/lodash/isArrayLike.js"(e,t){var r=B(),n=Ae();t.exports=function(e){return null!=e&&n(e.length)&&!r(e)}}}),je=a({"../../../node_modules/lodash/keys.js"(e,t){var r=De(),n=Ie(),o=Oe();t.exports=function(e){return o(e)?r(e):n(e)}}}),Ue=a({"../../../node_modules/lodash/_getAllKeys.js"(e,t){var r=be(),n=Ee(),o=je();t.exports=function(e){return r(e,o,n)}}}),$e=a({"../../../node_modules/lodash/_equalObjects.js"(e,t){var r=Ue(),n=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var u=1&o,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var d=l;d--;){var f=c[d];if(!(u?f in t:n.call(t,f)))return!1}var p=s.get(e),h=s.get(t);if(p&&h)return p==t&&h==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<l;){var y=e[f=c[d]],b=t[f];if(i)var v=u?i(b,y,f,t,e,s):i(y,b,f,e,t,s);if(!(void 0===v?y===b||a(y,b,o,i,s):v)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(m=!1)}return s.delete(e),s.delete(t),m}}}),He=a({"../../../node_modules/lodash/_DataView.js"(e,t){var r=$()(d(),"DataView");t.exports=r}}),Ne=a({"../../../node_modules/lodash/_Promise.js"(e,t){var r=$()(d(),"Promise");t.exports=r}}),Ve=a({"../../../node_modules/lodash/_Set.js"(e,t){var r=$()(d(),"Set");t.exports=r}}),ze=a({"../../../node_modules/lodash/_WeakMap.js"(e,t){var r=$()(d(),"WeakMap");t.exports=r}}),We=a({"../../../node_modules/lodash/_getTag.js"(e,t){var r=He(),n=H(),o=Ne(),i=Ve(),a=ze(),s=b(),u=O(),c="[object Map]",l="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",h=u(r),m=u(n),g=u(o),y=u(i),v=u(a),w=s;(r&&w(new r(new ArrayBuffer(1)))!=p||n&&w(new n)!=c||o&&w(o.resolve())!=l||i&&w(new i)!=d||a&&w(new a)!=f)&&(w=function(e){var t=s(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case h:return p;case m:return c;case g:return l;case y:return d;case v:return f}return t}),t.exports=w}}),Ge=a({"../../../node_modules/lodash/_baseIsEqualDeep.js"(e,t){var r=ie(),n=de(),o=me(),i=$e(),a=We(),s=ye(),u=ke(),c=Le(),l="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(e,t,h,m,g,y){var b=s(e),v=s(t),w=b?d:a(e),E=v?d:a(t),_=(w=w==l?f:w)==f,C=(E=E==l?f:E)==f,S=w==E;if(S&&u(e)){if(!u(t))return!1;b=!0,_=!1}if(S&&!_)return y||(y=new r),b||c(e)?n(e,t,h,m,g,y):o(e,t,w,h,m,g,y);if(!(1&h)){var x=_&&p.call(e,"__wrapped__"),k=C&&p.call(t,"__wrapped__");if(x||k){var T=x?e.value():e,A=k?t.value():t;return y||(y=new r),g(T,A,h,m,y)}}return!!S&&(y||(y=new r),i(e,t,h,m,g,y))}}}),Ye=a({"../../../node_modules/lodash/_baseIsEqual.js"(e,t){var r=Ge(),n=v();t.exports=function e(t,o,i,a,s){return t===o||(null==t||null==o||!n(t)&&!n(o)?t!=t&&o!=o:r(t,o,i,a,e,s))}}}),Xe=a({"../../../node_modules/lodash/isEqual.js"(e,t){var r=Ye();t.exports=function(e,t){return r(e,t)}}}),Ze=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}}),Ke=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}}}),Qe=a({"../../../node_modules/buffer/index.js"(e){var t=Ze(),r=Ke(),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|p(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(j(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(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(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||U(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 p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(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 M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(e).length;default:if(o)return n?-1:M(e).length;t=(""+t).toLowerCase(),o=!0}}function h(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 A(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(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),U(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:y(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):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(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 b(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(U(s))return a;e[r+a]=s}return a}function v(e,t,r,n){return O(M(t,e.length-r),e,r,n)}function w(e,t,r,n){return O(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return O(I(t),e,r,n)}function _(e,t,r,n){return O(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 C(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function S(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<=x)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));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(j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),j(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(j(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=p,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)m(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)m(this,t,t+3),m(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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):h.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(j(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 g(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return g(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 b(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(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 x=4096;function k(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 T(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 A(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+=$[e[i]];return o}function P(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 q(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 F(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 D(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 R(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||q(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||q(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||q(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||q(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||q(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||q(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||q(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||q(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||q(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||q(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||q(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||q(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||q(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||q(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||q(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||q(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||q(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||q(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)||F(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)||F(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||F(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||F(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||F(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||F(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||F(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);F(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);F(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||F(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||F(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||F(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||F(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||F(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 D(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return R(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 B=/[^+/0-9A-Za-z-_]/g;function M(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 I(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(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 j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function U(e){return e!=e}var $=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}()}}),Je=a({"../../../node_modules/lodash/toFinite.js"(e,t){var r=E(),n=1/0;t.exports=function(e){return e?(e=r(e))===n||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}}),et=a({"../../../node_modules/lodash/toInteger.js"(e,t){var r=Je();t.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}}}),tt=a({"../../../node_modules/lodash/before.js"(e,t){var r=et();t.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}}}),rt=a({"../../../node_modules/lodash/once.js"(e,t){var r=tt();t.exports=function(e){return r(2,e)}}}),nt=a({"../../../esbuild/polyfill.noop.js"(){}}),ot=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,C("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 nt().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/icudt71l.dat",start:275745,end:710017},{filename:"/ly.img.cesdk/presets/.keep",start:710017,end:710017},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:710017,end:713906},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:713906,end:720223},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:720223,end:724814},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:724814,end:734799},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:734799,end:735289},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:735289,end:738456},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:738456,end:741094},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:741094,end:742041},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:742041,end:742556},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:742556,end:743520},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:743520,end:745637},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:745637,end:746604},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:746604,end:747098},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:747098,end:760698},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:760698,end:761483},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:761483,end:761965},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:761965,end:764828},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:764828,end:765333},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:765333,end:765787},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:765787,end:767424},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:767424,end:767724},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:767724,end:768412},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:768412,end:768624},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:768624,end:769187},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:769187,end:771492},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:771492,end:772176},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:772176,end:772758},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:772758,end:773476},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:773476,end:773848}],remote_package_size:773848}),"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}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;n(r)}}else await new Promise(((t,r)=>{e.on("data",n),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}));const o=new Uint8Array(t);let i=0;for(const e of r)o.set(e,i),i+=e.length;return this.finish(o)}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){return this._processes.delete(e)}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),Promise.reject(e)))):this._fetchRemote(f,e,n,o,i,a,s,c).catch((e=>(f.fail(e),Promise.reject(e)))),f}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=nt(),{fileURLToPath:r}=nt(),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});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,g="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,b="";if(y){var v=nt(),w=nt();b=g?w.dirname(b)+"/":__dirname+"/",c=(e,t)=>(e=oe(e)?new URL(e):w.normalize(e),v.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=oe(e)?new URL(e):w.normalize(e),v.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||g)&&(g?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),r&&(b=r),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(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 E,_=u.print||console.log.bind(console),C=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&&(E=u.wasmBinary);var S,x,k=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&J("no native wasm support detected");var T,A,P,q,F,L,D,R,B,M,I,O=!1;function j(e,t){e||J(t)}function U(){var e=S.buffer;u.HEAP8=A=new Int8Array(e),u.HEAP16=q=new Int16Array(e),u.HEAP32=L=new Int32Array(e),u.HEAPU8=P=new Uint8Array(e),u.HEAPU16=F=new Uint16Array(e),u.HEAPU32=D=new Uint32Array(e),u.HEAPF32=R=new Float32Array(e),u.HEAPF64=I=new Float64Array(e),u.HEAP64=B=new BigInt64Array(e),u.HEAPU64=M=new BigUint64Array(e)}var $,H=u.INITIAL_MEMORY||16777216;j(H>=65536,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+H+"! (STACK_SIZE=65536)"),S=u.wasmMemory?u.wasmMemory:new WebAssembly.Memory({initial:H/65536,maximum:32768}),U(),H=S.buffer.byteLength;var N=[],V=[],z=[],W=[];function G(){return k||!1}var Y=0,X=null,Z=null;function K(e){Y++,u.monitorRunDependencies&&u.monitorRunDependencies(Y)}function Q(e){if(Y--,u.monitorRunDependencies&&u.monitorRunDependencies(Y),0==Y&&(null!==X&&(clearInterval(X),X=null),Z)){var t=Z;Z=null,t()}}function J(e){u.onAbort&&u.onAbort(e),C(e="Aborted("+e+")"),O=!0,T=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var ee,te,re="data:application/octet-stream;base64,";function ne(e){return e.startsWith(re)}function oe(e){return e.startsWith("file://")}function ie(e){if(e==ee&&E)return new Uint8Array(E);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function ae(e,t,r){return function(e){return E||!m&&!g||"function"!=typeof fetch?Promise.resolve().then((()=>ie(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ie(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{C("failed to asynchronously prepare wasm: "+e),J(e)}))}ne(ee="cesdk.wasm")||(te=ee,ee=u.locateFile?u.locateFile(te,b):b+te);var se={2350008:(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=["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),2351998:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2352162:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2352266:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2352437:(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(Zu(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)},2355220:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2355286: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},2355651:e=>{miniaudio.untrack_device_by_index(e)},2355694:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2355819:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2355945:()=>!!globalThis.ubq_browserTabHidden,2355991:()=>A.length};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{for(;e.length>0;)e.shift()(u)},le=[],de=0;function fe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){D[this.ptr+4>>2]=e},this.get_type=function(){return D[this.ptr+4>>2]},this.set_destructor=function(e){D[this.ptr+8>>2]=e},this.get_destructor=function(){return D[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,A[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=A[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,A[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=A[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){D[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return D[this.ptr+16>>2]},this.get_exception_ptr=function(){if(sc(this.get_type()))return D[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var pe=e=>{var t=de;if(!t)return Ku(0),0;var r=new fe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ku(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 Ku(i),t}return Ku(n),t},he={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=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.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=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},me=e=>(me=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(y)try{var e=nt();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}J("initRandomDevice")})())(e),ge={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Ae.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.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=ge.resolve(e).substr(1),t=ge.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("/")}},ye="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,be=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&ye)return ye.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},ve=[],we=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},Ee=(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 _e(e,t,r){var n=r>0?r:we(e)+1,o=new Array(n),i=Ee(e,o,0,o.length);return t&&(o.length=i),o}var Ce={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){Ce.ttys[e]={input:[],output:[],ops:t},Ae.registerDevice(e,Ce.stream_ops)},stream_ops:{open:function(e){var t=Ce.ttys[e.node.rdev];if(!t)throw new Ae.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 Ae.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 Ae.ErrnoError(29)}if(void 0===s&&0===i)throw new Ae.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 Ae.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ae.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){return(()=>{if(!ve.length){var e=null;if(y){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=v.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;ve=_e(e,!0)}return ve.shift()})()},put_char:function(e,t){null===t||10===t?(_(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(_(be(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?(C(be(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(C(be(e.output,0)),e.output=[])}}},Se=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Ju(65536,e);return t?((e,t)=>(P.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(Ae.isBlkdev(r)||Ae.isFIFO(r))throw new Ae.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:Ae.chrdev_stream_ops}});var o=Ae.createNode(e,t,r,n);return Ae.isDir(o.mode)?(o.node_ops=xe.ops_table.dir.node,o.stream_ops=xe.ops_table.dir.stream,o.contents={}):Ae.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):Ae.isLink(o.mode)?(o.node_ops=xe.ops_table.link.node,o.stream_ops=xe.ops_table.link.stream):Ae.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=Ae.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,Ae.isDir(e.mode)?t.size=4096:Ae.isFile(e.mode)?t.size=e.usedBytes:Ae.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 Ae.genericErrors[44]},mknod:(e,t,r,n)=>xe.createNode(e,t,r,n),rename(e,t,r){if(Ae.isDir(e.mode)){var n;try{n=Ae.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Ae.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=Ae.lookupNode(e,t);for(var n in r.contents)throw new Ae.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(!Ae.isLink(e.mode))throw new Ae.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===A.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&&Ae.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Ae.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(!Ae.isFile(e.node.mode))throw new Ae.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==A.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=Se(t)))throw new Ae.ErrnoError(48);A.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)}},ke=u.preloadPlugins||[];function Te(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}var Ae={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=ge.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ae.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Ae.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Ae.lookupNode(n,r[i]),o=he.join2(o,r[i]),Ae.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Ae.isLink(n.mode);){var u=Ae.readlink(o);if(o=ge.resolve(he.dirname(o),u),n=Ae.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ae.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Ae.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)%Ae.nameTable.length},hashAddNode:e=>{var t=Ae.hashName(e.parent.id,e.name);e.name_next=Ae.nameTable[t],Ae.nameTable[t]=e},hashRemoveNode:e=>{var t=Ae.hashName(e.parent.id,e.name);if(Ae.nameTable[t]===e)Ae.nameTable[t]=e.name_next;else for(var r=Ae.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Ae.mayLookup(e);if(r)throw new Ae.ErrnoError(r,e);for(var n=Ae.hashName(e.id,t),o=Ae.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Ae.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new Ae.FSNode(e,t,r,n);return Ae.hashAddNode(o),o},destroyNode:e=>{Ae.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)=>Ae.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=Ae.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return Ae.lookupNode(e,t),20}catch(e){}return Ae.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Ae.lookupNode(e,t)}catch(e){return e.errno}var o=Ae.nodePermissions(e,"wx");if(o)return o;if(r){if(!Ae.isDir(n.mode))return 54;if(Ae.isRoot(n)||Ae.getPath(n)===Ae.cwd())return 10}else if(Ae.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Ae.isLink(e.mode)?32:Ae.isDir(e.mode)&&("r"!==Ae.flagsToPermissionString(t)||512&t)?31:Ae.nodePermissions(e,Ae.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:()=>{for(var e=0;e<=Ae.MAX_OPEN_FDS;e++)if(!Ae.streams[e])return e;throw new Ae.ErrnoError(33)},getStreamChecked:e=>{var t=Ae.getStream(e);if(!t)throw new Ae.ErrnoError(8);return t},getStream:e=>Ae.streams[e],createStream:(e,t=-1)=>(Ae.FSStream||(Ae.FSStream=function(){this.shared={}},Ae.FSStream.prototype={},Object.defineProperties(Ae.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 Ae.FSStream,e),-1==t&&(t=Ae.nextfd()),e.fd=t,Ae.streams[t]=e,e),closeStream:e=>{Ae.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Ae.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Ae.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Ae.devices[e]={stream_ops:t}},getDevice:e=>Ae.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),Ae.syncFSRequests++,Ae.syncFSRequests>1&&C(`warning: ${Ae.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ae.getMounts(Ae.root.mount),n=0;function o(e){return Ae.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&&Ae.root)throw new Ae.ErrnoError(10);if(!o&&!i){var a=Ae.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ae.isMountpoint(n))throw new Ae.ErrnoError(10);if(!Ae.isDir(n.mode))throw new Ae.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Ae.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=Ae.lookupPath(e,{follow_mount:!1});if(!Ae.isMountpoint(t.node))throw new Ae.ErrnoError(28);var r=t.node,n=r.mounted,o=Ae.getMounts(n);Object.keys(Ae.nameTable).forEach((e=>{for(var t=Ae.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Ae.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=Ae.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new Ae.ErrnoError(28);var i=Ae.mayCreate(n,o);if(i)throw new Ae.ErrnoError(i);if(!n.node_ops.mknod)throw new Ae.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ae.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ae.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{Ae.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ae.mknod(e,t,r)),symlink:(e,t)=>{if(!ge.resolve(e))throw new Ae.ErrnoError(44);var r=Ae.lookupPath(t,{parent:!0}).node;if(!r)throw new Ae.ErrnoError(44);var n=he.basename(t),o=Ae.mayCreate(r,n);if(o)throw new Ae.ErrnoError(o);if(!r.node_ops.symlink)throw new Ae.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=he.dirname(e),i=he.dirname(t),a=he.basename(e),s=he.basename(t);if(r=Ae.lookupPath(e,{parent:!0}).node,n=Ae.lookupPath(t,{parent:!0}).node,!r||!n)throw new Ae.ErrnoError(44);if(r.mount!==n.mount)throw new Ae.ErrnoError(75);var u,c=Ae.lookupNode(r,a),l=ge.relative(e,i);if("."!==l.charAt(0))throw new Ae.ErrnoError(28);if("."!==(l=ge.relative(t,o)).charAt(0))throw new Ae.ErrnoError(55);try{u=Ae.lookupNode(n,s)}catch(e){}if(c!==u){var d=Ae.isDir(c.mode),f=Ae.mayDelete(r,a,d);if(f)throw new Ae.ErrnoError(f);if(f=u?Ae.mayDelete(n,s,d):Ae.mayCreate(n,s))throw new Ae.ErrnoError(f);if(!r.node_ops.rename)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(c)||u&&Ae.isMountpoint(u))throw new Ae.ErrnoError(10);if(n!==r&&(f=Ae.nodePermissions(r,"w")))throw new Ae.ErrnoError(f);Ae.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Ae.hashAddNode(c)}}},rmdir:e=>{var t=Ae.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!0);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.rmdir)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.rmdir(t,r),Ae.destroyNode(n)},readdir:e=>{var t=Ae.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ae.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Ae.lookupPath(e,{parent:!0}).node;if(!t)throw new Ae.ErrnoError(44);var r=he.basename(e),n=Ae.lookupNode(t,r),o=Ae.mayDelete(t,r,!1);if(o)throw new Ae.ErrnoError(o);if(!t.node_ops.unlink)throw new Ae.ErrnoError(63);if(Ae.isMountpoint(n))throw new Ae.ErrnoError(10);t.node_ops.unlink(t,r),Ae.destroyNode(n)},readlink:e=>{var t=Ae.lookupPath(e).node;if(!t)throw new Ae.ErrnoError(44);if(!t.node_ops.readlink)throw new Ae.ErrnoError(28);return ge.resolve(Ae.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Ae.lookupPath(e,{follow:!t}).node;if(!r)throw new Ae.ErrnoError(44);if(!r.node_ops.getattr)throw new Ae.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ae.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Ae.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Ae.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Ae.getStreamChecked(e);Ae.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Ae.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Ae.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Ae.getStreamChecked(e);Ae.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Ae.ErrnoError(28);var r;if(!(r="string"==typeof e?Ae.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ae.ErrnoError(63);if(Ae.isDir(r.mode))throw new Ae.ErrnoError(31);if(!Ae.isFile(r.mode))throw new Ae.ErrnoError(28);var n=Ae.nodePermissions(r,"w");if(n)throw new Ae.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Ae.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ae.ErrnoError(28);Ae.truncate(r.node,t)},utime:(e,t,r)=>{var n=Ae.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new Ae.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=he.normalize(e);try{n=Ae.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Ae.ErrnoError(20)}else n=Ae.mknod(e,r,0),o=!0;if(!n)throw new Ae.ErrnoError(44);if(Ae.isChrdev(n.mode)&&(t&=-513),65536&t&&!Ae.isDir(n.mode))throw new Ae.ErrnoError(54);if(!o){var i=Ae.mayOpen(n,t);if(i)throw new Ae.ErrnoError(i)}512&t&&!o&&Ae.truncate(n,0),t&=-131713;var a=Ae.createStream({node:n,path:Ae.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||(Ae.readFiles||(Ae.readFiles={}),e in Ae.readFiles||(Ae.readFiles[e]=1)),a},close:e=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ae.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ae.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ae.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 Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(1==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.read)throw new Ae.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Ae.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 Ae.ErrnoError(28);if(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(Ae.isDir(e.node.mode))throw new Ae.ErrnoError(31);if(!e.stream_ops.write)throw new Ae.ErrnoError(28);e.seekable&&1024&e.flags&&Ae.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Ae.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(Ae.isClosed(e))throw new Ae.ErrnoError(8);if(t<0||r<=0)throw new Ae.ErrnoError(28);if(0==(2097155&e.flags))throw new Ae.ErrnoError(8);if(!Ae.isFile(e.node.mode)&&!Ae.isDir(e.node.mode))throw new Ae.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ae.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 Ae.ErrnoError(2);if(1==(2097155&e.flags))throw new Ae.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ae.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 Ae.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=Ae.open(e,t.flags),o=Ae.stat(e).size,i=new Uint8Array(o);return Ae.read(n,i,0,o,0),"utf8"===t.encoding?r=be(i,0):"binary"===t.encoding&&(r=i),Ae.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Ae.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(we(t)+1),i=Ee(t,o,0,o.length);Ae.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ae.write(n,t,0,t.byteLength,void 0,r.canOwn)}Ae.close(n)},cwd:()=>Ae.currentPath,chdir:e=>{var t=Ae.lookupPath(e,{follow:!0});if(null===t.node)throw new Ae.ErrnoError(44);if(!Ae.isDir(t.node.mode))throw new Ae.ErrnoError(54);var r=Ae.nodePermissions(t.node,"x");if(r)throw new Ae.ErrnoError(r);Ae.currentPath=t.path},createDefaultDirectories:()=>{Ae.mkdir("/tmp"),Ae.mkdir("/home"),Ae.mkdir("/home/web_user")},createDefaultDevices:()=>{Ae.mkdir("/dev"),Ae.registerDevice(Ae.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Ae.mkdev("/dev/null",Ae.makedev(1,3)),Ce.register(Ae.makedev(5,0),Ce.default_tty_ops),Ce.register(Ae.makedev(6,0),Ce.default_tty1_ops),Ae.mkdev("/dev/tty",Ae.makedev(5,0)),Ae.mkdev("/dev/tty1",Ae.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=me(e).byteLength),e[--t]);Ae.createDevice("/dev","random",r),Ae.createDevice("/dev","urandom",r),Ae.mkdir("/dev/shm"),Ae.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Ae.mkdir("/proc");var e=Ae.mkdir("/proc/self");Ae.mkdir("/proc/self/fd"),Ae.mount({mount:()=>{var t=Ae.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Ae.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?Ae.createDevice("/dev","stdin",u.stdin):Ae.symlink("/dev/tty","/dev/stdin"),u.stdout?Ae.createDevice("/dev","stdout",null,u.stdout):Ae.symlink("/dev/tty","/dev/stdout"),u.stderr?Ae.createDevice("/dev","stderr",null,u.stderr):Ae.symlink("/dev/tty1","/dev/stderr"),Ae.open("/dev/stdin",0),Ae.open("/dev/stdout",1),Ae.open("/dev/stderr",1)},ensureErrnoError:()=>{Ae.ErrnoError||(Ae.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Ae.ErrnoError.prototype=new Error,Ae.ErrnoError.prototype.constructor=Ae.ErrnoError,[44].forEach((e=>{Ae.genericErrors[e]=new Ae.ErrnoError(e),Ae.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Ae.ensureErrnoError(),Ae.nameTable=new Array(4096),Ae.mount(xe,{},"/"),Ae.createDefaultDirectories(),Ae.createDefaultDevices(),Ae.createSpecialDirectories(),Ae.filesystems={MEMFS:xe}},init:(e,t,r)=>{Ae.init.initialized=!0,Ae.ensureErrnoError(),u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,Ae.createStandardStreams()},quit:()=>{Ae.init.initialized=!1;for(var e=0;e<Ae.streams.length;e++){var t=Ae.streams[e];t&&Ae.close(t)}},findObject:(e,t)=>{var r=Ae.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Ae.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=Ae.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=Ae.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:Ae.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=he.join2(e,i);try{Ae.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=he.join2("string"==typeof e?e:Ae.getPath(e),t),a=Te(n,o);return Ae.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Ae.getPath(e),a=t?he.join2(e,t):e);var s=Te(n,o),u=Ae.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}Ae.chmod(u,146|s);var f=Ae.open(u,577);Ae.write(f,r,0,r.length,0,i),Ae.close(f),Ae.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=he.join2("string"==typeof e?e:Ae.getPath(e),t),i=Te(!!r,!!n);Ae.createDevice.major||(Ae.createDevice.major=64);var a=Ae.makedev(Ae.createDevice.major++,0);return Ae.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 Ae.ErrnoError(29)}if(void 0===u&&0===a)throw new Ae.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 Ae.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Ae.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=_e(c(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ae.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||[]):_e(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,_("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(!g)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=Ae.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 Ae.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(Ae.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{Ae.forceLoadFile(u);var i=Se(t);if(!i)throw new Ae.ErrnoError(48);return l(e,A,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},Pe=(e,t)=>e?be(P,e,t):"",qe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?Ae.cwd():qe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ae.ErrnoError(44);return n}return he.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(Ae.getPath(e.node)))return-54;throw e}L[r>>2]=n.dev,L[r+4>>2]=n.mode,D[r+8>>2]=n.nlink,L[r+12>>2]=n.uid,L[r+16>>2]=n.gid,L[r+20>>2]=n.rdev,B[r+24>>3]=BigInt(n.size),L[r+32>>2]=4096,L[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return B[r+40>>3]=BigInt(Math.floor(o/1e3)),D[r+48>>2]=o%1e3*1e3,B[r+56>>3]=BigInt(Math.floor(i/1e3)),D[r+64>>2]=i%1e3*1e3,B[r+72>>3]=BigInt(Math.floor(a/1e3)),D[r+80>>2]=a%1e3*1e3,B[r+88>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){if(!Ae.isFile(t.node.mode))throw new Ae.ErrnoError(43);if(2&n)return 0;var i=P.slice(e,e+r);Ae.msync(t,i,o,r,n)},varargs:void 0,get:()=>(qe.varargs+=4,L[qe.varargs-4>>2]),getStr:e=>Pe(e),getStreamFromFD:function(e){return Ae.getStreamChecked(e)}},Fe={};function Le(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function De(e){return this.fromWireType(L[e>>2])}var Re={},Be={},Me={},Ie=void 0;function Oe(e){throw new Ie(e)}function je(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Oe("Mismatched type converter count");for(var o=0;o<e.length;++o)We(e[o],n[o])}e.forEach((function(e){Me[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Be.hasOwnProperty(e)?o[t]=Be[e]:(i.push(e),Re.hasOwnProperty(e)||(Re[e]=[]),Re[e].push((()=>{o[t]=Be[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}var Ue={};function $e(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}var He=void 0;function Ne(e){for(var t="",r=e;P[r];)t+=He[P[r++]];return t}var Ve=void 0;function ze(e){throw new Ve(e)}function We(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||ze(`type "${n}" must have a positive integer typeid pointer`),Be.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;ze(`Cannot register type '${n}' twice`)}if(Be[e]=t,delete Me[e],Re.hasOwnProperty(e)){var o=Re[e];delete Re[e],o.forEach((e=>e()))}}(e,t,r)}function Ge(e,t,r){switch(t){case 0:return r?function(e){return A[e]}:function(e){return P[e]};case 1:return r?function(e){return q[e>>1]}:function(e){return F[e>>1]};case 2:return r?function(e){return L[e>>2]}:function(e){return D[e>>2]};case 3:return r?function(e){return B[e>>3]}:function(e){return M[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function Ye(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 Xe(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){ze(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ke=!1;function Qe(e){}function Je(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 et(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=et(e,t,r.baseClass);return null===n?null:r.downcast(n)}var tt={};function rt(){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&&ze("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||Oe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Oe("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=tt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=et(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=>{Je(e.$$)})),Qe=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&&ze("Object already scheduled for deletion"),Qe(this),Je(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&&ze("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)||ze(`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])&&ze(`Cannot register public name '${e}' twice`),Ct(u,e,e),u.hasOwnProperty(r)&&ze(`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 xt(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 kt(e,t,r){for(;t!==r;)t.upcast||ze(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e}function Tt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${$e(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return kt(t.$$.ptr,r,this.registeredClass)}function At(e,t){var r;if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||ze(`Cannot pass "${$e(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&ze(`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=kt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&ze("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:ze(`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:ze("Unsupporting sharing policy")}return r}function Pt(e,t){if(null===t)return this.isReference&&ze(`null is not a valid ${this.name}`),0;t.$$||ze(`Cannot pass "${$e(t)}" as a ${this.name}`),t.$$.ptr||ze(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&ze(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return kt(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 Lt(e){null!==e&&e.delete()}function Dt(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=At:n?(this.toWireType=Tt,this.destructorFunction=null):(this.toWireType=Pt,this.destructorFunction=null)}function Rt(e,t,r){u.hasOwnProperty(e)||Oe("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 Bt=[],Mt=e=>{var t=Bt[e];return t||(e>=Bt.length&&(Bt.length=e+1),Bt[e]=t=$.get(e)),t};function It(e,t){e=Ne(e);var r=Mt(t);return"function"!=typeof r&&ze(`unknown function pointer with signature ${e}: ${t}`),r}var Ot=void 0;function jt(e){var t=Qu(e),r=Ne(t);return Gu(t),r}function Ut(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Be[t]||(Me[t]?Me[t].forEach(e):(r.push(t),n[t]=!0))})),new Ot(`${e}: `+r.map(jt).join([", "]))}function $t(e,t){for(var r=[],n=0;n<e;n++)r.push(D[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 Nt(e,t,r,n,o,i){var a=t.length;a<2&&ze("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=[ze,n,o,Le,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 Vt(){this.allocated=[void 0],this.freelist=[]}var zt=new Vt;function Wt(e){e>=zt.reserved&&0==--zt.get(e).refcount&&zt.free(e)}function Gt(){for(var e=0,t=zt.reserved;t<zt.allocated.length;++t)void 0!==zt.allocated[t]&&++e;return e}var Yt={toValue:e=>(e||ze("Cannot use deleted val. handle = "+e),zt.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 zt.allocate({refcount:1,value:e})}}};function Xt(e,t,r){switch(t){case 0:return function(e){var t=r?A:P;return this.fromWireType(t[e])};case 1:return function(e){var t=r?q:F;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?L:D;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function Zt(e,t){var r=Be[e];return void 0===r&&ze(t+" has unknown type "+jt(e)),r}function Kt(e,t){switch(t){case 2:return function(e){return this.fromWireType(R[e>>2])};case 3:return function(e){return this.fromWireType(I[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}var Qt=(e,t,r)=>Ee(e,P,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)&&F[n];)++n;if((r=n<<1)-e>32&&Jt)return Jt.decode(P.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=q[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);q[t>>1]=a,t+=2}return q[t>>1]=0,t-n},rr=e=>2*e.length,nr=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=L[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)),L[t>>2]=a,(t+=4)+4>o)break}return L[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]=Zt(D[t+4*n>>2],"parameter "+n);return r}var sr={};function ur(e){var t=sr[e];return void 0===t?Ne(e):t}var cr=[];function lr(){return"object"==typeof globalThis?globalThis: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=we(e)+1,r=Wu(t);return r&&Qt(e,r,t),r};function _r(e,t){if(Tr.mainLoop.timingMode=e,Tr.mainLoop.timingValue=t,!Tr.mainLoop.func)return 1;if(Tr.mainLoop.running||(Tr.mainLoop.running=!0),0==e)Tr.mainLoop.scheduler=function(){var e=0|Math.max(0,Tr.mainLoop.tickStartTime+t-gr());setTimeout(Tr.mainLoop.runner,e)},Tr.mainLoop.method="timeout";else if(1==e)Tr.mainLoop.scheduler=function(){Tr.requestAnimationFrame(Tr.mainLoop.runner)},Tr.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),g?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}Tr.mainLoop.scheduler=function(){setImmediate(Tr.mainLoop.runner)},Tr.mainLoop.method="immediate"}return 0}gr=()=>performance.now();var Cr=e=>{if(e instanceof ue||"unwind"==e)return T;h(1,e)},Sr=(e,t)=>{var r;T=e,T=r=e,G()||(u.onExit&&u.onExit(r),O=!0),h(r,new ue(r))},xr=e=>{if(!O)try{e(),(()=>{if(!G())try{Sr(T)}catch(e){Cr(e)}})()}catch(e){Cr(e)}},kr=(e,t)=>setTimeout((()=>{xr(e)}),t),Tr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Tr.mainLoop.scheduler=null,Tr.mainLoop.currentlyRunningMainloop++},resume:function(){Tr.mainLoop.currentlyRunningMainloop++;var e=Tr.mainLoop.timingMode,t=Tr.mainLoop.timingValue,r=Tr.mainLoop.func;Tr.mainLoop.func=null,function(e,t,r,n,o){j(!Tr.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."),Tr.mainLoop.func=e,Tr.mainLoop.arg=n;var i=Tr.mainLoop.currentlyRunningMainloop;function a(){return!(i<Tr.mainLoop.currentlyRunningMainloop)}if(Tr.mainLoop.running=!1,Tr.mainLoop.runner=function(){if(!O)if(Tr.mainLoop.queue.length>0){var t=Date.now(),r=Tr.mainLoop.queue.shift();if(r.func(r.arg),Tr.mainLoop.remainingBlockers){var n=Tr.mainLoop.remainingBlockers,o=n%1==0?n-1:Math.floor(n);r.counted?Tr.mainLoop.remainingBlockers=o:(o+=.5,Tr.mainLoop.remainingBlockers=(8*n+o)/9)}if(_('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Tr.mainLoop.updateStatus(),!a())return;setTimeout(Tr.mainLoop.runner,0)}else a()&&(Tr.mainLoop.currentFrameNumber=Tr.mainLoop.currentFrameNumber+1|0,1==Tr.mainLoop.timingMode&&Tr.mainLoop.timingValue>1&&Tr.mainLoop.currentFrameNumber%Tr.mainLoop.timingValue!=0?Tr.mainLoop.scheduler():(0==Tr.mainLoop.timingMode&&(Tr.mainLoop.tickStartTime=gr()),Tr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Tr.mainLoop.scheduler())))},o||(t&&t>0?_r(0,1e3/t):_r(1,1),Tr.mainLoop.scheduler()),r)throw"unwind"}(r,0,!1,Tr.mainLoop.arg,!0),_r(e,t),Tr.mainLoop.scheduler()},updateStatus:function(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=Tr.mainLoop.remainingBlockers,r=Tr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter:function(e){if(!O){if(u.preMainLoop&&!1===u.preMainLoop())return;xr(e),u.postMainLoop&&u.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(!Tr.initted){Tr.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:Tr.getMimetype(t)});o.size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:Tr.getMimetype(t)}));var i=URL.createObjectURL(o),a=new Image;a.onload=()=>{j(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),ju[t]=n,URL.revokeObjectURL(i),r&&r(e)},a.onerror=e=>{_("Image "+i+" could not be decoded"),n&&n()},a.src=i}};ke.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,Uu[t]=n,r&&r(e))}var a=new Blob([e],{type:Tr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){o||(C("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,kr((()=>{i(u)}),1e4)}};ke.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=>{!Tr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){Tr.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!==Br&&(i=Br.createContext(e,a))&&(o=Br.getContext(i).GLctx)}else o=e.getContext("2d");return o?(r&&(t||j(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&&Br.makeContextCurrent(i),u.useWebGL=t,Tr.moduleContextCreatedCallbacks.forEach((e=>e())),Tr.init()),o):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){Tr.lockPointer=e,Tr.resizeCanvas=t,void 0===Tr.lockPointer&&(Tr.lockPointer=!0),void 0===Tr.resizeCanvas&&(Tr.resizeCanvas=!1);var r=u.canvas;function n(){Tr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=Tr.exitFullscreen,Tr.lockPointer&&r.requestPointerLock(),Tr.isFullscreen=!0,Tr.resizeCanvas?Tr.setFullscreenCanvasSize():Tr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Tr.resizeCanvas?Tr.setWindowedCanvasSize():Tr.updateCanvasDimensions(r)),u.onFullScreen&&u.onFullScreen(Tr.isFullscreen),u.onFullscreen&&u.onFullscreen(Tr.isFullscreen)}Tr.fullscreenHandlersInstalled||(Tr.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!!Tr.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===Tr.nextRAF)Tr.nextRAF=t+1e3/60;else for(;t+2>=Tr.nextRAF;)Tr.nextRAF+=1e3/60;var r=Math.max(Tr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,Tr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e,t){return kr(e,t)},safeRequestAnimationFrame:function(e){return Tr.requestAnimationFrame((()=>{xr(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(Tr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Tr.mouseMovementX=Tr.mouseMovementY=0:(Tr.mouseMovementX=Tr.getMovementX(e),Tr.mouseMovementY=Tr.getMovementY(e)),"undefined"!=typeof SDL?(Tr.mouseX=SDL.mouseX+Tr.mouseMovementX,Tr.mouseY=SDL.mouseY+Tr.mouseMovementY):(Tr.mouseX+=Tr.mouseMovementX,Tr.mouseY+=Tr.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)Tr.lastTouches[a.identifier]=l,Tr.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=Tr.touches[a.identifier];d||(d=l),Tr.lastTouches[a.identifier]=d,Tr.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,Tr.mouseMovementX=f-Tr.mouseX,Tr.mouseMovementY=p-Tr.mouseY,Tr.mouseX=f,Tr.mouseY=p}},resizeListeners:[],updateResizeListeners:function(){var e=u.canvas;Tr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize:function(e,t,r){var n=u.canvas;Tr.updateCanvasDimensions(n,e,t),r||Tr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=D[SDL.screen>>2];e|=8388608,L[SDL.screen>>2]=e}Tr.updateCanvasDimensions(u.canvas),Tr.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=D[SDL.screen>>2];e&=-8388609,L[SDL.screen>>2]=e}Tr.updateCanvasDimensions(u.canvas),Tr.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)}Tr.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"))))}},Ar={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){Ar.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return Ar.setErrorCode(12296),0;if(t)for(;;){var i=L[t>>2];if(12321==i){var a=L[t+4>>2];Ar.contextAttributes.alpha=a>0}else if(12325==i){var s=L[t+4>>2];Ar.contextAttributes.depth=s>0}else if(12326==i){var u=L[t+4>>2];Ar.contextAttributes.stencil=u>0}else if(12337==i){var c=L[t+4>>2];Ar.contextAttributes.antialias=c>0}else if(12338==i)c=L[t+4>>2],Ar.contextAttributes.antialias=1==c;else if(12544==i){var l=L[t+4>>2];Ar.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(L[o>>2]=1),r&&n>0&&(L[r>>2]=62002),Ar.setErrorCode(12288),1):(Ar.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 Lr(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function Dr(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function Rr(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var Br={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Br.lastError||(Br.lastError=e)},getNewId:function(e){for(var t=Br.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?L[n+4*i>>2]:-1;o+=Pe(L[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?Br.registerContext(r,t):0},registerContext:function(e,t){var r=Br.getNewId(Br.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Br.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Br.initExtensions(n),r},makeContextCurrent:function(e){return Br.currentContext=Br.contexts[e],u.ctx=Ou=Br.currentContext&&Br.currentContext.GLctx,!(e&&!Ou)},getContext:function(e){return Br.contexts[e]},deleteContext:function(e){Br.currentContext===Br.contexts[e]&&(Br.currentContext=null),"object"==typeof wu&&wu.removeAllHandlersOnTarget(Br.contexts[e].GLctx.canvas),Br.contexts[e]&&Br.contexts[e].GLctx.canvas&&(Br.contexts[e].GLctx.canvas.GLctxObject=void 0),Br.contexts[e]=null},initExtensions:function(e){if(e||(e=Br.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;Pr(t),qr(t),Fr(t),Lr(t),Dr(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")),Rr(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=P[e++];)t+=105!=r&t,Mr.push(105==r?L[t]:(106==r?B:I)[t++>>1]),++t;return Mr})(t,r);return se[e].apply(null,n)},Or=function(e){Ou.activeTexture(e)},jr=function(e,t){Ou.attachShader(Br.programs[e],Br.shaders[t])},Ur=function(e,t){Ou.beginQuery(e,Br.queries[t])},$r=function(e,t){Ou.disjointTimerQueryExt.beginQueryEXT(e,Br.queries[t])},Hr=function(e){Ou.beginTransformFeedback(e)},Nr=function(e,t,r){Ou.bindAttribLocation(Br.programs[e],t,Pe(r))},Vr=function(e,t){35051==e?Ou.currentPixelPackBufferBinding=t:35052==e&&(Ou.currentPixelUnpackBufferBinding=t),Ou.bindBuffer(e,Br.buffers[t])},zr=function(e,t,r){Ou.bindBufferBase(e,t,Br.buffers[r])},Wr=function(e,t,r,n,o){Ou.bindBufferRange(e,t,Br.buffers[r],n,o)},Gr=function(e,t){Ou.bindFramebuffer(e,Br.framebuffers[t])},Yr=function(e,t){Ou.bindRenderbuffer(e,Br.renderbuffers[t])},Xr=function(e,t){Ou.bindSampler(e,Br.samplers[t])},Zr=function(e,t){Ou.bindTexture(e,Br.textures[t])},Kr=function(e,t){Ou.bindTransformFeedback(e,Br.transformFeedbacks[t])};function Qr(e){Ou.bindVertexArray(Br.vaos[e])}var Jr=Qr,en=Qr,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){Br.currentContext.version>=2?r&&t?Ou.bufferData(e,P,n,r,t):Ou.bufferData(e,t,n):Ou.bufferData(e,r?P.subarray(r,r+t):t,n)},cn=function(e,t,r,n){Br.currentContext.version>=2?r&&Ou.bufferSubData(e,t,P,n,r):Ou.bufferSubData(e,t,P.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,L,r>>2)},mn=function(e,t,r){Ou.clearBufferuiv(e,t,D,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(Br.syncs[e],t,r)},wn=function(e,t,r,n){Ou.colorMask(!!e,!!t,!!r,!!n)},En=function(e){Ou.compileShader(Br.shaders[e])},_n=function(e,t,r,n,o,i,a,s){Br.currentContext.version>=2?Ou.currentPixelUnpackBufferBinding||!a?Ou.compressedTexImage2D(e,t,r,n,o,i,a,s):Ou.compressedTexImage2D(e,t,r,n,o,i,P,s,a):Ou.compressedTexImage2D(e,t,r,n,o,i,s?P.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,P,u,s)},Sn=function(e,t,r,n,o,i,a,s,u){Br.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,P,u,s):Ou.compressedTexSubImage2D(e,t,r,n,o,i,a,u?P.subarray(u,u+s):null)},xn=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,P,l,c)},kn=function(e,t,r,n,o){Ou.copyBufferSubData(e,t,r,n,o)},Tn=function(e,t,r,n,o,i,a,s){Ou.copyTexImage2D(e,t,r,n,o,i,a,s)},An=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=Br.getNewId(Br.programs),t=Ou.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,Br.programs[e]=t,e},Fn=function(e){var t=Br.getNewId(Br.shaders);return Br.shaders[t]=Ou.createShader(e),t},Ln=function(e){Ou.cullFace(e)},Dn=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.buffers[n];o&&(Ou.deleteBuffer(o),o.name=0,Br.buffers[n]=null,n==Ou.currentPixelPackBufferBinding&&(Ou.currentPixelPackBufferBinding=0),n==Ou.currentPixelUnpackBufferBinding&&(Ou.currentPixelUnpackBufferBinding=0))}},Rn=function(e,t){for(var r=0;r<e;++r){var n=L[t+4*r>>2],o=Br.framebuffers[n];o&&(Ou.deleteFramebuffer(o),o.name=0,Br.framebuffers[n]=null)}},Bn=function(e){if(e){var t=Br.programs[e];t?(Ou.deleteProgram(t),t.name=0,Br.programs[e]=null):Br.recordError(1281)}},Mn=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.queries[n];o&&(Ou.deleteQuery(o),Br.queries[n]=null)}},In=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.queries[n];o&&(Ou.disjointTimerQueryExt.deleteQueryEXT(o),Br.queries[n]=null)}},On=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.renderbuffers[n];o&&(Ou.deleteRenderbuffer(o),o.name=0,Br.renderbuffers[n]=null)}},jn=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.samplers[n];o&&(Ou.deleteSampler(o),o.name=0,Br.samplers[n]=null)}},Un=function(e){if(e){var t=Br.shaders[e];t?(Ou.deleteShader(t),Br.shaders[e]=null):Br.recordError(1281)}},$n=function(e){if(e){var t=Br.syncs[e];t?(Ou.deleteSync(t),t.name=0,Br.syncs[e]=null):Br.recordError(1281)}},Hn=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.textures[n];o&&(Ou.deleteTexture(o),o.name=0,Br.textures[n]=null)}},Nn=function(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2],o=Br.transformFeedbacks[n];o&&(Ou.deleteTransformFeedback(o),o.name=0,Br.transformFeedbacks[n]=null)}};function Vn(e,t){for(var r=0;r<e;r++){var n=L[t+4*r>>2];Ou.deleteVertexArray(Br.vaos[n]),Br.vaos[n]=null}}var zn=Vn,Wn=Vn,Gn=function(e){Ou.depthFunc(e)},Yn=function(e){Ou.depthMask(!!e)},Xn=function(e,t){Ou.depthRange(e,t)},Zn=function(e,t){Ou.detachShader(Br.programs[e],Br.shaders[t])},Kn=function(e){Ou.disable(e)},Qn=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]=L[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)},xo=function(e){Ou.endQuery(e)},ko=function(e){Ou.disjointTimerQueryExt.endQueryEXT(e)},To=function(){Ou.endTransformFeedback()},Ao=function(e,t){var r=Ou.fenceSync(e,t);if(r){var n=Br.getNewId(Br.syncs);return r.name=n,Br.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,Br.renderbuffers[n])},Lo=function(e,t,r,n,o){Ou.framebufferTexture2D(e,t,r,Br.textures[n],o)},Do=function(e,t,r,n,o){Ou.framebufferTextureLayer(e,t,Br.textures[r],n,o)},Ro=function(e){Ou.frontFace(e)};function Bo(e,t,r,n){for(var o=0;o<e;o++){var i=Ou[r](),a=i&&Br.getNewId(n);i?(i.name=a,n[a]=i):Br.recordError(1282),L[t+4*o>>2]=a}}var Mo=function(e,t){Bo(e,t,"createBuffer",Br.buffers)},Io=function(e,t){Bo(e,t,"createFramebuffer",Br.framebuffers)},Oo=function(e,t){Bo(e,t,"createQuery",Br.queries)},jo=function(e,t){for(var r=0;r<e;r++){var n=Ou.disjointTimerQueryExt.createQueryEXT();if(!n){for(Br.recordError(1282);r<e;)L[t+4*r++>>2]=0;return}var o=Br.getNewId(Br.queries);n.name=o,Br.queries[o]=n,L[t+4*r>>2]=o}},Uo=function(e,t){Bo(e,t,"createRenderbuffer",Br.renderbuffers)},$o=function(e,t){Bo(e,t,"createSampler",Br.samplers)},Ho=function(e,t){Bo(e,t,"createTexture",Br.textures)},No=function(e,t){Bo(e,t,"createTransformFeedback",Br.transformFeedbacks)};function Vo(e,t){Bo(e,t,"createVertexArray",Br.vaos)}var zo=Vo,Wo=Vo,Go=function(e){Ou.generateMipmap(e)};function Yo(e,t,r,n,o,i,a,s){t=Br.programs[t];var u=Ou[e](t,r);if(u){var c=s&&Qt(u.name,s,n);o&&(L[o>>2]=c),i&&(L[i>>2]=u.size),a&&(L[a>>2]=u.type)}}var Xo=function(e,t,r,n,o,i,a){Yo("getActiveAttrib",e,t,r,n,o,i,a)},Zo=function(e,t,r,n,o,i,a){Yo("getActiveUniform",e,t,r,n,o,i,a)},Ko=function(e,t,r,n,o){e=Br.programs[e];var i=Ou.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=Qt(i,o,r);n&&(L[n>>2]=a)}else n&&(L[n>>2]=0)},Qo=function(e,t,r,n){if(n)if(e=Br.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++)L[n+4*i>>2]=o[i];else L[n>>2]=o}else{var a=Ou.getActiveUniformBlockName(e,t);L[n>>2]=a.length+1}else Br.recordError(1281)},Jo=function(e,t,r,n,o){if(o)if(t>0&&0==r)Br.recordError(1281);else{e=Br.programs[e];for(var i=[],a=0;a<t;a++)i.push(L[r+4*a>>2]);var s=Ou.getActiveUniforms(e,i,n);if(s){var u=s.length;for(a=0;a<u;a++)L[o+4*a>>2]=s[a]}}else Br.recordError(1281)},ei=function(e,t,r,n){var o=Ou.getAttachedShaders(Br.programs[e]),i=o.length;i>t&&(i=t),L[r>>2]=i;for(var a=0;a<i;++a){var s=Br.shaders.indexOf(o[a]);L[n+4*a>>2]=s}},ti=function(e,t){return Ou.getAttribLocation(Br.programs[e],Pe(t))};function ri(e,t){D[e>>2]=t,D[e+4>>2]=(t-D[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&&Br.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(Br.currentContext.version<2)return void Br.recordError(1282);n=2*(Ou.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(Br.currentContext.version<2)return void Br.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 Br.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 Br.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:L[t+4*a>>2]=i[a];break;case 2:R[t+4*a>>2]=i[a];break;case 4:A[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return Br.recordError(1280),void C("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Br.recordError(1280),void C("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:L[t>>2]=n;break;case 2:R[t>>2]=n;break;case 4:A[t>>0]=n?1:0}}else Br.recordError(1281)}var oi=function(e,t){ni(e,t,4)},ii=function(e,t,r){r?ri(r,Ou.getBufferParameter(e,t)):Br.recordError(1281)},ai=function(e,t,r){r?L[r>>2]=Ou.getBufferParameter(e,t):Br.recordError(1281)},si=function(){var e=Ou.getError()||Br.lastError;return Br.lastError=0,e},ui=function(e,t){ni(e,t,2)},ci=function(e,t){return Ou.getFragDataLocation(Br.programs[e],Pe(t))},li=function(e,t,r,n){var o=Ou.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),L[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 Br.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void Br.recordError(1280);o=0|i.name}break;default:return void Br.recordError(1280)}switch(n){case 1:ri(r,o);break;case 0:L[r>>2]=o;break;case 2:R[r>>2]=o;break;case 4:A[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else Br.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)Br.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)L[o+4*a>>2]=i[a]}else Br.recordError(1281)},yi=function(e,t,r,n,o){Br.recordError(1282)},bi=function(e,t,r,n){var o=Ou.getProgramInfoLog(Br.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Qt(o,n,t):0;r&&(L[r>>2]=i)},vi=function(e,t,r){if(r)if(e>=Br.counter)Br.recordError(1281);else if(e=Br.programs[e],35716==t){var n=Ou.getProgramInfoLog(e);null===n&&(n="(unknown error)"),L[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);L[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);L[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);L[r>>2]=e.maxUniformBlockNameLength}else L[r>>2]=Ou.getProgramParameter(e,t);else Br.recordError(1281)};function wi(e,t,r){if(r){var n,o=Br.queries[e];ri(r,"boolean"==typeof(n=Br.currentContext.version<2?Ou.disjointTimerQueryExt.getQueryObjectEXT(o,t):Ou.getQueryParameter(o,t))?n?1:0:n)}else Br.recordError(1281)}var Ei=wi;function _i(e,t,r){if(r){var n,o=Br.queries[e],i=Ou.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,L[r>>2]=n}else Br.recordError(1281)}var Ci=_i,Si=wi,xi=function(e,t,r){if(r){var n,o=Br.queries[e],i=Ou.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,L[r>>2]=n}else Br.recordError(1281)},ki=_i,Ti=function(e,t,r){r?L[r>>2]=Ou.getQuery(e,t):Br.recordError(1281)},Ai=function(e,t,r){r?L[r>>2]=Ou.disjointTimerQueryExt.getQueryEXT(e,t):Br.recordError(1281)},Pi=function(e,t,r){r?L[r>>2]=Ou.getRenderbufferParameter(e,t):Br.recordError(1281)},qi=function(e,t,r){r?R[r>>2]=Ou.getSamplerParameter(Br.samplers[e],t):Br.recordError(1281)},Fi=function(e,t,r){r?L[r>>2]=Ou.getSamplerParameter(Br.samplers[e],t):Br.recordError(1281)},Li=function(e,t,r,n){var o=Ou.getShaderInfoLog(Br.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?Qt(o,n,t):0;r&&(L[r>>2]=i)},Di=function(e,t,r,n){var o=Ou.getShaderPrecisionFormat(e,t);L[r>>2]=o.rangeMin,L[r+4>>2]=o.rangeMax,L[n>>2]=o.precision},Ri=function(e,t,r,n){var o=Ou.getShaderSource(Br.shaders[e]);if(o){var i=t>0&&n?Qt(o,n,t):0;r&&(L[r>>2]=i)}},Bi=function(e,t,r){if(r)if(35716==t){var n=Ou.getShaderInfoLog(Br.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;L[r>>2]=o}else if(35720==t){var i=Ou.getShaderSource(Br.shaders[e]),a=i?i.length+1:0;L[r>>2]=a}else L[r>>2]=Ou.getShaderParameter(Br.shaders[e],t);else Br.recordError(1281)},Mi=function(e){var t=Br.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||Br.recordError(1280),t=n&&Er(n);break;case 7938:var o=Ou.getParameter(7938);o=Br.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:Br.recordError(1280)}Br.stringCache[e]=t}return t},Ii=function(e,t){if(Br.currentContext.version<2)return Br.recordError(1282),0;var r=Br.stringiCache[e];if(r)return t<0||t>=r.length?(Br.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=Br.stringiCache[e]=n,t<0||t>=r.length?(Br.recordError(1281),0):r[t]}return Br.recordError(1280),0},Oi=function(e,t,r,n,o){if(r<0)Br.recordError(1281);else if(o){var i=Ou.getSyncParameter(Br.syncs[e],t);null!==i&&(L[o>>2]=i,n&&(L[n>>2]=1))}else Br.recordError(1281)},ji=function(e,t,r){r?R[r>>2]=Ou.getTexParameter(e,t):Br.recordError(1281)},Ui=function(e,t,r){r?L[r>>2]=Ou.getTexParameter(e,t):Br.recordError(1281)},$i=function(e,t,r,n,o,i,a){e=Br.programs[e];var s=Ou.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Qt(s.name,a,r);n&&(L[n>>2]=u)}else n&&(L[n>>2]=0);o&&(L[o>>2]=s.size),i&&(L[i>>2]=s.type)}},Hi=function(e,t){return Ou.getUniformBlockIndex(Br.programs[e],Pe(t))},Ni=function(e,t,r,n){if(n)if(t>0&&(0==r||0==n))Br.recordError(1281);else{e=Br.programs[e];for(var o=[],i=0;i<t;i++)o.push(Pe(L[r+4*i>>2]));var a=Ou.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)L[n+4*i>>2]=a[i]}}else Br.recordError(1281)};function Vi(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function zi(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=Vi(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=Pe(t),e=Br.programs[e]){zi(e);var r=e.uniformLocsById,n=0,o=t,i=Vi(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 Br.recordError(1281);var s;return-1};function Gi(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}Br.recordError(1282)}function Yi(e,t,r,n){if(r){zi(e=Br.programs[e]);var o=Ou.getUniform(e,Gi(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:L[r>>2]=o;break;case 2:R[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:L[r+4*i>>2]=o[i];break;case 2:R[r+4*i>>2]=o[i]}}else Br.recordError(1281)}var Xi=function(e,t,r){Yi(e,t,r,2)},Zi=function(e,t,r){Yi(e,t,r,0)},Ki=function(e,t,r){Yi(e,t,r,0)};function Qi(e,t,r,n){if(r){var o=Ou.getVertexAttrib(e,t);if(34975==t)L[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:L[r>>2]=o;break;case 2:R[r>>2]=o;break;case 5:L[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:L[r+4*i>>2]=o[i];break;case 2:R[r+4*i>>2]=o[i];break;case 5:L[r+4*i>>2]=Math.fround(o[i])}}else Br.recordError(1281)}function Ji(e,t,r){Qi(e,t,r,0)}var ea=Ji,ta=Ji,ra=function(e,t,r){r?L[r>>2]=Ou.getVertexAttribOffset(e,t):Br.recordError(1281)},na=function(e,t,r){Qi(e,t,r,2)},oa=function(e,t,r){Qi(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]=L[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]=L[r+4*u>>2];Ou.invalidateSubFramebuffer(e,s,n,o,i,a)},ua=function(e){var t=Br.buffers[e];return t?Ou.isBuffer(t):0},ca=function(e){return Ou.isEnabled(e)},la=function(e){var t=Br.framebuffers[e];return t?Ou.isFramebuffer(t):0},da=function(e){return(e=Br.programs[e])?Ou.isProgram(e):0},fa=function(e){var t=Br.queries[e];return t?Ou.isQuery(t):0},pa=function(e){var t=Br.queries[e];return t?Ou.disjointTimerQueryExt.isQueryEXT(t):0},ha=function(e){var t=Br.renderbuffers[e];return t?Ou.isRenderbuffer(t):0},ma=function(e){var t=Br.samplers[e];return t?Ou.isSampler(t):0},ga=function(e){var t=Br.shaders[e];return t?Ou.isShader(t):0},ya=function(e){return Ou.isSync(Br.syncs[e])},ba=function(e){var t=Br.textures[e];return t?Ou.isTexture(t):0},va=function(e){return Ou.isTransformFeedback(Br.transformFeedbacks[e])};function wa(e){var t=Br.vaos[e];return t?Ou.isVertexArray(t):0}var Ea=wa,_a=wa,Ca=function(e){Ou.lineWidth(e)},Sa=function(e){e=Br.programs[e],Ou.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},xa=function(e,t,r,n,o,i){Ou.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,L,t>>2,L,r>>2,L,n>>2,D,o>>2,i)},ka=function(e,t,r,n,o,i,a,s){Ou.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,L,t>>2,r,L,n>>2,L,o>>2,L,i>>2,D,a>>2,s)},Ta=function(){Ou.pauseTransformFeedback()},Aa=function(e,t){3317==e&&(Br.unpackAlignment=t),Ou.pixelStorei(e,t)},Pa=function(e,t){Ou.polygonOffset(e,t)},qa=function(e,t,r,n){Br.recordError(1280)},Fa=function(e,t,r){Br.recordError(1280)},La=function(e,t){Ou.disjointTimerQueryExt.queryCounterEXT(Br.queries[e],t)},Da=function(e){Ou.readBuffer(e)};function Ra(e){return 0==(e-=5120)?A:1==e?P:2==e?q:4==e?L:6==e?R:5==e||28922==e||28520==e||30779==e||30782==e?D:F}function Ba(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Ma(e,t,r,n,o,i){var a=Ra(e),s=Ba(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,Br.unpackAlignment);return a.subarray(o>>s,o+l>>s)}var Ia=function(e,t,r,n,o,i,a){if(Br.currentContext.version>=2)if(Ou.currentPixelPackBufferBinding)Ou.readPixels(e,t,r,n,o,i,a);else{var s=Ra(i);Ou.readPixels(e,t,r,n,o,i,s,a>>Ba(s))}else{var u=Ma(i,o,r,n,a);u?Ou.readPixels(e,t,r,n,o,i,u):Br.recordError(1280)}},Oa=function(){},ja=function(e,t,r,n){Ou.renderbufferStorage(e,t,r,n)},Ua=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)},Na=function(e,t,r){Ou.samplerParameterf(Br.samplers[e],t,r)},Va=function(e,t,r){var n=R[r>>2];Ou.samplerParameterf(Br.samplers[e],t,n)},za=function(e,t,r){Ou.samplerParameteri(Br.samplers[e],t,r)},Wa=function(e,t,r){var n=L[r>>2];Ou.samplerParameteri(Br.samplers[e],t,n)},Ga=function(e,t,r,n){Ou.scissor(e,t,r,n)},Ya=function(e,t,r,n,o){Br.recordError(1280)},Xa=function(e,t,r,n){var o=Br.getSource(e,t,r,n);if(Br.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(Br.shaders[e],o)},Za=function(e,t,r){Ou.stencilFunc(e,t,r)},Ka=function(e,t,r,n){Ou.stencilFuncSeparate(e,t,r,n)},Qa=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(Br.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)),Br.currentContext.version>=2)if(Ou.currentPixelUnpackBufferBinding)Ou.texImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=Ra(s);Ou.texImage2D(e,t,r,n,o,i,a,s,c,u>>Ba(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=Ra(u);Ou.texImage3D(e,t,r,n,o,i,a,s,u,l,c>>Ba(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=L[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(Br.currentContext.version>=2&&36193==s&&(s=5131),Br.currentContext.version>=2)if(Ou.currentPixelUnpackBufferBinding)Ou.texSubImage2D(e,t,r,n,o,i,a,s,u);else if(u){var c=Ra(s);Ou.texSubImage2D(e,t,r,n,o,i,a,s,c,u>>Ba(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=Ra(c);Ou.texSubImage3D(e,t,r,n,o,i,a,s,u,c,d,l>>Ba(d))}else Ou.texSubImage3D(e,t,r,n,o,i,a,s,u,c,null)},fs=function(e,t,r,n){e=Br.programs[e];for(var o=[],i=0;i<t;i++)o.push(Pe(L[r+4*i>>2]));Ou.transformFeedbackVaryings(e,o,n)},ps=function(e,t){Ou.uniform1f(Gi(e),t)},hs=[],ms=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform1fv(Gi(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(Gi(e),n)}},gs=function(e,t){Ou.uniform1i(Gi(e),t)},ys=[],bs=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform1iv(Gi(e),L,r>>2,t);else{if(t<=288)for(var n=ys[t-1],o=0;o<t;++o)n[o]=L[r+4*o>>2];else n=L.subarray(r>>2,r+4*t>>2);Ou.uniform1iv(Gi(e),n)}},vs=function(e,t){Ou.uniform1ui(Gi(e),t)},ws=function(e,t,r){t&&Ou.uniform1uiv(Gi(e),D,r>>2,t)},Es=function(e,t,r){Ou.uniform2f(Gi(e),t,r)},_s=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform2fv(Gi(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(Gi(e),n)}},Cs=function(e,t,r){Ou.uniform2i(Gi(e),t,r)},Ss=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform2iv(Gi(e),L,r>>2,2*t);else{if(t<=144)for(var n=ys[2*t-1],o=0;o<2*t;o+=2)n[o]=L[r+4*o>>2],n[o+1]=L[r+(4*o+4)>>2];else n=L.subarray(r>>2,r+8*t>>2);Ou.uniform2iv(Gi(e),n)}},xs=function(e,t,r){Ou.uniform2ui(Gi(e),t,r)},ks=function(e,t,r){t&&Ou.uniform2uiv(Gi(e),D,r>>2,2*t)},Ts=function(e,t,r,n){Ou.uniform3f(Gi(e),t,r,n)},As=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform3fv(Gi(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(Gi(e),n)}},Ps=function(e,t,r,n){Ou.uniform3i(Gi(e),t,r,n)},qs=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform3iv(Gi(e),L,r>>2,3*t);else{if(t<=96)for(var n=ys[3*t-1],o=0;o<3*t;o+=3)n[o]=L[r+4*o>>2],n[o+1]=L[r+(4*o+4)>>2],n[o+2]=L[r+(4*o+8)>>2];else n=L.subarray(r>>2,r+12*t>>2);Ou.uniform3iv(Gi(e),n)}},Fs=function(e,t,r,n){Ou.uniform3ui(Gi(e),t,r,n)},Ls=function(e,t,r){t&&Ou.uniform3uiv(Gi(e),D,r>>2,3*t)},Ds=function(e,t,r,n,o){Ou.uniform4f(Gi(e),t,r,n,o)},Rs=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform4fv(Gi(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(Gi(e),n)}},Bs=function(e,t,r,n,o){Ou.uniform4i(Gi(e),t,r,n,o)},Ms=function(e,t,r){if(Br.currentContext.version>=2)t&&Ou.uniform4iv(Gi(e),L,r>>2,4*t);else{if(t<=72)for(var n=ys[4*t-1],o=0;o<4*t;o+=4)n[o]=L[r+4*o>>2],n[o+1]=L[r+(4*o+4)>>2],n[o+2]=L[r+(4*o+8)>>2],n[o+3]=L[r+(4*o+12)>>2];else n=L.subarray(r>>2,r+16*t>>2);Ou.uniform4iv(Gi(e),n)}},Is=function(e,t,r,n,o){Ou.uniform4ui(Gi(e),t,r,n,o)},Os=function(e,t,r){t&&Ou.uniform4uiv(Gi(e),D,r>>2,4*t)},js=function(e,t,r){e=Br.programs[e],Ou.uniformBlockBinding(e,t,r)},Us=function(e,t,r,n){if(Br.currentContext.version>=2)t&&Ou.uniformMatrix2fv(Gi(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(Gi(e),!!r,o)}},$s=function(e,t,r,n){t&&Ou.uniformMatrix2x3fv(Gi(e),!!r,R,n>>2,6*t)},Hs=function(e,t,r,n){t&&Ou.uniformMatrix2x4fv(Gi(e),!!r,R,n>>2,8*t)},Ns=function(e,t,r,n){if(Br.currentContext.version>=2)t&&Ou.uniformMatrix3fv(Gi(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(Gi(e),!!r,o)}},Vs=function(e,t,r,n){t&&Ou.uniformMatrix3x2fv(Gi(e),!!r,R,n>>2,6*t)},zs=function(e,t,r,n){t&&Ou.uniformMatrix3x4fv(Gi(e),!!r,R,n>>2,12*t)},Ws=function(e,t,r,n){if(Br.currentContext.version>=2)t&&Ou.uniformMatrix4fv(Gi(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(Gi(e),!!r,o)}},Gs=function(e,t,r,n){t&&Ou.uniformMatrix4x2fv(Gi(e),!!r,R,n>>2,8*t)},Ys=function(e,t,r,n){t&&Ou.uniformMatrix4x3fv(Gi(e),!!r,R,n>>2,12*t)},Xs=function(e){e=Br.programs[e],Ou.useProgram(e),Ou.currentProgram=e},Zs=function(e){Ou.validateProgram(Br.programs[e])},Ks=function(e,t){Ou.vertexAttrib1f(e,t)},Qs=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,L[t>>2],L[t+4>>2],L[t+8>>2],L[t+12>>2])},pu=function(e,t,r,n,o){Ou.vertexAttribI4ui(e,t,r,n,o)},hu=function(e,t){Ou.vertexAttribI4ui(e,D[t>>2],D[t+4>>2],D[t+8>>2],D[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(Br.syncs[e],t,r)},vu=e=>{var t=e-S.buffer.byteLength+65535>>>16;try{return S.grow(t),U(),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||(z.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?Pe(t):t,_u[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}var Su,xu,ku,Tu=function(e,t){var r=t>>2,n=L[r+6],o={alpha:!!L[r+0],depth:!!L[r+1],stencil:!!L[r+2],antialias:!!L[r+3],premultipliedAlpha:!!L[r+4],preserveDrawingBuffer:!!L[r+5],powerPreference:Eu[n],failIfMajorPerformanceCaveat:!!L[r+7],majorVersion:L[r+8],minorVersion:L[r+9],enableExtensionsByDefault:L[r+10],explicitSwapControl:L[r+11],proxyContextToMainThread:L[r+12],renderViaOffscreenBackBuffer:L[r+13]},i=function(e){return Cu(e)}(e);return i?o.explicitSwapControl?0:Br.createContext(i,o):0},Au={},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 Au)void 0===Au[t]?delete e[t]:e[t]=Au[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=D[t>>2],s=D[t+4>>2];t+=8;var u=Ae.read(e,A,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],Lu=[31,28,31,30,31,30,31,31,30,31,30,31],Du=(e,t)=>{A.set(e,t)},Ru=(e,t,r,n)=>{var o=L[n+40>>2],i={tm_sec:L[n>>2],tm_min:L[n+4>>2],tm_hour:L[n+8>>2],tm_mday:L[n+12>>2],tm_mon:L[n+16>>2],tm_year:L[n+20>>2],tm_wday:L[n+24>>2],tm_yday:L[n+28>>2],tm_isdst:L[n+32>>2],tm_gmtoff:L[n+36>>2],tm_zone:o?Pe(o):""},a=Pe(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:Lu)[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:Lu,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=_e(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(Du(y,e),y.length-1)},Bu=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ae.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Mu=365,Iu=146;Object.defineProperties(Bu.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 Ae.isDir(this.mode)}},isDevice:{get:function(){return Ae.isChrdev(this.mode)}}}),Ae.FSNode=Bu,Ae.createPreloadedFile=function(e,t,r,n,o,i,a,s,u,c){var d=t?ge.resolve(he.join2(e,t)):e;function f(r){function l(r){c&&c(),s||Ae.createDataFile(e,t,r,n,o,u),i&&i(),Q()}(function(e,t,r,n){void 0!==Tr&&Tr.init();var o=!1;return ke.forEach((function(i){o||i.canHandle(t)&&(i.handle(e,t,r,n),o=!0)})),o})(r,d,l,(()=>{a&&a(),Q()}))||l(r)}K(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;l(e,(r=>{j(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&Q()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&K()})(r,(e=>f(e)),a):f(r)},Ae.staticInit(),u.FS_createPath=Ae.createPath,u.FS_createDataFile=Ae.createDataFile,u.FS_createPreloadedFile=Ae.createPreloadedFile,u.FS_unlink=Ae.unlink,u.FS_createLazyFile=Ae.createLazyFile,u.FS_createDevice=Ae.createDevice,Ie=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);He=e}(),Ve=u.BindingError=class BindingError extends Error{constructor(e){super(e),this.name="BindingError"}},bt.prototype.isAliasOf=Xe,bt.prototype.clone=ht,bt.prototype.delete=mt,bt.prototype.isDeleted=gt,bt.prototype.deleteLater=yt,u.getInheritedInstanceCount=rt,u.getLiveInheritedInstances=ot,u.flushPendingDeletes=at,u.setDelayFunction=ut,Dt.prototype.getPointee=qt,Dt.prototype.destructor=Ft,Dt.prototype.argPackAdvance=8,Dt.prototype.readValueFromPointer=De,Dt.prototype.deleteObject=Lt,Dt.prototype.fromWireType=ft,Ot=u.UnboundTypeError=(Su=Error,(ku=_t(xu="UnboundTypeError",(function(e){this.name=xu,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),ku.prototype.constructor=ku,ku.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},ku),Object.assign(Vt.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)}}),zt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),zt.reserved=zt.allocated.length,u.count_emval_handles=Gt,u.requestFullscreen=function(e,t){Tr.requestFullscreen(e,t)},u.requestAnimationFrame=function(e){Tr.requestAnimationFrame(e)},u.setCanvasSize=function(e,t,r){Tr.setCanvasSize(e,t,r)},u.pauseMainLoop=function(){Tr.mainLoop.pause()},u.resumeMainLoop=function(){Tr.mainLoop.resume()},u.getUserMedia=function(){Tr.getUserMedia()},u.createContext=function(e,t,r,n){return Tr.createContext(e,t,r,n)};for(var Ou,ju={},Uu={},$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 Nu=new Int32Array(288);for($u=0;$u<288;++$u)ys[$u]=Nu.subarray(0,$u+1);var Vu,zu={Ha:function(e){var t=new fe(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),le.push(t),ic(t.excPtr),t.get_exception_ptr()},Ga:function(){ec(0,0);var e=le.pop();oc(e.excPtr),de=0},o:()=>pe([]),aa:e=>pe([e]),k:function(e,t,r){throw new fe(e).init(t,r),de=e},M:function(e){throw de||(de=e),de},da:function(e,t,r){qe.varargs=r;try{var n=qe.getStreamFromFD(e);switch(t){case 0:return(o=qe.get())<0?-28:Ae.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=qe.get();return n.flags|=o,0;case 5:return o=qe.get(),q[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,L[Yu()>>2]=i,-1}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}var i},yb:function(e,t){try{var r=qe.getStreamFromFD(e);return qe.doStat(Ae.stat,r.path,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},Db:function(e,t,r){qe.varargs=r;try{var n=qe.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=qe.get();L[i>>2]=o.c_iflag||0,L[i+4>>2]=o.c_oflag||0,L[i+8>>2]=o.c_cflag||0,L[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)A[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=qe.get();var s=L[i>>2],u=L[i+4>>2],c=L[i+8>>2],l=L[i+12>>2],d=[];for(a=0;a<32;a++)d.push(A[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=qe.get(),L[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=qe.get(),Ae.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=qe.get(),q[i>>1]=f[0],q[i+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},vb:function(e,t){try{return e=qe.getStr(e),qe.doStat(Ae.lstat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},wb:function(e,t,r,n){try{t=qe.getStr(t);var o=256&n,i=4096&n;return n&=-6401,t=qe.calculateAt(e,t,i),qe.doStat(o?Ae.lstat:Ae.stat,t,r)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},qa:function(e,t,r,n){qe.varargs=n;try{t=qe.getStr(t),t=qe.calculateAt(e,t);var o=n?qe.get():0;return Ae.open(t,r,o).fd}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},xb:function(e,t){try{return e=qe.getStr(e),qe.doStat(Ae.stat,e,t)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ua:function(e){var t=Fe[e];delete Fe[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;je([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)),Le(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:De,destructorFunction:a}]}))},y:function(e){var t=Ue[e];delete Ue[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;je([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)),Le(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:De,destructorFunction:n}]}))},ya:function(e,t,r,n,o){t=Ne(t);var i=Ye(r),a=-1!=t.indexOf("u");a&&(o=(1n<<64n)-1n),We(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r&&"number"!=typeof r)throw new TypeError(`Cannot convert "${$e(r)}" to ${this.name}`);if(r<n||r>o)throw new TypeError(`Passing a number "${$e(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:Ge(t,i,!a),destructorFunction:null})},je:function(e,t,r,n,o){var i=Ye(r);We(e,{name:t=Ne(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=A;else if(2===r)n=q;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=L}return this.fromWireType(n[e>>i])},destructorFunction:null})},v:function(e,t,r,n,o,i,a,s,u,c,l,d,f){l=Ne(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(){Ut(`Cannot construct ${l} due to unbound types`,[n])})),je([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 Ve("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Ve(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Ve(`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 xt(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 Dt(l,d,!0,!1,!1),m=new Dt(l+"*",d,!1,!1,!1),g=new Dt(l+" const*",d,!1,!0,!1);return tt[e]={pointerType:m,constPointerType:g},Rt(p,a),[h,m,g]}))},w:function(e,t,r,n,o,i){var a=$t(t,r);o=It(n,o),je([],[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 Ve(`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]=()=>{Ut(`Cannot construct ${e.name} due to unbound types`,a)},je([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Nt(r,n,null,o,i),[]})),[]}))},d:function(e,t,r,n,o,i,a,s,u){var c=$t(r,n);t=Ne(t),i=It(o,i),je([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){Ut(`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),je([],c,(function(o){var s=Nt(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,[]})),[]}))},ie:function(e,t){We(e,{name:t=Ne(t),fromWireType:function(e){var t=Yt.toValue(e);return Wt(e),t},toWireType:function(e,t){return Yt.toHandle(t)},argPackAdvance:8,readValueFromPointer:De,destructorFunction:null})},V:function(e,t,r,n){var o=Ye(r);function i(){}t=Ne(t),i.values={},We(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)},A:function(e,t,r){var n=Zt(e,"enum");t=Ne(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},xa:function(e,t,r){var n=Ye(r);We(e,{name:t=Ne(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Kt(t,n),destructorFunction:null})},L:function(e,t,r,n,o,i,a){var s=$t(t,r);e=Ne(e),o=It(n,o),St(e,(function(){Ut(`Cannot call ${e} due to unbound types`,s)}),t-1),je([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return Rt(e,Nt(e,n,null,o,i,a),t-1),[]}))},R:function(e,t,r,n,o){t=Ne(t),-1===o&&(o=4294967295);var i=Ye(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var u=t.includes("unsigned");We(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:Ge(t,i,0!==n),destructorFunction:null})},D:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=D,r=t[e>>=2],o=t[e+1];return new n(t.buffer,o,r)}We(e,{name:r=Ne(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ge:function(e,t,r,n,o,i,a,s,u,c,l,d){r=Ne(r),i=It(o,i),s=It(a,s),c=It(u,c),d=It(l,d),je([e],[t],(function(e){return e=e[0],[new Dt(r,e.registeredClass,!1,!1,!0,e,n,i,s,c,d)]}))},wa:function(e,t){var r="std::string"===(t=Ne(t));We(e,{name:t,fromWireType:function(e){var t,n=D[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==P[s]){var u=Pe(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(P[o+a]);t=c.join("")}return Gu(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||ze("Cannot pass non-string to std::string"),n=r&&o?we(t):t.length;var i=Wu(4+n+1),a=i+4;if(D[i>>2]=n,r&&o)Qt(t,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(Gu(a),ze("String has UTF-16 code units that do not fit in 8 bits")),P[a+s]=u}else for(s=0;s<n;++s)P[a+s]=t[s];return null!==e&&e.push(Gu,i),i},argPackAdvance:8,readValueFromPointer:De,destructorFunction:function(e){Gu(e)}})},fa:function(e,t,r){var n,o,i,a,s;r=Ne(r),2===t?(n=er,o=tr,a=rr,i=()=>F,s=1):4===t&&(n=nr,o=or,a=ir,i=()=>D,s=2),We(e,{name:r,fromWireType:function(e){for(var r,o=D[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 Gu(e),r},toWireType:function(e,n){"string"!=typeof n&&ze(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=Wu(4+i+t);return D[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(Gu,u),u},argPackAdvance:8,readValueFromPointer:De,destructorFunction:function(e){Gu(e)}})},va:function(e,t,r,n,o,i){Fe[e]={name:Ne(t),rawConstructor:It(r,n),rawDestructor:It(o,i),elements:[]}},Q:function(e,t,r,n,o,i,a,s,u){Fe[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){Ue[e]={name:Ne(t),rawConstructor:It(r,n),rawDestructor:It(o,i),fields:[]}},n:function(e,t,r,n,o,i,a,s,u,c){Ue[e].fields.push({fieldName:Ne(t),getterReturnType:r,getter:It(n,o),getterContext:i,setterArgumentType:a,setter:It(s,u),setterContext:c})},ke:function(e,t){We(e,{isVoid:!0,name:t=Ne(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},Bb:()=>!0,hb:()=>{throw 1/0},j:function(e,t,r){e=Yt.toValue(e),t=Zt(t,"emval::as");var n=[],o=Yt.toHandle(n);return D[r>>2]=o,t.toWireType(n,e)},u: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 D[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,de:function(e,t){return(e=Yt.toValue(e))==(t=Yt.toValue(t))},F: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&&(zt.get(e).refcount+=1)},$:function(e,t){return(e=Yt.toValue(e))instanceof(t=Yt.toValue(t))},ea:function(e){return"number"==typeof(e=Yt.toValue(e))},N:function(e){return"string"==typeof(e=Yt.toValue(e))},ze: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)(Zt,u,Yt.toHandle,(()=>D))}(t),fr[t]=o),o(e,r,n)},I:function(){return Yt.toHandle([])},g:function(e){return Yt.toHandle(ur(e))},C:function(){return Yt.toHandle({})},i:function(e){Le(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=Zt(e,"_emval_take_value")).readValueFromPointer(t);return Yt.toHandle(r)},se:function(e){throw e=Yt.toValue(e)},Oc:function(e){return e=Yt.toValue(e),Yt.toHandle(typeof e)},pb:function(e,t){e=mr(e),t=mr(t);var r=new Date(1e3*e);L[t>>2]=r.getUTCSeconds(),L[t+4>>2]=r.getUTCMinutes(),L[t+8>>2]=r.getUTCHours(),L[t+12>>2]=r.getUTCDate(),L[t+16>>2]=r.getUTCMonth(),L[t+20>>2]=r.getUTCFullYear()-1900,L[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;L[t+28>>2]=o},qb:function(e,t){e=mr(e),t=mr(t);var r=new Date(1e3*e);L[t>>2]=r.getSeconds(),L[t+4>>2]=r.getMinutes(),L[t+8>>2]=r.getHours(),L[t+12>>2]=r.getDate(),L[t+16>>2]=r.getMonth(),L[t+20>>2]=r.getFullYear()-1900,L[t+24>>2]=r.getDay();var n=0|wr(r);L[t+28>>2]=n,L[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));L[t+32>>2]=s},rb:function(e){e=mr(e);var t=(()=>{var t=new Date(L[e+20>>2]+1900,L[e+16>>2],L[e+12>>2],L[e+8>>2],L[e+4>>2],L[e>>2],0),r=L[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)L[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))}L[e+24>>2]=t.getDay();var l=0|wr(t);return L[e+28>>2]=l,L[e>>2]=t.getSeconds(),L[e+4>>2]=t.getMinutes(),L[e+8>>2]=t.getHours(),L[e+12>>2]=t.getDate(),L[e+16>>2]=t.getMonth(),L[e+20>>2]=t.getYear(),t.getTime()/1e3})();return BigInt(t)},mb: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=qe.getStreamFromFD(n),u=Ae.mmap(s,e,o,t,r),c=u.ptr;return L[i>>2]=u.allocated,D[a>>2]=c,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},nb:function(e,t,r,n,o,i){e=mr(e),t=mr(t),i=mr(i);try{if(isNaN(i))return 61;var a=qe.getStreamFromFD(o);2&r&&qe.doMsync(e,a,t,n,i),Ae.munmap(a)}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return-e.errno}},ib:(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"}D[e>>2]=60*u,L[t>>2]=Number(a!=s);var l=c(o),d=c(i),f=Er(l),p=Er(d);s<a?(D[r>>2]=f,D[r+4>>2]=p):(D[r>>2]=p,D[r+4>>2]=f)},b:()=>{J("")},oa:function(e,t,r,n,o){return Ar.chooseConfig(e,t,r,n,o)},pa:function(e,t,r,n){if(62e3!=e)return Ar.setErrorCode(12296),0;for(var o=1;;){var i=L[n>>2];if(12440!=i){if(12344==i)break;return Ar.setErrorCode(12292),0}o=L[n+4>>2],n+=8}return o<2||o>3?(Ar.setErrorCode(12293),0):(Ar.contextAttributes.majorVersion=o-1,Ar.contextAttributes.minorVersion=0,Ar.context=Br.createContext(u.canvas,Ar.contextAttributes),0!=Ar.context?(Ar.setErrorCode(12288),Br.makeContextCurrent(Ar.context),u.useWebGL=!0,Tr.moduleContextCreatedCallbacks.forEach((function(e){e()})),Br.makeContextCurrent(null),62004):(Ar.setErrorCode(12297),0))},$a:function(e,t,r,n){return 62e3!=e?(Ar.setErrorCode(12296),0):62002!=t?(Ar.setErrorCode(12293),0):(Ar.setErrorCode(12288),62006)},ic:function(e,t){return 62e3!=e?(Ar.setErrorCode(12296),0):62004!=t?(Ar.setErrorCode(12294),0):(Br.deleteContext(Ar.context),Ar.setErrorCode(12288),Ar.currentContext==t&&(Ar.currentContext=0),1)},Zb:function(e,t){return 62e3!=e?(Ar.setErrorCode(12296),0):62006!=t?(Ar.setErrorCode(12301),1):(Ar.currentReadSurface==t&&(Ar.currentReadSurface=0),Ar.currentDrawSurface==t&&(Ar.currentDrawSurface=0),Ar.setErrorCode(12288),1)},T:function(e,t,r,n){if(62e3!=e)return Ar.setErrorCode(12296),0;if(62002!=t)return Ar.setErrorCode(12293),0;if(!n)return Ar.setErrorCode(12300),0;switch(Ar.setErrorCode(12288),r){case 12320:return L[n>>2]=Ar.contextAttributes.alpha?32:24,1;case 12321:return L[n>>2]=Ar.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return L[n>>2]=8,1;case 12325:return L[n>>2]=Ar.contextAttributes.depth?24:0,1;case 12326:return L[n>>2]=Ar.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return L[n>>2]=12344,1;case 12328:return L[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return L[n>>2]=0,1;case 12330:case 12332:return L[n>>2]=4096,1;case 12331:return L[n>>2]=16777216,1;case 12337:return L[n>>2]=Ar.contextAttributes.antialias?4:0,1;case 12338:return L[n>>2]=Ar.contextAttributes.antialias?1:0,1;case 12339:case 12352:return L[n>>2]=4,1;case 12341:case 12342:case 12343:return L[n>>2]=-1,1;case 12348:return L[n>>2]=1,1;case 12351:return L[n>>2]=12430,1;default:return Ar.setErrorCode(12292),0}},ob:function(e){return Ar.setErrorCode(12288),62e3},ta:function(){return Ar.errorCode},eb:function(e,t,r){return 62e3!=e?(Ar.setErrorCode(12296),0):(t&&(L[t>>2]=1),r&&(L[r>>2]=4),Ar.defaultDisplayInitialized=!0,Ar.setErrorCode(12288),1)},zb:function(e,t,r,n){return 62e3!=e?(Ar.setErrorCode(12296),0):0!=n&&62004!=n?(Ar.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(Ar.setErrorCode(12301),0):(Br.makeContextCurrent(n?Ar.context:null),Ar.currentContext=n,Ar.currentDrawSurface=t,Ar.currentReadSurface=r,Ar.setErrorCode(12288),1)},tc:function(e,t){if(Ar.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return Ar.setErrorCode(12288),1;Ar.setErrorCode(12302)}else Ar.setErrorCode(12290);else Ar.setErrorCode(12289);return 0},Ob:function(e){return 62e3!=e?(Ar.setErrorCode(12296),0):(Ar.currentContext=0,Ar.currentReadSurface=0,Ar.currentDrawSurface=0,Ar.defaultDisplayInitialized=!1,Ar.setErrorCode(12288),1)},K:(e,t,r)=>Ir(e,t,r),we:e=>{console.error(Pe(e))},xe:e=>{console.log(Pe(e))},ha:e=>{console.warn(Pe(e))},ba:function(){return Date.now()},me:function(){},jb:()=>2147483648,Ab:gr,Wf:Or,Xf:jr,Yc:Ur,ee:$r,Kc:Hr,Yf:Nr,Zf:Vr,Hc:zr,Ic:Wr,Ye:Gr,Ze:Yr,Ie:Xr,_f:Zr,Vb:Kr,sf:Jr,vf:en,$f:tn,ag:rn,Sd:nn,bg:on,Rd:an,Se:sn,cg:un,dg:cn,_e:ln,eg:dn,kc:fn,lc:pn,nc:hn,mc:mn,fg:gn,Qd:yn,gg:bn,Da:vn,hg:wn,ig:En,jg:_n,bd:Cn,kg:Sn,ad:xn,Qe:kn,Pd:Tn,lg:An,cd:Pn,mg:qn,ng:Fn,og:Ln,pg:Dn,$e:Rn,qg:Bn,_c:Mn,ge:In,af:On,Je:jn,rg:Un,Re:$n,sg:Hn,Ub:Nn,tf:zn,wf:Wn,Od:Gn,tg:Yn,Nd:Xn,Md:Zn,ug:Kn,vg:Qn,wg:Jn,qf:to,Vd:ro,Gb:no,of:oo,hd:io,Hb:ao,mf:co,fd:lo,Wd:fo,xg:ho,rf:go,Ud:yo,Eb:bo,pf:vo,Fb:wo,gd:Eo,ff:_o,yg:Co,zg:So,Xc:xo,ce:ko,Jc:To,Oe:Ao,Ag:Po,Bg:qo,bf:Fo,cf:Lo,Nc:Do,Cg:Ro,Dg:Mo,df:Io,$c:Oo,he:jo,ef:Uo,Ke:$o,Eg:Ho,Tb:No,uf:zo,xf:Wo,Ue:Go,Ld:Xo,Kd:Zo,ec:Ko,fc:Qo,hc:Jo,Jd:ei,Id:ti,Hd:oi,$b:ii,Fg:ai,Gg:si,Hg:ui,xc:ci,Ve:li,ac:fi,cc:pi,Lc:hi,gh:mi,Kb:gi,Pb:yi,Ig:bi,Jg:vi,Zd:Ei,$d:Ci,Yd:Si,Vc:xi,_d:ki,Wc:Ti,ae:Ai,We:Pi,Wb:qi,Xb:Fi,Kg:Li,Ee:Di,Gd:Ri,Lg:Bi,Ca:Mi,hh:Ii,bc:Oi,Fd:ji,Ed:Ui,Fc:$i,gc:Hi,jc:Ni,Mg:Wi,Dd:Xi,Cd:Zi,yc:Ki,Ec:ea,Dc:ta,zd:ra,Bd:na,Ad:oa,yd:ia,Fe:aa,He:sa,xd:ua,wd:ca,vd:la,ud:da,Zc:fa,fe:pa,td:ha,_b:ma,sd:ga,Pe:ya,Ng:ba,Sb:va,Mc:Ea,Xd:_a,Og:Ca,Pg:Sa,kf:xa,lf:ka,Rb:Ta,Qg:Aa,rd:Pa,Nb:qa,Mb:Fa,be:La,nf:Da,Rg:Ia,qd:Oa,Xe:ja,Te:Ua,Qb:$a,pd:Ha,Le:Na,Yb:Va,Me:za,Ne:Wa,Sg:Ga,od:Ya,Tg:Xa,Ug:Za,Vg:Ka,Wg:Qa,Xg:Ja,Yg:es,Zg:ts,_g:rs,ed:ns,$g:os,ah:is,bh:as,ch:ss,gf:us,Lb:cs,dh:ls,dd:ds,Gc:fs,eh:ps,fh:ms,Sf:gs,Tf:bs,wc:vs,rc:ws,Uf:Es,Vf:_s,Rf:Cs,Qf:Ss,vc:xs,qc:ks,Pf:Ts,Of:As,Nf:Ps,Mf:qs,uc:Fs,pc:Ls,Lf:Ds,Kf:Rs,yf:Bs,zf:Ms,sc:Is,oc:Os,dc:js,Af:Us,Uc:$s,Sc:Hs,Bf:Ns,Tc:Vs,Qc:zs,Cf:Ws,Rc:Gs,Pc:Ys,Df:Xs,nd:Zs,Ef:Ks,md:Qs,ld:Js,Ff:eu,kd:tu,Gf:ru,jd:nu,Hf:ou,hf:au,Td:su,Ib:uu,id:cu,Jb:lu,Cc:du,Ac:fu,Bc:pu,zc:hu,jf:mu,If:gu,Jf:yu,Ea:bu,Cb:(e,t,r)=>P.copyWithin(e,t,t+r),kb:e=>{var t=P.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},Va: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})},Ma: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})},_a: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})},Qa: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})},Ra: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})},Ia: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})},Ua: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)}},La: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)},Ya: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)}},Pa: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)},Ka: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()},Oa: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++},Ja:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Na:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Ta: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},ka:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},la: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},Sa:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},Xa: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},Wa:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Za: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]=Br.textures[o[e]]},qe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},ga:function(e,t,r,n){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,n)},ue:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ve: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},ne: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},pe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},oe:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},za: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},re: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},bb:function(){return!!u.emscripten_ubq_settings_forceWebGL1},na:Tu,ma:function(e){Br.currentContext==e&&(Br.currentContext=0),Br.deleteContext(e)},cb:function(e,t){var r=Br.getContext(e),n=Pe(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&&Lr(Ou),"WEBGL_multi_draw_instanced_base_vertex_base_instance"==n&&Dr(Ou),"WEBGL_multi_draw"==n&&Rr(Ou),!!r.GLctx.getExtension(n)},ab:function(e){for(var t=e>>2,r=0;r<14;++r)L[t+r]=0;L[t+0]=L[t+1]=L[t+3]=L[t+4]=L[t+8]=L[t+10]=1},db:function(e){return Br.makeContextCurrent(e)?0:-5},tb:(e,t)=>{var r=0;return Pu().forEach((function(n,o){var i=t+r;D[e+4*o>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)A[t++>>0]=e.charCodeAt(r);A[t>>0]=0})(n,i),r+=n.length+1})),0},ub:(e,t)=>{var r=Pu();D[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),D[t>>2]=n,0},ye:Sr,ca:function(e){try{var t=qe.getStreamFromFD(e);return Ae.close(t),0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},lb: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=qe.getStreamFromFD(e),a=qu(i,t,r,n);return D[o>>2]=a,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sa:function(e,t,r,n){try{var o=qe.getStreamFromFD(e),i=qu(o,t,r);return D[n>>2]=i,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},sb:function(e,t,r,n){t=mr(t),n=mr(n);try{if(isNaN(t))return 61;var o=qe.getStreamFromFD(e);return Ae.llseek(o,t,r),B[n>>3]=BigInt(o.position),o.getdents&&0===t&&0===r&&(o.getdents=null),0}catch(e){if(void 0===Ae||"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=D[t>>2],s=D[t+4>>2];t+=8;var u=Ae.write(e,A,a,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(qe.getStreamFromFD(e),t,r);return D[n>>2]=o,0}catch(e){if(void 0===Ae||"ErrnoError"!==e.name)throw e;return e.errno}},le:function(){return"undefined"!=typeof window?Er(window.location.hostname):Er("")},fb:(e,t)=>(me(P.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)}},H: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)}},Fa:function(e){var t=tc();try{return Mt(e)()}catch(e){if(rc(t),e!==e+0)throw e;ec(1,0)}},ia: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)}},W: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)}},s: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)}},De: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)}},Ba: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)}},Aa: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)}},t:function(e,t){var r=tc();try{Mt(e)(t)}catch(e){if(rc(r),e!==e+0)throw e;ec(1,0)}},B: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)}},G: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)}},E: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)}},Ce: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)}},Ae: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)}},ih: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)}},Be: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)}},ja:function(e,t){const r=Yt.toValue(t),n=u.ctx;n.bindTexture(n.TEXTURE_2D,Br.textures[e]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r)},a:S,gb:(e,t,r,n,o)=>Ru(e,t,r,n)},Wu=(function(){var e,t,r,o,i={a:zu};function a(e,t){var r,n=e.exports;return $=(x=n).lh,r=x.jh,V.unshift(r),Q(),n}if(K(),u.instantiateWasm)try{return u.instantiateWasm(i,a)}catch(e){C("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=E,t=ee,r=i,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||ne(t)||y||"function"!=typeof fetch?ae(t,r,o):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return C("wasm streaming compile failed: "+e),C("falling back to ArrayBuffer instantiation"),ae(t,r,o)}))))).catch(n)}(),u._malloc=e=>(Wu=u._malloc=x.kh)(e)),Gu=u._free=e=>(Gu=u._free=x.mh)(e),Yu=()=>(Yu=x.nh)(),Xu=(u._ma_malloc_emscripten=(e,t)=>(u._ma_malloc_emscripten=x.oh)(e,t),u._ma_free_emscripten=(e,t)=>(u._ma_free_emscripten=x.ph)(e,t),u._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Xu=u._ma_device_process_pcm_frames_capture__webaudio=x.qh)(e,t,r)),Zu=u._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Zu=u._ma_device_process_pcm_frames_playback__webaudio=x.rh)(e,t,r),Ku=e=>(Ku=x.sh)(e),Qu=e=>(Qu=x.th)(e),Ju=(u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=x.uh)(),(e,t)=>(Ju=x.vh)(e,t)),ec=(e,t)=>(ec=x.wh)(e,t),tc=()=>(tc=x.xh)(),rc=e=>(rc=x.yh)(e),nc=e=>(nc=x.zh)(e),oc=e=>(oc=x.Ah)(e),ic=e=>(ic=x.Bh)(e),ac=(e,t,r)=>(ac=x.Ch)(e,t,r),sc=e=>(sc=x.Dh)(e);function uc(){function e(){Vu||(Vu=!0,u.calledRun=!0,O||(u.noFSInit||Ae.init.initialized||Ae.init(),Ae.ignorePermissions=!1,Ce.init(),ce(V),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(),W.unshift(e);var e;ce(W)}()))}Y>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),N.unshift(e);var e;ce(N)}(),Y>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),e()}),1)):e()))}if(u.___start_em_js=2356011,u.___stop_em_js=2356375,u.addRunDependency=K,u.removeRunDependency=Q,u.FS_createPath=Ae.createPath,u.FS_createDataFile=Ae.createDataFile,u.FS_createLazyFile=Ae.createLazyFile,u.FS_createDevice=Ae.createDevice,u.FS_unlink=Ae.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=we(e)+1,r=nc(t);return Qt(e,r,t),r})(e)),t},array:e=>{var t=nc(e.length);return Du(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?Pe(e):"boolean"===t?Boolean(e):e}(f),p},u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return A[e>>0];case"i16":return q[e>>1];case"i32":return L[e>>2];case"i64":return B[e>>3];case"float":return R[e>>2];case"double":return I[e>>3];case"*":return D[e>>2];default:J(`invalid type for getValue: ${t}`)}},u.UTF8ToString=Pe,u.specialHTMLTargets=_u,u.FS_createPreloadedFile=Ae.createPreloadedFile,Z=function e(){Vu||uc(),Vu||(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))}}),it=s(_()),at=s(Xe()),st=Symbol("PROXY");Symbol("RESTORE");function ut(e,t){Object.defineProperty(e[t],st,{value:{type:"getter"},writable:!1})}function ct(e,t){Object.defineProperty(e[t],st,{value:{type:"setter"},writable:!1})}var lt,dt={};(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!")}})(lt||(lt={}));var ft=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=>pt(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>pt(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=pt(e);r(t)}catch(e){n(e)}})))).delete()}))}};function pt(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 ht(e){return new Promise(((t,r)=>{e((e=>{try{const r=pt(e);t(r)}catch(e){r(e)}}))}))}u([ct],ft.prototype,"setValue",1),u([ut],ft.prototype,"getValue",1);var mt=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r},gt=new WeakMap,yt={assets:[],total:0,currentPage:0,nextPage:void 0},AssetAPI=class{#e;constructor(e){this.#e=e}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;pt(this.#e.addAssetSource(e.id,(async(t,r)=>{try{const n={...t,tags:mt(t.tags),groups:mt(t.groups),excludeGroups:mt(t.excludeGroups)},o=await e.findAssets(n);if(o){const t={...o,assets:o.assets.map((t=>bt(t,e.id)))};r.invoke(t)}else r.invoke(yt)}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(this.#t(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(this.#t(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)),this.#r(e.id,e)}addLocalSource(e,t,r,n){pt(this.#e.addLocalAssetSource(e,t??[],r?async(e,t)=>{try{const n=await r(this.#t(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(this.#t(e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){pt(this.#e.removeAssetSource(e)),this.#n(e)}findAllSources(){return mt(this.#e.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??""};this.#e.findAssetSourceAssets(e,i,(e=>{try{const t=pt(e);r({...t,nextPage:-1===t.nextPage?void 0:t.nextPage})}catch(e){n(e)}}))}))}#t(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}async getGroups(e){return ht((t=>this.#e.getAssetSourceGroups(e,t))).then((e=>mt(e)))}getSupportedMimeTypes(e){return mt(pt(this.#e.getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=pt(this.#e.getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=pt(this.#e.getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){return!!gt.get(this.#e)?.get(e)?.canManageAssets}addAssetToSource(e,t){pt(this.#e.addAssetToSource(e,t))}removeAssetFromSource(e,t){pt(this.#e.removeAssetFromSource(e,t))}#r(e,t){gt.has(this.#e)||gt.set(this.#e,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/`),gt.get(this.#e).set(e,{canManageAssets:t.canManageAssets})}#n(e){gt.get(this.#e)?.delete(e)}async apply(e,t){return new Promise(((r,n)=>{this.#e.applyAssetSourceAsset(e,bt(t,e),(e=>{try{const t=pt(e);this.#e.isValid(t)?r(t):r(void 0)}catch(e){n(e)}}))}))}async applyToBlock(e,t,r){return ht((n=>this.#e.applyAssetSourceAssetToBlock(e,bt(t,e),r,n)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{this.#e.defaultApplyAsset(bt(e,""),(e=>{try{const r=pt(e);this.#e.isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return ht((r=>this.#e.defaultApplyAssetToBlock(bt(e,""),t,r)))}onAssetSourceAdded=e=>{const t=this.#e.subscribeToAssetSourceAdded(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}};onAssetSourceRemoved=e=>{const t=this.#e.subscribeToAssetSourceRemoved(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}};dispose(){gt.delete(this.#e)}};function bt(e,t){return"context"in e&&e.context.sourceId===t?e:{...e,context:{sourceId:t}}}var vt=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 wt(e){return"object"==typeof e&&null!=e}function Et(e){return"string"==typeof e?JSON.stringify(e):""+e}function _t(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: `"+Et(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*Ct(e,t,r,n){var o;wt(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=_t(o,t,r,n);e&&(yield e)}}function*St(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&&wt(t.schema)&&wt(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=St(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):wt(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 xt=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)=>Ct(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>Ct(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=kt(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=kt(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){const r=kt(e,t);return!r[0]}(e,this)}mask(e){return function(e,t){const r=kt(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return kt(e,this,t)}};function kt(e,t,r={}){const n=St(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(o[0]){return[new vt(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function Tt(e,t){return new xt({type:e,schema:null,validator:t})}function At(e){return new xt({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: "+Et(e)})}function Pt(){return Tt("boolean",(e=>"boolean"==typeof e))}function qt(){return Tt("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+Et(e)))}function Ft(){return Tt("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Et(e)))}function Lt(e){const t=e?Object.keys(e):[],r=Tt("never",(()=>!1));return new xt({type:"object",schema:e||null,*entries(n){if(e&&wt(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=>wt(e)||"Expected an object, but received: "+Et(e),coercer:e=>wt(e)?{...e}:e})}function Dt(){return Tt("string",(e=>"string"==typeof e||"Expected a string, but received: "+Et(e)))}function Rt(e,t,r={}){const{exclusive:n}=r;return It(e,"max",(r=>n?r<t:r<=t||"Expected a "+e.type+" less than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function Bt(e,t,r={}){const{exclusive:n}=r;return It(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function Mt(e){return It(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 It(e,t,r){return new xt({...e,*refiner(n,o){yield*e.refiner(n,o);const i=Ct(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function Ot(e,t,r){const[n]=kt(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function jt(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return Tt("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 Ut(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return Tt("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var $t=(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))($t||{}),Ht=$t,Nt="undefined"!=typeof Blob?Blob:(()=>{try{return Qe().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=Ht.Png,r={}){Ot("handle",e,Ft()),Ot("mimeType",t,jt()),Ot("options",r,Lt());const n=null!=r.targetWidth&&null!=r.targetHeight,o=r.jpegQuality??.9,i=r.webpQuality??1,a=r.pngCompressionLevel??5;return Ot("jpegQuality",o,Bt(Rt(Ft(),1),0,{exclusive:!0})),Ot("webpQuality",i,Bt(Rt(Ft(),1),0,{exclusive:!0})),Ot("pngCompressionLevel",a,Bt(Rt(qt(),9),0)),null==r.targetWidth&&null==r.targetHeight||(Ot("targetWidth",r.targetWidth,Ft()),Ot("targetHeight",r.targetHeight,Ft())),new Promise(((s,u)=>{this.#e.exportToBuffer(e,t,(e=>{"error"in e?u(e.error):s(new Nt([e],{type:t}))}),{pngCompressionLevel:a,jpegQuality:o,webpQuality:i,useTargetSize:n,targetWidth:r.targetWidth??0,targetHeight:r.targetHeight??0,exportPdfWithHighCompatibility:r.exportPdfWithHighCompatibility??!0})}))}async exportWithColorMask(e,t=Ht.Png,r,n,o,i={}){Ot("handle",e,Ft()),Ot("mimeType",t,jt()),Ot("options",i,Lt());const a=null!=i.targetWidth&&null!=i.targetHeight,s=i.jpegQuality??.9,u=i.webpQuality??1,c=i.pngCompressionLevel??5;return Ot("jpegQuality",s,Bt(Rt(Ft(),1),0,{exclusive:!0})),Ot("webpQuality",u,Bt(Rt(Ft(),1),0,{exclusive:!0})),Ot("pngCompressionLevel",c,Bt(Rt(qt(),9),0)),null==i.targetWidth&&null==i.targetHeight||(Ot("targetWidth",i.targetWidth,Ft()),Ot("targetHeight",i.targetHeight,Ft())),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 Nt([e],{type:t}),o=new Nt([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})}))}async exportVideo(e,t=Ht.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 Ot("content",e,Dt()),ht((t=>this.#e.loadBlocksFromString(e,t))).then((e=>mt(e)))}async saveToString(e){return Ot("blocks",e,At(Ft())),ht((t=>this.#e.saveBlocksToString(e,t)))}create(e){return Ot("type",e,Dt()),pt(this.#e.create(e))}createFill(e){return Ot("type",e,Dt()),pt(this.#e.createFill(e))}getType(e){return Ot("id",e,qt()),pt(this.#e.getType(e))}getKind(e){return Ot("id",e,qt()),pt(this.#e.getKind(e))}setKind(e,t){Ot("id",e,qt()),pt(this.#e.setKind(e,t))}select(e){return Ot("id",e,qt()),pt(this.#e.select(e))}setSelected(e,t){return Ot("id",e,qt()),Ot("selected",t,Pt()),pt(this.#e.setSelected(e,t))}isSelected(e){return Ot("id",e,qt()),pt(this.#e.isSelected(e))}findAllSelected(){return mt(this.#e.findAllSelected())}onSelectionChanged=e=>{const t=this.#e.subscribeToSelectionChange(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}};onClicked=e=>{const t=this.#e.subscribeToBlockClicked(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}};isGroupable(e){return Ot("ids",e,At(Ft())),pt(this.#e.isGroupable(e))}group(e){return Ot("ids",e,Mt(At(Ft()))),pt(this.#e.group(e))}ungroup(e){return Ot("id",e,Ft()),pt(this.#e.ungroup(e))}enterGroup(e){return Ot("id",e,Ft()),pt(this.#e.enterGroup(e))}exitGroup(e){return Ot("id",e,Ft()),pt(this.#e.exitGroup(e))}isCombinable(e){return Ot("ids",e,At(Ft())),pt(this.#e.isCombinable(e))}combine(e,t){return Ot("ids",e,At(Ft())),Ot("op",t,Dt()),pt(this.#e.combine(e,t))}setName(e,t){return Ot("id",e,qt()),Ot("name",t,Dt()),pt(this.#e.setName(e,t))}getName(e){return Ot("id",e,qt()),pt(this.#e.getName(e))}getUUID(e){return Ot("id",e,qt()),pt(this.#e.getUUID(e))}findByName(e){Ot("name",e,Dt());const t=this.#e.findByName(e);return mt(t)}findByType(e){Ot("type",e,Dt());const t=pt(this.#e.findByType(e));return mt(t)}findByKind(e){Ot("kind",e,Dt());const t=pt(this.#e.findByKind(e));return mt(t)}findAll(){return mt(this.#e.findAll())}findAllPlaceholders(){return mt(this.#e.findAllPlaceholders())}createShape(e){return Ot("type",e,Dt()),pt(this.#e.createShape(e))}hasShape(e){return Ot("id",e,qt()),pt(this.#e.hasShape(e))}getShape(e){return Ot("id",e,qt()),pt(this.#e.getShape(e))}setShape(e,t){return Ot("id",e,qt()),Ot("shape",t,qt()),pt(this.#e.setShape(e,t))}isVisible(e){return Ot("id",e,qt()),pt(this.#e.isVisible(e))}setVisible(e,t){return Ot("id",e,qt()),Ot("visible",t,Pt()),pt(this.#e.setVisible(e,t))}isClipped(e){return Ot("id",e,qt()),pt(this.#e.isClipped(e))}setClipped(e,t){return Ot("id",e,qt()),Ot("clipped",t,Pt()),pt(this.#e.setClipped(e,t))}isTransformLocked(e){return Ot("id",e,qt()),pt(this.#e.isTransformLocked(e))}setTransformLocked(e,t){return Ot("id",e,qt()),Ot("locked",t,Pt()),pt(this.#e.setTransformLocked(e,t))}getPositionX(e){return Ot("id",e,qt()),pt(this.#e.getPositionX(e))}getPositionXMode(e){return Ot("id",e,qt()),pt(this.#e.getPositionXMode(e))}getPositionY(e){return Ot("id",e,qt()),pt(this.#e.getPositionY(e))}getPositionYMode(e){return Ot("id",e,qt()),pt(this.#e.getPositionYMode(e))}setPositionX(e,t){return Ot("id",e,qt()),Ot("value",t,Ft()),pt(this.#e.setPositionX(e,t))}setPositionXMode(e,t){return Ot("id",e,qt()),pt(this.#e.setPositionXMode(e,t))}setPositionY(e,t){return Ot("id",e,qt()),Ot("value",t,Ft()),pt(this.#e.setPositionY(e,t))}setPositionYMode(e,t){return Ot("id",e,qt()),pt(this.#e.setPositionYMode(e,t))}setAlwaysOnTop(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return Ot("id",e,qt()),pt(this.#e.isAlwaysOnTop(e))}isAlwaysOnBottom(e){return Ot("id",e,qt()),pt(this.#e.isAlwaysOnBottom(e))}bringToFront(e){return Ot("id",e,Ft()),pt(this.#e.bringToFront(e))}sendToBack(e){return Ot("id",e,Ft()),pt(this.#e.sendToBack(e))}bringForward(e){return Ot("id",e,Ft()),pt(this.#e.bringForward(e))}sendBackward(e){return Ot("id",e,Ft()),pt(this.#e.sendBackward(e))}getRotation(e){return Ot("id",e,qt()),pt(this.#e.getRotation(e))}setRotation(e,t){return Ot("id",e,qt()),Ot("radians",t,Ft()),pt(this.#e.setRotation(e,t))}getFlipHorizontal(e){return Ot("id",e,qt()),pt(this.#e.getFlip(e)).horizontal}getFlipVertical(e){return Ot("id",e,qt()),pt(this.#e.getFlip(e)).vertical}setFlipHorizontal(e,t){return Ot("id",e,qt()),Ot("flip",t,Pt()),pt(this.#e.setFlipHorizontal(e,t))}setFlipVertical(e,t){return Ot("id",e,qt()),Ot("flip",t,Pt()),pt(this.#e.setFlipVertical(e,t))}hasContentFillMode(e){return Ot("id",e,qt()),pt(this.#e.hasContentFillMode(e))}getWidth(e){return Ot("id",e,qt()),pt(this.#e.getWidth(e))}getWidthMode(e){return Ot("id",e,qt()),pt(this.#e.getWidthMode(e))}getHeight(e){return Ot("id",e,qt()),pt(this.#e.getHeight(e))}getHeightMode(e){return Ot("id",e,qt()),pt(this.#e.getHeightMode(e))}setWidth(e,t){return Ot("id",e,qt()),Ot("value",t,Ft()),pt(this.#e.setWidth(e,t))}setWidthMode(e,t){return Ot("id",e,qt()),pt(this.#e.setWidthMode(e,t))}setHeight(e,t){return Ot("id",e,qt()),Ot("value",t,Ft()),pt(this.#e.setHeight(e,t))}setHeightMode(e,t){return Ot("id",e,qt()),pt(this.#e.setHeightMode(e,t))}getFrameX(e){return Ot("id",e,qt()),pt(this.#e.getLastFrameX(e))}getFrameY(e){return Ot("id",e,qt()),pt(this.#e.getLastFrameY(e))}getFrameWidth(e){return Ot("id",e,qt()),pt(this.#e.getLastFrameWidth(e))}getFrameHeight(e){return Ot("id",e,qt()),pt(this.#e.getLastFrameHeight(e))}setContentFillMode(e,t){return Ot("id",e,qt()),pt(this.#e.setContentFillMode(e,t))}getContentFillMode(e){return Ot("id",e,qt()),pt(this.#e.getContentFillMode(e))}duplicate(e){return Ot("id",e,qt()),pt(this.#e.duplicate(e))}destroy(e){return Ot("id",e,qt()),pt(this.#e.destroy(e))}isValid(e){return Ot("id",e,qt()),this.#e.isValid(e)}getParent(e){return Ot("id",e,qt()),pt(this.#e.hasParent(e))?pt(this.#e.getParent(e)):null}getChildren(e){Ot("id",e,qt());const t=pt(this.#e.getChildren(e));return mt(t)}insertChild(e,t,r){return Ot("parent",e,Ft()),Ot("child",t,Ft()),Ot("index",r,Bt(Ft(),0)),pt(this.#e.insertChild(e,t,r))}appendChild(e,t){return Ot("parent",e,Ft()),Ot("child",t,Ft()),pt(this.#e.appendChild(e,t))}referencesAnyVariables(e){return Ot("id",e,qt()),pt(this.#e.referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return Ot("id",e,qt()),pt(this.#e.getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return Ot("id",e,qt()),pt(this.#e.getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return Ot("id",e,qt()),pt(this.#e.getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return Ot("id",e,qt()),pt(this.#e.getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return Ot("ids",e,At(Ft())),pt(this.#e.getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return Ot("ids",e,Mt(At(Ft()))),pt(this.#e.alignHorizontally(e,t))}alignVertically(e,t){return Ot("ids",e,Mt(At(Ft()))),pt(this.#e.alignVertically(e,t))}isAlignable(e){return Ot("ids",e,At(Ft())),pt(this.#e.isAlignable(e))}distributeHorizontally(e){return Ot("ids",e,Mt(At(Ft()))),pt(this.#e.distributeHorizontally(e))}distributeVertically(e){return Ot("ids",e,Mt(At(Ft()))),pt(this.#e.distributeVertically(e))}isDistributable(e){return Ot("ids",e,At(Ft())),pt(this.#e.isDistributable(e))}fillParent(e){return Ot("id",e,qt()),pt(this.#e.fillParent(e))}resizeContentAware(e,t,r){return Ot("ids",e,At(Ft())),Ot("width",t,Ft()),Ot("height",r,Ft()),pt(this.#e.resizeContentAware(e,t,r))}scale(e,t,r=0,n=0){return Ot("id",e,qt()),pt(this.#e.scale(e,t,r,n))}findAllProperties(e){return Ot("id",e,qt()),mt(pt(this.#e.findAllProperties(e)))}isPropertyReadable(e){return Ot("property",e,Dt()),this.#e.isPropertyReadable(e)}isPropertyWritable(e){return Ot("property",e,Dt()),this.#e.isPropertyWritable(e)}getPropertyType(e){Ot("property",e,Dt());return pt(this.#e.getPropertyType(e))}getEnumValues(e){return Ot("enumProperty",e,Dt()),mt(pt(this.#e.getEnumValues(e)))}setBool(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("value",r,Pt()),pt(this.#e.setBool(e,t,r))}getBool(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getBool(e,t))}setInt(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("value",r,qt()),pt(this.#e.setInt(e,t,r))}getInt(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getInt(e,t))}setFloat(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("value",r,Ft()),pt(this.#e.setFloat(e,t,r))}getFloat(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getFloat(e,t))}setDouble(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("value",r,Ft()),pt(this.#e.setDouble(e,t,r))}getDouble(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getDouble(e,t))}setString(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("value",r,Dt()),pt(this.#e.setString(e,t,r))}getString(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getString(e,t))}setColor(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.setColor(e,t,lt.fromColor(r)))}getColor(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),lt.toColor(pt(this.#e.getColor(e,t)))}setColorRGBA(e,t,r,n,o,i=1){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("r",r,Ft()),Ot("g",n,Ft()),Ot("b",o,Ft()),Ot("a",i,Ft()),pt(this.#e.setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getColorRGBA(e,t))}setColorSpot(e,t,r,n=1){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("name",r,Dt()),Ot("tint",n,Ft()),pt(this.#e.setColorSpot(e,t,r,n))}getColorSpotName(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getColorSpotName(e,t))}getColorSpotTint(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getColorSpotTint(e,t))}setGradientColorStops(e,t,r){Ot("id",e,qt()),Ot("property",t,Dt());const n=r.map((e=>({color:lt.fromColor(e.color),stop:e.stop})));return pt(this.#e.setGradientColorStops(e,t,n))}getGradientColorStops(e,t){Ot("id",e,qt()),Ot("property",t,Dt());const r=pt(this.#e.getGradientColorStops(e,t));return mt(r).map((e=>({color:lt.toColor(e.color),stop:e.stop})))}getSourceSet(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),mt(pt(this.#e.getSourceSet(e,t)))}setSourceSet(e,t,r){Ot("id",e,qt()),Ot("property",t,Dt()),Ot("sourceSet",r,At(Lt({uri:Dt(),width:Ft(),height:Ft()}))),pt(this.#e.setSourceSet(e,t,r))}setEnum(e,t,r){return Ot("id",e,qt()),Ot("property",t,Dt()),Ot("value",r,Dt()),pt(this.#e.setEnum(e,t,r))}getEnum(e,t){return Ot("id",e,qt()),Ot("property",t,Dt()),pt(this.#e.getEnum(e,t))}hasCrop(e){return Ot("id",e,qt()),pt(this.#e.hasCrop(e))}setCropScaleX(e,t){return Ot("id",e,qt()),Ot("scaleX",t,Ft()),pt(this.#e.setCropScaleX(e,t))}setCropScaleY(e,t){return Ot("id",e,qt()),Ot("scaleY",t,Ft()),pt(this.#e.setCropScaleY(e,t))}setCropRotation(e,t){return Ot("id",e,qt()),Ot("rotation",t,Ft()),pt(this.#e.setCropRotation(e,t))}setCropScaleRatio(e,t){return Ot("id",e,qt()),Ot("scaleRatio",t,Ft()),pt(this.#e.setCropScaleRatio(e,t))}setCropTranslationX(e,t){return Ot("id",e,qt()),Ot("translationX",t,Ft()),pt(this.#e.setCropTranslationX(e,t))}setCropTranslationY(e,t){return Ot("id",e,qt()),Ot("translationY",t,Ft()),pt(this.#e.setCropTranslationY(e,t))}resetCrop(e){return Ot("id",e,qt()),pt(this.#e.resetCrop(e))}getCropScaleX(e){return Ot("id",e,qt()),pt(this.#e.getCropScaleX(e))}getCropScaleY(e){return Ot("id",e,qt()),pt(this.#e.getCropScaleY(e))}getCropRotation(e){return Ot("id",e,qt()),pt(this.#e.getCropRotation(e))}getCropScaleRatio(e){return Ot("id",e,qt()),pt(this.#e.getCropScaleRatio(e))}getCropTranslationX(e){return Ot("id",e,qt()),pt(this.#e.getCropTranslationX(e))}getCropTranslationY(e){return Ot("id",e,qt()),pt(this.#e.getCropTranslationY(e))}adjustCropToFillFrame(e,t){return Ot("id",e,qt()),Ot("minScaleRatio",t,Ft()),pt(this.#e.adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return Ot("id",e,qt()),pt(this.#e.flipCropHorizontal(e))}flipCropVertical(e){return Ot("id",e,qt()),pt(this.#e.flipCropVertical(e))}hasOpacity(e){return Ot("id",e,qt()),pt(this.#e.hasOpacity(e))}setOpacity(e,t){return Ot("id",e,qt()),Ot("opacity",t,Ft()),pt(this.#e.setOpacity(e,t))}getOpacity(e){return Ot("id",e,qt()),pt(this.#e.getOpacity(e))}hasBlendMode(e){return Ot("id",e,qt()),pt(this.#e.hasBlendMode(e))}setBlendMode(e,t){return Ot("id",e,qt()),Ot("blendMode",t,Dt()),pt(this.#e.setBlendMode(e,t))}getBlendMode(e){return Ot("id",e,qt()),pt(this.#e.getBlendMode(e))}hasFillColor(e){return Ot("id",e,qt()),pt(this.#e.hasFillColor(e))}isIncludedInExport(e){return Ot("id",e,qt()),pt(this.#e.isIncludedInExport(e))}setIncludedInExport(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,n,o=1){return Ot("id",e,qt()),Ot("r",t,Ft()),Ot("g",r,Ft()),Ot("b",n,Ft()),Ot("a",o,Ft()),pt(this.#e.setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return Ot("id",e,qt()),pt(this.#e.getFillColorRGBA(e))}setFillColorEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setFillColorEnabled(e,t))}isFillColorEnabled(e){return Ot("id",e,qt()),pt(this.#e.isFillColorEnabled(e))}createEffect(e){return Ot("type",e,Dt()),pt(this.#e.createEffect(e))}hasEffects(e){return Ot("id",e,qt()),pt(this.#e.hasEffects(e))}getEffects(e){Ot("id",e,qt());const t=pt(this.#e.getEffects(e));return mt(t)}insertEffect(e,t,r){Ot("id",e,qt()),Ot("effectId",t,qt()),Ot("index",r,Bt(qt(),0)),pt(this.#e.insertEffect(e,t,r))}appendEffect(e,t){Ot("id",e,qt()),Ot("effectId",t,qt()),pt(this.#e.appendEffect(e,t))}removeEffect(e,t){Ot("id",e,qt()),Ot("index",t,Bt(qt(),0)),pt(this.#e.removeEffect(e,t))}hasEffectEnabled(e){return Ot("effectId",e,qt()),pt(this.#e.hasEffectEnabled(e))}setEffectEnabled(e,t){Ot("effectId",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setEffectEnabled(e,t))}isEffectEnabled(e){return Ot("effectId",e,qt()),pt(this.#e.isEffectEnabled(e))}createBlur(e){return Ot("type",e,Dt()),pt(this.#e.createBlur(e))}hasBlur(e){return Ot("id",e,qt()),pt(this.#e.hasBlur(e))}setBlur(e,t){Ot("id",e,qt()),Ot("blurId",t,qt()),pt(this.#e.setBlur(e,t))}getBlur(e){return Ot("id",e,qt()),pt(this.#e.getBlur(e))}setBlurEnabled(e,t){Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setBlurEnabled(e,t))}isBlurEnabled(e){return Ot("id",e,qt()),pt(this.#e.isBlurEnabled(e))}hasBackgroundColor(e){return Ot("id",e,qt()),pt(this.#e.hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o=1){return Ot("id",e,qt()),Ot("r",t,Ft()),Ot("g",r,Ft()),Ot("b",n,Ft()),Ot("a",o,Ft()),pt(this.#e.setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return Ot("id",e,qt()),pt(this.#e.getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return Ot("id",e,qt()),pt(this.#e.isBackgroundColorEnabled(e))}hasStroke(e){return Ot("id",e,qt()),pt(this.#e.hasStroke(e))}setStrokeEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setStrokeEnabled(e,t))}isStrokeEnabled(e){return Ot("id",e,qt()),pt(this.#e.isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o=1){return Ot("id",e,qt()),Ot("r",t,Ft()),Ot("g",r,Ft()),Ot("b",n,Ft()),Ot("a",o,Ft()),pt(this.#e.setStrokeColorRGBA(e,t,r,n,o))}setStrokeColor(e,t){return Ot("id",e,qt()),pt(this.#e.setStrokeColor(e,lt.fromColor(t)))}getStrokeColorRGBA(e){return Ot("id",e,qt()),pt(this.#e.getStrokeColorRGBA(e))}getStrokeColor(e){return Ot("id",e,qt()),lt.toColor(pt(this.#e.getStrokeColor(e)))}setStrokeWidth(e,t){return Ot("id",e,qt()),Ot("width",t,Ft()),pt(this.#e.setStrokeWidth(e,t))}getStrokeWidth(e){return Ot("id",e,qt()),pt(this.#e.getStrokeWidth(e))}setStrokeStyle(e,t){return Ot("id",e,qt()),pt(this.#e.setStrokeStyle(e,t))}getStrokeStyle(e){Ot("id",e,qt());return pt(this.#e.getStrokeStyle(e))}setStrokePosition(e,t){return Ot("id",e,qt()),pt(this.#e.setStrokePosition(e,t))}getStrokePosition(e){Ot("id",e,qt());return pt(this.#e.getStrokePosition(e))}setStrokeCornerGeometry(e,t){return Ot("id",e,qt()),pt(this.#e.setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){Ot("id",e,qt());return pt(this.#e.getStrokeCornerGeometry(e))}hasDropShadow(e){return Ot("id",e,qt()),pt(this.#e.hasDropShadow(e))}setDropShadowEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return Ot("id",e,qt()),pt(this.#e.isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,n,o=1){return Ot("id",e,qt()),Ot("r",t,Ft()),Ot("g",r,Ft()),Ot("b",n,Ft()),Ot("a",o,Ft()),pt(this.#e.setDropShadowColorRGBA(e,t,r,n,o))}setDropShadowColor(e,t){return Ot("id",e,qt()),pt(this.#e.setDropShadowColor(e,lt.fromColor(t)))}getDropShadowColorRGBA(e){return Ot("id",e,qt()),pt(this.#e.getDropShadowColorRGBA(e))}getDropShadowColor(e){return Ot("id",e,qt()),lt.toColor(pt(this.#e.getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return Ot("id",e,qt()),Ot("offsetX",t,Ft()),pt(this.#e.setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return Ot("id",e,qt()),pt(this.#e.getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return Ot("id",e,qt()),Ot("offsetY",t,Ft()),pt(this.#e.setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return Ot("id",e,qt()),pt(this.#e.getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return Ot("id",e,qt()),Ot("blurRadiusX",t,Ft()),pt(this.#e.setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return Ot("id",e,qt()),pt(this.#e.getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return Ot("id",e,qt()),Ot("blurRadiusY",t,Ft()),pt(this.#e.setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return Ot("id",e,qt()),pt(this.#e.getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return Ot("id",e,qt()),pt(this.#e.setDropShadowClip(e,t))}getDropShadowClip(e){return Ot("id",e,qt()),pt(this.#e.getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return Ot("ids",e,At(qt())),Ot("vectorizeDistanceThreshold",t,Ft()),Ot("maxSmoothingDistance",r,Ft()),pt(this.#e.createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return Ot("path",e,Dt()),pt(this.#e.createCutoutFromPath(e))}createCutoutFromOperation(e,t){return Ot("ids",e,At(qt())),Ot("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return Tt("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),pt(this.#e.createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,n=-1){Ot("id",e,qt()),Ot("text",t,Dt()),Ot("from",r,qt()),Ot("to",n,qt()),pt(this.#e.replaceText(e,t,r,n))}removeText(e,t=-1,r=-1){Ot("id",e,qt()),Ot("from",t,qt()),Ot("to",r,qt()),pt(this.#e.removeText(e,t,r))}setTextColor(e,t,r=-1,n=-1){Ot("id",e,qt()),Ot("from",r,qt()),Ot("to",n,qt()),pt(this.#e.setTextColor(e,lt.fromColor(t),r,n))}getTextColors(e,t=-1,r=-1){Ot("id",e,qt()),Ot("from",t,qt()),Ot("to",r,qt());const n=this.#e.getTextColors(e,t,r);return mt(pt(n)).map((e=>lt.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return Ot("id",e,qt()),Ot("from",t,qt()),Ot("to",r,qt()),mt(pt(this.#e.getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return Ot("id",e,qt()),Ot("from",t,qt()),Ot("to",r,qt()),mt(pt(this.#e.getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return Ot("id",e,qt()),Ot("from",t,qt()),Ot("to",r,qt()),mt(pt(this.#e.getTextCases(e,t,r)))}setTextCase(e,t,r=-1,n=-1){Ot("id",e,qt()),Ot("textCase",t,Dt()),Ot("from",r,qt()),Ot("to",n,qt()),pt(this.#e.setTextCase(e,t,r,n))}getTextCursorRange(){return pt(this.#e.getTextCursorRange())}hasFill(e){return Ot("id",e,qt()),pt(this.#e.hasFill(e))}isFillEnabled(e){return Ot("id",e,qt()),pt(this.#e.isFillEnabled(e))}setFillEnabled(e,t){return Ot("id",e,qt()),pt(this.#e.setFillEnabled(e,t))}getFill(e){return Ot("id",e,qt()),pt(this.#e.getFill(e))}setFill(e,t){return Ot("id",e,qt()),Ot("fill",t,qt()),pt(this.#e.setFill(e,t))}setFillSolidColor(e,t,r,n,o=1){Ot("id",e,qt()),pt(this.#e.setFillSolidColor(e,t,r,n,o))}getFillSolidColor(e){return Ot("id",e,qt()),pt(this.#e.getFillSolidColor(e))}setPlaceholderEnabled(e,t){Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return Ot("id",e,qt()),pt(this.#e.isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return Ot("id",e,qt()),pt(this.#e.hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){Ot("id",e,qt()),pt(this.#e.setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return Ot("id",e,qt()),pt(this.#e.isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return Ot("id",e,qt()),pt(this.#e.hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return Ot("id",e,qt()),pt(this.#e.isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return Ot("id",e,qt()),pt(this.#e.isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){Ot("id",e,qt()),Ot("key",t,Dt()),Ot("value",r,Dt()),pt(this.#e.setMetadata(e,t,r))}getMetadata(e,t){return Ot("id",e,qt()),Ot("key",t,Dt()),pt(this.#e.getMetadata(e,t))}hasMetadata(e,t){return Ot("id",e,qt()),Ot("key",t,Dt()),pt(this.#e.hasMetadata(e,t))}findAllMetadata(e){return Ot("id",e,qt()),mt(pt(this.#e.findAllMetadata(e)))}removeMetadata(e,t){Ot("id",e,qt()),Ot("key",t,Dt()),pt(this.#e.removeMetadata(e,t))}setScopeEnabled(e,t,r){Ot("id",e,qt()),Ot("key",t,Dt()),Ot("enabled",r,Pt()),pt(this.#e.setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return Ot("id",e,qt()),Ot("key",t,Dt()),pt(this.#e.isScopeEnabled(e,t))}isAllowedByScope(e,t){return Ot("id",e,qt()),Ot("key",t,Dt()),pt(this.#e.isAllowedByScope(e,t))}hasDuration(e){return Ot("id",e,qt()),pt(this.#e.hasDuration(e))}setDuration(e,t){return Ot("id",e,qt()),Ot("duration",t,Ft()),pt(this.#e.setDuration(e,t))}getDuration(e){return Ot("id",e,qt()),pt(this.#e.getDuration(e))}hasTimeOffset(e){return Ot("id",e,qt()),pt(this.#e.hasTimeOffset(e))}setTimeOffset(e,t){return Ot("id",e,qt()),Ot("offset",t,Ft()),pt(this.#e.setTimeOffset(e,t))}getTimeOffset(e){return Ot("id",e,qt()),pt(this.#e.getTimeOffset(e))}hasTrim(e){return Ot("id",e,qt()),pt(this.#e.hasTrim(e))}setTrimOffset(e,t){return Ot("id",e,qt()),Ot("offset",t,Ft()),pt(this.#e.setTrimOffset(e,t))}getTrimOffset(e){return Ot("id",e,qt()),pt(this.#e.getTrimOffset(e))}setTrimLength(e,t){return Ot("id",e,qt()),Ot("length",t,Ft()),pt(this.#e.setTrimLength(e,t))}getTrimLength(e){return Ot("id",e,qt()),pt(this.#e.getTrimLength(e))}getTotalSceneDuration(e){return Ot("scene",e,qt()),pt(this.#e.getTotalSceneDuration(e))}setPlaying(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setPlaying(e,t))}isPlaying(e){return Ot("id",e,qt()),pt(this.#e.isPlaying(e))}hasPlaybackTime(e){return Ot("id",e,qt()),pt(this.#e.hasPlaybackTime(e))}setPlaybackTime(e,t){return Ot("id",e,qt()),Ot("time",t,Ft()),pt(this.#e.setPlaybackTime(e,t))}getPlaybackTime(e){return Ot("id",e,qt()),pt(this.#e.getPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return Ot("id",e,qt()),Ot("enabled",t,Pt()),pt(this.#e.setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return Ot("id",e,qt()),pt(this.#e.isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return Ot("id",e,qt()),pt(this.#e.hasPlaybackControl(e))}setLooping(e,t){Ot("id",e,qt()),Ot("looping",t,Pt()),pt(this.#e.setLooping(e,t))}isLooping(e){return Ot("id",e,qt()),pt(this.#e.isLooping(e))}setMuted(e,t){Ot("id",e,qt()),Ot("muted",t,Pt()),pt(this.#e.setMuted(e,t))}isMuted(e){return Ot("id",e,qt()),pt(this.#e.isMuted(e))}setVolume(e,t){Ot("id",e,qt()),Ot("volume",t,Ft()),pt(this.#e.setVolume(e,t))}getVolume(e){return Ot("id",e,qt()),pt(this.#e.getVolume(e))}async forceLoadAVResource(e){return Ot("id",e,qt()),ht((t=>this.#e.forceLoadAVResource(e,t)))}getAVResourceTotalDuration(e){return Ot("id",e,qt()),pt(this.#e.getAVResourceTotalDuration(e))}getVideoWidth(e){return Ot("id",e,qt()),pt(this.#e.getVideoWidth(e))}getVideoHeight(e){return Ot("id",e,qt()),pt(this.#e.getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,n,o,i){return Ot("id",e,qt()),Ot("thumbnailHeight",t,qt()),Ot("timeBegin",r,Ft()),Ot("timeEnd",n,Ft()),Ot("numberOfFrames",o,qt()),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))})),()=>{pt(this.#e.cancelVideoThumbnailSequenceGeneration(e))}}async getVideoFillThumbnail(e,t){return Ot("id",e,qt()),Ot("thumbnailHeight",t,qt()),new Promise(((r,n)=>{this.#e.getVideoFillThumbnail(e,t,(e=>{"error"in e?n(e.error):r(new Nt([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,n){return Ot("id",e,qt()),Ot("numberOfColumns",t,qt()),Ot("numberOfRows",r,qt()),Ot("thumbnailHeight",n,qt()),new Promise(((o,i)=>{this.#e.getVideoFillThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new Nt([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,n){return Ot("id",e,qt()),Ot("numberOfColumns",t,qt()),Ot("numberOfRows",r,qt()),new Promise(((o,i)=>{this.#e.getPageThumbnailAtlas(e,t,r,n,(e=>{"error"in e?i(e.error):o(new Nt([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),pt(this.#e.setNativePixelBuffer(e,t))}};u([ct],BlockAPI.prototype,"loadFromString",1),u([ct],BlockAPI.prototype,"create",1),u([ct],BlockAPI.prototype,"createFill",1),u([ut],BlockAPI.prototype,"getType",1),u([ct],BlockAPI.prototype,"select",1),u([ct],BlockAPI.prototype,"setSelected",1),u([ut],BlockAPI.prototype,"isSelected",1),u([ut],BlockAPI.prototype,"findAllSelected",1),u([ut],BlockAPI.prototype,"isGroupable",1),u([ct],BlockAPI.prototype,"group",1),u([ct],BlockAPI.prototype,"ungroup",1),u([ct],BlockAPI.prototype,"enterGroup",1),u([ct],BlockAPI.prototype,"exitGroup",1),u([ut],BlockAPI.prototype,"isCombinable",1),u([ct],BlockAPI.prototype,"combine",1),u([ct],BlockAPI.prototype,"setName",1),u([ut],BlockAPI.prototype,"getName",1),u([ut],BlockAPI.prototype,"getUUID",1),u([ut],BlockAPI.prototype,"findByName",1),u([ut],BlockAPI.prototype,"findByType",1),u([ut],BlockAPI.prototype,"findAll",1),u([ut],BlockAPI.prototype,"findAllPlaceholders",1),u([ct],BlockAPI.prototype,"createShape",1),u([ut],BlockAPI.prototype,"hasShape",1),u([ut],BlockAPI.prototype,"getShape",1),u([ct],BlockAPI.prototype,"setShape",1),u([ut],BlockAPI.prototype,"isVisible",1),u([ct],BlockAPI.prototype,"setVisible",1),u([ut],BlockAPI.prototype,"isClipped",1),u([ct],BlockAPI.prototype,"setClipped",1),u([ut],BlockAPI.prototype,"isTransformLocked",1),u([ct],BlockAPI.prototype,"setTransformLocked",1),u([ut],BlockAPI.prototype,"getPositionX",1),u([ut],BlockAPI.prototype,"getPositionXMode",1),u([ut],BlockAPI.prototype,"getPositionY",1),u([ut],BlockAPI.prototype,"getPositionYMode",1),u([ct],BlockAPI.prototype,"setPositionX",1),u([ct],BlockAPI.prototype,"setPositionXMode",1),u([ct],BlockAPI.prototype,"setPositionY",1),u([ct],BlockAPI.prototype,"setPositionYMode",1),u([ct],BlockAPI.prototype,"setAlwaysOnTop",1),u([ct],BlockAPI.prototype,"setAlwaysOnBottom",1),u([ut],BlockAPI.prototype,"isAlwaysOnTop",1),u([ut],BlockAPI.prototype,"isAlwaysOnBottom",1),u([ct],BlockAPI.prototype,"bringToFront",1),u([ct],BlockAPI.prototype,"sendToBack",1),u([ct],BlockAPI.prototype,"bringForward",1),u([ct],BlockAPI.prototype,"sendBackward",1),u([ut],BlockAPI.prototype,"getRotation",1),u([ct],BlockAPI.prototype,"setRotation",1),u([ut],BlockAPI.prototype,"getFlipHorizontal",1),u([ut],BlockAPI.prototype,"getFlipVertical",1),u([ct],BlockAPI.prototype,"setFlipHorizontal",1),u([ct],BlockAPI.prototype,"setFlipVertical",1),u([ut],BlockAPI.prototype,"hasContentFillMode",1),u([ut],BlockAPI.prototype,"getWidth",1),u([ut],BlockAPI.prototype,"getWidthMode",1),u([ut],BlockAPI.prototype,"getHeight",1),u([ut],BlockAPI.prototype,"getHeightMode",1),u([ct],BlockAPI.prototype,"setWidth",1),u([ct],BlockAPI.prototype,"setWidthMode",1),u([ct],BlockAPI.prototype,"setHeight",1),u([ct],BlockAPI.prototype,"setHeightMode",1),u([ut],BlockAPI.prototype,"getFrameX",1),u([ut],BlockAPI.prototype,"getFrameY",1),u([ut],BlockAPI.prototype,"getFrameWidth",1),u([ut],BlockAPI.prototype,"getFrameHeight",1),u([ct],BlockAPI.prototype,"setContentFillMode",1),u([ut],BlockAPI.prototype,"getContentFillMode",1),u([ct],BlockAPI.prototype,"duplicate",1),u([ct],BlockAPI.prototype,"destroy",1),u([ut],BlockAPI.prototype,"isValid",1),u([ut],BlockAPI.prototype,"getParent",1),u([ut],BlockAPI.prototype,"getChildren",1),u([ct],BlockAPI.prototype,"insertChild",1),u([ct],BlockAPI.prototype,"appendChild",1),u([ut],BlockAPI.prototype,"referencesAnyVariables",1),u([ut],BlockAPI.prototype,"getGlobalBoundingBoxX",1),u([ut],BlockAPI.prototype,"getGlobalBoundingBoxY",1),u([ut],BlockAPI.prototype,"getGlobalBoundingBoxWidth",1),u([ut],BlockAPI.prototype,"getGlobalBoundingBoxHeight",1),u([ut],BlockAPI.prototype,"getScreenSpaceBoundingBoxXYWH",1),u([ct],BlockAPI.prototype,"alignHorizontally",1),u([ct],BlockAPI.prototype,"alignVertically",1),u([ut],BlockAPI.prototype,"isAlignable",1),u([ct],BlockAPI.prototype,"distributeHorizontally",1),u([ct],BlockAPI.prototype,"distributeVertically",1),u([ct],BlockAPI.prototype,"isDistributable",1),u([ct],BlockAPI.prototype,"fillParent",1),u([ct],BlockAPI.prototype,"resizeContentAware",1),u([ct],BlockAPI.prototype,"scale",1),u([ut],BlockAPI.prototype,"findAllProperties",1),u([ut],BlockAPI.prototype,"isPropertyReadable",1),u([ut],BlockAPI.prototype,"isPropertyWritable",1),u([ut],BlockAPI.prototype,"getPropertyType",1),u([ut],BlockAPI.prototype,"getEnumValues",1),u([ct],BlockAPI.prototype,"setBool",1),u([ut],BlockAPI.prototype,"getBool",1),u([ct],BlockAPI.prototype,"setInt",1),u([ut],BlockAPI.prototype,"getInt",1),u([ct],BlockAPI.prototype,"setFloat",1),u([ut],BlockAPI.prototype,"getFloat",1),u([ct],BlockAPI.prototype,"setDouble",1),u([ut],BlockAPI.prototype,"getDouble",1),u([ct],BlockAPI.prototype,"setString",1),u([ut],BlockAPI.prototype,"getString",1),u([ct],BlockAPI.prototype,"setColor",1),u([ut],BlockAPI.prototype,"getColor",1),u([ct],BlockAPI.prototype,"setColorRGBA",1),u([ut],BlockAPI.prototype,"getColorRGBA",1),u([ct],BlockAPI.prototype,"setColorSpot",1),u([ut],BlockAPI.prototype,"getColorSpotName",1),u([ut],BlockAPI.prototype,"getColorSpotTint",1),u([ct],BlockAPI.prototype,"setGradientColorStops",1),u([ut],BlockAPI.prototype,"getGradientColorStops",1),u([ut],BlockAPI.prototype,"getSourceSet",1),u([ct],BlockAPI.prototype,"setSourceSet",1),u([ct],BlockAPI.prototype,"setEnum",1),u([ut],BlockAPI.prototype,"getEnum",1),u([ut],BlockAPI.prototype,"hasCrop",1),u([ct],BlockAPI.prototype,"setCropScaleX",1),u([ct],BlockAPI.prototype,"setCropScaleY",1),u([ct],BlockAPI.prototype,"setCropRotation",1),u([ct],BlockAPI.prototype,"setCropScaleRatio",1),u([ct],BlockAPI.prototype,"setCropTranslationX",1),u([ct],BlockAPI.prototype,"setCropTranslationY",1),u([ct],BlockAPI.prototype,"resetCrop",1),u([ut],BlockAPI.prototype,"getCropScaleX",1),u([ut],BlockAPI.prototype,"getCropScaleY",1),u([ut],BlockAPI.prototype,"getCropRotation",1),u([ut],BlockAPI.prototype,"getCropScaleRatio",1),u([ut],BlockAPI.prototype,"getCropTranslationX",1),u([ut],BlockAPI.prototype,"getCropTranslationY",1),u([ct],BlockAPI.prototype,"adjustCropToFillFrame",1),u([ct],BlockAPI.prototype,"flipCropHorizontal",1),u([ct],BlockAPI.prototype,"flipCropVertical",1),u([ut],BlockAPI.prototype,"hasOpacity",1),u([ct],BlockAPI.prototype,"setOpacity",1),u([ut],BlockAPI.prototype,"getOpacity",1),u([ut],BlockAPI.prototype,"hasBlendMode",1),u([ct],BlockAPI.prototype,"setBlendMode",1),u([ut],BlockAPI.prototype,"getBlendMode",1),u([ut],BlockAPI.prototype,"hasFillColor",1),u([ut],BlockAPI.prototype,"isIncludedInExport",1),u([ct],BlockAPI.prototype,"setIncludedInExport",1),u([ct],BlockAPI.prototype,"setFillColorRGBA",1),u([ut],BlockAPI.prototype,"getFillColorRGBA",1),u([ct],BlockAPI.prototype,"setFillColorEnabled",1),u([ut],BlockAPI.prototype,"isFillColorEnabled",1),u([ct],BlockAPI.prototype,"createEffect",1),u([ut],BlockAPI.prototype,"hasEffects",1),u([ut],BlockAPI.prototype,"getEffects",1),u([ct],BlockAPI.prototype,"insertEffect",1),u([ct],BlockAPI.prototype,"appendEffect",1),u([ct],BlockAPI.prototype,"removeEffect",1),u([ut],BlockAPI.prototype,"hasEffectEnabled",1),u([ct],BlockAPI.prototype,"setEffectEnabled",1),u([ut],BlockAPI.prototype,"isEffectEnabled",1),u([ct],BlockAPI.prototype,"createBlur",1),u([ut],BlockAPI.prototype,"hasBlur",1),u([ct],BlockAPI.prototype,"setBlur",1),u([ut],BlockAPI.prototype,"getBlur",1),u([ct],BlockAPI.prototype,"setBlurEnabled",1),u([ut],BlockAPI.prototype,"isBlurEnabled",1),u([ut],BlockAPI.prototype,"hasBackgroundColor",1),u([ct],BlockAPI.prototype,"setBackgroundColorRGBA",1),u([ut],BlockAPI.prototype,"getBackgroundColorRGBA",1),u([ct],BlockAPI.prototype,"setBackgroundColorEnabled",1),u([ut],BlockAPI.prototype,"isBackgroundColorEnabled",1),u([ut],BlockAPI.prototype,"hasStroke",1),u([ct],BlockAPI.prototype,"setStrokeEnabled",1),u([ut],BlockAPI.prototype,"isStrokeEnabled",1),u([ct],BlockAPI.prototype,"setStrokeColorRGBA",1),u([ct],BlockAPI.prototype,"setStrokeColor",1),u([ut],BlockAPI.prototype,"getStrokeColorRGBA",1),u([ut],BlockAPI.prototype,"getStrokeColor",1),u([ct],BlockAPI.prototype,"setStrokeWidth",1),u([ut],BlockAPI.prototype,"getStrokeWidth",1),u([ct],BlockAPI.prototype,"setStrokeStyle",1),u([ut],BlockAPI.prototype,"getStrokeStyle",1),u([ct],BlockAPI.prototype,"setStrokePosition",1),u([ut],BlockAPI.prototype,"getStrokePosition",1),u([ct],BlockAPI.prototype,"setStrokeCornerGeometry",1),u([ut],BlockAPI.prototype,"getStrokeCornerGeometry",1),u([ut],BlockAPI.prototype,"hasDropShadow",1),u([ct],BlockAPI.prototype,"setDropShadowEnabled",1),u([ut],BlockAPI.prototype,"isDropShadowEnabled",1),u([ct],BlockAPI.prototype,"setDropShadowColorRGBA",1),u([ct],BlockAPI.prototype,"setDropShadowColor",1),u([ut],BlockAPI.prototype,"getDropShadowColorRGBA",1),u([ut],BlockAPI.prototype,"getDropShadowColor",1),u([ct],BlockAPI.prototype,"setDropShadowOffsetX",1),u([ut],BlockAPI.prototype,"getDropShadowOffsetX",1),u([ct],BlockAPI.prototype,"setDropShadowOffsetY",1),u([ut],BlockAPI.prototype,"getDropShadowOffsetY",1),u([ct],BlockAPI.prototype,"setDropShadowBlurRadiusX",1),u([ut],BlockAPI.prototype,"getDropShadowBlurRadiusX",1),u([ct],BlockAPI.prototype,"setDropShadowBlurRadiusY",1),u([ut],BlockAPI.prototype,"getDropShadowBlurRadiusY",1),u([ct],BlockAPI.prototype,"setDropShadowClip",1),u([ut],BlockAPI.prototype,"getDropShadowClip",1),u([ct],BlockAPI.prototype,"createCutoutFromBlocks",1),u([ct],BlockAPI.prototype,"createCutoutFromPath",1),u([ct],BlockAPI.prototype,"createCutoutFromOperation",1),u([ct],BlockAPI.prototype,"replaceText",1),u([ct],BlockAPI.prototype,"removeText",1),u([ct],BlockAPI.prototype,"setTextColor",1),u([ut],BlockAPI.prototype,"getTextColors",1),u([ut],BlockAPI.prototype,"getTextFontWeights",1),u([ut],BlockAPI.prototype,"getTextFontStyles",1),u([ut],BlockAPI.prototype,"getTextCases",1),u([ct],BlockAPI.prototype,"setTextCase",1),u([ut],BlockAPI.prototype,"getTextCursorRange",1),u([ut],BlockAPI.prototype,"hasFill",1),u([ut],BlockAPI.prototype,"isFillEnabled",1),u([ct],BlockAPI.prototype,"setFillEnabled",1),u([ut],BlockAPI.prototype,"getFill",1),u([ct],BlockAPI.prototype,"setFill",1),u([ct],BlockAPI.prototype,"setFillSolidColor",1),u([ut],BlockAPI.prototype,"getFillSolidColor",1),u([ct],BlockAPI.prototype,"setPlaceholderEnabled",1),u([ut],BlockAPI.prototype,"isPlaceholderEnabled",1),u([ut],BlockAPI.prototype,"hasPlaceholderBehavior",1),u([ct],BlockAPI.prototype,"setPlaceholderBehaviorEnabled",1),u([ut],BlockAPI.prototype,"isPlaceholderBehaviorEnabled",1),u([ut],BlockAPI.prototype,"hasPlaceholderControls",1),u([ct],BlockAPI.prototype,"setPlaceholderControlsOverlayEnabled",1),u([ut],BlockAPI.prototype,"isPlaceholderControlsOverlayEnabled",1),u([ct],BlockAPI.prototype,"setPlaceholderControlsButtonEnabled",1),u([ut],BlockAPI.prototype,"isPlaceholderControlsButtonEnabled",1),u([ct],BlockAPI.prototype,"setMetadata",1),u([ut],BlockAPI.prototype,"getMetadata",1),u([ut],BlockAPI.prototype,"hasMetadata",1),u([ut],BlockAPI.prototype,"findAllMetadata",1),u([ct],BlockAPI.prototype,"removeMetadata",1),u([ct],BlockAPI.prototype,"setScopeEnabled",1),u([ut],BlockAPI.prototype,"isScopeEnabled",1),u([ut],BlockAPI.prototype,"isAllowedByScope",1),u([ut],BlockAPI.prototype,"hasDuration",1),u([ct],BlockAPI.prototype,"setDuration",1),u([ut],BlockAPI.prototype,"getDuration",1),u([ut],BlockAPI.prototype,"hasTimeOffset",1),u([ct],BlockAPI.prototype,"setTimeOffset",1),u([ut],BlockAPI.prototype,"getTimeOffset",1),u([ut],BlockAPI.prototype,"hasTrim",1),u([ct],BlockAPI.prototype,"setTrimOffset",1),u([ut],BlockAPI.prototype,"getTrimOffset",1),u([ct],BlockAPI.prototype,"setTrimLength",1),u([ut],BlockAPI.prototype,"getTrimLength",1),u([ut],BlockAPI.prototype,"getTotalSceneDuration",1),u([ct],BlockAPI.prototype,"setPlaying",1),u([ut],BlockAPI.prototype,"isPlaying",1),u([ut],BlockAPI.prototype,"hasPlaybackTime",1),u([ct],BlockAPI.prototype,"setPlaybackTime",1),u([ut],BlockAPI.prototype,"getPlaybackTime",1),u([ct],BlockAPI.prototype,"setSoloPlaybackEnabled",1),u([ut],BlockAPI.prototype,"isSoloPlaybackEnabled",1),u([ut],BlockAPI.prototype,"hasPlaybackControl",1),u([ct],BlockAPI.prototype,"setLooping",1),u([ut],BlockAPI.prototype,"isLooping",1),u([ct],BlockAPI.prototype,"setMuted",1),u([ut],BlockAPI.prototype,"isMuted",1),u([ct],BlockAPI.prototype,"setVolume",1),u([ut],BlockAPI.prototype,"getVolume",1),u([ct],BlockAPI.prototype,"forceLoadAVResource",1),u([ut],BlockAPI.prototype,"getAVResourceTotalDuration",1),u([ut],BlockAPI.prototype,"getVideoWidth",1),u([ut],BlockAPI.prototype,"getVideoHeight",1),u([ut],BlockAPI.prototype,"getVideoFillThumbnail",1),u([ut],BlockAPI.prototype,"getVideoFillThumbnailAtlas",1),u([ut],BlockAPI.prototype,"getPageThumbnailAtlas",1);var EditorAPI=class{#e;constructor(e){this.#e=e}unlockWithLicense(e){pt(this.#e.unlockWithLicense(e))}getActiveLicense(){return pt(this.#e.getActiveLicense())}onStateChanged=e=>{const t=this.#e.subscribeToEditorState(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}};setEditMode(e){Ot("keypath",e,Dt()),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){pt(this.#e.destroyHistory(e))}setActiveHistory(e){pt(this.#e.setActiveHistory(e))}getActiveHistory(){return this.#e.getActiveHistory()}addUndoStep(){pt(this.#e.addUndoStep())}undo(){pt(this.#e.undo())}redo(){pt(this.#e.redo())}canUndo(){return pt(this.#e.canUndo())}canRedo(){return pt(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()||pt(this.#e.unsubscribe(t))}};setSettingBool(e,t){return Ot("keypath",e,Dt()),Ot("value",t,Pt()),pt(this.#e.setSettingBool(e,t))}getSettingBool(e){return Ot("keypath",e,Dt()),pt(this.#e.getSettingBool(e))}setSettingInt(e,t){return Ot("keypath",e,Dt()),Ot("value",t,qt()),pt(this.#e.setSettingInt(e,t))}getSettingInt(e){return Ot("keypath",e,Dt()),pt(this.#e.getSettingInt(e))}setSettingFloat(e,t){return Ot("keypath",e,Dt()),Ot("value",t,Ft()),pt(this.#e.setSettingFloat(e,t))}getSettingFloat(e){return Ot("keypath",e,Dt()),pt(this.#e.getSettingFloat(e))}setSettingString(e,t){return Ot("keypath",e,Dt()),Ot("value",t,Dt()),pt(this.#e.setSettingString(e,t))}getSettingString(e){return Ot("keypath",e,Dt()),pt(this.#e.getSettingString(e))}setSettingColor(e,t){return Ot("keypath",e,Dt()),pt(this.#e.setSettingColor(e,lt.fromColor(t)))}getSettingColor(e){return Ot("keypath",e,Dt()),lt.toColor(pt(this.#e.getSettingColor(e)))}setSettingColorRGBA(e,t,r,n,o=1){return Ot("keypath",e,Dt()),Ot("r",t,Ft()),Ot("g",r,Ft()),Ot("b",n,Ft()),Ot("a",o,Ft()),pt(this.#e.setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return Ot("keypath",e,Dt()),pt(this.#e.getSettingColorRGBA(e))}setSettingEnum(e,t){return Ot("keypath",e,Dt()),Ot("value",t,Dt()),pt(this.#e.setSettingEnum(e,t))}getSettingEnum(e){return Ot("keypath",e,Dt()),pt(this.#e.getSettingEnum(e))}getSettingEnumOptions(e){return Ot("keypath",e,Dt()),mt(pt(this.#e.getSettingEnumOptions(e)))}findAllSettings(){return mt(this.#e.findAllSettings())}getSettingType(e){Ot("keypath",e,Dt());return pt(this.#e.getSettingType(e))}getAvailableMemory(){return pt(this.#e.getAvailableMemory())}getUsedMemory(){return pt(this.#e.getUsedMemory())}setURIResolver(e){return pt(this.#e.setURIResolver(e))}defaultURIResolver(e){return this.#e.defaultURIResolver(e)}getAbsoluteURI(e){return pt(this.#e.getAbsoluteURI(e))}setGlobalScope(e,t){Ot("key",e,Dt()),Ot("value",t,Dt()),pt(this.#e.setGlobalScope(e,t))}getGlobalScope(e){return Ot("key",e,Dt()),pt(this.#e.getGlobalScope(e))}findAllSpotColors(){return mt(this.#e.findAllSpotColors())}getSpotColorRGBA(e){return Ot("name",e,Dt()),this.#e.getSpotColorRGB(e)}getSpotColorCMYK(e){return Ot("name",e,Dt()),this.#e.getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,n){return Ot("name",e,Dt()),Ot("r",t,Ft()),Ot("g",r,Ft()),Ot("b",n,Ft()),this.#e.setSpotColorRGB(e,t,r,n)}setSpotColorCMYK(e,t,r,n,o){return Ot("name",e,Dt()),Ot("c",t,Ft()),Ot("m",r,Ft()),Ot("y",n,Ft()),Ot("k",o,Ft()),this.#e.setSpotColorCMYK(e,t,r,n,o)}removeSpotColor(e){return Ot("name",e,Dt()),pt(this.#e.removeSpotColor(e))}setSpotColorForCutoutType(e,t){return Ot("type",e,Dt()),Ot("color",t,Dt()),pt(this.#e.setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return Ot("type",e,Dt()),pt(this.#e.getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return Ot("colorSpace",t,Dt()),lt.toColor(pt(this.#e.convertColorToColorSpace(lt.fromColor(e),t)))}};u([ct],EditorAPI.prototype,"setEditMode",1),u([ut],EditorAPI.prototype,"getEditMode",1),u([ut],EditorAPI.prototype,"getCursorType",1),u([ut],EditorAPI.prototype,"getCursorRotation",1),u([ut],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceX",1),u([ut],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceY",1),u([ct],EditorAPI.prototype,"createHistory",1),u([ct],EditorAPI.prototype,"destroyHistory",1),u([ct],EditorAPI.prototype,"setActiveHistory",1),u([ut],EditorAPI.prototype,"getActiveHistory",1),u([ct],EditorAPI.prototype,"addUndoStep",1),u([ct],EditorAPI.prototype,"undo",1),u([ct],EditorAPI.prototype,"redo",1),u([ut],EditorAPI.prototype,"canUndo",1),u([ut],EditorAPI.prototype,"canRedo",1),u([ct],EditorAPI.prototype,"setSettingBool",1),u([ut],EditorAPI.prototype,"getSettingBool",1),u([ct],EditorAPI.prototype,"setSettingInt",1),u([ut],EditorAPI.prototype,"getSettingInt",1),u([ct],EditorAPI.prototype,"setSettingFloat",1),u([ut],EditorAPI.prototype,"getSettingFloat",1),u([ct],EditorAPI.prototype,"setSettingString",1),u([ut],EditorAPI.prototype,"getSettingString",1),u([ct],EditorAPI.prototype,"setSettingColor",1),u([ut],EditorAPI.prototype,"getSettingColor",1),u([ct],EditorAPI.prototype,"setSettingColorRGBA",1),u([ut],EditorAPI.prototype,"getSettingColorRGBA",1),u([ct],EditorAPI.prototype,"setSettingEnum",1),u([ut],EditorAPI.prototype,"getSettingEnum",1),u([ut],EditorAPI.prototype,"getAvailableMemory",1),u([ut],EditorAPI.prototype,"getUsedMemory",1),u([ct],EditorAPI.prototype,"setURIResolver",1),u([ut],EditorAPI.prototype,"defaultURIResolver",1),u([ut],EditorAPI.prototype,"getAbsoluteURI",1),u([ct],EditorAPI.prototype,"setGlobalScope",1),u([ut],EditorAPI.prototype,"getGlobalScope",1),u([ut],EditorAPI.prototype,"findAllSpotColors",1),u([ut],EditorAPI.prototype,"getSpotColorRGBA",1),u([ut],EditorAPI.prototype,"getSpotColorCMYK",1),u([ct],EditorAPI.prototype,"setSpotColorRGB",1),u([ct],EditorAPI.prototype,"setSpotColorCMYK",1),u([ct],EditorAPI.prototype,"removeSpotColor",1),u([ct],EditorAPI.prototype,"setSpotColorForCutoutType",1),u([ct],EditorAPI.prototype,"getSpotColorForCutoutType",1);var EventAPI=class{#e;constructor(e){this.#e=e}subscribe=(e,t)=>{Ot("blocks",e,At());const r=this.#e.subscribe(e,(e=>{try{t(mt(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(r))}}},SceneAPI=class{#e;constructor(e){this.#e=e}async loadFromString(e){return Ot("sceneContent",e,Dt()),ht((t=>this.#e.loadSceneFromString(e,t)))}async loadFromURL(e){return Ot("url",e,Dt()),ht((t=>this.#e.loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return ht((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 Nt([r],{type:Ht.Zip}))}))}))}create(e="Free"){Ot("sceneLayout",e,Ut());return pt(this.#e.createScene(e))}createVideo(){return pt(this.#e.createVideoScene())}createFromImage(e,t=300,r=1,n="Free",o=0,i=!1){return Ot("url",e,Dt()),Ot("dpi",t,Bt(Ft(),0)),Ot("pixelScaleFactor",r,Bt(Ft(),0)),Ot("sceneLayout",n,Ut()),ht((a=>this.#e.createSceneFromImage(e,t,r,n,o,i,a)))}createFromVideo(e){return Ot("url",e,Dt()),ht((t=>this.#e.createSceneFromVideo(e,t)))}get(){const e=pt(this.#e.findByType("scene")),t=mt(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return Ot("content",e,Dt()),ht((t=>this.#e.applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return Ot("url",e,Dt()),ht((t=>this.#e.applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return pt(this.#e.getSceneMode(e))}setDesignUnit(e){Ot("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return Tt("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();pt(this.#e.setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return pt(this.#e.getDesignUnit(e))}getPages(){return mt(pt(this.#e.getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=pt(this.#e.findNearestToViewPortCenterByKind(e,"page")),r=mt(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){Ot("type",e,Dt());const t=this.get();if(null==t)return[];const r=pt(this.#e.findNearestToViewPortCenterByType(t,e));return mt(r)}findNearestToViewPortCenterByKind(e){Ot("kind",e,Dt());const t=this.get();if(null==t)return[];const r=pt(this.#e.findNearestToViewPortCenterByKind(t,e));return mt(r)}setZoomLevel(e=1){const t=this.get();Ot("zoomLevel",e,Bt(Ft(),0)),this.#e.setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return pt(this.#e.getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,n=0,o=0){return Ot("id",e,qt()),ht((i=>this.#e.zoomToBlock(e,t,r,n,o,i)))}enableZoomAutoFit(e,t,r=0,n=0,o=0,i=0){return Ot("id",e,qt()),Ot("axis",t,function(){const e=["Horizontal","Vertical","Both"];return Tt("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(Ot("paddingBefore",r,Ft()),Ot("paddingAfter",n,Ft()),pt(this.#e.enableZoomAutoFit(e,t,r,0,n,0))):"Vertical"===t?(Ot("paddingBefore",r,Ft()),Ot("paddingAfter",n,Ft()),pt(this.#e.enableZoomAutoFit(e,t,0,r,0,n))):(Ot("paddingLeft",r,Ft()),Ot("paddingTop",n,Ft()),Ot("paddingRight",o,Ft()),Ot("paddingBottom",i,Ft()),pt(this.#e.enableZoomAutoFit(e,t,r,n,o,i)))}disableZoomAutoFit(e){return Ot("blockOrScene",e,qt()),pt(this.#e.disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return Ot("blockOrScene",e,qt()),pt(this.#e.isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,n=0,o=0,i=0,a=0,s=0,u=0){return Ot("ids",e,At(Ft())),Ot("paddingLeft",t,Ft()),Ot("paddingTop",r,Ft()),Ot("paddingRight",n,Ft()),Ot("paddingBottom",o,Ft()),Ot("scaledPaddingLeft",t,Ft()),Ot("scaledPaddingTop",r,Ft()),Ot("scaledPaddingRight",n,Ft()),Ot("scaledPaddingBottom",o,Ft()),pt(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 pt(this.#e.unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return pt(this.#e.unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,n=0,o=0,i=0,a=0){return Ot("ids",e,At(Ft())),Ot("minZoomLimit",t,Ft()),Ot("maxZoomLimit",r,Ft()),Ot("paddingLeft",n,Ft()),Ot("paddingTop",o,Ft()),Ot("paddingRight",i,Ft()),Ot("paddingBottom",a,Ft()),pt(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 pt(this.#e.unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return pt(this.#e.unstable_isCameraZoomClampingEnabled(e))}onZoomLevelChanged=e=>{const t=this.#e.subscribeToZoomLevel(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}};onActiveChanged=e=>{const t=this.#e.subscribeToActiveSceneChange(e);return()=>{this.#e.isDeleted()||pt(this.#e.unsubscribe(t))}}};function Vt(e,t){const r=new Set;function n(n){r.add(n);e?.(((e,...t)=>{n(e);for(const e of t)n(e)}));return()=>{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}u([ct],SceneAPI.prototype,"loadFromString",1),u([ct],SceneAPI.prototype,"loadFromURL",1),u([ct],SceneAPI.prototype,"create",1),u([ct],SceneAPI.prototype,"createVideo",1),u([ct],SceneAPI.prototype,"createFromImage",1),u([ct],SceneAPI.prototype,"createFromVideo",1),u([ut],SceneAPI.prototype,"get",1),u([ct],SceneAPI.prototype,"applyTemplateFromString",1),u([ct],SceneAPI.prototype,"applyTemplateFromURL",1),u([ut],SceneAPI.prototype,"getMode",1),u([ct],SceneAPI.prototype,"setDesignUnit",1),u([ut],SceneAPI.prototype,"getDesignUnit",1),u([ut],SceneAPI.prototype,"getPages",1),u([ut],SceneAPI.prototype,"getCurrentPage",1),u([ut],SceneAPI.prototype,"findNearestToViewPortCenterByType",1),u([ut],SceneAPI.prototype,"findNearestToViewPortCenterByKind",1),u([ct],SceneAPI.prototype,"setZoomLevel",1),u([ut],SceneAPI.prototype,"getZoomLevel",1),u([ct],SceneAPI.prototype,"zoomToBlock",1),u([ct],SceneAPI.prototype,"enableZoomAutoFit",1),u([ct],SceneAPI.prototype,"disableZoomAutoFit",1),u([ut],SceneAPI.prototype,"isZoomAutoFitEnabled",1);var zt=e=>t=>function(r){return t((function(t){r(e(t))}))};function Wt(e){return t=>function(r){let n=!1;const o=t((function(e){n=!0,r(e)}));return n||r(e instanceof Function?e():e),o}}var Gt=(e=((e,t)=>e===t))=>t=>function(r){let n;return t((function(t){e(t,n)||(n=t,r(t))}))},Yt=e=>{const t=new Set;let r=null;return function(n){return t.add(n),null===r&&(r=e((function(e){t.forEach((t=>t(e)))}))),function(){t.delete(n),0===t.size&&(r?.(),r=null)}}};function Xt(e,...t){return t.reduce(((e,t)=>t(e)),e)}var Zt=(...e)=>{const t=Array.from(e);return function(e){const r=t.map((function(t){return t(e)}));return function(){for(const e of r)e()}}};function Kt(e){return function(t){let r=null;const n=e((function(e){r?.(),r=e?e(t):e}));return function(){n(),r?.(),r=null}}}function Qt(...e){const t=Array.from(e);return function(e){const r=new Array(t.length),n=t.map(((t,n)=>t((function(t){r[n]=t,e(r)}))));return function(){n.forEach((e=>e())),r.length=0}}}var Jt=Symbol("NO_VALUE");function er(e){let t=Jt;const r=Vt();return{subscribe:r,value:()=>(t===Jt&&(t=e()),t),update(e){t=e,r.emit(t)}}}var tr=class{#o;#i=null;#a;constructor(e){this.#o=e;const t=Vt((()=>{1===t.handlers.size&&this.#s()}),(()=>{0===t.handlers.size&&this.#i?.()}));this.#a=t}dispose(){this.#a.handlers.clear(),this.#i?.()}#s(){if(this.#i)throw new Error("Settings Changed Event callback is already registered.");const e=this.#o.onSettingsChanged((()=>{this.#a.emit()}));this.#i=()=>{e(),this.#i=null}}#u(e){const t=()=>this.#o.getSettingBool(e);return{subscribe:Xt((e=>this.#a(e)),zt(t),Gt(),Yt),update:t=>{this.#o.setSettingBool(e,t),this.#a.emit()},value:t}}#c(e){const t=()=>this.#o.getSettingEnum(e);return{subscribe:Xt((e=>this.#a(e)),zt(t),Gt(),Yt),update:t=>{this.#o.setSettingEnum(e,t),this.#a.emit()},value:t}}#l(e){const t=()=>this.#o.getSettingString(e);return{subscribe:Xt((e=>this.#a(e)),zt(t),Gt(),Yt),update:t=>{this.#o.setSettingString(e,t),this.#a.emit()},value:t}}singlePageMode=this.#u("features/singlePageModeEnabled");role=this.#c("role");pageTitleShow=this.#u("page/title/show");pageTitleshowPageTitleTemplate=this.#u("page/title/showPageTitleTemplate");pageTitleAppendPageName=this.#u("page/title/appendPageName");pageTitleShowOnSinglePage=this.#u("page/title/showOnSinglePage");separator=this.#l("page/title/separator");pageTitleFont=this.#l("page/title/fontFileUri");dimOutOfPageAreas=this.#u("page/dimOutOfPageAreas");singlePointPanning=this.#u("touch/singlePointPanning");touchPinchAction=this.#c("touch/pinchAction");touchRotateAction=this.#c("touch/rotateAction");dragStartCanSelect=this.#u("touch/dragStartCanSelect");featureHspSelectiveAdjustmentsEnabled=this.#u("features/hspSelectiveAdjustmentsEnabled");featureLayerListEnabled=this.#u("features/layerListEnabled");unstable_videoExportInactivityTimeout=er((()=>1e4))},VariableAPI=class{#e;constructor(e){this.#e=e}findAll(){return mt(this.#e.findAllVariables())}setString(e,t){return Ot("key",e,Dt()),Ot("value",t,Dt()),pt(this.#e.setVariableString(e,t))}getString(e){return Ot("key",e,Dt()),pt(this.#e.getVariableString(e))}remove(e){return Ot("key",e,Dt()),pt(this.#e.removeVariable(e))}},rr={Info:"Info",Warning:"Warning",Error:"Error"};function nr(e,t){const r=`[UBQ] ${e}`;switch(t){case"Warning":console.warn(r);break;case"Error":console.error(r);break;case"Info":console.info(r);break;default:console.log(r)}}var or={baseURL:"/extensions/",entries:["ly.img.cesdk.fonts"]};function ir(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function ar(e){return"/"!==e[e.length-1]?`${e}/`:e}var sr=async function(e,t,r=fetch,n,o=new Set(n.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),n=t.startsWith("/");return r&&n?`${e.substring(0,e.length-1)}${t}`:r||n?`${e}${t}`:`${e}/${t}`}(t,`/${e}/content.json`);return r(i).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()})).then((r=>{if(void 0===r.assets)throw new Error(`Invalid content.json for assets: ${e}`);const i=r.assets;o.has(e)||n.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,n])=>{const o=n.toString();if(o.includes("{{base_url}}")){const n=o.replace("{{base_url}}",t);r.meta&&(r.meta[e]=n)}})),r.payload?.sourceSet&&r.payload.sourceSet.forEach((e=>{e.uri.includes("{{base_url}}")&&(e.uri=e.uri.replace("{{base_url}}",t))})),n.addAssetToSource(e,r)}))}))}));await Promise.all(i)};var ur=async function(e,t,r,n){const o=["ly.img.sticker","ly.img.vectorpath","ly.img.colors.defaultPalette","ly.img.filter.lut","ly.img.filter.duotone","ly.img.effect","ly.img.blur"].filter((e=>!r.includes(e)));await sr(o,t,n,e)};var cr=async function(e,t,r,n,o,i,a="https://cdn.img.ly/assets/demo/v2"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!o||r.includes(u)||s.has(u)||e.addLocalSource(u,["image/jpeg","image/png","image/webp","image/svg+xml","image/gif","image/bmp"]);const c="ly.img.video.upload";"Video"!==n||!o||r.includes(c)||s.has(c)||e.addLocalSource(c,["video/mp4","video/quicktime"]);const l="ly.img.audio.upload";"Video"!==n||!o||r.includes(l)||s.has(l)||e.addLocalSource(l,["audio/mpeg","audio/x-m4a","audio/m4a","audio/mp3"]);const d=["ly.img.image","ly.img.video","ly.img.audio"].filter((e=>!r.includes(e)));s.has("ly.img.template")||r.includes("ly.img.template")||(e.addLocalSource("ly.img.template",void 0,(async e=>{const r=e.meta?.uri;if(r)if(r.startsWith("UBQ1"))t.applyTemplateFromString(r);else{const e=new URL(r,window.location.href);t.applyTemplateFromURL(e.href)}})),d.push("ly.img.template")),await sr(d,a,i,e)};function lr(e,t){let r;const n=new Set;function o(){const n=window.devicePixelRatio,{width:i,height:a}=e.getBoundingClientRect();t(i*n,a*n,n),r=matchMedia(`(resolution: ${n}dppx)`),r.addEventListener("change",o,{once:!0})}o();const i=new ResizeObserver((function([e]){const{width:r,height:o}=e.target.getBoundingClientRect();if(r<=0||o<=0)return;const i=window.devicePixelRatio,a=setTimeout((function(){n.delete(a),t(r*i,o*i,i)}),0);n.add(a)}));return i.observe(e),()=>{r.removeEventListener("change",o),i.disconnect();for(const e of n)clearTimeout(e);n.clear(),e=null,t=null}}var dr=s(Xe()),fr=(e=>(e.Scene="ubq/designblocks/SceneProps",e.Camera="ubq/designblocks/Camera",e.Common="ubq/designblocks/CommonDesignBlockProps",e.Page="ubq/designblocks/Page",e.Image="ubq/designblocks/Image",e.Video="ubq/designblocks/Video",e.Audio="ubq/designblocks/Audio",e.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/Text",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState",e.DesignBlockFrame="ubq/designblocks/DesignBlockFrame",e.Size="ubq/layout/Size",e.Position="ubq/layout/Position",e.EulerRotation="ubq/scene/EulerRotation",e.Children="ubq/scene/Children",e))(fr||{}),pr=fr,hr=s(rt());function mr(e,t){const{block:r,event:n}=t;return Xt((t=>{const o=r.getType(e),i=(0,hr.default)(n.subscribe([e],(n=>{n.some((e=>"Destroyed"===e.type))&&!r.isValid(e)||r.getType(e)!==o?i():t(n)})));return i}),Yt)}var gr=function(e,t,r,n){const o=function(e,t){if(!t)return e;let r;return(...n)=>{const o=e(...n);return t(o,r)||(r=o),r}}(t,n?.equals),i=Vt();return{subscribe:Xt(Zt(e,i),zt(o),Gt(),Yt),update:r,value:o,flush:()=>i.emit()}};var yr=class{settings;clampCamera=!1;clampResult=er((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})));zoomLevel;#d;viewportPadding=er((()=>({x:40,y:48})));autoFit;scrollPercentage;sceneSize;scroll;constructor(e){const{block:t,scene:r,_ubq:n}=e,o=Xt(r.onActiveChanged,Wt(),zt((()=>r.get()))),i=Xt(o,zt((r=>null!=r&&t.isValid(r)?Xt(mr(r,e),Wt([]),zt((()=>t.getFloat(r,"scene/dpi")))):()=>()=>{})),Kt),a=Xt(o,zt((()=>{const r=t.findByType("camera")[0];return null==r?()=>()=>{}:Xt(mr(r,e),Wt([]),zt((()=>r)))})),Kt);this.settings={subscribe:Xt(a,zt((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),Gt(dr.default),Yt),update({width:e,height:r,pixelRatio:n}){const o=t.findByType("camera")[0];null!=o&&(t.setFloat(o,"camera/resolution/width",e),t.setFloat(o,"camera/resolution/height",r),t.setFloat(o,"camera/pixelRatio",n))},value(){const e=t.findByType("camera")[0];return null==e?{width:0,height:0,pixelRatio:1}:{width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}}},this.zoomLevel=gr(Zt(r.onZoomLevelChanged,i),(()=>{const e=r.get();return null!=e&&t.isValid(e)?r.getZoomLevel():1}),(e=>{const n=r.get();null!=n&&t.isValid(n)&&r.setZoomLevel(e)})),this.#d={subscribe:Xt(a,zt((e=>new ft(n).getValue(e,pr.Camera,"zoomLevel"))),Gt()),value(){const e=t.findByType("camera")[0];return null==e?1:new ft(n).getValue(e,pr.Camera,"zoomLevel")}},this.autoFit=gr(r.onZoomLevelChanged,(()=>{const e=r.get();return null!=e&&r.isZoomAutoFitEnabled(e)})),this.scrollPercentage={subscribe:Xt(this.clampResult.subscribe,zt((e=>e.scrollPercentage)),Gt(dr.default)),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:Xt(Qt(this.clampResult.subscribe,this.#d.subscribe,this.settings.subscribe),zt((([e,t,r])=>{const n=e?.sceneSize??this.clampResult.value().sceneSize??{x:0,y:0},o=t??this.#d.value()??10,i=r?.pixelRatio??this.settings.value().pixelRatio??1;return{x:n.x*o/i,y:n.y*o/i}})),Gt(dr.default)),value:()=>{const e=this.clampResult.value().sceneSize??{x:0,y:0},t=this.#d.value()??10,r=this.settings.value().pixelRatio??1;return{x:e.x*t/r,y:e.y*t/r}}},this.scroll=e=>{const r=t.findByType("camera")[0];if(null==r)return;const n=this.#d.value(),o=this.settings.value().pixelRatio,i=e.x*o/n,a=e.y*o/n,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}};function br(e,t,r=void 0){const n=e=>{pt(t.setContext("")),e.preventDefault()},o=e=>{pt(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",n,!1),e.addEventListener("webglcontextrestored",o,!1),()=>{e.removeEventListener("webglcontextlost",n),e.removeEventListener("webglcontextrestored",o)}}var vr=!1;var wr="https://api.img.ly/activate";var Er=s(ot()),_r="./cesdk-v1.20.0-rc.1-DTDUIA7U.data",Cr="./cesdk-v1.20.0-rc.1-PVCJXNLE.wasm",Sr=Er.default,xr=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",kr=-1!==xr.indexOf("Edge"),Tr=!!xr.match(/msie|trident/i),Ar=/\b(iPad|iPhone|iPod)\b/.test(xr)&&/WebKit/.test(xr)&&!/Edge/.test(xr)&&("undefined"==typeof window||!("MSStream"in window)),Pr=(e,t)=>{if(null!=t){return[t,e.split("/").pop()].join("")}return new URL(e,window.location.origin)};function qr(){try{return new WebAssembly.Memory({initial:Fr(Ar?512:32),maximum:Fr(2048)})}catch(e){return new WebAssembly.Memory({initial:Fr(32),maximum:Fr(2048)})}}function Fr(e){return 1024*e*1024/65536}async function Lr(e,t){const{core:r}=t,n=t.logger,o=Pr(Cr,r.baseURL).toString(),i=Pr(_r,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(wr,{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:qr()};Sr(c).then((async n=>{n.specialHTMLTargets["!canvas"]=e;n.emscripten_ubq_settings_forceWebGL1=!!t?.forceWebGL1;const o=pt(n.createEngine("!canvas",t.audioOutput??"auto"));!function(e,t){if(!t)throw new Error("Missing license key");pt(e.unlockWithLicense(t))}(o,await s),function(e,t){const r=new ft(e),n=new EditorAPI(e),o=new AssetAPI(e);n.setSettingEnum("role",t.role??"Creator"),"Adopter"===t.role&&n.setSettingEnum("doubleClickSelectionMode","Direct"),vr&&(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",vr||!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(){vr&&(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);(vr||"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)}))}async function Dr(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}var Rr=class{_reactor;_updateHandler=null;debugName;dirty=!0;readCalls=new Set;constructor(e,t){this.debugName=t,this._reactor=e}dispose(){this._updateHandler=null,this._reactor._unregisterReaction(this),this._reactor=null}track(e){return this._reactor._trackReaction(this,e)}subscribe(e){return this._reactor._registerReaction(this),this._updateHandler=e,()=>{this._updateHandler=null,this._reactor._unregisterReaction(this)}}update(){this._updateHandler?.()}},Br=s(Xe()),Mr=Symbol("NO_VALUE"),Ir=class{callId;_value;_readCurrentValue;constructor(e,t){this.callId=e,this._value=t(),this._readCurrentValue=t}updateValueAndCheckDirty(){try{const e=this._readCurrentValue();return(0,Br.default)(this._value,e)?(this._value=e,!1):(this._value=e,!0)}catch(e){return this._value=Mr,!0}}update(e){this._readCurrentValue=e}},Or=class{readCalls=new Map;readCache=new Map;registeredReactions=new Set;activeReactions=new Set;updatingDirtyReactions=0;_getterCalled(e,t){if(this.activeReactions.size<=0)return;const r=this._readThroughCache.bind(this,e,t);if(this.readCalls.has(e)){this.readCalls.get(e).update(r)}else this.readCalls.set(e,new Ir(e,r));for(const t of this.activeReactions)t.readCalls.add(e)}_setterCalled(){this._clearReadCache()}_readThroughCache(e,t){if(this.updatingDirtyReactions&&this.readCache.has(e))return this.readCache.get(e);const r=t();return this.readCache.set(e,r),r}wrapUpdateReactor=function(e){if(this.#f>10)throw new Error("Too many nested engine updates");const t=this.#f++;t>1&&console.warn("wrapUpdateReactor: nested update detected",t);try{e(),this._updateDirtyReactions()}finally{if(--this.#f!==t)throw new Error("Unexpected engine update nesting")}}.bind(this);#f=0;createReaction(e){return new Rr(this,e)}_registerReaction(e){this.registeredReactions.add(e)}_unregisterReaction(e){this.registeredReactions.delete(e)}_clearReadCache(){this.readCache.clear()}_cleanupReadCalls(){const e=new Set;for(const t of this.registeredReactions)for(const r of t.readCalls)e.add(r);for(const[t]of this.readCalls)e.has(t)||this.readCalls.delete(t)}#p=new Set;_updateDirtyReactions(){try{this.updatingDirtyReactions++,this._clearReadCache();const e=new Set;for(const[t,r]of this.readCalls)r.updateValueAndCheckDirty()&&e.add(t);if(e.size>0)for(const t of this.registeredReactions)for(const r of t.readCalls)if(e.has(r)){t.dirty=!0;break}for(const e of this.registeredReactions)if(!this.#p.has(e)&&e.dirty){this.#p.add(e);try{e.update()}finally{this.#p.delete(e)}e.dirty=!1}this._cleanupReadCalls()}finally{this.updatingDirtyReactions--}}_trackReaction(e,t){try{return this.activeReactions.add(e),e.readCalls.clear(),t()}finally{e.dirty=!1,this.activeReactions.delete(e)}}decorateFunction(e,t){return function(e,t,r=t.name){dt[r]??=0;const n=dt[r]++;return function(...o){const i=this,a=`${r}${n}-${JSON.stringify(o,null,0)}`;function s(){return Reflect.apply(t,i,o)}return e._getterCalled(a,s),e._readThroughCache(a,s)}}(this,e,t)}decorateObject(e){return function(e,t){const r=t.constructor?.name??crypto.randomUUID(),n=[];let o=!1;const i=Object.getOwnPropertyNames(t.constructor.prototype).concat(Object.getOwnPropertyNames(t));for(const s of i){const i=t[s];if("function"==typeof(a=i)&&st in a)if("getter"===i[st].type){let a=function(...t){if(o)throw new Error("Disposed @getter proxy called");const n=this,a=`${r}-${s.toString()}-${JSON.stringify(t,null,0)}`;function u(){return Reflect.apply(i,n,t)}return e._getterCalled(a,u),e._readThroughCache(a,u)};const u=Object.hasOwnProperty.call(t,"fnName")?()=>{t[s]=i}:()=>delete t[s];n.push(u),t[s]=a}else if("setter"===i[st].type){let r=function(...t){if(o)throw new Error("Disposed @setter proxy called");const r=this;return e._setterCalled(),Reflect.apply(i,r,t)};const a=Object.hasOwnProperty.call(t,"fnName")?()=>{t[s]=i}:()=>delete t[s];n.push(a),t[s]=r}}var a;return function(){o=!0;for(const e of n)e();n.length=0}}(this,e)}dispose(){this.registeredReactions.forEach((e=>e.dispose())),this.registeredReactions.clear(),this.readCalls.clear(),this.activeReactions.clear(),this.readCache.clear()}},jr='url("data:image/svg+xml,%3Csvg width=%2722%27 height=%2725%27 viewBox=%270 0 22 25%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg filter=%27url(%23filter0_d)%27%3E%3Cpath d=%27M18 11.1071C18 14.5637 15.5566 17.4515 12.3314 18.0846V20L7.20308 17.0145L12.3314 14.0289V15.7825C14.3292 15.1951 15.7946 13.3221 15.7946 11.107C15.7946 8.42285 13.6437 6.23908 11 6.23908C8.35629 6.23908 6.20542 8.42285 6.20542 11.107C6.20542 11.8299 6.35745 12.5252 6.65738 13.1736L4.66118 14.1255C4.22245 13.1771 4 12.1616 4 11.1071C4.00007 7.18825 7.1403 4 11.0001 4C14.8599 4 18 7.18825 18 11.1071Z%27 fill=%27black%27/%3E%3Cpath d=%27M12.8314 15.0559V14.0289V13.1593L12.0799 13.5968L6.95152 16.5824L6.20927 17.0145L6.95152 17.4466L12.0799 20.4321L12.8314 20.8696V20V18.4841C16.0889 17.6521 18.5 14.6573 18.5 11.1071C18.5 6.9193 15.1431 3.5 11.0001 3.5C6.85702 3.5 3.50008 6.91929 3.5 11.1071V11.1071C3.5 12.2334 3.73793 13.3206 4.20739 14.3354L4.41978 14.7946L4.8764 14.5768L6.8726 13.6249L7.31866 13.4122L7.11118 12.9637C6.84206 12.3819 6.70542 11.7584 6.70542 11.107C6.70542 8.69181 8.63956 6.73908 11 6.73908C13.3604 6.73908 15.2946 8.69181 15.2946 11.107C15.2946 12.8513 14.2837 14.3564 12.8314 15.0559Z%27 stroke=%27white%27/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id=%27filter0_d%27 x=%270.0599999%27 y=%270.0599999%27 width=%2721.88%27 height=%2724.6193%27 filterUnits=%27userSpaceOnUse%27 color-interpolation-filters=%27sRGB%27%3E%3CfeFlood flood-opacity=%270%27 result=%27BackgroundImageFix%27/%3E%3CfeColorMatrix in=%27SourceAlpha%27 type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0%27/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation=%271.47%27/%3E%3CfeColorMatrix type=%27matrix%27 values=%270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0%27/%3E%3CfeBlend mode=%27normal%27 in2=%27BackgroundImageFix%27 result=%27effect1_dropShadow%27/%3E%3CfeBlend mode=%27normal%27 in=%27SourceGraphic%27 in2=%27effect1_dropShadow%27 result=%27shape%27/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer';function Ur(e,t){let r;return t.onStateChanged((()=>{const n=function(e,t){switch(e){case"Arrow":return"default";case"Move":return"move";case"MoveNotPermitted":return"auto";case"Resize":{const e=180*t/Math.PI+45;if(!Tr&&!kr)return`url("data:image/svg+xml,%3Csvg style='transform: rotate(${e}deg)' width ='22' height ='22' viewBox ='0 0 22 22' fill ='none' xmlns ='http://www.w3.org/2000/svg'%3E%3Cg filter ='url(%23filter0_d)'%3E%3Cpath d ='M13.7 11.1L9.7 15.2L12.5 18H4V9.5L6.9 12.3L10.9 8.3L12.3 6.9L9.5 4H18V12.5L15.2 9.7L13.7 11.1Z' fill ='white'/%3E%3C/g%3E%3Cpath d ='M12.7 10.7L8.3 15.2L10.1 17H5V11.9L6.9 13.8L11.3 9.3L13.8 6.9L11.9 5H17V10.1L15.2 8.3L12.7 10.7Z' fill ='black'/%3E%3Cdefs%3E%3Cfilter id ='filter0_d' x ='0' y ='0' width ='22' height ='22' filterUnits ='userSpaceOnUse' color-interpolation-filters ='sRGB'%3E%3CfeFlood flood-opacity ='0' result ='BackgroundImageFix'/%3E%3CfeColorMatrix in ='SourceAlpha' type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation ='2'/%3E%3CfeColorMatrix type ='matrix' values ='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0'/%3E%3CfeBlend mode ='normal' in2 ='BackgroundImageFix' result ='effect1_dropShadow'/%3E%3CfeBlend mode ='normal' in ='SourceGraphic' in2 ='effect1_dropShadow' result ='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") 12 12, pointer`;switch(e){case 90:case 270:return"nwse-resize";case 135:case 315:return"ns-resize";case 180:case 360:return"nesw-resize";case 225:return"ew-resize";default:return"move"}}case"Rotate":return jr;case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(n!==r){r=n;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(t)&&e.style.setProperty("cursor",n)}}))}var $r=function(e,t,r){let n,o=null;const i=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||o?"Text"!==n&&o&&(o(),o=null):o=function(){let n=o();return()=>{n?.()};function o(){let i=!1,a="";if(null==e.parentElement)return console.warn('Could not attach hidden text input to the DOM: Canvas has no parentElement. This can happen if edit mode is switched to "Text", while the canvas is removed from the DOM.'),()=>{};const s=c();d();const u=f();return e.parentElement.appendChild(s),p(),()=>{u(),l()};function c(){const e=document.createElement("textarea");return e.id="ubq_internal-inline_text_editing_html_representation",e.setAttribute("data-cy","inline-text-editing-input"),e.autocapitalize="none",e.spellcheck=!1,e.cols=4096,e.style.contain="strict",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="-1px",e.style.overflow="hidden",e.style.clip="rect(0, 0, 0, 0)",e.style.border="0",e}function l(){s.blur(),s.remove()}function d(){const t=r.getTextCursorPositionInScreenSpaceX(),n=r.getTextCursorPositionInScreenSpaceY(),{left:o,top:i}=e.getBoundingClientRect();s.style.left=`${o+t/window.devicePixelRatio}px`,s.style.top=`${i+n/window.devicePixelRatio}px`}function f(){const t=e.getRootNode();s.addEventListener("input",E),s.addEventListener("keydown",C),s.addEventListener("copy",b),s.addEventListener("cut",v),s.addEventListener("compositionstart",S),s.addEventListener("compositionend",x),s.addEventListener("beforeinput",P),s.addEventListener("focusout",q),t.addEventListener("touchend",A),t.addEventListener("mousedown",A),t.addEventListener("mouseup",T);const n=r.onStateChanged((()=>{d()}));return()=>{s.removeEventListener("input",E),s.removeEventListener("keydown",C),s.removeEventListener("copy",b),s.removeEventListener("cut",v),s.removeEventListener("compositionstart",S),s.removeEventListener("compositionend",x),s.removeEventListener("beforeinput",P),s.removeEventListener("focusout",q),t.removeEventListener("mousedown",A),t.removeEventListener("mouseup",T),t.removeEventListener("touchend",A),n()}}function p(){null!==s.parentElement&&(s.focus(),h()||setTimeout((()=>s.focus()),0))}function h(){return s.getRootNode().activeElement===s}function m(){i=!1,n(),n=o()}function g(e){return[...e].length}function y(e){const t=e.selectionEnd??e.selectionStart??0;return g(e.value.substring(0,t))}function b(e){try{t.useInternalAPI((t=>{const r=pt(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function v(e){try{t.useInternalAPI((r=>{const n=pt(r.getSelectedText());if(""!==n&&e.clipboardData){e.clipboardData.setData("text/plain",n),e.preventDefault();const r={key:44,characters:"",shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}}))}catch(e){console.error(e)}}async function w(){return!(!i||t.ubq.unstable_isTextCursorInCompositionRange())&&(await x(),!0)}function E(e){const r=e.target,{value:n}=r;if(i){const e=y(s);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&(r.value="")}function _(e){const r={key:255,characters:e,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",r)}async function C(e){if(w(),1===e.key.length&&(a=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return i&&x(),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void R();if("Backspace"!==e.key&&"Delete"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&"ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"Enter"!==e.key)return;const r=function(e){const t={key:255,characters:e.key,shiftIsHeld:e.shiftKey,commandIsHeld:e.metaKey||e.ctrlKey,optionIsHeld:e.altKey,timestamp:Date.now()};switch(e.key.toUpperCase()){case"0":t.key=0;break;case"1":t.key=1;break;case"2":t.key=2;break;case"3":t.key=3;break;case"4":t.key=4;break;case"5":t.key=5;break;case"6":t.key=6;break;case"7":t.key=7;break;case"8":t.key=8;break;case"9":t.key=9;break;case"A":t.key=10;break;case"B":t.key=11;break;case"C":t.key=12;break;case"D":t.key=13;break;case"E":t.key=14;break;case"F":t.key=15;break;case"G":t.key=16;break;case"H":t.key=17;break;case"I":t.key=18;break;case"J":t.key=19;break;case"K":t.key=20;break;case"L":t.key=21;break;case"M":t.key=22;break;case"N":t.key=23;break;case"O":t.key=24;break;case"P":t.key=25;break;case"Q":t.key=26;break;case"R":t.key=27;break;case"S":t.key=28;break;case"T":t.key=29;break;case"U":t.key=30;break;case"V":t.key=31;break;case"W":t.key=32;break;case"X":t.key=33;break;case"Y":t.key=34;break;case"Z":t.key=35;break;case" ":t.key=42;break;case"ESCAPE":t.key=43,t.characters="";break;case"BACKSPACE":t.key=40,t.characters="";break;case"DELETE":t.key=44,t.characters="";break;case"ENTER":t.key=41,t.characters=t.shiftIsHeld?"\u2028":"\n";break;case"CONTROL":t.key=45,t.characters="";break;case"ALT":t.key=46,t.characters="";break;case"SHIFT":t.key=47,t.characters="";break;case"ARROWLEFT":t.key=36,t.characters="";break;case"ARROWRIGHT":t.key=37,t.characters="";break;case"ARROWUP":t.key=38,t.characters="";break;case"ARROWDOWN":t.key=39,t.characters="";break;case"DEAD":t.key=255,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",r),e.currentTarget&&(s.value="")}async function S(){i=!0,await t.execute("ubq/text/compositionStart")}async function x(){i?(i=!1,s.value="",m(),t.execute("ubq/text/compositionEnd")):s.value=""}async function k(){if(!i)return;t.ubq.update();if(await w())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),n=e.end-r.start,o=y(s);e.start>=r.start&&e.start<=1+r.end&&n!==o&&x()}async function T(){k()}async function A(t){k(),t.target===e&&"Text"===r.getEditMode()&&(p(),t.preventDefault())}async function P(e){if(i&&!e.isComposing&&x(),null===e.data)return;const r=e.target,n=e.data;if(await w())_(a);else if(i){const e=g(n);t.execute("ubq/text/compositionUpdate",{value:n,cursorPosition:e})}else n.length>0&&("\n"!==n[0]&&_(n),r.value="")}function q(e){if(D(e.relatedTarget)&&F(e.relatedTarget));else{L(e)}}function F(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}function L(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),n=e.dispatchEvent(r);return n&&p(),n}function D(e){return null!=e&&(e instanceof HTMLElement&&(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&e.type.match("^(text|number|url|email|search|tel)$")||e.isContentEditable))}async function R(){r.setEditMode("Transform")}}}()}));return()=>{o?.(),i()}};function Hr(e,t){const r=[],n=r=>{if("touch"===r.pointerType)return;const n=Nr(e,r);t.execute("ubq/inputs/mousemove",n)},o=n=>{if("touch"===n.pointerType)return;const o={...Nr(e,n),button:Vr(n.button),state:0,shiftIsHeld:!!n.shiftKey};r[n.button]=!1,n.currentTarget.releasePointerCapture(n.pointerId),t.execute("ubq/inputs/mousebutton",o),t.ubq.update()},i=n=>{if("touch"===n.pointerType)return;const o={...Nr(e,n),button:Vr(n.button),state:1,shiftIsHeld:!!n.shiftKey};r[n.button]=!0,n.currentTarget.setPointerCapture(n.pointerId),t.execute("ubq/inputs/mousebutton",o)},a=n=>{if("touch"===n.pointerType)return;const o={...Nr(e,n),shiftIsHeld:!!n.shiftKey};r.forEach(((e,r)=>{if(e){const e={...o,button:r,state:0};t.execute("ubq/inputs/mousebutton",e)}})),r.length=0},s=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",i),e.addEventListener("pointerup",o),e.addEventListener("pointercancel",o),e.addEventListener("pointermove",n),e.addEventListener("lostpointercapture",a),e.addEventListener("touchmove",s,{passive:!1}),()=>{e.removeEventListener("pointerdown",i),e.removeEventListener("pointerup",o),e.removeEventListener("pointercancel",o),e.removeEventListener("pointermove",n),e.removeEventListener("lostpointercapture",a),e.removeEventListener("touchmove",s),e=null}}function Nr(e,t){const r=e.getBoundingClientRect(),n=r?.top??0,o=r?.left??0;return{position:{x:(t.clientX-o)*window.devicePixelRatio,y:(t.clientY-n)*window.devicePixelRatio},isTouch:!1,timestamp:t.timeStamp}}function Vr(e){switch(e){case 0:return 0;case 1:return 2;case 2:return 1;default:return 255}}var zr=class{ubq;enabled;initialTarget;target;dispose;constructor(e,t){this.ubq=t,this.enabled=gr(e.editor.onSettingsChanged,(()=>{const t=e.editor.getSettingBool("mouse/enableZoom"),r=e.editor.getSettingBool("mouse/enableScroll");return t||r})),this.target=er((()=>{})),this.dispose=()=>{this.target.update(void 0),this.target=null,this.enabled=null,this.ubq=null,this.initialTarget=null,e=null,t=null}}initialize(e){let t;this.initialTarget=e;const r=Zt(this.enabled.subscribe,this.target.subscribe)((()=>{t?.(),t=void 0;const e=this.target.value();this.enabled.value()&&e&&(t=this.addWheelListener(e))}));this.target.update(e);return()=>{r(),t?.()}}setTarget(e){this.target.update(e);return()=>{this.target.update(this.initialTarget)}}addWheelListener(e){const t=e=>{if(!this.initialTarget)throw new Error("initialTarget is not set");const t={...Nr(this.initialTarget,e),deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode,shiftIsHeld:!!e.shiftKey,ctrlOrMetaIsHeld:!!e.ctrlKey||!!e.metaKey};this.ubq.mouseWheel(t)&&(e.stopPropagation(),e.preventDefault())};e.addEventListener("wheel",t,{passive:!1,capture:!0});return()=>{e.removeEventListener("wheel",t,{capture:!0}),e=null}}},Wr=class{active=!1;enableDebug=!1;timestamp=0;baseTouches=[];touches=[];currentTransform;constructor(){this.currentTransform=this.emptyTransform()}touchAddRemove(e){const t=new Array(e.touches.length);for(let r=0;r<e.touches.length;r++){const n=e.touches.item(r);t[r]=Gr(n)}this.touches=t}touchUpdate(e){for(let t=0;t<e.touches.length;t++){const r=e.touches.item(t),n=this.touches.find((e=>e.identifier===r.identifier));if(!n)return;n.x=r.clientX,n.y=r.clientY}}listen(e){return e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchcancel),e.addEventListener("touchmove",this.touchmove),()=>{e.removeEventListener("touchstart",this.touchstart),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.touchcancel),e.removeEventListener("touchmove",this.touchmove)}}touchstart=e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchstart")};touchend=e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchend")};touchcancel=e=>{this.touchAddRemove(e),this.timestamp=e.timeStamp,this.process("touchcancel")};touchmove=e=>{this.touchUpdate(e),this.timestamp=e.timeStamp,this.process("touchmove")};debugState;debug(){if(!this.enableDebug)return;const e=JSON.stringify(this.currentTransform);function t(e,[t,r,n],o){const i=document.createElement("div");return i.style.position="fixed",i.style.top="-25px",i.style.left="-25px",i.style.width="50px",i.style.height="50px",i.style.border=`3px ${o} rgb(${t},${r},${n})`,i.style.borderRadius="50%",i.style.borderStyle=o,i.style.backgroundColor=`rgba(${t},${r},${n}, 0.5)`,i.style.transformOrigin="center",i.style.textAlign="center",i.innerHTML=e,i.style.display="none",document.body.appendChild(i),i}this.debugState||(this.debugState={touches:[t("T1",[218,212,104],"solid"),t("T2",[218,212,104],"solid")],value:this.debugValueDiv(void 0,e,this.touches,[218,212,104]),baseTouches:[t("B1",[128,128,128],"solid"),t("B2",[128,128,128],"solid")]}),this.debugState.touches[0].style.display=this.touches[0]?"block":"none",this.debugState.touches[1].style.display=this.touches[1]?"block":"none",this.debugState.baseTouches[0].style.display=this.baseTouches[0]?"block":"none",this.debugState.baseTouches[1].style.display=this.baseTouches[1]?"block":"none",this.touches[0]&&(this.debugState.touches[0].style.transform=`translate(${this.touches[0]?.x}px, ${this.touches[0]?.y}px)`),this.touches[1]&&(this.debugState.touches[1].style.transform=`translate(${this.touches[1]?.x}px, ${this.touches[1]?.y}px)`),this.baseTouches[0]&&(this.debugState.baseTouches[0].style.transform=`translate(${this.baseTouches[0]?.x}px, ${this.baseTouches[0]?.y}px)`),this.baseTouches[1]&&(this.debugState.baseTouches[1].style.transform=`translate(${this.baseTouches[1]?.x}px, ${this.baseTouches[1]?.y}px)`),this.debugState.value=this.debugValueDiv(this.debugState.value,e,this.touches)}debugValueDiv(e,t,r,n){if(!e){const[t,r,o]=n??[128,128,128];(e=document.createElement("div")).style.position="fixed",e.style.top="50px",e.style.left="50px",e.style.width="300px",e.style.height="100px",e.style.border=`3px solid rgb(${t},${r},${o})`,e.style.borderStyle="dashed",e.style.backgroundColor=`rgba(${t},${r},${o}, 0.5)`,e.style.transformOrigin="center",e.style.overflow="visible",e.style.textOverflow="visible",e.style.display="none",document.body.appendChild(e)}return this.active?e.style.borderStyle="solid":e.style.borderStyle="dashed",0===r.length?(e.style.display="none",e):(e.style.display="block",e.innerHTML=t,e)}resetBaseTouches(){this.baseTouches=this.touches.map(Gr)}process(e){if("touchcancel"===e)return this.resetBaseTouches(),this.reset(),this.debug(),void this.emit(2);"touchstart"!==e&&"touchend"!==e||(this.resetBaseTouches(),this.debug()),!this.active&&this.shouldStart()&&(this.active=!0,this.emit(0)),"touchmove"===e&&(this.currentTransform=this.calculateTransform(),this.active&&this.emit(1)),this.debug(),this.active&&this.shouldStop()&&(this.active=!1,this.emit(2),this.reset())}shouldStart(){return 2===this.touches.length}shouldStop(){return 2!==this.touches.length}emit(e){const t={timestamp:this.timestamp,state:e,touchPoints:this.touches},r=this.makeEvent(t);for(const e of this.handlers)e(r)}handlers=new Set;addListener(e){return this.handlers.add(e),()=>{this.handlers.delete(e)}}reset(){this.active=!1,this.currentTransform=this.emptyTransform()}};function Gr(e){if(null!=e)return e instanceof Touch?{identifier:e.identifier,x:e.clientX,y:e.clientY}:{identifier:e.identifier,x:e.x,y:e.y}}var Yr=class _PanRecognizer extends Wr{static PAN_THRESHOLD=10;makeEvent(e){const t=0===e.state?{x:0,y:0}:this.currentTransform;return{...e,panDistance:t}}calculateTransform(){const e=Zr(this.touches),t=Zr(this.baseTouches);return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return super.shouldStart()&&Xr(this.calculateTransform())>_PanRecognizer.PAN_THRESHOLD}};function Xr(e){return Math.sqrt(e.x**2+e.y**2)}function Zr(e){let t=0,r=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.x,r+=o.y}return t/=e.length,r/=e.length,{x:t,y:r}}var Kr=class _PinchRecognizer extends Wr{static PINCH_THRESHOLD=.2;makeEvent(e){return{...e,scale:this.currentTransform}}calculateTransform(){const e=this.baseTouches,t=this.touches;if(2!==e.length||2!==t.length)return 1;const r=Math.sqrt(Math.pow(e[0].x-e[1].x,2)+Math.pow(e[0].y-e[1].y,2));return Math.sqrt(Math.pow(t[0].x-t[1].x,2)+Math.pow(t[0].y-t[1].y,2))/r}emptyTransform(){return 1}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform()-1)>_PinchRecognizer.PINCH_THRESHOLD}},Qr=class _PointRecognizer extends Wr{static DISTANCE_THRESHOLD=5;static TAP_MAX_TIME=250;lastPosition={x:0,y:0};makeEvent(e){const t=this.tapDetected?this.tapLocation:e.touchPoints[0];return 0===e.state?(this.lastPosition=t,{button:0,state:1,position:t,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}):2===e.state?{button:0,state:0,position:t??this.lastPosition,shiftIsHeld:!1,isTouch:!0,timestamp:e.timestamp}:(this.lastPosition=t,{position:t,isTouch:!0,timestamp:e.timestamp})}previousNumTouches=0;fingerDownTimestamp=0;tapDetected=!1;tapLocation={x:0,y:0};process(e){if("touchstart"===e||"touchend"===e){this.tapDetected=!1;const e=1===this.touches.length&&0===this.previousNumTouches,t=0===this.touches.length&&1===this.previousNumTouches;e&&(this.fingerDownTimestamp=performance.now(),this.tapLocation=this.touches[0]),t&&performance.now()-this.fingerDownTimestamp<_PointRecognizer.TAP_MAX_TIME&&(this.tapDetected=!0),this.previousNumTouches=this.touches.length}super.process(e)}calculateTransform(){if(0===this.touches.length||0===this.baseTouches.length)return{x:0,y:0};const e=this.touches[0],t=this.baseTouches[0];return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return this.tapDetected||1===this.touches.length&&Xr(this.calculateTransform())>_PointRecognizer.DISTANCE_THRESHOLD}shouldStop(){return 1!==this.touches.length}},Jr=class _RotateRecognizer extends Wr{static ROTATE_THRESHOLD=.1;makeEvent(e){return{...e,rotation:this.currentTransform}}calculateTransform(){const e=this.baseTouches,t=this.touches;if(e.length<2||t.length<2)return 0;const r=Math.atan2(e[1].y-e[0].y,e[1].x-e[0].x);return Math.atan2(t[1].y-t[0].y,t[1].x-t[0].x)-r}emptyTransform(){return 0}shouldStart(){return super.shouldStart()&&Math.abs(this.calculateTransform())>_RotateRecognizer.ROTATE_THRESHOLD}};function en(e,t){const r=[],n=new Qr;r.push(n.listen(e)),r.push(n.addListener((r=>{"button"in r?t.execute("ubq/inputs/mousebutton",tn(e,r)):t.execute("ubq/inputs/mousemove",tn(e,r))})));const o=new Yr;r.push(o.listen(e)),r.push(o.addListener((r=>{t.execute("ubq/inputs/touchpan",tn(e,r))})));const i=new Kr;r.push(i.listen(e)),r.push(i.addListener((r=>{t.execute("ubq/inputs/touchpinch",tn(e,r))})));const a=new Jr;return r.push(a.listen(e)),r.push(a.addListener((r=>{t.execute("ubq/inputs/touchrotate",tn(e,r))}))),()=>{r.forEach((e=>e()))}}function tn(e,t){const r=window.devicePixelRatio??1,{top:n,left:o}=e.getBoundingClientRect();if(1===r&&0===n&&0===o)return t;const i=e=>({x:(e.x-o)*r,y:(e.y-n)*r});if("position"in t)return{...t,position:i(t.position)};const a=t.touchPoints.map(i);return"panDistance"in t?{...t,touchPoints:a,panDistance:i(t.panDistance)}:{...t,touchPoints:a}}function rn(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}var nn,on,an="assets/core/worker-host-v1.20.0-rc.1-HLK2ZNSZ.js",sn="application/javascript";(on=nn||(nn={})).start=function(e){return{...e,msg:"exportVideo"}},on.abort=function(){return{msg:"exportVideoAbort"}},on.finished=function(e){return{...e,msg:"exportVideoFinished"}},on.error=function(e){return{...e,msg:"exportVideoError"}},on.progress=function(e){return{...e,msg:"exportVideoProgress"}},on.log=function(e){return{...e,msg:"exportLog"}};var un=class{configuration;constructor(e){this.configuration=e}async exportVideo(e,t,r,n,o){const{abortSignal:i,inactivityTimeout:a}=o??{},s=await async function(e){const t=an.toString().split("/").pop(),r=await async function(e,t=!0){if(!(e=e.toString()).includes("://")||e.includes(window.location.origin))return e;const r=await fetch(e).then((e=>e.text())),n=new URL(e).href.split("/").slice(0,-1).join("/"),o=`data:${sn},${encodeURIComponent(`const _importScripts = importScripts;\n const _fixImports = (url) => new URL(url, '${n}/').href;\n importScripts = (...urls) => _importScripts(...urls.map(_fixImports));`+r)}`;return t?URL.createObjectURL(new Blob([`importScripts("${o}")`],{type:sn})):o}(new URL(t,e.core.baseURL));return new Worker(r)}(this.configuration),u=function(e){return{baseURL:e.baseURL,license:e.license,core:e.core,presets:e.presets,featureFlags:e.featureFlags,forceWebGL1:e.forceWebGL1,audioOutput:e.audioOutput,extensions:e.extensions}}(this.configuration),c=new Promise(((e,t)=>{if(s.onmessage=({data:r})=>{if("exportVideoFinished"===r.msg){const t=new Blob([r.data],{type:r.mimeType});e(t)}else"exportVideoError"===r.msg?t(r.error):"exportVideoProgress"===r.msg||("exportLog"===r.msg?this.configuration.logger(r.message,r.logLevel):console.error("Unknown message received ",r))},i){let e=!1;const t=()=>{e||(e=!0,s.postMessage(nn.abort()))};i.addEventListener("abort",t,{once:!0})}}));s.postMessage(nn.start({sceneString:e,engineSettings:t,pluginURLs:r,config:u,exportOptions:n,inactivityTimeout:a}));const l=()=>{s.postMessage({msg:"setVisibility",visible:"visible"===document.visibilityState})};return document.addEventListener("visibilitychange",l),c.finally((()=>{s.terminate(),document.removeEventListener("visibilitychange",l)})),c}};var cn=10,ln=1e4;globalThis.ubq_browserTabHidden=!0;var dn={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)}}}};function fn(e,t,r){return async(n,o,i,a)=>{const s=t.scene.get();if(null==s||!t.block.isValid(s))throw new Error("No valid scene available.");const u=await t.scene.saveToString(),c=function(e){const t=new Map,r=e.findAllSettings();for(const n of r)switch(e.getSettingType(n)){case"Bool":t.set(n,e.getSettingBool(n));break;case"Int":t.set(n,e.getSettingInt(n));break;case"Float":t.set(n,e.getSettingFloat(n));break;case"String":t.set(n,e.getSettingString(n));break;case"Color":t.set(n,e.getSettingColor(n));break;case"Enum":t.set(n,e.getSettingEnum(n))}return t}(t.editor),l=t.settings.unstable_videoExportInactivityTimeout.value(),d=t.editor.getActiveLicense();if(e.featureFlags?.exportWorker??1){return new un({...e,license:d}).exportVideo(u,c,r,a,{abortSignal:a.abortSignal,inactivityTimeout:l})}return async function(e,t,r,n,o={},i){let a,s,u=0,c=null;const l=i?.visibility??dn;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>ln)a(new Error("Video export timed out due to inactivity."));else{if(u<cn){for(const e of _)e.update?.(C);m.update()}s=setTimeout(d,1)}};const h=new OffscreenCanvas(64,64),m=await Lr(h,{...e,audioOutput:"none"}),g=new AssetAPI(m),y=new SceneAPI(m),b=new BlockAPI(m),v=new EditorAPI(m),w=new EventAPI(m),E=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 _=await Promise.all(r.map((e=>Dr(e)))),C={asset:g,block:b,scene:y,editor:v,event:w,variable:E};for(const e of _)e.initialize?.(C);const S=await y.loadFromString(n),x=b.getTotalSceneDuration(y.get());d();const k=await new Promise(((t,r)=>{a=r,e.abortSignal?.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),m.exportVideoToBuffer(o.block??S,o.timeOffset??0,o.duration??x,Ht.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(k.byteLength);return T.set(k),p(),T}catch(e){throw p(),e}}(a.abortSignal?{...e,abortSignal:a.abortSignal}:e,c,r,u,{block:n,width:a.targetWidth,height:a.targetHeight,...a},{onProgress:i,visibility:mn,inactivityTimeout:l}).then((e=>new Blob([e],{type:Ht.Mp4})))}}var pn,hn,mn={value:()=>"visible"===document.visibilityState,subscribe:Xt((pn=document,hn="visibilitychange",function(e){return pn.addEventListener(hn,e),function(){pn.removeEventListener(hn,e)}}),zt((()=>"visible"===document.visibilityState)))},CreativeEngine=class{asset;block;editor;event;scene;variable;#h;reactor;#m;#g;#y;#b;#v;#w=[];#E=[];#e;#_=[];constructor(e,t,r){this.#e=e,this.#g=new ft(e),this.asset=new AssetAPI(e),this.block=new BlockAPI(e),this.editor=new EditorAPI(e),this.event=new EventAPI(e),this.scene=new SceneAPI(e),this.variable=new VariableAPI(e),this.#h=new tr(this.editor),this.#v=new zr(this,e),this.#_.push(this.#v.dispose);const n=new Or;this.reactor=n;const o=[this.reactor.decorateObject(this.#g),this.reactor.decorateObject(this.block),this.reactor.decorateObject(this.editor),this.reactor.decorateObject(this.scene)],i=this.wrapUpdate(n.wrapUpdateReactor);this.#_.push((()=>{o.forEach((e=>e())),i(),this.reactor.dispose()})),this.block.exportVideo=fn(r,{block:this.block,scene:this.scene,editor:this.editor,settings:this.#h},this.#w),"getInternalCanvas"in t?(this.#y=t.getInternalCanvas(),this.#b=t):this.#y=t,this.#m=new yr(this),this.#C(),"undefined"!=typeof window&&window.Cypress&&(this.config=r,this.helper=this.#g)}async unstable_addPlugin(e){null!=e.url&&this.#w.push(e.url);const t=e.url?await Dr(e.url):e;if(t.initialize){const e={asset:this.asset,block:this.block,scene:this.scene,editor:this.editor,event:this.event,variable:this.variable};t.initialize(e)}this.#E.push(t)}unstable_setVideoExportInactivityTimeout(e){this.#h.unstable_videoExportInactivityTimeout.update(e)}#S(){if(!this.#b)return;const e=this.#b.getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,n=t.width*r,o=t.height*r;e.width!==n&&(e.width=n),e.height!==o&&(e.height=o)}#x(){const{width:e,height:t}=this.#y,r="undefined"!=typeof window?window.devicePixelRatio:1,{height:n,width:o,pixelRatio:i}=this.#m.settings.value();rn(o,e,1e-4)&&rn(n,t,1e-4)&&rn(i,r,1e-4)||this.#m.settings.update({height:t,width:e,pixelRatio:window.devicePixelRatio})}#k=[];wrapUpdate(e){return this.#k.push(e),()=>{const t=this.#k.indexOf(e);-1!==t&&this.#k.splice(t,1)}}#T(){return e=>{this.#k.reduce(((e,t)=>function(){let r=!1;if(t((function(){r=!0,e()})),!r)throw new Error(`Wrapper did not call update: ${t.toString()}`)}),this.#A.bind(this,e))()}}#P;#C(e=!0){this.#q(e),this.#F()}#q(e=!0){let t,r=!1,n=0;if(this.#P)return;const o=()=>{const i=this.#T();if(this.#P=requestAnimationFrame(o),!r)try{i(e),n=0}catch(e){throw n++,n>=10&&(console.error("Repeated exceptions in update loop. Stopping loop."),t?.(),this.#L()),e}};this.#P=requestAnimationFrame(o)}#F(){if(e=this.#y,!("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement))return;var e;const t=this.#b??this.#y,r=[Hr(t,this.#g),this.#v.initialize(t),$r(t,this.#g,this.editor),Ur(t,this.editor),en(t,this.#g),br(this.#y,this.#e,(()=>{this.#y.width=this.#y.width})),lr(t,this.#D)];this.#R=()=>{r.reverse().forEach((e=>e()))}}setWheelEventTarget(e){return this.#v.setTarget(e)}#D=(0,it.default)(function(){this.#A()}.bind(this),100,{leading:!0,trailing:!1});#R;#L(){this.#R?.(),this.#R=void 0,this.#P&&(cancelAnimationFrame(this.#P),this.#P=0)}#A(e=!0){for(const e of this.#E)e.update?.(this);if(e){1===this.block.findByType("scene").length&&this.#B()}this.#S(),this.#x(),this.#e.update()}#B(){if(this.#m.clampCamera){const e={sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}};this.#g.execute("cesdk/clampCameraAndRender",{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y}).then((e=>{(0,at.default)(this.#m.clampResult.value(),e)||this.#m.clampResult.update(e)}),(()=>{(0,at.default)(this.#m.clampResult.value(),e)||this.#m.clampResult.update(e)}))}else this.#g.execute("ubq/render")}get element(){return this.#b}dispose(){this.#_.forEach((e=>e())),this.#L(),this.asset.dispose(),this.#y=null,this.#b?.dispose(),this.#b=void 0,this.#g=null,this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,this.#k.length=0,this.#e.delete(),this.#e=null}static async init(e,t){let r=function(e,t){if(r(t?.canvas))return t?.canvas;if(r(e))return console.warn("Passing an existing HTMLCanvasElement as a second parameter to CreativeEngine.init() is deprecated. Use the element property on the CreativeEngine instance to access a fully managed canvas to append into the DOM instead. For more information, have a look into our documentation at https://img.ly/docs/cesdk/next/engine/quickstart/#initialization."),e;return;function r(e){return"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}}(t,e);const n="7978b4b7a7";let o;n&&console.log(`[CreativeEngine] Revision ${n}`),r||(o=function(){customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",class HTMLCreativeEngineCanvasElement extends HTMLElement{#y;constructor(){super(),this.#y=document.createElement("canvas");const e=document.createElement("style");e.textContent=":host {display: block; width: 100%; height: 100%; contain: content;} canvas {position: absolute; inset: 0; width: 100%; height:100%; display: block; touch-action: none;}",this.attachShadow({mode:"closed"}).append(e,this.#y)}getInternalCanvas(){if(!this.#y)throw new Error("Internal canvas element is undefined");return this.#y}dispose(){this.#y?.remove(),this.#y=void 0}clear(){if(!this.#y)return;const e=this.#y.width;this.#y.width=1,this.#y.width=e}});return document.createElement("cesdk-canvas")}(),r=o.getInternalCanvas());const i=function(e){return e&&"callbacks"in e&&e.callbacks?.log&&!e.logger?{...e,logger:e.callbacks.log}:e}(e),a=function(e={},t="https://cdn.img.ly/packages/imgly/cesdk-engine/1.20.0-rc.1/assets"){const r={...e,license:e.license??"",featureFlags:e.featureFlags??{},baseURL:e.baseURL??t,core:e.core??{baseURL:"core/"},extensions:e.extensions??{...or},logger:e.logger??nr,presets:e.presets??{}};return r.extensions.baseURL??=or.baseURL,r.extensions.entries??={...or.entries},r.baseURL=ir(r.baseURL),r.baseURL=ar(r.baseURL),r.core.baseURL=ir(r.core.baseURL,r.baseURL),r.core.baseURL=ar(r.core.baseURL),r.extensions.baseURL=ar(r.extensions.baseURL),r.extensions.entries=r.extensions.entries.map((e=>ar(e))),r}(i);if(!function(e){return!0===e?._skipConfigWarnings}(e))for(const t of function(e){const t=[];return e?("callbacks"in e&&e.callbacks?.log&&t.push("config.callbacks.log has been moved to config.logger"),e.scene&&t.push("config.scene options have been removed. You can set a scene's dpi and pixelScaleFactor via the BlockApi's setInt(sceneId, 'scene/dpi', dpi) and setInt(sceneId, 'scene/pixelScaleFactor', factor)."),e.page&&t.push("config.page options have been moved to the EditorAPI"),e.variables&&t.push("config.variables has been removed. Please use the VariableAPI instead"),t):t}(e))a.logger(t,"Warning");const s=new this(await Lr(r,a),o??r,a);return function(e,t){if(e)try{const r=t.editor;if(null!=e.page?.title?.show&&r.setSettingBool("page/title/show",e.page.title.show),null!=e.page?.title?.fontFileUri&&r.setSettingString("page/title/fontFileUri",e.page?.title?.fontFileUri),null!=e.page?.dimOutOfPageAreas&&r.setSettingBool("page/dimOutOfPageAreas",e.page?.dimOutOfPageAreas),e.variables)for(const r in e.variables)if(Object.prototype.hasOwnProperty.call(e.variables,r)){const n=e.variables[r];t.variable.setString(r,String(n.value))}}catch(e){console.error(e)}}(e,s),s}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v2",excludeAssetSourceIds:t=[]}={}){return ur(this.asset,e,t)}async addDemoAssetSources({baseURL:e="https://cdn.img.ly/assets/demo/v2",excludeAssetSourceIds:t=[],sceneMode:r="Design",withUploadAssetSources:n=!1}={}){return cr(this.asset,this.scene,t,r,n,void 0,e)}get _ubq(){return this.#e}get _camera(){return this.#m}get _helper(){return this.#g}};var gn=function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){return console.error(e),!1}return!1},yn=1e4,bn=1e6;async function vn(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window))throw new Error("Missing required web video APIs");const e={codec:"avc1.4D0034",width:1920,height:1080,avc:{format:"annexb"},framerate:30};if(!await VideoEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");const t=new OffscreenCanvas(e.width,e.height),r=t.getContext("webgl2");if(!r)throw new Error("Could not create WebGL2 context");return r.clearColor(1,0,1,1),r.clear(r.COLOR_BUFFER_BIT),new Promise(((r,n)=>{setTimeout((()=>{n(new Error("Timed out during video export"))}),yn);const o=new VideoEncoder({output:()=>r(!0),error:e=>n(e)});o.configure(e);const i=new VideoFrame(t,{timestamp:0,duration:bn/e.framerate});o.encode(i,{keyFrame:!0}),i.close(),o.flush().then((()=>{"closed"!==o.state&&o.close()}))}))}async function wn(){if("undefined"==typeof window)throw new Error("Window is undefined");if(!("AudioDecoder"in window&&"AudioEncoder"in window))throw new Error("Missing required web audio APIs");const e={codec:"mp4a.40.02",sampleRate:48e3,numberOfChannels:2,bitrate:128e3};if(!await AudioEncoder.isConfigSupported(e))throw new Error("Encoder config not supported");return new Promise(((t,r)=>{setTimeout((()=>{r(new Error("Timed out during audio export"))}),yn);const n=new AudioEncoder({output:()=>t(!0),error:r});n.configure(e);const o=1024,i=new Float32Array(o*e.numberOfChannels);for(let e=0;e<o;++e){const t=e/o;i[2*e+0]=Math.sin(880*Math.PI*t),i[2*e+1]=Math.sin(888*Math.PI*t)}for(let t=0;t<10;++t){const r=new AudioData({format:"f32",sampleRate:e.sampleRate,numberOfFrames:o,numberOfChannels:e.numberOfChannels,timestamp:t*o/e.sampleRate*bn,data:i});n.encode(r),r.close()}n.flush().then((()=>{"closed"!==n.state&&n.close()}))}))}function En(){if("undefined"==typeof window)return!1;return"VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window&&"AudioDecoder"in window&&"AudioEncoder"in window}function _n(){return Promise.all([vn(),wn()]).then((e=>e.every((e=>e))),(()=>!1))}var Cn=function(){try{const e=!0,t=!0,r="globalThis"in window,n="BigInt"in window,o="allSettled"in Promise,i="matchAll"in String.prototype,a=CSS.supports("(display: flex) and (gap: 8px)"),s="MediaRecorder"in window&&"pause"in window.MediaRecorder.prototype,u=CSS.supports("selector(:not(a, .b))"),c=CSS.supports("selector(:is(a))");return gn()&&e&&t&&r&&n&&o&&i&&a&&s&&u&&c}catch{return!1}};export{rr as LogLevel,Ht as MimeType,un as WorkerClient,CreativeEngine as default,Cn as supportsBrowser,En as supportsVideo,_n as supportsVideoExport,gn as supportsWasm};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
ieee754/index.js:
|