@cesdk/engine 1.27.0 → 1.27.1-rc.0
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.27.0-T7MJDZHJ.wasm → cesdk-v1.27.1-rc.0-EY6RHE4D.wasm} +0 -0
- package/assets/core/{worker-host-v1.27.0-WBISL7KQ.js → worker-host-v1.27.1-rc.0-KDJMPE3L.js} +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- /package/assets/core/{cesdk-v1.27.0-46BMFTP2.data → cesdk-v1.27.1-rc.0-46BMFTP2.data} +0 -0
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,a=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},s=(a,s,u)=>(u=null!=a?e(n(a)):{},((e,n,a,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))i.call(e,u)||u===a||t(e,u,{get:()=>n[u],enumerable:!(s=r(n,u))||s.enumerable});return e})(!s&&a&&a.__esModule?u:t(u,"default",{value:a,enumerable:!0}),a)),u=(e,o,n,i)=>{for(var a,s=i>1?void 0:i?r(o,n):o,u=e.length-1;u>=0;u--)(a=e[u])&&(s=(i?a(o,n,s):a(s))||s);return i&&s&&t(o,n,s),s},c=(e,r,o)=>(((e,r,o)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o})(e,"symbol"!=typeof r?r+"":r,o),o),l=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},d=(e,t,r)=>(l(e,t,"read from private field"),r?r.call(e):t.get(e)),p=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h=(e,t,r,o)=>(l(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r),f=(e,t,r)=>(l(e,t,"access private method"),r),m=a({"../../../node_modules/lodash/isObject.js"(e,t){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}}),g=a({"../../../node_modules/lodash/_freeGlobal.js"(e,t){var r="object"==typeof global&&global&&global.Object===Object&&global;t.exports=r}}),y=a({"../../../node_modules/lodash/_root.js"(e,t){var r=g(),o="object"==typeof self&&self&&self.Object===Object&&self,n=r||o||Function("return this")();t.exports=n}}),b=a({"../../../node_modules/lodash/now.js"(e,t){var r=y();t.exports=function(){return r.Date.now()}}}),v=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}}}),w=a({"../../../node_modules/lodash/_baseTrim.js"(e,t){var r=v(),o=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}}}),_=a({"../../../node_modules/lodash/_Symbol.js"(e,t){var r=y().Symbol;t.exports=r}}),E=a({"../../../node_modules/lodash/_getRawTag.js"(e,t){var r=_(),o=Object.prototype,n=o.hasOwnProperty,i=o.toString,a=r?r.toStringTag:void 0;t.exports=function(e){var t=n.call(e,a),r=e[a];try{e[a]=void 0;var o=!0}catch(e){}var s=i.call(e);return o&&(t?e[a]=r:delete e[a]),s}}}),S=a({"../../../node_modules/lodash/_objectToString.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}}}),C=a({"../../../node_modules/lodash/_baseGetTag.js"(e,t){var r=_(),o=E(),n=S(),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)?o(e):n(e)}}}),k=a({"../../../node_modules/lodash/isObjectLike.js"(e,t){t.exports=function(e){return null!=e&&"object"==typeof e}}}),x=a({"../../../node_modules/lodash/isSymbol.js"(e,t){var r=C(),o=k();t.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}}}),T=a({"../../../node_modules/lodash/toNumber.js"(e,t){var r=w(),o=m(),n=x(),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(n(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(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=a({"../../../node_modules/lodash/debounce.js"(e,t){var r=m(),o=b(),n=T(),i=Math.max,a=Math.min;t.exports=function(e,t,s){var u,c,l,d,p,h,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var r=u,o=c;return u=c=void 0,f=t,d=e.apply(o,r)}function v(e){var r=e-h;return void 0===h||r>=t||r<0||g&&e-f>=l}function w(){var e=o();if(v(e))return _(e);p=setTimeout(w,function(e){var r=t-(e-h);return g?a(r,l-(e-f)):r}(e))}function _(e){return p=void 0,y&&u?b(e):(u=c=void 0,d)}function E(){var e=o(),r=v(e);if(u=arguments,c=this,h=e,r){if(void 0===p)return function(e){return f=e,p=setTimeout(w,t),m?b(e):d}(h);if(g)return clearTimeout(p),p=setTimeout(w,t),b(h)}return void 0===p&&(p=setTimeout(w,t)),d}return t=n(t)||0,r(s)&&(m=!!s.leading,l=(g="maxWait"in s)?i(n(s.maxWait)||0,t):l,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==p&&clearTimeout(p),f=0,u=h=c=p=void 0},E.flush=function(){return void 0===p?d:_(o())},E}}}),P=a({"../../../node_modules/lodash/_listCacheClear.js"(e,t){t.exports=function(){this.__data__=[],this.size=0}}}),q=a({"../../../node_modules/lodash/eq.js"(e,t){t.exports=function(e,t){return e===t||e!=e&&t!=t}}}),F=a({"../../../node_modules/lodash/_assocIndexOf.js"(e,t){var r=q();t.exports=function(e,t){for(var o=e.length;o--;)if(r(e[o][0],t))return o;return-1}}}),L=a({"../../../node_modules/lodash/_listCacheDelete.js"(e,t){var r=F(),o=Array.prototype.splice;t.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}}}),B=a({"../../../node_modules/lodash/_listCacheGet.js"(e,t){var r=F();t.exports=function(e){var t=this.__data__,o=r(t,e);return o<0?void 0:t[o][1]}}}),D=a({"../../../node_modules/lodash/_listCacheHas.js"(e,t){var r=F();t.exports=function(e){return r(this.__data__,e)>-1}}}),R=a({"../../../node_modules/lodash/_listCacheSet.js"(e,t){var r=F();t.exports=function(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}}}),M=a({"../../../node_modules/lodash/_ListCache.js"(e,t){var r=P(),o=L(),n=B(),i=D(),a=R();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),I=a({"../../../node_modules/lodash/_stackClear.js"(e,t){var r=M();t.exports=function(){this.__data__=new r,this.size=0}}}),O=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}}}),j=a({"../../../node_modules/lodash/_stackGet.js"(e,t){t.exports=function(e){return this.__data__.get(e)}}}),U=a({"../../../node_modules/lodash/_stackHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),$=a({"../../../node_modules/lodash/isFunction.js"(e,t){var r=C(),o=m();t.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}}}),N=a({"../../../node_modules/lodash/_coreJsData.js"(e,t){var r=y()["__core-js_shared__"];t.exports=r}}),H=a({"../../../node_modules/lodash/_isMasked.js"(e,t){var r,o=N(),n=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!n&&n in e}}}),V=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""}}}),W=a({"../../../node_modules/lodash/_baseIsNative.js"(e,t){var r=$(),o=H(),n=m(),i=V(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,d=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!n(e)||o(e))&&(r(e)?d:a).test(i(e))}}}),z=a({"../../../node_modules/lodash/_getValue.js"(e,t){t.exports=function(e,t){return null==e?void 0:e[t]}}}),G=a({"../../../node_modules/lodash/_getNative.js"(e,t){var r=W(),o=z();t.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}}}),Y=a({"../../../node_modules/lodash/_Map.js"(e,t){var r=G()(y(),"Map");t.exports=r}}),X=a({"../../../node_modules/lodash/_nativeCreate.js"(e,t){var r=G()(Object,"create");t.exports=r}}),Z=a({"../../../node_modules/lodash/_hashClear.js"(e,t){var r=X();t.exports=function(){this.__data__=r?r(null):{},this.size=0}}}),K=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}}}),Q=a({"../../../node_modules/lodash/_hashGet.js"(e,t){var r=X(),o=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}}}),J=a({"../../../node_modules/lodash/_hashHas.js"(e,t){var r=X(),o=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}}}),ee=a({"../../../node_modules/lodash/_hashSet.js"(e,t){var r=X();t.exports=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}}}),te=a({"../../../node_modules/lodash/_Hash.js"(e,t){var r=Z(),o=K(),n=Q(),i=J(),a=ee();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),re=a({"../../../node_modules/lodash/_mapCacheClear.js"(e,t){var r=te(),o=M(),n=Y();t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(n||o),string:new r}}}}),oe=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}}}),ne=a({"../../../node_modules/lodash/_getMapData.js"(e,t){var r=oe();t.exports=function(e,t){var o=e.__data__;return r(t)?o["string"==typeof t?"string":"hash"]:o.map}}}),ie=a({"../../../node_modules/lodash/_mapCacheDelete.js"(e,t){var r=ne();t.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}}}),ae=a({"../../../node_modules/lodash/_mapCacheGet.js"(e,t){var r=ne();t.exports=function(e){return r(this,e).get(e)}}}),se=a({"../../../node_modules/lodash/_mapCacheHas.js"(e,t){var r=ne();t.exports=function(e){return r(this,e).has(e)}}}),ue=a({"../../../node_modules/lodash/_mapCacheSet.js"(e,t){var r=ne();t.exports=function(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}}}),ce=a({"../../../node_modules/lodash/_MapCache.js"(e,t){var r=re(),o=ie(),n=ae(),i=se(),a=ue();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),le=a({"../../../node_modules/lodash/_stackSet.js"(e,t){var r=M(),o=Y(),n=ce();t.exports=function(e,t){var i=this.__data__;if(i instanceof r){var a=i.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new n(a)}return i.set(e,t),this.size=i.size,this}}}),de=a({"../../../node_modules/lodash/_Stack.js"(e,t){var r=M(),o=I(),n=O(),i=j(),a=U(),s=le();function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u}}),pe=a({"../../../node_modules/lodash/_setCacheAdd.js"(e,t){t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}}),he=a({"../../../node_modules/lodash/_setCacheHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),fe=a({"../../../node_modules/lodash/_SetCache.js"(e,t){var r=ce(),o=pe(),n=he();function i(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new r;++t<o;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=n,t.exports=i}}),me=a({"../../../node_modules/lodash/_arraySome.js"(e,t){t.exports=function(e,t){for(var r=-1,o=null==e?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1}}}),ge=a({"../../../node_modules/lodash/_cacheHas.js"(e,t){t.exports=function(e,t){return e.has(t)}}}),ye=a({"../../../node_modules/lodash/_equalArrays.js"(e,t){var r=fe(),o=me(),n=ge();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 p=u.get(e),h=u.get(t);if(p&&h)return p==t&&h==e;var f=-1,m=!0,g=2&i?new r:void 0;for(u.set(e,t),u.set(t,e);++f<l;){var y=e[f],b=t[f];if(a)var v=c?a(b,y,f,t,e,u):a(y,b,f,e,t,u);if(void 0!==v){if(v)continue;m=!1;break}if(g){if(!o(t,(function(e,t){if(!n(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}}}),be=a({"../../../node_modules/lodash/_Uint8Array.js"(e,t){var r=y().Uint8Array;t.exports=r}}),ve=a({"../../../node_modules/lodash/_mapToArray.js"(e,t){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}}}),we=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}}}),_e=a({"../../../node_modules/lodash/_equalByTag.js"(e,t){var r=_(),o=be(),n=q(),i=ye(),a=ve(),s=we(),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 o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+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 h=a;case"[object Set]":var f=1&u;if(h||(h=s),e.size!=t.size&&!f)return!1;var m=p.get(e);if(m)return m==t;u|=2,p.set(e,t);var g=i(h(e),h(t),u,l,d,p);return p.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}}}),Ee=a({"../../../node_modules/lodash/_arrayPush.js"(e,t){t.exports=function(e,t){for(var r=-1,o=t.length,n=e.length;++r<o;)e[n+r]=t[r];return e}}}),Se=a({"../../../node_modules/lodash/isArray.js"(e,t){var r=Array.isArray;t.exports=r}}),Ce=a({"../../../node_modules/lodash/_baseGetAllKeys.js"(e,t){var r=Ee(),o=Se();t.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}}}),ke=a({"../../../node_modules/lodash/_arrayFilter.js"(e,t){t.exports=function(e,t){for(var r=-1,o=null==e?0:e.length,n=0,i=[];++r<o;){var a=e[r];t(a,r,e)&&(i[n++]=a)}return i}}}),xe=a({"../../../node_modules/lodash/stubArray.js"(e,t){t.exports=function(){return[]}}}),Te=a({"../../../node_modules/lodash/_getSymbols.js"(e,t){var r=ke(),o=xe(),n=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),r(i(e),(function(t){return n.call(e,t)})))}:o;t.exports=a}}),Ae=a({"../../../node_modules/lodash/_baseTimes.js"(e,t){t.exports=function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}}}),Pe=a({"../../../node_modules/lodash/_baseIsArguments.js"(e,t){var r=C(),o=k();t.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}}}),qe=a({"../../../node_modules/lodash/isArguments.js"(e,t){var r=Pe(),o=k(),n=Object.prototype,i=n.hasOwnProperty,a=n.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s}}),Fe=a({"../../../node_modules/lodash/stubFalse.js"(e,t){t.exports=function(){return!1}}}),Le=a({"../../../node_modules/lodash/isBuffer.js"(e,t){var r=y(),o=Fe(),n="object"==typeof e&&e&&!e.nodeType&&e,i=n&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===n?r.Buffer:void 0,s=(a?a.isBuffer:void 0)||o;t.exports=s}}),Be=a({"../../../node_modules/lodash/_isIndex.js"(e,t){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}}}),De=a({"../../../node_modules/lodash/isLength.js"(e,t){t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}}),Re=a({"../../../node_modules/lodash/_baseIsTypedArray.js"(e,t){var r=C(),o=De(),n=k(),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 n(e)&&o(e.length)&&!!i[r(e)]}}}),Me=a({"../../../node_modules/lodash/_baseUnary.js"(e,t){t.exports=function(e){return function(t){return e(t)}}}}),Ie=a({"../../../node_modules/lodash/_nodeUtil.js"(e,t){var r=g(),o="object"==typeof e&&e&&!e.nodeType&&e,n=o&&"object"==typeof t&&t&&!t.nodeType&&t,i=n&&n.exports===o&&r.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();t.exports=a}}),Oe=a({"../../../node_modules/lodash/isTypedArray.js"(e,t){var r=Re(),o=Me(),n=Ie(),i=n&&n.isTypedArray,a=i?o(i):r;t.exports=a}}),je=a({"../../../node_modules/lodash/_arrayLikeKeys.js"(e,t){var r=Ae(),o=qe(),n=Se(),i=Le(),a=Be(),s=Oe(),u=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=n(e),l=!c&&o(e),d=!c&&!l&&i(e),p=!c&&!l&&!d&&s(e),h=c||l||d||p,f=h?r(e.length,String):[],m=f.length;for(var g in e)!t&&!u.call(e,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||f.push(g);return f}}}),Ue=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)}}}),$e=a({"../../../node_modules/lodash/_overArg.js"(e,t){t.exports=function(e,t){return function(r){return e(t(r))}}}}),Ne=a({"../../../node_modules/lodash/_nativeKeys.js"(e,t){var r=$e()(Object.keys,Object);t.exports=r}}),He=a({"../../../node_modules/lodash/_baseKeys.js"(e,t){var r=Ue(),o=Ne(),n=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return o(e);var t=[];for(var i in Object(e))n.call(e,i)&&"constructor"!=i&&t.push(i);return t}}}),Ve=a({"../../../node_modules/lodash/isArrayLike.js"(e,t){var r=$(),o=De();t.exports=function(e){return null!=e&&o(e.length)&&!r(e)}}}),We=a({"../../../node_modules/lodash/keys.js"(e,t){var r=je(),o=He(),n=Ve();t.exports=function(e){return n(e)?r(e):o(e)}}}),ze=a({"../../../node_modules/lodash/_getAllKeys.js"(e,t){var r=Ce(),o=Te(),n=We();t.exports=function(e){return r(e,n,o)}}}),Ge=a({"../../../node_modules/lodash/_equalObjects.js"(e,t){var r=ze(),o=Object.prototype.hasOwnProperty;t.exports=function(e,t,n,i,a,s){var u=1&n,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:o.call(t,p)))return!1}var h=s.get(e),f=s.get(t);if(h&&f)return h==t&&f==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<l;){var y=e[p=c[d]],b=t[p];if(i)var v=u?i(b,y,p,t,e,s):i(y,b,p,e,t,s);if(!(void 0===v?y===b||a(y,b,n,i,s):v)){m=!1;break}g||(g="constructor"==p)}if(m&&!g){var w=e.constructor,_=t.constructor;w==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(m=!1)}return s.delete(e),s.delete(t),m}}}),Ye=a({"../../../node_modules/lodash/_DataView.js"(e,t){var r=G()(y(),"DataView");t.exports=r}}),Xe=a({"../../../node_modules/lodash/_Promise.js"(e,t){var r=G()(y(),"Promise");t.exports=r}}),Ze=a({"../../../node_modules/lodash/_Set.js"(e,t){var r=G()(y(),"Set");t.exports=r}}),Ke=a({"../../../node_modules/lodash/_WeakMap.js"(e,t){var r=G()(y(),"WeakMap");t.exports=r}}),Qe=a({"../../../node_modules/lodash/_getTag.js"(e,t){var r=Ye(),o=Y(),n=Xe(),i=Ze(),a=Ke(),s=C(),u=V(),c="[object Map]",l="[object Promise]",d="[object Set]",p="[object WeakMap]",h="[object DataView]",f=u(r),m=u(o),g=u(n),y=u(i),b=u(a),v=s;(r&&v(new r(new ArrayBuffer(1)))!=h||o&&v(new o)!=c||n&&v(n.resolve())!=l||i&&v(new i)!=d||a&&v(new a)!=p)&&(v=function(e){var t=s(e),r="[object Object]"==t?e.constructor:void 0,o=r?u(r):"";if(o)switch(o){case f:return h;case m:return c;case g:return l;case y:return d;case b:return p}return t}),t.exports=v}}),Je=a({"../../../node_modules/lodash/_baseIsEqualDeep.js"(e,t){var r=de(),o=ye(),n=_e(),i=Ge(),a=Qe(),s=Se(),u=Le(),c=Oe(),l="[object Arguments]",d="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(e,t,f,m,g,y){var b=s(e),v=s(t),w=b?d:a(e),_=v?d:a(t),E=(w=w==l?p:w)==p,S=(_=_==l?p:_)==p,C=w==_;if(C&&u(e)){if(!u(t))return!1;b=!0,E=!1}if(C&&!E)return y||(y=new r),b||c(e)?o(e,t,f,m,g,y):n(e,t,w,f,m,g,y);if(!(1&f)){var k=E&&h.call(e,"__wrapped__"),x=S&&h.call(t,"__wrapped__");if(k||x){var T=k?e.value():e,A=x?t.value():t;return y||(y=new r),g(T,A,f,m,y)}}return!!C&&(y||(y=new r),i(e,t,f,m,g,y))}}}),et=a({"../../../node_modules/lodash/_baseIsEqual.js"(e,t){var r=Je(),o=k();t.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}}}),tt=a({"../../../node_modules/lodash/isEqual.js"(e,t){var r=et();t.exports=function(e,t){return r(e,t)}}}),rt=a({"../../../node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=a(e),r=t[0],o=t[1];return 3*(r+o)/4-o},e.toByteArray=function(e){var t,r,i=a(e),s=i[0],u=i[1],c=new n(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=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},e.fromByteArray=function(e){for(var t,o=e.length,n=o%3,i=[],a=16383,u=0,c=o-n;u<c;u+=a)i.push(s(e,u,u+a>c?c:u+a));1===n?(t=e[o-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[o-2]<<8)+e[o-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};var t,r=[],o=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,64;t<64;++t)r[t]=i[t],o[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,o){for(var n,i,a=[],s=t;s<o;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=n)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63}}),ot=a({"../../../node_modules/ieee754/index.js"(e){e.read=function(e,t,r,o,n){var i,a,s=8*n-o-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?n-1:0,p=r?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=o;l>0;a=256*a+e[t+d],d+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,o),i-=c}return(h?-1:1)*a*Math.pow(2,i-o)},e.write=function(e,t,r,o,n,i){var a,s,u,c=8*i-n-1,l=(1<<c)-1,d=l>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:i-1,f=o?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?p/u:p*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,n),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;e[r+h]=255&s,h+=f,s/=256,n-=8);for(a=a<<n|s,c+=n;c>0;e[r+h]=255&a,h+=f,a/=256,c-=8);e[r+h-f]|=128*m}}}),nt=a({"../../../node_modules/buffer/index.js"(e){var t=rt(),r=ot(),o="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 n=2147483647;function i(e){if(e>n)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|h(e,t),o=i(r),n=o.write(e,t);n!==r&&(o=o.slice(0,n));return o}(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 o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return a.from(o,t,r);var n=function(e){if(a.isBuffer(e)){var t=0|p(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(n)return n;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|p(e))}function l(e){for(var t=e.length<0?0:0|p(e.length),r=i(t),o=0;o<t;o+=1)r[o]=255&e[o];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 o;return o=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(o,a.prototype),o}function p(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function h(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,o=arguments.length>2&&!0===arguments[2];if(!o&&0===r)return 0;for(var n=!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(n)return o?-1:M(e).length;t=(""+t).toLowerCase(),n=!0}}function f(e,t,r){var o=!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 C(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}function g(e,t,r,o,n){if(0===e.length)return-1;if("string"==typeof r?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),U(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=a.from(t,o)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,o,n){var i,a=1,s=e.length,u=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){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(n){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,p=0;p<u;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function b(e,t,r,o){r=Number(r)||0;var n=e.length-r;o?(o=Number(o))>n&&(o=n):o=n;var i=t.length;o>i/2&&(o=i/2);for(var a=0;a<o;++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,o){return O(M(t,e.length-r),e,r,o)}function w(e,t,r,o){return O(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,o)}function _(e,t,r,o){return O(I(t),e,r,o)}function E(e,t,r,o){return O(function(e,t){for(var r,o,n,i=[],a=0;a<e.length&&!((t-=2)<0);++a)o=(r=e.charCodeAt(a))>>8,n=r%256,i.push(n),i.push(o);return i}(t,e.length-r),e,r,o)}function S(e,r,o){return 0===r&&o===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,o))}function C(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var i,a,s,u,c=e[n],l=null,d=c>239?4:c>223?3:c>191?2:1;if(n+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[n+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[n+1],a=e[n+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[n+1],a=e[n+2],s=e[n+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,o.push(l>>>10&1023|55296),l=56320|1023&l),o.push(l),n+=d}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var r="",o=0;for(;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=k));return r}(o)}e.kMaxLength=n,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,o=t.length,n=0,i=Math.min(r,o);n<i;++n)if(e[n]!==t[n]){r=e[n],o=t[n];break}return r<o?-1:o<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 o=a.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var i=e[r];if(j(i,Uint8Array))n+i.length>o.length?a.from(i).copy(o,n):Uint8Array.prototype.set.call(o,i,n);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,n)}n+=i.length}return o},a.byteLength=h,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?C(this,0,e):f.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+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(e,t,r,o,n){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===o&&(o=0),void 0===n&&(n=this.length),t<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(o>=n&&t>=r)return 0;if(o>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(o>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(i,s),c=this.slice(o,n),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,o){if(void 0===t)o="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)o=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===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){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 _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function x(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(127&e[n]);return o}function T(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(e[n]);return o}function A(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var n="",i=t;i<r;++i)n+=$[e[i]];return n}function P(e,t,r){for(var o=e.slice(t,r),n="",i=0;i<o.length-1;i+=2)n+=String.fromCharCode(o[i]+256*o[i+1]);return n}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,o,n,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}function L(e,t,r,o,n,i){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,o,n,i){return t=+t,o>>>=0,i||L(e,0,o,4),r.write(e,t,o,n,23,4),o+4}function D(e,t,o,n,i){return t=+t,o>>>=0,i||L(e,0,o,8),r.write(e,t,o,n,52,8),o+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 o=this.subarray(e,t);return Object.setPrototypeOf(o,a.prototype),o},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||q(e,t,this.length);for(var o=this[e],n=1,i=0;++i<t&&(n*=256);)o+=this[e+i]*n;return o},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||q(e,t,this.length);for(var o=this[e+--t],n=1;t>0&&(n*=256);)o+=this[e+--t]*n;return o},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 o=this[e],n=1,i=0;++i<t&&(n*=256);)o+=this[e+i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||q(e,t,this.length);for(var o=t,n=1,i=this[e+--o];o>0&&(n*=256);)i+=this[e+--o]*n;return i>=(n*=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,o){(e=+e,t>>>=0,r>>>=0,o)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i<r&&(n*=256);)this[t+i]=e/n&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,o){(e=+e,t>>>=0,r>>>=0,o)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,i=1;for(this[t+n]=255&e;--n>=0&&(i*=256);)this[t+n]=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,o){if(e=+e,t>>>=0,!o){var n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}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,o){if(e=+e,t>>>=0,!o){var n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}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 B(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,o){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o<r&&(o=r),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t<o-r&&(o=e.length-t+r);var n=o-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,o):Uint8Array.prototype.set.call(e,this.subarray(r,o),t),n},a.prototype.fill=function(e,t,r,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!a.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===e.length){var n=e.charCodeAt(0);("utf8"===o&&n<128||"latin1"===o)&&(e=n)}}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,o),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 R=/[^+/0-9A-Za-z-_]/g;function M(e,t){var r;t=t||1/0;for(var o=e.length,n=null,i=[],a=0;a<o;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===o){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=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(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}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 o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}}),it=a({"../../../node_modules/lodash/toFinite.js"(e,t){var r=T(),o=1/0;t.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}}),at=a({"../../../node_modules/lodash/toInteger.js"(e,t){var r=it();t.exports=function(e){var t=r(e),o=t%1;return t==t?o?t-o:t:0}}}),st=a({"../../../node_modules/lodash/before.js"(e,t){var r=at();t.exports=function(e,t){var o;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=void 0),o}}}}),ut=a({"../../../node_modules/lodash/once.js"(e,t){var r=st();t.exports=function(e){return r(2,e)}}}),ct=a({"../../../esbuild/polyfill.noop.js"(){}}),lt=a({"../../../_builds/cesdk/wasm32-unknown-emscripten/Release/cesdk.js"(e,t){var r,o=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r||=__filename),function(e={}){var t,o,n,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)]},o=function(e){return function t(o){var n;"number"==typeof o&&(o=new Uint32Array(2*o)),ArrayBuffer.isView(o)||(o.constructor&&"ArrayBuffer"===o.constructor.name?o=new Uint32Array(o):(n=o,o=new Uint32Array(2*o.length)));var i=new Proxy({slice:(e,r)=>(r??=o.length,t(o.slice(2*e,2*r))),subarray:(e,r)=>t(o.subarray(2*e,2*r)),[Symbol.iterator]:function*(){for(var t=0;t<o.length/2;t++)yield e(o[2*t],o[2*t+1])},BYTES_PER_ELEMENT:2*o.BYTES_PER_ELEMENT,buffer:o.buffer,byteLength:o.byteLength,byteOffset:o.byteOffset,length:o.length/2,copyWithin:function(e,t,r){return o.copyWithin(2*e,2*t,2*r),i},set(e,t){if(t??=0,2*(e.length+t)>o.length)throw new RangeError("offset is out of bounds");for(var n=0;n<e.length;n++){var i=e[n],a=r(i);o.set(a,2*(t+n))}}},{get(t,r,n){if("string"!=typeof r||!/^\d+$/.test(r))return Reflect.get(t,r,n);var i=o[2*r],a=o[2*r+1];return e(i,a)},set(e,t,n,i){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,n,i);if("bigint"!=typeof n)throw new TypeError(`Cannot convert ${n} to a BigInt`);var a=r(n);return o.set(a,2*t),!0}});return n&&i.set(n),i}};globalThis.BigUint64Array=o(t),globalThis.BigInt64Array=o(e)}u.ready=new Promise(((e,r)=>{t=e,o=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,k("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,o=e.remote_package_size,n=null,i=u.getPreloadedPackage?u.getPreloadedPackage(r,o):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 o=e.files,a=0;a<o.length;++a)new r(o[a].start,o[a].end,o[a].audio||0).open("GET",o[a].filename);function s(o){t(o,"Loading data file failed."),t(o.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var n=new Uint8Array(o);r.prototype.byteArray=n;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):n=s}i||function(e,t,r,o){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onprogress=function(r){var o=e,i=t;if(r.total&&(i=r.total),r.loaded){n.addedTotal?u.dataFileDownloads[o].loaded=r.loaded:(n.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[o]={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...")},n.onerror=function(t){throw new Error("NetworkError for: "+e)},n.onload=function(e){if(!(200==n.status||304==n.status||206==n.status||0==n.status&&n.response))throw new Error(n.statusText+" : "+n.responseURL);var t=n.response;r(t)},n.send(null)}else ct().readFile(e,(function(e,t){e?o(e):r(t.buffer)}))}(r,o,(function(e){n?(n(e),n=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:274413},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274413,end:275394},{filename:"/ly.img.cesdk/icu/icudt74l.dat",start:275394,end:810498},{filename:"/ly.img.cesdk/presets/.keep",start:810498,end:810498},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:810498,end:814387},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:814387,end:820704},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:820704,end:825295},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:825295,end:835280},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:835280,end:835770},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:835770,end:838937},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:838937,end:841575},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:841575,end:842522},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:842522,end:843037},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:843037,end:844001},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:844001,end:846118},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:846118,end:847085},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:847085,end:847579},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:847579,end:861179},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:861179,end:861964},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:861964,end:862446},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:862446,end:865309},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:865309,end:865814},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:865814,end:866268},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:866268,end:867905},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:867905,end:868205},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:868205,end:868893},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:868893,end:869105},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:869105,end:869668},{filename:"/ly.img.cesdk/shaders/recolor.sksl",start:869668,end:871869},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:871869,end:874174},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:874174,end:874858},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:874858,end:875440},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:875440,end:876158},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:876158,end:876530}],remote_package_size:876530}),"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=n||(n={}))[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=n.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t,this.abortController=new AbortController,this.abortSignal=this.abortController.signal}async readChunks(e){let t=0;const r=[],o=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;if(this.abortSignal.aborted)throw await t.cancel(),t.releaseLock(),new Error(this.abortSignal.reason);o(r)}t.releaseLock()}else{const t=()=>e.destroy(new Error(this.abortSignal.reason));this.abortSignal.addEventListener("abort",t,{once:!0});try{await new Promise(((t,r)=>{e.on("data",o),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}))}finally{this.abortSignal.removeEventListener("abort",t)}}const n=new Uint8Array(t);let i=0;for(const e of r)n.set(e,i),i+=e.length;return this.finish(n)}abort(){this.isPending()&&this.abortController.abort("Fetch aborted")}isPending(){return this.state===n.PENDING}isError(){return this.state===n.ERROR}isFinished(){return this.state===n.FINISHED}isAllocated(){return this.state===n.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:n.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:n.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:n.ERROR,error:e});return Object.assign(this,t)}}u.emscripten_ubq_asyncFetchManager=new class AsyncFetchManager{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){const t=this._processes.get(e);return(null==t?void 0:t.isPending())&&t.abort(),this._processes.delete(e)}clear(){for(const e of this._processes.values())e.isPending()&&e.abort();this._processes.clear(),this._headers.clear()}fetch(e,t,r,o,n,i,a,s,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)})):this._fetchRemote(p,e,o,n,i,a,s,c).catch((e=>{p.fail(e)})),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=ct(),{fileURLToPath:r}=ct(),o=t.createReadStream(r(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,o,n,i,s,c){const l=u.UTF8ToString(s,c),d=this.getHeaders(r,o),p=t===a.POST?new Uint8Array(u.HEAPU8.buffer,n,i):void 0,h=await this._fetch(e.uri,{method:a[t],headers:d,body:p,mode:"cors",credentials:l,signal:e.abortSignal});if(h.status>=200&&h.status<=209){let t=0;return h.headers.has("Content-Length")&&(t=+h.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(h.body)}return e.fail(h.statusText)}getHeaders(e,t){const r={};for(let o=0;o<t;o++){const t=u.getValue(e+4*o,"i32"),n=this._headers.get(t);r[n.key]=n.value}return r}createHeader(e,t,r,o){const n=u.UTF8ToString(e,t),i=u.UTF8ToString(r,o),a=this._nextHeaderHandle++;return this._headers.set(a,{key:n,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),o=u._malloc(t.length+1),n=u.HEAPU8.subarray(o,o+t.length+1);for(let e=0;e<t.length;e++)n[e]=t[e];n[t.length]=0,r[1]=o}else r[1]=0;return t},u.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:o=>{const n=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=n.length)&&(i=!0),!i){var a=u.ctx;const e=r.decodedFrames%n.length,t=a.getParameter(a.TEXTURE_BINDING_2D);a.bindTexture(a.TEXTURE_2D,n[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,o),a.bindTexture(a.TEXTURE_2D,t)}o.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 o=new AudioDecoder({output:n=>{if(o.flushing)return void n.close();const i=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),s=1===n.numberOfChannels?0:1;if("f32-planar"===n.format){let e=o.writtenFrames%r;if(e+n.numberOfFrames<=r)n.copyTo(i.subarray(e),{planeIndex:0,frameCount:n.numberOfFrames}),n.copyTo(a.subarray(e),{planeIndex:s,frameCount:n.numberOfFrames});else{const t=r-e;n.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),n.copyTo(a.subarray(e),{planeIndex:s,frameCount:t}),n.copyTo(i,{planeIndex:0,frameOffset:t}),n.copyTo(a,{planeIndex:s,frameOffset:t})}o.writtenFrames+=n.numberOfFrames}else if("s16-planar"===n.format)if(1===n.numberOfChannels){const e=new Int16Array(n.numberOfFrames);n.copyTo(e,{planeIndex:0});for(let t=0;t<n.numberOfFrames;t++){const n=e[t]/32768;let s=o.writtenFrames%r;i[s]=n,a[s]=n,o.writtenFrames++}}else{const e=new Int16Array(n.numberOfFrames),t=new Int16Array(n.numberOfFrames);n.copyTo(e,{planeIndex:0}),n.copyTo(t,{planeIndex:1});for(let s=0;s<n.numberOfFrames;s++){let n=o.writtenFrames%r;i[n]=e[s]/32768,a[n]=t[s]/32768,o.writtenFrames++}}else if("s16"===n.format){const e=new Int16Array(n.numberOfFrames*n.numberOfChannels);if(n.copyTo(e,{planeIndex:0}),1===n.numberOfChannels)for(let t=0;t<n.numberOfFrames;t++){const n=e[t]/32768;let s=o.writtenFrames%r;i[s]=n,a[s]=n,o.writtenFrames++}else for(let t=0;t<n.numberOfFrames;t++){let s=o.writtenFrames%r;i[s]=e[t*n.numberOfChannels+0]/32768,a[s]=e[t*n.numberOfChannels+1]/32768,o.writtenFrames++}}else console.error("Unsupported audio format:",n.format);n.close()},error:e=>{o.unexpectedError=e,console.error(e)}});return o.writtenFrames=0,o},u.emscripten_ubq_settings_forceWebGL1=!1;var c,l,d,p=Object.assign({},u),h=[],f="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";if(b){var w=ct(),_=ct();v=y?_.dirname(v)+"/":__dirname+"/",c=(e,t)=>(e=ee(e)?new URL(e):_.normalize(e),w.readFileSync(e,t?void 0:"utf8")),d=e=>{var t=c(e,!0);return t.buffer||(t=new Uint8Array(t)),t},l=(e,t,r,o=!0)=>{e=ee(e)?new URL(e):_.normalize(e),w.readFile(e,o?void 0:"utf8",((e,n)=>{e?r(e):t(o?n.buffer:n)}))},!u.thisProgram&&process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),h=process.argv.slice(2),m=(e,t)=>{throw process.exitCode=e,t}}else(g||y)&&(y?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),r&&(v=r),v=v.startsWith("blob:")?"":v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=(e,t,r)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{200==o.status||0==o.status&&o.response?t(o.response):r()},o.onerror=r,o.send(null)});var E,S,C=u.print||console.log.bind(console),k=u.printErr||console.error.bind(console);Object.assign(u,p),p=null,u.arguments&&(h=u.arguments),u.thisProgram&&(f=u.thisProgram),u.quit&&(m=u.quit),u.wasmBinary&&(E=u.wasmBinary),"object"!=typeof WebAssembly&&Z("no native wasm support detected");var x,T,A,P,q,F,L,B,D,R,M,I=!1;function O(e,t){e||Z(t)}function j(){var e=S.buffer;u.HEAP8=T=new Int8Array(e),u.HEAP16=P=new Int16Array(e),u.HEAPU8=A=new Uint8Array(e),u.HEAPU16=q=new Uint16Array(e),u.HEAP32=F=new Int32Array(e),u.HEAPU32=L=new Uint32Array(e),u.HEAPF32=B=new Float32Array(e),u.HEAPF64=M=new Float64Array(e),u.HEAP64=D=new BigInt64Array(e),u.HEAPU64=R=new BigUint64Array(e)}var U=u.INITIAL_MEMORY||16777216;S=u.wasmMemory?u.wasmMemory:new WebAssembly.Memory({initial:U/65536,maximum:32768}),j(),U=S.buffer.byteLength;var $=[],N=[],H=[],V=[],W=0,z=null,G=null;function Y(e){W++,u.monitorRunDependencies?.(W)}function X(e){if(W--,u.monitorRunDependencies?.(W),0==W&&(null!==z&&(clearInterval(z),z=null),G)){var t=G;G=null,t()}}function Z(e){u.onAbort?.(e),k(e="Aborted("+e+")"),I=!0,x=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}var K,Q,J=e=>e.startsWith("data:application/octet-stream;base64,"),ee=e=>e.startsWith("file://");function te(e){if(e==K&&E)return new Uint8Array(E);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function re(e,t,r){return function(e){return E||!g&&!y||"function"!=typeof fetch?Promise.resolve().then((()=>te(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()})).catch((()=>te(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{k(`failed to asynchronously prepare wasm: ${e}`),Z(e)}))}J(K="cesdk.wasm")||(Q=K,K=u.locateFile?u.locateFile(Q,v):v+Q);var oe={2384208:(e,t,r,o,n)=>"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=o,window.miniaudio.device_state.started=n,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=function(){return["touchstart","touchend","click"]}(),miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2386198:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2386362:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2386466:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2386637:(e,t,r,o,n,i)=>{var a=e,s=t,c=r,l=o,d=n,p=i;if(void 0===window.miniaudio)return-1;var h={},f={};a==window.miniaudio.device_type.playback&&(f.sampleRate=c),h.webaudio=new(window.AudioContext||window.webkitAudioContext)(f),h.webaudio.suspend(),h.state=window.miniaudio.device_state.stopped;var m=0,g=s;return a!=window.miniaudio.device_type.playback&&(m=s),h.scriptNode=h.webaudio.createScriptProcessor(l,m,g),h.scriptNode.onaudioprocess=function(e){if(null!=h.intermediaryBufferView&&0!=h.intermediaryBufferView.length||(h.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),o=h.intermediaryBufferView,n=0;n<l;n+=1)o[n*s+t]=r[n];Bu(p,l,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Du(p,l,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(o=h.intermediaryBufferView,n=0;n<l;n+=1)i[n]=o[n*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){h.streamNode=h.webaudio.createMediaStreamSource(e),h.streamNode.connect(h.scriptNode),h.scriptNode.connect(h.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&h.scriptNode.connect(h.webaudio.destination),miniaudio.track_device(h)},2389420:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2389486: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},2389851:e=>{miniaudio.untrack_device_by_index(e)},2389894:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2390019:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2390145:()=>!!globalThis.ubq_browserTabHidden,2390191:()=>T.length};function ne(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ie=e=>{for(;e.length>0;)e.shift()(u)},ae=u.noExitRuntime||!0,se=[],ue=0;class ExceptionInfo{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){L[this.ptr+4>>2]=e}get_type(){return L[this.ptr+4>>2]}set_destructor(e){L[this.ptr+8>>2]=e}get_destructor(){return L[this.ptr+8>>2]}set_caught(e){e=e?1:0,T[this.ptr+12>>0]=e}get_caught(){return 0!=T[this.ptr+12>>0]}set_rethrown(e){e=e?1:0,T[this.ptr+13>>0]=e}get_rethrown(){return 0!=T[this.ptr+13>>0]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){L[this.ptr+16>>2]=e}get_adjusted_ptr(){return L[this.ptr+16>>2]}get_exception_ptr(){if(Wu(this.get_type()))return L[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var ce=e=>{var t=ue;if(!t)return Ru(0),0;var r=new ExceptionInfo(t);r.set_adjusted_ptr(t);var o=r.get_type();if(!o)return Ru(0),t;for(var n in e){var i=e[n];if(0===i||i===o)break;var a=r.ptr+16;if(Vu(i,o,a))return Ru(i),t}return Ru(o),t},le={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,o=e.length-1;o>=0;o--){var n=e[o];"."===n?e.splice(o,1):".."===n?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=le.isAbs(e),r="/"===e.substr(-1);return(e=le.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=le.splitPath(e),r=t[0],o=t[1];return r||o?(o&&(o=o.substr(0,o.length-1)),r+o):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=le.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return le.normalize(e.join("/"))},join2:(e,t)=>le.normalize(e+"/"+t)},de=e=>(de=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=ct();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}Z("initRandomDevice")})())(e),pe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var o=r>=0?arguments[r]:Ce.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=le.isAbs(o)}return(t?"/":"")+(e=le.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=pe.resolve(e).substr(1),t=pe.resolve(t).substr(1);for(var o=r(e.split("/")),n=r(t.split("/")),i=Math.min(o.length,n.length),a=i,s=0;s<i;s++)if(o[s]!==n[s]){a=s;break}var u=[];for(s=a;s<o.length;s++)u.push("..");return(u=u.concat(n.slice(a))).join("/")}},he="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,fe=(e,t,r)=>{for(var o=t+r,n=t;e[n]&&!(n>=o);)++n;if(n-t>16&&e.buffer&&he)return he.decode(e.subarray(t,n));for(var i="";t<n;){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},me=[],ge=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);o<=127?t++:o<=2047?t+=2:o>=55296&&o<=57343?(t+=4,++r):t+=3}return t},ye=(e,t,r,o)=>{if(!(o>0))return 0;for(var n=r,i=r+o-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-n};function be(e,t,r){var o=r>0?r:ge(e)+1,n=new Array(o),i=ye(e,n,0,n.length);return t&&(n.length=i),n}var ve={ttys:[],init(){},shutdown(){},register(e,t){ve.ttys[e]={input:[],output:[],ops:t},Ce.registerDevice(e,ve.stream_ops)},stream_ops:{open(e){var t=ve.ttys[e.node.rdev];if(!t)throw new Ce.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,o,n){if(!e.tty||!e.tty.ops.get_char)throw new Ce.ErrnoError(60);for(var i=0,a=0;a<o;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ce.ErrnoError(29)}if(void 0===s&&0===i)throw new Ce.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,n){if(!e.tty||!e.tty.ops.put_char)throw new Ce.ErrnoError(60);try{for(var i=0;i<o;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ce.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:e=>(()=>{if(!me.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,o=process.stdin.fd;try{r=w.readSync(o,t)}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;me=be(e,!0)}return me.shift()})(),put_char(e,t){null===t||10===t?(C(fe(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(C(fe(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(k(fe(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(k(fe(e.output,0)),e.output=[])}}},we=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Iu(65536,e);return t?((e,t)=>(A.fill(0,e,e+t),e))(t,e):0},_e={ops_table:null,mount:e=>_e.createNode(null,"/",16895,0),createNode(e,t,r,o){if(Ce.isBlkdev(r)||Ce.isFIFO(r))throw new Ce.ErrnoError(63);_e.ops_table||={dir:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr,lookup:_e.node_ops.lookup,mknod:_e.node_ops.mknod,rename:_e.node_ops.rename,unlink:_e.node_ops.unlink,rmdir:_e.node_ops.rmdir,readdir:_e.node_ops.readdir,symlink:_e.node_ops.symlink},stream:{llseek:_e.stream_ops.llseek}},file:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr},stream:{llseek:_e.stream_ops.llseek,read:_e.stream_ops.read,write:_e.stream_ops.write,allocate:_e.stream_ops.allocate,mmap:_e.stream_ops.mmap,msync:_e.stream_ops.msync}},link:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr,readlink:_e.node_ops.readlink},stream:{}},chrdev:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr},stream:Ce.chrdev_stream_ops}};var n=Ce.createNode(e,t,r,o);return Ce.isDir(n.mode)?(n.node_ops=_e.ops_table.dir.node,n.stream_ops=_e.ops_table.dir.stream,n.contents={}):Ce.isFile(n.mode)?(n.node_ops=_e.ops_table.file.node,n.stream_ops=_e.ops_table.file.stream,n.usedBytes=0,n.contents=null):Ce.isLink(n.mode)?(n.node_ops=_e.ops_table.link.node,n.stream_ops=_e.ops_table.link.stream):Ce.isChrdev(n.mode)&&(n.node_ops=_e.ops_table.chrdev.node,n.stream_ops=_e.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n,e.timestamp=n.timestamp),n},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 o=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(o.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=Ce.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,Ce.isDir(e.mode)?t.size=4096:Ce.isFile(e.mode)?t.size=e.usedBytes:Ce.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&&_e.resizeFileStorage(e,t.size)},lookup(e,t){throw Ce.genericErrors[44]},mknod:(e,t,r,o)=>_e.createNode(e,t,r,o),rename(e,t,r){if(Ce.isDir(e.mode)){var o;try{o=Ce.lookupNode(t,r)}catch(e){}if(o)for(var n in o.contents)throw new Ce.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=Ce.lookupNode(e,t);for(var o in r.contents)throw new Ce.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var o=_e.createNode(e,t,41471,0);return o.link=r,o},readlink(e){if(!Ce.isLink(e.mode))throw new Ce.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,o,n){var i=e.node.contents;if(n>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,o);if(a>8&&i.subarray)t.set(i.subarray(n,n+a),r);else for(var s=0;s<a;s++)t[r+s]=i[n+s];return a},write(e,t,r,o,n,i){if(t.buffer===T.buffer&&(i=!1),!o)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+o),a.usedBytes=o,o;if(0===a.usedBytes&&0===n)return a.contents=t.slice(r,r+o),a.usedBytes=o,o;if(n+o<=a.usedBytes)return a.contents.set(t.subarray(r,r+o),n),o}if(_e.expandFileStorage(a,n+o),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+o),n);else for(var s=0;s<o;s++)a.contents[n+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,n+o),o},llseek(e,t,r){var o=t;if(1===r?o+=e.position:2===r&&Ce.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new Ce.ErrnoError(28);return o},allocate(e,t,r){_e.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,o,n){if(!Ce.isFile(e.node.mode))throw new Ce.ErrnoError(43);var i,a,s=e.node.contents;if(2&n||s.buffer!==T.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=we(t)))throw new Ce.ErrnoError(48);T.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,o,n)=>(_e.stream_ops.write(e,t,0,o,r,!1),0)}},Ee=u.preloadPlugins||[],Se=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ce={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=pe.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ce.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),o=Ce.root,n="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(o=Ce.lookupNode(o,r[i]),n=le.join2(n,r[i]),Ce.isMountpoint(o)&&(!a||a&&t.follow_mount)&&(o=o.mounted.root),!a||t.follow)for(var s=0;Ce.isLink(o.mode);){var u=Ce.readlink(n);if(n=pe.resolve(le.dirname(n),u),o=Ce.lookupPath(n,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ce.ErrnoError(32)}}return{path:n,node:o}},getPath(e){for(var t;;){if(Ce.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,o=0;o<t.length;o++)r=(r<<5)-r+t.charCodeAt(o)|0;return(e+r>>>0)%Ce.nameTable.length},hashAddNode(e){var t=Ce.hashName(e.parent.id,e.name);e.name_next=Ce.nameTable[t],Ce.nameTable[t]=e},hashRemoveNode(e){var t=Ce.hashName(e.parent.id,e.name);if(Ce.nameTable[t]===e)Ce.nameTable[t]=e.name_next;else for(var r=Ce.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ce.mayLookup(e);if(r)throw new Ce.ErrnoError(r);for(var o=Ce.hashName(e.id,t),n=Ce.nameTable[o];n;n=n.name_next){var i=n.name;if(n.parent.id===e.id&&i===t)return n}return Ce.lookup(e,t)},createNode(e,t,r,o){var n=new Ce.FSNode(e,t,r,o);return Ce.hashAddNode(n),n},destroyNode(e){Ce.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)=>Ce.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!Ce.isDir(e.mode))return 54;var t=Ce.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Ce.lookupNode(e,t),20}catch(e){}return Ce.nodePermissions(e,"wx")},mayDelete(e,t,r){var o;try{o=Ce.lookupNode(e,t)}catch(e){return e.errno}var n=Ce.nodePermissions(e,"wx");if(n)return n;if(r){if(!Ce.isDir(o.mode))return 54;if(Ce.isRoot(o)||Ce.getPath(o)===Ce.cwd())return 10}else if(Ce.isDir(o.mode))return 31;return 0},mayOpen:(e,t)=>e?Ce.isLink(e.mode)?32:Ce.isDir(e.mode)&&("r"!==Ce.flagsToPermissionString(t)||512&t)?31:Ce.nodePermissions(e,Ce.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ce.MAX_OPEN_FDS;e++)if(!Ce.streams[e])return e;throw new Ce.ErrnoError(33)},getStreamChecked(e){var t=Ce.getStream(e);if(!t)throw new Ce.ErrnoError(8);return t},getStream:e=>Ce.streams[e],createStream:(e,t=-1)=>(Ce.FSStream||(Ce.FSStream=function(){this.shared={}},Ce.FSStream.prototype={},Object.defineProperties(Ce.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 Ce.FSStream,e),-1==t&&(t=Ce.nextfd()),e.fd=t,Ce.streams[t]=e,e),closeStream(e){Ce.streams[e]=null},chrdev_stream_ops:{open(e){var t=Ce.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Ce.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ce.devices[e]={stream_ops:t}},getDevice:e=>Ce.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var o=r.pop();t.push(o),r.push.apply(r,o.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ce.syncFSRequests++,Ce.syncFSRequests>1&&k(`warning: ${Ce.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ce.getMounts(Ce.root.mount),o=0;function n(e){return Ce.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,n(e));++o>=r.length&&n(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,r){var o,n="/"===r,i=!r;if(n&&Ce.root)throw new Ce.ErrnoError(10);if(!n&&!i){var a=Ce.lookupPath(r,{follow_mount:!1});if(r=a.path,o=a.node,Ce.isMountpoint(o))throw new Ce.ErrnoError(10);if(!Ce.isDir(o.mode))throw new Ce.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,n?Ce.root=u:o&&(o.mounted=s,o.mount&&o.mount.mounts.push(s)),u},unmount(e){var t=Ce.lookupPath(e,{follow_mount:!1});if(!Ce.isMountpoint(t.node))throw new Ce.ErrnoError(28);var r=t.node,o=r.mounted,n=Ce.getMounts(o);Object.keys(Ce.nameTable).forEach((e=>{for(var t=Ce.nameTable[e];t;){var r=t.name_next;n.includes(t.mount)&&Ce.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(o);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var o=Ce.lookupPath(e,{parent:!0}).node,n=le.basename(e);if(!n||"."===n||".."===n)throw new Ce.ErrnoError(28);var i=Ce.mayCreate(o,n);if(i)throw new Ce.ErrnoError(i);if(!o.node_ops.mknod)throw new Ce.ErrnoError(63);return o.node_ops.mknod(o,n,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ce.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ce.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),o="",n=0;n<r.length;++n)if(r[n]){o+="/"+r[n];try{Ce.mkdir(o,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ce.mknod(e,t,r)),symlink(e,t){if(!pe.resolve(e))throw new Ce.ErrnoError(44);var r=Ce.lookupPath(t,{parent:!0}).node;if(!r)throw new Ce.ErrnoError(44);var o=le.basename(t),n=Ce.mayCreate(r,o);if(n)throw new Ce.ErrnoError(n);if(!r.node_ops.symlink)throw new Ce.ErrnoError(63);return r.node_ops.symlink(r,o,e)},rename(e,t){var r,o,n=le.dirname(e),i=le.dirname(t),a=le.basename(e),s=le.basename(t);if(r=Ce.lookupPath(e,{parent:!0}).node,o=Ce.lookupPath(t,{parent:!0}).node,!r||!o)throw new Ce.ErrnoError(44);if(r.mount!==o.mount)throw new Ce.ErrnoError(75);var u,c=Ce.lookupNode(r,a),l=pe.relative(e,i);if("."!==l.charAt(0))throw new Ce.ErrnoError(28);if("."!==(l=pe.relative(t,n)).charAt(0))throw new Ce.ErrnoError(55);try{u=Ce.lookupNode(o,s)}catch(e){}if(c!==u){var d=Ce.isDir(c.mode),p=Ce.mayDelete(r,a,d);if(p)throw new Ce.ErrnoError(p);if(p=u?Ce.mayDelete(o,s,d):Ce.mayCreate(o,s))throw new Ce.ErrnoError(p);if(!r.node_ops.rename)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(c)||u&&Ce.isMountpoint(u))throw new Ce.ErrnoError(10);if(o!==r&&(p=Ce.nodePermissions(r,"w")))throw new Ce.ErrnoError(p);Ce.hashRemoveNode(c);try{r.node_ops.rename(c,o,s)}catch(e){throw e}finally{Ce.hashAddNode(c)}}},rmdir(e){var t=Ce.lookupPath(e,{parent:!0}).node,r=le.basename(e),o=Ce.lookupNode(t,r),n=Ce.mayDelete(t,r,!0);if(n)throw new Ce.ErrnoError(n);if(!t.node_ops.rmdir)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(o))throw new Ce.ErrnoError(10);t.node_ops.rmdir(t,r),Ce.destroyNode(o)},readdir(e){var t=Ce.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ce.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ce.lookupPath(e,{parent:!0}).node;if(!t)throw new Ce.ErrnoError(44);var r=le.basename(e),o=Ce.lookupNode(t,r),n=Ce.mayDelete(t,r,!1);if(n)throw new Ce.ErrnoError(n);if(!t.node_ops.unlink)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(o))throw new Ce.ErrnoError(10);t.node_ops.unlink(t,r),Ce.destroyNode(o)},readlink(e){var t=Ce.lookupPath(e).node;if(!t)throw new Ce.ErrnoError(44);if(!t.node_ops.readlink)throw new Ce.ErrnoError(28);return pe.resolve(Ce.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ce.lookupPath(e,{follow:!t}).node;if(!r)throw new Ce.ErrnoError(44);if(!r.node_ops.getattr)throw new Ce.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ce.stat(e,!0),chmod(e,t,r){var o;if(!(o="string"==typeof e?Ce.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);o.node_ops.setattr(o,{mode:4095&t|-4096&o.mode,timestamp:Date.now()})},lchmod(e,t){Ce.chmod(e,t,!0)},fchmod(e,t){var r=Ce.getStreamChecked(e);Ce.chmod(r.node,t)},chown(e,t,r,o){var n;if(!(n="string"==typeof e?Ce.lookupPath(e,{follow:!o}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown(e,t,r){Ce.chown(e,t,r,!0)},fchown(e,t,r){var o=Ce.getStreamChecked(e);Ce.chown(o.node,t,r)},truncate(e,t){if(t<0)throw new Ce.ErrnoError(28);var r;if(!(r="string"==typeof e?Ce.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);if(Ce.isDir(r.mode))throw new Ce.ErrnoError(31);if(!Ce.isFile(r.mode))throw new Ce.ErrnoError(28);var o=Ce.nodePermissions(r,"w");if(o)throw new Ce.ErrnoError(o);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ce.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ce.ErrnoError(28);Ce.truncate(r.node,t)},utime(e,t,r){var o=Ce.lookupPath(e,{follow:!0}).node;o.node_ops.setattr(o,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ce.ErrnoError(44);var o;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)o=e;else{e=le.normalize(e);try{o=Ce.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n=!1;if(64&t)if(o){if(128&t)throw new Ce.ErrnoError(20)}else o=Ce.mknod(e,r,0),n=!0;if(!o)throw new Ce.ErrnoError(44);if(Ce.isChrdev(o.mode)&&(t&=-513),65536&t&&!Ce.isDir(o.mode))throw new Ce.ErrnoError(54);if(!n){var i=Ce.mayOpen(o,t);if(i)throw new Ce.ErrnoError(i)}512&t&&!n&&Ce.truncate(o,0),t&=-131713;var a=Ce.createStream({node:o,path:Ce.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!u.logReadFiles||1&t||(Ce.readFiles||(Ce.readFiles={}),e in Ce.readFiles||(Ce.readFiles[e]=1)),a},close(e){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ce.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ce.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ce.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,o,n){if(o<0||n<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(1==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.read)throw new Ce.ErrnoError(28);var i=void 0!==n;if(i){if(!e.seekable)throw new Ce.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,t,r,o,n);return i||(e.position+=a),a},write(e,t,r,o,n,i){if(o<0||n<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.write)throw new Ce.ErrnoError(28);e.seekable&&1024&e.flags&&Ce.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new Ce.ErrnoError(70)}else n=e.position;var s=e.stream_ops.write(e,t,r,o,n,i);return a||(e.position+=s),s},allocate(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(t<0||r<=0)throw new Ce.ErrnoError(28);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(!Ce.isFile(e.node.mode)&&!Ce.isDir(e.node.mode))throw new Ce.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ce.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,o,n){if(0!=(2&o)&&0==(2&n)&&2!=(2097155&e.flags))throw new Ce.ErrnoError(2);if(1==(2097155&e.flags))throw new Ce.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ce.ErrnoError(43);return e.stream_ops.mmap(e,t,r,o,n)},msync:(e,t,r,o,n)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,o,n):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ce.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,o=Ce.open(e,t.flags),n=Ce.stat(e).size,i=new Uint8Array(n);return Ce.read(o,i,0,n,0),"utf8"===t.encoding?r=fe(i,0):"binary"===t.encoding&&(r=i),Ce.close(o),r},writeFile(e,t,r={}){r.flags=r.flags||577;var o=Ce.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(ge(t)+1),i=ye(t,n,0,n.length);Ce.write(o,n,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ce.write(o,t,0,t.byteLength,void 0,r.canOwn)}Ce.close(o)},cwd:()=>Ce.currentPath,chdir(e){var t=Ce.lookupPath(e,{follow:!0});if(null===t.node)throw new Ce.ErrnoError(44);if(!Ce.isDir(t.node.mode))throw new Ce.ErrnoError(54);var r=Ce.nodePermissions(t.node,"x");if(r)throw new Ce.ErrnoError(r);Ce.currentPath=t.path},createDefaultDirectories(){Ce.mkdir("/tmp"),Ce.mkdir("/home"),Ce.mkdir("/home/web_user")},createDefaultDevices(){Ce.mkdir("/dev"),Ce.registerDevice(Ce.makedev(1,3),{read:()=>0,write:(e,t,r,o,n)=>o}),Ce.mkdev("/dev/null",Ce.makedev(1,3)),ve.register(Ce.makedev(5,0),ve.default_tty_ops),ve.register(Ce.makedev(6,0),ve.default_tty1_ops),Ce.mkdev("/dev/tty",Ce.makedev(5,0)),Ce.mkdev("/dev/tty1",Ce.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=de(e).byteLength),e[--t]);Ce.createDevice("/dev","random",r),Ce.createDevice("/dev","urandom",r),Ce.mkdir("/dev/shm"),Ce.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ce.mkdir("/proc");var e=Ce.mkdir("/proc/self");Ce.mkdir("/proc/self/fd"),Ce.mount({mount(){var t=Ce.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,o=Ce.getStreamChecked(r),n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return n.parent=n,n}},t}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?Ce.createDevice("/dev","stdin",u.stdin):Ce.symlink("/dev/tty","/dev/stdin"),u.stdout?Ce.createDevice("/dev","stdout",null,u.stdout):Ce.symlink("/dev/tty","/dev/stdout"),u.stderr?Ce.createDevice("/dev","stderr",null,u.stderr):Ce.symlink("/dev/tty1","/dev/stderr"),Ce.open("/dev/stdin",0),Ce.open("/dev/stdout",1),Ce.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{Ce.genericErrors[e]=new Ce.ErrnoError(e),Ce.genericErrors[e].stack="<generic error, no stack>"})),Ce.nameTable=new Array(4096),Ce.mount(_e,{},"/"),Ce.createDefaultDirectories(),Ce.createDefaultDevices(),Ce.createSpecialDirectories(),Ce.filesystems={MEMFS:_e}},init(e,t,r){Ce.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,Ce.createStandardStreams()},quit(){Ce.init.initialized=!1;for(var e=0;e<Ce.streams.length;e++){var t=Ce.streams[e];t&&Ce.close(t)}},findObject(e,t){var r=Ce.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(o=Ce.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 o=Ce.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=o.path,r.parentObject=o.node,r.name=le.basename(e),o=Ce.lookupPath(e,{follow:!t}),r.exists=!0,r.path=o.path,r.object=o.node,r.name=o.node.name,r.isRoot="/"===o.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,o){e="string"==typeof e?e:Ce.getPath(e);for(var n=t.split("/").reverse();n.length;){var i=n.pop();if(i){var a=le.join2(e,i);try{Ce.mkdir(a)}catch(e){}e=a}}return a},createFile(e,t,r,o,n){var i=le.join2("string"==typeof e?e:Ce.getPath(e),t),a=Se(o,n);return Ce.create(i,a)},createDataFile(e,t,r,o,n,i){var a=t;e&&(e="string"==typeof e?e:Ce.getPath(e),a=t?le.join2(e,t):e);var s=Se(o,n),u=Ce.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}Ce.chmod(u,146|s);var p=Ce.open(u,577);Ce.write(p,r,0,r.length,0,i),Ce.close(p),Ce.chmod(u,s)}},createDevice(e,t,r,o){var n=le.join2("string"==typeof e?e:Ce.getPath(e),t),i=Se(!!r,!!o);Ce.createDevice.major||(Ce.createDevice.major=64);var a=Ce.makedev(Ce.createDevice.major++,0);return Ce.registerDevice(a,{open(e){e.seekable=!1},close(e){o?.buffer?.length&&o(10)},read(e,t,o,n,i){for(var a=0,s=0;s<n;s++){var u;try{u=r()}catch(e){throw new Ce.ErrnoError(29)}if(void 0===u&&0===a)throw new Ce.ErrnoError(6);if(null==u)break;a++,t[o+s]=u}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,i){for(var a=0;a<n;a++)try{o(t[r+a])}catch(e){throw new Ce.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}}),Ce.mkdev(n,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=be(c(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ce.ErrnoError(29)}},createLazyFile(e,t,r,o,n){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,o=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;n||(a=o);var s=this;s.setDataGetter((e=>{var t=e*a,n=(e+1)*a-1;if(n=Math.min(n,o-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>o-1)throw new Error("only "+o+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),o!==a&&n.setRequestHeader("Range","bytes="+e+"-"+t),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):be(n.responseText||"",!0)})(t,n)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&o||(a=o=1,o=this.getter(0).length,a=o,C("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=o,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Ce.createFile(e,t,s,o,n);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,o,n){var i=e.node.contents;if(n>=i.length)return 0;var a=Math.min(i.length-n,o);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[n+s];else for(s=0;s<a;s++)t[r+s]=i.get(n+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return Ce.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,o,n)=>(Ce.forceLoadFile(u),l(e,t,r,o,n)),c.mmap=(e,t,r,o,n)=>{Ce.forceLoadFile(u);var i=we(t);if(!i)throw new Ce.ErrnoError(48);return l(e,T,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},ke=(e,t)=>e?fe(A,e,t):"",xe={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(le.isAbs(t))return t;var o;if(o=-100===e?Ce.cwd():xe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ce.ErrnoError(44);return o}return le.join2(o,t)},doStat(e,t,r){var o=e(t);F[r>>2]=o.dev,F[r+4>>2]=o.mode,L[r+8>>2]=o.nlink,F[r+12>>2]=o.uid,F[r+16>>2]=o.gid,F[r+20>>2]=o.rdev,D[r+24>>3]=BigInt(o.size),F[r+32>>2]=4096,F[r+36>>2]=o.blocks;var n=o.atime.getTime(),i=o.mtime.getTime(),a=o.ctime.getTime();return D[r+40>>3]=BigInt(Math.floor(n/1e3)),L[r+48>>2]=n%1e3*1e3,D[r+56>>3]=BigInt(Math.floor(i/1e3)),L[r+64>>2]=i%1e3*1e3,D[r+72>>3]=BigInt(Math.floor(a/1e3)),L[r+80>>2]=a%1e3*1e3,D[r+88>>3]=BigInt(o.ino),0},doMsync(e,t,r,o,n){if(!Ce.isFile(t.node.mode))throw new Ce.ErrnoError(43);if(2&o)return 0;var i=A.slice(e,e+r);Ce.msync(t,i,n,r,o)},varargs:void 0,get(){var e=F[+xe.varargs>>2];return xe.varargs+=4,e},getp:()=>xe.get(),getStr:e=>ke(e),getStreamFromFD:e=>Ce.getStreamChecked(e)},Te={},Ae=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Pe(e){return this.fromWireType(F[e>>2])}var qe,Fe,Le,Be={},De={},Re={},Me=e=>{throw new qe(e)},Ie=(e,t,r)=>{function o(t){var o=r(t);o.length!==e.length&&Me("Mismatched type converter count");for(var n=0;n<e.length;++n)Ne(e[n],o[n])}e.forEach((function(e){Re[e]=t}));var n=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{De.hasOwnProperty(e)?n[t]=De[e]:(i.push(e),Be.hasOwnProperty(e)||(Be[e]=[]),Be[e].push((()=>{n[t]=De[e],++a===i.length&&o(n)})))})),0===i.length&&o(n)},Oe={},je=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Ue=e=>{for(var t="",r=e;A[r];)t+=Fe[A[r++]];return t},$e=e=>{throw new Le(e)};function Ne(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var o=t.name;if(e||$e(`type "${o}" must have a positive integer typeid pointer`),De.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;$e(`Cannot register type '${o}' twice`)}if(De[e]=t,delete Re[e],Be.hasOwnProperty(e)){var n=Be[e];delete Be[e],n.forEach((e=>e()))}}(e,t,r)}var He,Ve=(e,t,r)=>{switch(t){case 1:return r?e=>T[e>>0]:e=>A[e>>0];case 2:return r?e=>P[e>>1]:e=>q[e>>1];case 4:return r?e=>F[e>>2]:e=>L[e>>2];case 8:return r?e=>D[e>>3]:e=>R[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},We=8,ze=e=>{$e(e.$$.ptrType.registeredClass.name+" instance already deleted")},Ge=!1,Ye=e=>{},Xe=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Ze=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var o=Ze(e,t,r.baseClass);return null===o?null:r.downcast(o)},Ke={},Qe=()=>Object.keys(ot).length,Je=()=>{var e=[];for(var t in ot)ot.hasOwnProperty(t)&&e.push(ot[t]);return e},et=[],tt=()=>{for(;et.length;){var e=et.pop();e.$$.deleteScheduled=!1,e.delete()}},rt=e=>{He=e,et.length&&He&&He(tt)},ot={},nt=(e,t)=>(t=((e,t)=>{for(void 0===t&&$e("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),ot[t]),it=(e,t)=>(t.ptrType&&t.ptr||Me("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Me("Both smartPtrType and smartPtr must be specified"),t.count={value:1},st(Object.create(e,{$$:{value:t,writable:!0}})));function at(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=nt(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var o=r.clone();return this.destructor(e),o}function n(){return this.isSmartPointer?it(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):it(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Ke[a];if(!s)return n.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Ze(t,this.registeredClass,i.registeredClass);return null===u?n.call(this):this.isSmartPointer?it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var st=e=>"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Ge=new FinalizationRegistry((e=>{Xe(e.$$)})),Ye=e=>Ge.unregister(e),(st=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ge.register(e,r,e)}return e})(e));function ut(){}var lt=(e,t)=>Object.defineProperty(t,"name",{value:e}),dt=(e,t,r)=>{if(void 0===e[t].overloadTable){var o=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||$e(`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[o.argCount]=o}},pt=(e,t,r)=>{u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&$e(`Cannot register public name '${e}' twice`),dt(u,e,e),u.hasOwnProperty(r)&&$e(`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 ht(e,t,r,o,n,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=o,this.baseClass=n,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}var ft=(e,t,r)=>{for(;t!==r;)t.upcast||$e(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function mt(e,t){if(null===t)return this.isReference&&$e(`null is not a valid ${this.name}`),0;t.$$||$e(`Cannot pass "${je(t)}" as a ${this.name}`),t.$$.ptr||$e(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ft(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&$e(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||$e(`Cannot pass "${je(t)}" as a ${this.name}`),t.$$.ptr||$e(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&$e(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var o=t.$$.ptrType.registeredClass;if(r=ft(t.$$.ptr,o,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&$e("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:$e(`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 n=t.clone();r=this.rawShare(r,It.toHandle((()=>n.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:$e("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&$e(`null is not a valid ${this.name}`),0;t.$$||$e(`Cannot pass "${je(t)}" as a ${this.name}`),t.$$.ptr||$e(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&$e(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ft(t.$$.ptr,r,this.registeredClass)}function bt(e){return this.fromWireType(L[e>>2])}function vt(e,t,r,o,n,i,a,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=o,this.isSmartPointer=n,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,n||void 0!==t.baseClass?this.toWireType=gt:o?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}var wt,_t,Et=(e,t,r)=>{u.hasOwnProperty(e)||Me("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==r?u[e].overloadTable[r]=t:(u[e]=t,u[e].argCount=r)},St=[],Ct=e=>{var t=St[e];return t||(e>=St.length&&(St.length=e+1),St[e]=t=wt.get(e)),t},kt=(e,t)=>{e=Ue(e);var r=Ct(t);return"function"!=typeof r&&$e(`unknown function pointer with signature ${e}: ${t}`),r},xt=e=>{var t=Mu(e),r=Ue(t);return Lu(t),r},Tt=(e,t)=>{var r=[],o={};throw t.forEach((function e(t){o[t]||De[t]||(Re[t]?Re[t].forEach(e):(r.push(t),o[t]=!0))})),new _t(`${e}: `+r.map(xt).join([", "]))},At=(e,t)=>{for(var r=[],o=0;o<e;o++)r.push(L[t+4*o>>2]);return r};function Pt(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}function qt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=lt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var o=new r,n=e.apply(o,t);return n instanceof Object?n:o}function Ft(e,t,r,o,n,i){var a=t.length;a<2&&$e("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=Pt(t),c="void"!==t[0].name,l=[e,$e,o,n,Ae,t[0],t[1]],d=0;d<a-2;++d)l.push(t[d+2]);if(!u)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&l.push(t[d].destructorFunction);let[p,h]=function(e,t,r,o){for(var n=Pt(e),i=e.length,a="",s="",u=0;u<i-2;++u)a+=(0!==u?", ":"")+"arg"+u,s+=(0!==u?", ":"")+"arg"+u+"Wired";var c=`\n return function (${a}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;n&&(c+="var destructors = [];\n");var l=n?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(t&&(c+="var thisWired = classParam['toWireType']("+l+", this);\n"),u=0;u<i-2;++u)c+="var arg"+u+"Wired = argType"+u+"['toWireType']("+l+", arg"+u+");\n",d.push("argType"+u);if(t&&(s="thisWired"+(s.length>0?", ":"")+s),c+=(r||o?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",n)c+="runDestructors(destructors);\n";else for(u=t?1:2;u<e.length;++u){var p=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(c+=p+"_dtor("+p+");\n",d.push(p+"_dtor"))}return r&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[d,c+="}\n"]}(t,s,c,i);p.push(h);var f=qt(Function,p).apply(null,l);return lt(e,f)}var Lt,Bt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},Dt=new class HandleAllocator{constructor(){this.allocated=[void 0],this.freelist=[]}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)}},Rt=e=>{e>=Dt.reserved&&0==--Dt.get(e).refcount&&Dt.free(e)},Mt=()=>{for(var e=0,t=Dt.reserved;t<Dt.allocated.length;++t)void 0!==Dt.allocated[t]&&++e;return e},It={toValue:e=>(e||$e("Cannot use deleted val. handle = "+e),Dt.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 Dt.allocate({refcount:1,value:e})}}},Ot={name:"emscripten::val",fromWireType:e=>{var t=It.toValue(e);return Rt(e),t},toWireType:(e,t)=>It.toHandle(t),argPackAdvance:We,readValueFromPointer:Pe,destructorFunction:null},jt=(e,t,r)=>{switch(t){case 1:return r?function(e){return this.fromWireType(T[e>>0])}:function(e){return this.fromWireType(A[e>>0])};case 2:return r?function(e){return this.fromWireType(P[e>>1])}:function(e){return this.fromWireType(q[e>>1])};case 4:return r?function(e){return this.fromWireType(F[e>>2])}:function(e){return this.fromWireType(L[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ut=(e,t)=>{var r=De[e];return void 0===r&&$e(t+" has unknown type "+xt(e)),r},$t=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(B[e>>2])};case 8:return function(e){return this.fromWireType(M[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Nt=(e,t,r)=>ye(e,A,t,r),Ht="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Vt=(e,t)=>{for(var r=e,o=r>>1,n=o+t/2;!(o>=n)&&q[o];)++o;if((r=o<<1)-e>32&&Ht)return Ht.decode(A.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=P[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Wt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var o=t,n=(r-=2)<2*e.length?r/2:e.length,i=0;i<n;++i){var a=e.charCodeAt(i);P[t>>1]=a,t+=2}return P[t>>1]=0,t-o},zt=e=>2*e.length,Gt=(e,t)=>{for(var r=0,o="";!(r>=t/4);){var n=F[e+4*r>>2];if(0==n)break;if(++r,n>=65536){var i=n-65536;o+=String.fromCharCode(55296|i>>10,56320|1023&i)}else o+=String.fromCharCode(n)}return o},Yt=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var o=t,n=o+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)),F[t>>2]=a,(t+=4)+4>n)break}return F[t>>2]=0,t-o},Xt=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);o>=55296&&o<=57343&&++r,t+=4}return t},Zt=(e,t,r)=>{var o=[],n=e.toWireType(o,r);return o.length&&(L[t>>2]=It.toHandle(o)),n},Kt=[],Qt={},Jt=e=>{var t=Qt[e];return void 0===t?Ue(e):t},er=()=>"object"==typeof globalThis?globalThis:function(){return Function}()("return this")(),tr=(Reflect.construct,e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e)),rr=e=>e%4==0&&(e%100!=0||e%400==0),or=[0,31,60,91,121,152,182,213,244,274,305,335],nr=[0,31,59,90,120,151,181,212,243,273,304,334],ir=e=>(rr(e.getFullYear())?or:nr)[e.getMonth()]+e.getDate()-1,ar=e=>{var t=ge(e)+1,r=qu(t);return r&&Nt(e,r,t),r},sr=(e,t)=>{if(fr.mainLoop.timingMode=e,fr.mainLoop.timingValue=t,!fr.mainLoop.func)return 1;if(fr.mainLoop.running||(fr.mainLoop.running=!0),0==e)fr.mainLoop.scheduler=function(){var e=0|Math.max(0,fr.mainLoop.tickStartTime+t-Lt());setTimeout(fr.mainLoop.runner,e)},fr.mainLoop.method="timeout";else if(1==e)fr.mainLoop.scheduler=function(){fr.requestAnimationFrame(fr.mainLoop.runner)},fr.mainLoop.method="rAF";else if(2==e){if(void 0===fr.setImmediate)if("undefined"==typeof setImmediate){var r=[],o="setimmediate";addEventListener("message",(e=>{e.data!==o&&e.data.target!==o||(e.stopPropagation(),r.shift()())}),!0),fr.setImmediate=function(e){r.push(e),y?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:o})):postMessage(o,"*")}}else fr.setImmediate=setImmediate;fr.mainLoop.scheduler=function(){fr.setImmediate(fr.mainLoop.runner)},fr.mainLoop.method="immediate"}return 0};Lt=()=>performance.now();var ur=e=>{if(e instanceof ne||"unwind"==e)return x;m(1,e)},cr=()=>ae||!1,lr=(e,t)=>{var r;x=e,x=r=e,cr()||(u.onExit?.(r),I=!0),m(r,new ne(r))},dr=lr,pr=e=>{if(!I)try{e(),(()=>{if(!cr())try{dr(x)}catch(e){ur(e)}})()}catch(e){ur(e)}},hr=(e,t)=>setTimeout((()=>{pr(e)}),t),fr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){fr.mainLoop.scheduler=null,fr.mainLoop.currentlyRunningMainloop++},resume(){fr.mainLoop.currentlyRunningMainloop++;var e=fr.mainLoop.timingMode,t=fr.mainLoop.timingValue,r=fr.mainLoop.func;fr.mainLoop.func=null,((e,t,r,o,n)=>{O(!fr.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."),fr.mainLoop.func=e,fr.mainLoop.arg=o;var i=fr.mainLoop.currentlyRunningMainloop;function a(){return!(i<fr.mainLoop.currentlyRunningMainloop)}if(fr.mainLoop.running=!1,fr.mainLoop.runner=function(){if(!I)if(fr.mainLoop.queue.length>0){Date.now();var t=fr.mainLoop.queue.shift();if(t.func(t.arg),fr.mainLoop.remainingBlockers){var r=fr.mainLoop.remainingBlockers,o=r%1==0?r-1:Math.floor(r);t.counted?fr.mainLoop.remainingBlockers=o:(o+=.5,fr.mainLoop.remainingBlockers=(8*r+o)/9)}if(fr.mainLoop.updateStatus(),!a())return;setTimeout(fr.mainLoop.runner,0)}else a()&&(fr.mainLoop.currentFrameNumber=fr.mainLoop.currentFrameNumber+1|0,1==fr.mainLoop.timingMode&&fr.mainLoop.timingValue>1&&fr.mainLoop.currentFrameNumber%fr.mainLoop.timingValue!=0?fr.mainLoop.scheduler():(0==fr.mainLoop.timingMode&&(fr.mainLoop.tickStartTime=Lt()),fr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio?.queueNewAudioData?.(),fr.mainLoop.scheduler())))},n||(t&&t>0?sr(0,1e3/t):sr(1,1),fr.mainLoop.scheduler()),r)throw"unwind"})(r,0,!1,fr.mainLoop.arg,!0),sr(e,t),fr.mainLoop.scheduler()},updateStatus(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=fr.mainLoop.remainingBlockers,r=fr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter(e){if(!I){if(u.preMainLoop&&!1===u.preMainLoop())return;pr(e),u.postMainLoop?.()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(!fr.initted){fr.initted=!0;var e={canHandle:function(e){return!u.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,o){var n=new Blob([e],{type:fr.getMimetype(t)});n.size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:fr.getMimetype(t)}));var i=URL.createObjectURL(n),a=new Image;a.onload=()=>{O(a.complete,`Image ${t} could not be decoded`);var o=document.createElement("canvas");o.width=a.width,o.height=a.height,o.getContext("2d").drawImage(a,0,0),Eu[t]=o,URL.revokeObjectURL(i),r?.(e)},a.onerror=e=>{k(`Image ${i} could not be decoded`),o?.()},a.src=i}};Ee.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,o){var n=!1;function i(o){n||(n=!0,Su[t]=o,r?.(e))}var a=new Blob([e],{type:fr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){n||(k(`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="",o=0,n=0,i=0;i<e.length;i++)for(o=o<<8|e[i],n+=8;n>=6;){var a=o>>n-6&63;n-=6,r+=t[a]}return 2==n?(r+=t[(3&o)<<4],r+="=="):4==n&&(r+=t[(15&o)<<2],r+="="),r}(e),i(u))},u.src=s,hr((()=>{i(u)}),1e4)}};Ee.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",o,!1),document.addEventListener("mozpointerlockchange",o,!1),document.addEventListener("webkitpointerlockchange",o,!1),document.addEventListener("mspointerlockchange",o,!1),u.elementPointerLock&&r.addEventListener("click",(e=>{!fr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function o(){fr.pointerLock=document.pointerLockElement===u.canvas||document.mozPointerLockElement===u.canvas||document.webkitPointerLockElement===u.canvas||document.msPointerLockElement===u.canvas}},createContext(e,t,r,o){if(t&&u.ctx&&e==u.canvas)return u.ctx;var n,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(o)for(var s in o)a[s]=o[s];void 0!==gr&&(i=gr.createContext(e,a))&&(n=gr.getContext(i).GLctx)}else n=e.getContext("2d");return n?(r&&(t||O(void 0===_u,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),u.ctx=n,t&&gr.makeContextCurrent(i),u.useWebGL=t,fr.moduleContextCreatedCallbacks.forEach((e=>e())),fr.init()),n):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){fr.lockPointer=e,fr.resizeCanvas=t,void 0===fr.lockPointer&&(fr.lockPointer=!0),void 0===fr.resizeCanvas&&(fr.resizeCanvas=!1);var r=u.canvas;function o(){fr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=fr.exitFullscreen,fr.lockPointer&&r.requestPointerLock(),fr.isFullscreen=!0,fr.resizeCanvas?fr.setFullscreenCanvasSize():fr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),fr.resizeCanvas?fr.setWindowedCanvasSize():fr.updateCanvasDimensions(r)),u.onFullScreen?.(fr.isFullscreen),u.onFullscreen?.(fr.isFullscreen)}fr.fullscreenHandlersInstalled||(fr.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("MSFullscreenChange",o,!1));var n=document.createElement("div");r.parentNode.insertBefore(n,r),n.appendChild(r),n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||(n.webkitRequestFullscreen?()=>n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(n.webkitRequestFullScreen?()=>n.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),n.requestFullscreen()},exitFullscreen:()=>!!fr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(0===fr.nextRAF)fr.nextRAF=t+1e3/60;else for(;t+2>=fr.nextRAF;)fr.nextRAF+=1e3/60;var r=Math.max(fr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,fr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,t)=>hr(e,t),safeRequestAnimationFrame:e=>fr.requestAnimationFrame((()=>{pr(e)})),getMimetype:e=>({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(e){window.getUserMedia||=navigator.getUserMedia||navigator.mozGetUserMedia,window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(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:{},calculateMouseCoords(e,t){var r=u.canvas.getBoundingClientRect(),o=u.canvas.width,n=u.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset,s=e-(i+r.left),c=t-(a+r.top);return{x:s*=o/r.width,y:c*=n/r.height}},setMouseCoords(e,t){const{x:r,y:o}=fr.calculateMouseCoords(e,t);fr.mouseMovementX=r-fr.mouseX,fr.mouseMovementY=o-fr.mouseY,fr.mouseX=r,fr.mouseY=o},calculateMouseEvent(e){if(fr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?fr.mouseMovementX=fr.mouseMovementY=0:(fr.mouseMovementX=fr.getMovementX(e),fr.mouseMovementY=fr.getMovementY(e)),"undefined"!=typeof SDL?(fr.mouseX=SDL.mouseX+fr.mouseMovementX,fr.mouseY=SDL.mouseY+fr.mouseMovementY):(fr.mouseX+=fr.mouseMovementX,fr.mouseY+=fr.mouseMovementY);else{if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var t=e.touch;if(void 0===t)return;var r=fr.calculateMouseCoords(t.pageX,t.pageY);if("touchstart"===e.type)fr.lastTouches[t.identifier]=r,fr.touches[t.identifier]=r;else if("touchend"===e.type||"touchmove"===e.type){var o=fr.touches[t.identifier];o||=r,fr.lastTouches[t.identifier]=o,fr.touches[t.identifier]=r}return}fr.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=u.canvas;fr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize(e,t,r){var o=u.canvas;fr.updateCanvasDimensions(o,e,t),r||fr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e|=8388608,F[SDL.screen>>2]=e}fr.updateCanvasDimensions(u.canvas),fr.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e&=-8388609,F[SDL.screen>>2]=e}fr.updateCanvasDimensions(u.canvas),fr.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var o=t,n=r;if(u.forcedAspectRatio&&u.forcedAspectRatio>0&&(o/n<u.forcedAspectRatio?o=Math.round(n*u.forcedAspectRatio):n=Math.round(o/u.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/o,screen.height/n);o=Math.round(o*i),n=Math.round(n*i)}fr.resizeCanvas?(e.width!=o&&(e.width=o),e.height!=n&&(e.height=n),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&&(o!=t||n!=r?(e.style.setProperty("width",o+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},mr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode(e){mr.errorCode=e},chooseConfig(e,t,r,o,n){if(62e3!=e)return mr.setErrorCode(12296),0;if(t)for(;;){var i=F[t>>2];if(12321==i){var a=F[t+4>>2];mr.contextAttributes.alpha=a>0}else if(12325==i){var s=F[t+4>>2];mr.contextAttributes.depth=s>0}else if(12326==i){var u=F[t+4>>2];mr.contextAttributes.stencil=u>0}else if(12337==i){var c=F[t+4>>2];mr.contextAttributes.antialias=c>0}else if(12338==i)c=F[t+4>>2],mr.contextAttributes.antialias=1==c;else if(12544==i){var l=F[t+4>>2];mr.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&o||n?(n&&(F[n>>2]=1),r&&o>0&&(L[r>>2]=62002),mr.setErrorCode(12288),1):(mr.setErrorCode(12300),0)}},gr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){gr.lastError||(gr.lastError=e)},getNewId:e=>{for(var t=gr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:(e,t,r,o)=>{for(var n="",i=0;i<t;++i){var a=o?L[o+4*i>>2]:void 0;n+=ke(L[r+4*i>>2],a)}return n},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let t=function(t,r){var o=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==o instanceof WebGLRenderingContext?o:null};e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=t}var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?gr.registerContext(r,t):0},registerContext:(e,t)=>{var r=gr.getNewId(gr.contexts),o={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=o),gr.contexts[r]=o,r},makeContextCurrent:e=>(gr.currentContext=gr.contexts[e],u.ctx=_u=gr.currentContext?.GLctx,!(e&&!_u)),getContext:e=>gr.contexts[e],deleteContext:e=>{gr.currentContext===gr.contexts[e]&&(gr.currentContext=null),"object"==typeof iu&&iu.removeAllHandlersOnTarget(gr.contexts[e].GLctx.canvas),gr.contexts[e]&&gr.contexts[e].GLctx.canvas&&(gr.contexts[e].GLctx.canvas.GLctxObject=void 0),gr.contexts[e]=null}},yr=[],br=(e,t,r)=>{var o=((e,t)=>{var r;for(yr.length=0;r=A[e++];){var o=105!=r;t+=(o&=112!=r)&&t%8?4:0,yr.push(112==r?L[t>>2]:106==r?D[t>>3]:105==r?F[t>>2]:M[t>>3]),t+=o?8:4}return yr})(t,r);return oe[e].apply(null,o)},vr=function(e){_u.activeTexture(e)},wr=(e,t)=>{_u.attachShader(gr.programs[e],gr.shaders[t])},_r=(e,t)=>{_u.beginQuery(e,gr.queries[t])},Er=(e,t)=>{_u.disjointTimerQueryExt.beginQueryEXT(e,gr.queries[t])},Sr=function(e){_u.beginTransformFeedback(e)},Cr=(e,t,r)=>{_u.bindAttribLocation(gr.programs[e],t,ke(r))},kr=(e,t)=>{35051==e?_u.currentPixelPackBufferBinding=t:35052==e&&(_u.currentPixelUnpackBufferBinding=t),_u.bindBuffer(e,gr.buffers[t])},xr=(e,t,r)=>{_u.bindBufferBase(e,t,gr.buffers[r])},Tr=(e,t,r,o,n)=>{_u.bindBufferRange(e,t,gr.buffers[r],o,n)},Ar=(e,t)=>{_u.bindFramebuffer(e,gr.framebuffers[t])},Pr=(e,t)=>{_u.bindRenderbuffer(e,gr.renderbuffers[t])},qr=(e,t)=>{_u.bindSampler(e,gr.samplers[t])},Fr=(e,t)=>{_u.bindTexture(e,gr.textures[t])},Lr=(e,t)=>{_u.bindTransformFeedback(e,gr.transformFeedbacks[t])},Br=e=>{_u.bindVertexArray(gr.vaos[e])},Dr=Br,Rr=Br,Mr=function(e,t,r,o){_u.blendColor(e,t,r,o)},Ir=function(e){_u.blendEquation(e)},Or=function(e,t){_u.blendEquationSeparate(e,t)},jr=function(e,t){_u.blendFunc(e,t)},Ur=function(e,t,r,o){_u.blendFuncSeparate(e,t,r,o)},$r=function(e,t,r,o,n,i,a,s,u,c){_u.blitFramebuffer(e,t,r,o,n,i,a,s,u,c)},Nr=(e,t,r,o)=>{gr.currentContext.version>=2?r&&t?_u.bufferData(e,A,o,r,t):_u.bufferData(e,t,o):_u.bufferData(e,r?A.subarray(r,r+t):t,o)},Hr=(e,t,r,o)=>{gr.currentContext.version>=2?r&&_u.bufferSubData(e,t,A,o,r):_u.bufferSubData(e,t,A.subarray(o,o+r))},Vr=function(e){return _u.checkFramebufferStatus(e)},Wr=function(e){_u.clear(e)},zr=function(e,t,r,o){_u.clearBufferfi(e,t,r,o)},Gr=(e,t,r)=>{_u.clearBufferfv(e,t,B,r>>2)},Yr=(e,t,r)=>{_u.clearBufferiv(e,t,F,r>>2)},Xr=(e,t,r)=>{_u.clearBufferuiv(e,t,L,r>>2)},Zr=function(e,t,r,o){_u.clearColor(e,t,r,o)},Kr=function(e){_u.clearDepth(e)},Qr=function(e){_u.clearStencil(e)},Jr=(e,t,r)=>(r=Number(r),_u.clientWaitSync(gr.syncs[e],t,r)),eo=(e,t,r,o)=>{_u.colorMask(!!e,!!t,!!r,!!o)},to=e=>{_u.compileShader(gr.shaders[e])},ro=(e,t,r,o,n,i,a,s)=>{gr.currentContext.version>=2?_u.currentPixelUnpackBufferBinding||!a?_u.compressedTexImage2D(e,t,r,o,n,i,a,s):_u.compressedTexImage2D(e,t,r,o,n,i,A,s,a):_u.compressedTexImage2D(e,t,r,o,n,i,s?A.subarray(s,s+a):null)},oo=(e,t,r,o,n,i,a,s,u)=>{_u.currentPixelUnpackBufferBinding?_u.compressedTexImage3D(e,t,r,o,n,i,a,s,u):_u.compressedTexImage3D(e,t,r,o,n,i,a,A,u,s)},no=(e,t,r,o,n,i,a,s,u)=>{gr.currentContext.version>=2?_u.currentPixelUnpackBufferBinding||!s?_u.compressedTexSubImage2D(e,t,r,o,n,i,a,s,u):_u.compressedTexSubImage2D(e,t,r,o,n,i,a,A,u,s):_u.compressedTexSubImage2D(e,t,r,o,n,i,a,u?A.subarray(u,u+s):null)},io=(e,t,r,o,n,i,a,s,u,c,l)=>{_u.currentPixelUnpackBufferBinding?_u.compressedTexSubImage3D(e,t,r,o,n,i,a,s,u,c,l):_u.compressedTexSubImage3D(e,t,r,o,n,i,a,s,u,A,l,c)},ao=function(e,t,r,o,n){_u.copyBufferSubData(e,t,r,o,n)},so=function(e,t,r,o,n,i,a,s){_u.copyTexImage2D(e,t,r,o,n,i,a,s)},uo=function(e,t,r,o,n,i,a,s){_u.copyTexSubImage2D(e,t,r,o,n,i,a,s)},co=function(e,t,r,o,n,i,a,s,u){_u.copyTexSubImage3D(e,t,r,o,n,i,a,s,u)},lo=()=>{var e=gr.getNewId(gr.programs),t=_u.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,gr.programs[e]=t,e},po=e=>{var t=gr.getNewId(gr.shaders);return gr.shaders[t]=_u.createShader(e),t},ho=function(e){_u.cullFace(e)},fo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.buffers[o];n&&(_u.deleteBuffer(n),n.name=0,gr.buffers[o]=null,o==_u.currentPixelPackBufferBinding&&(_u.currentPixelPackBufferBinding=0),o==_u.currentPixelUnpackBufferBinding&&(_u.currentPixelUnpackBufferBinding=0))}},mo=(e,t)=>{for(var r=0;r<e;++r){var o=F[t+4*r>>2],n=gr.framebuffers[o];n&&(_u.deleteFramebuffer(n),n.name=0,gr.framebuffers[o]=null)}},go=e=>{if(e){var t=gr.programs[e];t?(_u.deleteProgram(t),t.name=0,gr.programs[e]=null):gr.recordError(1281)}},yo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.queries[o];n&&(_u.deleteQuery(n),gr.queries[o]=null)}},bo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.queries[o];n&&(_u.disjointTimerQueryExt.deleteQueryEXT(n),gr.queries[o]=null)}},vo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.renderbuffers[o];n&&(_u.deleteRenderbuffer(n),n.name=0,gr.renderbuffers[o]=null)}},wo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.samplers[o];n&&(_u.deleteSampler(n),n.name=0,gr.samplers[o]=null)}},_o=e=>{if(e){var t=gr.shaders[e];t?(_u.deleteShader(t),gr.shaders[e]=null):gr.recordError(1281)}},Eo=e=>{if(e){var t=gr.syncs[e];t?(_u.deleteSync(t),t.name=0,gr.syncs[e]=null):gr.recordError(1281)}},So=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.textures[o];n&&(_u.deleteTexture(n),n.name=0,gr.textures[o]=null)}},Co=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.transformFeedbacks[o];n&&(_u.deleteTransformFeedback(n),n.name=0,gr.transformFeedbacks[o]=null)}},ko=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2];_u.deleteVertexArray(gr.vaos[o]),gr.vaos[o]=null}},xo=ko,To=ko,Ao=function(e){_u.depthFunc(e)},Po=e=>{_u.depthMask(!!e)},qo=function(e,t){_u.depthRange(e,t)},Fo=(e,t)=>{_u.detachShader(gr.programs[e],gr.shaders[t])},Lo=function(e){_u.disable(e)},Bo=e=>{_u.disableVertexAttribArray(e)},Do=(e,t,r)=>{_u.drawArrays(e,t,r)},Ro=(e,t,r,o)=>{_u.drawArraysInstanced(e,t,r,o)},Mo=Ro,Io=Ro,Oo=Ro,jo=(e,t,r,o,n)=>{_u.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,o,n)},Uo=Ro,$o=Ro,No=[],Ho=(e,t)=>{for(var r=No[e],o=0;o<e;o++)r[o]=F[t+4*o>>2];_u.drawBuffers(r)},Vo=Ho,Wo=Ho,zo=Ho,Go=(e,t,r,o)=>{_u.drawElements(e,t,r,o)},Yo=Go,Xo=(e,t,r,o,n)=>{_u.drawElementsInstanced(e,t,r,o,n)},Zo=Xo,Ko=Xo,Qo=Xo,Jo=(e,t,r,o,n,i,a)=>{_u.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,o,n,i,a)},en=Xo,tn=Xo,rn=(e,t,r,o,n,i)=>{Go(e,o,n,i)},on=function(e){_u.enable(e)},nn=e=>{_u.enableVertexAttribArray(e)},an=function(e){_u.endQuery(e)},sn=e=>{_u.disjointTimerQueryExt.endQueryEXT(e)},un=function(){_u.endTransformFeedback()},cn=(e,t)=>{var r=_u.fenceSync(e,t);if(r){var o=gr.getNewId(gr.syncs);return r.name=o,gr.syncs[o]=r,o}return 0},ln=function(){_u.finish()},dn=function(){_u.flush()},pn=(e,t,r,o)=>{_u.framebufferRenderbuffer(e,t,r,gr.renderbuffers[o])},hn=(e,t,r,o,n)=>{_u.framebufferTexture2D(e,t,r,gr.textures[o],n)},fn=(e,t,r,o,n)=>{_u.framebufferTextureLayer(e,t,gr.textures[r],o,n)},mn=function(e){_u.frontFace(e)},gn=(e,t,r,o)=>{for(var n=0;n<e;n++){var i=_u[r](),a=i&&gr.getNewId(o);i?(i.name=a,o[a]=i):gr.recordError(1282),F[t+4*n>>2]=a}},yn=(e,t)=>{gn(e,t,"createBuffer",gr.buffers)},bn=(e,t)=>{gn(e,t,"createFramebuffer",gr.framebuffers)},vn=(e,t)=>{gn(e,t,"createQuery",gr.queries)},wn=(e,t)=>{for(var r=0;r<e;r++){var o=_u.disjointTimerQueryExt.createQueryEXT();if(!o){for(gr.recordError(1282);r<e;)F[t+4*r++>>2]=0;return}var n=gr.getNewId(gr.queries);o.name=n,gr.queries[n]=o,F[t+4*r>>2]=n}},_n=(e,t)=>{gn(e,t,"createRenderbuffer",gr.renderbuffers)},En=(e,t)=>{gn(e,t,"createSampler",gr.samplers)},Sn=(e,t)=>{gn(e,t,"createTexture",gr.textures)},Cn=(e,t)=>{gn(e,t,"createTransformFeedback",gr.transformFeedbacks)};function kn(e,t){gn(e,t,"createVertexArray",gr.vaos)}var xn,Tn,An,Pn=kn,qn=kn,Fn=function(e){_u.generateMipmap(e)},Ln=(e,t,r,o,n,i,a,s)=>{t=gr.programs[t];var u=_u[e](t,r);if(u){var c=s&&Nt(u.name,s,o);n&&(F[n>>2]=c),i&&(F[i>>2]=u.size),a&&(F[a>>2]=u.type)}},Bn=(e,t,r,o,n,i,a)=>{Ln("getActiveAttrib",e,t,r,o,n,i,a)},Dn=(e,t,r,o,n,i,a)=>{Ln("getActiveUniform",e,t,r,o,n,i,a)},Rn=(e,t,r,o,n)=>{e=gr.programs[e];var i=_u.getActiveUniformBlockName(e,t);if(i)if(n&&r>0){var a=Nt(i,n,r);o&&(F[o>>2]=a)}else o&&(F[o>>2]=0)},Mn=(e,t,r,o)=>{if(o)if(e=gr.programs[e],35393!=r){var n=_u.getActiveUniformBlockParameter(e,t,r);if(null!==n)if(35395==r)for(var i=0;i<n.length;i++)F[o+4*i>>2]=n[i];else F[o>>2]=n}else{var a=_u.getActiveUniformBlockName(e,t);F[o>>2]=a.length+1}else gr.recordError(1281)},In=(e,t,r,o,n)=>{if(n)if(t>0&&0==r)gr.recordError(1281);else{e=gr.programs[e];for(var i=[],a=0;a<t;a++)i.push(F[r+4*a>>2]);var s=_u.getActiveUniforms(e,i,o);if(s){var u=s.length;for(a=0;a<u;a++)F[n+4*a>>2]=s[a]}}else gr.recordError(1281)},On=(e,t,r,o)=>{var n=_u.getAttachedShaders(gr.programs[e]),i=n.length;i>t&&(i=t),F[r>>2]=i;for(var a=0;a<i;++a){var s=gr.shaders.indexOf(n[a]);F[o+4*a>>2]=s}},jn=(e,t)=>_u.getAttribLocation(gr.programs[e],ke(t)),Un=(e,t)=>{L[e>>2]=t;var r=L[e>>2];L[e+4>>2]=(t-r)/4294967296},$n=function(){var e,t=(e=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","WEBGL_clip_cull_distance","EXT_color_buffer_half_float","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"],(_u.getSupportedExtensions()||[]).filter((t=>e.includes(t))));return t=t.concat(t.map((e=>"GL_"+e)))},Nn=(e,t,r)=>{if(t){var o=void 0;switch(e){case 36346:o=1;break;case 36344:return void(0!=r&&1!=r&&gr.recordError(1280));case 34814:case 36345:o=0;break;case 34466:var n=_u.getParameter(34467);o=n?n.length:0;break;case 33309:if(gr.currentContext.version<2)return void gr.recordError(1282);o=$n().length;break;case 33307:case 33308:if(gr.currentContext.version<2)return void gr.recordError(1280);o=33307==e?3:0}if(void 0===o){var i=_u.getParameter(e);switch(typeof i){case"number":o=i;break;case"boolean":o=i?1:0;break;case"string":return void gr.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:o=0;break;default:return void gr.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:F[t+4*a>>2]=i[a];break;case 2:B[t+4*a>>2]=i[a];break;case 4:T[t+a>>0]=i[a]?1:0}return}try{o=0|i.name}catch(t){return gr.recordError(1280),void k(`GL_INVALID_ENUM in glGet${r}v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return gr.recordError(1280),void k(`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:Un(t,o);break;case 0:F[t>>2]=o;break;case 2:B[t>>2]=o;break;case 4:T[t>>0]=o?1:0}}else gr.recordError(1281)},Hn=(e,t)=>Nn(e,t,4),Vn=(e,t,r)=>{r?Un(r,_u.getBufferParameter(e,t)):gr.recordError(1281)},Wn=(e,t,r)=>{r?F[r>>2]=_u.getBufferParameter(e,t):gr.recordError(1281)},zn=()=>{var e=_u.getError()||gr.lastError;return gr.lastError=0,e},Gn=(e,t)=>Nn(e,t,2),Yn=(e,t)=>_u.getFragDataLocation(gr.programs[e],ke(t)),Xn=(e,t,r,o)=>{var n=_u.getFramebufferAttachmentParameter(e,t,r);(n instanceof WebGLRenderbuffer||n instanceof WebGLTexture)&&(n=0|n.name),F[o>>2]=n},Zn=(e,t,r,o)=>{if(r){var n,i=_u.getIndexedParameter(e,t);switch(typeof i){case"boolean":n=i?1:0;break;case"number":n=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:n=0;break;default:return void gr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void gr.recordError(1280);n=0|i.name}break;default:return void gr.recordError(1280)}switch(o){case 1:Un(r,n);break;case 0:F[r>>2]=n;break;case 2:B[r>>2]=n;break;case 4:T[r>>0]=n?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+o}}else gr.recordError(1281)},Kn=(e,t,r)=>Zn(e,t,r,1),Qn=(e,t)=>{Nn(e,t,1)},Jn=(e,t,r)=>Zn(e,t,r,0),ei=(e,t)=>Nn(e,t,0),ti=(e,t,r,o,n)=>{if(o<0)gr.recordError(1281);else if(n){var i=_u.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<o;++a)F[n+4*a>>2]=i[a]}else gr.recordError(1281)},ri=(e,t,r,o,n)=>{gr.recordError(1282)},oi=(e,t,r,o)=>{var n=_u.getProgramInfoLog(gr.programs[e]);null===n&&(n="(unknown error)");var i=t>0&&o?Nt(n,o,t):0;r&&(F[r>>2]=i)},ni=(e,t,r)=>{if(r)if(e>=gr.counter)gr.recordError(1281);else if(e=gr.programs[e],35716==t){var o=_u.getProgramInfoLog(e);null===o&&(o="(unknown error)"),F[r>>2]=o.length+1}else if(35719==t){if(!e.maxUniformLength)for(var n=0;n<_u.getProgramParameter(e,35718);++n)e.maxUniformLength=Math.max(e.maxUniformLength,_u.getActiveUniform(e,n).name.length+1);F[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(n=0;n<_u.getProgramParameter(e,35721);++n)e.maxAttributeLength=Math.max(e.maxAttributeLength,_u.getActiveAttrib(e,n).name.length+1);F[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(n=0;n<_u.getProgramParameter(e,35382);++n)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,_u.getActiveUniformBlockName(e,n).length+1);F[r>>2]=e.maxUniformBlockNameLength}else F[r>>2]=_u.getProgramParameter(e,t);else gr.recordError(1281)},ii=(e,t,r)=>{if(r){var o,n=gr.queries[e];o=gr.currentContext.version<2?_u.disjointTimerQueryExt.getQueryObjectEXT(n,t):_u.getQueryParameter(n,t),Un(r,"boolean"==typeof o?o?1:0:o)}else gr.recordError(1281)},ai=ii,si=(e,t,r)=>{if(r){var o,n=gr.queries[e],i=_u.disjointTimerQueryExt.getQueryObjectEXT(n,t);o="boolean"==typeof i?i?1:0:i,F[r>>2]=o}else gr.recordError(1281)},ui=si,ci=ii,li=(e,t,r)=>{if(r){var o,n=gr.queries[e],i=_u.getQueryParameter(n,t);o="boolean"==typeof i?i?1:0:i,F[r>>2]=o}else gr.recordError(1281)},di=si,pi=(e,t,r)=>{r?F[r>>2]=_u.getQuery(e,t):gr.recordError(1281)},hi=(e,t,r)=>{r?F[r>>2]=_u.disjointTimerQueryExt.getQueryEXT(e,t):gr.recordError(1281)},fi=(e,t,r)=>{r?F[r>>2]=_u.getRenderbufferParameter(e,t):gr.recordError(1281)},mi=(e,t,r)=>{r?B[r>>2]=_u.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},gi=(e,t,r)=>{r?F[r>>2]=_u.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},yi=(e,t,r,o)=>{var n=_u.getShaderInfoLog(gr.shaders[e]);null===n&&(n="(unknown error)");var i=t>0&&o?Nt(n,o,t):0;r&&(F[r>>2]=i)},bi=(e,t,r,o)=>{var n=_u.getShaderPrecisionFormat(e,t);F[r>>2]=n.rangeMin,F[r+4>>2]=n.rangeMax,F[o>>2]=n.precision},vi=(e,t,r,o)=>{var n=_u.getShaderSource(gr.shaders[e]);if(n){var i=t>0&&o?Nt(n,o,t):0;r&&(F[r>>2]=i)}},wi=(e,t,r)=>{if(r)if(35716==t){var o=_u.getShaderInfoLog(gr.shaders[e]);null===o&&(o="(unknown error)");var n=o?o.length+1:0;F[r>>2]=n}else if(35720==t){var i=_u.getShaderSource(gr.shaders[e]),a=i?i.length+1:0;F[r>>2]=a}else F[r>>2]=_u.getShaderParameter(gr.shaders[e],t);else gr.recordError(1281)},_i=e=>{var t=gr.stringCache[e];if(!t){switch(e){case 7939:t=ar($n().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=_u.getParameter(e);r||gr.recordError(1280),t=r?ar(r):0;break;case 7938:var o=_u.getParameter(7938);o=gr.currentContext.version>=2?`OpenGL ES 3.0 (${o})`:`OpenGL ES 2.0 (${o})`,t=ar(o);break;case 35724:var n=_u.getParameter(35724),i=n.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),n=`OpenGL ES GLSL ES ${i[1]} (${n})`),t=ar(n);break;default:gr.recordError(1280)}gr.stringCache[e]=t}return t},Ei=(e,t)=>{if(gr.currentContext.version<2)return gr.recordError(1282),0;var r=gr.stringiCache[e];if(r)return t<0||t>=r.length?(gr.recordError(1281),0):r[t];if(7939===e){var o=$n().map(ar);return r=gr.stringiCache[e]=o,t<0||t>=r.length?(gr.recordError(1281),0):r[t]}return gr.recordError(1280),0},Si=(e,t,r,o,n)=>{if(r<0)gr.recordError(1281);else if(n){var i=_u.getSyncParameter(gr.syncs[e],t);null!==i&&(F[n>>2]=i,o&&(F[o>>2]=1))}else gr.recordError(1281)},Ci=(e,t,r)=>{r?B[r>>2]=_u.getTexParameter(e,t):gr.recordError(1281)},ki=(e,t,r)=>{r?F[r>>2]=_u.getTexParameter(e,t):gr.recordError(1281)},xi=(e,t,r,o,n,i,a)=>{e=gr.programs[e];var s=_u.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Nt(s.name,a,r);o&&(F[o>>2]=u)}else o&&(F[o>>2]=0);n&&(F[n>>2]=s.size),i&&(F[i>>2]=s.type)}},Ti=(e,t)=>_u.getUniformBlockIndex(gr.programs[e],ke(t)),Ai=(e,t,r,o)=>{if(o)if(t>0&&(0==r||0==o))gr.recordError(1281);else{e=gr.programs[e];for(var n=[],i=0;i<t;i++)n.push(ke(F[r+4*i>>2]));var a=_u.getUniformIndices(e,n);if(a){var s=a.length;for(i=0;i<s;i++)F[o+4*i>>2]=a[i]}}else gr.recordError(1281)},Pi=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),qi=e=>{var t,r,o=e.uniformLocsById,n=e.uniformSizeAndIdsByName;if(!o)for(e.uniformLocsById=o={},e.uniformArrayNamesById={},t=0;t<_u.getProgramParameter(e,35718);++t){var i=_u.getActiveUniform(e,t),a=i.name,s=i.size,u=Pi(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,n[c]=[s,l],r=0;r<s;++r)o[l]=r,e.uniformArrayNamesById[l++]=c}},Fi=(e,t)=>{if(t=ke(t),e=gr.programs[e]){qi(e);var r=e.uniformLocsById,o=0,n=t,i=Pi(t);i>0&&(s=t.slice(i+1),o=parseInt(s)>>>0,n=t.slice(0,i));var a=e.uniformSizeAndIdsByName[n];if(a&&o<a[0]&&(r[o+=a[1]]=r[o]||_u.getUniformLocation(e,t)))return o}else gr.recordError(1281);var s;return-1},Li=e=>{var t=_u.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=_u.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?`[${r}]`:""))),r}gr.recordError(1282)},Bi=(e,t,r,o)=>{if(r){e=gr.programs[e],qi(e);var n=_u.getUniform(e,Li(t));if("number"==typeof n||"boolean"==typeof n)switch(o){case 0:F[r>>2]=n;break;case 2:B[r>>2]=n}else for(var i=0;i<n.length;i++)switch(o){case 0:F[r+4*i>>2]=n[i];break;case 2:B[r+4*i>>2]=n[i]}}else gr.recordError(1281)},Di=(e,t,r)=>{Bi(e,t,r,2)},Ri=(e,t,r)=>{Bi(e,t,r,0)},Mi=(e,t,r)=>Bi(e,t,r,0),Ii=(e,t,r,o)=>{if(r){var n=_u.getVertexAttrib(e,t);if(34975==t)F[r>>2]=n&&n.name;else if("number"==typeof n||"boolean"==typeof n)switch(o){case 0:F[r>>2]=n;break;case 2:B[r>>2]=n;break;case 5:F[r>>2]=Math.fround(n)}else for(var i=0;i<n.length;i++)switch(o){case 0:F[r+4*i>>2]=n[i];break;case 2:B[r+4*i>>2]=n[i];break;case 5:F[r+4*i>>2]=Math.fround(n[i])}}else gr.recordError(1281)},Oi=(e,t,r)=>{Ii(e,t,r,0)},ji=Oi,Ui=Oi,$i=(e,t,r)=>{r?F[r>>2]=_u.getVertexAttribOffset(e,t):gr.recordError(1281)},Ni=(e,t,r)=>{Ii(e,t,r,2)},Hi=(e,t,r)=>{Ii(e,t,r,5)},Vi=function(e,t){_u.hint(e,t)},Wi=(e,t,r)=>{for(var o=No[t],n=0;n<t;n++)o[n]=F[r+4*n>>2];_u.invalidateFramebuffer(e,o)},zi=(e,t,r,o,n,i,a)=>{for(var s=No[t],u=0;u<t;u++)s[u]=F[r+4*u>>2];_u.invalidateSubFramebuffer(e,s,o,n,i,a)},Gi=e=>{var t=gr.buffers[e];return t?_u.isBuffer(t):0},Yi=function(e){return _u.isEnabled(e)},Xi=e=>{var t=gr.framebuffers[e];return t?_u.isFramebuffer(t):0},Zi=e=>(e=gr.programs[e])?_u.isProgram(e):0,Ki=e=>{var t=gr.queries[e];return t?_u.isQuery(t):0},Qi=e=>{var t=gr.queries[e];return t?_u.disjointTimerQueryExt.isQueryEXT(t):0},Ji=e=>{var t=gr.renderbuffers[e];return t?_u.isRenderbuffer(t):0},ea=e=>{var t=gr.samplers[e];return t?_u.isSampler(t):0},ta=e=>{var t=gr.shaders[e];return t?_u.isShader(t):0},ra=e=>_u.isSync(gr.syncs[e]),oa=e=>{var t=gr.textures[e];return t?_u.isTexture(t):0},na=e=>_u.isTransformFeedback(gr.transformFeedbacks[e]),ia=e=>{var t=gr.vaos[e];return t?_u.isVertexArray(t):0},aa=ia,sa=ia,ua=function(e){_u.lineWidth(e)},ca=e=>{e=gr.programs[e],_u.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},la=(e,t,r,o,n,i)=>{_u.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,F,t>>2,F,r>>2,F,o>>2,L,n>>2,i)},da=(e,t,r,o,n,i,a,s)=>{_u.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,F,t>>2,r,F,o>>2,F,n>>2,F,i>>2,L,a>>2,s)},pa=function(){_u.pauseTransformFeedback()},ha=(e,t)=>{3317==e&&(gr.unpackAlignment=t),_u.pixelStorei(e,t)},fa=function(e,t){_u.polygonOffset(e,t)},ma=(e,t,r,o)=>{gr.recordError(1280)},ga=(e,t,r)=>{gr.recordError(1280)},ya=(e,t)=>{_u.disjointTimerQueryExt.queryCounterEXT(gr.queries[e],t)},ba=function(e){_u.readBuffer(e)},va=e=>0==(e-=5120)?T:1==e?A:2==e?P:4==e?F:6==e?B:5==e||28922==e||28520==e||30779==e||30782==e?L:q,wa=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),_a=(e,t,r,o,n,i)=>{var a=va(e),s=wa(a),u=1<<s,c=(e=>({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(t)*u,l=((e,t,r,o)=>{var n;return t*(e*r+(n=o)-1&-n)})(r,o,c,gr.unpackAlignment);return a.subarray(n>>s,n+l>>s)},Ea=(e,t,r,o,n,i,a)=>{if(gr.currentContext.version>=2)if(_u.currentPixelPackBufferBinding)_u.readPixels(e,t,r,o,n,i,a);else{var s=va(i);_u.readPixels(e,t,r,o,n,i,s,a>>wa(s))}else{var u=_a(i,n,r,o,a);u?_u.readPixels(e,t,r,o,n,i,u):gr.recordError(1280)}},Sa=()=>{},Ca=function(e,t,r,o){_u.renderbufferStorage(e,t,r,o)},ka=function(e,t,r,o,n){_u.renderbufferStorageMultisample(e,t,r,o,n)},xa=function(){_u.resumeTransformFeedback()},Ta=(e,t)=>{_u.sampleCoverage(e,!!t)},Aa=(e,t,r)=>{_u.samplerParameterf(gr.samplers[e],t,r)},Pa=(e,t,r)=>{var o=B[r>>2];_u.samplerParameterf(gr.samplers[e],t,o)},qa=(e,t,r)=>{_u.samplerParameteri(gr.samplers[e],t,r)},Fa=(e,t,r)=>{var o=F[r>>2];_u.samplerParameteri(gr.samplers[e],t,o)},La=function(e,t,r,o){_u.scissor(e,t,r,o)},Ba=(e,t,r,o,n)=>{gr.recordError(1280)},Da=(e,t,r,o)=>{var n=gr.getSource(e,t,r,o);if(gr.currentContext.version>=2&&n.includes("#version 100")){var i="";(n=(n=n.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",n=n.replace(/gl_FragColor/g,"GL_FragColor")),n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n.includes("attribute")?(n=n.replace(/attribute/g,"in")).replace(/varying/g,"out"):n.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)}_u.shaderSource(gr.shaders[e],n)},Ra=function(e,t,r){_u.stencilFunc(e,t,r)},Ma=function(e,t,r,o){_u.stencilFuncSeparate(e,t,r,o)},Ia=function(e){_u.stencilMask(e)},Oa=function(e,t){_u.stencilMaskSeparate(e,t)},ja=function(e,t,r){_u.stencilOp(e,t,r)},Ua=function(e,t,r,o){_u.stencilOpSeparate(e,t,r,o)},$a=(e,t,r,o,n,i,a,s,u)=>{if(gr.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)),gr.currentContext.version>=2)if(_u.currentPixelUnpackBufferBinding)_u.texImage2D(e,t,r,o,n,i,a,s,u);else if(u){var c=va(s);_u.texImage2D(e,t,r,o,n,i,a,s,c,u>>wa(c))}else _u.texImage2D(e,t,r,o,n,i,a,s,null);else _u.texImage2D(e,t,r,o,n,i,a,s,u?_a(s,a,o,n,u):null)},Na=(e,t,r,o,n,i,a,s,u,c)=>{if(_u.currentPixelUnpackBufferBinding)_u.texImage3D(e,t,r,o,n,i,a,s,u,c);else if(c){var l=va(u);_u.texImage3D(e,t,r,o,n,i,a,s,u,l,c>>wa(l))}else _u.texImage3D(e,t,r,o,n,i,a,s,u,null)},Ha=function(e,t,r){_u.texParameterf(e,t,r)},Va=(e,t,r)=>{var o=B[r>>2];_u.texParameterf(e,t,o)},Wa=function(e,t,r){_u.texParameteri(e,t,r)},za=(e,t,r)=>{var o=F[r>>2];_u.texParameteri(e,t,o)},Ga=function(e,t,r,o,n){_u.texStorage2D(e,t,r,o,n)},Ya=function(e,t,r,o,n,i){_u.texStorage3D(e,t,r,o,n,i)},Xa=(e,t,r,o,n,i,a,s,u)=>{if(gr.currentContext.version>=2&&36193==s&&(s=5131),gr.currentContext.version>=2)if(_u.currentPixelUnpackBufferBinding)_u.texSubImage2D(e,t,r,o,n,i,a,s,u);else if(u){var c=va(s);_u.texSubImage2D(e,t,r,o,n,i,a,s,c,u>>wa(c))}else _u.texSubImage2D(e,t,r,o,n,i,a,s,null);else{var l=null;u&&(l=_a(s,a,n,i,u)),_u.texSubImage2D(e,t,r,o,n,i,a,s,l)}},Za=(e,t,r,o,n,i,a,s,u,c,l)=>{if(_u.currentPixelUnpackBufferBinding)_u.texSubImage3D(e,t,r,o,n,i,a,s,u,c,l);else if(l){var d=va(c);_u.texSubImage3D(e,t,r,o,n,i,a,s,u,c,d,l>>wa(d))}else _u.texSubImage3D(e,t,r,o,n,i,a,s,u,c,null)},Ka=(e,t,r,o)=>{e=gr.programs[e];for(var n=[],i=0;i<t;i++)n.push(ke(F[r+4*i>>2]));_u.transformFeedbackVaryings(e,n,o)},Qa=(e,t)=>{_u.uniform1f(Li(e),t)},Ja=[],es=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform1fv(Li(e),B,r>>2,t);else{if(t<=288)for(var o=Ja[t-1],n=0;n<t;++n)o[n]=B[r+4*n>>2];else o=B.subarray(r>>2,r+4*t>>2);_u.uniform1fv(Li(e),o)}},ts=(e,t)=>{_u.uniform1i(Li(e),t)},rs=[],os=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform1iv(Li(e),F,r>>2,t);else{if(t<=288)for(var o=rs[t-1],n=0;n<t;++n)o[n]=F[r+4*n>>2];else o=F.subarray(r>>2,r+4*t>>2);_u.uniform1iv(Li(e),o)}},ns=(e,t)=>{_u.uniform1ui(Li(e),t)},is=(e,t,r)=>{t&&_u.uniform1uiv(Li(e),L,r>>2,t)},as=(e,t,r)=>{_u.uniform2f(Li(e),t,r)},ss=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform2fv(Li(e),B,r>>2,2*t);else{if(t<=144)for(var o=Ja[2*t-1],n=0;n<2*t;n+=2)o[n]=B[r+4*n>>2],o[n+1]=B[r+(4*n+4)>>2];else o=B.subarray(r>>2,r+8*t>>2);_u.uniform2fv(Li(e),o)}},us=(e,t,r)=>{_u.uniform2i(Li(e),t,r)},cs=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform2iv(Li(e),F,r>>2,2*t);else{if(t<=144)for(var o=rs[2*t-1],n=0;n<2*t;n+=2)o[n]=F[r+4*n>>2],o[n+1]=F[r+(4*n+4)>>2];else o=F.subarray(r>>2,r+8*t>>2);_u.uniform2iv(Li(e),o)}},ls=(e,t,r)=>{_u.uniform2ui(Li(e),t,r)},ds=(e,t,r)=>{t&&_u.uniform2uiv(Li(e),L,r>>2,2*t)},ps=(e,t,r,o)=>{_u.uniform3f(Li(e),t,r,o)},hs=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform3fv(Li(e),B,r>>2,3*t);else{if(t<=96)for(var o=Ja[3*t-1],n=0;n<3*t;n+=3)o[n]=B[r+4*n>>2],o[n+1]=B[r+(4*n+4)>>2],o[n+2]=B[r+(4*n+8)>>2];else o=B.subarray(r>>2,r+12*t>>2);_u.uniform3fv(Li(e),o)}},fs=(e,t,r,o)=>{_u.uniform3i(Li(e),t,r,o)},ms=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform3iv(Li(e),F,r>>2,3*t);else{if(t<=96)for(var o=rs[3*t-1],n=0;n<3*t;n+=3)o[n]=F[r+4*n>>2],o[n+1]=F[r+(4*n+4)>>2],o[n+2]=F[r+(4*n+8)>>2];else o=F.subarray(r>>2,r+12*t>>2);_u.uniform3iv(Li(e),o)}},gs=(e,t,r,o)=>{_u.uniform3ui(Li(e),t,r,o)},ys=(e,t,r)=>{t&&_u.uniform3uiv(Li(e),L,r>>2,3*t)},bs=(e,t,r,o,n)=>{_u.uniform4f(Li(e),t,r,o,n)},vs=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform4fv(Li(e),B,r>>2,4*t);else{if(t<=72){var o=Ja[4*t-1],n=B;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;o[i]=n[a],o[i+1]=n[a+1],o[i+2]=n[a+2],o[i+3]=n[a+3]}}else o=B.subarray(r>>2,r+16*t>>2);_u.uniform4fv(Li(e),o)}},ws=(e,t,r,o,n)=>{_u.uniform4i(Li(e),t,r,o,n)},_s=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform4iv(Li(e),F,r>>2,4*t);else{if(t<=72)for(var o=rs[4*t-1],n=0;n<4*t;n+=4)o[n]=F[r+4*n>>2],o[n+1]=F[r+(4*n+4)>>2],o[n+2]=F[r+(4*n+8)>>2],o[n+3]=F[r+(4*n+12)>>2];else o=F.subarray(r>>2,r+16*t>>2);_u.uniform4iv(Li(e),o)}},Es=(e,t,r,o,n)=>{_u.uniform4ui(Li(e),t,r,o,n)},Ss=(e,t,r)=>{t&&_u.uniform4uiv(Li(e),L,r>>2,4*t)},Cs=(e,t,r)=>{e=gr.programs[e],_u.uniformBlockBinding(e,t,r)},ks=(e,t,r,o)=>{if(gr.currentContext.version>=2)t&&_u.uniformMatrix2fv(Li(e),!!r,B,o>>2,4*t);else{if(t<=72)for(var n=Ja[4*t-1],i=0;i<4*t;i+=4)n[i]=B[o+4*i>>2],n[i+1]=B[o+(4*i+4)>>2],n[i+2]=B[o+(4*i+8)>>2],n[i+3]=B[o+(4*i+12)>>2];else n=B.subarray(o>>2,o+16*t>>2);_u.uniformMatrix2fv(Li(e),!!r,n)}},xs=(e,t,r,o)=>{t&&_u.uniformMatrix2x3fv(Li(e),!!r,B,o>>2,6*t)},Ts=(e,t,r,o)=>{t&&_u.uniformMatrix2x4fv(Li(e),!!r,B,o>>2,8*t)},As=(e,t,r,o)=>{if(gr.currentContext.version>=2)t&&_u.uniformMatrix3fv(Li(e),!!r,B,o>>2,9*t);else{if(t<=32)for(var n=Ja[9*t-1],i=0;i<9*t;i+=9)n[i]=B[o+4*i>>2],n[i+1]=B[o+(4*i+4)>>2],n[i+2]=B[o+(4*i+8)>>2],n[i+3]=B[o+(4*i+12)>>2],n[i+4]=B[o+(4*i+16)>>2],n[i+5]=B[o+(4*i+20)>>2],n[i+6]=B[o+(4*i+24)>>2],n[i+7]=B[o+(4*i+28)>>2],n[i+8]=B[o+(4*i+32)>>2];else n=B.subarray(o>>2,o+36*t>>2);_u.uniformMatrix3fv(Li(e),!!r,n)}},Ps=(e,t,r,o)=>{t&&_u.uniformMatrix3x2fv(Li(e),!!r,B,o>>2,6*t)},qs=(e,t,r,o)=>{t&&_u.uniformMatrix3x4fv(Li(e),!!r,B,o>>2,12*t)},Fs=(e,t,r,o)=>{if(gr.currentContext.version>=2)t&&_u.uniformMatrix4fv(Li(e),!!r,B,o>>2,16*t);else{if(t<=18){var n=Ja[16*t-1],i=B;o>>=2;for(var a=0;a<16*t;a+=16){var s=o+a;n[a]=i[s],n[a+1]=i[s+1],n[a+2]=i[s+2],n[a+3]=i[s+3],n[a+4]=i[s+4],n[a+5]=i[s+5],n[a+6]=i[s+6],n[a+7]=i[s+7],n[a+8]=i[s+8],n[a+9]=i[s+9],n[a+10]=i[s+10],n[a+11]=i[s+11],n[a+12]=i[s+12],n[a+13]=i[s+13],n[a+14]=i[s+14],n[a+15]=i[s+15]}}else n=B.subarray(o>>2,o+64*t>>2);_u.uniformMatrix4fv(Li(e),!!r,n)}},Ls=(e,t,r,o)=>{t&&_u.uniformMatrix4x2fv(Li(e),!!r,B,o>>2,8*t)},Bs=(e,t,r,o)=>{t&&_u.uniformMatrix4x3fv(Li(e),!!r,B,o>>2,12*t)},Ds=e=>{e=gr.programs[e],_u.useProgram(e),_u.currentProgram=e},Rs=e=>{_u.validateProgram(gr.programs[e])},Ms=function(e,t){_u.vertexAttrib1f(e,t)},Is=(e,t)=>{_u.vertexAttrib1f(e,B[t>>2])},Os=function(e,t,r){_u.vertexAttrib2f(e,t,r)},js=(e,t)=>{_u.vertexAttrib2f(e,B[t>>2],B[t+4>>2])},Us=function(e,t,r,o){_u.vertexAttrib3f(e,t,r,o)},$s=(e,t)=>{_u.vertexAttrib3f(e,B[t>>2],B[t+4>>2],B[t+8>>2])},Ns=function(e,t,r,o,n){_u.vertexAttrib4f(e,t,r,o,n)},Hs=(e,t)=>{_u.vertexAttrib4f(e,B[t>>2],B[t+4>>2],B[t+8>>2],B[t+12>>2])},Vs=(e,t)=>{_u.vertexAttribDivisor(e,t)},Ws=Vs,zs=Vs,Gs=Vs,Ys=Vs,Xs=Vs,Zs=function(e,t,r,o,n){_u.vertexAttribI4i(e,t,r,o,n)},Ks=(e,t)=>{_u.vertexAttribI4i(e,F[t>>2],F[t+4>>2],F[t+8>>2],F[t+12>>2])},Qs=function(e,t,r,o,n){_u.vertexAttribI4ui(e,t,r,o,n)},Js=(e,t)=>{_u.vertexAttribI4ui(e,L[t>>2],L[t+4>>2],L[t+8>>2],L[t+12>>2])},eu=(e,t,r,o,n)=>{_u.vertexAttribIPointer(e,t,r,o,n)},tu=(e,t,r,o,n,i)=>{_u.vertexAttribPointer(e,t,r,!!o,n,i)},ru=function(e,t,r,o){_u.viewport(e,t,r,o)},ou=(e,t,r)=>{r=Number(r),_u.waitSync(gr.syncs[e],t,r)},nu=e=>{var t=(e-S.buffer.byteLength+65535)/65536;try{return S.grow(t),j(),1}catch(e){}},iu={removeAllEventListeners(){for(;iu.eventHandlers.length;)iu._removeHandler(iu.eventHandlers.length-1);iu.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,t,r){function o(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 n in iu.deferredCalls){var i=iu.deferredCalls[n];if(i.targetFunction==e&&o(i.argsList,r))return}iu.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),iu.deferredCalls.sort(((e,t)=>e.precedence<t.precedence))},removeDeferredCalls(e){for(var t=0;t<iu.deferredCalls.length;++t)iu.deferredCalls[t].targetFunction==e&&(iu.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:()=>navigator.userActivation?navigator.userActivation.isActive:iu.inEventHandler&&iu.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(iu.canPerformEventHandlerRequests())for(var e=0;e<iu.deferredCalls.length;++e){var t=iu.deferredCalls[e];iu.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,t)=>{for(var r=0;r<iu.eventHandlers.length;++r)iu.eventHandlers[r].target!=e||t&&t!=iu.eventHandlers[r].eventTypeString||iu._removeHandler(r--)},_removeHandler(e){var t=iu.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),iu.eventHandlers.splice(e,1)},registerOrRemoveHandler(e){if(!e.target)return-4;if(e.callbackfunc)e.eventListenerFunc=function(t){++iu.inEventHandler,iu.currentEventHandler=e,iu.runDeferredCalls(),e.handlerFunc(t),iu.runDeferredCalls(),--iu.inEventHandler},e.target.addEventListener(e.eventTypeString,e.eventListenerFunc,e.useCapture),iu.eventHandlers.push(e);else for(var t=0;t<iu.eventHandlers.length;++t)iu.eventHandlers[t].target==e.target&&iu.eventHandlers[t].eventTypeString==e.eventTypeString&&iu._removeHandler(t--);return 0},getNodeNameForTarget:e=>e?e==window?"#window":e==screen?"#screen":e?.nodeName||"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},au=["default","low-power","high-performance"],su=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],uu=e=>{var t;return e=(t=e)>2?ke(t):t,su[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},cu=(e,t)=>{var r=t>>2,o=F[r+6],n={alpha:!!F[r+0],depth:!!F[r+1],stencil:!!F[r+2],antialias:!!F[r+3],premultipliedAlpha:!!F[r+4],preserveDrawingBuffer:!!F[r+5],powerPreference:au[o],failIfMajorPerformanceCaveat:!!F[r+7],majorVersion:F[r+8],minorVersion:F[r+9],enableExtensionsByDefault:F[r+10],explicitSwapControl:F[r+11],proxyContextToMainThread:F[r+12],renderViaOffscreenBackBuffer:F[r+13]},i=uu(e);return i?n.explicitSwapControl?0:gr.createContext(i,n):0},lu={},du=()=>{if(!du.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 lu)void 0===lu[t]?delete e[t]:e[t]=lu[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);du.strings=r}return du.strings},pu=(e,t,r,o)=>{for(var n=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Ce.read(e,T,a,s,o);if(u<0)return-1;if(n+=u,u<s)break;void 0!==o&&(o+=u)}return n},hu=[31,29,31,30,31,30,31,31,30,31,30,31],fu=[31,28,31,30,31,30,31,31,30,31,30,31],mu=(e,t)=>{T.set(e,t)},gu=(e,t,r,o)=>{var n=L[o+40>>2],i={tm_sec:F[o>>2],tm_min:F[o+4>>2],tm_hour:F[o+8>>2],tm_mday:F[o+12>>2],tm_mon:F[o+16>>2],tm_year:F[o+20>>2],tm_wday:F[o+24>>2],tm_yday:F[o+28>>2],tm_isdst:F[o+32>>2],tm_gmtoff:F[o+36>>2],tm_zone:n?ke(n):""},a=ke(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 o="number"==typeof e?e.toString():e||"";o.length<t;)o=r[0]+o;return o}function p(e,t){return d(e,t,"0")}function h(e,t){function r(e){return e<0?-1:e>0?1:0}var o;return 0===(o=r(e.getFullYear()-t.getFullYear()))&&0===(o=r(e.getMonth()-t.getMonth()))&&(o=r(e.getDate()-t.getDate())),o}function f(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 o=rr(r.getFullYear()),n=r.getMonth(),i=(o?hu:fu)[n];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+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),o=new Date(t.getFullYear()+1,0,4),n=f(r),i=f(o);return h(n,t)<=0?h(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=>p((e.tm_year+1900)/100|0,2),"%d":e=>p(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":m,"%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,o=0;o<=t;r+=e[o++]);return r})(rr(e.tm_year+1900)?hu:fu,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&&rr(e.tm_year)||(t=1)}}else{t=52;var o=(e.tm_wday+7-e.tm_yday-1)%7;(4==o||5==o&&rr(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"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=be(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(mu(y,e),y.length-1)},yu=e=>{var t=ge(e)+1,r=$u(t);return Nt(e,r,t),r},bu=function(e,t,r,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ce.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=o},vu=365,wu=146;Object.defineProperties(bu.prototype,{read:{get:function(){return(this.mode&vu)===vu},set:function(e){e?this.mode|=vu:this.mode&=-366}},write:{get:function(){return(this.mode&wu)===wu},set:function(e){e?this.mode|=wu:this.mode&=-147}},isFolder:{get:function(){return Ce.isDir(this.mode)}},isDevice:{get:function(){return Ce.isChrdev(this.mode)}}}),Ce.FSNode=bu,Ce.createPreloadedFile=(e,t,r,o,n,i,a,s,u,c)=>{var d=t?pe.resolve(le.join2(e,t)):e;function p(r){function l(r){c?.(),s||((e,t,r,o,n,i)=>{Ce.createDataFile(e,t,r,o,n,i)})(e,t,r,o,n,u),i?.(),X()}((e,t,r,o)=>{void 0!==fr&&fr.init();var n=!1;return Ee.forEach((i=>{n||i.canHandle(t)&&(i.handle(e,t,r,o),n=!0)})),n})(r,d,l,(()=>{a?.(),X()}))||l(r)}Y(),"string"==typeof r?((e,t,r,o)=>{var n=o?"":`al ${e}`;l(e,(e=>{t(new Uint8Array(e)),n&&X()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&Y()})(r,p,a):p(r)},Ce.staticInit(),u.FS_createPath=Ce.createPath,u.FS_createDataFile=Ce.createDataFile,u.FS_createPreloadedFile=Ce.createPreloadedFile,u.FS_unlink=Ce.unlink,u.FS_createLazyFile=Ce.createLazyFile,u.FS_createDevice=Ce.createDevice,qe=u.InternalError=class InternalError extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Fe=e})(),Le=u.BindingError=class BindingError extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(ut.prototype,{isAliasOf(e){if(!(this instanceof ut))return!1;if(!(e instanceof ut))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var o=e.$$.ptrType.registeredClass,n=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;o.baseClass;)n=o.upcast(n),o=o.baseClass;return t===o&&r===n},clone(){if(this.$$.ptr||ze(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=st(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},delete(){this.$$.ptr||ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),Ye(this),Xe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),et.push(this),1===et.length&&He&&He(tt),this.$$.deleteScheduled=!0,this}}),u.getInheritedInstanceCount=Qe,u.getLiveInheritedInstances=Je,u.flushPendingDeletes=tt,u.setDelayFunction=rt,Object.assign(vt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:We,readValueFromPointer:bt,fromWireType:at}),_t=u.UnboundTypeError=(xn=Error,(An=lt(Tn="UnboundTypeError",(function(e){this.name=Tn,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(xn.prototype),An.prototype.constructor=An,An.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},An),Dt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Object.assign(Dt,{reserved:Dt.allocated.length}),u.count_emval_handles=Mt,u.requestFullscreen=fr.requestFullscreen,u.requestAnimationFrame=fr.requestAnimationFrame,u.setCanvasSize=fr.setCanvasSize,u.pauseMainLoop=fr.mainLoop.pause,u.resumeMainLoop=fr.mainLoop.resume,u.getUserMedia=fr.getUserMedia,u.createContext=fr.createContext;for(var _u,Eu={},Su={},Cu=0;Cu<32;++Cu)No.push(new Array(Cu));var ku=new Float32Array(288);for(Cu=0;Cu<288;++Cu)Ja[Cu]=ku.subarray(0,Cu+1);var xu=new Int32Array(288);for(Cu=0;Cu<288;++Cu)rs[Cu]=xu.subarray(0,Cu+1);var Tu,Au={Oa:e=>{var t=new ExceptionInfo(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),se.push(t),Hu(t.excPtr),t.get_exception_ptr()},Na:()=>{Ou(0,0);var e=se.pop();Nu(e.excPtr),ue=0},o:()=>ce([]),ca:e=>ce([e]),k:(e,t,r)=>{throw new ExceptionInfo(e).init(t,r),ue=e},R:e=>{throw ue||(ue=e),ue},fa:function(e,t,r){xe.varargs=r;try{var o=xe.getStreamFromFD(e);switch(t){case 0:if((n=xe.get())<0)return-28;for(;Ce.streams[n];)n++;return Ce.createStream(o,n).fd;case 1:case 2:case 13:case 14:return 0;case 3:return o.flags;case 4:var n=xe.get();return o.flags|=n,0;case 12:return n=xe.getp(),P[n+0>>1]=2,0}return-28}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Bb:function(e,t){try{var r=xe.getStreamFromFD(e);return xe.doStat(Ce.stat,r.path,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Gb:function(e,t,r){xe.varargs=r;try{var o=xe.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return o.tty?0:-59;case 21505:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var n=o.tty.ops.ioctl_tcgets(o),i=xe.getp();F[i>>2]=n.c_iflag||0,F[i+4>>2]=n.c_oflag||0,F[i+8>>2]=n.c_cflag||0,F[i+12>>2]=n.c_lflag||0;for(var a=0;a<32;a++)T[i+a+17>>0]=n.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){i=xe.getp();var s=F[i>>2],u=F[i+4>>2],c=F[i+8>>2],l=F[i+12>>2],d=[];for(a=0;a<32;a++)d.push(T[i+a+17>>0]);return o.tty.ops.ioctl_tcsets(o.tty,t,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return o.tty?(i=xe.getp(),F[i>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return i=xe.getp(),Ce.ioctl(o,t,i);case 21523:if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var p=o.tty.ops.ioctl_tiocgwinsz(o.tty);i=xe.getp(),P[i>>1]=p[0],P[i+2>>1]=p[1]}return 0;default:return-28}}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t){try{return e=xe.getStr(e),xe.doStat(Ce.lstat,e,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t,r,o){try{t=xe.getStr(t);var n=256&o,i=4096&o;return o&=-6401,t=xe.calculateAt(e,t,i),xe.doStat(n?Ce.lstat:Ce.stat,t,r)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},wa:function(e,t,r,o){xe.varargs=o;try{t=xe.getStr(t),t=xe.calculateAt(e,t);var n=o?xe.get():0;return Ce.open(t,r,n).fd}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Ab:function(e,t){try{return e=xe.getStr(e),xe.doStat(Ce.stat,e,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Ba:e=>{var t=Te[e];delete Te[e];var r=t.elements,o=r.length,n=r.map((e=>e.getterReturnType)).concat(r.map((e=>e.setterArgumentType))),i=t.rawConstructor,a=t.rawDestructor;Ie([e],n,(function(e){return r.forEach(((t,r)=>{var n=e[r],i=t.getter,a=t.getterContext,s=e[r+o],u=t.setter,c=t.setterContext;t.read=e=>n.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(c,e,s.toWireType(r,t)),Ae(r)}})),[{name:t.name,fromWireType:e=>{for(var t=new Array(o),n=0;n<o;++n)t[n]=r[n].read(e);return a(e),t},toWireType:(e,n)=>{if(o!==n.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${o}, actual=${n.length}`);for(var s=i(),u=0;u<o;++u)r[u].write(s,n[u]);return null!==e&&e.push(a,s),s},argPackAdvance:We,readValueFromPointer:Pe,destructorFunction:a}]}))},z:e=>{var t=Oe[e];delete Oe[e];var r=t.rawConstructor,o=t.rawDestructor,n=t.fields,i=n.map((e=>e.getterReturnType)).concat(n.map((e=>e.setterArgumentType)));Ie([e],i,(e=>{var i={};return n.forEach(((t,r)=>{var o=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+n.length],l=t.setter,d=t.setterContext;i[o]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(d,e,c.toWireType(r,t)),Ae(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in i)t[r]=i[r].read(e);return o(e),t},toWireType:(e,t)=>{for(var n in i)if(!(n in t))throw new TypeError(`Missing field: "${n}"`);var a=r();for(n in i)i[n].write(a,t[n]);return null!==e&&e.push(o,a),a},argPackAdvance:We,readValueFromPointer:Pe,destructorFunction:o}]}))},Ea:(e,t,r,o,n)=>{var i=-1!=(t=Ue(t)).indexOf("u");Ne(e,{name:t,fromWireType:e=>e,toWireType:function(e,t){if("bigint"!=typeof t&&"number"!=typeof t)throw new TypeError(`Cannot convert "${je(t)}" to ${this.name}`);return"number"==typeof t&&(t=BigInt(t)),t},argPackAdvance:We,readValueFromPointer:Ve(t,r,!i),destructorFunction:null})},ne:(e,t,r,o)=>{Ne(e,{name:t=Ue(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:o},argPackAdvance:We,readValueFromPointer:function(e){return this.fromWireType(A[e])},destructorFunction:null})},v:(e,t,r,o,n,i,a,s,u,c,l,d,p)=>{l=Ue(l),i=kt(n,i),s&&=kt(a,s),c&&=kt(u,c),p=kt(d,p);var h=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(l);pt(h,(function(){Tt(`Cannot construct ${l} due to unbound types`,[o])})),Ie([e,t,r],o?[o]:[],(function(t){var r,n;t=t[0],n=o?(r=t.registeredClass).instancePrototype:ut.prototype;var a=lt(l,(function(){if(Object.getPrototypeOf(this)!==u)throw new Le("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Le(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Le(`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(n,{constructor:{value:a}});a.prototype=u;var d=new ht(l,a,u,p,r,i,s,c);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var f=new vt(l,d,!0,!1,!1),m=new vt(l+"*",d,!1,!1,!1),g=new vt(l+" const*",d,!1,!0,!1);return Ke[e]={pointerType:m,constPointerType:g},Et(h,a),[f,m,g]}))},x:(e,t,r,o,n,i)=>{var a=At(t,r);n=kt(o,n),Ie([],[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 Le(`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]=()=>{Tt(`Cannot construct ${e.name} due to unbound types`,a)},Ie([],a,(o=>(o.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ft(r,o,null,n,i),[]))),[]}))},d:(e,t,r,o,n,i,a,s,u)=>{var c=At(r,o);t=Ue(t),t=Bt(t),i=kt(n,i),Ie([],[e],(function(e){var o=`${(e=e[0]).name}.${t}`;function n(){Tt(`Cannot call ${o} 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?(n.argCount=r-2,n.className=e.name,l[t]=n):(dt(l,t,o),l[t].overloadTable[r-2]=n),Ie([],c,(function(n){var s=Ft(o,n,e,i,a,u);return void 0===l[t].overloadTable?(s.argCount=r-2,l[t]=s):l[t].overloadTable[r-2]=s,[]})),[]}))},me:e=>Ne(e,Ot),ba:(e,t,r,o)=>{function n(){}t=Ue(t),n.values={},Ne(e,{name:t,constructor:n,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:We,readValueFromPointer:jt(t,r,o),destructorFunction:null}),pt(t,n)},I:(e,t,r)=>{var o=Ut(e,"enum");t=Ue(t);var n=o.constructor,i=Object.create(o.constructor.prototype,{value:{value:r},constructor:{value:lt(`${o.name}_${t}`,(function(){}))}});n.values[r]=i,n[t]=i},Da:(e,t,r)=>{Ne(e,{name:t=Ue(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:We,readValueFromPointer:$t(t,r),destructorFunction:null})},J:(e,t,r,o,n,i,a)=>{var s=At(t,r);e=Ue(e),e=Bt(e),n=kt(o,n),pt(e,(function(){Tt(`Cannot call ${e} due to unbound types`,s)}),t-1),Ie([],s,(function(r){var o=[r[0],null].concat(r.slice(1));return Et(e,Ft(e,o,null,n,i,a),t-1),[]}))},O:(e,t,r,o,n)=>{t=Ue(t),-1===n&&(n=4294967295);var i=e=>e;if(0===o){var a=32-8*r;i=e=>e<<a>>>a}var s=t.includes("unsigned");Ne(e,{name:t,fromWireType:i,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:We,readValueFromPointer:Ve(t,r,0!==o),destructorFunction:null})},E:(e,t,r)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function n(e){var t=L[e>>2],r=L[e+4>>2];return new o(T.buffer,r,t)}Ne(e,{name:r=Ue(r),fromWireType:n,argPackAdvance:We,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},ef:(e,t,r,o,n,i,a,s,u,c,l,d)=>{r=Ue(r),i=kt(n,i),s=kt(a,s),c=kt(u,c),d=kt(l,d),Ie([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,o,i,s,c,d)]}))},Fa:(e,t)=>{var r="std::string"===(t=Ue(t));Ne(e,{name:t,fromWireType(e){var t,o=L[e>>2],n=e+4;if(r)for(var i=n,a=0;a<=o;++a){var s=n+a;if(a==o||0==A[s]){var u=ke(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(o);for(a=0;a<o;++a)c[a]=String.fromCharCode(A[n+a]);t=c.join("")}return Lu(e),t},toWireType(e,t){var o;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||$e("Cannot pass non-string to std::string"),o=r&&n?ge(t):t.length;var i=qu(4+o+1),a=i+4;if(L[i>>2]=o,r&&n)Nt(t,a,o+1);else if(n)for(var s=0;s<o;++s){var u=t.charCodeAt(s);u>255&&(Lu(a),$e("String has UTF-16 code units that do not fit in 8 bits")),A[a+s]=u}else for(s=0;s<o;++s)A[a+s]=t[s];return null!==e&&e.push(Lu,i),i},argPackAdvance:We,readValueFromPointer:bt,destructorFunction(e){Lu(e)}})},ga:(e,t,r)=>{var o,n,i,a,s;r=Ue(r),2===t?(o=Vt,n=Wt,a=zt,i=()=>q,s=1):4===t&&(o=Gt,n=Yt,a=Xt,i=()=>L,s=2),Ne(e,{name:r,fromWireType:e=>{for(var r,n=L[e>>2],a=i(),u=e+4,c=0;c<=n;++c){var l=e+4+c*t;if(c==n||0==a[l>>s]){var d=o(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return Lu(e),r},toWireType:(e,o)=>{"string"!=typeof o&&$e(`Cannot pass non-string to C++ string type ${r}`);var i=a(o),u=qu(4+i+t);return L[u>>2]=i>>s,n(o,u+4,i+t),null!==e&&e.push(Lu,u),u},argPackAdvance:We,readValueFromPointer:Pe,destructorFunction(e){Lu(e)}})},Ca:(e,t,r,o,n,i)=>{Te[e]={name:Ue(t),rawConstructor:kt(r,o),rawDestructor:kt(n,i),elements:[]}},N:(e,t,r,o,n,i,a,s,u)=>{Te[e].elements.push({getterReturnType:t,getter:kt(r,o),getterContext:n,setterArgumentType:i,setter:kt(a,s),setterContext:u})},A:(e,t,r,o,n,i)=>{Oe[e]={name:Ue(t),rawConstructor:kt(r,o),rawDestructor:kt(n,i),fields:[]}},n:(e,t,r,o,n,i,a,s,u,c)=>{Oe[e].fields.push({fieldName:Ue(t),getterReturnType:r,getter:kt(o,n),getterContext:i,setterArgumentType:a,setter:kt(s,u),setterContext:c})},oe:(e,t)=>{Ne(e,{isVoid:!0,name:t=Ue(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Db:()=>1,kb:()=>{throw 1/0},j:(e,t,r)=>(e=It.toValue(e),t=Ut(t,"emval::as"),Zt(t,r,e)),w:(e,t,r,o)=>(e=Kt[e])(null,t=It.toValue(t),r,o),P:(e,t,r,o,n)=>(e=Kt[e])(t=It.toValue(t),t[r=Jt(r)],o,n),c:Rt,le:(e,t)=>(e=It.toValue(e))==(t=It.toValue(t)),M:e=>0===e?It.toHandle(er()):(e=Jt(e),It.toHandle(er()[e])),s:(e,t,r)=>{var o=((e,t)=>{for(var r=new Array(e),o=0;o<e;++o)r[o]=Ut(L[t+4*o>>2],"parameter "+o);return r})(e,t),n=o.shift();e--;var i="return function (obj, func, destructorsRef, args) {\n",a=0,s=[];0===r&&s.push("obj");for(var u=["retType"],c=[n],l=0;l<e;++l)s.push("arg"+l),u.push("argType"+l),c.push(o[l]),i+=` var arg${l} = argType${l}.readValueFromPointer(args${a?"+"+a:""});\n`,a+=o[l].argPackAdvance;i+=` var rv = ${1===r?"new func":"func.call"}(${s.join(", ")});\n`,n.isVoid||(u.push("emval_returnValue"),c.push(Zt),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",u.push(i);var d,p,h=qt(Function,u).apply(null,c),f=`methodCaller<(${o.map((e=>e.name)).join(", ")}) => ${n.name}>`;return d=lt(f,h),p=Kt.length,Kt.push(d),p},h:(e,t)=>(e=It.toValue(e),t=It.toValue(t),It.toHandle(e[t])),e:e=>{e>4&&(Dt.get(e).refcount+=1)},_:(e,t)=>(e=It.toValue(e))instanceof(t=It.toValue(t)),ja:e=>"number"==typeof(e=It.toValue(e)),K:e=>"string"==typeof(e=It.toValue(e)),Le:()=>It.toHandle([]),f:e=>It.toHandle(Jt(e)),B:()=>It.toHandle({}),i:e=>{var t=It.toValue(e);Ae(t),Rt(e)},l:(e,t,r)=>{e=It.toValue(e),t=It.toValue(t),r=It.toValue(r),e[t]=r},g:(e,t)=>{var r=(e=Ut(e,"_emval_take_value")).readValueFromPointer(t);return It.toHandle(r)},qf:e=>{throw e=It.toValue(e)},qd:e=>(e=It.toValue(e),It.toHandle(typeof e)),sb:function(e,t){e=tr(e);var r=new Date(1e3*e);F[t>>2]=r.getUTCSeconds(),F[t+4>>2]=r.getUTCMinutes(),F[t+8>>2]=r.getUTCHours(),F[t+12>>2]=r.getUTCDate(),F[t+16>>2]=r.getUTCMonth(),F[t+20>>2]=r.getUTCFullYear()-1900,F[t+24>>2]=r.getUTCDay();var o=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),n=(r.getTime()-o)/864e5|0;F[t+28>>2]=n},tb:function(e,t){e=tr(e);var r=new Date(1e3*e);F[t>>2]=r.getSeconds(),F[t+4>>2]=r.getMinutes(),F[t+8>>2]=r.getHours(),F[t+12>>2]=r.getDate(),F[t+16>>2]=r.getMonth(),F[t+20>>2]=r.getFullYear()-1900,F[t+24>>2]=r.getDay();var o=0|ir(r);F[t+28>>2]=o,F[t+36>>2]=-60*r.getTimezoneOffset();var n=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));F[t+32>>2]=s},ub:function(e){var t=(()=>{var t=new Date(F[e+20>>2]+1900,F[e+16>>2],F[e+12>>2],F[e+8>>2],F[e+4>>2],F[e>>2],0),r=F[e+32>>2],o=t.getTimezoneOffset(),n=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=Math.min(a,i);if(r<0)F[e+32>>2]=Number(i!=a&&s==o);else if(r>0!=(s==o)){var u=Math.max(a,i),c=r>0?s:u;t.setTime(t.getTime()+6e4*(c-o))}F[e+24>>2]=t.getDay();var l=0|ir(t);F[e+28>>2]=l,F[e>>2]=t.getSeconds(),F[e+4>>2]=t.getMinutes(),F[e+8>>2]=t.getHours(),F[e+12>>2]=t.getDate(),F[e+16>>2]=t.getMonth(),F[e+20>>2]=t.getYear();var d=t.getTime();return isNaN(d)?-1:d/1e3})();return BigInt(t)},qb:function(e,t,r,o,n,i,a){n=tr(n);try{if(isNaN(n))return 61;var s=xe.getStreamFromFD(o),u=Ce.mmap(s,e,n,t,r),c=u.ptr;return F[i>>2]=u.allocated,L[a>>2]=c,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},rb:function(e,t,r,o,n,i){i=tr(i);try{if(isNaN(i))return 61;var a=xe.getStreamFromFD(n);2&r&&xe.doMsync(e,a,t,o,i),Ce.munmap(a)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},lb:(e,t,r)=>{var o=(new Date).getFullYear(),n=new Date(o,0,1),i=new Date(o,6,1),a=n.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}L[e>>2]=60*u,F[t>>2]=Number(a!=s);var l=c(n),d=c(i),p=ar(l),h=ar(d);s<a?(L[r>>2]=p,L[r+4>>2]=h):(L[r>>2]=h,L[r+4>>2]=p)},b:()=>{Z("")},re:function(e){var t=ke(e);localStorage.removeItem(t)},ua:(e,t,r,o,n)=>mr.chooseConfig(e,t,r,o,n),va:(e,t,r,o)=>{if(62e3!=e)return mr.setErrorCode(12296),0;for(var n=1;;){var i=F[o>>2];if(12440!=i){if(12344==i)break;return mr.setErrorCode(12292),0}n=F[o+4>>2],o+=8}return n<2||n>3?(mr.setErrorCode(12293),0):(mr.contextAttributes.majorVersion=n-1,mr.contextAttributes.minorVersion=0,mr.context=gr.createContext(u.canvas,mr.contextAttributes),0!=mr.context?(mr.setErrorCode(12288),gr.makeContextCurrent(mr.context),u.useWebGL=!0,fr.moduleContextCreatedCallbacks.forEach((function(e){e()})),gr.makeContextCurrent(null),62004):(mr.setErrorCode(12297),0))},cb:(e,t,r,o)=>62e3!=e?(mr.setErrorCode(12296),0):62002!=t?(mr.setErrorCode(12293),0):(mr.setErrorCode(12288),62006),Nc:(e,t)=>62e3!=e?(mr.setErrorCode(12296),0):62004!=t?(mr.setErrorCode(12294),0):(gr.deleteContext(mr.context),mr.setErrorCode(12288),mr.currentContext==t&&(mr.currentContext=0),1),Cc:(e,t)=>62e3!=e?(mr.setErrorCode(12296),0):62006!=t?(mr.setErrorCode(12301),1):(mr.currentReadSurface==t&&(mr.currentReadSurface=0),mr.currentDrawSurface==t&&(mr.currentDrawSurface=0),mr.setErrorCode(12288),1),S:(e,t,r,o)=>{if(62e3!=e)return mr.setErrorCode(12296),0;if(62002!=t)return mr.setErrorCode(12293),0;if(!o)return mr.setErrorCode(12300),0;switch(mr.setErrorCode(12288),r){case 12320:return F[o>>2]=mr.contextAttributes.alpha?32:24,1;case 12321:return F[o>>2]=mr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return F[o>>2]=8,1;case 12325:return F[o>>2]=mr.contextAttributes.depth?24:0,1;case 12326:return F[o>>2]=mr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return F[o>>2]=12344,1;case 12328:return F[o>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return F[o>>2]=0,1;case 12330:case 12332:return F[o>>2]=4096,1;case 12331:return F[o>>2]=16777216,1;case 12337:return F[o>>2]=mr.contextAttributes.antialias?4:0,1;case 12338:return F[o>>2]=mr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return F[o>>2]=4,1;case 12341:case 12342:case 12343:return F[o>>2]=-1,1;case 12348:return F[o>>2]=1,1;case 12351:return F[o>>2]=12430,1;default:return mr.setErrorCode(12292),0}},Nb:e=>(mr.setErrorCode(12288),0!=e&&1!=e?0:62e3),za:()=>mr.errorCode,Fb:(e,t,r)=>62e3!=e?(mr.setErrorCode(12296),0):(t&&(F[t>>2]=1),r&&(F[r>>2]=4),mr.defaultDisplayInitialized=!0,mr.setErrorCode(12288),1),Yb:(e,t,r,o)=>62e3!=e?(mr.setErrorCode(12296),0):0!=o&&62004!=o?(mr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(mr.setErrorCode(12301),0):(gr.makeContextCurrent(o?mr.context:null),mr.currentContext=o,mr.currentDrawSurface=t,mr.currentReadSurface=r,mr.setErrorCode(12288),1),Aa:(e,t)=>{if(mr.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return mr.setErrorCode(12288),1;mr.setErrorCode(12302)}else mr.setErrorCode(12290);else mr.setErrorCode(12289);return 0},rc:e=>62e3!=e?(mr.setErrorCode(12296),0):(mr.currentContext=0,mr.currentReadSurface=0,mr.currentDrawSurface=0,mr.defaultDisplayInitialized=!1,mr.setErrorCode(12288),1),H:(e,t,r)=>br(e,t,r),Ae:e=>{console.error(ke(e))},Be:e=>{console.log(ke(e))},ma:e=>{console.warn(ke(e))},da:()=>Date.now(),qe:function(){},mb:()=>2147483648,Cb:Lt,$f:vr,ag:wr,Xc:_r,he:Er,Jc:Sr,bg:Cr,cg:kr,Gc:xr,Hc:Tr,$e:Ar,af:Pr,Ke:qr,dg:Fr,Ub:Lr,yf:Dr,Af:Rr,eg:Mr,fg:Ir,Wd:Or,gg:jr,Vd:Ur,Ve:$r,hg:Nr,ig:Hr,bf:Vr,jg:Wr,ic:zr,jc:Gr,lc:Yr,kc:Xr,kg:Zr,Ud:Kr,lg:Qr,Ka:Jr,mg:eo,ng:to,og:ro,ad:oo,pg:no,$c:io,Te:ao,Td:so,qg:uo,bd:co,rg:lo,sg:po,tg:ho,ug:fo,cf:mo,vg:go,Zc:yo,je:bo,df:vo,Me:wo,wg:_o,Ue:Eo,xg:So,Tb:Co,zf:xo,Bf:To,Sd:Ao,yg:Po,Rd:qo,Qd:Fo,zg:Lo,Ag:Bo,Bg:Do,wf:Mo,Zd:Io,id:Oo,tf:jo,jd:Uo,Hb:$o,rf:Vo,ed:Wo,_d:zo,Cg:Yo,xf:Zo,Yd:Ko,fd:Qo,uf:Jo,gd:en,hd:tn,kf:rn,Dg:on,Eg:nn,Wc:an,ge:sn,Ic:un,Re:cn,Fg:ln,Gg:dn,ff:pn,gf:hn,Mc:fn,Hg:mn,Ig:yn,hf:bn,_c:vn,ke:wn,jf:_n,Ne:En,Jg:Sn,Sb:Cn,vf:Pn,Cf:qn,Xe:Fn,Pd:Bn,Od:Dn,dc:Rn,ec:Mn,gc:In,Nd:On,Md:jn,Ld:Hn,_b:Vn,Kg:Wn,Lg:zn,Mg:Gn,vc:Yn,Ye:Xn,$b:Kn,bc:Qn,Kc:Jn,lh:ei,Jb:ti,Ob:ri,Ng:oi,Og:ni,be:ai,de:ui,ae:ci,Uc:li,ce:di,Vc:pi,ee:hi,Ze:fi,Vb:mi,Wb:gi,Pg:yi,He:bi,Kd:vi,Qg:wi,Ja:_i,mh:Ei,ac:Si,Jd:Ci,Id:ki,Ec:xi,fc:Ti,hc:Ai,Rg:Fi,Hd:Di,Gd:Ri,wc:Mi,Dc:ji,Bc:Ui,Dd:$i,Fd:Ni,Ed:Hi,Cd:Vi,Ie:Wi,Je:zi,Bd:Gi,Ad:Yi,zd:Xi,yd:Zi,Yc:Ki,ie:Qi,xd:Ji,Zb:ea,wd:ta,Se:ra,Sg:oa,Rb:na,Lc:aa,$d:sa,Tg:ua,Ug:ca,of:la,pf:da,Qb:pa,Vg:ha,vd:fa,Mb:ma,Lb:ga,fe:ya,sf:ba,Wg:Ea,ud:Sa,_e:Ca,We:ka,Pb:xa,td:Ta,Oe:Aa,Xb:Pa,Pe:qa,Qe:Fa,Xg:La,sd:Ba,Yg:Da,Zg:Ra,_g:Ma,$g:Ia,ah:Oa,bh:ja,ch:Ua,dh:$a,dd:Na,eh:Ha,fh:Va,gh:Wa,hh:za,lf:Ga,Kb:Ya,ih:Xa,cd:Za,Fc:Ka,jh:Qa,kh:es,Xf:ts,Yf:os,uc:ns,pc:is,Zf:as,_f:ss,Wf:us,Vf:cs,tc:ls,oc:ds,Uf:ps,Tf:hs,Sf:fs,Rf:ms,sc:gs,nc:ys,Qf:bs,Pf:vs,Df:ws,Ef:_s,qc:Es,mc:Ss,cc:Cs,Ff:ks,Tc:xs,Rc:Ts,Gf:As,Sc:Ps,Pc:qs,Hf:Fs,Qc:Ls,Oc:Bs,If:Ds,rd:Rs,Jf:Ms,pd:Is,od:Os,Kf:js,nd:Us,Lf:$s,md:Ns,Mf:Hs,mf:Ws,Xd:zs,kd:Gs,ld:Ys,Ib:Xs,Ac:Zs,yc:Ks,zc:Qs,xc:Js,nf:eu,Nf:tu,Of:ru,La:ou,Eb:(e,t,r)=>A.copyWithin(e,t,t+r),ob:e=>{var t=A.length,r=2147483648;if((e>>>=0)>r)return!1;for(var o,n,i=1;i<=4;i*=2){var a=t*(1+.2/i);a=Math.min(a,e+100663296);var s=Math.min(r,(o=Math.max(e,a))+((n=65536)-o%n)%n);if(nu(s))return!0}return!1},_a:function(e,t,r,o,n,i,a,s,c){const l=u.UTF8ToString(e,e+t),d=u.HEAPU8.subarray(n,n+i),p=u.emscripten_ubq_codec_audioDecoderNextHandle++,h={codec:l,sampleRate:r,numberOfChannels:o,description:d};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,s,c);AudioDecoder.isConfigSupported(h).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(h),u.emscripten_ubq_codec_audioDecoders.set(p,{audioDecoder:e,decoderConfig:h,leftBufferPtr:a,rightBufferPtr:s,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:p})},Ua:function(e,t,r,o,n,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_audioEncoderNextHandle++,c={codec:a,sampleRate:r,numberOfChannels:o,bitrate:n};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: "+o,e+="; bit rate: "+n,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},bb:function(e,t,r,o,n,i,a){const s=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(n,n+i),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:s,codedWidth:r,codedHeight:o,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})},Xa:function(e,t,r,o,n,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_videoEncoderNextHandle++,c=u.specialHTMLTargets["!canvas"];c.width=r,c.height=o;const l={codec:a,width:r,height:o,avc:{format:"annexb"},framerate:n};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"+o,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},Pa:function(e,t,r,o,n,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(n,n+i),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:o,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})},Qa:function(e,t,r,o,n,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(n,n+i),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:o,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})},V: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)}},pa: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)},sa: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)}},qa: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)},Ta:function(e,t,r){const o=1e6,n=u.emscripten_ubq_codec_audioEncoders.get(e),i=n.audioEncoderConfig.sampleRate,a=n.audioEncoderConfig.numberOfChannels,s=r/a,c=Math.round(o*(n.frameIndex*s/i)),l=Math.round(o*(s/i)),d=u.HEAPF32.subarray(t/4,t/4+r),p=new AudioData({format:"f32",sampleRate:i,numberOfFrames:s,numberOfChannels:a,duration:l,timestamp:c,data:d});n.audioEncoder.encode(p),n.frameIndex++,p.close()},Wa:function(e,t,r){const o=1e6,n=u.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(o*(n.frameIndex/n.encoderConfig.framerate)),a=n.frameIndex%n.groupOfPictures==0,s=Math.round(o/n.encoderConfig.framerate),c=u.specialHTMLTargets["!canvas"],l=new VideoFrame(c,{timestamp:i,duration:s});n.videoEncoder.encode(l,{keyFrame:a}),l.close(),n.frameIndex++},Sa:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Va:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Za: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},X:async function(e,t,r){const o=u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;o.shouldDropFrames=r,o.flushing=!0;try{await o.flush()}catch{}o.flushing=!1,o.shouldDropFrames=!1,o.decodedFrames=t},oa:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ra:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},W:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ya:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},ab:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Y:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},$a:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Ra:function(e,t,r){const o=u.emscripten_ubq_codec_videoDecoders.get(e),n=u.HEAPU32.subarray(t/4,t/4+r);o.videoDecoder.textures=[];for(let e=0;e<r;e++)o.videoDecoder.textures[e]=gr.textures[n[e]]},ve:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},la:function(){u.emscripten_ubq_asyncFetchManager.clear()},ka:function(e,t,r,o){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,o)},ye:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ze:function(e,t,r,o,n,i,a,s,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,o,n,i,a,s,c).handle},aa:function(e){return u.emscripten_ubq_asyncFetchManager.deleteProcess(e)},xe: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},ue:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},te:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},ia: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},we:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},db:function(){return!!u.emscripten_ubq_settings_forceWebGL1},ta:cu,Z:e=>{gr.currentContext==e&&(gr.currentContext=0),gr.deleteContext(e)},hb:e=>(e=>{var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.isVertexArray=e=>t.isVertexArrayOES(e),1})(gr.contexts[e].GLctx),gb:e=>(e=>{var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=(e,r)=>t.drawBuffersWEBGL(e,r),1})(gr.contexts[e].GLctx),fb:e=>(e=>!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")))(gr.contexts[e].GLctx),$:(e,t)=>{var r=gr.getContext(e),o=ke(t);return o.startsWith("GL_")&&(o=o.substr(3)),!!r.GLctx.getExtension(o)},eb:(e,t)=>{if(!t)return-5;if(!(e=gr.contexts[e]))return-3;var r=e.GLctx;if(!r)return-3;r=r.getContextAttributes(),F[t>>2]=r.alpha,F[t+4>>2]=r.depth,F[t+8>>2]=r.stencil,F[t+12>>2]=r.antialias,F[t+16>>2]=r.premultipliedAlpha,F[t+20>>2]=r.preserveDrawingBuffer;var o=r.powerPreference&&au.indexOf(r.powerPreference);return F[t+24>>2]=o,F[t+28>>2]=r.failIfMajorPerformanceCaveat,F[t+32>>2]=e.version,F[t+36>>2]=0,0},nb:e=>gr.makeContextCurrent(e)?0:-5,wb:(e,t)=>{var r=0;return du().forEach(((o,n)=>{var i=t+r;L[e+4*n>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)T[t++>>0]=e.charCodeAt(r);T[t>>0]=0})(o,i),r+=o.length+1})),0},xb:(e,t)=>{var r=du();L[e>>2]=r.length;var o=0;return r.forEach((e=>o+=e.length+1)),L[t>>2]=o,0},Ce:dr,ea:function(e){try{var t=xe.getStreamFromFD(e);return Ce.close(t),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},pb:function(e,t,r,o,n){o=tr(o);try{if(isNaN(o))return 61;var i=xe.getStreamFromFD(e),a=pu(i,t,r,o);return L[n>>2]=a,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},ya:function(e,t,r,o){try{var n=xe.getStreamFromFD(e),i=pu(n,t,r);return L[o>>2]=i,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},vb:function(e,t,r,o){t=tr(t);try{if(isNaN(t))return 61;var n=xe.getStreamFromFD(e);return Ce.llseek(n,t,r),D[o>>3]=BigInt(n.position),n.getdents&&0===t&&0===r&&(n.getdents=null),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},xa:function(e,t,r,o){try{var n=((e,t,r,o)=>{for(var n=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Ce.write(e,T,a,s,o);if(u<0)return-1;n+=u,void 0!==o&&(o+=u)}return n})(xe.getStreamFromFD(e),t,r);return L[o>>2]=n,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},se:function(e){var t=ke(e),r=localStorage.getItem(t);return null==r?null:ar(r)},pe:function(){return"undefined"!=typeof window?ar(window.location.hostname):ar("")},ib:(e,t)=>(de(A.subarray(e,e+t)),0),y:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},L:function(e,t){var r=ju();try{return Ct(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},G:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},m:function(e,t,r,o){var n=ju();try{return Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},oh:function(e){var t=ju();try{return Ct(e)()}catch(e){if(Uu(t),e!==e+0)throw e;Ou(1,0)}},Ma:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},q:function(e,t){var r=ju();try{return Ct(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},U:function(e,t,r,o,n,i,a,s,u,c,l,d,p,h,f,m){var g=ju();try{return Ct(e)(t,r,o,n,i,a,s,u,c,l,d,p,h,f,m)}catch(e){if(Uu(g),e!==e+0)throw e;Ou(1,0)}},r:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},t:function(e,t,r,o){var n=ju();try{return Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},T:function(e,t,r,o,n){var i=ju();try{return Ct(e)(t,r,o,n)}catch(e){if(Uu(i),e!==e+0)throw e;Ou(1,0)}},Ge:function(e,t,r,o,n,i){var a=ju();try{return Ct(e)(t,r,o,n,i)}catch(e){if(Uu(a),e!==e+0)throw e;Ou(1,0)}},Ia:function(e,t,r,o,n,i,a){var s=ju();try{return Ct(e)(t,r,o,n,i,a)}catch(e){if(Uu(s),e!==e+0)throw e;Ou(1,0)}},Ha:function(e,t,r,o,n,i,a,s,u,c){var l=ju();try{return Ct(e)(t,r,o,n,i,a,s,u,c)}catch(e){if(Uu(l),e!==e+0)throw e;Ou(1,0)}},Q:function(e){var t=ju();try{Ct(e)()}catch(e){if(Uu(t),e!==e+0)throw e;Ou(1,0)}},u:function(e,t){var r=ju();try{Ct(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},C:function(e,t,r,o){var n=ju();try{Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},F:function(e,t,r){var o=ju();try{Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},p:function(e,t,r,o){var n=ju();try{Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},D:function(e,t,r,o,n){var i=ju();try{Ct(e)(t,r,o,n)}catch(e){if(Uu(i),e!==e+0)throw e;Ou(1,0)}},Fe:function(e,t,r,o,n,i){var a=ju();try{Ct(e)(t,r,o,n,i)}catch(e){if(Uu(a),e!==e+0)throw e;Ou(1,0)}},De:function(e,t,r,o,n,i,a){var s=ju();try{Ct(e)(t,r,o,n,i,a)}catch(e){if(Uu(s),e!==e+0)throw e;Ou(1,0)}},nh:function(e,t,r,o,n,i,a,s){var u=ju();try{Ct(e)(t,r,o,n,i,a,s)}catch(e){if(Uu(u),e!==e+0)throw e;Ou(1,0)}},Ee:function(e,t,r,o,n,i,a,s,u,c){var l=ju();try{Ct(e)(t,r,o,n,i,a,s,u,c)}catch(e){if(Uu(l),e!==e+0)throw e;Ou(1,0)}},ha:function(){return"undefined"!=typeof localStorage},na:function(e,t){const r=It.toValue(t),o=u.ctx;o.bindTexture(o.TEXTURE_2D,gr.textures[e]),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,r)},a:S,Ga:function(e,t){var r=ke(e),o=ke(t);localStorage.setItem(r,o)},jb:(e,t,r,o,n)=>gu(e,t,r,o)},Pu=function(){var e,t,r,n,i={a:Au};function a(e,t){var r;return Pu=e.exports,wt=Pu.th,r=Pu.ph,N.unshift(r),X(),Pu}if(Y(),u.instantiateWasm)try{return u.instantiateWasm(i,a)}catch(e){k(`Module.instantiateWasm callback failed with error: ${e}`),o(e)}return(e=E,t=K,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||J(t)||b||"function"!=typeof fetch?re(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return k(`wasm streaming compile failed: ${e}`),k("falling back to ArrayBuffer instantiation"),re(t,r,n)}))))).catch(o),{}}(),qu=u._malloc=e=>(qu=u._malloc=Pu.qh)(e),Fu=u._main=(e,t)=>(Fu=u._main=Pu.rh)(e,t),Lu=u._free=e=>(Lu=u._free=Pu.sh)(e),Bu=(u._ma_malloc_emscripten=(e,t)=>(u._ma_malloc_emscripten=Pu.uh)(e,t),u._ma_free_emscripten=(e,t)=>(u._ma_free_emscripten=Pu.vh)(e,t),u._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Bu=u._ma_device_process_pcm_frames_capture__webaudio=Pu.wh)(e,t,r)),Du=u._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Du=u._ma_device_process_pcm_frames_playback__webaudio=Pu.xh)(e,t,r),Ru=e=>(Ru=Pu.yh)(e),Mu=e=>(Mu=Pu.zh)(e),Iu=(e,t)=>(Iu=Pu.Ah)(e,t),Ou=(e,t)=>(Ou=Pu.Bh)(e,t),ju=()=>(ju=Pu.Ch)(),Uu=e=>(Uu=Pu.Dh)(e),$u=e=>($u=Pu.Eh)(e),Nu=e=>(Nu=Pu.Fh)(e),Hu=e=>(Hu=Pu.Gh)(e),Vu=(e,t,r)=>(Vu=Pu.Hh)(e,t,r),Wu=e=>(Wu=Pu.Ih)(e);function zu(e=h){function r(){Tu||(Tu=!0,u.calledRun=!0,I||(u.noFSInit||Ce.init.initialized||Ce.init(),Ce.ignorePermissions=!1,ve.init(),ie(N),ie(H),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Gu&&function(e=[]){var t=Fu;e.unshift(f);var r=e.length,o=$u(4*(r+1)),n=o;e.forEach((e=>{L[n>>2]=yu(e),n+=4})),L[n>>2]=0;try{var i=t(r,o);return lr(i,!0),i}catch(e){return ur(e)}}(e),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),V.unshift(e);var e;ie(V)}()))}W>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),$.unshift(e);var e;ie($)}(),W>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),r()}),1)):r()))}if(u.___start_em_js=2390211,u.___stop_em_js=2391046,u.addRunDependency=Y,u.removeRunDependency=X,u.FS_createPath=Ce.createPath,u.FS_createLazyFile=Ce.createLazyFile,u.FS_createDevice=Ce.createDevice,u.ccall=(e,t,r,o,n)=>{var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=yu(e)),t},array:e=>{var t=$u(e.length);return mu(e,t),t}},a=(e=>u["_"+e])(e),s=[],c=0;if(o)for(var l=0;l<o.length;l++){var d=i[r[l]];d?(0===c&&(c=ju()),s[l]=d(o[l])):s[l]=o[l]}var p,h=a.apply(null,s);return p=h,0!==c&&Uu(c),h=function(e){return"string"===t?ke(e):"boolean"===t?Boolean(e):e}(p),h},u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return T[e>>0];case"i16":return P[e>>1];case"i32":return F[e>>2];case"i64":return D[e>>3];case"float":return B[e>>2];case"double":return M[e>>3];case"*":return L[e>>2];default:Z(`invalid type for getValue: ${t}`)}},u.UTF8ToString=ke,u.specialHTMLTargets=su,u.FS_createPreloadedFile=Ce.createPreloadedFile,u.FS_createDataFile=Ce.createDataFile,u.FS_unlink=Ce.unlink,G=function e(){Tu||zu(),Tu||(G=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var Gu=!0;return u.noInitialRun&&(Gu=!1),zu(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=o:"function"==typeof define&&define.amd&&define([],(()=>o))}}),dt=s(A()),pt=s(tt()),ht=Symbol("PROXY");function ft(e,t){Object.defineProperty(e[t],ht,{value:{type:"getter"},writable:!1})}function mt(e,t){Object.defineProperty(e[t],ht,{value:{type:"setter"},writable:!1})}var gt={};var yt=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,o){return this.useInternalAPI((n=>bt(n.setValue(e,t,r,o))))}getValue(e,t,r){return this.useInternalAPI((o=>bt(o.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,o)=>{this.useInternalAPI((n=>n.ubqExecute(e,t,(e=>{try{const t=bt(e);r(t)}catch(e){o(e)}})))).delete()}))}};function bt(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 vt(e){return new Promise(((t,r)=>{e((e=>{try{const r=bt(e);t(r)}catch(e){r(e)}}))}))}u([mt],yt.prototype,"setValue",1),u([ft],yt.prototype,"getValue",1);var wt,_t,Et,St,Ct,kt,xt,Tt=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r},At=new WeakMap,Pt={assets:[],total:0,currentPage:0,nextPage:void 0},AssetAPI=class{constructor(e){p(this,_t),p(this,St),p(this,kt),p(this,wt,void 0),c(this,"onAssetSourceAdded",(e=>{const t=d(this,wt).subscribeToAssetSourceAdded(e);return()=>{d(this,wt).isDeleted()||bt(d(this,wt).unsubscribe(t))}})),c(this,"onAssetSourceRemoved",(e=>{const t=d(this,wt).subscribeToAssetSourceRemoved(e);return()=>{d(this,wt).isDeleted()||bt(d(this,wt).unsubscribe(t))}})),h(this,wt,e)}addSource(e){const t=e.getSupportedMimeTypes?.bind(e),r=e.getGroups?.bind(e),o=e.applyAsset?.bind(e),n=e.applyAssetToBlock?.bind(e),i=e.addAsset?.bind(e),a=e.removeAsset?.bind(e),s=e.credits,u=e.license;bt(d(this,wt).addAssetSource(e.id,(async(t,r)=>{try{const o={...t,tags:Tt(t.tags),groups:Tt(t.groups),excludeGroups:Tt(t.excludeGroups)},n=await e.findAssets(o);if(n){const t={...n,assets:n.assets.map((t=>qt(t,e.id)))};r.invoke(t)}else r.invoke(Pt)}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,o?async(e,t)=>{try{const r=await o(f(this,_t,Et).call(this,e));t.invoke(r)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{try{await n(f(this,_t,Et).call(this,e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null,i?async e=>{i(e)}:null,a?async e=>{a(e)}:null)),f(this,St,Ct).call(this,e.id,e)}addLocalSource(e,t,r,o){bt(d(this,wt).addLocalAssetSource(e,t??[],r?async(e,t)=>{try{const o=await r(f(this,_t,Et).call(this,e));t.invoke(o)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,o?async(e,t,r)=>{try{await o(f(this,_t,Et).call(this,e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){bt(d(this,wt).removeAssetSource(e)),f(this,kt,xt).call(this,e)}findAllSources(){return Tt(d(this,wt).findAllAssetSources())}findAssets(e,t){return new Promise(((r,o)=>{let n=t?.tags??[];Array.isArray(n)||(n=[n]);const i={perPage:t?.perPage??0,page:t?.page??0,query:t?.query??"",tags:n,groups:t?.groups??[],excludeGroups:t?.excludeGroups??[],locale:t?.locale??""};d(this,wt).findAssetSourceAssets(e,i,(e=>{try{const t=bt(e);r({...t,nextPage:-1===t.nextPage?void 0:t.nextPage})}catch(e){o(e)}}))}))}async getGroups(e){return vt((t=>d(this,wt).getAssetSourceGroups(e,t))).then((e=>Tt(e)))}getSupportedMimeTypes(e){return Tt(bt(d(this,wt).getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=bt(d(this,wt).getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=bt(d(this,wt).getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){return!!At.get(d(this,wt))?.get(e)?.canManageAssets}addAssetToSource(e,t){bt(d(this,wt).addAssetToSource(e,t))}removeAssetFromSource(e,t){bt(d(this,wt).removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,o)=>{d(this,wt).applyAssetSourceAsset(e,qt(t,e),(e=>{try{const t=bt(e);d(this,wt).isValid(t)?r(t):r(void 0)}catch(e){o(e)}}))}))}async applyToBlock(e,t,r){return vt((o=>d(this,wt).applyAssetSourceAssetToBlock(e,qt(t,e),r,o)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{d(this,wt).defaultApplyAsset(qt(e,""),(e=>{try{const r=bt(e);d(this,wt).isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return vt((r=>d(this,wt).defaultApplyAssetToBlock(qt(e,""),t,r)))}dispose(){At.delete(d(this,wt))}};function qt(e,t){return"context"in e&&e.context.sourceId===t?e:{...e,context:{sourceId:t}}}wt=new WeakMap,_t=new WeakSet,Et=function(e){const t={...e};return 0===t.groups?.length&&delete t.groups,t.locale||delete t.locale,t.label||delete t.label,0===t.tags?.length&&delete t.tags,t.credits?.name||t.credits?.url?t.credits.url||delete t.credits.url:delete t.credits,t.license?.name||t.license?.url?t.license.url||delete t.license.url:delete t.license,t.utm?.source||t.utm?.medium?(t.utm.source||delete t.utm.source,t.utm.medium||delete t.utm.medium):delete t.utm,t},St=new WeakSet,Ct=function(e,t){At.has(d(this,wt))||At.set(d(this,wt),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/`),At.get(d(this,wt)).set(e,{canManageAssets:t.canManageAssets})},kt=new WeakSet,xt=function(e){At.get(d(this,wt))?.delete(e)};var Ft=class extends TypeError{constructor(e,t){let r;const{message:o,...n}=e,{path:i}=e;super(0===i.length?o:"At path: "+i.join(".")+" -- "+o),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,n),this.name=this.constructor.name,this.failures=()=>{var o;return null!=(o=r)?o:r=[e,...t()]}}};function Lt(e){return"object"==typeof e&&null!=e}function Bt(e){return"string"==typeof e?JSON.stringify(e):""+e}function Dt(e,t,r,o){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:n,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+Bt(o)+"`"}=e;return{value:o,type:a,refinement:s,key:n[n.length-1],path:n,branch:i,...e,message:u}}function*Rt(e,t,r,o){var n;Lt(n=e)&&"function"==typeof n[Symbol.iterator]||(e=[e]);for(const n of e){const e=Dt(n,t,r,o);e&&(yield e)}}function*Mt(e,t,r={}){const{path:o=[],branch:n=[e],coerce:i=!1,mask:a=!1}=r,s={path:o,branch:n};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&Lt(t.schema)&&Lt(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=Mt(c,l,{path:void 0===r?o:[...o,r],branch:void 0===r?n:[...n,c],coerce:i,mask:a});for(const o of t)o[0]?(u=!1,yield[o[0],void 0]):i&&(c=o[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):Lt(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 It=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:o,refiner:n,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=o?(e,t)=>Rt(o(e,t),t,this,e):()=>[],this.refiner=n?(e,t)=>Rt(n(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=Ot(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=Ot(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){const r=Ot(e,t);return!r[0]}(e,this)}mask(e){return function(e,t){const r=Ot(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return Ot(e,this,t)}};function Ot(e,t,r={}){const o=Mt(e,t,r),n=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(o);if(n[0]){return[new Ft(n[0],(function*(){for(const e of o)e[0]&&(yield e[0])})),void 0]}return[void 0,n[1]]}function jt(e,t){return new It({type:e,schema:null,validator:t})}function Ut(e){return new It({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,o]of t.entries())yield[r,o,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Bt(e)})}function $t(){return jt("boolean",(e=>"boolean"==typeof e))}function Nt(){return jt("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+Bt(e)))}function Ht(){return jt("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Bt(e)))}function Vt(e){const t=e?Object.keys(e):[],r=jt("never",(()=>!1));return new It({type:"object",schema:e||null,*entries(o){if(e&&Lt(o)){const n=new Set(Object.keys(o));for(const r of t)n.delete(r),yield[r,o[r],e[r]];for(const e of n)yield[e,o[e],r]}},validator:e=>Lt(e)||"Expected an object, but received: "+Bt(e),coercer:e=>Lt(e)?{...e}:e})}function Wt(){return jt("string",(e=>"string"==typeof e||"Expected a string, but received: "+Bt(e)))}function zt(e,t,r={}){const{exclusive:o}=r;return Xt(e,"max",(r=>o?r<t:r<=t||"Expected a "+e.type+" less than "+(o?"":"or equal to ")+t+" but received `"+r+"`"))}function Gt(e,t,r={}){const{exclusive:o}=r;return Xt(e,"min",(r=>o?r>t:r>=t||"Expected a "+e.type+" greater than "+(o?"":"or equal to ")+t+" but received `"+r+"`"))}function Yt(e){return Xt(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 Xt(e,t,r){return new It({...e,*refiner(o,n){yield*e.refiner(o,n);const i=Rt(r(o,n),n,e,o);for(const e of i)yield{...e,refinement:t}}})}function Zt(e,t,r){const[o]=Ot(t,r);if(o)throw o.message=`Error in argument '${e}': ${o.message}`,o}function Kt(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return jt("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 Qt(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return jt("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var Jt,er=(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))(er||{}),tr=er;(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!")}})(Jt||(Jt={}));var rr="undefined"!=typeof Blob?Blob:(()=>{try{return nt().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=tr.Png,r={}){Zt("handle",e,Ht()),Zt("mimeType",t,Kt()),Zt("options",r,Vt());const o=null!=r.targetWidth&&null!=r.targetHeight,n=r.jpegQuality??.9,i=r.webpQuality??1,a=r.pngCompressionLevel??5;return Zt("jpegQuality",n,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("webpQuality",i,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("pngCompressionLevel",a,Gt(zt(Nt(),9),0)),null==r.targetWidth&&null==r.targetHeight||(Zt("targetWidth",r.targetWidth,Ht()),Zt("targetHeight",r.targetHeight,Ht())),new Promise(((s,u)=>{this.#e.exportToBuffer(e,t,(e=>{"error"in e?u(e.error):s(new rr([e],{type:t}))}),{pngCompressionLevel:a,jpegQuality:n,webpQuality:i,useTargetSize:o,targetWidth:r.targetWidth??0,targetHeight:r.targetHeight??0,exportPdfWithHighCompatibility:r.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:r.exportPdfWithUnderlayer??!1,underlayerSpotColorName:r.underlayerSpotColorName??"",underlayerOffset:r.underlayerOffset??0})}))}async exportWithColorMask(e,t=tr.Png,r,o,n,i={}){Zt("handle",e,Ht()),Zt("mimeType",t,Kt()),Zt("options",i,Vt());const a=null!=i.targetWidth&&null!=i.targetHeight,s=i.jpegQuality??.9,u=i.webpQuality??1,c=i.pngCompressionLevel??5;return Zt("jpegQuality",s,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("webpQuality",u,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("pngCompressionLevel",c,Gt(zt(Nt(),9),0)),null==i.targetWidth&&null==i.targetHeight||(Zt("targetWidth",i.targetWidth,Ht()),Zt("targetHeight",i.targetHeight,Ht())),new Promise(((l,d)=>{this.#e.exportWithColorMaskToBuffer(e,t,r,o,n,((e,r)=>{if("error"in e)d(e.error);else if("error"in r)d(r.error);else{const o=new rr([e],{type:t}),n=new rr([r],{type:t});l([o,n])}}),{pngCompressionLevel:c,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:i.targetWidth??0,targetHeight:i.targetHeight??0,exportPdfWithHighCompatibility:i.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:i.exportPdfWithUnderlayer??!1,underlayerSpotColorName:i.underlayerSpotColorName??"",underlayerOffset:i.underlayerOffset??0})}))}async exportVideo(e,t=tr.Mp4,r,o){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return Zt("content",e,Wt()),vt((t=>this.#e.loadBlocksFromString(e,t))).then((e=>Tt(e)))}async saveToString(e){return Zt("blocks",e,Ut(Ht())),vt((t=>this.#e.saveBlocksToString(e,t)))}create(e){return Zt("type",e,Wt()),bt(this.#e.create(e))}createFill(e){return Zt("type",e,Wt()),bt(this.#e.createFill(e))}getType(e){return Zt("id",e,Nt()),bt(this.#e.getType(e))}getKind(e){return Zt("id",e,Nt()),bt(this.#e.getKind(e))}setKind(e,t){Zt("id",e,Nt()),bt(this.#e.setKind(e,t))}select(e){return Zt("id",e,Nt()),bt(this.#e.select(e))}setSelected(e,t){return Zt("id",e,Nt()),Zt("selected",t,$t()),bt(this.#e.setSelected(e,t))}isSelected(e){return Zt("id",e,Nt()),bt(this.#e.isSelected(e))}findAllSelected(){return Tt(this.#e.findAllSelected())}onSelectionChanged=e=>{const t=this.#e.subscribeToSelectionChange(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};onClicked=e=>{const t=this.#e.subscribeToBlockClicked(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};isGroupable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isGroupable(e))}group(e){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.group(e))}ungroup(e){return Zt("id",e,Ht()),bt(this.#e.ungroup(e))}enterGroup(e){return Zt("id",e,Ht()),bt(this.#e.enterGroup(e))}exitGroup(e){return Zt("id",e,Ht()),bt(this.#e.exitGroup(e))}isCombinable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isCombinable(e))}combine(e,t){return Zt("ids",e,Ut(Ht())),Zt("op",t,Wt()),bt(this.#e.combine(e,t))}setName(e,t){return Zt("id",e,Nt()),Zt("name",t,Wt()),bt(this.#e.setName(e,t))}getName(e){return Zt("id",e,Nt()),bt(this.#e.getName(e))}getUUID(e){return Zt("id",e,Nt()),bt(this.#e.getUUID(e))}findByName(e){Zt("name",e,Wt());const t=this.#e.findByName(e);return Tt(t)}findByType(e){Zt("type",e,Wt());const t=bt(this.#e.findByType(e));return Tt(t)}findByKind(e){Zt("kind",e,Wt());const t=bt(this.#e.findByKind(e));return Tt(t)}findAll(){return Tt(this.#e.findAll())}findAllPlaceholders(){return Tt(this.#e.findAllPlaceholders())}createShape(e){return Zt("type",e,Wt()),bt(this.#e.createShape(e))}hasShape(e){return Zt("id",e,Nt()),bt(this.#e.hasShape(e))}getShape(e){return Zt("id",e,Nt()),bt(this.#e.getShape(e))}setShape(e,t){return Zt("id",e,Nt()),Zt("shape",t,Nt()),bt(this.#e.setShape(e,t))}isVisible(e){return Zt("id",e,Nt()),bt(this.#e.isVisible(e))}setVisible(e,t){return Zt("id",e,Nt()),Zt("visible",t,$t()),bt(this.#e.setVisible(e,t))}isClipped(e){return Zt("id",e,Nt()),bt(this.#e.isClipped(e))}setClipped(e,t){return Zt("id",e,Nt()),Zt("clipped",t,$t()),bt(this.#e.setClipped(e,t))}isTransformLocked(e){return Zt("id",e,Nt()),bt(this.#e.isTransformLocked(e))}setTransformLocked(e,t){return Zt("id",e,Nt()),Zt("locked",t,$t()),bt(this.#e.setTransformLocked(e,t))}getPositionX(e){return Zt("id",e,Nt()),bt(this.#e.getPositionX(e))}getPositionXMode(e){return Zt("id",e,Nt()),bt(this.#e.getPositionXMode(e))}getPositionY(e){return Zt("id",e,Nt()),bt(this.#e.getPositionY(e))}getPositionYMode(e){return Zt("id",e,Nt()),bt(this.#e.getPositionYMode(e))}setPositionX(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setPositionX(e,t))}setPositionXMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setPositionXMode(e,t))}setPositionY(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setPositionY(e,t))}setPositionYMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setPositionYMode(e,t))}setAlwaysOnTop(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return Zt("id",e,Nt()),bt(this.#e.isAlwaysOnTop(e))}isAlwaysOnBottom(e){return Zt("id",e,Nt()),bt(this.#e.isAlwaysOnBottom(e))}bringToFront(e){return Zt("id",e,Ht()),bt(this.#e.bringToFront(e))}sendToBack(e){return Zt("id",e,Ht()),bt(this.#e.sendToBack(e))}bringForward(e){return Zt("id",e,Ht()),bt(this.#e.bringForward(e))}sendBackward(e){return Zt("id",e,Ht()),bt(this.#e.sendBackward(e))}getRotation(e){return Zt("id",e,Nt()),bt(this.#e.getRotation(e))}setRotation(e,t){return Zt("id",e,Nt()),Zt("radians",t,Ht()),bt(this.#e.setRotation(e,t))}getFlipHorizontal(e){return Zt("id",e,Nt()),bt(this.#e.getFlip(e)).horizontal}getFlipVertical(e){return Zt("id",e,Nt()),bt(this.#e.getFlip(e)).vertical}setFlipHorizontal(e,t){return Zt("id",e,Nt()),Zt("flip",t,$t()),bt(this.#e.setFlipHorizontal(e,t))}setFlipVertical(e,t){return Zt("id",e,Nt()),Zt("flip",t,$t()),bt(this.#e.setFlipVertical(e,t))}hasContentFillMode(e){return Zt("id",e,Nt()),bt(this.#e.hasContentFillMode(e))}getWidth(e){return Zt("id",e,Nt()),bt(this.#e.getWidth(e))}getWidthMode(e){return Zt("id",e,Nt()),bt(this.#e.getWidthMode(e))}getHeight(e){return Zt("id",e,Nt()),bt(this.#e.getHeight(e))}getHeightMode(e){return Zt("id",e,Nt()),bt(this.#e.getHeightMode(e))}setWidth(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setWidth(e,t))}setWidthMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setWidthMode(e,t))}setHeight(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setHeight(e,t))}setHeightMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setHeightMode(e,t))}getFrameX(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameX(e))}getFrameY(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameY(e))}getFrameWidth(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameWidth(e))}getFrameHeight(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameHeight(e))}setContentFillMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setContentFillMode(e,t))}getContentFillMode(e){return Zt("id",e,Nt()),bt(this.#e.getContentFillMode(e))}duplicate(e){return Zt("id",e,Nt()),bt(this.#e.duplicate(e))}destroy(e){return Zt("id",e,Nt()),bt(this.#e.destroy(e))}isValid(e){return Zt("id",e,Nt()),this.#e.isValid(e)}getParent(e){return Zt("id",e,Nt()),bt(this.#e.hasParent(e))?bt(this.#e.getParent(e)):null}getChildren(e){Zt("id",e,Nt());const t=bt(this.#e.getChildren(e));return Tt(t)}insertChild(e,t,r){return Zt("parent",e,Ht()),Zt("child",t,Ht()),Zt("index",r,Gt(Ht(),0)),bt(this.#e.insertChild(e,t,r))}appendChild(e,t){return Zt("parent",e,Ht()),Zt("child",t,Ht()),bt(this.#e.appendChild(e,t))}referencesAnyVariables(e){return Zt("id",e,Nt()),bt(this.#e.referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.alignHorizontally(e,t))}alignVertically(e,t){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.alignVertically(e,t))}isAlignable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isAlignable(e))}distributeHorizontally(e){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.distributeHorizontally(e))}distributeVertically(e){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.distributeVertically(e))}isDistributable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isDistributable(e))}fillParent(e){return Zt("id",e,Nt()),bt(this.#e.fillParent(e))}resizeContentAware(e,t,r){return Zt("ids",e,Ut(Ht())),Zt("width",t,Ht()),Zt("height",r,Ht()),bt(this.#e.resizeContentAware(e,t,r))}scale(e,t,r=0,o=0){return Zt("id",e,Nt()),bt(this.#e.scale(e,t,r,o))}findAllProperties(e){return Zt("id",e,Nt()),Tt(bt(this.#e.findAllProperties(e)))}isPropertyReadable(e){return Zt("property",e,Wt()),this.#e.isPropertyReadable(e)}isPropertyWritable(e){return Zt("property",e,Wt()),this.#e.isPropertyWritable(e)}getPropertyType(e){Zt("property",e,Wt());return bt(this.#e.getPropertyType(e))}getEnumValues(e){return Zt("enumProperty",e,Wt()),Tt(bt(this.#e.getEnumValues(e)))}setBool(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,$t()),bt(this.#e.setBool(e,t,r))}getBool(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getBool(e,t))}setInt(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Nt()),bt(this.#e.setInt(e,t,r))}getInt(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getInt(e,t))}setFloat(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Ht()),bt(this.#e.setFloat(e,t,r))}getFloat(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getFloat(e,t))}setDouble(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Ht()),bt(this.#e.setDouble(e,t,r))}getDouble(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getDouble(e,t))}setString(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Wt()),bt(this.#e.setString(e,t,r))}getString(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getString(e,t))}setColor(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.setColor(e,t,Jt.fromColor(r)))}getColor(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),Jt.toColor(bt(this.#e.getColor(e,t)))}setColorRGBA(e,t,r,o,n,i=1){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("r",r,Ht()),Zt("g",o,Ht()),Zt("b",n,Ht()),Zt("a",i,Ht()),bt(this.#e.setColorRGBA(e,t,r,o,n,i))}getColorRGBA(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getColorRGBA(e,t))}setColorSpot(e,t,r,o=1){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("name",r,Wt()),Zt("tint",o,Ht()),bt(this.#e.setColorSpot(e,t,r,o))}getColorSpotName(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getColorSpotName(e,t))}getColorSpotTint(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getColorSpotTint(e,t))}setGradientColorStops(e,t,r){Zt("id",e,Nt()),Zt("property",t,Wt());const o=r.map((e=>({color:Jt.fromColor(e.color),stop:e.stop})));return bt(this.#e.setGradientColorStops(e,t,o))}getGradientColorStops(e,t){Zt("id",e,Nt()),Zt("property",t,Wt());const r=bt(this.#e.getGradientColorStops(e,t));return Tt(r).map((e=>({color:Jt.toColor(e.color),stop:e.stop})))}getSourceSet(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),Tt(bt(this.#e.getSourceSet(e,t)))}setSourceSet(e,t,r){Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("sourceSet",r,Ut(Vt({uri:Wt(),width:Ht(),height:Ht()}))),bt(this.#e.setSourceSet(e,t,r))}setEnum(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Wt()),bt(this.#e.setEnum(e,t,r))}getEnum(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getEnum(e,t))}hasCrop(e){return Zt("id",e,Nt()),bt(this.#e.hasCrop(e))}setCropScaleX(e,t){return Zt("id",e,Nt()),Zt("scaleX",t,Ht()),bt(this.#e.setCropScaleX(e,t))}setCropScaleY(e,t){return Zt("id",e,Nt()),Zt("scaleY",t,Ht()),bt(this.#e.setCropScaleY(e,t))}setCropRotation(e,t){return Zt("id",e,Nt()),Zt("rotation",t,Ht()),bt(this.#e.setCropRotation(e,t))}setCropScaleRatio(e,t){return Zt("id",e,Nt()),Zt("scaleRatio",t,Ht()),bt(this.#e.setCropScaleRatio(e,t))}setCropTranslationX(e,t){return Zt("id",e,Nt()),Zt("translationX",t,Ht()),bt(this.#e.setCropTranslationX(e,t))}setCropTranslationY(e,t){return Zt("id",e,Nt()),Zt("translationY",t,Ht()),bt(this.#e.setCropTranslationY(e,t))}resetCrop(e){return Zt("id",e,Nt()),bt(this.#e.resetCrop(e))}getCropScaleX(e){return Zt("id",e,Nt()),bt(this.#e.getCropScaleX(e))}getCropScaleY(e){return Zt("id",e,Nt()),bt(this.#e.getCropScaleY(e))}getCropRotation(e){return Zt("id",e,Nt()),bt(this.#e.getCropRotation(e))}getCropScaleRatio(e){return Zt("id",e,Nt()),bt(this.#e.getCropScaleRatio(e))}getCropTranslationX(e){return Zt("id",e,Nt()),bt(this.#e.getCropTranslationX(e))}getCropTranslationY(e){return Zt("id",e,Nt()),bt(this.#e.getCropTranslationY(e))}adjustCropToFillFrame(e,t){return Zt("id",e,Nt()),Zt("minScaleRatio",t,Ht()),bt(this.#e.adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return Zt("id",e,Nt()),bt(this.#e.flipCropHorizontal(e))}flipCropVertical(e){return Zt("id",e,Nt()),bt(this.#e.flipCropVertical(e))}hasOpacity(e){return Zt("id",e,Nt()),bt(this.#e.hasOpacity(e))}setOpacity(e,t){return Zt("id",e,Nt()),Zt("opacity",t,Ht()),bt(this.#e.setOpacity(e,t))}getOpacity(e){return Zt("id",e,Nt()),bt(this.#e.getOpacity(e))}hasBlendMode(e){return Zt("id",e,Nt()),bt(this.#e.hasBlendMode(e))}setBlendMode(e,t){return Zt("id",e,Nt()),Zt("blendMode",t,Wt()),bt(this.#e.setBlendMode(e,t))}getBlendMode(e){return Zt("id",e,Nt()),bt(this.#e.getBlendMode(e))}hasFillColor(e){return Zt("id",e,Nt()),bt(this.#e.hasFillColor(e))}isIncludedInExport(e){return Zt("id",e,Nt()),bt(this.#e.isIncludedInExport(e))}setIncludedInExport(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setFillColorRGBA(e,t,r,o,n))}getFillColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getFillColorRGBA(e))}setFillColorEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setFillColorEnabled(e,t))}isFillColorEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isFillColorEnabled(e))}createEffect(e){return Zt("type",e,Wt()),bt(this.#e.createEffect(e))}hasEffects(e){return Zt("id",e,Nt()),bt(this.#e.hasEffects(e))}getEffects(e){Zt("id",e,Nt());const t=bt(this.#e.getEffects(e));return Tt(t)}insertEffect(e,t,r){Zt("id",e,Nt()),Zt("effectId",t,Nt()),Zt("index",r,Gt(Nt(),0)),bt(this.#e.insertEffect(e,t,r))}appendEffect(e,t){Zt("id",e,Nt()),Zt("effectId",t,Nt()),bt(this.#e.appendEffect(e,t))}removeEffect(e,t){Zt("id",e,Nt()),Zt("index",t,Gt(Nt(),0)),bt(this.#e.removeEffect(e,t))}hasEffectEnabled(e){return Zt("effectId",e,Nt()),bt(this.#e.hasEffectEnabled(e))}setEffectEnabled(e,t){Zt("effectId",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setEffectEnabled(e,t))}isEffectEnabled(e){return Zt("effectId",e,Nt()),bt(this.#e.isEffectEnabled(e))}createBlur(e){return Zt("type",e,Wt()),bt(this.#e.createBlur(e))}hasBlur(e){return Zt("id",e,Nt()),bt(this.#e.hasBlur(e))}setBlur(e,t){Zt("id",e,Nt()),Zt("blurId",t,Nt()),bt(this.#e.setBlur(e,t))}getBlur(e){return Zt("id",e,Nt()),bt(this.#e.getBlur(e))}setBlurEnabled(e,t){Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setBlurEnabled(e,t))}isBlurEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isBlurEnabled(e))}hasBackgroundColor(e){return Zt("id",e,Nt()),bt(this.#e.hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setBackgroundColorRGBA(e,t,r,o,n))}getBackgroundColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isBackgroundColorEnabled(e))}hasStroke(e){return Zt("id",e,Nt()),bt(this.#e.hasStroke(e))}setStrokeEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setStrokeEnabled(e,t))}isStrokeEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setStrokeColorRGBA(e,t,r,o,n))}setStrokeColor(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokeColor(e,Jt.fromColor(t)))}getStrokeColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getStrokeColorRGBA(e))}getStrokeColor(e){return Zt("id",e,Nt()),Jt.toColor(bt(this.#e.getStrokeColor(e)))}setStrokeWidth(e,t){return Zt("id",e,Nt()),Zt("width",t,Ht()),bt(this.#e.setStrokeWidth(e,t))}getStrokeWidth(e){return Zt("id",e,Nt()),bt(this.#e.getStrokeWidth(e))}setStrokeStyle(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokeStyle(e,t))}getStrokeStyle(e){Zt("id",e,Nt());return bt(this.#e.getStrokeStyle(e))}setStrokePosition(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokePosition(e,t))}getStrokePosition(e){Zt("id",e,Nt());return bt(this.#e.getStrokePosition(e))}setStrokeCornerGeometry(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){Zt("id",e,Nt());return bt(this.#e.getStrokeCornerGeometry(e))}hasDropShadow(e){return Zt("id",e,Nt()),bt(this.#e.hasDropShadow(e))}setDropShadowEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setDropShadowColorRGBA(e,t,r,o,n))}setDropShadowColor(e,t){return Zt("id",e,Nt()),bt(this.#e.setDropShadowColor(e,Jt.fromColor(t)))}getDropShadowColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowColorRGBA(e))}getDropShadowColor(e){return Zt("id",e,Nt()),Jt.toColor(bt(this.#e.getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return Zt("id",e,Nt()),Zt("offsetX",t,Ht()),bt(this.#e.setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return Zt("id",e,Nt()),Zt("offsetY",t,Ht()),bt(this.#e.setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return Zt("id",e,Nt()),Zt("blurRadiusX",t,Ht()),bt(this.#e.setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return Zt("id",e,Nt()),Zt("blurRadiusY",t,Ht()),bt(this.#e.setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return Zt("id",e,Nt()),bt(this.#e.setDropShadowClip(e,t))}getDropShadowClip(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return Zt("ids",e,Ut(Nt())),Zt("vectorizeDistanceThreshold",t,Ht()),Zt("maxSmoothingDistance",r,Ht()),bt(this.#e.createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return Zt("path",e,Wt()),bt(this.#e.createCutoutFromPath(e))}createCutoutFromOperation(e,t){return Zt("ids",e,Ut(Nt())),Zt("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return jt("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),bt(this.#e.createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,o=-1){Zt("id",e,Nt()),Zt("text",t,Wt()),Zt("from",r,Nt()),Zt("to",o,Nt()),bt(this.#e.replaceText(e,t,r,o))}removeText(e,t=-1,r=-1){Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),bt(this.#e.removeText(e,t,r))}setTextColor(e,t,r=-1,o=-1){Zt("id",e,Nt()),Zt("from",r,Nt()),Zt("to",o,Nt()),bt(this.#e.setTextColor(e,Jt.fromColor(t),r,o))}getTextColors(e,t=-1,r=-1){Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt());const o=this.#e.getTextColors(e,t,r);return Tt(bt(o)).map((e=>Jt.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),Tt(bt(this.#e.getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),Tt(bt(this.#e.getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),Tt(bt(this.#e.getTextCases(e,t,r)))}setTextCase(e,t,r=-1,o=-1){Zt("id",e,Nt()),Zt("textCase",t,Wt()),Zt("from",r,Nt()),Zt("to",o,Nt()),bt(this.#e.setTextCase(e,t,r,o))}canToggleBoldFont(e,t=-1,r=-1){return Zt("id",e,Nt()),bt(this.#e.canToggleBoldFont(e,t,r))}canToggleItalicFont(e,t=-1,r=-1){return Zt("id",e,Nt()),bt(this.#e.canToggleItalicFont(e,t,r))}toggleBoldFont(e,t=-1,r=-1){Zt("id",e,Nt()),bt(this.#e.toggleBoldFont(e,t,r))}toggleItalicFont(e,t=-1,r=-1){Zt("id",e,Nt()),bt(this.#e.toggleItalicFont(e,t,r))}setFont(e,t,r){Zt("block",e,Nt()),Zt("fontFileUri",t,Wt()),bt(this.#e.setFont(e,t,r))}getTypeface(e){return Zt("block",e,Nt()),bt(this.#e.getTypeface(e))}getTextCursorRange(){return bt(this.#e.getTextCursorRange())}hasFill(e){return Zt("id",e,Nt()),bt(this.#e.hasFill(e))}isFillEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isFillEnabled(e))}setFillEnabled(e,t){return Zt("id",e,Nt()),bt(this.#e.setFillEnabled(e,t))}getFill(e){return Zt("id",e,Nt()),bt(this.#e.getFill(e))}setFill(e,t){return Zt("id",e,Nt()),Zt("fill",t,Nt()),bt(this.#e.setFill(e,t))}setFillSolidColor(e,t,r,o,n=1){Zt("id",e,Nt()),bt(this.#e.setFillSolidColor(e,t,r,o,n))}getFillSolidColor(e){return Zt("id",e,Nt()),bt(this.#e.getFillSolidColor(e))}setPlaceholderEnabled(e,t){Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){Zt("id",e,Nt()),bt(this.#e.setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){Zt("id",e,Nt()),Zt("key",t,Wt()),Zt("value",r,Wt()),bt(this.#e.setMetadata(e,t,r))}getMetadata(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.getMetadata(e,t))}hasMetadata(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.hasMetadata(e,t))}findAllMetadata(e){return Zt("id",e,Nt()),Tt(bt(this.#e.findAllMetadata(e)))}removeMetadata(e,t){Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.removeMetadata(e,t))}setScopeEnabled(e,t,r){Zt("id",e,Nt()),Zt("key",t,Wt()),Zt("enabled",r,$t()),bt(this.#e.setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.isScopeEnabled(e,t))}isAllowedByScope(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.isAllowedByScope(e,t))}hasDuration(e){return Zt("id",e,Nt()),bt(this.#e.hasDuration(e))}setDuration(e,t){return Zt("id",e,Nt()),Zt("duration",t,Ht()),bt(this.#e.setDuration(e,t))}getDuration(e){return Zt("id",e,Nt()),bt(this.#e.getDuration(e))}hasTimeOffset(e){return Zt("id",e,Nt()),bt(this.#e.hasTimeOffset(e))}setTimeOffset(e,t){return Zt("id",e,Nt()),Zt("offset",t,Ht()),bt(this.#e.setTimeOffset(e,t))}getTimeOffset(e){return Zt("id",e,Nt()),bt(this.#e.getTimeOffset(e))}hasTrim(e){return Zt("id",e,Nt()),bt(this.#e.hasTrim(e))}setTrimOffset(e,t){return Zt("id",e,Nt()),Zt("offset",t,Ht()),bt(this.#e.setTrimOffset(e,t))}getTrimOffset(e){return Zt("id",e,Nt()),bt(this.#e.getTrimOffset(e))}setTrimLength(e,t){return Zt("id",e,Nt()),Zt("length",t,Ht()),bt(this.#e.setTrimLength(e,t))}getTrimLength(e){return Zt("id",e,Nt()),bt(this.#e.getTrimLength(e))}getTotalSceneDuration(e){return Zt("scene",e,Nt()),bt(this.#e.getTotalSceneDuration(e))}setPlaying(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaying(e,t))}isPlaying(e){return Zt("id",e,Nt()),bt(this.#e.isPlaying(e))}hasPlaybackTime(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaybackTime(e))}setPlaybackTime(e,t){return Zt("id",e,Nt()),Zt("time",t,Ht()),bt(this.#e.setPlaybackTime(e,t))}getPlaybackTime(e){return Zt("id",e,Nt()),bt(this.#e.getPlaybackTime(e))}isVisibleAtCurrentPlaybackTime(e){return Zt("id",e,Nt()),bt(this.#e.isVisibleAtCurrentPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaybackControl(e))}setLooping(e,t){Zt("id",e,Nt()),Zt("looping",t,$t()),bt(this.#e.setLooping(e,t))}isLooping(e){return Zt("id",e,Nt()),bt(this.#e.isLooping(e))}setMuted(e,t){Zt("id",e,Nt()),Zt("muted",t,$t()),bt(this.#e.setMuted(e,t))}isMuted(e){return Zt("id",e,Nt()),bt(this.#e.isMuted(e))}setVolume(e,t){Zt("id",e,Nt()),Zt("volume",t,Ht()),bt(this.#e.setVolume(e,t))}getVolume(e){return Zt("id",e,Nt()),bt(this.#e.getVolume(e))}async forceLoadAVResource(e){return Zt("id",e,Nt()),vt((t=>this.#e.forceLoadAVResource(e,t)))}unstable_isAVResourceLoaded(e){return Zt("id",e,Nt()),bt(this.#e.unstable_isAVResourceLoaded(e))}getAVResourceTotalDuration(e){return Zt("id",e,Nt()),bt(this.#e.getAVResourceTotalDuration(e))}getVideoWidth(e){return Zt("id",e,Nt()),bt(this.#e.getVideoWidth(e))}getVideoHeight(e){return Zt("id",e,Nt()),bt(this.#e.getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,o,n,i){Zt("id",e,Nt()),Zt("thumbnailHeight",t,Nt()),Zt("timeBegin",r,Ht()),Zt("timeEnd",o,Ht()),Zt("numberOfFrames",n,Nt());const a=this.#e.generateVideoThumbnailSequence(e,t,r,o,n,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))}));return()=>{this.#e.cancelVideoThumbnailSequenceGeneration(a)}}generateAudioThumbnailSequence(e,t,r,o,n,i,a){Zt("id",e,Nt()),Zt("samplesPerChunk",t,Nt()),Zt("timeBegin",r,Ht()),Zt("timeEnd",o,Ht()),Zt("numberOfSamples",n,Nt()),Zt("numberOfChannels",i,Nt());const s=this.#e.generateAudioThumbnailSequence(e,t,r,o,n,i,(e=>{"error"in e?a(0,new Error(e.error)):a(e.chunkIndex,e.sampleData)}));return()=>{this.#e.cancelAudioThumbnailSequenceGeneration(s)}}async getVideoFillThumbnail(e,t){return Zt("id",e,Nt()),Zt("thumbnailHeight",t,Nt()),new Promise(((r,o)=>{this.#e.getVideoFillThumbnail(e,t,(e=>{"error"in e?o(e.error):r(new rr([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,o){return Zt("id",e,Nt()),Zt("numberOfColumns",t,Nt()),Zt("numberOfRows",r,Nt()),Zt("thumbnailHeight",o,Nt()),new Promise(((n,i)=>{this.#e.getVideoFillThumbnailAtlas(e,t,r,o,(e=>{"error"in e?i(e.error):n(new rr([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,o){return Zt("id",e,Nt()),Zt("numberOfColumns",t,Nt()),Zt("numberOfRows",r,Nt()),new Promise(((n,i)=>{this.#e.getPageThumbnailAtlas(e,t,r,o,(e=>{"error"in e?i(e.error):n(new rr([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){Zt("id",e,Nt()),t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),bt(this.#e.setNativePixelBuffer(e,t))}getState(e){return Zt("id",e,Nt()),bt(this.#e.getState(e))}setState(e,t){Zt("id",e,Nt()),bt(this.#e.setState(e,t))}onStateChanged=(e,t)=>{Zt("ids",e,Ut(Nt()));const r=this.#e.subscribeToBlockState(e,(e=>{try{t(Tt(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(r))}}};u([mt],BlockAPI.prototype,"loadFromString",1),u([mt],BlockAPI.prototype,"create",1),u([mt],BlockAPI.prototype,"createFill",1),u([ft],BlockAPI.prototype,"getType",1),u([mt],BlockAPI.prototype,"select",1),u([mt],BlockAPI.prototype,"setSelected",1),u([ft],BlockAPI.prototype,"isSelected",1),u([ft],BlockAPI.prototype,"findAllSelected",1),u([ft],BlockAPI.prototype,"isGroupable",1),u([mt],BlockAPI.prototype,"group",1),u([mt],BlockAPI.prototype,"ungroup",1),u([mt],BlockAPI.prototype,"enterGroup",1),u([mt],BlockAPI.prototype,"exitGroup",1),u([ft],BlockAPI.prototype,"isCombinable",1),u([mt],BlockAPI.prototype,"combine",1),u([mt],BlockAPI.prototype,"setName",1),u([ft],BlockAPI.prototype,"getName",1),u([ft],BlockAPI.prototype,"getUUID",1),u([ft],BlockAPI.prototype,"findByName",1),u([ft],BlockAPI.prototype,"findByType",1),u([ft],BlockAPI.prototype,"findAll",1),u([ft],BlockAPI.prototype,"findAllPlaceholders",1),u([mt],BlockAPI.prototype,"createShape",1),u([ft],BlockAPI.prototype,"hasShape",1),u([ft],BlockAPI.prototype,"getShape",1),u([mt],BlockAPI.prototype,"setShape",1),u([ft],BlockAPI.prototype,"isVisible",1),u([mt],BlockAPI.prototype,"setVisible",1),u([ft],BlockAPI.prototype,"isClipped",1),u([mt],BlockAPI.prototype,"setClipped",1),u([ft],BlockAPI.prototype,"isTransformLocked",1),u([mt],BlockAPI.prototype,"setTransformLocked",1),u([ft],BlockAPI.prototype,"getPositionX",1),u([ft],BlockAPI.prototype,"getPositionXMode",1),u([ft],BlockAPI.prototype,"getPositionY",1),u([ft],BlockAPI.prototype,"getPositionYMode",1),u([mt],BlockAPI.prototype,"setPositionX",1),u([mt],BlockAPI.prototype,"setPositionXMode",1),u([mt],BlockAPI.prototype,"setPositionY",1),u([mt],BlockAPI.prototype,"setPositionYMode",1),u([mt],BlockAPI.prototype,"setAlwaysOnTop",1),u([mt],BlockAPI.prototype,"setAlwaysOnBottom",1),u([ft],BlockAPI.prototype,"isAlwaysOnTop",1),u([ft],BlockAPI.prototype,"isAlwaysOnBottom",1),u([mt],BlockAPI.prototype,"bringToFront",1),u([mt],BlockAPI.prototype,"sendToBack",1),u([mt],BlockAPI.prototype,"bringForward",1),u([mt],BlockAPI.prototype,"sendBackward",1),u([ft],BlockAPI.prototype,"getRotation",1),u([mt],BlockAPI.prototype,"setRotation",1),u([ft],BlockAPI.prototype,"getFlipHorizontal",1),u([ft],BlockAPI.prototype,"getFlipVertical",1),u([mt],BlockAPI.prototype,"setFlipHorizontal",1),u([mt],BlockAPI.prototype,"setFlipVertical",1),u([ft],BlockAPI.prototype,"hasContentFillMode",1),u([ft],BlockAPI.prototype,"getWidth",1),u([ft],BlockAPI.prototype,"getWidthMode",1),u([ft],BlockAPI.prototype,"getHeight",1),u([ft],BlockAPI.prototype,"getHeightMode",1),u([mt],BlockAPI.prototype,"setWidth",1),u([mt],BlockAPI.prototype,"setWidthMode",1),u([mt],BlockAPI.prototype,"setHeight",1),u([mt],BlockAPI.prototype,"setHeightMode",1),u([ft],BlockAPI.prototype,"getFrameX",1),u([ft],BlockAPI.prototype,"getFrameY",1),u([ft],BlockAPI.prototype,"getFrameWidth",1),u([ft],BlockAPI.prototype,"getFrameHeight",1),u([mt],BlockAPI.prototype,"setContentFillMode",1),u([ft],BlockAPI.prototype,"getContentFillMode",1),u([mt],BlockAPI.prototype,"duplicate",1),u([mt],BlockAPI.prototype,"destroy",1),u([ft],BlockAPI.prototype,"isValid",1),u([ft],BlockAPI.prototype,"getParent",1),u([ft],BlockAPI.prototype,"getChildren",1),u([mt],BlockAPI.prototype,"insertChild",1),u([mt],BlockAPI.prototype,"appendChild",1),u([ft],BlockAPI.prototype,"referencesAnyVariables",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxX",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxY",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxWidth",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxHeight",1),u([ft],BlockAPI.prototype,"getScreenSpaceBoundingBoxXYWH",1),u([mt],BlockAPI.prototype,"alignHorizontally",1),u([mt],BlockAPI.prototype,"alignVertically",1),u([ft],BlockAPI.prototype,"isAlignable",1),u([mt],BlockAPI.prototype,"distributeHorizontally",1),u([mt],BlockAPI.prototype,"distributeVertically",1),u([mt],BlockAPI.prototype,"isDistributable",1),u([mt],BlockAPI.prototype,"fillParent",1),u([mt],BlockAPI.prototype,"resizeContentAware",1),u([mt],BlockAPI.prototype,"scale",1),u([ft],BlockAPI.prototype,"findAllProperties",1),u([ft],BlockAPI.prototype,"isPropertyReadable",1),u([ft],BlockAPI.prototype,"isPropertyWritable",1),u([ft],BlockAPI.prototype,"getPropertyType",1),u([ft],BlockAPI.prototype,"getEnumValues",1),u([mt],BlockAPI.prototype,"setBool",1),u([ft],BlockAPI.prototype,"getBool",1),u([mt],BlockAPI.prototype,"setInt",1),u([ft],BlockAPI.prototype,"getInt",1),u([mt],BlockAPI.prototype,"setFloat",1),u([ft],BlockAPI.prototype,"getFloat",1),u([mt],BlockAPI.prototype,"setDouble",1),u([ft],BlockAPI.prototype,"getDouble",1),u([mt],BlockAPI.prototype,"setString",1),u([ft],BlockAPI.prototype,"getString",1),u([mt],BlockAPI.prototype,"setColor",1),u([ft],BlockAPI.prototype,"getColor",1),u([mt],BlockAPI.prototype,"setColorRGBA",1),u([ft],BlockAPI.prototype,"getColorRGBA",1),u([mt],BlockAPI.prototype,"setColorSpot",1),u([ft],BlockAPI.prototype,"getColorSpotName",1),u([ft],BlockAPI.prototype,"getColorSpotTint",1),u([mt],BlockAPI.prototype,"setGradientColorStops",1),u([ft],BlockAPI.prototype,"getGradientColorStops",1),u([ft],BlockAPI.prototype,"getSourceSet",1),u([mt],BlockAPI.prototype,"setSourceSet",1),u([mt],BlockAPI.prototype,"setEnum",1),u([ft],BlockAPI.prototype,"getEnum",1),u([ft],BlockAPI.prototype,"hasCrop",1),u([mt],BlockAPI.prototype,"setCropScaleX",1),u([mt],BlockAPI.prototype,"setCropScaleY",1),u([mt],BlockAPI.prototype,"setCropRotation",1),u([mt],BlockAPI.prototype,"setCropScaleRatio",1),u([mt],BlockAPI.prototype,"setCropTranslationX",1),u([mt],BlockAPI.prototype,"setCropTranslationY",1),u([mt],BlockAPI.prototype,"resetCrop",1),u([ft],BlockAPI.prototype,"getCropScaleX",1),u([ft],BlockAPI.prototype,"getCropScaleY",1),u([ft],BlockAPI.prototype,"getCropRotation",1),u([ft],BlockAPI.prototype,"getCropScaleRatio",1),u([ft],BlockAPI.prototype,"getCropTranslationX",1),u([ft],BlockAPI.prototype,"getCropTranslationY",1),u([mt],BlockAPI.prototype,"adjustCropToFillFrame",1),u([mt],BlockAPI.prototype,"flipCropHorizontal",1),u([mt],BlockAPI.prototype,"flipCropVertical",1),u([ft],BlockAPI.prototype,"hasOpacity",1),u([mt],BlockAPI.prototype,"setOpacity",1),u([ft],BlockAPI.prototype,"getOpacity",1),u([ft],BlockAPI.prototype,"hasBlendMode",1),u([mt],BlockAPI.prototype,"setBlendMode",1),u([ft],BlockAPI.prototype,"getBlendMode",1),u([ft],BlockAPI.prototype,"hasFillColor",1),u([ft],BlockAPI.prototype,"isIncludedInExport",1),u([mt],BlockAPI.prototype,"setIncludedInExport",1),u([mt],BlockAPI.prototype,"setFillColorRGBA",1),u([ft],BlockAPI.prototype,"getFillColorRGBA",1),u([mt],BlockAPI.prototype,"setFillColorEnabled",1),u([ft],BlockAPI.prototype,"isFillColorEnabled",1),u([mt],BlockAPI.prototype,"createEffect",1),u([ft],BlockAPI.prototype,"hasEffects",1),u([ft],BlockAPI.prototype,"getEffects",1),u([mt],BlockAPI.prototype,"insertEffect",1),u([mt],BlockAPI.prototype,"appendEffect",1),u([mt],BlockAPI.prototype,"removeEffect",1),u([ft],BlockAPI.prototype,"hasEffectEnabled",1),u([mt],BlockAPI.prototype,"setEffectEnabled",1),u([ft],BlockAPI.prototype,"isEffectEnabled",1),u([mt],BlockAPI.prototype,"createBlur",1),u([ft],BlockAPI.prototype,"hasBlur",1),u([mt],BlockAPI.prototype,"setBlur",1),u([ft],BlockAPI.prototype,"getBlur",1),u([mt],BlockAPI.prototype,"setBlurEnabled",1),u([ft],BlockAPI.prototype,"isBlurEnabled",1),u([ft],BlockAPI.prototype,"hasBackgroundColor",1),u([mt],BlockAPI.prototype,"setBackgroundColorRGBA",1),u([ft],BlockAPI.prototype,"getBackgroundColorRGBA",1),u([mt],BlockAPI.prototype,"setBackgroundColorEnabled",1),u([ft],BlockAPI.prototype,"isBackgroundColorEnabled",1),u([ft],BlockAPI.prototype,"hasStroke",1),u([mt],BlockAPI.prototype,"setStrokeEnabled",1),u([ft],BlockAPI.prototype,"isStrokeEnabled",1),u([mt],BlockAPI.prototype,"setStrokeColorRGBA",1),u([mt],BlockAPI.prototype,"setStrokeColor",1),u([ft],BlockAPI.prototype,"getStrokeColorRGBA",1),u([ft],BlockAPI.prototype,"getStrokeColor",1),u([mt],BlockAPI.prototype,"setStrokeWidth",1),u([ft],BlockAPI.prototype,"getStrokeWidth",1),u([mt],BlockAPI.prototype,"setStrokeStyle",1),u([ft],BlockAPI.prototype,"getStrokeStyle",1),u([mt],BlockAPI.prototype,"setStrokePosition",1),u([ft],BlockAPI.prototype,"getStrokePosition",1),u([mt],BlockAPI.prototype,"setStrokeCornerGeometry",1),u([ft],BlockAPI.prototype,"getStrokeCornerGeometry",1),u([ft],BlockAPI.prototype,"hasDropShadow",1),u([mt],BlockAPI.prototype,"setDropShadowEnabled",1),u([ft],BlockAPI.prototype,"isDropShadowEnabled",1),u([mt],BlockAPI.prototype,"setDropShadowColorRGBA",1),u([mt],BlockAPI.prototype,"setDropShadowColor",1),u([ft],BlockAPI.prototype,"getDropShadowColorRGBA",1),u([ft],BlockAPI.prototype,"getDropShadowColor",1),u([mt],BlockAPI.prototype,"setDropShadowOffsetX",1),u([ft],BlockAPI.prototype,"getDropShadowOffsetX",1),u([mt],BlockAPI.prototype,"setDropShadowOffsetY",1),u([ft],BlockAPI.prototype,"getDropShadowOffsetY",1),u([mt],BlockAPI.prototype,"setDropShadowBlurRadiusX",1),u([ft],BlockAPI.prototype,"getDropShadowBlurRadiusX",1),u([mt],BlockAPI.prototype,"setDropShadowBlurRadiusY",1),u([ft],BlockAPI.prototype,"getDropShadowBlurRadiusY",1),u([mt],BlockAPI.prototype,"setDropShadowClip",1),u([ft],BlockAPI.prototype,"getDropShadowClip",1),u([mt],BlockAPI.prototype,"createCutoutFromBlocks",1),u([mt],BlockAPI.prototype,"createCutoutFromPath",1),u([mt],BlockAPI.prototype,"createCutoutFromOperation",1),u([mt],BlockAPI.prototype,"replaceText",1),u([mt],BlockAPI.prototype,"removeText",1),u([mt],BlockAPI.prototype,"setTextColor",1),u([ft],BlockAPI.prototype,"getTextColors",1),u([ft],BlockAPI.prototype,"getTextFontWeights",1),u([ft],BlockAPI.prototype,"getTextFontStyles",1),u([ft],BlockAPI.prototype,"getTextCases",1),u([mt],BlockAPI.prototype,"setTextCase",1),u([mt],BlockAPI.prototype,"setFont",1),u([ft],BlockAPI.prototype,"getTypeface",1),u([ft],BlockAPI.prototype,"getTextCursorRange",1),u([ft],BlockAPI.prototype,"hasFill",1),u([ft],BlockAPI.prototype,"isFillEnabled",1),u([mt],BlockAPI.prototype,"setFillEnabled",1),u([ft],BlockAPI.prototype,"getFill",1),u([mt],BlockAPI.prototype,"setFill",1),u([mt],BlockAPI.prototype,"setFillSolidColor",1),u([ft],BlockAPI.prototype,"getFillSolidColor",1),u([mt],BlockAPI.prototype,"setPlaceholderEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderEnabled",1),u([ft],BlockAPI.prototype,"hasPlaceholderBehavior",1),u([mt],BlockAPI.prototype,"setPlaceholderBehaviorEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderBehaviorEnabled",1),u([ft],BlockAPI.prototype,"hasPlaceholderControls",1),u([mt],BlockAPI.prototype,"setPlaceholderControlsOverlayEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderControlsOverlayEnabled",1),u([mt],BlockAPI.prototype,"setPlaceholderControlsButtonEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderControlsButtonEnabled",1),u([mt],BlockAPI.prototype,"setMetadata",1),u([ft],BlockAPI.prototype,"getMetadata",1),u([ft],BlockAPI.prototype,"hasMetadata",1),u([ft],BlockAPI.prototype,"findAllMetadata",1),u([mt],BlockAPI.prototype,"removeMetadata",1),u([mt],BlockAPI.prototype,"setScopeEnabled",1),u([ft],BlockAPI.prototype,"isScopeEnabled",1),u([ft],BlockAPI.prototype,"isAllowedByScope",1),u([ft],BlockAPI.prototype,"hasDuration",1),u([mt],BlockAPI.prototype,"setDuration",1),u([ft],BlockAPI.prototype,"getDuration",1),u([ft],BlockAPI.prototype,"hasTimeOffset",1),u([mt],BlockAPI.prototype,"setTimeOffset",1),u([ft],BlockAPI.prototype,"getTimeOffset",1),u([ft],BlockAPI.prototype,"hasTrim",1),u([mt],BlockAPI.prototype,"setTrimOffset",1),u([ft],BlockAPI.prototype,"getTrimOffset",1),u([mt],BlockAPI.prototype,"setTrimLength",1),u([ft],BlockAPI.prototype,"getTrimLength",1),u([ft],BlockAPI.prototype,"getTotalSceneDuration",1),u([mt],BlockAPI.prototype,"setPlaying",1),u([ft],BlockAPI.prototype,"isPlaying",1),u([ft],BlockAPI.prototype,"hasPlaybackTime",1),u([mt],BlockAPI.prototype,"setPlaybackTime",1),u([ft],BlockAPI.prototype,"getPlaybackTime",1),u([ft],BlockAPI.prototype,"isVisibleAtCurrentPlaybackTime",1),u([mt],BlockAPI.prototype,"setSoloPlaybackEnabled",1),u([ft],BlockAPI.prototype,"isSoloPlaybackEnabled",1),u([ft],BlockAPI.prototype,"hasPlaybackControl",1),u([mt],BlockAPI.prototype,"setLooping",1),u([ft],BlockAPI.prototype,"isLooping",1),u([mt],BlockAPI.prototype,"setMuted",1),u([ft],BlockAPI.prototype,"isMuted",1),u([mt],BlockAPI.prototype,"setVolume",1),u([ft],BlockAPI.prototype,"getVolume",1),u([mt],BlockAPI.prototype,"forceLoadAVResource",1),u([ft],BlockAPI.prototype,"unstable_isAVResourceLoaded",1),u([ft],BlockAPI.prototype,"getAVResourceTotalDuration",1),u([ft],BlockAPI.prototype,"getVideoWidth",1),u([ft],BlockAPI.prototype,"getVideoHeight",1),u([ft],BlockAPI.prototype,"getVideoFillThumbnail",1),u([ft],BlockAPI.prototype,"getVideoFillThumbnailAtlas",1),u([ft],BlockAPI.prototype,"getPageThumbnailAtlas",1),u([ft],BlockAPI.prototype,"getState",1),u([mt],BlockAPI.prototype,"setState",1);var EditorAPI=class{#e;constructor(e){this.#e=e}unlockWithLicense(e){bt(this.#e.unlockWithLicense(e))}startTracking(e,t){this.#e.startTracking(e,t,"")}setTrackingMetadata(e){this.#e.setTrackingMetadata(e)}getTrackingMetadata(){return bt(this.#e.getTrackingMetadata())}getActiveLicense(){return bt(this.#e.getActiveLicense())}onStateChanged=e=>{const t=this.#e.subscribeToEditorState(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};setEditMode(e){Zt("keypath",e,Wt()),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){bt(this.#e.destroyHistory(e))}setActiveHistory(e){bt(this.#e.setActiveHistory(e))}getActiveHistory(){return this.#e.getActiveHistory()}addUndoStep(){bt(this.#e.addUndoStep())}undo(){bt(this.#e.undo())}redo(){bt(this.#e.redo())}canUndo(){return bt(this.#e.canUndo())}canRedo(){return bt(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()||bt(this.#e.unsubscribe(t))}};onRoleChanged=e=>{const t=this.#e.subscribeToRoleChange(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};setSettingBool(e,t){return Zt("keypath",e,Wt()),Zt("value",t,$t()),bt(this.#e.setSettingBool(e,t))}getSettingBool(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingBool(e))}setSettingInt(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Nt()),bt(this.#e.setSettingInt(e,t))}getSettingInt(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingInt(e))}setSettingFloat(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Ht()),bt(this.#e.setSettingFloat(e,t))}getSettingFloat(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingFloat(e))}setSettingString(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setSettingString(e,t))}getSettingString(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingString(e))}setSettingColor(e,t){return Zt("keypath",e,Wt()),bt(this.#e.setSettingColor(e,Jt.fromColor(t)))}getSettingColor(e){return Zt("keypath",e,Wt()),Jt.toColor(bt(this.#e.getSettingColor(e)))}setSettingColorRGBA(e,t,r,o,n=1){return Zt("keypath",e,Wt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setSettingColorRGBA(e,t,r,o,n))}getSettingColorRGBA(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingColorRGBA(e))}setSettingEnum(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setSettingEnum(e,t))}getSettingEnum(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingEnum(e))}getSettingEnumOptions(e){return Zt("keypath",e,Wt()),Tt(bt(this.#e.getSettingEnumOptions(e)))}setRole(e){return bt(this.#e.setRole(e))}getRole(){return bt(this.#e.getRole())}findAllSettings(){return Tt(this.#e.findAllSettings())}getSettingType(e){Zt("keypath",e,Wt());return bt(this.#e.getSettingType(e))}getAvailableMemory(){return bt(this.#e.getAvailableMemory())}getUsedMemory(){return bt(this.#e.getUsedMemory())}getMaxExportSize(){return bt(this.#e.getMaxExportSize())}setURIResolver(e){return bt(this.#e.setURIResolver(e))}defaultURIResolver(e){return this.#e.defaultURIResolver(e)}getAbsoluteURI(e){return bt(this.#e.getAbsoluteURI(e))}findAllScopes(){return Tt(this.#e.findAllScopes())}setGlobalScope(e,t){Zt("key",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setGlobalScope(e,t))}getGlobalScope(e){return Zt("key",e,Wt()),bt(this.#e.getGlobalScope(e))}findAllSpotColors(){return Tt(this.#e.findAllSpotColors())}getSpotColorRGBA(e){return Zt("name",e,Wt()),this.#e.getSpotColorRGB(e)}getSpotColorCMYK(e){return Zt("name",e,Wt()),this.#e.getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,o){return Zt("name",e,Wt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),this.#e.setSpotColorRGB(e,t,r,o)}setSpotColorCMYK(e,t,r,o,n){return Zt("name",e,Wt()),Zt("c",t,Ht()),Zt("m",r,Ht()),Zt("y",o,Ht()),Zt("k",n,Ht()),this.#e.setSpotColorCMYK(e,t,r,o,n)}removeSpotColor(e){return Zt("name",e,Wt()),bt(this.#e.removeSpotColor(e))}setSpotColorForCutoutType(e,t){return Zt("type",e,Wt()),Zt("color",t,Wt()),bt(this.#e.setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return Zt("type",e,Wt()),bt(this.#e.getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return Zt("colorSpace",t,Wt()),Jt.toColor(bt(this.#e.convertColorToColorSpace(Jt.fromColor(e),t)))}createBuffer(){return this.#e.createBuffer()}destroyBuffer(e){bt(this.#e.destroyBuffer(e))}setBufferData(e,t,r){Zt("offset",t,Nt()),bt(this.#e.setBufferData(e,t,r))}getBufferData(e,t,r){Zt("offset",t,Nt()),Zt("length",r,Nt());const o=this.#e.getBufferData(e,t,r);if("error"in o)throw new Error(o.error);return o}setBufferLength(e,t){Zt("length",t,Nt()),bt(this.#e.setBufferLength(e,t))}getBufferLength(e){return bt(this.#e.getBufferLength(e))}};u([mt],EditorAPI.prototype,"setEditMode",1),u([ft],EditorAPI.prototype,"getEditMode",1),u([ft],EditorAPI.prototype,"getCursorType",1),u([ft],EditorAPI.prototype,"getCursorRotation",1),u([ft],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceX",1),u([ft],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceY",1),u([mt],EditorAPI.prototype,"createHistory",1),u([mt],EditorAPI.prototype,"destroyHistory",1),u([mt],EditorAPI.prototype,"setActiveHistory",1),u([ft],EditorAPI.prototype,"getActiveHistory",1),u([mt],EditorAPI.prototype,"addUndoStep",1),u([mt],EditorAPI.prototype,"undo",1),u([mt],EditorAPI.prototype,"redo",1),u([ft],EditorAPI.prototype,"canUndo",1),u([ft],EditorAPI.prototype,"canRedo",1),u([mt],EditorAPI.prototype,"setSettingBool",1),u([ft],EditorAPI.prototype,"getSettingBool",1),u([mt],EditorAPI.prototype,"setSettingInt",1),u([ft],EditorAPI.prototype,"getSettingInt",1),u([mt],EditorAPI.prototype,"setSettingFloat",1),u([ft],EditorAPI.prototype,"getSettingFloat",1),u([mt],EditorAPI.prototype,"setSettingString",1),u([ft],EditorAPI.prototype,"getSettingString",1),u([mt],EditorAPI.prototype,"setSettingColor",1),u([ft],EditorAPI.prototype,"getSettingColor",1),u([mt],EditorAPI.prototype,"setSettingColorRGBA",1),u([ft],EditorAPI.prototype,"getSettingColorRGBA",1),u([mt],EditorAPI.prototype,"setSettingEnum",1),u([ft],EditorAPI.prototype,"getSettingEnum",1),u([mt],EditorAPI.prototype,"setRole",1),u([ft],EditorAPI.prototype,"getRole",1),u([ft],EditorAPI.prototype,"getAvailableMemory",1),u([ft],EditorAPI.prototype,"getUsedMemory",1),u([ft],EditorAPI.prototype,"getMaxExportSize",1),u([mt],EditorAPI.prototype,"setURIResolver",1),u([ft],EditorAPI.prototype,"defaultURIResolver",1),u([ft],EditorAPI.prototype,"getAbsoluteURI",1),u([ft],EditorAPI.prototype,"findAllScopes",1),u([mt],EditorAPI.prototype,"setGlobalScope",1),u([ft],EditorAPI.prototype,"getGlobalScope",1),u([ft],EditorAPI.prototype,"findAllSpotColors",1),u([ft],EditorAPI.prototype,"getSpotColorRGBA",1),u([ft],EditorAPI.prototype,"getSpotColorCMYK",1),u([mt],EditorAPI.prototype,"setSpotColorRGB",1),u([mt],EditorAPI.prototype,"setSpotColorCMYK",1),u([mt],EditorAPI.prototype,"removeSpotColor",1),u([mt],EditorAPI.prototype,"setSpotColorForCutoutType",1),u([mt],EditorAPI.prototype,"getSpotColorForCutoutType",1);var EventAPI=class{#e;constructor(e){this.#e=e}subscribe=(e,t)=>{Zt("blocks",e,Ut());const r=this.#e.subscribe(e,(e=>{try{t(Tt(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(r))}}},SceneAPI=class{#e;constructor(e){this.#e=e}async loadFromString(e){return Zt("sceneContent",e,Wt()),vt((t=>this.#e.loadSceneFromString(e,t)))}async loadFromURL(e){return Zt("url",e,Wt()),vt((t=>this.#e.loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return vt((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 rr([r],{type:tr.Zip}))}))}))}create(e="Free"){Zt("sceneLayout",e,Qt());return bt(this.#e.createScene(e))}createVideo(){return bt(this.#e.createVideoScene())}createFromImage(e,t=300,r=1,o="Free",n=0,i=!1){return Zt("url",e,Wt()),Zt("dpi",t,Gt(Ht(),0)),Zt("pixelScaleFactor",r,Gt(Ht(),0)),Zt("sceneLayout",o,Qt()),vt((a=>this.#e.createSceneFromImage(e,t,r,o,n,i,a)))}createFromVideo(e){return Zt("url",e,Wt()),vt((t=>this.#e.createSceneFromVideo(e,t)))}get(){const e=bt(this.#e.findByType("scene")),t=Tt(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return Zt("content",e,Wt()),vt((t=>this.#e.applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return Zt("url",e,Wt()),vt((t=>this.#e.applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return bt(this.#e.getSceneMode(e))}setDesignUnit(e){Zt("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return jt("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();bt(this.#e.setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return bt(this.#e.getDesignUnit(e))}getPages(){return Tt(bt(this.#e.getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=bt(this.#e.findNearestToViewPortCenterByType(e,"//ly.img.ubq/page")),r=Tt(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){Zt("type",e,Wt());const t=this.get();if(null==t)return[];const r=bt(this.#e.findNearestToViewPortCenterByType(t,e));return Tt(r)}findNearestToViewPortCenterByKind(e){Zt("kind",e,Wt());const t=this.get();if(null==t)return[];const r=bt(this.#e.findNearestToViewPortCenterByKind(t,e));return Tt(r)}setZoomLevel(e=1){const t=this.get();Zt("zoomLevel",e,Gt(Ht(),0)),this.#e.setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return bt(this.#e.getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,o=0,n=0){return Zt("id",e,Nt()),vt((i=>this.#e.zoomToBlock(e,t,r,o,n,i)))}enableZoomAutoFit(e,t,r=0,o=0,n=0,i=0){return Zt("id",e,Nt()),Zt("axis",t,function(){const e=["Horizontal","Vertical","Both"];return jt("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(Zt("paddingBefore",r,Ht()),Zt("paddingAfter",o,Ht()),bt(this.#e.enableZoomAutoFit(e,t,r,0,o,0))):"Vertical"===t?(Zt("paddingBefore",r,Ht()),Zt("paddingAfter",o,Ht()),bt(this.#e.enableZoomAutoFit(e,t,0,r,0,o))):(Zt("paddingLeft",r,Ht()),Zt("paddingTop",o,Ht()),Zt("paddingRight",n,Ht()),Zt("paddingBottom",i,Ht()),bt(this.#e.enableZoomAutoFit(e,t,r,o,n,i)))}disableZoomAutoFit(e){return Zt("blockOrScene",e,Nt()),bt(this.#e.disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return Zt("blockOrScene",e,Nt()),bt(this.#e.isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,o=0,n=0,i=0,a=0,s=0,u=0){return Zt("ids",e,Ut(Ht())),Zt("paddingLeft",t,Ht()),Zt("paddingTop",r,Ht()),Zt("paddingRight",o,Ht()),Zt("paddingBottom",n,Ht()),Zt("scaledPaddingLeft",t,Ht()),Zt("scaledPaddingTop",r,Ht()),Zt("scaledPaddingRight",o,Ht()),Zt("scaledPaddingBottom",n,Ht()),bt(this.#e.unstable_enableCameraPositionClamping(e,t,r,o,n,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,o=0,n=0,i=0,a=0){return Zt("ids",e,Ut(Ht())),Zt("minZoomLimit",t,Ht()),Zt("maxZoomLimit",r,Ht()),Zt("paddingLeft",o,Ht()),Zt("paddingTop",n,Ht()),Zt("paddingRight",i,Ht()),Zt("paddingBottom",a,Ht()),bt(this.#e.unstable_enableCameraZoomClamping(e,t,r,o,n,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_isCameraZoomClampingEnabled(e))}onZoomLevelChanged=e=>{const t=this.#e.subscribeToZoomLevel(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};onActiveChanged=e=>{const t=this.#e.subscribeToActiveSceneChange(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}}};function or(e,t){const r=new Set;function o(o){r.add(o);e?.(((e,...t)=>{o(e);for(const e of t)o(e)}));return()=>{r.delete(o),t?.()}}return o.emit=function(e,...t){for(const o of r){o(e);for(const e of t)o(e)}},o.handlers=r,o}u([mt],SceneAPI.prototype,"loadFromString",1),u([mt],SceneAPI.prototype,"loadFromURL",1),u([mt],SceneAPI.prototype,"create",1),u([mt],SceneAPI.prototype,"createVideo",1),u([mt],SceneAPI.prototype,"createFromImage",1),u([mt],SceneAPI.prototype,"createFromVideo",1),u([ft],SceneAPI.prototype,"get",1),u([mt],SceneAPI.prototype,"applyTemplateFromString",1),u([mt],SceneAPI.prototype,"applyTemplateFromURL",1),u([ft],SceneAPI.prototype,"getMode",1),u([mt],SceneAPI.prototype,"setDesignUnit",1),u([ft],SceneAPI.prototype,"getDesignUnit",1),u([ft],SceneAPI.prototype,"getPages",1),u([ft],SceneAPI.prototype,"getCurrentPage",1),u([ft],SceneAPI.prototype,"findNearestToViewPortCenterByType",1),u([ft],SceneAPI.prototype,"findNearestToViewPortCenterByKind",1),u([mt],SceneAPI.prototype,"setZoomLevel",1),u([ft],SceneAPI.prototype,"getZoomLevel",1),u([mt],SceneAPI.prototype,"zoomToBlock",1),u([mt],SceneAPI.prototype,"enableZoomAutoFit",1),u([mt],SceneAPI.prototype,"disableZoomAutoFit",1),u([ft],SceneAPI.prototype,"isZoomAutoFitEnabled",1);var nr=e=>t=>function(r){return t((function(t){r(e(t))}))};function ir(e){return t=>function(r){let o=!1;const n=t((function(e){o=!0,r(e)}));return o||r(e instanceof Function?e():e),n}}var ar=(e=((e,t)=>e===t))=>t=>function(r){let o;return t((function(t){e(t,o)||(o=t,r(t))}))},sr=e=>{const t=new Set;let r=null;return function(o){return t.add(o),null===r&&(r=e((function(e){t.forEach((t=>t(e)))}))),function(){t.delete(o),0===t.size&&(r?.(),r=null)}}};function ur(e,...t){return t.reduce(((e,t)=>t(e)),e)}var cr=(...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 lr(e){return function(t){let r=null;const o=e((function(e){r?.(),r=e?e(t):e}));return function(){o(),r?.(),r=null}}}function dr(...e){const t=Array.from(e);return function(e){const r=new Array(t.length),o=t.map(((t,o)=>t((function(t){r[o]=t,e(r)}))));return function(){o.forEach((e=>e())),r.length=0}}}var pr,hr,fr,mr,gr,yr,br,vr,wr,_r,Er,Sr=Symbol("NO_VALUE");function Cr(e){let t=Sr;const r=or();return{subscribe:r,value:()=>(t===Sr&&(t=e()),t),update(e){t=e,r.emit(t)}}}var kr=class{constructor(e){p(this,mr),p(this,yr),p(this,vr),p(this,_r),p(this,pr,void 0),p(this,hr,null),p(this,fr,void 0),c(this,"singlePageMode",f(this,yr,br).call(this,"features/singlePageModeEnabled")),c(this,"role"),c(this,"pageTitleShow",f(this,yr,br).call(this,"page/title/show")),c(this,"pageTitleshowPageTitleTemplate",f(this,yr,br).call(this,"page/title/showPageTitleTemplate")),c(this,"pageTitleAppendPageName",f(this,yr,br).call(this,"page/title/appendPageName")),c(this,"pageTitleShowOnSinglePage",f(this,yr,br).call(this,"page/title/showOnSinglePage")),c(this,"separator",f(this,_r,Er).call(this,"page/title/separator")),c(this,"pageTitleFont",f(this,_r,Er).call(this,"page/title/fontFileUri")),c(this,"dimOutOfPageAreas",f(this,yr,br).call(this,"page/dimOutOfPageAreas")),c(this,"singlePointPanning",f(this,yr,br).call(this,"touch/singlePointPanning")),c(this,"touchPinchAction",f(this,vr,wr).call(this,"touch/pinchAction")),c(this,"touchRotateAction",f(this,vr,wr).call(this,"touch/rotateAction")),c(this,"dragStartCanSelect",f(this,yr,br).call(this,"touch/dragStartCanSelect")),c(this,"featureHspSelectiveAdjustmentsEnabled",f(this,yr,br).call(this,"features/hspSelectiveAdjustmentsEnabled")),c(this,"featureLayerListEnabled",f(this,yr,br).call(this,"features/layerListEnabled")),c(this,"unstable_videoExportInactivityTimeout",Cr((()=>1e4))),h(this,pr,e);const t=or((()=>{1===t.handlers.size&&f(this,mr,gr).call(this)}),(()=>{var e;0===t.handlers.size&&(null==(e=d(this,hr))||e.call(this))}));h(this,fr,t),this.role={subscribe:ur((e=>d(this,pr).onRoleChanged(e)),ar(),sr),update:e=>{d(this,pr).setRole(e)},value:()=>d(this,pr).getRole()}}dispose(){var e;d(this,fr).handlers.clear(),null==(e=d(this,hr))||e.call(this)}};pr=new WeakMap,hr=new WeakMap,fr=new WeakMap,mr=new WeakSet,gr=function(){if(d(this,hr))throw new Error("Settings Changed Event callback is already registered.");const e=d(this,pr).onSettingsChanged((()=>{d(this,fr).emit()}));h(this,hr,(()=>{e(),h(this,hr,null)}))},yr=new WeakSet,br=function(e){const t=()=>d(this,pr).getSettingBool(e);return{subscribe:ur((e=>d(this,fr).call(this,e)),nr(t),ar(),sr),update:t=>{d(this,pr).setSettingBool(e,t),d(this,fr).emit()},value:t}},vr=new WeakSet,wr=function(e){const t=()=>d(this,pr).getSettingEnum(e);return{subscribe:ur((e=>d(this,fr).call(this,e)),nr(t),ar(),sr),update:t=>{d(this,pr).setSettingEnum(e,t),d(this,fr).emit()},value:t}},_r=new WeakSet,Er=function(e){const t=()=>d(this,pr).getSettingString(e);return{subscribe:ur((e=>d(this,fr).call(this,e)),nr(t),ar(),sr),update:t=>{d(this,pr).setSettingString(e,t),d(this,fr).emit()},value:t}};var VariableAPI=class{#e;constructor(e){this.#e=e}findAll(){return Tt(this.#e.findAllVariables())}setString(e,t){return Zt("key",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setVariableString(e,t))}getString(e){return Zt("key",e,Wt()),bt(this.#e.getVariableString(e))}remove(e){return Zt("key",e,Wt()),bt(this.#e.removeVariable(e))}};u([ft],VariableAPI.prototype,"findAll",1),u([mt],VariableAPI.prototype,"setString",1),u([ft],VariableAPI.prototype,"getString",1),u([mt],VariableAPI.prototype,"remove",1);var xr={Info:"Info",Warning:"Warning",Error:"Error"};function Tr(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)}}function Ar(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function Pr(e){return"/"!==e[e.length-1]?`${e}/`:e}var qr=async function(e,t,r=fetch,o,n=new Set(o.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),o=t.startsWith("/");return r&&o?`${e.substring(0,e.length-1)}${t}`:r||o?`${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;n.has(e)||o.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,o])=>{const n=o.toString();if(n.includes("{{base_url}}")){const o=n.replace("{{base_url}}",t);r.meta&&(r.meta[e]=o)}})),r.payload?.typeface&&r.payload.typeface.fonts.forEach((e=>{e.uri.includes("{{base_url}}")&&(e.uri=e.uri.replace("{{base_url}}",t))})),r.payload?.sourceSet&&r.payload.sourceSet.forEach((e=>{e.uri.includes("{{base_url}}")&&(e.uri=e.uri.replace("{{base_url}}",t))})),o.addAssetToSource(e,r)}))}))}));await Promise.all(i)};var Fr=async function(e,t,r,o){const n=["ly.img.sticker","ly.img.vectorpath","ly.img.colors.defaultPalette","ly.img.filter.lut","ly.img.filter.duotone","ly.img.effect","ly.img.blur","ly.img.typeface"].filter((e=>!r.includes(e)));await qr(n,t,o,e)};var Lr=async function(e,t,r,o,n,i,a="https://cdn.img.ly/assets/demo/v2"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!n||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"!==o||!n||r.includes(c)||s.has(c)||e.addLocalSource(c,["video/mp4","video/quicktime"]);const l="ly.img.audio.upload";"Video"!==o||!n||r.includes(l)||s.has(l)||e.addLocalSource(l,["audio/mpeg","audio/mp3","audio/x-m4a","audio/wav"]);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")),"Video"!==o||s.has("ly.img.video.template")||r.includes("ly.img.video.template")||(e.addLocalSource("ly.img.video.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.video.template")),await qr(d,a,i,e)};function Br(e,t){let r;const o=new Set;function n(){const o=window.devicePixelRatio,{width:i,height:a}=e.getBoundingClientRect();t(i*o,a*o,o),r=matchMedia(`(resolution: ${o}dppx)`),r.addEventListener("change",n,{once:!0})}n();const i=new ResizeObserver((function([e]){const{width:r,height:n}=e.target.getBoundingClientRect();if(r<=0||n<=0)return;const i=window.devicePixelRatio,a=setTimeout((function(){o.delete(a),t(r*i,n*i,i)}),0);o.add(a)}));return i.observe(e),()=>{r.removeEventListener("change",n),i.disconnect();for(const e of o)clearTimeout(e);o.clear(),e=null,t=null}}var Dr=s(tt()),Rr=(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))(Rr||{}),Mr=Rr,Ir=s(ut());function Or(e,t){const{block:r,event:o}=t;return ur((t=>{const n=r.getType(e),i=(0,Ir.default)(o.subscribe([e],(function(o){o.some((e=>"Destroyed"===e.type))&&!r.isValid(e)||r.getType(e)!==n?i():t(o)})));return i}),sr)}var jr=function(e,t,r,o){const n=function(e,t){if(!t)return e;let r;return(...o)=>{const n=e(...o);return t(n,r)||(r=n),r}}(t,o?.equals),i=or();return{subscribe:ur(cr(e,i),nr(n),ar(),sr),update:r,value:n,flush:()=>i.emit()}};var Ur=class{settings;clampCamera=!1;clampResult=Cr((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})));zoomLevel;#t;viewportPadding=Cr((()=>({x:40,y:48})));autoFit;scrollPercentage;sceneSize;scroll;constructor(e){const{block:t,scene:r,_ubq:o}=e,n=ur(r.onActiveChanged,ir(),nr((()=>r.get()))),i=ur(n,nr((r=>null!=r&&t.isValid(r)?ur(Or(r,e),ir([]),nr((()=>t.getFloat(r,"scene/dpi")))):()=>()=>{})),lr),a=ur(n,nr((()=>{const r=t.findByType("camera")[0];return null==r?()=>()=>{}:ur(Or(r,e),ir([]),nr((()=>r)))})),lr);this.settings={subscribe:ur(a,nr((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),ar(Dr.default),sr),update({width:e,height:r,pixelRatio:o}){const n=t.findByType("camera")[0];null!=n&&(t.setFloat(n,"camera/resolution/width",e),t.setFloat(n,"camera/resolution/height",r),t.setFloat(n,"camera/pixelRatio",o))},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=jr(cr(r.onZoomLevelChanged,i),(()=>{const e=r.get(),{pixelRatio:o}=this.settings.value();return null!=e&&t.isValid(e)?r.getZoomLevel()/o:1}),(e=>{const o=r.get(),{pixelRatio:n}=this.settings.value();null!=o&&t.isValid(o)&&r.setZoomLevel(e*n)})),this.#t={subscribe:ur(a,nr((e=>new yt(o).getValue(e,Mr.Camera,"zoomLevel"))),ar()),value(){const e=t.findByType("camera")[0];return null==e?1:new yt(o).getValue(e,Mr.Camera,"zoomLevel")}},this.autoFit=jr(r.onZoomLevelChanged,(()=>{const e=r.get();return null!=e&&r.isZoomAutoFitEnabled(e)})),this.scrollPercentage={subscribe:ur(this.clampResult.subscribe,nr((e=>e.scrollPercentage)),ar(Dr.default)),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:ur(dr(this.clampResult.subscribe,this.#t.subscribe,this.settings.subscribe),nr((([e,t,r])=>{const o=e?.sceneSize??this.clampResult.value().sceneSize??{x:0,y:0},n=t??this.#t.value()??10,i=r?.pixelRatio??this.settings.value().pixelRatio??1;return{x:o.x*n/i,y:o.y*n/i}})),ar(Dr.default)),value:()=>{const e=this.clampResult.value().sceneSize??{x:0,y:0},t=this.#t.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 o=this.#t.value(),n=this.settings.value().pixelRatio,i=e.x*n/o,a=e.y*n/o,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}},$r="apiFallbackTypefaces";function Nr(e,t,r=void 0){const o=e=>{bt(t.setContext("")),e.preventDefault()},n=e=>{bt(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",o,!1),e.addEventListener("webglcontextrestored",n,!1),()=>{e.removeEventListener("webglcontextlost",o),e.removeEventListener("webglcontextrestored",n)}}var Hr=!1;var Vr="https://api.img.ly/activate";var Wr=s(lt()),zr="./cesdk-v1.27.0-46BMFTP2.data",Gr="./cesdk-v1.27.0-T7MJDZHJ.wasm",Yr=Wr.default,Xr=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",Zr=-1!==Xr.indexOf("Edge"),Kr=!!Xr.match(/msie|trident/i),Qr=/\b(iPad|iPhone|iPod)\b/.test(Xr)&&/WebKit/.test(Xr)&&!/Edge/.test(Xr)&&("undefined"==typeof window||!("MSStream"in window)),Jr=(e,t)=>{if(null!=t){return[t,e.split("/").pop()].join("")}return new URL(e,window.location.origin)};function eo(){try{return new WebAssembly.Memory({initial:to(Qr?512:32),maximum:to(2048)})}catch(e){return new WebAssembly.Memory({initial:to(32),maximum:to(2048)})}}function to(e){return 1024*e*1024/65536}async function ro(e,t){const{core:r}=t,o=t.logger,n=Jr(Gr,r.baseURL).toString(),i=Jr(zr,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(Vr,{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")?n:e.endsWith(".data")?i:t+e,print:e=>{e&&"undefined"!==e&&o(e,"Info")},printErr:e=>{e&&"undefined"!==e&&o(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:eo()};Yr(c).then((async o=>{o.specialHTMLTargets["!canvas"]=e;o.emscripten_ubq_settings_forceWebGL1=Qr||!!t?.forceWebGL1;const n=bt(o.createEngine("!canvas",t.audioOutput??"auto"));!function(e,t){if(!t)throw new Error("Missing license key");bt(e.unlockWithLicense(t))}(n,await s),function(e,t){const r=new yt(e),o=new EditorAPI(e),n=new AssetAPI(e);o.setRole(t.role??"Creator"),Hr&&(r.execute("cesdk/getVersionInfo").then((e=>console.debug(e))),r.execute("cesdk/getCapabilitiesInfo").then((e=>console.debug(e)))),o.setSettingString("basePath",t.baseURL),o.setSettingBool("showBuildVersion",Hr||!1),t.featureFlags?.preventScrolling&&(o.setSettingBool("touch/singlePointPanning",!1),o.setSettingBool("touch/dragStartCanSelect",!1)),n.addLocalSource("ly.img.text"),function(){Hr&&(o.setSettingBool("features/hspSelectiveAdjustmentsEnabled",!1),o.setSettingBool("features/layerListEnabled",!1),o.setSettingBool("features/templatingEnabled",!0));const e=!!t.featureFlags?.singlePageMode;o.setSettingBool("features/singlePageModeEnabled",e),o.setSettingBool("features/effectsEnabled",!0)}(),function(){const t=new VariableAPI(e);(Hr||"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.startTracking(t.license,t.userId??"")}(n,t),r(n)})).catch(a)}))}async function oo(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 no=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?.()}},io=s(tt()),ao=Symbol("NO_VALUE"),so=class{callId;_value=ao;_lastUpdateValue=ao;_readFromEngine;constructor(e,t){this.callId=e,this._readFromEngine=t,this.read(),this._lastUpdateValue=this._value}readCachedValue(){return this._value===ao||this.revalidate?this.read():this._value}revalidate=!1;invalidate(){this.revalidate=!0}read(){const e=this._readFromEngine();return this.revalidate=!1,(0,io.default)(this._value,e)?this._value:(this._value=e,e)}updateValueAndCheckDirty(){try{const e=this.read(),t=this._lastUpdateValue!==e;return this._lastUpdateValue=e,t}catch{return this._lastUpdateValue=ao,!0}}update(e){this._readFromEngine=e}},uo=class{readCalls=new Map;registeredReactions=new Set;activeReactions=new Set;get isTracking(){return this.activeReactions.size>0}_getterCalled(e,t){if(this.isTracking){if(this.readCalls.has(e)){this.readCalls.get(e).update(t)}else this.readCalls.set(e,new so(e,t));for(const t of this.activeReactions)t.readCalls.add(e)}}_setterCalled(){for(const e of this.readCalls.values())e.invalidate()}read(e,t){return this.isTracking&&this.readCalls.has(e)?this.readCalls.get(e).readCachedValue():t()}#r=0;createReaction(e){return new no(this,e)}_registerReaction(e){this.registeredReactions.add(e)}_unregisterReaction(e){this.registeredReactions.delete(e)}_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)}#o=new Set;updateDirtyReactions(){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)if(!t.dirty)for(const r of t.readCalls)if(e.has(r)){t.dirty=!0;break}for(const e of this.registeredReactions)if(!this.#o.has(e)&&e.dirty)try{this.#o.add(e),e.update()}finally{e.dirty=!1,this.#o.delete(e)}this._cleanupReadCalls()}_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){gt[r]??=0;const o=gt[r]++;return function(...n){const i=this,a=`${r}${o}-${JSON.stringify(n,null,0)}`;function s(){return Reflect.apply(t,i,n)}return e._getterCalled(a,s),e.read(a,s)}}(this,e,t)}decorateObject(e){return function(e,t){const r=t.constructor?.name??crypto.randomUUID(),o=[];let n=!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)&&ht in a)if("getter"===i[ht].type){let a=function(...t){if(n)throw new Error("Disposed @getter proxy called");const o=this,a=`${r}-${s.toString()}-${JSON.stringify(t,null,0)}`;function u(){return Reflect.apply(i,o,t)}return e._getterCalled(a,u),e.read(a,u)};const u=Object.hasOwnProperty.call(t,"fnName")?()=>{t[s]=i}:()=>delete t[s];o.push(u),t[s]=a}else if("setter"===i[ht].type){let r=function(...t){if(n)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];o.push(a),t[s]=r}}var a;return function(){n=!0;for(const e of o)e();o.length=0}}(this,e)}dispose(){this.registeredReactions.forEach((e=>e.dispose())),this.registeredReactions.clear(),this.readCalls.clear(),this.activeReactions.clear()}},co='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 lo(e,t){let r;return t.onStateChanged((()=>{const o=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(!Kr&&!Zr)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 co;case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(o!==r){r=o;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:o});e.dispatchEvent(t)&&e.style.setProperty("cursor",o)}}))}var po=function(e,t,r,o){let n,i=null;const a=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||i?"Text"!==n&&i&&(i(),i=null):i=function(){const n=i();return()=>{n?.()};function i(){let n=!1,i="";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 a=u();l();const s=d();return e.parentElement.appendChild(a),p(),()=>{s(),c()};function u(){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 c(){a.blur(),a.remove()}function l(){const t=r.getTextCursorPositionInScreenSpaceX(),o=r.getTextCursorPositionInScreenSpaceY(),{left:n,top:i}=e.getBoundingClientRect();a.style.left=`${n+t/window.devicePixelRatio}px`,a.style.top=`${i+o/window.devicePixelRatio}px`}function d(){const t=e.getRootNode();a.addEventListener("input",v),a.addEventListener("keydown",_),a.addEventListener("copy",g),a.addEventListener("cut",y),a.addEventListener("compositionstart",E),a.addEventListener("compositionend",S),a.addEventListener("beforeinput",T),a.addEventListener("focusout",A),t.addEventListener("touchend",x),t.addEventListener("mousedown",x),t.addEventListener("mouseup",k);const o=r.onStateChanged((()=>{l()}));return()=>{a.removeEventListener("input",v),a.removeEventListener("keydown",_),a.removeEventListener("copy",g),a.removeEventListener("cut",y),a.removeEventListener("compositionstart",E),a.removeEventListener("compositionend",S),a.removeEventListener("beforeinput",T),a.removeEventListener("focusout",A),t.removeEventListener("mousedown",x),t.removeEventListener("mouseup",k),t.removeEventListener("touchend",x),o()}}function p(){null!==a.parentElement&&(a.focus(),h()||setTimeout((()=>a.focus()),0))}function h(){return a.getRootNode().activeElement===a}function f(e){return[...e].length}function m(e){const t=e.selectionEnd??e.selectionStart??0;return f(e.value.substring(0,t))}function g(e){try{t.useInternalAPI((t=>{const r=bt(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function y(e){try{t.useInternalAPI((r=>{const o=bt(r.getSelectedText());if(""!==o&&e.clipboardData){e.clipboardData.setData("text/plain",o),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 b(){return!(!n||t.ubq.unstable_isTextCursorInCompositionRange())&&(await S(),!0)}function v(e){const r=e.target,{value:o}=r;if(n){const e=m(a);t.execute("ubq/text/compositionUpdate",{value:o,cursorPosition:e})}else o.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 _(e){if(b(),1===e.key.length&&(i=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return n&&S(),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=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&&(a.value="")}async function E(){n=!0,await t.execute("ubq/text/compositionStart")}async function S(){n?(n=!1,a.value="",t.execute("ubq/text/compositionEnd")):a.value=""}async function C(){if(!n)return;o();if(await b())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),i=e.end-r.start,s=m(a);e.start>=r.start&&e.start<=1+r.end&&i!==s&&S()}async function k(){C()}async function x(t){C(),t.target===e&&"Text"===r.getEditMode()&&(p(),t.preventDefault())}async function T(e){if(n&&!e.isComposing&&S(),null===e.data)return;const r=e.target,o=e.data;if(await b())w(i);else if(n){const e=f(o);t.execute("ubq/text/compositionUpdate",{value:o,cursorPosition:e})}else o.length>0&&("\n"!==o[0]&&w(o),r.value="")}function A(e){if(F(e.relatedTarget)&&P(e.relatedTarget));else{q(e)}}function P(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}function q(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),o=e.dispatchEvent(r);return o&&p(),o}function F(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()=>{i?.(),a()}};function ho(e,t,r){const o=[],n=r=>{if("touch"===r.pointerType)return;const o=fo(e,r);t.execute("ubq/inputs/mousemove",o)},i=n=>{if("touch"===n.pointerType)return;const i={...fo(e,n),button:mo(n.button),state:0,shiftIsHeld:!!n.shiftKey};o[n.button]=!1,n.currentTarget.releasePointerCapture(n.pointerId),t.execute("ubq/inputs/mousebutton",i),r()},a=r=>{if("touch"===r.pointerType)return;const n={...fo(e,r),button:mo(r.button),state:1,shiftIsHeld:!!r.shiftKey};o[r.button]=!0,r.currentTarget.setPointerCapture(r.pointerId),t.execute("ubq/inputs/mousebutton",n)},s=r=>{if("touch"===r.pointerType)return;const n={...fo(e,r),shiftIsHeld:!!r.shiftKey};o.forEach(((e,r)=>{if(e){const e={...n,button:r,state:0};t.execute("ubq/inputs/mousebutton",e)}})),o.length=0},u=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",a),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),e.addEventListener("pointermove",n),e.addEventListener("lostpointercapture",s),e.addEventListener("touchmove",u,{passive:!1}),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),e.removeEventListener("pointermove",n),e.removeEventListener("lostpointercapture",s),e.removeEventListener("touchmove",u),e=null}}function fo(e,t){const r=e.getBoundingClientRect(),o=r?.top??0,n=r?.left??0;return{position:{x:(t.clientX-n)*window.devicePixelRatio,y:(t.clientY-o)*window.devicePixelRatio},isTouch:!1,timestamp:t.timeStamp}}function mo(e){switch(e){case 0:return 0;case 1:return 2;case 2:return 1;default:return 255}}var go=class{ubq;enabled;initialTarget;target;dispose;constructor(e,t){this.ubq=t,this.enabled=jr(e.editor.onSettingsChanged,(()=>{const t=e.editor.getSettingBool("mouse/enableZoom"),r=e.editor.getSettingBool("mouse/enableScroll");return t||r})),this.target=Cr((()=>{})),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=cr(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={...fo(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}}},yo=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 o=e.touches.item(r);t[r]=bo(o)}this.touches=t}touchUpdate(e){for(let t=0;t<e.touches.length;t++){const r=e.touches.item(t),o=this.touches.find((e=>e.identifier===r.identifier));if(!o)return;o.x=r.clientX,o.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,o],n){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 ${n} rgb(${t},${r},${o})`,i.style.borderRadius="50%",i.style.borderStyle=n,i.style.backgroundColor=`rgba(${t},${r},${o}, 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,o){if(!e){const[t,r,n]=o??[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},${n})`,e.style.borderStyle="dashed",e.style.backgroundColor=`rgba(${t},${r},${n}, 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(bo)}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 bo(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 vo=class _PanRecognizer extends yo{static PAN_THRESHOLD=10;makeEvent(e){const t=0===e.state?{x:0,y:0}:this.currentTransform;return{...e,panDistance:t}}calculateTransform(){const e=_o(this.touches),t=_o(this.baseTouches);return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return super.shouldStart()&&wo(this.calculateTransform())>_PanRecognizer.PAN_THRESHOLD}};function wo(e){return Math.sqrt(e.x**2+e.y**2)}function _o(e){let t=0,r=0;for(let o=0;o<e.length;o++){const n=e[o];t+=n.x,r+=n.y}return t/=e.length,r/=e.length,{x:t,y:r}}var Eo=class _PinchRecognizer extends yo{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}},So=class _PointRecognizer extends yo{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&&wo(this.calculateTransform())>_PointRecognizer.DISTANCE_THRESHOLD}shouldStop(){return 1!==this.touches.length}},Co=class _RotateRecognizer extends yo{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 ko(e,t){const r=[],o=new So;r.push(o.listen(e)),r.push(o.addListener((r=>{"button"in r?t.execute("ubq/inputs/mousebutton",xo(e,r)):t.execute("ubq/inputs/mousemove",xo(e,r))})));const n=new vo;r.push(n.listen(e)),r.push(n.addListener((r=>{t.execute("ubq/inputs/touchpan",xo(e,r))})));const i=new Eo;r.push(i.listen(e)),r.push(i.addListener((r=>{t.execute("ubq/inputs/touchpinch",xo(e,r))})));const a=new Co;return r.push(a.listen(e)),r.push(a.addListener((r=>{t.execute("ubq/inputs/touchrotate",xo(e,r))}))),()=>{r.forEach((e=>e()))}}function xo(e,t){const r=window.devicePixelRatio??1,{top:o,left:n}=e.getBoundingClientRect();if(1===r&&0===o&&0===n)return t;const i=e=>({x:(e.x-n)*r,y:(e.y-o)*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 To(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}var Ao,Po,qo="assets/core/worker-host-v1.27.0-WBISL7KQ.js",Fo="application/javascript";(Po=Ao||(Ao={})).start=function(e){return{...e,msg:"exportVideo"}},Po.abort=function(){return{msg:"exportVideoAbort"}},Po.finished=function(e){return{...e,msg:"exportVideoFinished"}},Po.error=function(e){return{...e,msg:"exportVideoError"}},Po.progress=function(e){return{...e,msg:"exportVideoProgress"}},Po.log=function(e){return{...e,msg:"exportLog"}};var Lo=class{configuration;constructor(e){this.configuration=e}async exportVideo(e,t,r,o,n,i){const{abortSignal:a,inactivityTimeout:s}=n??{},u=await async function(e){const t=qo.toString().split("/").pop(),r=await async function(e){if(!(e=e.toString()).includes("://")||e.includes(window.location.origin))return e;const t=`const _importScripts = importScripts;\n const _fixImports = (url) => new URL(url, '${new URL(e).href.split("/").slice(0,-1).join("/")}/').href;\n importScripts = (...urls) => _importScripts(...urls.map(_fixImports));`;return URL.createObjectURL(new Blob([`${t}importScripts("${e}")`],{type:Fo}))}(new URL(t,e.core.baseURL));return new Worker(r)}(this.configuration),c=function(e){return{baseURL:e.baseURL,license:e.license,core:e.core,role:e.role,presets:e.presets,featureFlags:e.featureFlags,forceWebGL1:e.forceWebGL1,audioOutput:e.audioOutput}}(this.configuration),l=new Promise(((e,t)=>{if(u.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?n?.onProgress?.(r.renderedFrames,r.encodedFrames,r.totalFrames):"exportLog"===r.msg?this.configuration.logger(r.message,r.logLevel):console.error("Unknown message received ",r)},a){let e=!1;const t=()=>{e||(e=!0,u.postMessage(Ao.abort()))};a.addEventListener("abort",t,{once:!0})}}));u.postMessage(Ao.start({sceneString:e,engineSettings:t,pluginURLs:r,config:c,exportOptions:o,workerOptions:i,inactivityTimeout:s}));const d=()=>{u.postMessage({msg:"setVisibility",visible:"visible"===document.visibilityState})};return document.addEventListener("visibilitychange",d),l.finally((()=>{u.terminate(),document.removeEventListener("visibilitychange",d)})),l}};var Bo=10,Do=1e4;globalThis.ubq_browserTabHidden=!0;var Ro={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 Mo(e,t,r){return async(o,n,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 o of r)switch(e.getSettingType(o)){case"Bool":t.set(o,e.getSettingBool(o));break;case"Int":t.set(o,e.getSettingInt(o));break;case"Float":t.set(o,e.getSettingFloat(o));break;case"String":t.set(o,e.getSettingString(o));break;case"Color":t.set(o,e.getSettingColor(o));break;case"Enum":t.set(o,e.getSettingEnum(o))}return t}(t.editor),l=t.settings.unstable_videoExportInactivityTimeout.value(),d=t.editor.getActiveLicense(),p={scopes:Object.fromEntries(t.editor.findAllScopes().map((e=>[e,t.editor.getGlobalScope(e)])))};try{p.trackingMetadata=t.editor.getTrackingMetadata()}catch{p.trackingMetadata=void 0}const h={block:o,width:a.targetWidth,height:a.targetHeight,...a};if(e.featureFlags?.exportWorker??1){return new Lo({...e,license:d}).exportVideo(u,c,r,h,{abortSignal:a.abortSignal,inactivityTimeout:l,onProgress:i},p)}return async function(e,t,r,o,n={},i,a){let s,u,c=0,l=null;const d=a?.visibility??Ro;globalThis.ubq_exportVideoTimeout=a?.inactivityTimeout;const p=d.subscribe((()=>{null!==l&&(l=Date.now()),globalThis.ubq_browserTabHidden=!d.value()}));let h=null;function f(){clearTimeout(u),p(),h?.()}try{let p=function(){if(!0===d.value()&&null!==l&&Date.now()-l>Do)s(new Error("Video export timed out due to inactivity."));else{if(c<Bo){for(const e of S)e.update?.(C);g.update()}u=setTimeout(p,1)}};const m=new OffscreenCanvas(64,64),g=await ro(m,{...e,audioOutput:"none"}),y=new AssetAPI(g),b=new SceneAPI(g),v=new BlockAPI(g),w=new EditorAPI(g),_=new EventAPI(g),E=new VariableAPI(g);if(h=()=>{g.delete()},function(e,t){for(const[r,o]of t)switch(e.getSettingType(r)){case"Bool":e.setSettingBool(r,o);break;case"Int":e.setSettingInt(r,o);break;case"Float":e.setSettingFloat(r,o);break;case"String":e.setSettingString(r,o);break;case"Color":e.setSettingColor(r,o);break;case"Enum":{const t=r,n=o;e.setSettingEnum(t,n)}}}(w,t),i?.trackingMetadata&&w.setTrackingMetadata(i.trackingMetadata),i?.scopes)for(const[e,t]of Object.entries(i.scopes))w.setGlobalScope(e,t);const S=await Promise.all(r.map((e=>oo(e)))),C={asset:y,block:v,scene:b,editor:w,event:_,variable:E};for(const e of S)e.initialize?.(C);const k=await b.loadFromString(o),x=n.block?v.getDuration(n.block):v.getTotalSceneDuration(b.get());p();const T=await new Promise(((t,r)=>{s=r,e.abortSignal?.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),g.exportVideoToBuffer(n.block??k,n.timeOffset??0,n.duration??x,tr.Mp4,((e,t,r)=>{c=e-t,l=Date.now(),a?.onProgress?.(e,t,r)}),(e=>{"error"in e?r(e.error):t(e)}),{h264Profile:n.h264Profile??77,h264Level:n.h264Level??52,framerate:n.framerate??30,useTargetSize:void 0!==n.width&&void 0!==n.height,targetWidth:n.width??0,targetHeight:n.height??0})})),A=new Uint8Array(T.byteLength);return A.set(T),f(),A}catch(e){throw f(),e}}(a.abortSignal?{...e,abortSignal:a.abortSignal}:e,c,r,u,h,p,{onProgress:i,visibility:gn,inactivityTimeout:l}).then((e=>new Blob([e],{type:tr.Mp4})))}}var Io,Oo,jo,Uo,$o,No,Ho,Vo,Wo,zo,Go,Yo,Xo,Zo,Ko,Qo,Jo,en,tn,rn,on,nn,an,sn,un,cn,ln,dn,pn,hn,fn,mn,gn={value:()=>"visible"===document.visibilityState,subscribe:ur((Io=document,Oo="visibilitychange",function(e){return Io.addEventListener(Oo,e),function(){Io.removeEventListener(Oo,e)}}),nr((()=>"visible"===document.visibilityState)))},CreativeEngine=class{constructor(e,t,r){p(this,Xo),p(this,Ko),p(this,tn),p(this,on),p(this,an),p(this,ln),p(this,pn),p(this,fn),c(this,"asset"),c(this,"block"),c(this,"editor"),c(this,"event"),c(this,"scene"),c(this,"variable"),p(this,jo,void 0),c(this,"reactor"),p(this,Uo,void 0),p(this,$o,void 0),p(this,No,void 0),p(this,Ho,void 0),p(this,Vo,void 0),p(this,Wo,[]),p(this,zo,[]),p(this,Go,void 0),p(this,Yo,[]),p(this,Jo,[]),p(this,en,void 0),p(this,un,(0,dt.default)(function(){f(this,pn,hn).call(this)}.bind(this),100,{leading:!0,trailing:!1})),p(this,cn,void 0),h(this,Go,e),h(this,$o,new yt(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),h(this,jo,new kr(this.editor)),h(this,Vo,new go(this,e)),d(this,Yo).push(d(this,Vo).dispose);const o=new uo;this.reactor=o;const n=[this.reactor.decorateObject(d(this,$o)),this.reactor.decorateObject(this.block),this.reactor.decorateObject(this.editor),this.reactor.decorateObject(this.scene),this.reactor.decorateObject(this.variable)],i=this.addPostUpdateCallback(o.updateDirtyReactions.bind(o));d(this,Yo).push((()=>{n.forEach((e=>e())),i(),this.reactor.dispose()})),this.block.exportVideo=Mo(r,{block:this.block,scene:this.scene,editor:this.editor,settings:d(this,jo)},d(this,Wo)),"getInternalCanvas"in t?(h(this,No,t.getInternalCanvas()),h(this,Ho,t)):h(this,No,t),h(this,Uo,new Ur(this)),f(this,tn,rn).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=r,this.helper=d(this,$o))}async unstable_addPlugin(e){null!=e.url&&d(this,Wo).push(e.url);const t=e.url?await oo(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)}d(this,zo).push(t)}unstable_setVideoExportInactivityTimeout(e){d(this,jo).unstable_videoExportInactivityTimeout.update(e)}addPostUpdateCallback(e){return d(this,Jo).push(e),()=>{const t=d(this,Jo).indexOf(e);-1!==t&&d(this,Jo).splice(t,1)}}setWheelEventTarget(e){return d(this,Vo).setTarget(e)}get element(){return d(this,Ho)}dispose(){d(this,Yo).forEach((e=>e())),f(this,ln,dn).call(this),this.asset.dispose(),h(this,No,null),d(this,Ho)?.dispose(),h(this,Ho,void 0),h(this,$o,null),this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,d(this,Jo).length=0,d(this,Go).delete(),h(this,Go,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 o="5b601ae0fd";let n;o&&console.log(`[CreativeEngine] Revision ${o}`),r||(n=function(){customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",class HTMLCreativeEngineCanvasElement extends HTMLElement{#n;constructor(){super(),this.#n=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.#n)}getInternalCanvas(){if(!this.#n)throw new Error("Internal canvas element is undefined");return this.#n}dispose(){this.#n?.remove(),this.#n=void 0}clear(){if(!this.#n)return;const e=this.#n.width;this.#n.width=1,this.#n.width=e}});return document.createElement("cesdk-canvas")}(),r=n.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.27.0/assets"){const r={...e,license:e.license??"",featureFlags:e.featureFlags??{},baseURL:e.baseURL??t,core:e.core??{baseURL:"core/"},logger:e.logger??Tr,presets:e.presets??{}};return r.baseURL=Ar(r.baseURL),r.baseURL=Pr(r.baseURL),r.core.baseURL=Ar(r.core.baseURL,r.baseURL),r.core.baseURL=Pr(r.core.baseURL),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"),e.presets?.typefaces&&t.push("config.presets.typefaces has been removed. Please use the AssetAPI to add typefaces instead and use `ui.typefaceLibraries` to populate the typeface selection dropdown in the UI."),t):t}(e))a.logger(t,"Warning");const s=new this(await ro(r,a),n??r,a);return function(e,t){if(e)try{const r=t.editor,o=t.asset;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 o=e.variables[r];t.variable.setString(r,String(o.value))}if(e.presets?.typefaces){o.addLocalSource($r);for(const[t,r]of Object.entries(e.presets.typefaces))o.addAssetToSource($r,{id:t,payload:{typeface:{name:r.family,fonts:r.fonts.map((e=>({subFamily:`${e.weight} ${e.style}`,style:e.style,uri:e.fontURL,weight:e.weight})))}}})}}catch(e){console.error(e)}}(e,s),s}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v3",excludeAssetSourceIds:t=[]}={}){return Fr(this.asset,e,t)}async addDemoAssetSources({baseURL:e="https://cdn.img.ly/assets/demo/v2",excludeAssetSourceIds:t=[],sceneMode:r="Design",withUploadAssetSources:o=!1}={}){return Lr(this.asset,this.scene,t,r,o,void 0,e)}get _ubq(){return d(this,Go)}get _camera(){return d(this,Uo)}get _helper(){return d(this,$o)}};jo=new WeakMap,Uo=new WeakMap,$o=new WeakMap,No=new WeakMap,Ho=new WeakMap,Vo=new WeakMap,Wo=new WeakMap,zo=new WeakMap,Go=new WeakMap,Yo=new WeakMap,Xo=new WeakSet,Zo=function(){if(!d(this,Ho))return;const e=d(this,Ho).getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,o=t.width*r,n=t.height*r;e.width!==o&&(e.width=o),e.height!==n&&(e.height=n)},Ko=new WeakSet,Qo=function(){const{width:e,height:t}=d(this,No),r="undefined"!=typeof window?window.devicePixelRatio:1,{height:o,width:n,pixelRatio:i}=d(this,Uo).settings.value();if(!(To(n,e,1e-4)&&To(o,t,1e-4)&&To(i,r,1e-4)||(d(this,Uo).settings.update({height:t,width:e,pixelRatio:r}),To(i,r,1e-4)||null===this.scene.get()))){const e=this.scene.getZoomLevel();this.scene.setZoomLevel(e*(r/i))}},Jo=new WeakMap,en=new WeakMap,tn=new WeakSet,rn=function(e=!0){f(this,on,nn).call(this,e),f(this,an,sn).call(this)},on=new WeakSet,nn=function(e=!0){let t,r=!1,o=0;if(d(this,en))return;const n=()=>{if(h(this,en,requestAnimationFrame(n)),!r)try{f(this,pn,hn).call(this,e),o=0}catch(e){throw o++,o>=10&&(console.error("Repeated exceptions in update loop. Stopping loop."),t?.(),f(this,ln,dn).call(this)),e}};h(this,en,requestAnimationFrame(n))},an=new WeakSet,sn=function(){if(e=d(this,No),!("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement))return;var e;const t=d(this,Ho)??d(this,No),r=f(this,pn,hn).bind(this,!1),o=[ho(t,d(this,$o),r),d(this,Vo).initialize(t),po(t,d(this,$o),this.editor,r),lo(t,this.editor),ko(t,d(this,$o)),Nr(d(this,No),d(this,Go),(()=>{d(this,No).width=d(this,No).width})),Br(t,d(this,un))];h(this,cn,(()=>{o.reverse().forEach((e=>e()))}))},un=new WeakMap,cn=new WeakMap,ln=new WeakSet,dn=function(){var e;null==(e=d(this,cn))||e.call(this),h(this,cn,void 0),d(this,en)&&(cancelAnimationFrame(d(this,en)),h(this,en,0))},pn=new WeakSet,hn=function(e=!0){for(const e of d(this,zo))e.update?.(this);if(e){1===this.block.findByType("scene").length&&f(this,fn,mn).call(this)}f(this,Xo,Zo).call(this),f(this,Ko,Qo).call(this),d(this,Go).update();for(const e of d(this,Jo))e()},fn=new WeakSet,mn=function(){if(d(this,Uo).clampCamera){const e={sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}};d(this,$o).execute("cesdk/clampCameraAndRender",{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y}).then((e=>{(0,pt.default)(d(this,Uo).clampResult.value(),e)||d(this,Uo).clampResult.update(e)}),(()=>{(0,pt.default)(d(this,Uo).clampResult.value(),e)||d(this,Uo).clampResult.update(e)}))}else d(this,$o).execute("ubq/render")};var yn=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},bn=1e4,vn=1e6;async function wn(){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,o)=>{setTimeout((()=>{o(new Error("Timed out during video export"))}),bn);const n=new VideoEncoder({output:()=>r(!0),error:e=>o(e)});n.configure(e);const i=new VideoFrame(t,{timestamp:0,duration:vn/e.framerate});n.encode(i,{keyFrame:!0}),i.close(),n.flush().then((()=>{"closed"!==n.state&&n.close()}))}))}async function _n(){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"))}),bn);const o=new AudioEncoder({output:()=>t(!0),error:r});o.configure(e);const n=1024,i=new Float32Array(n*e.numberOfChannels);for(let e=0;e<n;++e){const t=e/n;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:n,numberOfChannels:e.numberOfChannels,timestamp:t*n/e.sampleRate*vn,data:i});o.encode(r),r.close()}o.flush().then((()=>{"closed"!==o.state&&o.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 Sn(){return Promise.all([wn(),_n()]).then((e=>e.every((e=>e))),(()=>!1))}var Cn=function(){try{const e=!0,t=!0,r="globalThis"in window,o="BigInt"in window,n="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 yn()&&e&&t&&r&&o&&n&&i&&a&&s&&u&&c}catch{return!1}};export{xr as LogLevel,tr as MimeType,Lo as WorkerClient,CreativeEngine as default,Cn as supportsBrowser,En as supportsVideo,Sn as supportsVideoExport,yn as supportsWasm};
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,a=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},s=(a,s,u)=>(u=null!=a?e(n(a)):{},((e,n,a,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let u of o(n))i.call(e,u)||u===a||t(e,u,{get:()=>n[u],enumerable:!(s=r(n,u))||s.enumerable});return e})(!s&&a&&a.__esModule?u:t(u,"default",{value:a,enumerable:!0}),a)),u=(e,o,n,i)=>{for(var a,s=i>1?void 0:i?r(o,n):o,u=e.length-1;u>=0;u--)(a=e[u])&&(s=(i?a(o,n,s):a(s))||s);return i&&s&&t(o,n,s),s},c=(e,r,o)=>(((e,r,o)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o})(e,"symbol"!=typeof r?r+"":r,o),o),l=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},d=(e,t,r)=>(l(e,t,"read from private field"),r?r.call(e):t.get(e)),p=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h=(e,t,r,o)=>(l(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r),f=(e,t,r)=>(l(e,t,"access private method"),r),m=a({"../../../node_modules/lodash/isObject.js"(e,t){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}}),g=a({"../../../node_modules/lodash/_freeGlobal.js"(e,t){var r="object"==typeof global&&global&&global.Object===Object&&global;t.exports=r}}),y=a({"../../../node_modules/lodash/_root.js"(e,t){var r=g(),o="object"==typeof self&&self&&self.Object===Object&&self,n=r||o||Function("return this")();t.exports=n}}),b=a({"../../../node_modules/lodash/now.js"(e,t){var r=y();t.exports=function(){return r.Date.now()}}}),v=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}}}),w=a({"../../../node_modules/lodash/_baseTrim.js"(e,t){var r=v(),o=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}}}),_=a({"../../../node_modules/lodash/_Symbol.js"(e,t){var r=y().Symbol;t.exports=r}}),E=a({"../../../node_modules/lodash/_getRawTag.js"(e,t){var r=_(),o=Object.prototype,n=o.hasOwnProperty,i=o.toString,a=r?r.toStringTag:void 0;t.exports=function(e){var t=n.call(e,a),r=e[a];try{e[a]=void 0;var o=!0}catch(e){}var s=i.call(e);return o&&(t?e[a]=r:delete e[a]),s}}}),S=a({"../../../node_modules/lodash/_objectToString.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}}}),C=a({"../../../node_modules/lodash/_baseGetTag.js"(e,t){var r=_(),o=E(),n=S(),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)?o(e):n(e)}}}),k=a({"../../../node_modules/lodash/isObjectLike.js"(e,t){t.exports=function(e){return null!=e&&"object"==typeof e}}}),x=a({"../../../node_modules/lodash/isSymbol.js"(e,t){var r=C(),o=k();t.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}}}),T=a({"../../../node_modules/lodash/toNumber.js"(e,t){var r=w(),o=m(),n=x(),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(n(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(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=a({"../../../node_modules/lodash/debounce.js"(e,t){var r=m(),o=b(),n=T(),i=Math.max,a=Math.min;t.exports=function(e,t,s){var u,c,l,d,p,h,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var r=u,o=c;return u=c=void 0,f=t,d=e.apply(o,r)}function v(e){var r=e-h;return void 0===h||r>=t||r<0||g&&e-f>=l}function w(){var e=o();if(v(e))return _(e);p=setTimeout(w,function(e){var r=t-(e-h);return g?a(r,l-(e-f)):r}(e))}function _(e){return p=void 0,y&&u?b(e):(u=c=void 0,d)}function E(){var e=o(),r=v(e);if(u=arguments,c=this,h=e,r){if(void 0===p)return function(e){return f=e,p=setTimeout(w,t),m?b(e):d}(h);if(g)return clearTimeout(p),p=setTimeout(w,t),b(h)}return void 0===p&&(p=setTimeout(w,t)),d}return t=n(t)||0,r(s)&&(m=!!s.leading,l=(g="maxWait"in s)?i(n(s.maxWait)||0,t):l,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==p&&clearTimeout(p),f=0,u=h=c=p=void 0},E.flush=function(){return void 0===p?d:_(o())},E}}}),P=a({"../../../node_modules/lodash/_listCacheClear.js"(e,t){t.exports=function(){this.__data__=[],this.size=0}}}),q=a({"../../../node_modules/lodash/eq.js"(e,t){t.exports=function(e,t){return e===t||e!=e&&t!=t}}}),F=a({"../../../node_modules/lodash/_assocIndexOf.js"(e,t){var r=q();t.exports=function(e,t){for(var o=e.length;o--;)if(r(e[o][0],t))return o;return-1}}}),L=a({"../../../node_modules/lodash/_listCacheDelete.js"(e,t){var r=F(),o=Array.prototype.splice;t.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}}}),D=a({"../../../node_modules/lodash/_listCacheGet.js"(e,t){var r=F();t.exports=function(e){var t=this.__data__,o=r(t,e);return o<0?void 0:t[o][1]}}}),B=a({"../../../node_modules/lodash/_listCacheHas.js"(e,t){var r=F();t.exports=function(e){return r(this.__data__,e)>-1}}}),R=a({"../../../node_modules/lodash/_listCacheSet.js"(e,t){var r=F();t.exports=function(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}}}),M=a({"../../../node_modules/lodash/_ListCache.js"(e,t){var r=P(),o=L(),n=D(),i=B(),a=R();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),I=a({"../../../node_modules/lodash/_stackClear.js"(e,t){var r=M();t.exports=function(){this.__data__=new r,this.size=0}}}),O=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}}}),j=a({"../../../node_modules/lodash/_stackGet.js"(e,t){t.exports=function(e){return this.__data__.get(e)}}}),U=a({"../../../node_modules/lodash/_stackHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),$=a({"../../../node_modules/lodash/isFunction.js"(e,t){var r=C(),o=m();t.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}}}),N=a({"../../../node_modules/lodash/_coreJsData.js"(e,t){var r=y()["__core-js_shared__"];t.exports=r}}),H=a({"../../../node_modules/lodash/_isMasked.js"(e,t){var r,o=N(),n=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!n&&n in e}}}),V=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""}}}),W=a({"../../../node_modules/lodash/_baseIsNative.js"(e,t){var r=$(),o=H(),n=m(),i=V(),a=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,d=RegExp("^"+c.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!n(e)||o(e))&&(r(e)?d:a).test(i(e))}}}),z=a({"../../../node_modules/lodash/_getValue.js"(e,t){t.exports=function(e,t){return null==e?void 0:e[t]}}}),G=a({"../../../node_modules/lodash/_getNative.js"(e,t){var r=W(),o=z();t.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}}}),Y=a({"../../../node_modules/lodash/_Map.js"(e,t){var r=G()(y(),"Map");t.exports=r}}),X=a({"../../../node_modules/lodash/_nativeCreate.js"(e,t){var r=G()(Object,"create");t.exports=r}}),Z=a({"../../../node_modules/lodash/_hashClear.js"(e,t){var r=X();t.exports=function(){this.__data__=r?r(null):{},this.size=0}}}),K=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}}}),Q=a({"../../../node_modules/lodash/_hashGet.js"(e,t){var r=X(),o=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}}}),J=a({"../../../node_modules/lodash/_hashHas.js"(e,t){var r=X(),o=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}}}),ee=a({"../../../node_modules/lodash/_hashSet.js"(e,t){var r=X();t.exports=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}}}),te=a({"../../../node_modules/lodash/_Hash.js"(e,t){var r=Z(),o=K(),n=Q(),i=J(),a=ee();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),re=a({"../../../node_modules/lodash/_mapCacheClear.js"(e,t){var r=te(),o=M(),n=Y();t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(n||o),string:new r}}}}),oe=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}}}),ne=a({"../../../node_modules/lodash/_getMapData.js"(e,t){var r=oe();t.exports=function(e,t){var o=e.__data__;return r(t)?o["string"==typeof t?"string":"hash"]:o.map}}}),ie=a({"../../../node_modules/lodash/_mapCacheDelete.js"(e,t){var r=ne();t.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}}}),ae=a({"../../../node_modules/lodash/_mapCacheGet.js"(e,t){var r=ne();t.exports=function(e){return r(this,e).get(e)}}}),se=a({"../../../node_modules/lodash/_mapCacheHas.js"(e,t){var r=ne();t.exports=function(e){return r(this,e).has(e)}}}),ue=a({"../../../node_modules/lodash/_mapCacheSet.js"(e,t){var r=ne();t.exports=function(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}}}),ce=a({"../../../node_modules/lodash/_MapCache.js"(e,t){var r=re(),o=ie(),n=ae(),i=se(),a=ue();function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,t.exports=s}}),le=a({"../../../node_modules/lodash/_stackSet.js"(e,t){var r=M(),o=Y(),n=ce();t.exports=function(e,t){var i=this.__data__;if(i instanceof r){var a=i.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new n(a)}return i.set(e,t),this.size=i.size,this}}}),de=a({"../../../node_modules/lodash/_Stack.js"(e,t){var r=M(),o=I(),n=O(),i=j(),a=U(),s=le();function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u}}),pe=a({"../../../node_modules/lodash/_setCacheAdd.js"(e,t){t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}}),he=a({"../../../node_modules/lodash/_setCacheHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),fe=a({"../../../node_modules/lodash/_SetCache.js"(e,t){var r=ce(),o=pe(),n=he();function i(e){var t=-1,o=null==e?0:e.length;for(this.__data__=new r;++t<o;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=n,t.exports=i}}),me=a({"../../../node_modules/lodash/_arraySome.js"(e,t){t.exports=function(e,t){for(var r=-1,o=null==e?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1}}}),ge=a({"../../../node_modules/lodash/_cacheHas.js"(e,t){t.exports=function(e,t){return e.has(t)}}}),ye=a({"../../../node_modules/lodash/_equalArrays.js"(e,t){var r=fe(),o=me(),n=ge();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 p=u.get(e),h=u.get(t);if(p&&h)return p==t&&h==e;var f=-1,m=!0,g=2&i?new r:void 0;for(u.set(e,t),u.set(t,e);++f<l;){var y=e[f],b=t[f];if(a)var v=c?a(b,y,f,t,e,u):a(y,b,f,e,t,u);if(void 0!==v){if(v)continue;m=!1;break}if(g){if(!o(t,(function(e,t){if(!n(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}}}),be=a({"../../../node_modules/lodash/_Uint8Array.js"(e,t){var r=y().Uint8Array;t.exports=r}}),ve=a({"../../../node_modules/lodash/_mapToArray.js"(e,t){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,o){r[++t]=[o,e]})),r}}}),we=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}}}),_e=a({"../../../node_modules/lodash/_equalByTag.js"(e,t){var r=_(),o=be(),n=q(),i=ye(),a=ve(),s=we(),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 o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+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 h=a;case"[object Set]":var f=1&u;if(h||(h=s),e.size!=t.size&&!f)return!1;var m=p.get(e);if(m)return m==t;u|=2,p.set(e,t);var g=i(h(e),h(t),u,l,d,p);return p.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}}}),Ee=a({"../../../node_modules/lodash/_arrayPush.js"(e,t){t.exports=function(e,t){for(var r=-1,o=t.length,n=e.length;++r<o;)e[n+r]=t[r];return e}}}),Se=a({"../../../node_modules/lodash/isArray.js"(e,t){var r=Array.isArray;t.exports=r}}),Ce=a({"../../../node_modules/lodash/_baseGetAllKeys.js"(e,t){var r=Ee(),o=Se();t.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}}}),ke=a({"../../../node_modules/lodash/_arrayFilter.js"(e,t){t.exports=function(e,t){for(var r=-1,o=null==e?0:e.length,n=0,i=[];++r<o;){var a=e[r];t(a,r,e)&&(i[n++]=a)}return i}}}),xe=a({"../../../node_modules/lodash/stubArray.js"(e,t){t.exports=function(){return[]}}}),Te=a({"../../../node_modules/lodash/_getSymbols.js"(e,t){var r=ke(),o=xe(),n=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(e){return null==e?[]:(e=Object(e),r(i(e),(function(t){return n.call(e,t)})))}:o;t.exports=a}}),Ae=a({"../../../node_modules/lodash/_baseTimes.js"(e,t){t.exports=function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}}}),Pe=a({"../../../node_modules/lodash/_baseIsArguments.js"(e,t){var r=C(),o=k();t.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}}}),qe=a({"../../../node_modules/lodash/isArguments.js"(e,t){var r=Pe(),o=k(),n=Object.prototype,i=n.hasOwnProperty,a=n.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!a.call(e,"callee")};t.exports=s}}),Fe=a({"../../../node_modules/lodash/stubFalse.js"(e,t){t.exports=function(){return!1}}}),Le=a({"../../../node_modules/lodash/isBuffer.js"(e,t){var r=y(),o=Fe(),n="object"==typeof e&&e&&!e.nodeType&&e,i=n&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===n?r.Buffer:void 0,s=(a?a.isBuffer:void 0)||o;t.exports=s}}),De=a({"../../../node_modules/lodash/_isIndex.js"(e,t){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var o=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}}}),Be=a({"../../../node_modules/lodash/isLength.js"(e,t){t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}}),Re=a({"../../../node_modules/lodash/_baseIsTypedArray.js"(e,t){var r=C(),o=Be(),n=k(),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 n(e)&&o(e.length)&&!!i[r(e)]}}}),Me=a({"../../../node_modules/lodash/_baseUnary.js"(e,t){t.exports=function(e){return function(t){return e(t)}}}}),Ie=a({"../../../node_modules/lodash/_nodeUtil.js"(e,t){var r=g(),o="object"==typeof e&&e&&!e.nodeType&&e,n=o&&"object"==typeof t&&t&&!t.nodeType&&t,i=n&&n.exports===o&&r.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();t.exports=a}}),Oe=a({"../../../node_modules/lodash/isTypedArray.js"(e,t){var r=Re(),o=Me(),n=Ie(),i=n&&n.isTypedArray,a=i?o(i):r;t.exports=a}}),je=a({"../../../node_modules/lodash/_arrayLikeKeys.js"(e,t){var r=Ae(),o=qe(),n=Se(),i=Le(),a=De(),s=Oe(),u=Object.prototype.hasOwnProperty;t.exports=function(e,t){var c=n(e),l=!c&&o(e),d=!c&&!l&&i(e),p=!c&&!l&&!d&&s(e),h=c||l||d||p,f=h?r(e.length,String):[],m=f.length;for(var g in e)!t&&!u.call(e,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||f.push(g);return f}}}),Ue=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)}}}),$e=a({"../../../node_modules/lodash/_overArg.js"(e,t){t.exports=function(e,t){return function(r){return e(t(r))}}}}),Ne=a({"../../../node_modules/lodash/_nativeKeys.js"(e,t){var r=$e()(Object.keys,Object);t.exports=r}}),He=a({"../../../node_modules/lodash/_baseKeys.js"(e,t){var r=Ue(),o=Ne(),n=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return o(e);var t=[];for(var i in Object(e))n.call(e,i)&&"constructor"!=i&&t.push(i);return t}}}),Ve=a({"../../../node_modules/lodash/isArrayLike.js"(e,t){var r=$(),o=Be();t.exports=function(e){return null!=e&&o(e.length)&&!r(e)}}}),We=a({"../../../node_modules/lodash/keys.js"(e,t){var r=je(),o=He(),n=Ve();t.exports=function(e){return n(e)?r(e):o(e)}}}),ze=a({"../../../node_modules/lodash/_getAllKeys.js"(e,t){var r=Ce(),o=Te(),n=We();t.exports=function(e){return r(e,n,o)}}}),Ge=a({"../../../node_modules/lodash/_equalObjects.js"(e,t){var r=ze(),o=Object.prototype.hasOwnProperty;t.exports=function(e,t,n,i,a,s){var u=1&n,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:o.call(t,p)))return!1}var h=s.get(e),f=s.get(t);if(h&&f)return h==t&&f==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<l;){var y=e[p=c[d]],b=t[p];if(i)var v=u?i(b,y,p,t,e,s):i(y,b,p,e,t,s);if(!(void 0===v?y===b||a(y,b,n,i,s):v)){m=!1;break}g||(g="constructor"==p)}if(m&&!g){var w=e.constructor,_=t.constructor;w==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(m=!1)}return s.delete(e),s.delete(t),m}}}),Ye=a({"../../../node_modules/lodash/_DataView.js"(e,t){var r=G()(y(),"DataView");t.exports=r}}),Xe=a({"../../../node_modules/lodash/_Promise.js"(e,t){var r=G()(y(),"Promise");t.exports=r}}),Ze=a({"../../../node_modules/lodash/_Set.js"(e,t){var r=G()(y(),"Set");t.exports=r}}),Ke=a({"../../../node_modules/lodash/_WeakMap.js"(e,t){var r=G()(y(),"WeakMap");t.exports=r}}),Qe=a({"../../../node_modules/lodash/_getTag.js"(e,t){var r=Ye(),o=Y(),n=Xe(),i=Ze(),a=Ke(),s=C(),u=V(),c="[object Map]",l="[object Promise]",d="[object Set]",p="[object WeakMap]",h="[object DataView]",f=u(r),m=u(o),g=u(n),y=u(i),b=u(a),v=s;(r&&v(new r(new ArrayBuffer(1)))!=h||o&&v(new o)!=c||n&&v(n.resolve())!=l||i&&v(new i)!=d||a&&v(new a)!=p)&&(v=function(e){var t=s(e),r="[object Object]"==t?e.constructor:void 0,o=r?u(r):"";if(o)switch(o){case f:return h;case m:return c;case g:return l;case y:return d;case b:return p}return t}),t.exports=v}}),Je=a({"../../../node_modules/lodash/_baseIsEqualDeep.js"(e,t){var r=de(),o=ye(),n=_e(),i=Ge(),a=Qe(),s=Se(),u=Le(),c=Oe(),l="[object Arguments]",d="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(e,t,f,m,g,y){var b=s(e),v=s(t),w=b?d:a(e),_=v?d:a(t),E=(w=w==l?p:w)==p,S=(_=_==l?p:_)==p,C=w==_;if(C&&u(e)){if(!u(t))return!1;b=!0,E=!1}if(C&&!E)return y||(y=new r),b||c(e)?o(e,t,f,m,g,y):n(e,t,w,f,m,g,y);if(!(1&f)){var k=E&&h.call(e,"__wrapped__"),x=S&&h.call(t,"__wrapped__");if(k||x){var T=k?e.value():e,A=x?t.value():t;return y||(y=new r),g(T,A,f,m,y)}}return!!C&&(y||(y=new r),i(e,t,f,m,g,y))}}}),et=a({"../../../node_modules/lodash/_baseIsEqual.js"(e,t){var r=Je(),o=k();t.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,a,e,s))}}}),tt=a({"../../../node_modules/lodash/isEqual.js"(e,t){var r=et();t.exports=function(e,t){return r(e,t)}}}),rt=a({"../../../node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=a(e),r=t[0],o=t[1];return 3*(r+o)/4-o},e.toByteArray=function(e){var t,r,i=a(e),s=i[0],u=i[1],c=new n(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=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},e.fromByteArray=function(e){for(var t,o=e.length,n=o%3,i=[],a=16383,u=0,c=o-n;u<c;u+=a)i.push(s(e,u,u+a>c?c:u+a));1===n?(t=e[o-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[o-2]<<8)+e[o-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};var t,r=[],o=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,64;t<64;++t)r[t]=i[t],o[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,o){for(var n,i,a=[],s=t;s<o;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=n)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63}}),ot=a({"../../../node_modules/ieee754/index.js"(e){e.read=function(e,t,r,o,n){var i,a,s=8*n-o-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?n-1:0,p=r?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=o;l>0;a=256*a+e[t+d],d+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,o),i-=c}return(h?-1:1)*a*Math.pow(2,i-o)},e.write=function(e,t,r,o,n,i){var a,s,u,c=8*i-n-1,l=(1<<c)-1,d=l>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:i-1,f=o?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?p/u:p*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,n),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;e[r+h]=255&s,h+=f,s/=256,n-=8);for(a=a<<n|s,c+=n;c>0;e[r+h]=255&a,h+=f,a/=256,c-=8);e[r+h-f]|=128*m}}}),nt=a({"../../../node_modules/buffer/index.js"(e){var t=rt(),r=ot(),o="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 n=2147483647;function i(e){if(e>n)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|h(e,t),o=i(r),n=o.write(e,t);n!==r&&(o=o.slice(0,n));return o}(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 o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return a.from(o,t,r);var n=function(e){if(a.isBuffer(e)){var t=0|p(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(n)return n;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|p(e))}function l(e){for(var t=e.length<0?0:0|p(e.length),r=i(t),o=0;o<t;o+=1)r[o]=255&e[o];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 o;return o=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(o,a.prototype),o}function p(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function h(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,o=arguments.length>2&&!0===arguments[2];if(!o&&0===r)return 0;for(var n=!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(n)return o?-1:M(e).length;t=(""+t).toLowerCase(),n=!0}}function f(e,t,r){var o=!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 C(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}function g(e,t,r,o,n){if(0===e.length)return-1;if("string"==typeof r?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),U(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=a.from(t,o)),a.isBuffer(t))return 0===t.length?-1:y(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,o,n){var i,a=1,s=e.length,u=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){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(n){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,p=0;p<u;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function b(e,t,r,o){r=Number(r)||0;var n=e.length-r;o?(o=Number(o))>n&&(o=n):o=n;var i=t.length;o>i/2&&(o=i/2);for(var a=0;a<o;++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,o){return O(M(t,e.length-r),e,r,o)}function w(e,t,r,o){return O(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,o)}function _(e,t,r,o){return O(I(t),e,r,o)}function E(e,t,r,o){return O(function(e,t){for(var r,o,n,i=[],a=0;a<e.length&&!((t-=2)<0);++a)o=(r=e.charCodeAt(a))>>8,n=r%256,i.push(n),i.push(o);return i}(t,e.length-r),e,r,o)}function S(e,r,o){return 0===r&&o===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,o))}function C(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var i,a,s,u,c=e[n],l=null,d=c>239?4:c>223?3:c>191?2:1;if(n+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[n+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[n+1],a=e[n+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[n+1],a=e[n+2],s=e[n+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,o.push(l>>>10&1023|55296),l=56320|1023&l),o.push(l),n+=d}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);var r="",o=0;for(;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=k));return r}(o)}e.kMaxLength=n,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,o=t.length,n=0,i=Math.min(r,o);n<i;++n)if(e[n]!==t[n]){r=e[n],o=t[n];break}return r<o?-1:o<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 o=a.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var i=e[r];if(j(i,Uint8Array))n+i.length>o.length?a.from(i).copy(o,n):Uint8Array.prototype.set.call(o,i,n);else{if(!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(o,n)}n+=i.length}return o},a.byteLength=h,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?C(this,0,e):f.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+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(e,t,r,o,n){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===o&&(o=0),void 0===n&&(n=this.length),t<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(o>=n&&t>=r)return 0;if(o>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(o>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(i,s),c=this.slice(o,n),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,o){if(void 0===t)o="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)o=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===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){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 _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function x(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(127&e[n]);return o}function T(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(e[n]);return o}function A(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var n="",i=t;i<r;++i)n+=$[e[i]];return n}function P(e,t,r){for(var o=e.slice(t,r),n="",i=0;i<o.length-1;i+=2)n+=String.fromCharCode(o[i]+256*o[i+1]);return n}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,o,n,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}function L(e,t,r,o,n,i){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,o,n,i){return t=+t,o>>>=0,i||L(e,0,o,4),r.write(e,t,o,n,23,4),o+4}function B(e,t,o,n,i){return t=+t,o>>>=0,i||L(e,0,o,8),r.write(e,t,o,n,52,8),o+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 o=this.subarray(e,t);return Object.setPrototypeOf(o,a.prototype),o},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||q(e,t,this.length);for(var o=this[e],n=1,i=0;++i<t&&(n*=256);)o+=this[e+i]*n;return o},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||q(e,t,this.length);for(var o=this[e+--t],n=1;t>0&&(n*=256);)o+=this[e+--t]*n;return o},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 o=this[e],n=1,i=0;++i<t&&(n*=256);)o+=this[e+i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||q(e,t,this.length);for(var o=t,n=1,i=this[e+--o];o>0&&(n*=256);)i+=this[e+--o]*n;return i>=(n*=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,o){(e=+e,t>>>=0,r>>>=0,o)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i<r&&(n*=256);)this[t+i]=e/n&255;return t+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,r,o){(e=+e,t>>>=0,r>>>=0,o)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,i=1;for(this[t+n]=255&e;--n>=0&&(i*=256);)this[t+n]=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,o){if(e=+e,t>>>=0,!o){var n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}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,o){if(e=+e,t>>>=0,!o){var n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}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 B(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,o){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o<r&&(o=r),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t<o-r&&(o=e.length-t+r);var n=o-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,o):Uint8Array.prototype.set.call(e,this.subarray(r,o),t),n},a.prototype.fill=function(e,t,r,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!a.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===e.length){var n=e.charCodeAt(0);("utf8"===o&&n<128||"latin1"===o)&&(e=n)}}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,o),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 R=/[^+/0-9A-Za-z-_]/g;function M(e,t){var r;t=t||1/0;for(var o=e.length,n=null,i=[],a=0;a<o;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===o){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=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(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}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 o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}}),it=a({"../../../node_modules/lodash/toFinite.js"(e,t){var r=T(),o=1/0;t.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}}),at=a({"../../../node_modules/lodash/toInteger.js"(e,t){var r=it();t.exports=function(e){var t=r(e),o=t%1;return t==t?o?t-o:t:0}}}),st=a({"../../../node_modules/lodash/before.js"(e,t){var r=at();t.exports=function(e,t){var o;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=void 0),o}}}}),ut=a({"../../../node_modules/lodash/once.js"(e,t){var r=st();t.exports=function(e){return r(2,e)}}}),ct=a({"../../../esbuild/polyfill.noop.js"(){}}),lt=a({"../../../_builds/cesdk/wasm32-unknown-emscripten/Release/cesdk.js"(e,t){var r,o=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r||=__filename),function(e={}){var t,o,n,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)]},o=function(e){return function t(o){var n;"number"==typeof o&&(o=new Uint32Array(2*o)),ArrayBuffer.isView(o)||(o.constructor&&"ArrayBuffer"===o.constructor.name?o=new Uint32Array(o):(n=o,o=new Uint32Array(2*o.length)));var i=new Proxy({slice:(e,r)=>(r??=o.length,t(o.slice(2*e,2*r))),subarray:(e,r)=>t(o.subarray(2*e,2*r)),[Symbol.iterator]:function*(){for(var t=0;t<o.length/2;t++)yield e(o[2*t],o[2*t+1])},BYTES_PER_ELEMENT:2*o.BYTES_PER_ELEMENT,buffer:o.buffer,byteLength:o.byteLength,byteOffset:o.byteOffset,length:o.length/2,copyWithin:function(e,t,r){return o.copyWithin(2*e,2*t,2*r),i},set(e,t){if(t??=0,2*(e.length+t)>o.length)throw new RangeError("offset is out of bounds");for(var n=0;n<e.length;n++){var i=e[n],a=r(i);o.set(a,2*(t+n))}}},{get(t,r,n){if("string"!=typeof r||!/^\d+$/.test(r))return Reflect.get(t,r,n);var i=o[2*r],a=o[2*r+1];return e(i,a)},set(e,t,n,i){if("string"!=typeof t||!/^\d+$/.test(t))return Reflect.set(e,t,n,i);if("bigint"!=typeof n)throw new TypeError(`Cannot convert ${n} to a BigInt`);var a=r(n);return o.set(a,2*t),!0}});return n&&i.set(n),i}};globalThis.BigUint64Array=o(t),globalThis.BigInt64Array=o(e)}u.ready=new Promise(((e,r)=>{t=e,o=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,k("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,o=e.remote_package_size,n=null,i=u.getPreloadedPackage?u.getPreloadedPackage(r,o):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 o=e.files,a=0;a<o.length;++a)new r(o[a].start,o[a].end,o[a].audio||0).open("GET",o[a].filename);function s(o){t(o,"Loading data file failed."),t(o.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var n=new Uint8Array(o);r.prototype.byteArray=n;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):n=s}i||function(e,t,r,o){if("object"!=typeof process||"object"!=typeof process.versions||"string"!=typeof process.versions.node){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onprogress=function(r){var o=e,i=t;if(r.total&&(i=r.total),r.loaded){n.addedTotal?u.dataFileDownloads[o].loaded=r.loaded:(n.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[o]={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...")},n.onerror=function(t){throw new Error("NetworkError for: "+e)},n.onload=function(e){if(!(200==n.status||304==n.status||206==n.status||0==n.status&&n.response))throw new Error(n.statusText+" : "+n.responseURL);var t=n.response;r(t)},n.send(null)}else ct().readFile(e,(function(e,t){e?o(e):r(t.buffer)}))}(r,o,(function(e){n?(n(e),n=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:274413},{filename:"/ly.img.cesdk/icons/RotateIndicator.svg",start:274413,end:275394},{filename:"/ly.img.cesdk/icu/icudt74l.dat",start:275394,end:810498},{filename:"/ly.img.cesdk/presets/.keep",start:810498,end:810498},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:810498,end:814387},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:814387,end:820704},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:820704,end:825295},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:825295,end:835280},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:835280,end:835770},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:835770,end:838937},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:838937,end:841575},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:841575,end:842522},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:842522,end:843037},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:843037,end:844001},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:844001,end:846118},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:846118,end:847085},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:847085,end:847579},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:847579,end:861179},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:861179,end:861964},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:861964,end:862446},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:862446,end:865309},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:865309,end:865814},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:865814,end:866268},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:866268,end:867905},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:867905,end:868205},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:868205,end:868893},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:868893,end:869105},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:869105,end:869668},{filename:"/ly.img.cesdk/shaders/recolor.sksl",start:869668,end:871869},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:871869,end:874174},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:874174,end:874858},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:874858,end:875440},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:875440,end:876158},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:876158,end:876530}],remote_package_size:876530}),"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=n||(n={}))[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=n.PENDING,this.totalBytes=0,this.receivedLength=0,this.handle=e,this.uri=t,this.abortController=new AbortController,this.abortSignal=this.abortController.signal}async readChunks(e){let t=0;const r=[],o=e=>{r.push(e),t+=e.length,this.receivedLength=t};if(null==e);else if("getReader"in e){const t=e.getReader();for(;;){const{done:e,value:r}=await t.read();if(e)break;if(this.abortSignal.aborted)throw await t.cancel(),t.releaseLock(),new Error(this.abortSignal.reason);o(r)}t.releaseLock()}else{const t=()=>e.destroy(new Error(this.abortSignal.reason));this.abortSignal.addEventListener("abort",t,{once:!0});try{await new Promise(((t,r)=>{e.on("data",o),e.on("end",(()=>t())),e.on("error",(e=>r(e)))}))}finally{this.abortSignal.removeEventListener("abort",t)}}const n=new Uint8Array(t);let i=0;for(const e of r)n.set(e,i),i+=e.length;return this.finish(n)}abort(){this.isPending()&&this.abortController.abort("Fetch aborted")}isPending(){return this.state===n.PENDING}isError(){return this.state===n.ERROR}isFinished(){return this.state===n.FINISHED}isAllocated(){return this.state===n.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:n.ALLOCATED,resultAddress:t,resultLength:e});return Object.assign(this,r),r}return null}finish(e){const t=Object.assign(Object.assign({},this),{state:n.FINISHED,result:e,totalBytes:e.length});return Object.assign(this,t)}fail(e){const t=Object.assign(Object.assign({},this),{state:n.ERROR,error:e});return Object.assign(this,t)}}u.emscripten_ubq_asyncFetchManager=new class AsyncFetchManager{constructor(){this._nextHandle=0,this._nextHeaderHandle=0,this._processes=new Map,this._headers=new Map,this._fetchImpl=null}_fetch(e,t){return this._fetchImpl?this._fetchImpl(e,t):fetch(e,t)}setFetch(e){this._fetchImpl=e}getProcess(e){return this._processes.get(e)}deleteProcess(e){const t=this._processes.get(e);return(null==t?void 0:t.isPending())&&t.abort(),this._processes.delete(e)}clear(){for(const e of this._processes.values())e.isPending()&&e.abort();this._processes.clear(),this._headers.clear()}fetch(e,t,r,o,n,i,a,s,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)})):this._fetchRemote(p,e,o,n,i,a,s,c).catch((e=>{p.fail(e)})),p}async _fetchFile(e){if("undefined"!=typeof window)throw new Error("File URLs supported only in Node.JS");const t=ct(),{fileURLToPath:r}=ct(),o=t.createReadStream(r(e.uri));return e.readChunks(o)}async _fetchRemote(e,t,r,o,n,i,s,c){const l=u.UTF8ToString(s,c),d=this.getHeaders(r,o),p=t===a.POST?new Uint8Array(u.HEAPU8.buffer,n,i):void 0,h=await this._fetch(e.uri,{method:a[t],headers:d,body:p,mode:"cors",credentials:l,signal:e.abortSignal});if(h.status>=200&&h.status<=209){let t=0;return h.headers.has("Content-Length")&&(t=+h.headers.get("Content-Length")),e.totalBytes=t,e.readChunks(h.body)}return e.fail(h.statusText)}getHeaders(e,t){const r={};for(let o=0;o<t;o++){const t=u.getValue(e+4*o,"i32"),n=this._headers.get(t);r[n.key]=n.value}return r}createHeader(e,t,r,o){const n=u.UTF8ToString(e,t),i=u.UTF8ToString(r,o),a=this._nextHeaderHandle++;return this._headers.set(a,{key:n,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),o=u._malloc(t.length+1),n=u.HEAPU8.subarray(o,o+t.length+1);for(let e=0;e<t.length;e++)n[e]=t[e];n[t.length]=0,r[1]=o}else r[1]=0;return t},u.emscripten_ubq_codec_createVideoDecoder=function(e,t){const r=new VideoDecoder({output:o=>{const n=r.textures;let i=!1;if((r.shouldDropFrames||r.decodedFrames<r.requestedFrame||r.decodeQueueSize>=n.length)&&(i=!0),!i){var a=u.ctx;const e=r.decodedFrames%n.length,t=a.getParameter(a.TEXTURE_BINDING_2D);a.bindTexture(a.TEXTURE_2D,n[e]),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,o),a.bindTexture(a.TEXTURE_2D,t)}o.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 o=new AudioDecoder({output:n=>{if(o.flushing)return void n.close();const i=u.HEAPF32.subarray(e/4,e/4+r),a=u.HEAPF32.subarray(t/4,t/4+r),s=1===n.numberOfChannels?0:1;if("f32-planar"===n.format){let e=o.writtenFrames%r;if(e+n.numberOfFrames<=r)n.copyTo(i.subarray(e),{planeIndex:0,frameCount:n.numberOfFrames}),n.copyTo(a.subarray(e),{planeIndex:s,frameCount:n.numberOfFrames});else{const t=r-e;n.copyTo(i.subarray(e),{planeIndex:0,frameCount:t}),n.copyTo(a.subarray(e),{planeIndex:s,frameCount:t}),n.copyTo(i,{planeIndex:0,frameOffset:t}),n.copyTo(a,{planeIndex:s,frameOffset:t})}o.writtenFrames+=n.numberOfFrames}else if("s16-planar"===n.format)if(1===n.numberOfChannels){const e=new Int16Array(n.numberOfFrames);n.copyTo(e,{planeIndex:0});for(let t=0;t<n.numberOfFrames;t++){const n=e[t]/32768;let s=o.writtenFrames%r;i[s]=n,a[s]=n,o.writtenFrames++}}else{const e=new Int16Array(n.numberOfFrames),t=new Int16Array(n.numberOfFrames);n.copyTo(e,{planeIndex:0}),n.copyTo(t,{planeIndex:1});for(let s=0;s<n.numberOfFrames;s++){let n=o.writtenFrames%r;i[n]=e[s]/32768,a[n]=t[s]/32768,o.writtenFrames++}}else if("s16"===n.format){const e=new Int16Array(n.numberOfFrames*n.numberOfChannels);if(n.copyTo(e,{planeIndex:0}),1===n.numberOfChannels)for(let t=0;t<n.numberOfFrames;t++){const n=e[t]/32768;let s=o.writtenFrames%r;i[s]=n,a[s]=n,o.writtenFrames++}else for(let t=0;t<n.numberOfFrames;t++){let s=o.writtenFrames%r;i[s]=e[t*n.numberOfChannels+0]/32768,a[s]=e[t*n.numberOfChannels+1]/32768,o.writtenFrames++}}else console.error("Unsupported audio format:",n.format);n.close()},error:e=>{o.unexpectedError=e,console.error(e)}});return o.writtenFrames=0,o},u.emscripten_ubq_settings_forceWebGL1=!1;var c,l,d,p=Object.assign({},u),h=[],f="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";if(b){var w=ct(),_=ct();v=y?_.dirname(v)+"/":__dirname+"/",c=(e,t)=>(e=ee(e)?new URL(e):_.normalize(e),w.readFileSync(e,t?void 0:"utf8")),d=e=>{var t=c(e,!0);return t.buffer||(t=new Uint8Array(t)),t},l=(e,t,r,o=!0)=>{e=ee(e)?new URL(e):_.normalize(e),w.readFile(e,o?void 0:"utf8",((e,n)=>{e?r(e):t(o?n.buffer:n)}))},!u.thisProgram&&process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),h=process.argv.slice(2),m=(e,t)=>{throw process.exitCode=e,t}}else(g||y)&&(y?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),r&&(v=r),v=v.startsWith("blob:")?"":v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1),c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(d=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=(e,t,r)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{200==o.status||0==o.status&&o.response?t(o.response):r()},o.onerror=r,o.send(null)});var E,S,C=u.print||console.log.bind(console),k=u.printErr||console.error.bind(console);Object.assign(u,p),p=null,u.arguments&&(h=u.arguments),u.thisProgram&&(f=u.thisProgram),u.quit&&(m=u.quit),u.wasmBinary&&(E=u.wasmBinary),"object"!=typeof WebAssembly&&Z("no native wasm support detected");var x,T,A,P,q,F,L,D,B,R,M,I=!1;function O(e,t){e||Z(t)}function j(){var e=S.buffer;u.HEAP8=T=new Int8Array(e),u.HEAP16=P=new Int16Array(e),u.HEAPU8=A=new Uint8Array(e),u.HEAPU16=q=new Uint16Array(e),u.HEAP32=F=new Int32Array(e),u.HEAPU32=L=new Uint32Array(e),u.HEAPF32=D=new Float32Array(e),u.HEAPF64=M=new Float64Array(e),u.HEAP64=B=new BigInt64Array(e),u.HEAPU64=R=new BigUint64Array(e)}var U=u.INITIAL_MEMORY||16777216;S=u.wasmMemory?u.wasmMemory:new WebAssembly.Memory({initial:U/65536,maximum:32768}),j(),U=S.buffer.byteLength;var $=[],N=[],H=[],V=[],W=0,z=null,G=null;function Y(e){W++,u.monitorRunDependencies?.(W)}function X(e){if(W--,u.monitorRunDependencies?.(W),0==W&&(null!==z&&(clearInterval(z),z=null),G)){var t=G;G=null,t()}}function Z(e){u.onAbort?.(e),k(e="Aborted("+e+")"),I=!0,x=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}var K,Q,J=e=>e.startsWith("data:application/octet-stream;base64,"),ee=e=>e.startsWith("file://");function te(e){if(e==K&&E)return new Uint8Array(E);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}function re(e,t,r){return function(e){return E||!g&&!y||"function"!=typeof fetch?Promise.resolve().then((()=>te(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()})).catch((()=>te(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{k(`failed to asynchronously prepare wasm: ${e}`),Z(e)}))}J(K="cesdk.wasm")||(Q=K,K=u.locateFile?u.locateFile(Q,v):v+Q);var oe={2385072:(e,t,r,o,n)=>"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=o,window.miniaudio.device_state.started=n,miniaudio.devices=[],miniaudio.track_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(null==miniaudio.devices[t])return miniaudio.devices[t]=e,t;return miniaudio.devices.push(e),miniaudio.devices.length-1},miniaudio.untrack_device_by_index=function(e){for(miniaudio.devices[e]=null;miniaudio.devices.length>0&&null==miniaudio.devices[miniaudio.devices.length-1];)miniaudio.devices.pop()},miniaudio.untrack_device=function(e){for(var t=0;t<miniaudio.devices.length;++t)if(miniaudio.devices[t]==e)return miniaudio.untrack_device_by_index(t)},miniaudio.get_device_by_index=function(e){return miniaudio.devices[e]},miniaudio.unlock_event_types=function(){return["touchstart","touchend","click"]}(),miniaudio.unlock=function(){for(var e=0;e<miniaudio.devices.length;++e){var t=miniaudio.devices[e];null!=t&&null!=t.webaudio&&2===t.state&&t.webaudio.resume()}miniaudio.unlock_event_types.map((function(e){document.removeEventListener(e,miniaudio.unlock,!0)}))},miniaudio.unlock_event_types.map((function(e){document.addEventListener(e,miniaudio.unlock,!0)}))),window.miniaudio.referenceCount+=1,1),2387062:()=>{void 0!==window.miniaudio&&(window.miniaudio.referenceCount-=1,0===window.miniaudio.referenceCount&&delete window.miniaudio)},2387226:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,2387330:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},2387501:(e,t,r,o,n,i)=>{var a=e,s=t,c=r,l=o,d=n,p=i;if(void 0===window.miniaudio)return-1;var h={},f={};a==window.miniaudio.device_type.playback&&(f.sampleRate=c),h.webaudio=new(window.AudioContext||window.webkitAudioContext)(f),h.webaudio.suspend(),h.state=window.miniaudio.device_state.stopped;var m=0,g=s;return a!=window.miniaudio.device_type.playback&&(m=s),h.scriptNode=h.webaudio.createScriptProcessor(l,m,g),h.scriptNode.onaudioprocess=function(e){if(null!=h.intermediaryBufferView&&0!=h.intermediaryBufferView.length||(h.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),o=h.intermediaryBufferView,n=0;n<l;n+=1)o[n*s+t]=r[n];Du(p,l,d)}if(a==miniaudio.device_type.playback||a==miniaudio.device_type.duplex)for(Bu(p,l,d),t=0;t<e.outputBuffer.numberOfChannels;++t){var i=e.outputBuffer.getChannelData(t);for(o=h.intermediaryBufferView,n=0;n<l;n+=1)i[n]=o[n*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){h.streamNode=h.webaudio.createMediaStreamSource(e),h.streamNode.connect(h.scriptNode),h.scriptNode.connect(h.webaudio.destination)})).catch((function(e){console.log("Failed to get user media: "+e)})),a==miniaudio.device_type.playback&&h.scriptNode.connect(h.webaudio.destination),miniaudio.track_device(h)},2390284:e=>miniaudio.get_device_by_index(e).webaudio.sampleRate,2390350: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},2390715:e=>{miniaudio.untrack_device_by_index(e)},2390758:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.resume(),t.state=miniaudio.device_state.started},2390883:e=>{var t=miniaudio.get_device_by_index(e);t.webaudio.suspend(),t.state=miniaudio.device_state.stopped},2391009:()=>!!globalThis.ubq_browserTabHidden,2391055:()=>T.length};function ne(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ie=e=>{for(;e.length>0;)e.shift()(u)},ae=u.noExitRuntime||!0,se=[],ue=0;class ExceptionInfo{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){L[this.ptr+4>>2]=e}get_type(){return L[this.ptr+4>>2]}set_destructor(e){L[this.ptr+8>>2]=e}get_destructor(){return L[this.ptr+8>>2]}set_caught(e){e=e?1:0,T[this.ptr+12>>0]=e}get_caught(){return 0!=T[this.ptr+12>>0]}set_rethrown(e){e=e?1:0,T[this.ptr+13>>0]=e}get_rethrown(){return 0!=T[this.ptr+13>>0]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){L[this.ptr+16>>2]=e}get_adjusted_ptr(){return L[this.ptr+16>>2]}get_exception_ptr(){if(Wu(this.get_type()))return L[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var ce=e=>{var t=ue;if(!t)return Ru(0),0;var r=new ExceptionInfo(t);r.set_adjusted_ptr(t);var o=r.get_type();if(!o)return Ru(0),t;for(var n in e){var i=e[n];if(0===i||i===o)break;var a=r.ptr+16;if(Vu(i,o,a))return Ru(i),t}return Ru(o),t},le={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,o=e.length-1;o>=0;o--){var n=e[o];"."===n?e.splice(o,1):".."===n?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=le.isAbs(e),r="/"===e.substr(-1);return(e=le.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=le.splitPath(e),r=t[0],o=t[1];return r||o?(o&&(o=o.substr(0,o.length-1)),r+o):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=le.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return le.normalize(e.join("/"))},join2:(e,t)=>le.normalize(e+"/"+t)},de=e=>(de=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(b)try{var e=ct();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch(e){}Z("initRandomDevice")})())(e),pe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var o=r>=0?arguments[r]:Ce.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=le.isAbs(o)}return(t?"/":"")+(e=le.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=pe.resolve(e).substr(1),t=pe.resolve(t).substr(1);for(var o=r(e.split("/")),n=r(t.split("/")),i=Math.min(o.length,n.length),a=i,s=0;s<i;s++)if(o[s]!==n[s]){a=s;break}var u=[];for(s=a;s<o.length;s++)u.push("..");return(u=u.concat(n.slice(a))).join("/")}},he="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,fe=(e,t,r)=>{for(var o=t+r,n=t;e[n]&&!(n>=o);)++n;if(n-t>16&&e.buffer&&he)return he.decode(e.subarray(t,n));for(var i="";t<n;){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},me=[],ge=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);o<=127?t++:o<=2047?t+=2:o>=55296&&o<=57343?(t+=4,++r):t+=3}return t},ye=(e,t,r,o)=>{if(!(o>0))return 0;for(var n=r,i=r+o-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-n};function be(e,t,r){var o=r>0?r:ge(e)+1,n=new Array(o),i=ye(e,n,0,n.length);return t&&(n.length=i),n}var ve={ttys:[],init(){},shutdown(){},register(e,t){ve.ttys[e]={input:[],output:[],ops:t},Ce.registerDevice(e,ve.stream_ops)},stream_ops:{open(e){var t=ve.ttys[e.node.rdev];if(!t)throw new Ce.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,o,n){if(!e.tty||!e.tty.ops.get_char)throw new Ce.ErrnoError(60);for(var i=0,a=0;a<o;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Ce.ErrnoError(29)}if(void 0===s&&0===i)throw new Ce.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,n){if(!e.tty||!e.tty.ops.put_char)throw new Ce.ErrnoError(60);try{for(var i=0;i<o;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Ce.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:e=>(()=>{if(!me.length){var e=null;if(b){var t=Buffer.alloc(256),r=0,o=process.stdin.fd;try{r=w.readSync(o,t)}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;me=be(e,!0)}return me.shift()})(),put_char(e,t){null===t||10===t?(C(fe(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(C(fe(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(k(fe(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(k(fe(e.output,0)),e.output=[])}}},we=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Iu(65536,e);return t?((e,t)=>(A.fill(0,e,e+t),e))(t,e):0},_e={ops_table:null,mount:e=>_e.createNode(null,"/",16895,0),createNode(e,t,r,o){if(Ce.isBlkdev(r)||Ce.isFIFO(r))throw new Ce.ErrnoError(63);_e.ops_table||={dir:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr,lookup:_e.node_ops.lookup,mknod:_e.node_ops.mknod,rename:_e.node_ops.rename,unlink:_e.node_ops.unlink,rmdir:_e.node_ops.rmdir,readdir:_e.node_ops.readdir,symlink:_e.node_ops.symlink},stream:{llseek:_e.stream_ops.llseek}},file:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr},stream:{llseek:_e.stream_ops.llseek,read:_e.stream_ops.read,write:_e.stream_ops.write,allocate:_e.stream_ops.allocate,mmap:_e.stream_ops.mmap,msync:_e.stream_ops.msync}},link:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr,readlink:_e.node_ops.readlink},stream:{}},chrdev:{node:{getattr:_e.node_ops.getattr,setattr:_e.node_ops.setattr},stream:Ce.chrdev_stream_ops}};var n=Ce.createNode(e,t,r,o);return Ce.isDir(n.mode)?(n.node_ops=_e.ops_table.dir.node,n.stream_ops=_e.ops_table.dir.stream,n.contents={}):Ce.isFile(n.mode)?(n.node_ops=_e.ops_table.file.node,n.stream_ops=_e.ops_table.file.stream,n.usedBytes=0,n.contents=null):Ce.isLink(n.mode)?(n.node_ops=_e.ops_table.link.node,n.stream_ops=_e.ops_table.link.stream):Ce.isChrdev(n.mode)&&(n.node_ops=_e.ops_table.chrdev.node,n.stream_ops=_e.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n,e.timestamp=n.timestamp),n},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 o=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(o.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=Ce.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,Ce.isDir(e.mode)?t.size=4096:Ce.isFile(e.mode)?t.size=e.usedBytes:Ce.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&&_e.resizeFileStorage(e,t.size)},lookup(e,t){throw Ce.genericErrors[44]},mknod:(e,t,r,o)=>_e.createNode(e,t,r,o),rename(e,t,r){if(Ce.isDir(e.mode)){var o;try{o=Ce.lookupNode(t,r)}catch(e){}if(o)for(var n in o.contents)throw new Ce.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=Ce.lookupNode(e,t);for(var o in r.contents)throw new Ce.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r of Object.keys(e.contents))t.push(r);return t},symlink(e,t,r){var o=_e.createNode(e,t,41471,0);return o.link=r,o},readlink(e){if(!Ce.isLink(e.mode))throw new Ce.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,o,n){var i=e.node.contents;if(n>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,o);if(a>8&&i.subarray)t.set(i.subarray(n,n+a),r);else for(var s=0;s<a;s++)t[r+s]=i[n+s];return a},write(e,t,r,o,n,i){if(t.buffer===T.buffer&&(i=!1),!o)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+o),a.usedBytes=o,o;if(0===a.usedBytes&&0===n)return a.contents=t.slice(r,r+o),a.usedBytes=o,o;if(n+o<=a.usedBytes)return a.contents.set(t.subarray(r,r+o),n),o}if(_e.expandFileStorage(a,n+o),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+o),n);else for(var s=0;s<o;s++)a.contents[n+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,n+o),o},llseek(e,t,r){var o=t;if(1===r?o+=e.position:2===r&&Ce.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new Ce.ErrnoError(28);return o},allocate(e,t,r){_e.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,t,r,o,n){if(!Ce.isFile(e.node.mode))throw new Ce.ErrnoError(43);var i,a,s=e.node.contents;if(2&n||s.buffer!==T.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=we(t)))throw new Ce.ErrnoError(48);T.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(e,t,r,o,n)=>(_e.stream_ops.write(e,t,0,o,r,!1),0)}},Ee=u.preloadPlugins||[],Se=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ce={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=pe.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Ce.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),o=Ce.root,n="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(o=Ce.lookupNode(o,r[i]),n=le.join2(n,r[i]),Ce.isMountpoint(o)&&(!a||a&&t.follow_mount)&&(o=o.mounted.root),!a||t.follow)for(var s=0;Ce.isLink(o.mode);){var u=Ce.readlink(n);if(n=pe.resolve(le.dirname(n),u),o=Ce.lookupPath(n,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Ce.ErrnoError(32)}}return{path:n,node:o}},getPath(e){for(var t;;){if(Ce.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,o=0;o<t.length;o++)r=(r<<5)-r+t.charCodeAt(o)|0;return(e+r>>>0)%Ce.nameTable.length},hashAddNode(e){var t=Ce.hashName(e.parent.id,e.name);e.name_next=Ce.nameTable[t],Ce.nameTable[t]=e},hashRemoveNode(e){var t=Ce.hashName(e.parent.id,e.name);if(Ce.nameTable[t]===e)Ce.nameTable[t]=e.name_next;else for(var r=Ce.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Ce.mayLookup(e);if(r)throw new Ce.ErrnoError(r);for(var o=Ce.hashName(e.id,t),n=Ce.nameTable[o];n;n=n.name_next){var i=n.name;if(n.parent.id===e.id&&i===t)return n}return Ce.lookup(e,t)},createNode(e,t,r,o){var n=new Ce.FSNode(e,t,r,o);return Ce.hashAddNode(n),n},destroyNode(e){Ce.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)=>Ce.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!Ce.isDir(e.mode))return 54;var t=Ce.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Ce.lookupNode(e,t),20}catch(e){}return Ce.nodePermissions(e,"wx")},mayDelete(e,t,r){var o;try{o=Ce.lookupNode(e,t)}catch(e){return e.errno}var n=Ce.nodePermissions(e,"wx");if(n)return n;if(r){if(!Ce.isDir(o.mode))return 54;if(Ce.isRoot(o)||Ce.getPath(o)===Ce.cwd())return 10}else if(Ce.isDir(o.mode))return 31;return 0},mayOpen:(e,t)=>e?Ce.isLink(e.mode)?32:Ce.isDir(e.mode)&&("r"!==Ce.flagsToPermissionString(t)||512&t)?31:Ce.nodePermissions(e,Ce.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Ce.MAX_OPEN_FDS;e++)if(!Ce.streams[e])return e;throw new Ce.ErrnoError(33)},getStreamChecked(e){var t=Ce.getStream(e);if(!t)throw new Ce.ErrnoError(8);return t},getStream:e=>Ce.streams[e],createStream:(e,t=-1)=>(Ce.FSStream||(Ce.FSStream=function(){this.shared={}},Ce.FSStream.prototype={},Object.defineProperties(Ce.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 Ce.FSStream,e),-1==t&&(t=Ce.nextfd()),e.fd=t,Ce.streams[t]=e,e),closeStream(e){Ce.streams[e]=null},chrdev_stream_ops:{open(e){var t=Ce.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new Ce.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Ce.devices[e]={stream_ops:t}},getDevice:e=>Ce.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var o=r.pop();t.push(o),r.push.apply(r,o.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Ce.syncFSRequests++,Ce.syncFSRequests>1&&k(`warning: ${Ce.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ce.getMounts(Ce.root.mount),o=0;function n(e){return Ce.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,n(e));++o>=r.length&&n(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount(e,t,r){var o,n="/"===r,i=!r;if(n&&Ce.root)throw new Ce.ErrnoError(10);if(!n&&!i){var a=Ce.lookupPath(r,{follow_mount:!1});if(r=a.path,o=a.node,Ce.isMountpoint(o))throw new Ce.ErrnoError(10);if(!Ce.isDir(o.mode))throw new Ce.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,n?Ce.root=u:o&&(o.mounted=s,o.mount&&o.mount.mounts.push(s)),u},unmount(e){var t=Ce.lookupPath(e,{follow_mount:!1});if(!Ce.isMountpoint(t.node))throw new Ce.ErrnoError(28);var r=t.node,o=r.mounted,n=Ce.getMounts(o);Object.keys(Ce.nameTable).forEach((e=>{for(var t=Ce.nameTable[e];t;){var r=t.name_next;n.includes(t.mount)&&Ce.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(o);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var o=Ce.lookupPath(e,{parent:!0}).node,n=le.basename(e);if(!n||"."===n||".."===n)throw new Ce.ErrnoError(28);var i=Ce.mayCreate(o,n);if(i)throw new Ce.ErrnoError(i);if(!o.node_ops.mknod)throw new Ce.ErrnoError(63);return o.node_ops.mknod(o,n,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Ce.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Ce.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),o="",n=0;n<r.length;++n)if(r[n]){o+="/"+r[n];try{Ce.mkdir(o,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Ce.mknod(e,t,r)),symlink(e,t){if(!pe.resolve(e))throw new Ce.ErrnoError(44);var r=Ce.lookupPath(t,{parent:!0}).node;if(!r)throw new Ce.ErrnoError(44);var o=le.basename(t),n=Ce.mayCreate(r,o);if(n)throw new Ce.ErrnoError(n);if(!r.node_ops.symlink)throw new Ce.ErrnoError(63);return r.node_ops.symlink(r,o,e)},rename(e,t){var r,o,n=le.dirname(e),i=le.dirname(t),a=le.basename(e),s=le.basename(t);if(r=Ce.lookupPath(e,{parent:!0}).node,o=Ce.lookupPath(t,{parent:!0}).node,!r||!o)throw new Ce.ErrnoError(44);if(r.mount!==o.mount)throw new Ce.ErrnoError(75);var u,c=Ce.lookupNode(r,a),l=pe.relative(e,i);if("."!==l.charAt(0))throw new Ce.ErrnoError(28);if("."!==(l=pe.relative(t,n)).charAt(0))throw new Ce.ErrnoError(55);try{u=Ce.lookupNode(o,s)}catch(e){}if(c!==u){var d=Ce.isDir(c.mode),p=Ce.mayDelete(r,a,d);if(p)throw new Ce.ErrnoError(p);if(p=u?Ce.mayDelete(o,s,d):Ce.mayCreate(o,s))throw new Ce.ErrnoError(p);if(!r.node_ops.rename)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(c)||u&&Ce.isMountpoint(u))throw new Ce.ErrnoError(10);if(o!==r&&(p=Ce.nodePermissions(r,"w")))throw new Ce.ErrnoError(p);Ce.hashRemoveNode(c);try{r.node_ops.rename(c,o,s)}catch(e){throw e}finally{Ce.hashAddNode(c)}}},rmdir(e){var t=Ce.lookupPath(e,{parent:!0}).node,r=le.basename(e),o=Ce.lookupNode(t,r),n=Ce.mayDelete(t,r,!0);if(n)throw new Ce.ErrnoError(n);if(!t.node_ops.rmdir)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(o))throw new Ce.ErrnoError(10);t.node_ops.rmdir(t,r),Ce.destroyNode(o)},readdir(e){var t=Ce.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Ce.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Ce.lookupPath(e,{parent:!0}).node;if(!t)throw new Ce.ErrnoError(44);var r=le.basename(e),o=Ce.lookupNode(t,r),n=Ce.mayDelete(t,r,!1);if(n)throw new Ce.ErrnoError(n);if(!t.node_ops.unlink)throw new Ce.ErrnoError(63);if(Ce.isMountpoint(o))throw new Ce.ErrnoError(10);t.node_ops.unlink(t,r),Ce.destroyNode(o)},readlink(e){var t=Ce.lookupPath(e).node;if(!t)throw new Ce.ErrnoError(44);if(!t.node_ops.readlink)throw new Ce.ErrnoError(28);return pe.resolve(Ce.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Ce.lookupPath(e,{follow:!t}).node;if(!r)throw new Ce.ErrnoError(44);if(!r.node_ops.getattr)throw new Ce.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Ce.stat(e,!0),chmod(e,t,r){var o;if(!(o="string"==typeof e?Ce.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);o.node_ops.setattr(o,{mode:4095&t|-4096&o.mode,timestamp:Date.now()})},lchmod(e,t){Ce.chmod(e,t,!0)},fchmod(e,t){var r=Ce.getStreamChecked(e);Ce.chmod(r.node,t)},chown(e,t,r,o){var n;if(!(n="string"==typeof e?Ce.lookupPath(e,{follow:!o}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown(e,t,r){Ce.chown(e,t,r,!0)},fchown(e,t,r){var o=Ce.getStreamChecked(e);Ce.chown(o.node,t,r)},truncate(e,t){if(t<0)throw new Ce.ErrnoError(28);var r;if(!(r="string"==typeof e?Ce.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Ce.ErrnoError(63);if(Ce.isDir(r.mode))throw new Ce.ErrnoError(31);if(!Ce.isFile(r.mode))throw new Ce.ErrnoError(28);var o=Ce.nodePermissions(r,"w");if(o)throw new Ce.ErrnoError(o);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Ce.getStreamChecked(e);if(0==(2097155&r.flags))throw new Ce.ErrnoError(28);Ce.truncate(r.node,t)},utime(e,t,r){var o=Ce.lookupPath(e,{follow:!0}).node;o.node_ops.setattr(o,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Ce.ErrnoError(44);var o;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)o=e;else{e=le.normalize(e);try{o=Ce.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n=!1;if(64&t)if(o){if(128&t)throw new Ce.ErrnoError(20)}else o=Ce.mknod(e,r,0),n=!0;if(!o)throw new Ce.ErrnoError(44);if(Ce.isChrdev(o.mode)&&(t&=-513),65536&t&&!Ce.isDir(o.mode))throw new Ce.ErrnoError(54);if(!n){var i=Ce.mayOpen(o,t);if(i)throw new Ce.ErrnoError(i)}512&t&&!n&&Ce.truncate(o,0),t&=-131713;var a=Ce.createStream({node:o,path:Ce.getPath(o),flags:t,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!u.logReadFiles||1&t||(Ce.readFiles||(Ce.readFiles={}),e in Ce.readFiles||(Ce.readFiles[e]=1)),a},close(e){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Ce.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Ce.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ce.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,o,n){if(o<0||n<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(1==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.read)throw new Ce.ErrnoError(28);var i=void 0!==n;if(i){if(!e.seekable)throw new Ce.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,t,r,o,n);return i||(e.position+=a),a},write(e,t,r,o,n,i){if(o<0||n<0)throw new Ce.ErrnoError(28);if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(Ce.isDir(e.node.mode))throw new Ce.ErrnoError(31);if(!e.stream_ops.write)throw new Ce.ErrnoError(28);e.seekable&&1024&e.flags&&Ce.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new Ce.ErrnoError(70)}else n=e.position;var s=e.stream_ops.write(e,t,r,o,n,i);return a||(e.position+=s),s},allocate(e,t,r){if(Ce.isClosed(e))throw new Ce.ErrnoError(8);if(t<0||r<=0)throw new Ce.ErrnoError(28);if(0==(2097155&e.flags))throw new Ce.ErrnoError(8);if(!Ce.isFile(e.node.mode)&&!Ce.isDir(e.node.mode))throw new Ce.ErrnoError(43);if(!e.stream_ops.allocate)throw new Ce.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,o,n){if(0!=(2&o)&&0==(2&n)&&2!=(2097155&e.flags))throw new Ce.ErrnoError(2);if(1==(2097155&e.flags))throw new Ce.ErrnoError(2);if(!e.stream_ops.mmap)throw new Ce.ErrnoError(43);return e.stream_ops.mmap(e,t,r,o,n)},msync:(e,t,r,o,n)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,o,n):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Ce.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,o=Ce.open(e,t.flags),n=Ce.stat(e).size,i=new Uint8Array(n);return Ce.read(o,i,0,n,0),"utf8"===t.encoding?r=fe(i,0):"binary"===t.encoding&&(r=i),Ce.close(o),r},writeFile(e,t,r={}){r.flags=r.flags||577;var o=Ce.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(ge(t)+1),i=ye(t,n,0,n.length);Ce.write(o,n,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Ce.write(o,t,0,t.byteLength,void 0,r.canOwn)}Ce.close(o)},cwd:()=>Ce.currentPath,chdir(e){var t=Ce.lookupPath(e,{follow:!0});if(null===t.node)throw new Ce.ErrnoError(44);if(!Ce.isDir(t.node.mode))throw new Ce.ErrnoError(54);var r=Ce.nodePermissions(t.node,"x");if(r)throw new Ce.ErrnoError(r);Ce.currentPath=t.path},createDefaultDirectories(){Ce.mkdir("/tmp"),Ce.mkdir("/home"),Ce.mkdir("/home/web_user")},createDefaultDevices(){Ce.mkdir("/dev"),Ce.registerDevice(Ce.makedev(1,3),{read:()=>0,write:(e,t,r,o,n)=>o}),Ce.mkdev("/dev/null",Ce.makedev(1,3)),ve.register(Ce.makedev(5,0),ve.default_tty_ops),ve.register(Ce.makedev(6,0),ve.default_tty1_ops),Ce.mkdev("/dev/tty",Ce.makedev(5,0)),Ce.mkdev("/dev/tty1",Ce.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=de(e).byteLength),e[--t]);Ce.createDevice("/dev","random",r),Ce.createDevice("/dev","urandom",r),Ce.mkdir("/dev/shm"),Ce.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ce.mkdir("/proc");var e=Ce.mkdir("/proc/self");Ce.mkdir("/proc/self/fd"),Ce.mount({mount(){var t=Ce.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,o=Ce.getStreamChecked(r),n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return n.parent=n,n}},t}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?Ce.createDevice("/dev","stdin",u.stdin):Ce.symlink("/dev/tty","/dev/stdin"),u.stdout?Ce.createDevice("/dev","stdout",null,u.stdout):Ce.symlink("/dev/tty","/dev/stdout"),u.stderr?Ce.createDevice("/dev","stderr",null,u.stderr):Ce.symlink("/dev/tty1","/dev/stderr"),Ce.open("/dev/stdin",0),Ce.open("/dev/stdout",1),Ce.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{Ce.genericErrors[e]=new Ce.ErrnoError(e),Ce.genericErrors[e].stack="<generic error, no stack>"})),Ce.nameTable=new Array(4096),Ce.mount(_e,{},"/"),Ce.createDefaultDirectories(),Ce.createDefaultDevices(),Ce.createSpecialDirectories(),Ce.filesystems={MEMFS:_e}},init(e,t,r){Ce.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=t||u.stdout,u.stderr=r||u.stderr,Ce.createStandardStreams()},quit(){Ce.init.initialized=!1;for(var e=0;e<Ce.streams.length;e++){var t=Ce.streams[e];t&&Ce.close(t)}},findObject(e,t){var r=Ce.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(o=Ce.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 o=Ce.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=o.path,r.parentObject=o.node,r.name=le.basename(e),o=Ce.lookupPath(e,{follow:!t}),r.exists=!0,r.path=o.path,r.object=o.node,r.name=o.node.name,r.isRoot="/"===o.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,o){e="string"==typeof e?e:Ce.getPath(e);for(var n=t.split("/").reverse();n.length;){var i=n.pop();if(i){var a=le.join2(e,i);try{Ce.mkdir(a)}catch(e){}e=a}}return a},createFile(e,t,r,o,n){var i=le.join2("string"==typeof e?e:Ce.getPath(e),t),a=Se(o,n);return Ce.create(i,a)},createDataFile(e,t,r,o,n,i){var a=t;e&&(e="string"==typeof e?e:Ce.getPath(e),a=t?le.join2(e,t):e);var s=Se(o,n),u=Ce.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}Ce.chmod(u,146|s);var p=Ce.open(u,577);Ce.write(p,r,0,r.length,0,i),Ce.close(p),Ce.chmod(u,s)}},createDevice(e,t,r,o){var n=le.join2("string"==typeof e?e:Ce.getPath(e),t),i=Se(!!r,!!o);Ce.createDevice.major||(Ce.createDevice.major=64);var a=Ce.makedev(Ce.createDevice.major++,0);return Ce.registerDevice(a,{open(e){e.seekable=!1},close(e){o?.buffer?.length&&o(10)},read(e,t,o,n,i){for(var a=0,s=0;s<n;s++){var u;try{u=r()}catch(e){throw new Ce.ErrnoError(29)}if(void 0===u&&0===a)throw new Ce.ErrnoError(6);if(null==u)break;a++,t[o+s]=u}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,i){for(var a=0;a<n;a++)try{o(t[r+a])}catch(e){throw new Ce.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}}),Ce.mkdev(n,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=be(c(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Ce.ErrnoError(29)}},createLazyFile(e,t,r,o,n){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,o=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;n||(a=o);var s=this;s.setDataGetter((e=>{var t=e*a,n=(e+1)*a-1;if(n=Math.min(n,o-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>o-1)throw new Error("only "+o+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),o!==a&&n.setRequestHeader("Range","bytes="+e+"-"+t),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):be(n.responseText||"",!0)})(t,n)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&o||(a=o=1,o=this.getter(0).length,a=o,C("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=o,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=Ce.createFile(e,t,s,o,n);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,o,n){var i=e.node.contents;if(n>=i.length)return 0;var a=Math.min(i.length-n,o);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[n+s];else for(s=0;s<a;s++)t[r+s]=i.get(n+s);return a}return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return Ce.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,o,n)=>(Ce.forceLoadFile(u),l(e,t,r,o,n)),c.mmap=(e,t,r,o,n)=>{Ce.forceLoadFile(u);var i=we(t);if(!i)throw new Ce.ErrnoError(48);return l(e,T,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},ke=(e,t)=>e?fe(A,e,t):"",xe={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(le.isAbs(t))return t;var o;if(o=-100===e?Ce.cwd():xe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Ce.ErrnoError(44);return o}return le.join2(o,t)},doStat(e,t,r){var o=e(t);F[r>>2]=o.dev,F[r+4>>2]=o.mode,L[r+8>>2]=o.nlink,F[r+12>>2]=o.uid,F[r+16>>2]=o.gid,F[r+20>>2]=o.rdev,B[r+24>>3]=BigInt(o.size),F[r+32>>2]=4096,F[r+36>>2]=o.blocks;var n=o.atime.getTime(),i=o.mtime.getTime(),a=o.ctime.getTime();return B[r+40>>3]=BigInt(Math.floor(n/1e3)),L[r+48>>2]=n%1e3*1e3,B[r+56>>3]=BigInt(Math.floor(i/1e3)),L[r+64>>2]=i%1e3*1e3,B[r+72>>3]=BigInt(Math.floor(a/1e3)),L[r+80>>2]=a%1e3*1e3,B[r+88>>3]=BigInt(o.ino),0},doMsync(e,t,r,o,n){if(!Ce.isFile(t.node.mode))throw new Ce.ErrnoError(43);if(2&o)return 0;var i=A.slice(e,e+r);Ce.msync(t,i,n,r,o)},varargs:void 0,get(){var e=F[+xe.varargs>>2];return xe.varargs+=4,e},getp:()=>xe.get(),getStr:e=>ke(e),getStreamFromFD:e=>Ce.getStreamChecked(e)},Te={},Ae=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Pe(e){return this.fromWireType(F[e>>2])}var qe,Fe,Le,De={},Be={},Re={},Me=e=>{throw new qe(e)},Ie=(e,t,r)=>{function o(t){var o=r(t);o.length!==e.length&&Me("Mismatched type converter count");for(var n=0;n<e.length;++n)Ne(e[n],o[n])}e.forEach((function(e){Re[e]=t}));var n=new Array(t.length),i=[],a=0;t.forEach(((e,t)=>{Be.hasOwnProperty(e)?n[t]=Be[e]:(i.push(e),De.hasOwnProperty(e)||(De[e]=[]),De[e].push((()=>{n[t]=Be[e],++a===i.length&&o(n)})))})),0===i.length&&o(n)},Oe={},je=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Ue=e=>{for(var t="",r=e;A[r];)t+=Fe[A[r++]];return t},$e=e=>{throw new Le(e)};function Ne(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var o=t.name;if(e||$e(`type "${o}" must have a positive integer typeid pointer`),Be.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;$e(`Cannot register type '${o}' twice`)}if(Be[e]=t,delete Re[e],De.hasOwnProperty(e)){var n=De[e];delete De[e],n.forEach((e=>e()))}}(e,t,r)}var He,Ve=(e,t,r)=>{switch(t){case 1:return r?e=>T[e>>0]:e=>A[e>>0];case 2:return r?e=>P[e>>1]:e=>q[e>>1];case 4:return r?e=>F[e>>2]:e=>L[e>>2];case 8:return r?e=>B[e>>3]:e=>R[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},We=8,ze=e=>{$e(e.$$.ptrType.registeredClass.name+" instance already deleted")},Ge=!1,Ye=e=>{},Xe=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Ze=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var o=Ze(e,t,r.baseClass);return null===o?null:r.downcast(o)},Ke={},Qe=()=>Object.keys(ot).length,Je=()=>{var e=[];for(var t in ot)ot.hasOwnProperty(t)&&e.push(ot[t]);return e},et=[],tt=()=>{for(;et.length;){var e=et.pop();e.$$.deleteScheduled=!1,e.delete()}},rt=e=>{He=e,et.length&&He&&He(tt)},ot={},nt=(e,t)=>(t=((e,t)=>{for(void 0===t&&$e("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),ot[t]),it=(e,t)=>(t.ptrType&&t.ptr||Me("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Me("Both smartPtrType and smartPtr must be specified"),t.count={value:1},st(Object.create(e,{$$:{value:t,writable:!0}})));function at(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=nt(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var o=r.clone();return this.destructor(e),o}function n(){return this.isSmartPointer?it(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):it(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Ke[a];if(!s)return n.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Ze(t,this.registeredClass,i.registeredClass);return null===u?n.call(this):this.isSmartPointer?it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):it(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var st=e=>"undefined"==typeof FinalizationRegistry?(st=e=>e,e):(Ge=new FinalizationRegistry((e=>{Xe(e.$$)})),Ye=e=>Ge.unregister(e),(st=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Ge.register(e,r,e)}return e})(e));function ut(){}var lt=(e,t)=>Object.defineProperty(t,"name",{value:e}),dt=(e,t,r)=>{if(void 0===e[t].overloadTable){var o=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||$e(`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[o.argCount]=o}},pt=(e,t,r)=>{u.hasOwnProperty(e)?((void 0===r||void 0!==u[e].overloadTable&&void 0!==u[e].overloadTable[r])&&$e(`Cannot register public name '${e}' twice`),dt(u,e,e),u.hasOwnProperty(r)&&$e(`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 ht(e,t,r,o,n,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=o,this.baseClass=n,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}var ft=(e,t,r)=>{for(;t!==r;)t.upcast||$e(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function mt(e,t){if(null===t)return this.isReference&&$e(`null is not a valid ${this.name}`),0;t.$$||$e(`Cannot pass "${je(t)}" as a ${this.name}`),t.$$.ptr||$e(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ft(t.$$.ptr,r,this.registeredClass)}function gt(e,t){var r;if(null===t)return this.isReference&&$e(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||$e(`Cannot pass "${je(t)}" as a ${this.name}`),t.$$.ptr||$e(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&$e(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var o=t.$$.ptrType.registeredClass;if(r=ft(t.$$.ptr,o,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&$e("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:$e(`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 n=t.clone();r=this.rawShare(r,It.toHandle((()=>n.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:$e("Unsupporting sharing policy")}return r}function yt(e,t){if(null===t)return this.isReference&&$e(`null is not a valid ${this.name}`),0;t.$$||$e(`Cannot pass "${je(t)}" as a ${this.name}`),t.$$.ptr||$e(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&$e(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ft(t.$$.ptr,r,this.registeredClass)}function bt(e){return this.fromWireType(L[e>>2])}function vt(e,t,r,o,n,i,a,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=o,this.isSmartPointer=n,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,n||void 0!==t.baseClass?this.toWireType=gt:o?(this.toWireType=mt,this.destructorFunction=null):(this.toWireType=yt,this.destructorFunction=null)}var wt,_t,Et=(e,t,r)=>{u.hasOwnProperty(e)||Me("Replacing nonexistant public symbol"),void 0!==u[e].overloadTable&&void 0!==r?u[e].overloadTable[r]=t:(u[e]=t,u[e].argCount=r)},St=[],Ct=e=>{var t=St[e];return t||(e>=St.length&&(St.length=e+1),St[e]=t=wt.get(e)),t},kt=(e,t)=>{e=Ue(e);var r=Ct(t);return"function"!=typeof r&&$e(`unknown function pointer with signature ${e}: ${t}`),r},xt=e=>{var t=Mu(e),r=Ue(t);return Lu(t),r},Tt=(e,t)=>{var r=[],o={};throw t.forEach((function e(t){o[t]||Be[t]||(Re[t]?Re[t].forEach(e):(r.push(t),o[t]=!0))})),new _t(`${e}: `+r.map(xt).join([", "]))},At=(e,t)=>{for(var r=[],o=0;o<e;o++)r.push(L[t+4*o>>2]);return r};function Pt(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}function qt(e,t){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var r=lt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var o=new r,n=e.apply(o,t);return n instanceof Object?n:o}function Ft(e,t,r,o,n,i){var a=t.length;a<2&&$e("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=Pt(t),c="void"!==t[0].name,l=[e,$e,o,n,Ae,t[0],t[1]],d=0;d<a-2;++d)l.push(t[d+2]);if(!u)for(d=s?1:2;d<t.length;++d)null!==t[d].destructorFunction&&l.push(t[d].destructorFunction);let[p,h]=function(e,t,r,o){for(var n=Pt(e),i=e.length,a="",s="",u=0;u<i-2;++u)a+=(0!==u?", ":"")+"arg"+u,s+=(0!==u?", ":"")+"arg"+u+"Wired";var c=`\n return function (${a}) {\n if (arguments.length !== ${i-2}) {\n throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${i-2}');\n }`;n&&(c+="var destructors = [];\n");var l=n?"destructors":"null",d=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(t&&(c+="var thisWired = classParam['toWireType']("+l+", this);\n"),u=0;u<i-2;++u)c+="var arg"+u+"Wired = argType"+u+"['toWireType']("+l+", arg"+u+");\n",d.push("argType"+u);if(t&&(s="thisWired"+(s.length>0?", ":"")+s),c+=(r||o?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",n)c+="runDestructors(destructors);\n";else for(u=t?1:2;u<e.length;++u){var p=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(c+=p+"_dtor("+p+");\n",d.push(p+"_dtor"))}return r&&(c+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[d,c+="}\n"]}(t,s,c,i);p.push(h);var f=qt(Function,p).apply(null,l);return lt(e,f)}var Lt,Dt=e=>{const t=(e=e.trim()).indexOf("(");return-1!==t?e.substr(0,t):e},Bt=new class HandleAllocator{constructor(){this.allocated=[void 0],this.freelist=[]}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)}},Rt=e=>{e>=Bt.reserved&&0==--Bt.get(e).refcount&&Bt.free(e)},Mt=()=>{for(var e=0,t=Bt.reserved;t<Bt.allocated.length;++t)void 0!==Bt.allocated[t]&&++e;return e},It={toValue:e=>(e||$e("Cannot use deleted val. handle = "+e),Bt.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 Bt.allocate({refcount:1,value:e})}}},Ot={name:"emscripten::val",fromWireType:e=>{var t=It.toValue(e);return Rt(e),t},toWireType:(e,t)=>It.toHandle(t),argPackAdvance:We,readValueFromPointer:Pe,destructorFunction:null},jt=(e,t,r)=>{switch(t){case 1:return r?function(e){return this.fromWireType(T[e>>0])}:function(e){return this.fromWireType(A[e>>0])};case 2:return r?function(e){return this.fromWireType(P[e>>1])}:function(e){return this.fromWireType(q[e>>1])};case 4:return r?function(e){return this.fromWireType(F[e>>2])}:function(e){return this.fromWireType(L[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Ut=(e,t)=>{var r=Be[e];return void 0===r&&$e(t+" has unknown type "+xt(e)),r},$t=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(D[e>>2])};case 8:return function(e){return this.fromWireType(M[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Nt=(e,t,r)=>ye(e,A,t,r),Ht="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Vt=(e,t)=>{for(var r=e,o=r>>1,n=o+t/2;!(o>=n)&&q[o];)++o;if((r=o<<1)-e>32&&Ht)return Ht.decode(A.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=P[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Wt=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var o=t,n=(r-=2)<2*e.length?r/2:e.length,i=0;i<n;++i){var a=e.charCodeAt(i);P[t>>1]=a,t+=2}return P[t>>1]=0,t-o},zt=e=>2*e.length,Gt=(e,t)=>{for(var r=0,o="";!(r>=t/4);){var n=F[e+4*r>>2];if(0==n)break;if(++r,n>=65536){var i=n-65536;o+=String.fromCharCode(55296|i>>10,56320|1023&i)}else o+=String.fromCharCode(n)}return o},Yt=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var o=t,n=o+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)),F[t>>2]=a,(t+=4)+4>n)break}return F[t>>2]=0,t-o},Xt=e=>{for(var t=0,r=0;r<e.length;++r){var o=e.charCodeAt(r);o>=55296&&o<=57343&&++r,t+=4}return t},Zt=(e,t,r)=>{var o=[],n=e.toWireType(o,r);return o.length&&(L[t>>2]=It.toHandle(o)),n},Kt=[],Qt={},Jt=e=>{var t=Qt[e];return void 0===t?Ue(e):t},er=()=>"object"==typeof globalThis?globalThis:function(){return Function}()("return this")(),tr=(Reflect.construct,e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e)),rr=e=>e%4==0&&(e%100!=0||e%400==0),or=[0,31,60,91,121,152,182,213,244,274,305,335],nr=[0,31,59,90,120,151,181,212,243,273,304,334],ir=e=>(rr(e.getFullYear())?or:nr)[e.getMonth()]+e.getDate()-1,ar=e=>{var t=ge(e)+1,r=qu(t);return r&&Nt(e,r,t),r},sr=(e,t)=>{if(fr.mainLoop.timingMode=e,fr.mainLoop.timingValue=t,!fr.mainLoop.func)return 1;if(fr.mainLoop.running||(fr.mainLoop.running=!0),0==e)fr.mainLoop.scheduler=function(){var e=0|Math.max(0,fr.mainLoop.tickStartTime+t-Lt());setTimeout(fr.mainLoop.runner,e)},fr.mainLoop.method="timeout";else if(1==e)fr.mainLoop.scheduler=function(){fr.requestAnimationFrame(fr.mainLoop.runner)},fr.mainLoop.method="rAF";else if(2==e){if(void 0===fr.setImmediate)if("undefined"==typeof setImmediate){var r=[],o="setimmediate";addEventListener("message",(e=>{e.data!==o&&e.data.target!==o||(e.stopPropagation(),r.shift()())}),!0),fr.setImmediate=function(e){r.push(e),y?(void 0===u.setImmediates&&(u.setImmediates=[]),u.setImmediates.push(e),postMessage({target:o})):postMessage(o,"*")}}else fr.setImmediate=setImmediate;fr.mainLoop.scheduler=function(){fr.setImmediate(fr.mainLoop.runner)},fr.mainLoop.method="immediate"}return 0};Lt=()=>performance.now();var ur=e=>{if(e instanceof ne||"unwind"==e)return x;m(1,e)},cr=()=>ae||!1,lr=(e,t)=>{var r;x=e,x=r=e,cr()||(u.onExit?.(r),I=!0),m(r,new ne(r))},dr=lr,pr=e=>{if(!I)try{e(),(()=>{if(!cr())try{dr(x)}catch(e){ur(e)}})()}catch(e){ur(e)}},hr=(e,t)=>setTimeout((()=>{pr(e)}),t),fr={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){fr.mainLoop.scheduler=null,fr.mainLoop.currentlyRunningMainloop++},resume(){fr.mainLoop.currentlyRunningMainloop++;var e=fr.mainLoop.timingMode,t=fr.mainLoop.timingValue,r=fr.mainLoop.func;fr.mainLoop.func=null,((e,t,r,o,n)=>{O(!fr.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."),fr.mainLoop.func=e,fr.mainLoop.arg=o;var i=fr.mainLoop.currentlyRunningMainloop;function a(){return!(i<fr.mainLoop.currentlyRunningMainloop)}if(fr.mainLoop.running=!1,fr.mainLoop.runner=function(){if(!I)if(fr.mainLoop.queue.length>0){Date.now();var t=fr.mainLoop.queue.shift();if(t.func(t.arg),fr.mainLoop.remainingBlockers){var r=fr.mainLoop.remainingBlockers,o=r%1==0?r-1:Math.floor(r);t.counted?fr.mainLoop.remainingBlockers=o:(o+=.5,fr.mainLoop.remainingBlockers=(8*r+o)/9)}if(fr.mainLoop.updateStatus(),!a())return;setTimeout(fr.mainLoop.runner,0)}else a()&&(fr.mainLoop.currentFrameNumber=fr.mainLoop.currentFrameNumber+1|0,1==fr.mainLoop.timingMode&&fr.mainLoop.timingValue>1&&fr.mainLoop.currentFrameNumber%fr.mainLoop.timingValue!=0?fr.mainLoop.scheduler():(0==fr.mainLoop.timingMode&&(fr.mainLoop.tickStartTime=Lt()),fr.mainLoop.runIter(e),a()&&("object"==typeof SDL&&SDL.audio?.queueNewAudioData?.(),fr.mainLoop.scheduler())))},n||(t&&t>0?sr(0,1e3/t):sr(1,1),fr.mainLoop.scheduler()),r)throw"unwind"})(r,0,!1,fr.mainLoop.arg,!0),sr(e,t),fr.mainLoop.scheduler()},updateStatus(){if(u.setStatus){var e=u.statusMessage||"Please wait...",t=fr.mainLoop.remainingBlockers,r=fr.mainLoop.expectedBlockers;t?t<r?u.setStatus(e+" ("+(r-t)+"/"+r+")"):u.setStatus(e):u.setStatus("")}},runIter(e){if(!I){if(u.preMainLoop&&!1===u.preMainLoop())return;pr(e),u.postMainLoop?.()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(!fr.initted){fr.initted=!0;var e={canHandle:function(e){return!u.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,o){var n=new Blob([e],{type:fr.getMimetype(t)});n.size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:fr.getMimetype(t)}));var i=URL.createObjectURL(n),a=new Image;a.onload=()=>{O(a.complete,`Image ${t} could not be decoded`);var o=document.createElement("canvas");o.width=a.width,o.height=a.height,o.getContext("2d").drawImage(a,0,0),Eu[t]=o,URL.revokeObjectURL(i),r?.(e)},a.onerror=e=>{k(`Image ${i} could not be decoded`),o?.()},a.src=i}};Ee.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,o){var n=!1;function i(o){n||(n=!0,Su[t]=o,r?.(e))}var a=new Blob([e],{type:fr.getMimetype(t)}),s=URL.createObjectURL(a),u=new Audio;u.addEventListener("canplaythrough",(()=>i(u)),!1),u.onerror=function(r){n||(k(`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="",o=0,n=0,i=0;i<e.length;i++)for(o=o<<8|e[i],n+=8;n>=6;){var a=o>>n-6&63;n-=6,r+=t[a]}return 2==n?(r+=t[(3&o)<<4],r+="=="):4==n&&(r+=t[(15&o)<<2],r+="="),r}(e),i(u))},u.src=s,hr((()=>{i(u)}),1e4)}};Ee.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",o,!1),document.addEventListener("mozpointerlockchange",o,!1),document.addEventListener("webkitpointerlockchange",o,!1),document.addEventListener("mspointerlockchange",o,!1),u.elementPointerLock&&r.addEventListener("click",(e=>{!fr.pointerLock&&u.canvas.requestPointerLock&&(u.canvas.requestPointerLock(),e.preventDefault())}),!1))}function o(){fr.pointerLock=document.pointerLockElement===u.canvas||document.mozPointerLockElement===u.canvas||document.webkitPointerLockElement===u.canvas||document.msPointerLockElement===u.canvas}},createContext(e,t,r,o){if(t&&u.ctx&&e==u.canvas)return u.ctx;var n,i;if(t){var a={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(o)for(var s in o)a[s]=o[s];void 0!==gr&&(i=gr.createContext(e,a))&&(n=gr.getContext(i).GLctx)}else n=e.getContext("2d");return n?(r&&(t||O(void 0===_u,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),u.ctx=n,t&&gr.makeContextCurrent(i),u.useWebGL=t,fr.moduleContextCreatedCallbacks.forEach((e=>e())),fr.init()),n):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){fr.lockPointer=e,fr.resizeCanvas=t,void 0===fr.lockPointer&&(fr.lockPointer=!0),void 0===fr.resizeCanvas&&(fr.resizeCanvas=!1);var r=u.canvas;function o(){fr.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=fr.exitFullscreen,fr.lockPointer&&r.requestPointerLock(),fr.isFullscreen=!0,fr.resizeCanvas?fr.setFullscreenCanvasSize():fr.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),fr.resizeCanvas?fr.setWindowedCanvasSize():fr.updateCanvasDimensions(r)),u.onFullScreen?.(fr.isFullscreen),u.onFullscreen?.(fr.isFullscreen)}fr.fullscreenHandlersInstalled||(fr.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("MSFullscreenChange",o,!1));var n=document.createElement("div");r.parentNode.insertBefore(n,r),n.appendChild(r),n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||(n.webkitRequestFullscreen?()=>n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(n.webkitRequestFullScreen?()=>n.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),n.requestFullscreen()},exitFullscreen:()=>!!fr.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(0===fr.nextRAF)fr.nextRAF=t+1e3/60;else for(;t+2>=fr.nextRAF;)fr.nextRAF+=1e3/60;var r=Math.max(fr.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,fr.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,t)=>hr(e,t),safeRequestAnimationFrame:e=>fr.requestAnimationFrame((()=>{pr(e)})),getMimetype:e=>({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(e){window.getUserMedia||=navigator.getUserMedia||navigator.mozGetUserMedia,window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(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:{},calculateMouseCoords(e,t){var r=u.canvas.getBoundingClientRect(),o=u.canvas.width,n=u.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset,s=e-(i+r.left),c=t-(a+r.top);return{x:s*=o/r.width,y:c*=n/r.height}},setMouseCoords(e,t){const{x:r,y:o}=fr.calculateMouseCoords(e,t);fr.mouseMovementX=r-fr.mouseX,fr.mouseMovementY=o-fr.mouseY,fr.mouseX=r,fr.mouseY=o},calculateMouseEvent(e){if(fr.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?fr.mouseMovementX=fr.mouseMovementY=0:(fr.mouseMovementX=fr.getMovementX(e),fr.mouseMovementY=fr.getMovementY(e)),"undefined"!=typeof SDL?(fr.mouseX=SDL.mouseX+fr.mouseMovementX,fr.mouseY=SDL.mouseY+fr.mouseMovementY):(fr.mouseX+=fr.mouseMovementX,fr.mouseY+=fr.mouseMovementY);else{if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var t=e.touch;if(void 0===t)return;var r=fr.calculateMouseCoords(t.pageX,t.pageY);if("touchstart"===e.type)fr.lastTouches[t.identifier]=r,fr.touches[t.identifier]=r;else if("touchend"===e.type||"touchmove"===e.type){var o=fr.touches[t.identifier];o||=r,fr.lastTouches[t.identifier]=o,fr.touches[t.identifier]=r}return}fr.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=u.canvas;fr.resizeListeners.forEach((t=>t(e.width,e.height)))},setCanvasSize(e,t,r){var o=u.canvas;fr.updateCanvasDimensions(o,e,t),r||fr.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e|=8388608,F[SDL.screen>>2]=e}fr.updateCanvasDimensions(u.canvas),fr.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=L[SDL.screen>>2];e&=-8388609,F[SDL.screen>>2]=e}fr.updateCanvasDimensions(u.canvas),fr.updateResizeListeners()},updateCanvasDimensions(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var o=t,n=r;if(u.forcedAspectRatio&&u.forcedAspectRatio>0&&(o/n<u.forcedAspectRatio?o=Math.round(n*u.forcedAspectRatio):n=Math.round(o/u.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var i=Math.min(screen.width/o,screen.height/n);o=Math.round(o*i),n=Math.round(n*i)}fr.resizeCanvas?(e.width!=o&&(e.width=o),e.height!=n&&(e.height=n),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&&(o!=t||n!=r?(e.style.setProperty("width",o+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},mr={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode(e){mr.errorCode=e},chooseConfig(e,t,r,o,n){if(62e3!=e)return mr.setErrorCode(12296),0;if(t)for(;;){var i=F[t>>2];if(12321==i){var a=F[t+4>>2];mr.contextAttributes.alpha=a>0}else if(12325==i){var s=F[t+4>>2];mr.contextAttributes.depth=s>0}else if(12326==i){var u=F[t+4>>2];mr.contextAttributes.stencil=u>0}else if(12337==i){var c=F[t+4>>2];mr.contextAttributes.antialias=c>0}else if(12338==i)c=F[t+4>>2],mr.contextAttributes.antialias=1==c;else if(12544==i){var l=F[t+4>>2];mr.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&o||n?(n&&(F[n>>2]=1),r&&o>0&&(L[r>>2]=62002),mr.setErrorCode(12288),1):(mr.setErrorCode(12300),0)}},gr={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){gr.lastError||(gr.lastError=e)},getNewId:e=>{for(var t=gr.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:(e,t,r,o)=>{for(var n="",i=0;i<t;++i){var a=o?L[o+4*i>>2]:void 0;n+=ke(L[r+4*i>>2],a)}return n},createContext:(e,t)=>{if(!e.getContextSafariWebGL2Fixed){let t=function(t,r){var o=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==o instanceof WebGLRenderingContext?o:null};e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=t}var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?gr.registerContext(r,t):0},registerContext:(e,t)=>{var r=gr.getNewId(gr.contexts),o={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=o),gr.contexts[r]=o,r},makeContextCurrent:e=>(gr.currentContext=gr.contexts[e],u.ctx=_u=gr.currentContext?.GLctx,!(e&&!_u)),getContext:e=>gr.contexts[e],deleteContext:e=>{gr.currentContext===gr.contexts[e]&&(gr.currentContext=null),"object"==typeof iu&&iu.removeAllHandlersOnTarget(gr.contexts[e].GLctx.canvas),gr.contexts[e]&&gr.contexts[e].GLctx.canvas&&(gr.contexts[e].GLctx.canvas.GLctxObject=void 0),gr.contexts[e]=null}},yr=[],br=(e,t,r)=>{var o=((e,t)=>{var r;for(yr.length=0;r=A[e++];){var o=105!=r;t+=(o&=112!=r)&&t%8?4:0,yr.push(112==r?L[t>>2]:106==r?B[t>>3]:105==r?F[t>>2]:M[t>>3]),t+=o?8:4}return yr})(t,r);return oe[e].apply(null,o)},vr=function(e){_u.activeTexture(e)},wr=(e,t)=>{_u.attachShader(gr.programs[e],gr.shaders[t])},_r=(e,t)=>{_u.beginQuery(e,gr.queries[t])},Er=(e,t)=>{_u.disjointTimerQueryExt.beginQueryEXT(e,gr.queries[t])},Sr=function(e){_u.beginTransformFeedback(e)},Cr=(e,t,r)=>{_u.bindAttribLocation(gr.programs[e],t,ke(r))},kr=(e,t)=>{35051==e?_u.currentPixelPackBufferBinding=t:35052==e&&(_u.currentPixelUnpackBufferBinding=t),_u.bindBuffer(e,gr.buffers[t])},xr=(e,t,r)=>{_u.bindBufferBase(e,t,gr.buffers[r])},Tr=(e,t,r,o,n)=>{_u.bindBufferRange(e,t,gr.buffers[r],o,n)},Ar=(e,t)=>{_u.bindFramebuffer(e,gr.framebuffers[t])},Pr=(e,t)=>{_u.bindRenderbuffer(e,gr.renderbuffers[t])},qr=(e,t)=>{_u.bindSampler(e,gr.samplers[t])},Fr=(e,t)=>{_u.bindTexture(e,gr.textures[t])},Lr=(e,t)=>{_u.bindTransformFeedback(e,gr.transformFeedbacks[t])},Dr=e=>{_u.bindVertexArray(gr.vaos[e])},Br=Dr,Rr=Dr,Mr=function(e,t,r,o){_u.blendColor(e,t,r,o)},Ir=function(e){_u.blendEquation(e)},Or=function(e,t){_u.blendEquationSeparate(e,t)},jr=function(e,t){_u.blendFunc(e,t)},Ur=function(e,t,r,o){_u.blendFuncSeparate(e,t,r,o)},$r=function(e,t,r,o,n,i,a,s,u,c){_u.blitFramebuffer(e,t,r,o,n,i,a,s,u,c)},Nr=(e,t,r,o)=>{gr.currentContext.version>=2?r&&t?_u.bufferData(e,A,o,r,t):_u.bufferData(e,t,o):_u.bufferData(e,r?A.subarray(r,r+t):t,o)},Hr=(e,t,r,o)=>{gr.currentContext.version>=2?r&&_u.bufferSubData(e,t,A,o,r):_u.bufferSubData(e,t,A.subarray(o,o+r))},Vr=function(e){return _u.checkFramebufferStatus(e)},Wr=function(e){_u.clear(e)},zr=function(e,t,r,o){_u.clearBufferfi(e,t,r,o)},Gr=(e,t,r)=>{_u.clearBufferfv(e,t,D,r>>2)},Yr=(e,t,r)=>{_u.clearBufferiv(e,t,F,r>>2)},Xr=(e,t,r)=>{_u.clearBufferuiv(e,t,L,r>>2)},Zr=function(e,t,r,o){_u.clearColor(e,t,r,o)},Kr=function(e){_u.clearDepth(e)},Qr=function(e){_u.clearStencil(e)},Jr=(e,t,r)=>(r=Number(r),_u.clientWaitSync(gr.syncs[e],t,r)),eo=(e,t,r,o)=>{_u.colorMask(!!e,!!t,!!r,!!o)},to=e=>{_u.compileShader(gr.shaders[e])},ro=(e,t,r,o,n,i,a,s)=>{gr.currentContext.version>=2?_u.currentPixelUnpackBufferBinding||!a?_u.compressedTexImage2D(e,t,r,o,n,i,a,s):_u.compressedTexImage2D(e,t,r,o,n,i,A,s,a):_u.compressedTexImage2D(e,t,r,o,n,i,s?A.subarray(s,s+a):null)},oo=(e,t,r,o,n,i,a,s,u)=>{_u.currentPixelUnpackBufferBinding?_u.compressedTexImage3D(e,t,r,o,n,i,a,s,u):_u.compressedTexImage3D(e,t,r,o,n,i,a,A,u,s)},no=(e,t,r,o,n,i,a,s,u)=>{gr.currentContext.version>=2?_u.currentPixelUnpackBufferBinding||!s?_u.compressedTexSubImage2D(e,t,r,o,n,i,a,s,u):_u.compressedTexSubImage2D(e,t,r,o,n,i,a,A,u,s):_u.compressedTexSubImage2D(e,t,r,o,n,i,a,u?A.subarray(u,u+s):null)},io=(e,t,r,o,n,i,a,s,u,c,l)=>{_u.currentPixelUnpackBufferBinding?_u.compressedTexSubImage3D(e,t,r,o,n,i,a,s,u,c,l):_u.compressedTexSubImage3D(e,t,r,o,n,i,a,s,u,A,l,c)},ao=function(e,t,r,o,n){_u.copyBufferSubData(e,t,r,o,n)},so=function(e,t,r,o,n,i,a,s){_u.copyTexImage2D(e,t,r,o,n,i,a,s)},uo=function(e,t,r,o,n,i,a,s){_u.copyTexSubImage2D(e,t,r,o,n,i,a,s)},co=function(e,t,r,o,n,i,a,s,u){_u.copyTexSubImage3D(e,t,r,o,n,i,a,s,u)},lo=()=>{var e=gr.getNewId(gr.programs),t=_u.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,gr.programs[e]=t,e},po=e=>{var t=gr.getNewId(gr.shaders);return gr.shaders[t]=_u.createShader(e),t},ho=function(e){_u.cullFace(e)},fo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.buffers[o];n&&(_u.deleteBuffer(n),n.name=0,gr.buffers[o]=null,o==_u.currentPixelPackBufferBinding&&(_u.currentPixelPackBufferBinding=0),o==_u.currentPixelUnpackBufferBinding&&(_u.currentPixelUnpackBufferBinding=0))}},mo=(e,t)=>{for(var r=0;r<e;++r){var o=F[t+4*r>>2],n=gr.framebuffers[o];n&&(_u.deleteFramebuffer(n),n.name=0,gr.framebuffers[o]=null)}},go=e=>{if(e){var t=gr.programs[e];t?(_u.deleteProgram(t),t.name=0,gr.programs[e]=null):gr.recordError(1281)}},yo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.queries[o];n&&(_u.deleteQuery(n),gr.queries[o]=null)}},bo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.queries[o];n&&(_u.disjointTimerQueryExt.deleteQueryEXT(n),gr.queries[o]=null)}},vo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.renderbuffers[o];n&&(_u.deleteRenderbuffer(n),n.name=0,gr.renderbuffers[o]=null)}},wo=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.samplers[o];n&&(_u.deleteSampler(n),n.name=0,gr.samplers[o]=null)}},_o=e=>{if(e){var t=gr.shaders[e];t?(_u.deleteShader(t),gr.shaders[e]=null):gr.recordError(1281)}},Eo=e=>{if(e){var t=gr.syncs[e];t?(_u.deleteSync(t),t.name=0,gr.syncs[e]=null):gr.recordError(1281)}},So=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.textures[o];n&&(_u.deleteTexture(n),n.name=0,gr.textures[o]=null)}},Co=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2],n=gr.transformFeedbacks[o];n&&(_u.deleteTransformFeedback(n),n.name=0,gr.transformFeedbacks[o]=null)}},ko=(e,t)=>{for(var r=0;r<e;r++){var o=F[t+4*r>>2];_u.deleteVertexArray(gr.vaos[o]),gr.vaos[o]=null}},xo=ko,To=ko,Ao=function(e){_u.depthFunc(e)},Po=e=>{_u.depthMask(!!e)},qo=function(e,t){_u.depthRange(e,t)},Fo=(e,t)=>{_u.detachShader(gr.programs[e],gr.shaders[t])},Lo=function(e){_u.disable(e)},Do=e=>{_u.disableVertexAttribArray(e)},Bo=(e,t,r)=>{_u.drawArrays(e,t,r)},Ro=(e,t,r,o)=>{_u.drawArraysInstanced(e,t,r,o)},Mo=Ro,Io=Ro,Oo=Ro,jo=(e,t,r,o,n)=>{_u.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,o,n)},Uo=Ro,$o=Ro,No=[],Ho=(e,t)=>{for(var r=No[e],o=0;o<e;o++)r[o]=F[t+4*o>>2];_u.drawBuffers(r)},Vo=Ho,Wo=Ho,zo=Ho,Go=(e,t,r,o)=>{_u.drawElements(e,t,r,o)},Yo=Go,Xo=(e,t,r,o,n)=>{_u.drawElementsInstanced(e,t,r,o,n)},Zo=Xo,Ko=Xo,Qo=Xo,Jo=(e,t,r,o,n,i,a)=>{_u.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,o,n,i,a)},en=Xo,tn=Xo,rn=(e,t,r,o,n,i)=>{Go(e,o,n,i)},on=function(e){_u.enable(e)},nn=e=>{_u.enableVertexAttribArray(e)},an=function(e){_u.endQuery(e)},sn=e=>{_u.disjointTimerQueryExt.endQueryEXT(e)},un=function(){_u.endTransformFeedback()},cn=(e,t)=>{var r=_u.fenceSync(e,t);if(r){var o=gr.getNewId(gr.syncs);return r.name=o,gr.syncs[o]=r,o}return 0},ln=function(){_u.finish()},dn=function(){_u.flush()},pn=(e,t,r,o)=>{_u.framebufferRenderbuffer(e,t,r,gr.renderbuffers[o])},hn=(e,t,r,o,n)=>{_u.framebufferTexture2D(e,t,r,gr.textures[o],n)},fn=(e,t,r,o,n)=>{_u.framebufferTextureLayer(e,t,gr.textures[r],o,n)},mn=function(e){_u.frontFace(e)},gn=(e,t,r,o)=>{for(var n=0;n<e;n++){var i=_u[r](),a=i&&gr.getNewId(o);i?(i.name=a,o[a]=i):gr.recordError(1282),F[t+4*n>>2]=a}},yn=(e,t)=>{gn(e,t,"createBuffer",gr.buffers)},bn=(e,t)=>{gn(e,t,"createFramebuffer",gr.framebuffers)},vn=(e,t)=>{gn(e,t,"createQuery",gr.queries)},wn=(e,t)=>{for(var r=0;r<e;r++){var o=_u.disjointTimerQueryExt.createQueryEXT();if(!o){for(gr.recordError(1282);r<e;)F[t+4*r++>>2]=0;return}var n=gr.getNewId(gr.queries);o.name=n,gr.queries[n]=o,F[t+4*r>>2]=n}},_n=(e,t)=>{gn(e,t,"createRenderbuffer",gr.renderbuffers)},En=(e,t)=>{gn(e,t,"createSampler",gr.samplers)},Sn=(e,t)=>{gn(e,t,"createTexture",gr.textures)},Cn=(e,t)=>{gn(e,t,"createTransformFeedback",gr.transformFeedbacks)};function kn(e,t){gn(e,t,"createVertexArray",gr.vaos)}var xn,Tn,An,Pn=kn,qn=kn,Fn=function(e){_u.generateMipmap(e)},Ln=(e,t,r,o,n,i,a,s)=>{t=gr.programs[t];var u=_u[e](t,r);if(u){var c=s&&Nt(u.name,s,o);n&&(F[n>>2]=c),i&&(F[i>>2]=u.size),a&&(F[a>>2]=u.type)}},Dn=(e,t,r,o,n,i,a)=>{Ln("getActiveAttrib",e,t,r,o,n,i,a)},Bn=(e,t,r,o,n,i,a)=>{Ln("getActiveUniform",e,t,r,o,n,i,a)},Rn=(e,t,r,o,n)=>{e=gr.programs[e];var i=_u.getActiveUniformBlockName(e,t);if(i)if(n&&r>0){var a=Nt(i,n,r);o&&(F[o>>2]=a)}else o&&(F[o>>2]=0)},Mn=(e,t,r,o)=>{if(o)if(e=gr.programs[e],35393!=r){var n=_u.getActiveUniformBlockParameter(e,t,r);if(null!==n)if(35395==r)for(var i=0;i<n.length;i++)F[o+4*i>>2]=n[i];else F[o>>2]=n}else{var a=_u.getActiveUniformBlockName(e,t);F[o>>2]=a.length+1}else gr.recordError(1281)},In=(e,t,r,o,n)=>{if(n)if(t>0&&0==r)gr.recordError(1281);else{e=gr.programs[e];for(var i=[],a=0;a<t;a++)i.push(F[r+4*a>>2]);var s=_u.getActiveUniforms(e,i,o);if(s){var u=s.length;for(a=0;a<u;a++)F[n+4*a>>2]=s[a]}}else gr.recordError(1281)},On=(e,t,r,o)=>{var n=_u.getAttachedShaders(gr.programs[e]),i=n.length;i>t&&(i=t),F[r>>2]=i;for(var a=0;a<i;++a){var s=gr.shaders.indexOf(n[a]);F[o+4*a>>2]=s}},jn=(e,t)=>_u.getAttribLocation(gr.programs[e],ke(t)),Un=(e,t)=>{L[e>>2]=t;var r=L[e>>2];L[e+4>>2]=(t-r)/4294967296},$n=function(){var e,t=(e=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","WEBGL_clip_cull_distance","EXT_color_buffer_half_float","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"],(_u.getSupportedExtensions()||[]).filter((t=>e.includes(t))));return t=t.concat(t.map((e=>"GL_"+e)))},Nn=(e,t,r)=>{if(t){var o=void 0;switch(e){case 36346:o=1;break;case 36344:return void(0!=r&&1!=r&&gr.recordError(1280));case 34814:case 36345:o=0;break;case 34466:var n=_u.getParameter(34467);o=n?n.length:0;break;case 33309:if(gr.currentContext.version<2)return void gr.recordError(1282);o=$n().length;break;case 33307:case 33308:if(gr.currentContext.version<2)return void gr.recordError(1280);o=33307==e?3:0}if(void 0===o){var i=_u.getParameter(e);switch(typeof i){case"number":o=i;break;case"boolean":o=i?1:0;break;case"string":return void gr.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:o=0;break;default:return void gr.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:F[t+4*a>>2]=i[a];break;case 2:D[t+4*a>>2]=i[a];break;case 4:T[t+a>>0]=i[a]?1:0}return}try{o=0|i.name}catch(t){return gr.recordError(1280),void k(`GL_INVALID_ENUM in glGet${r}v: Unknown object returned from WebGL getParameter(${e})! (error: ${t})`)}}break;default:return gr.recordError(1280),void k(`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:Un(t,o);break;case 0:F[t>>2]=o;break;case 2:D[t>>2]=o;break;case 4:T[t>>0]=o?1:0}}else gr.recordError(1281)},Hn=(e,t)=>Nn(e,t,4),Vn=(e,t,r)=>{r?Un(r,_u.getBufferParameter(e,t)):gr.recordError(1281)},Wn=(e,t,r)=>{r?F[r>>2]=_u.getBufferParameter(e,t):gr.recordError(1281)},zn=()=>{var e=_u.getError()||gr.lastError;return gr.lastError=0,e},Gn=(e,t)=>Nn(e,t,2),Yn=(e,t)=>_u.getFragDataLocation(gr.programs[e],ke(t)),Xn=(e,t,r,o)=>{var n=_u.getFramebufferAttachmentParameter(e,t,r);(n instanceof WebGLRenderbuffer||n instanceof WebGLTexture)&&(n=0|n.name),F[o>>2]=n},Zn=(e,t,r,o)=>{if(r){var n,i=_u.getIndexedParameter(e,t);switch(typeof i){case"boolean":n=i?1:0;break;case"number":n=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:n=0;break;default:return void gr.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void gr.recordError(1280);n=0|i.name}break;default:return void gr.recordError(1280)}switch(o){case 1:Un(r,n);break;case 0:F[r>>2]=n;break;case 2:D[r>>2]=n;break;case 4:T[r>>0]=n?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+o}}else gr.recordError(1281)},Kn=(e,t,r)=>Zn(e,t,r,1),Qn=(e,t)=>{Nn(e,t,1)},Jn=(e,t,r)=>Zn(e,t,r,0),ei=(e,t)=>Nn(e,t,0),ti=(e,t,r,o,n)=>{if(o<0)gr.recordError(1281);else if(n){var i=_u.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<o;++a)F[n+4*a>>2]=i[a]}else gr.recordError(1281)},ri=(e,t,r,o,n)=>{gr.recordError(1282)},oi=(e,t,r,o)=>{var n=_u.getProgramInfoLog(gr.programs[e]);null===n&&(n="(unknown error)");var i=t>0&&o?Nt(n,o,t):0;r&&(F[r>>2]=i)},ni=(e,t,r)=>{if(r)if(e>=gr.counter)gr.recordError(1281);else if(e=gr.programs[e],35716==t){var o=_u.getProgramInfoLog(e);null===o&&(o="(unknown error)"),F[r>>2]=o.length+1}else if(35719==t){if(!e.maxUniformLength)for(var n=0;n<_u.getProgramParameter(e,35718);++n)e.maxUniformLength=Math.max(e.maxUniformLength,_u.getActiveUniform(e,n).name.length+1);F[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(n=0;n<_u.getProgramParameter(e,35721);++n)e.maxAttributeLength=Math.max(e.maxAttributeLength,_u.getActiveAttrib(e,n).name.length+1);F[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(n=0;n<_u.getProgramParameter(e,35382);++n)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,_u.getActiveUniformBlockName(e,n).length+1);F[r>>2]=e.maxUniformBlockNameLength}else F[r>>2]=_u.getProgramParameter(e,t);else gr.recordError(1281)},ii=(e,t,r)=>{if(r){var o,n=gr.queries[e];o=gr.currentContext.version<2?_u.disjointTimerQueryExt.getQueryObjectEXT(n,t):_u.getQueryParameter(n,t),Un(r,"boolean"==typeof o?o?1:0:o)}else gr.recordError(1281)},ai=ii,si=(e,t,r)=>{if(r){var o,n=gr.queries[e],i=_u.disjointTimerQueryExt.getQueryObjectEXT(n,t);o="boolean"==typeof i?i?1:0:i,F[r>>2]=o}else gr.recordError(1281)},ui=si,ci=ii,li=(e,t,r)=>{if(r){var o,n=gr.queries[e],i=_u.getQueryParameter(n,t);o="boolean"==typeof i?i?1:0:i,F[r>>2]=o}else gr.recordError(1281)},di=si,pi=(e,t,r)=>{r?F[r>>2]=_u.getQuery(e,t):gr.recordError(1281)},hi=(e,t,r)=>{r?F[r>>2]=_u.disjointTimerQueryExt.getQueryEXT(e,t):gr.recordError(1281)},fi=(e,t,r)=>{r?F[r>>2]=_u.getRenderbufferParameter(e,t):gr.recordError(1281)},mi=(e,t,r)=>{r?D[r>>2]=_u.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},gi=(e,t,r)=>{r?F[r>>2]=_u.getSamplerParameter(gr.samplers[e],t):gr.recordError(1281)},yi=(e,t,r,o)=>{var n=_u.getShaderInfoLog(gr.shaders[e]);null===n&&(n="(unknown error)");var i=t>0&&o?Nt(n,o,t):0;r&&(F[r>>2]=i)},bi=(e,t,r,o)=>{var n=_u.getShaderPrecisionFormat(e,t);F[r>>2]=n.rangeMin,F[r+4>>2]=n.rangeMax,F[o>>2]=n.precision},vi=(e,t,r,o)=>{var n=_u.getShaderSource(gr.shaders[e]);if(n){var i=t>0&&o?Nt(n,o,t):0;r&&(F[r>>2]=i)}},wi=(e,t,r)=>{if(r)if(35716==t){var o=_u.getShaderInfoLog(gr.shaders[e]);null===o&&(o="(unknown error)");var n=o?o.length+1:0;F[r>>2]=n}else if(35720==t){var i=_u.getShaderSource(gr.shaders[e]),a=i?i.length+1:0;F[r>>2]=a}else F[r>>2]=_u.getShaderParameter(gr.shaders[e],t);else gr.recordError(1281)},_i=e=>{var t=gr.stringCache[e];if(!t){switch(e){case 7939:t=ar($n().join(" "));break;case 7936:case 7937:case 37445:case 37446:var r=_u.getParameter(e);r||gr.recordError(1280),t=r?ar(r):0;break;case 7938:var o=_u.getParameter(7938);o=gr.currentContext.version>=2?`OpenGL ES 3.0 (${o})`:`OpenGL ES 2.0 (${o})`,t=ar(o);break;case 35724:var n=_u.getParameter(35724),i=n.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),n=`OpenGL ES GLSL ES ${i[1]} (${n})`),t=ar(n);break;default:gr.recordError(1280)}gr.stringCache[e]=t}return t},Ei=(e,t)=>{if(gr.currentContext.version<2)return gr.recordError(1282),0;var r=gr.stringiCache[e];if(r)return t<0||t>=r.length?(gr.recordError(1281),0):r[t];if(7939===e){var o=$n().map(ar);return r=gr.stringiCache[e]=o,t<0||t>=r.length?(gr.recordError(1281),0):r[t]}return gr.recordError(1280),0},Si=(e,t,r,o,n)=>{if(r<0)gr.recordError(1281);else if(n){var i=_u.getSyncParameter(gr.syncs[e],t);null!==i&&(F[n>>2]=i,o&&(F[o>>2]=1))}else gr.recordError(1281)},Ci=(e,t,r)=>{r?D[r>>2]=_u.getTexParameter(e,t):gr.recordError(1281)},ki=(e,t,r)=>{r?F[r>>2]=_u.getTexParameter(e,t):gr.recordError(1281)},xi=(e,t,r,o,n,i,a)=>{e=gr.programs[e];var s=_u.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var u=Nt(s.name,a,r);o&&(F[o>>2]=u)}else o&&(F[o>>2]=0);n&&(F[n>>2]=s.size),i&&(F[i>>2]=s.type)}},Ti=(e,t)=>_u.getUniformBlockIndex(gr.programs[e],ke(t)),Ai=(e,t,r,o)=>{if(o)if(t>0&&(0==r||0==o))gr.recordError(1281);else{e=gr.programs[e];for(var n=[],i=0;i<t;i++)n.push(ke(F[r+4*i>>2]));var a=_u.getUniformIndices(e,n);if(a){var s=a.length;for(i=0;i<s;i++)F[o+4*i>>2]=a[i]}}else gr.recordError(1281)},Pi=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),qi=e=>{var t,r,o=e.uniformLocsById,n=e.uniformSizeAndIdsByName;if(!o)for(e.uniformLocsById=o={},e.uniformArrayNamesById={},t=0;t<_u.getProgramParameter(e,35718);++t){var i=_u.getActiveUniform(e,t),a=i.name,s=i.size,u=Pi(a),c=u>0?a.slice(0,u):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,n[c]=[s,l],r=0;r<s;++r)o[l]=r,e.uniformArrayNamesById[l++]=c}},Fi=(e,t)=>{if(t=ke(t),e=gr.programs[e]){qi(e);var r=e.uniformLocsById,o=0,n=t,i=Pi(t);i>0&&(s=t.slice(i+1),o=parseInt(s)>>>0,n=t.slice(0,i));var a=e.uniformSizeAndIdsByName[n];if(a&&o<a[0]&&(r[o+=a[1]]=r[o]||_u.getUniformLocation(e,t)))return o}else gr.recordError(1281);var s;return-1},Li=e=>{var t=_u.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=_u.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?`[${r}]`:""))),r}gr.recordError(1282)},Di=(e,t,r,o)=>{if(r){e=gr.programs[e],qi(e);var n=_u.getUniform(e,Li(t));if("number"==typeof n||"boolean"==typeof n)switch(o){case 0:F[r>>2]=n;break;case 2:D[r>>2]=n}else for(var i=0;i<n.length;i++)switch(o){case 0:F[r+4*i>>2]=n[i];break;case 2:D[r+4*i>>2]=n[i]}}else gr.recordError(1281)},Bi=(e,t,r)=>{Di(e,t,r,2)},Ri=(e,t,r)=>{Di(e,t,r,0)},Mi=(e,t,r)=>Di(e,t,r,0),Ii=(e,t,r,o)=>{if(r){var n=_u.getVertexAttrib(e,t);if(34975==t)F[r>>2]=n&&n.name;else if("number"==typeof n||"boolean"==typeof n)switch(o){case 0:F[r>>2]=n;break;case 2:D[r>>2]=n;break;case 5:F[r>>2]=Math.fround(n)}else for(var i=0;i<n.length;i++)switch(o){case 0:F[r+4*i>>2]=n[i];break;case 2:D[r+4*i>>2]=n[i];break;case 5:F[r+4*i>>2]=Math.fround(n[i])}}else gr.recordError(1281)},Oi=(e,t,r)=>{Ii(e,t,r,0)},ji=Oi,Ui=Oi,$i=(e,t,r)=>{r?F[r>>2]=_u.getVertexAttribOffset(e,t):gr.recordError(1281)},Ni=(e,t,r)=>{Ii(e,t,r,2)},Hi=(e,t,r)=>{Ii(e,t,r,5)},Vi=function(e,t){_u.hint(e,t)},Wi=(e,t,r)=>{for(var o=No[t],n=0;n<t;n++)o[n]=F[r+4*n>>2];_u.invalidateFramebuffer(e,o)},zi=(e,t,r,o,n,i,a)=>{for(var s=No[t],u=0;u<t;u++)s[u]=F[r+4*u>>2];_u.invalidateSubFramebuffer(e,s,o,n,i,a)},Gi=e=>{var t=gr.buffers[e];return t?_u.isBuffer(t):0},Yi=function(e){return _u.isEnabled(e)},Xi=e=>{var t=gr.framebuffers[e];return t?_u.isFramebuffer(t):0},Zi=e=>(e=gr.programs[e])?_u.isProgram(e):0,Ki=e=>{var t=gr.queries[e];return t?_u.isQuery(t):0},Qi=e=>{var t=gr.queries[e];return t?_u.disjointTimerQueryExt.isQueryEXT(t):0},Ji=e=>{var t=gr.renderbuffers[e];return t?_u.isRenderbuffer(t):0},ea=e=>{var t=gr.samplers[e];return t?_u.isSampler(t):0},ta=e=>{var t=gr.shaders[e];return t?_u.isShader(t):0},ra=e=>_u.isSync(gr.syncs[e]),oa=e=>{var t=gr.textures[e];return t?_u.isTexture(t):0},na=e=>_u.isTransformFeedback(gr.transformFeedbacks[e]),ia=e=>{var t=gr.vaos[e];return t?_u.isVertexArray(t):0},aa=ia,sa=ia,ua=function(e){_u.lineWidth(e)},ca=e=>{e=gr.programs[e],_u.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},la=(e,t,r,o,n,i)=>{_u.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,F,t>>2,F,r>>2,F,o>>2,L,n>>2,i)},da=(e,t,r,o,n,i,a,s)=>{_u.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,F,t>>2,r,F,o>>2,F,n>>2,F,i>>2,L,a>>2,s)},pa=function(){_u.pauseTransformFeedback()},ha=(e,t)=>{3317==e&&(gr.unpackAlignment=t),_u.pixelStorei(e,t)},fa=function(e,t){_u.polygonOffset(e,t)},ma=(e,t,r,o)=>{gr.recordError(1280)},ga=(e,t,r)=>{gr.recordError(1280)},ya=(e,t)=>{_u.disjointTimerQueryExt.queryCounterEXT(gr.queries[e],t)},ba=function(e){_u.readBuffer(e)},va=e=>0==(e-=5120)?T:1==e?A:2==e?P:4==e?F:6==e?D:5==e||28922==e||28520==e||30779==e||30782==e?L:q,wa=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),_a=(e,t,r,o,n,i)=>{var a=va(e),s=wa(a),u=1<<s,c=(e=>({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(t)*u,l=((e,t,r,o)=>{var n;return t*(e*r+(n=o)-1&-n)})(r,o,c,gr.unpackAlignment);return a.subarray(n>>s,n+l>>s)},Ea=(e,t,r,o,n,i,a)=>{if(gr.currentContext.version>=2)if(_u.currentPixelPackBufferBinding)_u.readPixels(e,t,r,o,n,i,a);else{var s=va(i);_u.readPixels(e,t,r,o,n,i,s,a>>wa(s))}else{var u=_a(i,n,r,o,a);u?_u.readPixels(e,t,r,o,n,i,u):gr.recordError(1280)}},Sa=()=>{},Ca=function(e,t,r,o){_u.renderbufferStorage(e,t,r,o)},ka=function(e,t,r,o,n){_u.renderbufferStorageMultisample(e,t,r,o,n)},xa=function(){_u.resumeTransformFeedback()},Ta=(e,t)=>{_u.sampleCoverage(e,!!t)},Aa=(e,t,r)=>{_u.samplerParameterf(gr.samplers[e],t,r)},Pa=(e,t,r)=>{var o=D[r>>2];_u.samplerParameterf(gr.samplers[e],t,o)},qa=(e,t,r)=>{_u.samplerParameteri(gr.samplers[e],t,r)},Fa=(e,t,r)=>{var o=F[r>>2];_u.samplerParameteri(gr.samplers[e],t,o)},La=function(e,t,r,o){_u.scissor(e,t,r,o)},Da=(e,t,r,o,n)=>{gr.recordError(1280)},Ba=(e,t,r,o)=>{var n=gr.getSource(e,t,r,o);if(gr.currentContext.version>=2&&n.includes("#version 100")){var i="";(n=(n=n.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",n=n.replace(/gl_FragColor/g,"GL_FragColor")),n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n.includes("attribute")?(n=n.replace(/attribute/g,"in")).replace(/varying/g,"out"):n.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)}_u.shaderSource(gr.shaders[e],n)},Ra=function(e,t,r){_u.stencilFunc(e,t,r)},Ma=function(e,t,r,o){_u.stencilFuncSeparate(e,t,r,o)},Ia=function(e){_u.stencilMask(e)},Oa=function(e,t){_u.stencilMaskSeparate(e,t)},ja=function(e,t,r){_u.stencilOp(e,t,r)},Ua=function(e,t,r,o){_u.stencilOpSeparate(e,t,r,o)},$a=(e,t,r,o,n,i,a,s,u)=>{if(gr.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)),gr.currentContext.version>=2)if(_u.currentPixelUnpackBufferBinding)_u.texImage2D(e,t,r,o,n,i,a,s,u);else if(u){var c=va(s);_u.texImage2D(e,t,r,o,n,i,a,s,c,u>>wa(c))}else _u.texImage2D(e,t,r,o,n,i,a,s,null);else _u.texImage2D(e,t,r,o,n,i,a,s,u?_a(s,a,o,n,u):null)},Na=(e,t,r,o,n,i,a,s,u,c)=>{if(_u.currentPixelUnpackBufferBinding)_u.texImage3D(e,t,r,o,n,i,a,s,u,c);else if(c){var l=va(u);_u.texImage3D(e,t,r,o,n,i,a,s,u,l,c>>wa(l))}else _u.texImage3D(e,t,r,o,n,i,a,s,u,null)},Ha=function(e,t,r){_u.texParameterf(e,t,r)},Va=(e,t,r)=>{var o=D[r>>2];_u.texParameterf(e,t,o)},Wa=function(e,t,r){_u.texParameteri(e,t,r)},za=(e,t,r)=>{var o=F[r>>2];_u.texParameteri(e,t,o)},Ga=function(e,t,r,o,n){_u.texStorage2D(e,t,r,o,n)},Ya=function(e,t,r,o,n,i){_u.texStorage3D(e,t,r,o,n,i)},Xa=(e,t,r,o,n,i,a,s,u)=>{if(gr.currentContext.version>=2&&36193==s&&(s=5131),gr.currentContext.version>=2)if(_u.currentPixelUnpackBufferBinding)_u.texSubImage2D(e,t,r,o,n,i,a,s,u);else if(u){var c=va(s);_u.texSubImage2D(e,t,r,o,n,i,a,s,c,u>>wa(c))}else _u.texSubImage2D(e,t,r,o,n,i,a,s,null);else{var l=null;u&&(l=_a(s,a,n,i,u)),_u.texSubImage2D(e,t,r,o,n,i,a,s,l)}},Za=(e,t,r,o,n,i,a,s,u,c,l)=>{if(_u.currentPixelUnpackBufferBinding)_u.texSubImage3D(e,t,r,o,n,i,a,s,u,c,l);else if(l){var d=va(c);_u.texSubImage3D(e,t,r,o,n,i,a,s,u,c,d,l>>wa(d))}else _u.texSubImage3D(e,t,r,o,n,i,a,s,u,c,null)},Ka=(e,t,r,o)=>{e=gr.programs[e];for(var n=[],i=0;i<t;i++)n.push(ke(F[r+4*i>>2]));_u.transformFeedbackVaryings(e,n,o)},Qa=(e,t)=>{_u.uniform1f(Li(e),t)},Ja=[],es=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform1fv(Li(e),D,r>>2,t);else{if(t<=288)for(var o=Ja[t-1],n=0;n<t;++n)o[n]=D[r+4*n>>2];else o=D.subarray(r>>2,r+4*t>>2);_u.uniform1fv(Li(e),o)}},ts=(e,t)=>{_u.uniform1i(Li(e),t)},rs=[],os=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform1iv(Li(e),F,r>>2,t);else{if(t<=288)for(var o=rs[t-1],n=0;n<t;++n)o[n]=F[r+4*n>>2];else o=F.subarray(r>>2,r+4*t>>2);_u.uniform1iv(Li(e),o)}},ns=(e,t)=>{_u.uniform1ui(Li(e),t)},is=(e,t,r)=>{t&&_u.uniform1uiv(Li(e),L,r>>2,t)},as=(e,t,r)=>{_u.uniform2f(Li(e),t,r)},ss=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform2fv(Li(e),D,r>>2,2*t);else{if(t<=144)for(var o=Ja[2*t-1],n=0;n<2*t;n+=2)o[n]=D[r+4*n>>2],o[n+1]=D[r+(4*n+4)>>2];else o=D.subarray(r>>2,r+8*t>>2);_u.uniform2fv(Li(e),o)}},us=(e,t,r)=>{_u.uniform2i(Li(e),t,r)},cs=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform2iv(Li(e),F,r>>2,2*t);else{if(t<=144)for(var o=rs[2*t-1],n=0;n<2*t;n+=2)o[n]=F[r+4*n>>2],o[n+1]=F[r+(4*n+4)>>2];else o=F.subarray(r>>2,r+8*t>>2);_u.uniform2iv(Li(e),o)}},ls=(e,t,r)=>{_u.uniform2ui(Li(e),t,r)},ds=(e,t,r)=>{t&&_u.uniform2uiv(Li(e),L,r>>2,2*t)},ps=(e,t,r,o)=>{_u.uniform3f(Li(e),t,r,o)},hs=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform3fv(Li(e),D,r>>2,3*t);else{if(t<=96)for(var o=Ja[3*t-1],n=0;n<3*t;n+=3)o[n]=D[r+4*n>>2],o[n+1]=D[r+(4*n+4)>>2],o[n+2]=D[r+(4*n+8)>>2];else o=D.subarray(r>>2,r+12*t>>2);_u.uniform3fv(Li(e),o)}},fs=(e,t,r,o)=>{_u.uniform3i(Li(e),t,r,o)},ms=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform3iv(Li(e),F,r>>2,3*t);else{if(t<=96)for(var o=rs[3*t-1],n=0;n<3*t;n+=3)o[n]=F[r+4*n>>2],o[n+1]=F[r+(4*n+4)>>2],o[n+2]=F[r+(4*n+8)>>2];else o=F.subarray(r>>2,r+12*t>>2);_u.uniform3iv(Li(e),o)}},gs=(e,t,r,o)=>{_u.uniform3ui(Li(e),t,r,o)},ys=(e,t,r)=>{t&&_u.uniform3uiv(Li(e),L,r>>2,3*t)},bs=(e,t,r,o,n)=>{_u.uniform4f(Li(e),t,r,o,n)},vs=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform4fv(Li(e),D,r>>2,4*t);else{if(t<=72){var o=Ja[4*t-1],n=D;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;o[i]=n[a],o[i+1]=n[a+1],o[i+2]=n[a+2],o[i+3]=n[a+3]}}else o=D.subarray(r>>2,r+16*t>>2);_u.uniform4fv(Li(e),o)}},ws=(e,t,r,o,n)=>{_u.uniform4i(Li(e),t,r,o,n)},_s=(e,t,r)=>{if(gr.currentContext.version>=2)t&&_u.uniform4iv(Li(e),F,r>>2,4*t);else{if(t<=72)for(var o=rs[4*t-1],n=0;n<4*t;n+=4)o[n]=F[r+4*n>>2],o[n+1]=F[r+(4*n+4)>>2],o[n+2]=F[r+(4*n+8)>>2],o[n+3]=F[r+(4*n+12)>>2];else o=F.subarray(r>>2,r+16*t>>2);_u.uniform4iv(Li(e),o)}},Es=(e,t,r,o,n)=>{_u.uniform4ui(Li(e),t,r,o,n)},Ss=(e,t,r)=>{t&&_u.uniform4uiv(Li(e),L,r>>2,4*t)},Cs=(e,t,r)=>{e=gr.programs[e],_u.uniformBlockBinding(e,t,r)},ks=(e,t,r,o)=>{if(gr.currentContext.version>=2)t&&_u.uniformMatrix2fv(Li(e),!!r,D,o>>2,4*t);else{if(t<=72)for(var n=Ja[4*t-1],i=0;i<4*t;i+=4)n[i]=D[o+4*i>>2],n[i+1]=D[o+(4*i+4)>>2],n[i+2]=D[o+(4*i+8)>>2],n[i+3]=D[o+(4*i+12)>>2];else n=D.subarray(o>>2,o+16*t>>2);_u.uniformMatrix2fv(Li(e),!!r,n)}},xs=(e,t,r,o)=>{t&&_u.uniformMatrix2x3fv(Li(e),!!r,D,o>>2,6*t)},Ts=(e,t,r,o)=>{t&&_u.uniformMatrix2x4fv(Li(e),!!r,D,o>>2,8*t)},As=(e,t,r,o)=>{if(gr.currentContext.version>=2)t&&_u.uniformMatrix3fv(Li(e),!!r,D,o>>2,9*t);else{if(t<=32)for(var n=Ja[9*t-1],i=0;i<9*t;i+=9)n[i]=D[o+4*i>>2],n[i+1]=D[o+(4*i+4)>>2],n[i+2]=D[o+(4*i+8)>>2],n[i+3]=D[o+(4*i+12)>>2],n[i+4]=D[o+(4*i+16)>>2],n[i+5]=D[o+(4*i+20)>>2],n[i+6]=D[o+(4*i+24)>>2],n[i+7]=D[o+(4*i+28)>>2],n[i+8]=D[o+(4*i+32)>>2];else n=D.subarray(o>>2,o+36*t>>2);_u.uniformMatrix3fv(Li(e),!!r,n)}},Ps=(e,t,r,o)=>{t&&_u.uniformMatrix3x2fv(Li(e),!!r,D,o>>2,6*t)},qs=(e,t,r,o)=>{t&&_u.uniformMatrix3x4fv(Li(e),!!r,D,o>>2,12*t)},Fs=(e,t,r,o)=>{if(gr.currentContext.version>=2)t&&_u.uniformMatrix4fv(Li(e),!!r,D,o>>2,16*t);else{if(t<=18){var n=Ja[16*t-1],i=D;o>>=2;for(var a=0;a<16*t;a+=16){var s=o+a;n[a]=i[s],n[a+1]=i[s+1],n[a+2]=i[s+2],n[a+3]=i[s+3],n[a+4]=i[s+4],n[a+5]=i[s+5],n[a+6]=i[s+6],n[a+7]=i[s+7],n[a+8]=i[s+8],n[a+9]=i[s+9],n[a+10]=i[s+10],n[a+11]=i[s+11],n[a+12]=i[s+12],n[a+13]=i[s+13],n[a+14]=i[s+14],n[a+15]=i[s+15]}}else n=D.subarray(o>>2,o+64*t>>2);_u.uniformMatrix4fv(Li(e),!!r,n)}},Ls=(e,t,r,o)=>{t&&_u.uniformMatrix4x2fv(Li(e),!!r,D,o>>2,8*t)},Ds=(e,t,r,o)=>{t&&_u.uniformMatrix4x3fv(Li(e),!!r,D,o>>2,12*t)},Bs=e=>{e=gr.programs[e],_u.useProgram(e),_u.currentProgram=e},Rs=e=>{_u.validateProgram(gr.programs[e])},Ms=function(e,t){_u.vertexAttrib1f(e,t)},Is=(e,t)=>{_u.vertexAttrib1f(e,D[t>>2])},Os=function(e,t,r){_u.vertexAttrib2f(e,t,r)},js=(e,t)=>{_u.vertexAttrib2f(e,D[t>>2],D[t+4>>2])},Us=function(e,t,r,o){_u.vertexAttrib3f(e,t,r,o)},$s=(e,t)=>{_u.vertexAttrib3f(e,D[t>>2],D[t+4>>2],D[t+8>>2])},Ns=function(e,t,r,o,n){_u.vertexAttrib4f(e,t,r,o,n)},Hs=(e,t)=>{_u.vertexAttrib4f(e,D[t>>2],D[t+4>>2],D[t+8>>2],D[t+12>>2])},Vs=(e,t)=>{_u.vertexAttribDivisor(e,t)},Ws=Vs,zs=Vs,Gs=Vs,Ys=Vs,Xs=Vs,Zs=function(e,t,r,o,n){_u.vertexAttribI4i(e,t,r,o,n)},Ks=(e,t)=>{_u.vertexAttribI4i(e,F[t>>2],F[t+4>>2],F[t+8>>2],F[t+12>>2])},Qs=function(e,t,r,o,n){_u.vertexAttribI4ui(e,t,r,o,n)},Js=(e,t)=>{_u.vertexAttribI4ui(e,L[t>>2],L[t+4>>2],L[t+8>>2],L[t+12>>2])},eu=(e,t,r,o,n)=>{_u.vertexAttribIPointer(e,t,r,o,n)},tu=(e,t,r,o,n,i)=>{_u.vertexAttribPointer(e,t,r,!!o,n,i)},ru=function(e,t,r,o){_u.viewport(e,t,r,o)},ou=(e,t,r)=>{r=Number(r),_u.waitSync(gr.syncs[e],t,r)},nu=e=>{var t=(e-S.buffer.byteLength+65535)/65536;try{return S.grow(t),j(),1}catch(e){}},iu={removeAllEventListeners(){for(;iu.eventHandlers.length;)iu._removeHandler(iu.eventHandlers.length-1);iu.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(e,t,r){function o(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 n in iu.deferredCalls){var i=iu.deferredCalls[n];if(i.targetFunction==e&&o(i.argsList,r))return}iu.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),iu.deferredCalls.sort(((e,t)=>e.precedence<t.precedence))},removeDeferredCalls(e){for(var t=0;t<iu.deferredCalls.length;++t)iu.deferredCalls[t].targetFunction==e&&(iu.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:()=>navigator.userActivation?navigator.userActivation.isActive:iu.inEventHandler&&iu.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(iu.canPerformEventHandlerRequests())for(var e=0;e<iu.deferredCalls.length;++e){var t=iu.deferredCalls[e];iu.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:(e,t)=>{for(var r=0;r<iu.eventHandlers.length;++r)iu.eventHandlers[r].target!=e||t&&t!=iu.eventHandlers[r].eventTypeString||iu._removeHandler(r--)},_removeHandler(e){var t=iu.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),iu.eventHandlers.splice(e,1)},registerOrRemoveHandler(e){if(!e.target)return-4;if(e.callbackfunc)e.eventListenerFunc=function(t){++iu.inEventHandler,iu.currentEventHandler=e,iu.runDeferredCalls(),e.handlerFunc(t),iu.runDeferredCalls(),--iu.inEventHandler},e.target.addEventListener(e.eventTypeString,e.eventListenerFunc,e.useCapture),iu.eventHandlers.push(e);else for(var t=0;t<iu.eventHandlers.length;++t)iu.eventHandlers[t].target==e.target&&iu.eventHandlers[t].eventTypeString==e.eventTypeString&&iu._removeHandler(t--);return 0},getNodeNameForTarget:e=>e?e==window?"#window":e==screen?"#screen":e?.nodeName||"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},au=["default","low-power","high-performance"],su=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],uu=e=>{var t;return e=(t=e)>2?ke(t):t,su[e]||("undefined"!=typeof document?document.querySelector(e):void 0)},cu=(e,t)=>{var r=t>>2,o=F[r+6],n={alpha:!!F[r+0],depth:!!F[r+1],stencil:!!F[r+2],antialias:!!F[r+3],premultipliedAlpha:!!F[r+4],preserveDrawingBuffer:!!F[r+5],powerPreference:au[o],failIfMajorPerformanceCaveat:!!F[r+7],majorVersion:F[r+8],minorVersion:F[r+9],enableExtensionsByDefault:F[r+10],explicitSwapControl:F[r+11],proxyContextToMainThread:F[r+12],renderViaOffscreenBackBuffer:F[r+13]},i=uu(e);return i?n.explicitSwapControl?0:gr.createContext(i,n):0},lu={},du=()=>{if(!du.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 lu)void 0===lu[t]?delete e[t]:e[t]=lu[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);du.strings=r}return du.strings},pu=(e,t,r,o)=>{for(var n=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Ce.read(e,T,a,s,o);if(u<0)return-1;if(n+=u,u<s)break;void 0!==o&&(o+=u)}return n},hu=[31,29,31,30,31,30,31,31,30,31,30,31],fu=[31,28,31,30,31,30,31,31,30,31,30,31],mu=(e,t)=>{T.set(e,t)},gu=(e,t,r,o)=>{var n=L[o+40>>2],i={tm_sec:F[o>>2],tm_min:F[o+4>>2],tm_hour:F[o+8>>2],tm_mday:F[o+12>>2],tm_mon:F[o+16>>2],tm_year:F[o+20>>2],tm_wday:F[o+24>>2],tm_yday:F[o+28>>2],tm_isdst:F[o+32>>2],tm_gmtoff:F[o+36>>2],tm_zone:n?ke(n):""},a=ke(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 o="number"==typeof e?e.toString():e||"";o.length<t;)o=r[0]+o;return o}function p(e,t){return d(e,t,"0")}function h(e,t){function r(e){return e<0?-1:e>0?1:0}var o;return 0===(o=r(e.getFullYear()-t.getFullYear()))&&0===(o=r(e.getMonth()-t.getMonth()))&&(o=r(e.getDate()-t.getDate())),o}function f(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 o=rr(r.getFullYear()),n=r.getMonth(),i=(o?hu:fu)[n];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+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),o=new Date(t.getFullYear()+1,0,4),n=f(r),i=f(o);return h(n,t)<=0?h(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=>p((e.tm_year+1900)/100|0,2),"%d":e=>p(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>m(e).toString().substring(2),"%G":m,"%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,o=0;o<=t;r+=e[o++]);return r})(rr(e.tm_year+1900)?hu:fu,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&&rr(e.tm_year)||(t=1)}}else{t=52;var o=(e.tm_wday+7-e.tm_yday-1)%7;(4==o||5==o&&rr(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"),g)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),g[u](i)));var y=be(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(mu(y,e),y.length-1)},yu=e=>{var t=ge(e)+1,r=$u(t);return Nt(e,r,t),r},bu=function(e,t,r,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Ce.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=o},vu=365,wu=146;Object.defineProperties(bu.prototype,{read:{get:function(){return(this.mode&vu)===vu},set:function(e){e?this.mode|=vu:this.mode&=-366}},write:{get:function(){return(this.mode&wu)===wu},set:function(e){e?this.mode|=wu:this.mode&=-147}},isFolder:{get:function(){return Ce.isDir(this.mode)}},isDevice:{get:function(){return Ce.isChrdev(this.mode)}}}),Ce.FSNode=bu,Ce.createPreloadedFile=(e,t,r,o,n,i,a,s,u,c)=>{var d=t?pe.resolve(le.join2(e,t)):e;function p(r){function l(r){c?.(),s||((e,t,r,o,n,i)=>{Ce.createDataFile(e,t,r,o,n,i)})(e,t,r,o,n,u),i?.(),X()}((e,t,r,o)=>{void 0!==fr&&fr.init();var n=!1;return Ee.forEach((i=>{n||i.canHandle(t)&&(i.handle(e,t,r,o),n=!0)})),n})(r,d,l,(()=>{a?.(),X()}))||l(r)}Y(),"string"==typeof r?((e,t,r,o)=>{var n=o?"":`al ${e}`;l(e,(e=>{t(new Uint8Array(e)),n&&X()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),n&&Y()})(r,p,a):p(r)},Ce.staticInit(),u.FS_createPath=Ce.createPath,u.FS_createDataFile=Ce.createDataFile,u.FS_createPreloadedFile=Ce.createPreloadedFile,u.FS_unlink=Ce.unlink,u.FS_createLazyFile=Ce.createLazyFile,u.FS_createDevice=Ce.createDevice,qe=u.InternalError=class InternalError extends Error{constructor(e){super(e),this.name="InternalError"}},(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Fe=e})(),Le=u.BindingError=class BindingError extends Error{constructor(e){super(e),this.name="BindingError"}},Object.assign(ut.prototype,{isAliasOf(e){if(!(this instanceof ut))return!1;if(!(e instanceof ut))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var o=e.$$.ptrType.registeredClass,n=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;o.baseClass;)n=o.upcast(n),o=o.baseClass;return t===o&&r===n},clone(){if(this.$$.ptr||ze(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=st(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},delete(){this.$$.ptr||ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),Ye(this),Xe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$e("Object already scheduled for deletion"),et.push(this),1===et.length&&He&&He(tt),this.$$.deleteScheduled=!0,this}}),u.getInheritedInstanceCount=Qe,u.getLiveInheritedInstances=Je,u.flushPendingDeletes=tt,u.setDelayFunction=rt,Object.assign(vt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:We,readValueFromPointer:bt,fromWireType:at}),_t=u.UnboundTypeError=(xn=Error,(An=lt(Tn="UnboundTypeError",(function(e){this.name=Tn,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(xn.prototype),An.prototype.constructor=An,An.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},An),Bt.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Object.assign(Bt,{reserved:Bt.allocated.length}),u.count_emval_handles=Mt,u.requestFullscreen=fr.requestFullscreen,u.requestAnimationFrame=fr.requestAnimationFrame,u.setCanvasSize=fr.setCanvasSize,u.pauseMainLoop=fr.mainLoop.pause,u.resumeMainLoop=fr.mainLoop.resume,u.getUserMedia=fr.getUserMedia,u.createContext=fr.createContext;for(var _u,Eu={},Su={},Cu=0;Cu<32;++Cu)No.push(new Array(Cu));var ku=new Float32Array(288);for(Cu=0;Cu<288;++Cu)Ja[Cu]=ku.subarray(0,Cu+1);var xu=new Int32Array(288);for(Cu=0;Cu<288;++Cu)rs[Cu]=xu.subarray(0,Cu+1);var Tu,Au={Oa:e=>{var t=new ExceptionInfo(e);return t.get_caught()||t.set_caught(!0),t.set_rethrown(!1),se.push(t),Hu(t.excPtr),t.get_exception_ptr()},Na:()=>{Ou(0,0);var e=se.pop();Nu(e.excPtr),ue=0},o:()=>ce([]),ca:e=>ce([e]),k:(e,t,r)=>{throw new ExceptionInfo(e).init(t,r),ue=e},R:e=>{throw ue||(ue=e),ue},fa:function(e,t,r){xe.varargs=r;try{var o=xe.getStreamFromFD(e);switch(t){case 0:if((n=xe.get())<0)return-28;for(;Ce.streams[n];)n++;return Ce.createStream(o,n).fd;case 1:case 2:case 13:case 14:return 0;case 3:return o.flags;case 4:var n=xe.get();return o.flags|=n,0;case 12:return n=xe.getp(),P[n+0>>1]=2,0}return-28}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Bb:function(e,t){try{var r=xe.getStreamFromFD(e);return xe.doStat(Ce.stat,r.path,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Gb:function(e,t,r){xe.varargs=r;try{var o=xe.getStreamFromFD(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return o.tty?0:-59;case 21505:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var n=o.tty.ops.ioctl_tcgets(o),i=xe.getp();F[i>>2]=n.c_iflag||0,F[i+4>>2]=n.c_oflag||0,F[i+8>>2]=n.c_cflag||0,F[i+12>>2]=n.c_lflag||0;for(var a=0;a<32;a++)T[i+a+17>>0]=n.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){i=xe.getp();var s=F[i>>2],u=F[i+4>>2],c=F[i+8>>2],l=F[i+12>>2],d=[];for(a=0;a<32;a++)d.push(T[i+a+17>>0]);return o.tty.ops.ioctl_tcsets(o.tty,t,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return o.tty?(i=xe.getp(),F[i>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return i=xe.getp(),Ce.ioctl(o,t,i);case 21523:if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var p=o.tty.ops.ioctl_tiocgwinsz(o.tty);i=xe.getp(),P[i>>1]=p[0],P[i+2>>1]=p[1]}return 0;default:return-28}}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},zb:function(e,t){try{return e=xe.getStr(e),xe.doStat(Ce.lstat,e,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},yb:function(e,t,r,o){try{t=xe.getStr(t);var n=256&o,i=4096&o;return o&=-6401,t=xe.calculateAt(e,t,i),xe.doStat(n?Ce.lstat:Ce.stat,t,r)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},wa:function(e,t,r,o){xe.varargs=o;try{t=xe.getStr(t),t=xe.calculateAt(e,t);var n=o?xe.get():0;return Ce.open(t,r,n).fd}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Ab:function(e,t){try{return e=xe.getStr(e),xe.doStat(Ce.stat,e,t)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},Ba:e=>{var t=Te[e];delete Te[e];var r=t.elements,o=r.length,n=r.map((e=>e.getterReturnType)).concat(r.map((e=>e.setterArgumentType))),i=t.rawConstructor,a=t.rawDestructor;Ie([e],n,(function(e){return r.forEach(((t,r)=>{var n=e[r],i=t.getter,a=t.getterContext,s=e[r+o],u=t.setter,c=t.setterContext;t.read=e=>n.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];u(c,e,s.toWireType(r,t)),Ae(r)}})),[{name:t.name,fromWireType:e=>{for(var t=new Array(o),n=0;n<o;++n)t[n]=r[n].read(e);return a(e),t},toWireType:(e,n)=>{if(o!==n.length)throw new TypeError(`Incorrect number of tuple elements for ${t.name}: expected=${o}, actual=${n.length}`);for(var s=i(),u=0;u<o;++u)r[u].write(s,n[u]);return null!==e&&e.push(a,s),s},argPackAdvance:We,readValueFromPointer:Pe,destructorFunction:a}]}))},z:e=>{var t=Oe[e];delete Oe[e];var r=t.rawConstructor,o=t.rawDestructor,n=t.fields,i=n.map((e=>e.getterReturnType)).concat(n.map((e=>e.setterArgumentType)));Ie([e],i,(e=>{var i={};return n.forEach(((t,r)=>{var o=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+n.length],l=t.setter,d=t.setterContext;i[o]={read:e=>a.fromWireType(s(u,e)),write:(e,t)=>{var r=[];l(d,e,c.toWireType(r,t)),Ae(r)}}})),[{name:t.name,fromWireType:e=>{var t={};for(var r in i)t[r]=i[r].read(e);return o(e),t},toWireType:(e,t)=>{for(var n in i)if(!(n in t))throw new TypeError(`Missing field: "${n}"`);var a=r();for(n in i)i[n].write(a,t[n]);return null!==e&&e.push(o,a),a},argPackAdvance:We,readValueFromPointer:Pe,destructorFunction:o}]}))},Ea:(e,t,r,o,n)=>{var i=-1!=(t=Ue(t)).indexOf("u");Ne(e,{name:t,fromWireType:e=>e,toWireType:function(e,t){if("bigint"!=typeof t&&"number"!=typeof t)throw new TypeError(`Cannot convert "${je(t)}" to ${this.name}`);return"number"==typeof t&&(t=BigInt(t)),t},argPackAdvance:We,readValueFromPointer:Ve(t,r,!i),destructorFunction:null})},ne:(e,t,r,o)=>{Ne(e,{name:t=Ue(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:o},argPackAdvance:We,readValueFromPointer:function(e){return this.fromWireType(A[e])},destructorFunction:null})},v:(e,t,r,o,n,i,a,s,u,c,l,d,p)=>{l=Ue(l),i=kt(n,i),s&&=kt(a,s),c&&=kt(u,c),p=kt(d,p);var h=(e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(l);pt(h,(function(){Tt(`Cannot construct ${l} due to unbound types`,[o])})),Ie([e,t,r],o?[o]:[],(function(t){var r,n;t=t[0],n=o?(r=t.registeredClass).instancePrototype:ut.prototype;var a=lt(l,(function(){if(Object.getPrototypeOf(this)!==u)throw new Le("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Le(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Le(`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(n,{constructor:{value:a}});a.prototype=u;var d=new ht(l,a,u,p,r,i,s,c);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var f=new vt(l,d,!0,!1,!1),m=new vt(l+"*",d,!1,!1,!1),g=new vt(l+" const*",d,!1,!0,!1);return Ke[e]={pointerType:m,constPointerType:g},Et(h,a),[f,m,g]}))},x:(e,t,r,o,n,i)=>{var a=At(t,r);n=kt(o,n),Ie([],[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 Le(`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]=()=>{Tt(`Cannot construct ${e.name} due to unbound types`,a)},Ie([],a,(o=>(o.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ft(r,o,null,n,i),[]))),[]}))},d:(e,t,r,o,n,i,a,s,u)=>{var c=At(r,o);t=Ue(t),t=Dt(t),i=kt(n,i),Ie([],[e],(function(e){var o=`${(e=e[0]).name}.${t}`;function n(){Tt(`Cannot call ${o} 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?(n.argCount=r-2,n.className=e.name,l[t]=n):(dt(l,t,o),l[t].overloadTable[r-2]=n),Ie([],c,(function(n){var s=Ft(o,n,e,i,a,u);return void 0===l[t].overloadTable?(s.argCount=r-2,l[t]=s):l[t].overloadTable[r-2]=s,[]})),[]}))},me:e=>Ne(e,Ot),ba:(e,t,r,o)=>{function n(){}t=Ue(t),n.values={},Ne(e,{name:t,constructor:n,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,argPackAdvance:We,readValueFromPointer:jt(t,r,o),destructorFunction:null}),pt(t,n)},I:(e,t,r)=>{var o=Ut(e,"enum");t=Ue(t);var n=o.constructor,i=Object.create(o.constructor.prototype,{value:{value:r},constructor:{value:lt(`${o.name}_${t}`,(function(){}))}});n.values[r]=i,n[t]=i},Da:(e,t,r)=>{Ne(e,{name:t=Ue(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:We,readValueFromPointer:$t(t,r),destructorFunction:null})},J:(e,t,r,o,n,i,a)=>{var s=At(t,r);e=Ue(e),e=Dt(e),n=kt(o,n),pt(e,(function(){Tt(`Cannot call ${e} due to unbound types`,s)}),t-1),Ie([],s,(function(r){var o=[r[0],null].concat(r.slice(1));return Et(e,Ft(e,o,null,n,i,a),t-1),[]}))},O:(e,t,r,o,n)=>{t=Ue(t),-1===n&&(n=4294967295);var i=e=>e;if(0===o){var a=32-8*r;i=e=>e<<a>>>a}var s=t.includes("unsigned");Ne(e,{name:t,fromWireType:i,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:We,readValueFromPointer:Ve(t,r,0!==o),destructorFunction:null})},E:(e,t,r)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function n(e){var t=L[e>>2],r=L[e+4>>2];return new o(T.buffer,r,t)}Ne(e,{name:r=Ue(r),fromWireType:n,argPackAdvance:We,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},ef:(e,t,r,o,n,i,a,s,u,c,l,d)=>{r=Ue(r),i=kt(n,i),s=kt(a,s),c=kt(u,c),d=kt(l,d),Ie([e],[t],(function(e){return e=e[0],[new vt(r,e.registeredClass,!1,!1,!0,e,o,i,s,c,d)]}))},Fa:(e,t)=>{var r="std::string"===(t=Ue(t));Ne(e,{name:t,fromWireType(e){var t,o=L[e>>2],n=e+4;if(r)for(var i=n,a=0;a<=o;++a){var s=n+a;if(a==o||0==A[s]){var u=ke(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(o);for(a=0;a<o;++a)c[a]=String.fromCharCode(A[n+a]);t=c.join("")}return Lu(e),t},toWireType(e,t){var o;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||$e("Cannot pass non-string to std::string"),o=r&&n?ge(t):t.length;var i=qu(4+o+1),a=i+4;if(L[i>>2]=o,r&&n)Nt(t,a,o+1);else if(n)for(var s=0;s<o;++s){var u=t.charCodeAt(s);u>255&&(Lu(a),$e("String has UTF-16 code units that do not fit in 8 bits")),A[a+s]=u}else for(s=0;s<o;++s)A[a+s]=t[s];return null!==e&&e.push(Lu,i),i},argPackAdvance:We,readValueFromPointer:bt,destructorFunction(e){Lu(e)}})},ga:(e,t,r)=>{var o,n,i,a,s;r=Ue(r),2===t?(o=Vt,n=Wt,a=zt,i=()=>q,s=1):4===t&&(o=Gt,n=Yt,a=Xt,i=()=>L,s=2),Ne(e,{name:r,fromWireType:e=>{for(var r,n=L[e>>2],a=i(),u=e+4,c=0;c<=n;++c){var l=e+4+c*t;if(c==n||0==a[l>>s]){var d=o(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+t}}return Lu(e),r},toWireType:(e,o)=>{"string"!=typeof o&&$e(`Cannot pass non-string to C++ string type ${r}`);var i=a(o),u=qu(4+i+t);return L[u>>2]=i>>s,n(o,u+4,i+t),null!==e&&e.push(Lu,u),u},argPackAdvance:We,readValueFromPointer:Pe,destructorFunction(e){Lu(e)}})},Ca:(e,t,r,o,n,i)=>{Te[e]={name:Ue(t),rawConstructor:kt(r,o),rawDestructor:kt(n,i),elements:[]}},N:(e,t,r,o,n,i,a,s,u)=>{Te[e].elements.push({getterReturnType:t,getter:kt(r,o),getterContext:n,setterArgumentType:i,setter:kt(a,s),setterContext:u})},A:(e,t,r,o,n,i)=>{Oe[e]={name:Ue(t),rawConstructor:kt(r,o),rawDestructor:kt(n,i),fields:[]}},n:(e,t,r,o,n,i,a,s,u,c)=>{Oe[e].fields.push({fieldName:Ue(t),getterReturnType:r,getter:kt(o,n),getterContext:i,setterArgumentType:a,setter:kt(s,u),setterContext:c})},oe:(e,t)=>{Ne(e,{isVoid:!0,name:t=Ue(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},Db:()=>1,kb:()=>{throw 1/0},j:(e,t,r)=>(e=It.toValue(e),t=Ut(t,"emval::as"),Zt(t,r,e)),w:(e,t,r,o)=>(e=Kt[e])(null,t=It.toValue(t),r,o),P:(e,t,r,o,n)=>(e=Kt[e])(t=It.toValue(t),t[r=Jt(r)],o,n),c:Rt,le:(e,t)=>(e=It.toValue(e))==(t=It.toValue(t)),M:e=>0===e?It.toHandle(er()):(e=Jt(e),It.toHandle(er()[e])),s:(e,t,r)=>{var o=((e,t)=>{for(var r=new Array(e),o=0;o<e;++o)r[o]=Ut(L[t+4*o>>2],"parameter "+o);return r})(e,t),n=o.shift();e--;var i="return function (obj, func, destructorsRef, args) {\n",a=0,s=[];0===r&&s.push("obj");for(var u=["retType"],c=[n],l=0;l<e;++l)s.push("arg"+l),u.push("argType"+l),c.push(o[l]),i+=` var arg${l} = argType${l}.readValueFromPointer(args${a?"+"+a:""});\n`,a+=o[l].argPackAdvance;i+=` var rv = ${1===r?"new func":"func.call"}(${s.join(", ")});\n`,n.isVoid||(u.push("emval_returnValue"),c.push(Zt),i+=" return emval_returnValue(retType, destructorsRef, rv);\n"),i+="};\n",u.push(i);var d,p,h=qt(Function,u).apply(null,c),f=`methodCaller<(${o.map((e=>e.name)).join(", ")}) => ${n.name}>`;return d=lt(f,h),p=Kt.length,Kt.push(d),p},h:(e,t)=>(e=It.toValue(e),t=It.toValue(t),It.toHandle(e[t])),e:e=>{e>4&&(Bt.get(e).refcount+=1)},_:(e,t)=>(e=It.toValue(e))instanceof(t=It.toValue(t)),ja:e=>"number"==typeof(e=It.toValue(e)),K:e=>"string"==typeof(e=It.toValue(e)),Le:()=>It.toHandle([]),f:e=>It.toHandle(Jt(e)),B:()=>It.toHandle({}),i:e=>{var t=It.toValue(e);Ae(t),Rt(e)},l:(e,t,r)=>{e=It.toValue(e),t=It.toValue(t),r=It.toValue(r),e[t]=r},g:(e,t)=>{var r=(e=Ut(e,"_emval_take_value")).readValueFromPointer(t);return It.toHandle(r)},qf:e=>{throw e=It.toValue(e)},qd:e=>(e=It.toValue(e),It.toHandle(typeof e)),sb:function(e,t){e=tr(e);var r=new Date(1e3*e);F[t>>2]=r.getUTCSeconds(),F[t+4>>2]=r.getUTCMinutes(),F[t+8>>2]=r.getUTCHours(),F[t+12>>2]=r.getUTCDate(),F[t+16>>2]=r.getUTCMonth(),F[t+20>>2]=r.getUTCFullYear()-1900,F[t+24>>2]=r.getUTCDay();var o=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),n=(r.getTime()-o)/864e5|0;F[t+28>>2]=n},tb:function(e,t){e=tr(e);var r=new Date(1e3*e);F[t>>2]=r.getSeconds(),F[t+4>>2]=r.getMinutes(),F[t+8>>2]=r.getHours(),F[t+12>>2]=r.getDate(),F[t+16>>2]=r.getMonth(),F[t+20>>2]=r.getFullYear()-1900,F[t+24>>2]=r.getDay();var o=0|ir(r);F[t+28>>2]=o,F[t+36>>2]=-60*r.getTimezoneOffset();var n=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));F[t+32>>2]=s},ub:function(e){var t=(()=>{var t=new Date(F[e+20>>2]+1900,F[e+16>>2],F[e+12>>2],F[e+8>>2],F[e+4>>2],F[e>>2],0),r=F[e+32>>2],o=t.getTimezoneOffset(),n=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=Math.min(a,i);if(r<0)F[e+32>>2]=Number(i!=a&&s==o);else if(r>0!=(s==o)){var u=Math.max(a,i),c=r>0?s:u;t.setTime(t.getTime()+6e4*(c-o))}F[e+24>>2]=t.getDay();var l=0|ir(t);F[e+28>>2]=l,F[e>>2]=t.getSeconds(),F[e+4>>2]=t.getMinutes(),F[e+8>>2]=t.getHours(),F[e+12>>2]=t.getDate(),F[e+16>>2]=t.getMonth(),F[e+20>>2]=t.getYear();var d=t.getTime();return isNaN(d)?-1:d/1e3})();return BigInt(t)},qb:function(e,t,r,o,n,i,a){n=tr(n);try{if(isNaN(n))return 61;var s=xe.getStreamFromFD(o),u=Ce.mmap(s,e,n,t,r),c=u.ptr;return F[i>>2]=u.allocated,L[a>>2]=c,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},rb:function(e,t,r,o,n,i){i=tr(i);try{if(isNaN(i))return 61;var a=xe.getStreamFromFD(n);2&r&&xe.doMsync(e,a,t,o,i),Ce.munmap(a)}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return-e.errno}},lb:(e,t,r)=>{var o=(new Date).getFullYear(),n=new Date(o,0,1),i=new Date(o,6,1),a=n.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}L[e>>2]=60*u,F[t>>2]=Number(a!=s);var l=c(n),d=c(i),p=ar(l),h=ar(d);s<a?(L[r>>2]=p,L[r+4>>2]=h):(L[r>>2]=h,L[r+4>>2]=p)},b:()=>{Z("")},re:function(e){var t=ke(e);localStorage.removeItem(t)},ua:(e,t,r,o,n)=>mr.chooseConfig(e,t,r,o,n),va:(e,t,r,o)=>{if(62e3!=e)return mr.setErrorCode(12296),0;for(var n=1;;){var i=F[o>>2];if(12440!=i){if(12344==i)break;return mr.setErrorCode(12292),0}n=F[o+4>>2],o+=8}return n<2||n>3?(mr.setErrorCode(12293),0):(mr.contextAttributes.majorVersion=n-1,mr.contextAttributes.minorVersion=0,mr.context=gr.createContext(u.canvas,mr.contextAttributes),0!=mr.context?(mr.setErrorCode(12288),gr.makeContextCurrent(mr.context),u.useWebGL=!0,fr.moduleContextCreatedCallbacks.forEach((function(e){e()})),gr.makeContextCurrent(null),62004):(mr.setErrorCode(12297),0))},cb:(e,t,r,o)=>62e3!=e?(mr.setErrorCode(12296),0):62002!=t?(mr.setErrorCode(12293),0):(mr.setErrorCode(12288),62006),Nc:(e,t)=>62e3!=e?(mr.setErrorCode(12296),0):62004!=t?(mr.setErrorCode(12294),0):(gr.deleteContext(mr.context),mr.setErrorCode(12288),mr.currentContext==t&&(mr.currentContext=0),1),Cc:(e,t)=>62e3!=e?(mr.setErrorCode(12296),0):62006!=t?(mr.setErrorCode(12301),1):(mr.currentReadSurface==t&&(mr.currentReadSurface=0),mr.currentDrawSurface==t&&(mr.currentDrawSurface=0),mr.setErrorCode(12288),1),S:(e,t,r,o)=>{if(62e3!=e)return mr.setErrorCode(12296),0;if(62002!=t)return mr.setErrorCode(12293),0;if(!o)return mr.setErrorCode(12300),0;switch(mr.setErrorCode(12288),r){case 12320:return F[o>>2]=mr.contextAttributes.alpha?32:24,1;case 12321:return F[o>>2]=mr.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return F[o>>2]=8,1;case 12325:return F[o>>2]=mr.contextAttributes.depth?24:0,1;case 12326:return F[o>>2]=mr.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return F[o>>2]=12344,1;case 12328:return F[o>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return F[o>>2]=0,1;case 12330:case 12332:return F[o>>2]=4096,1;case 12331:return F[o>>2]=16777216,1;case 12337:return F[o>>2]=mr.contextAttributes.antialias?4:0,1;case 12338:return F[o>>2]=mr.contextAttributes.antialias?1:0,1;case 12339:case 12352:return F[o>>2]=4,1;case 12341:case 12342:case 12343:return F[o>>2]=-1,1;case 12348:return F[o>>2]=1,1;case 12351:return F[o>>2]=12430,1;default:return mr.setErrorCode(12292),0}},Nb:e=>(mr.setErrorCode(12288),0!=e&&1!=e?0:62e3),za:()=>mr.errorCode,Fb:(e,t,r)=>62e3!=e?(mr.setErrorCode(12296),0):(t&&(F[t>>2]=1),r&&(F[r>>2]=4),mr.defaultDisplayInitialized=!0,mr.setErrorCode(12288),1),Yb:(e,t,r,o)=>62e3!=e?(mr.setErrorCode(12296),0):0!=o&&62004!=o?(mr.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(mr.setErrorCode(12301),0):(gr.makeContextCurrent(o?mr.context:null),mr.currentContext=o,mr.currentDrawSurface=t,mr.currentReadSurface=r,mr.setErrorCode(12288),1),Aa:(e,t)=>{if(mr.defaultDisplayInitialized)if(u.ctx){if(!u.ctx.isContextLost())return mr.setErrorCode(12288),1;mr.setErrorCode(12302)}else mr.setErrorCode(12290);else mr.setErrorCode(12289);return 0},rc:e=>62e3!=e?(mr.setErrorCode(12296),0):(mr.currentContext=0,mr.currentReadSurface=0,mr.currentDrawSurface=0,mr.defaultDisplayInitialized=!1,mr.setErrorCode(12288),1),H:(e,t,r)=>br(e,t,r),Ae:e=>{console.error(ke(e))},Be:e=>{console.log(ke(e))},ma:e=>{console.warn(ke(e))},da:()=>Date.now(),qe:function(){},mb:()=>2147483648,Cb:Lt,$f:vr,ag:wr,Xc:_r,he:Er,Jc:Sr,bg:Cr,cg:kr,Gc:xr,Hc:Tr,$e:Ar,af:Pr,Ke:qr,dg:Fr,Ub:Lr,yf:Br,Af:Rr,eg:Mr,fg:Ir,Wd:Or,gg:jr,Vd:Ur,Ve:$r,hg:Nr,ig:Hr,bf:Vr,jg:Wr,ic:zr,jc:Gr,lc:Yr,kc:Xr,kg:Zr,Ud:Kr,lg:Qr,Ka:Jr,mg:eo,ng:to,og:ro,ad:oo,pg:no,$c:io,Te:ao,Td:so,qg:uo,bd:co,rg:lo,sg:po,tg:ho,ug:fo,cf:mo,vg:go,Zc:yo,je:bo,df:vo,Me:wo,wg:_o,Ue:Eo,xg:So,Tb:Co,zf:xo,Bf:To,Sd:Ao,yg:Po,Rd:qo,Qd:Fo,zg:Lo,Ag:Do,Bg:Bo,wf:Mo,Zd:Io,id:Oo,tf:jo,jd:Uo,Hb:$o,rf:Vo,ed:Wo,_d:zo,Cg:Yo,xf:Zo,Yd:Ko,fd:Qo,uf:Jo,gd:en,hd:tn,kf:rn,Dg:on,Eg:nn,Wc:an,ge:sn,Ic:un,Re:cn,Fg:ln,Gg:dn,ff:pn,gf:hn,Mc:fn,Hg:mn,Ig:yn,hf:bn,_c:vn,ke:wn,jf:_n,Ne:En,Jg:Sn,Sb:Cn,vf:Pn,Cf:qn,Xe:Fn,Pd:Dn,Od:Bn,dc:Rn,ec:Mn,gc:In,Nd:On,Md:jn,Ld:Hn,_b:Vn,Kg:Wn,Lg:zn,Mg:Gn,vc:Yn,Ye:Xn,$b:Kn,bc:Qn,Kc:Jn,lh:ei,Jb:ti,Ob:ri,Ng:oi,Og:ni,be:ai,de:ui,ae:ci,Uc:li,ce:di,Vc:pi,ee:hi,Ze:fi,Vb:mi,Wb:gi,Pg:yi,He:bi,Kd:vi,Qg:wi,Ja:_i,mh:Ei,ac:Si,Jd:Ci,Id:ki,Ec:xi,fc:Ti,hc:Ai,Rg:Fi,Hd:Bi,Gd:Ri,wc:Mi,Dc:ji,Bc:Ui,Dd:$i,Fd:Ni,Ed:Hi,Cd:Vi,Ie:Wi,Je:zi,Bd:Gi,Ad:Yi,zd:Xi,yd:Zi,Yc:Ki,ie:Qi,xd:Ji,Zb:ea,wd:ta,Se:ra,Sg:oa,Rb:na,Lc:aa,$d:sa,Tg:ua,Ug:ca,of:la,pf:da,Qb:pa,Vg:ha,vd:fa,Mb:ma,Lb:ga,fe:ya,sf:ba,Wg:Ea,ud:Sa,_e:Ca,We:ka,Pb:xa,td:Ta,Oe:Aa,Xb:Pa,Pe:qa,Qe:Fa,Xg:La,sd:Da,Yg:Ba,Zg:Ra,_g:Ma,$g:Ia,ah:Oa,bh:ja,ch:Ua,dh:$a,dd:Na,eh:Ha,fh:Va,gh:Wa,hh:za,lf:Ga,Kb:Ya,ih:Xa,cd:Za,Fc:Ka,jh:Qa,kh:es,Xf:ts,Yf:os,uc:ns,pc:is,Zf:as,_f:ss,Wf:us,Vf:cs,tc:ls,oc:ds,Uf:ps,Tf:hs,Sf:fs,Rf:ms,sc:gs,nc:ys,Qf:bs,Pf:vs,Df:ws,Ef:_s,qc:Es,mc:Ss,cc:Cs,Ff:ks,Tc:xs,Rc:Ts,Gf:As,Sc:Ps,Pc:qs,Hf:Fs,Qc:Ls,Oc:Ds,If:Bs,rd:Rs,Jf:Ms,pd:Is,od:Os,Kf:js,nd:Us,Lf:$s,md:Ns,Mf:Hs,mf:Ws,Xd:zs,kd:Gs,ld:Ys,Ib:Xs,Ac:Zs,yc:Ks,zc:Qs,xc:Js,nf:eu,Nf:tu,Of:ru,La:ou,Eb:(e,t,r)=>A.copyWithin(e,t,t+r),ob:e=>{var t=A.length,r=2147483648;if((e>>>=0)>r)return!1;for(var o,n,i=1;i<=4;i*=2){var a=t*(1+.2/i);a=Math.min(a,e+100663296);var s=Math.min(r,(o=Math.max(e,a))+((n=65536)-o%n)%n);if(nu(s))return!0}return!1},_a:function(e,t,r,o,n,i,a,s,c){const l=u.UTF8ToString(e,e+t),d=u.HEAPU8.subarray(n,n+i),p=u.emscripten_ubq_codec_audioDecoderNextHandle++,h={codec:l,sampleRate:r,numberOfChannels:o,description:d};try{const e=u.emscripten_ubq_codec_createAudioDecoder(a,s,c);AudioDecoder.isConfigSupported(h).then((t=>{e.configUnsupported=!t}),(()=>{e.configUnsupported=!0})),e.configure(h),u.emscripten_ubq_codec_audioDecoders.set(p,{audioDecoder:e,decoderConfig:h,leftBufferPtr:a,rightBufferPtr:s,bufferLength:c})}catch(e){return u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:p})},Ua:function(e,t,r,o,n,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_audioEncoderNextHandle++,c={codec:a,sampleRate:r,numberOfChannels:o,bitrate:n};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: "+o,e+="; bit rate: "+n,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},bb:function(e,t,r,o,n,i,a){const s=u.UTF8ToString(e,e+t),c=u.HEAPU8.subarray(n,n+i),l=u.emscripten_ubq_codec_videoDecoderNextHandle++,d={codec:s,codedWidth:r,codedHeight:o,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})},Xa:function(e,t,r,o,n,i){const a=u.UTF8ToString(e,e+t),s=u.emscripten_ubq_codec_videoEncoderNextHandle++,c=u.specialHTMLTargets["!canvas"];c.width=r,c.height=o;const l={codec:a,width:r,height:o,avc:{format:"annexb"},framerate:n};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"+o,u.emscripten_ubq_codec_createNativeResult({error:e})}return u.emscripten_ubq_codec_createNativeResult({handle:s})},Pa:function(e,t,r,o,n,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(n,n+i),l=new EncodedAudioChunk({type:t?"key":"delta",timestamp:r,duration:o,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})},Qa:function(e,t,r,o,n,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(n,n+i),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:o,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})},V: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)}},pa: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)},sa: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)}},qa: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)},Ta:function(e,t,r){const o=1e6,n=u.emscripten_ubq_codec_audioEncoders.get(e),i=n.audioEncoderConfig.sampleRate,a=n.audioEncoderConfig.numberOfChannels,s=r/a,c=Math.round(o*(n.frameIndex*s/i)),l=Math.round(o*(s/i)),d=u.HEAPF32.subarray(t/4,t/4+r),p=new AudioData({format:"f32",sampleRate:i,numberOfFrames:s,numberOfChannels:a,duration:l,timestamp:c,data:d});n.audioEncoder.encode(p),n.frameIndex++,p.close()},Wa:function(e,t,r){const o=1e6,n=u.emscripten_ubq_codec_videoEncoders.get(e),i=Math.round(o*(n.frameIndex/n.encoderConfig.framerate)),a=n.frameIndex%n.groupOfPictures==0,s=Math.round(o/n.encoderConfig.framerate),c=u.specialHTMLTargets["!canvas"],l=new VideoFrame(c,{timestamp:i,duration:s});n.videoEncoder.encode(l,{keyFrame:a}),l.close(),n.frameIndex++},Sa:async function(e,t){const r=u.emscripten_ubq_codec_audioEncoders.get(e);await r.audioEncoder.flush(),u.emscripten_ubq_codec_onFinalizedAudioEncoding(e,t)},Va:async function(e,t){const r=u.emscripten_ubq_codec_videoEncoders.get(e);await r.videoEncoder.flush(),u.emscripten_ubq_codec_onFinalizedVideoEncoding(e,t)},Za: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},X:async function(e,t,r){const o=u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder;o.shouldDropFrames=r,o.flushing=!0;try{await o.flush()}catch{}o.flushing=!1,o.shouldDropFrames=!1,o.decodedFrames=t},oa:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.decodeQueueSize},ra:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.decodedFrames},W:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.writtenFrames},Ya:function(e){return u.emscripten_ubq_codec_audioDecoders.get(e).audioDecoder.flushing},ab:function(e){return u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.flushing},Y:function(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder&&"undefined"!=typeof AudioDecoder&&"undefined"!=typeof AudioEncoder},$a:function(e,t){u.emscripten_ubq_codec_videoDecoders.get(e).videoDecoder.requestedFrame=t},Ra:function(e,t,r){const o=u.emscripten_ubq_codec_videoDecoders.get(e),n=u.HEAPU32.subarray(t/4,t/4+r);o.videoDecoder.textures=[];for(let e=0;e<r;e++)o.videoDecoder.textures[e]=gr.textures[n[e]]},ve:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return!!(null==t?void 0:t.allocate())},la:function(){u.emscripten_ubq_asyncFetchManager.clear()},ka:function(e,t,r,o){return u.emscripten_ubq_asyncFetchManager.createHeader(e,t,r,o)},ye:function(e){u.emscripten_ubq_asyncFetchManager.deleteHeader(e)},ze:function(e,t,r,o,n,i,a,s,c){return u.emscripten_ubq_asyncFetchManager.fetch(e,t,r,o,n,i,a,s,c).handle},aa:function(e){return u.emscripten_ubq_asyncFetchManager.deleteProcess(e)},xe: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},ue:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultAddress:-1},te:function(e){const t=u.emscripten_ubq_asyncFetchManager.getProcess(e);return(null==t?void 0:t.isAllocated())?t.resultLength:-1},ia: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},we:function(e){var t,r;return null!==(r=null===(t=u.emscripten_ubq_asyncFetchManager.getProcess(e))||void 0===t?void 0:t.totalBytes)&&void 0!==r?r:0},db:function(){return!!u.emscripten_ubq_settings_forceWebGL1},ta:cu,Z:e=>{gr.currentContext==e&&(gr.currentContext=0),gr.deleteContext(e)},hb:e=>(e=>{var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=()=>t.createVertexArrayOES(),e.deleteVertexArray=e=>t.deleteVertexArrayOES(e),e.bindVertexArray=e=>t.bindVertexArrayOES(e),e.isVertexArray=e=>t.isVertexArrayOES(e),1})(gr.contexts[e].GLctx),gb:e=>(e=>{var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=(e,r)=>t.drawBuffersWEBGL(e,r),1})(gr.contexts[e].GLctx),fb:e=>(e=>!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")))(gr.contexts[e].GLctx),$:(e,t)=>{var r=gr.getContext(e),o=ke(t);return o.startsWith("GL_")&&(o=o.substr(3)),!!r.GLctx.getExtension(o)},eb:(e,t)=>{if(!t)return-5;if(!(e=gr.contexts[e]))return-3;var r=e.GLctx;if(!r)return-3;r=r.getContextAttributes(),F[t>>2]=r.alpha,F[t+4>>2]=r.depth,F[t+8>>2]=r.stencil,F[t+12>>2]=r.antialias,F[t+16>>2]=r.premultipliedAlpha,F[t+20>>2]=r.preserveDrawingBuffer;var o=r.powerPreference&&au.indexOf(r.powerPreference);return F[t+24>>2]=o,F[t+28>>2]=r.failIfMajorPerformanceCaveat,F[t+32>>2]=e.version,F[t+36>>2]=0,0},nb:e=>gr.makeContextCurrent(e)?0:-5,wb:(e,t)=>{var r=0;return du().forEach(((o,n)=>{var i=t+r;L[e+4*n>>2]=i,((e,t)=>{for(var r=0;r<e.length;++r)T[t++>>0]=e.charCodeAt(r);T[t>>0]=0})(o,i),r+=o.length+1})),0},xb:(e,t)=>{var r=du();L[e>>2]=r.length;var o=0;return r.forEach((e=>o+=e.length+1)),L[t>>2]=o,0},Ce:dr,ea:function(e){try{var t=xe.getStreamFromFD(e);return Ce.close(t),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},pb:function(e,t,r,o,n){o=tr(o);try{if(isNaN(o))return 61;var i=xe.getStreamFromFD(e),a=pu(i,t,r,o);return L[n>>2]=a,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},ya:function(e,t,r,o){try{var n=xe.getStreamFromFD(e),i=pu(n,t,r);return L[o>>2]=i,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},vb:function(e,t,r,o){t=tr(t);try{if(isNaN(t))return 61;var n=xe.getStreamFromFD(e);return Ce.llseek(n,t,r),B[o>>3]=BigInt(n.position),n.getdents&&0===t&&0===r&&(n.getdents=null),0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},xa:function(e,t,r,o){try{var n=((e,t,r,o)=>{for(var n=0,i=0;i<r;i++){var a=L[t>>2],s=L[t+4>>2];t+=8;var u=Ce.write(e,T,a,s,o);if(u<0)return-1;n+=u,void 0!==o&&(o+=u)}return n})(xe.getStreamFromFD(e),t,r);return L[o>>2]=n,0}catch(e){if(void 0===Ce||"ErrnoError"!==e.name)throw e;return e.errno}},se:function(e){var t=ke(e),r=localStorage.getItem(t);return null==r?null:ar(r)},pe:function(){return"undefined"!=typeof window?ar(window.location.hostname):ar("")},ib:(e,t)=>(de(A.subarray(e,e+t)),0),y:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},L:function(e,t){var r=ju();try{return Ct(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},G:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},m:function(e,t,r,o){var n=ju();try{return Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},oh:function(e){var t=ju();try{return Ct(e)()}catch(e){if(Uu(t),e!==e+0)throw e;Ou(1,0)}},Ma:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},q:function(e,t){var r=ju();try{return Ct(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},U:function(e,t,r,o,n,i,a,s,u,c,l,d,p,h,f,m){var g=ju();try{return Ct(e)(t,r,o,n,i,a,s,u,c,l,d,p,h,f,m)}catch(e){if(Uu(g),e!==e+0)throw e;Ou(1,0)}},r:function(e,t,r){var o=ju();try{return Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},t:function(e,t,r,o){var n=ju();try{return Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},T:function(e,t,r,o,n){var i=ju();try{return Ct(e)(t,r,o,n)}catch(e){if(Uu(i),e!==e+0)throw e;Ou(1,0)}},Ge:function(e,t,r,o,n,i){var a=ju();try{return Ct(e)(t,r,o,n,i)}catch(e){if(Uu(a),e!==e+0)throw e;Ou(1,0)}},Ia:function(e,t,r,o,n,i,a){var s=ju();try{return Ct(e)(t,r,o,n,i,a)}catch(e){if(Uu(s),e!==e+0)throw e;Ou(1,0)}},Ha:function(e,t,r,o,n,i,a,s,u,c){var l=ju();try{return Ct(e)(t,r,o,n,i,a,s,u,c)}catch(e){if(Uu(l),e!==e+0)throw e;Ou(1,0)}},Q:function(e){var t=ju();try{Ct(e)()}catch(e){if(Uu(t),e!==e+0)throw e;Ou(1,0)}},u:function(e,t){var r=ju();try{Ct(e)(t)}catch(e){if(Uu(r),e!==e+0)throw e;Ou(1,0)}},C:function(e,t,r,o){var n=ju();try{Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},F:function(e,t,r){var o=ju();try{Ct(e)(t,r)}catch(e){if(Uu(o),e!==e+0)throw e;Ou(1,0)}},p:function(e,t,r,o){var n=ju();try{Ct(e)(t,r,o)}catch(e){if(Uu(n),e!==e+0)throw e;Ou(1,0)}},D:function(e,t,r,o,n){var i=ju();try{Ct(e)(t,r,o,n)}catch(e){if(Uu(i),e!==e+0)throw e;Ou(1,0)}},Fe:function(e,t,r,o,n,i){var a=ju();try{Ct(e)(t,r,o,n,i)}catch(e){if(Uu(a),e!==e+0)throw e;Ou(1,0)}},De:function(e,t,r,o,n,i,a){var s=ju();try{Ct(e)(t,r,o,n,i,a)}catch(e){if(Uu(s),e!==e+0)throw e;Ou(1,0)}},nh:function(e,t,r,o,n,i,a,s){var u=ju();try{Ct(e)(t,r,o,n,i,a,s)}catch(e){if(Uu(u),e!==e+0)throw e;Ou(1,0)}},Ee:function(e,t,r,o,n,i,a,s,u,c){var l=ju();try{Ct(e)(t,r,o,n,i,a,s,u,c)}catch(e){if(Uu(l),e!==e+0)throw e;Ou(1,0)}},ha:function(){return"undefined"!=typeof localStorage},na:function(e,t){const r=It.toValue(t),o=u.ctx;o.bindTexture(o.TEXTURE_2D,gr.textures[e]),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,r)},a:S,Ga:function(e,t){var r=ke(e),o=ke(t);localStorage.setItem(r,o)},jb:(e,t,r,o,n)=>gu(e,t,r,o)},Pu=function(){var e,t,r,n,i={a:Au};function a(e,t){var r;return Pu=e.exports,wt=Pu.th,r=Pu.ph,N.unshift(r),X(),Pu}if(Y(),u.instantiateWasm)try{return u.instantiateWasm(i,a)}catch(e){k(`Module.instantiateWasm callback failed with error: ${e}`),o(e)}return(e=E,t=K,r=i,n=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||J(t)||b||"function"!=typeof fetch?re(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return k(`wasm streaming compile failed: ${e}`),k("falling back to ArrayBuffer instantiation"),re(t,r,n)}))))).catch(o),{}}(),qu=u._malloc=e=>(qu=u._malloc=Pu.qh)(e),Fu=u._main=(e,t)=>(Fu=u._main=Pu.rh)(e,t),Lu=u._free=e=>(Lu=u._free=Pu.sh)(e),Du=(u._ma_malloc_emscripten=(e,t)=>(u._ma_malloc_emscripten=Pu.uh)(e,t),u._ma_free_emscripten=(e,t)=>(u._ma_free_emscripten=Pu.vh)(e,t),u._ma_device_process_pcm_frames_capture__webaudio=(e,t,r)=>(Du=u._ma_device_process_pcm_frames_capture__webaudio=Pu.wh)(e,t,r)),Bu=u._ma_device_process_pcm_frames_playback__webaudio=(e,t,r)=>(Bu=u._ma_device_process_pcm_frames_playback__webaudio=Pu.xh)(e,t,r),Ru=e=>(Ru=Pu.yh)(e),Mu=e=>(Mu=Pu.zh)(e),Iu=(e,t)=>(Iu=Pu.Ah)(e,t),Ou=(e,t)=>(Ou=Pu.Bh)(e,t),ju=()=>(ju=Pu.Ch)(),Uu=e=>(Uu=Pu.Dh)(e),$u=e=>($u=Pu.Eh)(e),Nu=e=>(Nu=Pu.Fh)(e),Hu=e=>(Hu=Pu.Gh)(e),Vu=(e,t,r)=>(Vu=Pu.Hh)(e,t,r),Wu=e=>(Wu=Pu.Ih)(e);function zu(e=h){function r(){Tu||(Tu=!0,u.calledRun=!0,I||(u.noFSInit||Ce.init.initialized||Ce.init(),Ce.ignorePermissions=!1,ve.init(),ie(N),ie(H),t(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Gu&&function(e=[]){var t=Fu;e.unshift(f);var r=e.length,o=$u(4*(r+1)),n=o;e.forEach((e=>{L[n>>2]=yu(e),n+=4})),L[n>>2]=0;try{var i=t(r,o);return lr(i,!0),i}catch(e){return ur(e)}}(e),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)e=u.postRun.shift(),V.unshift(e);var e;ie(V)}()))}W>0||(function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)e=u.preRun.shift(),$.unshift(e);var e;ie($)}(),W>0||(u.setStatus?(u.setStatus("Running..."),setTimeout((function(){setTimeout((function(){u.setStatus("")}),1),r()}),1)):r()))}if(u.___start_em_js=2391075,u.___stop_em_js=2391910,u.addRunDependency=Y,u.removeRunDependency=X,u.FS_createPath=Ce.createPath,u.FS_createLazyFile=Ce.createLazyFile,u.FS_createDevice=Ce.createDevice,u.ccall=(e,t,r,o,n)=>{var i={string:e=>{var t=0;return null!=e&&0!==e&&(t=yu(e)),t},array:e=>{var t=$u(e.length);return mu(e,t),t}},a=(e=>u["_"+e])(e),s=[],c=0;if(o)for(var l=0;l<o.length;l++){var d=i[r[l]];d?(0===c&&(c=ju()),s[l]=d(o[l])):s[l]=o[l]}var p,h=a.apply(null,s);return p=h,0!==c&&Uu(c),h=function(e){return"string"===t?ke(e):"boolean"===t?Boolean(e):e}(p),h},u.getValue=function(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return T[e>>0];case"i16":return P[e>>1];case"i32":return F[e>>2];case"i64":return B[e>>3];case"float":return D[e>>2];case"double":return M[e>>3];case"*":return L[e>>2];default:Z(`invalid type for getValue: ${t}`)}},u.UTF8ToString=ke,u.specialHTMLTargets=su,u.FS_createPreloadedFile=Ce.createPreloadedFile,u.FS_createDataFile=Ce.createDataFile,u.FS_unlink=Ce.unlink,G=function e(){Tu||zu(),Tu||(G=e)},u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var Gu=!0;return u.noInitialRun&&(Gu=!1),zu(),e.ready});"object"==typeof e&&"object"==typeof t?t.exports=o:"function"==typeof define&&define.amd&&define([],(()=>o))}}),dt=s(A()),pt=s(tt()),ht=Symbol("PROXY");function ft(e,t){Object.defineProperty(e[t],ht,{value:{type:"getter"},writable:!1})}function mt(e,t){Object.defineProperty(e[t],ht,{value:{type:"setter"},writable:!1})}var gt={};var yt=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,o){return this.useInternalAPI((n=>bt(n.setValue(e,t,r,o))))}getValue(e,t,r){return this.useInternalAPI((o=>bt(o.getValue(e,t,r))))}async execute(e,t){return new Promise(((r,o)=>{this.useInternalAPI((n=>n.ubqExecute(e,t,(e=>{try{const t=bt(e);r(t)}catch(e){o(e)}})))).delete()}))}};function bt(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 vt(e){return new Promise(((t,r)=>{e((e=>{try{const r=bt(e);t(r)}catch(e){r(e)}}))}))}u([mt],yt.prototype,"setValue",1),u([ft],yt.prototype,"getValue",1);var wt,_t,Et,St,Ct,kt,xt,Tt=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r},At=new WeakMap,Pt={assets:[],total:0,currentPage:0,nextPage:void 0},AssetAPI=class{constructor(e){p(this,_t),p(this,St),p(this,kt),p(this,wt,void 0),c(this,"onAssetSourceAdded",(e=>{const t=d(this,wt).subscribeToAssetSourceAdded(e);return()=>{d(this,wt).isDeleted()||bt(d(this,wt).unsubscribe(t))}})),c(this,"onAssetSourceRemoved",(e=>{const t=d(this,wt).subscribeToAssetSourceRemoved(e);return()=>{d(this,wt).isDeleted()||bt(d(this,wt).unsubscribe(t))}})),h(this,wt,e)}addSource(e){const t=e.getSupportedMimeTypes?.bind(e),r=e.getGroups?.bind(e),o=e.applyAsset?.bind(e),n=e.applyAssetToBlock?.bind(e),i=e.addAsset?.bind(e),a=e.removeAsset?.bind(e),s=e.credits,u=e.license;bt(d(this,wt).addAssetSource(e.id,(async(t,r)=>{try{const o={...t,tags:Tt(t.tags),groups:Tt(t.groups),excludeGroups:Tt(t.excludeGroups)},n=await e.findAssets(o);if(n){const t={...n,assets:n.assets.map((t=>qt(t,e.id)))};r.invoke(t)}else r.invoke(Pt)}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,o?async(e,t)=>{try{const r=await o(f(this,_t,Et).call(this,e));t.invoke(r)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,n?async(e,t,r)=>{try{await n(f(this,_t,Et).call(this,e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null,i?async e=>{i(e)}:null,a?async e=>{a(e)}:null)),f(this,St,Ct).call(this,e.id,e)}addLocalSource(e,t,r,o){bt(d(this,wt).addLocalAssetSource(e,t??[],r?async(e,t)=>{try{const o=await r(f(this,_t,Et).call(this,e));t.invoke(o)}catch(e){t.invoke(e.message??"Unknown error in user-defined `applyAsset`")}}:null,o?async(e,t,r)=>{try{await o(f(this,_t,Et).call(this,e),t),r.invoke({})}catch(e){r.invoke(e.message??"Unknown error in user-defined `applyAssetToBlock`")}}:null))}removeSource(e){bt(d(this,wt).removeAssetSource(e)),f(this,kt,xt).call(this,e)}findAllSources(){return Tt(d(this,wt).findAllAssetSources())}findAssets(e,t){return new Promise(((r,o)=>{let n=t?.tags??[];Array.isArray(n)||(n=[n]);const i={perPage:t?.perPage??0,page:t?.page??0,query:t?.query??"",tags:n,groups:t?.groups??[],excludeGroups:t?.excludeGroups??[],locale:t?.locale??""};d(this,wt).findAssetSourceAssets(e,i,(e=>{try{const t=bt(e);r({...t,nextPage:-1===t.nextPage?void 0:t.nextPage})}catch(e){o(e)}}))}))}async getGroups(e){return vt((t=>d(this,wt).getAssetSourceGroups(e,t))).then((e=>Tt(e)))}getSupportedMimeTypes(e){return Tt(bt(d(this,wt).getAssetSourceSupportedMimeTypes(e)))}getCredits(e){const t=bt(d(this,wt).getAssetSourceCredits(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}getLicense(e){const t=bt(d(this,wt).getAssetSourceLicense(e));if(t.name||t.url)return t.url?t:{name:t.name,url:void 0}}canManageAssets(e){return!!At.get(d(this,wt))?.get(e)?.canManageAssets}addAssetToSource(e,t){bt(d(this,wt).addAssetToSource(e,t))}removeAssetFromSource(e,t){bt(d(this,wt).removeAssetFromSource(e,t))}async apply(e,t){return new Promise(((r,o)=>{d(this,wt).applyAssetSourceAsset(e,qt(t,e),(e=>{try{const t=bt(e);d(this,wt).isValid(t)?r(t):r(void 0)}catch(e){o(e)}}))}))}async applyToBlock(e,t,r){return vt((o=>d(this,wt).applyAssetSourceAssetToBlock(e,qt(t,e),r,o)))}async defaultApplyAsset(e){return new Promise(((t,r)=>{d(this,wt).defaultApplyAsset(qt(e,""),(e=>{try{const r=bt(e);d(this,wt).isValid(r)?t(r):t(void 0)}catch(e){r(e)}}))}))}async defaultApplyAssetToBlock(e,t){return vt((r=>d(this,wt).defaultApplyAssetToBlock(qt(e,""),t,r)))}dispose(){At.delete(d(this,wt))}};function qt(e,t){return"context"in e&&e.context.sourceId===t?e:{...e,context:{sourceId:t}}}wt=new WeakMap,_t=new WeakSet,Et=function(e){const t={...e};return 0===t.groups?.length&&delete t.groups,t.locale||delete t.locale,t.label||delete t.label,0===t.tags?.length&&delete t.tags,t.credits?.name||t.credits?.url?t.credits.url||delete t.credits.url:delete t.credits,t.license?.name||t.license?.url?t.license.url||delete t.license.url:delete t.license,t.utm?.source||t.utm?.medium?(t.utm.source||delete t.utm.source,t.utm.medium||delete t.utm.medium):delete t.utm,t},St=new WeakSet,Ct=function(e,t){At.has(d(this,wt))||At.set(d(this,wt),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/`),At.get(d(this,wt)).set(e,{canManageAssets:t.canManageAssets})},kt=new WeakSet,xt=function(e){At.get(d(this,wt))?.delete(e)};var Ft=class extends TypeError{constructor(e,t){let r;const{message:o,...n}=e,{path:i}=e;super(0===i.length?o:"At path: "+i.join(".")+" -- "+o),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,n),this.name=this.constructor.name,this.failures=()=>{var o;return null!=(o=r)?o:r=[e,...t()]}}};function Lt(e){return"object"==typeof e&&null!=e}function Dt(e){return"string"==typeof e?JSON.stringify(e):""+e}function Bt(e,t,r,o){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:n,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+Dt(o)+"`"}=e;return{value:o,type:a,refinement:s,key:n[n.length-1],path:n,branch:i,...e,message:u}}function*Rt(e,t,r,o){var n;Lt(n=e)&&"function"==typeof n[Symbol.iterator]||(e=[e]);for(const n of e){const e=Bt(n,t,r,o);e&&(yield e)}}function*Mt(e,t,r={}){const{path:o=[],branch:n=[e],coerce:i=!1,mask:a=!1}=r,s={path:o,branch:n};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&Lt(t.schema)&&Lt(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=Mt(c,l,{path:void 0===r?o:[...o,r],branch:void 0===r?n:[...n,c],coerce:i,mask:a});for(const o of t)o[0]?(u=!1,yield[o[0],void 0]):i&&(c=o[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):Lt(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 It=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:o,refiner:n,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=o?(e,t)=>Rt(o(e,t),t,this,e):()=>[],this.refiner=n?(e,t)=>Rt(n(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=Ot(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=Ot(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){const r=Ot(e,t);return!r[0]}(e,this)}mask(e){return function(e,t){const r=Ot(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return Ot(e,this,t)}};function Ot(e,t,r={}){const o=Mt(e,t,r),n=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(o);if(n[0]){return[new Ft(n[0],(function*(){for(const e of o)e[0]&&(yield e[0])})),void 0]}return[void 0,n[1]]}function jt(e,t){return new It({type:e,schema:null,validator:t})}function Ut(e){return new It({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,o]of t.entries())yield[r,o,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Dt(e)})}function $t(){return jt("boolean",(e=>"boolean"==typeof e))}function Nt(){return jt("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+Dt(e)))}function Ht(){return jt("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Dt(e)))}function Vt(e){const t=e?Object.keys(e):[],r=jt("never",(()=>!1));return new It({type:"object",schema:e||null,*entries(o){if(e&&Lt(o)){const n=new Set(Object.keys(o));for(const r of t)n.delete(r),yield[r,o[r],e[r]];for(const e of n)yield[e,o[e],r]}},validator:e=>Lt(e)||"Expected an object, but received: "+Dt(e),coercer:e=>Lt(e)?{...e}:e})}function Wt(){return jt("string",(e=>"string"==typeof e||"Expected a string, but received: "+Dt(e)))}function zt(e,t,r={}){const{exclusive:o}=r;return Xt(e,"max",(r=>o?r<t:r<=t||"Expected a "+e.type+" less than "+(o?"":"or equal to ")+t+" but received `"+r+"`"))}function Gt(e,t,r={}){const{exclusive:o}=r;return Xt(e,"min",(r=>o?r>t:r>=t||"Expected a "+e.type+" greater than "+(o?"":"or equal to ")+t+" but received `"+r+"`"))}function Yt(e){return Xt(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 Xt(e,t,r){return new It({...e,*refiner(o,n){yield*e.refiner(o,n);const i=Rt(r(o,n),n,e,o);for(const e of i)yield{...e,refinement:t}}})}function Zt(e,t,r){const[o]=Ot(t,r);if(o)throw o.message=`Error in argument '${e}': ${o.message}`,o}function Kt(){const e=/image\/(png|jpeg|webp|x-tga)|video\/(mp4|quicktime)|application\/octet-stream|application\/pdf/;return jt("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 Qt(){const e=["Free","VerticalStack","HorizontalStack","DepthStack"];return jt("SceneLayout",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}var Jt,er=(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))(er||{}),tr=er;(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!")}})(Jt||(Jt={}));var rr="undefined"!=typeof Blob?Blob:(()=>{try{return nt().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=tr.Png,r={}){Zt("handle",e,Ht()),Zt("mimeType",t,Kt()),Zt("options",r,Vt());const o=null!=r.targetWidth&&null!=r.targetHeight,n=r.jpegQuality??.9,i=r.webpQuality??1,a=r.pngCompressionLevel??5;return Zt("jpegQuality",n,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("webpQuality",i,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("pngCompressionLevel",a,Gt(zt(Nt(),9),0)),null==r.targetWidth&&null==r.targetHeight||(Zt("targetWidth",r.targetWidth,Ht()),Zt("targetHeight",r.targetHeight,Ht())),new Promise(((s,u)=>{this.#e.exportToBuffer(e,t,(e=>{"error"in e?u(e.error):s(new rr([e],{type:t}))}),{pngCompressionLevel:a,jpegQuality:n,webpQuality:i,useTargetSize:o,targetWidth:r.targetWidth??0,targetHeight:r.targetHeight??0,exportPdfWithHighCompatibility:r.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:r.exportPdfWithUnderlayer??!1,underlayerSpotColorName:r.underlayerSpotColorName??"",underlayerOffset:r.underlayerOffset??0})}))}async exportWithColorMask(e,t=tr.Png,r,o,n,i={}){Zt("handle",e,Ht()),Zt("mimeType",t,Kt()),Zt("options",i,Vt());const a=null!=i.targetWidth&&null!=i.targetHeight,s=i.jpegQuality??.9,u=i.webpQuality??1,c=i.pngCompressionLevel??5;return Zt("jpegQuality",s,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("webpQuality",u,Gt(zt(Ht(),1),0,{exclusive:!0})),Zt("pngCompressionLevel",c,Gt(zt(Nt(),9),0)),null==i.targetWidth&&null==i.targetHeight||(Zt("targetWidth",i.targetWidth,Ht()),Zt("targetHeight",i.targetHeight,Ht())),new Promise(((l,d)=>{this.#e.exportWithColorMaskToBuffer(e,t,r,o,n,((e,r)=>{if("error"in e)d(e.error);else if("error"in r)d(r.error);else{const o=new rr([e],{type:t}),n=new rr([r],{type:t});l([o,n])}}),{pngCompressionLevel:c,jpegQuality:s,webpQuality:u,useTargetSize:a,targetWidth:i.targetWidth??0,targetHeight:i.targetHeight??0,exportPdfWithHighCompatibility:i.exportPdfWithHighCompatibility??!0,exportPdfWithUnderlayer:i.exportPdfWithUnderlayer??!1,underlayerSpotColorName:i.underlayerSpotColorName??"",underlayerOffset:i.underlayerOffset??0})}))}async exportVideo(e,t=tr.Mp4,r,o){throw new Error("Method not implemented. An implementation is available on the BlockAPI at engine.block or cesdk.engine.block")}async loadFromString(e){return Zt("content",e,Wt()),vt((t=>this.#e.loadBlocksFromString(e,t))).then((e=>Tt(e)))}async saveToString(e){return Zt("blocks",e,Ut(Ht())),vt((t=>this.#e.saveBlocksToString(e,t)))}create(e){return Zt("type",e,Wt()),bt(this.#e.create(e))}createFill(e){return Zt("type",e,Wt()),bt(this.#e.createFill(e))}getType(e){return Zt("id",e,Nt()),bt(this.#e.getType(e))}getKind(e){return Zt("id",e,Nt()),bt(this.#e.getKind(e))}setKind(e,t){Zt("id",e,Nt()),bt(this.#e.setKind(e,t))}select(e){return Zt("id",e,Nt()),bt(this.#e.select(e))}setSelected(e,t){return Zt("id",e,Nt()),Zt("selected",t,$t()),bt(this.#e.setSelected(e,t))}isSelected(e){return Zt("id",e,Nt()),bt(this.#e.isSelected(e))}findAllSelected(){return Tt(this.#e.findAllSelected())}onSelectionChanged=e=>{const t=this.#e.subscribeToSelectionChange(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};onClicked=e=>{const t=this.#e.subscribeToBlockClicked(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};isGroupable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isGroupable(e))}group(e){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.group(e))}ungroup(e){return Zt("id",e,Ht()),bt(this.#e.ungroup(e))}enterGroup(e){return Zt("id",e,Ht()),bt(this.#e.enterGroup(e))}exitGroup(e){return Zt("id",e,Ht()),bt(this.#e.exitGroup(e))}isCombinable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isCombinable(e))}combine(e,t){return Zt("ids",e,Ut(Ht())),Zt("op",t,Wt()),bt(this.#e.combine(e,t))}setName(e,t){return Zt("id",e,Nt()),Zt("name",t,Wt()),bt(this.#e.setName(e,t))}getName(e){return Zt("id",e,Nt()),bt(this.#e.getName(e))}getUUID(e){return Zt("id",e,Nt()),bt(this.#e.getUUID(e))}findByName(e){Zt("name",e,Wt());const t=this.#e.findByName(e);return Tt(t)}findByType(e){Zt("type",e,Wt());const t=bt(this.#e.findByType(e));return Tt(t)}findByKind(e){Zt("kind",e,Wt());const t=bt(this.#e.findByKind(e));return Tt(t)}findAll(){return Tt(this.#e.findAll())}findAllPlaceholders(){return Tt(this.#e.findAllPlaceholders())}createShape(e){return Zt("type",e,Wt()),bt(this.#e.createShape(e))}hasShape(e){return Zt("id",e,Nt()),bt(this.#e.hasShape(e))}getShape(e){return Zt("id",e,Nt()),bt(this.#e.getShape(e))}setShape(e,t){return Zt("id",e,Nt()),Zt("shape",t,Nt()),bt(this.#e.setShape(e,t))}isVisible(e){return Zt("id",e,Nt()),bt(this.#e.isVisible(e))}setVisible(e,t){return Zt("id",e,Nt()),Zt("visible",t,$t()),bt(this.#e.setVisible(e,t))}isClipped(e){return Zt("id",e,Nt()),bt(this.#e.isClipped(e))}setClipped(e,t){return Zt("id",e,Nt()),Zt("clipped",t,$t()),bt(this.#e.setClipped(e,t))}isTransformLocked(e){return Zt("id",e,Nt()),bt(this.#e.isTransformLocked(e))}setTransformLocked(e,t){return Zt("id",e,Nt()),Zt("locked",t,$t()),bt(this.#e.setTransformLocked(e,t))}getPositionX(e){return Zt("id",e,Nt()),bt(this.#e.getPositionX(e))}getPositionXMode(e){return Zt("id",e,Nt()),bt(this.#e.getPositionXMode(e))}getPositionY(e){return Zt("id",e,Nt()),bt(this.#e.getPositionY(e))}getPositionYMode(e){return Zt("id",e,Nt()),bt(this.#e.getPositionYMode(e))}setPositionX(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setPositionX(e,t))}setPositionXMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setPositionXMode(e,t))}setPositionY(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setPositionY(e,t))}setPositionYMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setPositionYMode(e,t))}setAlwaysOnTop(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setAlwaysOnTop(e,t))}setAlwaysOnBottom(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setAlwaysOnBottom(e,t))}isAlwaysOnTop(e){return Zt("id",e,Nt()),bt(this.#e.isAlwaysOnTop(e))}isAlwaysOnBottom(e){return Zt("id",e,Nt()),bt(this.#e.isAlwaysOnBottom(e))}bringToFront(e){return Zt("id",e,Ht()),bt(this.#e.bringToFront(e))}sendToBack(e){return Zt("id",e,Ht()),bt(this.#e.sendToBack(e))}bringForward(e){return Zt("id",e,Ht()),bt(this.#e.bringForward(e))}sendBackward(e){return Zt("id",e,Ht()),bt(this.#e.sendBackward(e))}getRotation(e){return Zt("id",e,Nt()),bt(this.#e.getRotation(e))}setRotation(e,t){return Zt("id",e,Nt()),Zt("radians",t,Ht()),bt(this.#e.setRotation(e,t))}getFlipHorizontal(e){return Zt("id",e,Nt()),bt(this.#e.getFlip(e)).horizontal}getFlipVertical(e){return Zt("id",e,Nt()),bt(this.#e.getFlip(e)).vertical}setFlipHorizontal(e,t){return Zt("id",e,Nt()),Zt("flip",t,$t()),bt(this.#e.setFlipHorizontal(e,t))}setFlipVertical(e,t){return Zt("id",e,Nt()),Zt("flip",t,$t()),bt(this.#e.setFlipVertical(e,t))}hasContentFillMode(e){return Zt("id",e,Nt()),bt(this.#e.hasContentFillMode(e))}getWidth(e){return Zt("id",e,Nt()),bt(this.#e.getWidth(e))}getWidthMode(e){return Zt("id",e,Nt()),bt(this.#e.getWidthMode(e))}getHeight(e){return Zt("id",e,Nt()),bt(this.#e.getHeight(e))}getHeightMode(e){return Zt("id",e,Nt()),bt(this.#e.getHeightMode(e))}setWidth(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setWidth(e,t))}setWidthMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setWidthMode(e,t))}setHeight(e,t){return Zt("id",e,Nt()),Zt("value",t,Ht()),bt(this.#e.setHeight(e,t))}setHeightMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setHeightMode(e,t))}getFrameX(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameX(e))}getFrameY(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameY(e))}getFrameWidth(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameWidth(e))}getFrameHeight(e){return Zt("id",e,Nt()),bt(this.#e.getLastFrameHeight(e))}setContentFillMode(e,t){return Zt("id",e,Nt()),bt(this.#e.setContentFillMode(e,t))}getContentFillMode(e){return Zt("id",e,Nt()),bt(this.#e.getContentFillMode(e))}duplicate(e){return Zt("id",e,Nt()),bt(this.#e.duplicate(e))}destroy(e){return Zt("id",e,Nt()),bt(this.#e.destroy(e))}isValid(e){return Zt("id",e,Nt()),this.#e.isValid(e)}getParent(e){return Zt("id",e,Nt()),bt(this.#e.hasParent(e))?bt(this.#e.getParent(e)):null}getChildren(e){Zt("id",e,Nt());const t=bt(this.#e.getChildren(e));return Tt(t)}insertChild(e,t,r){return Zt("parent",e,Ht()),Zt("child",t,Ht()),Zt("index",r,Gt(Ht(),0)),bt(this.#e.insertChild(e,t,r))}appendChild(e,t){return Zt("parent",e,Ht()),Zt("child",t,Ht()),bt(this.#e.appendChild(e,t))}referencesAnyVariables(e){return Zt("id",e,Nt()),bt(this.#e.referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return Zt("id",e,Nt()),bt(this.#e.getGlobalBoundingBoxHeight(e))}getScreenSpaceBoundingBoxXYWH(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.getScreenSpaceBoundingBoxXYWH(e))}alignHorizontally(e,t){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.alignHorizontally(e,t))}alignVertically(e,t){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.alignVertically(e,t))}isAlignable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isAlignable(e))}distributeHorizontally(e){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.distributeHorizontally(e))}distributeVertically(e){return Zt("ids",e,Yt(Ut(Ht()))),bt(this.#e.distributeVertically(e))}isDistributable(e){return Zt("ids",e,Ut(Ht())),bt(this.#e.isDistributable(e))}fillParent(e){return Zt("id",e,Nt()),bt(this.#e.fillParent(e))}resizeContentAware(e,t,r){return Zt("ids",e,Ut(Ht())),Zt("width",t,Ht()),Zt("height",r,Ht()),bt(this.#e.resizeContentAware(e,t,r))}scale(e,t,r=0,o=0){return Zt("id",e,Nt()),bt(this.#e.scale(e,t,r,o))}findAllProperties(e){return Zt("id",e,Nt()),Tt(bt(this.#e.findAllProperties(e)))}isPropertyReadable(e){return Zt("property",e,Wt()),this.#e.isPropertyReadable(e)}isPropertyWritable(e){return Zt("property",e,Wt()),this.#e.isPropertyWritable(e)}getPropertyType(e){Zt("property",e,Wt());return bt(this.#e.getPropertyType(e))}getEnumValues(e){return Zt("enumProperty",e,Wt()),Tt(bt(this.#e.getEnumValues(e)))}setBool(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,$t()),bt(this.#e.setBool(e,t,r))}getBool(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getBool(e,t))}setInt(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Nt()),bt(this.#e.setInt(e,t,r))}getInt(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getInt(e,t))}setFloat(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Ht()),bt(this.#e.setFloat(e,t,r))}getFloat(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getFloat(e,t))}setDouble(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Ht()),bt(this.#e.setDouble(e,t,r))}getDouble(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getDouble(e,t))}setString(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Wt()),bt(this.#e.setString(e,t,r))}getString(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getString(e,t))}setColor(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.setColor(e,t,Jt.fromColor(r)))}getColor(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),Jt.toColor(bt(this.#e.getColor(e,t)))}setColorRGBA(e,t,r,o,n,i=1){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("r",r,Ht()),Zt("g",o,Ht()),Zt("b",n,Ht()),Zt("a",i,Ht()),bt(this.#e.setColorRGBA(e,t,r,o,n,i))}getColorRGBA(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getColorRGBA(e,t))}setColorSpot(e,t,r,o=1){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("name",r,Wt()),Zt("tint",o,Ht()),bt(this.#e.setColorSpot(e,t,r,o))}getColorSpotName(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getColorSpotName(e,t))}getColorSpotTint(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getColorSpotTint(e,t))}setGradientColorStops(e,t,r){Zt("id",e,Nt()),Zt("property",t,Wt());const o=r.map((e=>({color:Jt.fromColor(e.color),stop:e.stop})));return bt(this.#e.setGradientColorStops(e,t,o))}getGradientColorStops(e,t){Zt("id",e,Nt()),Zt("property",t,Wt());const r=bt(this.#e.getGradientColorStops(e,t));return Tt(r).map((e=>({color:Jt.toColor(e.color),stop:e.stop})))}getSourceSet(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),Tt(bt(this.#e.getSourceSet(e,t)))}setSourceSet(e,t,r){Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("sourceSet",r,Ut(Vt({uri:Wt(),width:Ht(),height:Ht()}))),bt(this.#e.setSourceSet(e,t,r))}setEnum(e,t,r){return Zt("id",e,Nt()),Zt("property",t,Wt()),Zt("value",r,Wt()),bt(this.#e.setEnum(e,t,r))}getEnum(e,t){return Zt("id",e,Nt()),Zt("property",t,Wt()),bt(this.#e.getEnum(e,t))}hasCrop(e){return Zt("id",e,Nt()),bt(this.#e.hasCrop(e))}setCropScaleX(e,t){return Zt("id",e,Nt()),Zt("scaleX",t,Ht()),bt(this.#e.setCropScaleX(e,t))}setCropScaleY(e,t){return Zt("id",e,Nt()),Zt("scaleY",t,Ht()),bt(this.#e.setCropScaleY(e,t))}setCropRotation(e,t){return Zt("id",e,Nt()),Zt("rotation",t,Ht()),bt(this.#e.setCropRotation(e,t))}setCropScaleRatio(e,t){return Zt("id",e,Nt()),Zt("scaleRatio",t,Ht()),bt(this.#e.setCropScaleRatio(e,t))}setCropTranslationX(e,t){return Zt("id",e,Nt()),Zt("translationX",t,Ht()),bt(this.#e.setCropTranslationX(e,t))}setCropTranslationY(e,t){return Zt("id",e,Nt()),Zt("translationY",t,Ht()),bt(this.#e.setCropTranslationY(e,t))}resetCrop(e){return Zt("id",e,Nt()),bt(this.#e.resetCrop(e))}getCropScaleX(e){return Zt("id",e,Nt()),bt(this.#e.getCropScaleX(e))}getCropScaleY(e){return Zt("id",e,Nt()),bt(this.#e.getCropScaleY(e))}getCropRotation(e){return Zt("id",e,Nt()),bt(this.#e.getCropRotation(e))}getCropScaleRatio(e){return Zt("id",e,Nt()),bt(this.#e.getCropScaleRatio(e))}getCropTranslationX(e){return Zt("id",e,Nt()),bt(this.#e.getCropTranslationX(e))}getCropTranslationY(e){return Zt("id",e,Nt()),bt(this.#e.getCropTranslationY(e))}adjustCropToFillFrame(e,t){return Zt("id",e,Nt()),Zt("minScaleRatio",t,Ht()),bt(this.#e.adjustCropToFillFrame(e,t))}flipCropHorizontal(e){return Zt("id",e,Nt()),bt(this.#e.flipCropHorizontal(e))}flipCropVertical(e){return Zt("id",e,Nt()),bt(this.#e.flipCropVertical(e))}hasOpacity(e){return Zt("id",e,Nt()),bt(this.#e.hasOpacity(e))}setOpacity(e,t){return Zt("id",e,Nt()),Zt("opacity",t,Ht()),bt(this.#e.setOpacity(e,t))}getOpacity(e){return Zt("id",e,Nt()),bt(this.#e.getOpacity(e))}hasBlendMode(e){return Zt("id",e,Nt()),bt(this.#e.hasBlendMode(e))}setBlendMode(e,t){return Zt("id",e,Nt()),Zt("blendMode",t,Wt()),bt(this.#e.setBlendMode(e,t))}getBlendMode(e){return Zt("id",e,Nt()),bt(this.#e.getBlendMode(e))}hasFillColor(e){return Zt("id",e,Nt()),bt(this.#e.hasFillColor(e))}isIncludedInExport(e){return Zt("id",e,Nt()),bt(this.#e.isIncludedInExport(e))}setIncludedInExport(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setIncludedInExport(e,t))}setFillColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setFillColorRGBA(e,t,r,o,n))}getFillColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getFillColorRGBA(e))}setFillColorEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setFillColorEnabled(e,t))}isFillColorEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isFillColorEnabled(e))}createEffect(e){return Zt("type",e,Wt()),bt(this.#e.createEffect(e))}hasEffects(e){return Zt("id",e,Nt()),bt(this.#e.hasEffects(e))}getEffects(e){Zt("id",e,Nt());const t=bt(this.#e.getEffects(e));return Tt(t)}insertEffect(e,t,r){Zt("id",e,Nt()),Zt("effectId",t,Nt()),Zt("index",r,Gt(Nt(),0)),bt(this.#e.insertEffect(e,t,r))}appendEffect(e,t){Zt("id",e,Nt()),Zt("effectId",t,Nt()),bt(this.#e.appendEffect(e,t))}removeEffect(e,t){Zt("id",e,Nt()),Zt("index",t,Gt(Nt(),0)),bt(this.#e.removeEffect(e,t))}hasEffectEnabled(e){return Zt("effectId",e,Nt()),bt(this.#e.hasEffectEnabled(e))}setEffectEnabled(e,t){Zt("effectId",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setEffectEnabled(e,t))}isEffectEnabled(e){return Zt("effectId",e,Nt()),bt(this.#e.isEffectEnabled(e))}createBlur(e){return Zt("type",e,Wt()),bt(this.#e.createBlur(e))}hasBlur(e){return Zt("id",e,Nt()),bt(this.#e.hasBlur(e))}setBlur(e,t){Zt("id",e,Nt()),Zt("blurId",t,Nt()),bt(this.#e.setBlur(e,t))}getBlur(e){return Zt("id",e,Nt()),bt(this.#e.getBlur(e))}setBlurEnabled(e,t){Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setBlurEnabled(e,t))}isBlurEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isBlurEnabled(e))}hasBackgroundColor(e){return Zt("id",e,Nt()),bt(this.#e.hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setBackgroundColorRGBA(e,t,r,o,n))}getBackgroundColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isBackgroundColorEnabled(e))}hasStroke(e){return Zt("id",e,Nt()),bt(this.#e.hasStroke(e))}setStrokeEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setStrokeEnabled(e,t))}isStrokeEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setStrokeColorRGBA(e,t,r,o,n))}setStrokeColor(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokeColor(e,Jt.fromColor(t)))}getStrokeColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getStrokeColorRGBA(e))}getStrokeColor(e){return Zt("id",e,Nt()),Jt.toColor(bt(this.#e.getStrokeColor(e)))}setStrokeWidth(e,t){return Zt("id",e,Nt()),Zt("width",t,Ht()),bt(this.#e.setStrokeWidth(e,t))}getStrokeWidth(e){return Zt("id",e,Nt()),bt(this.#e.getStrokeWidth(e))}setStrokeStyle(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokeStyle(e,t))}getStrokeStyle(e){Zt("id",e,Nt());return bt(this.#e.getStrokeStyle(e))}setStrokePosition(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokePosition(e,t))}getStrokePosition(e){Zt("id",e,Nt());return bt(this.#e.getStrokePosition(e))}setStrokeCornerGeometry(e,t){return Zt("id",e,Nt()),bt(this.#e.setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){Zt("id",e,Nt());return bt(this.#e.getStrokeCornerGeometry(e))}hasDropShadow(e){return Zt("id",e,Nt()),bt(this.#e.hasDropShadow(e))}setDropShadowEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setDropShadowEnabled(e,t))}isDropShadowEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isDropShadowEnabled(e))}setDropShadowColorRGBA(e,t,r,o,n=1){return Zt("id",e,Nt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setDropShadowColorRGBA(e,t,r,o,n))}setDropShadowColor(e,t){return Zt("id",e,Nt()),bt(this.#e.setDropShadowColor(e,Jt.fromColor(t)))}getDropShadowColorRGBA(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowColorRGBA(e))}getDropShadowColor(e){return Zt("id",e,Nt()),Jt.toColor(bt(this.#e.getDropShadowColor(e)))}setDropShadowOffsetX(e,t){return Zt("id",e,Nt()),Zt("offsetX",t,Ht()),bt(this.#e.setDropShadowOffsetX(e,t))}getDropShadowOffsetX(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowOffsetX(e))}setDropShadowOffsetY(e,t){return Zt("id",e,Nt()),Zt("offsetY",t,Ht()),bt(this.#e.setDropShadowOffsetY(e,t))}getDropShadowOffsetY(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowOffsetY(e))}setDropShadowBlurRadiusX(e,t){return Zt("id",e,Nt()),Zt("blurRadiusX",t,Ht()),bt(this.#e.setDropShadowBlurRadiusX(e,t))}getDropShadowBlurRadiusX(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowBlurRadiusX(e))}setDropShadowBlurRadiusY(e,t){return Zt("id",e,Nt()),Zt("blurRadiusY",t,Ht()),bt(this.#e.setDropShadowBlurRadiusY(e,t))}getDropShadowBlurRadiusY(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowBlurRadiusY(e))}setDropShadowClip(e,t){return Zt("id",e,Nt()),bt(this.#e.setDropShadowClip(e,t))}getDropShadowClip(e){return Zt("id",e,Nt()),bt(this.#e.getDropShadowClip(e))}createCutoutFromBlocks(e,t=2,r=4){return Zt("ids",e,Ut(Nt())),Zt("vectorizeDistanceThreshold",t,Ht()),Zt("maxSmoothingDistance",r,Ht()),bt(this.#e.createCutoutFromBlocks(e,t,r))}createCutoutFromPath(e){return Zt("path",e,Wt()),bt(this.#e.createCutoutFromPath(e))}createCutoutFromOperation(e,t){return Zt("ids",e,Ut(Nt())),Zt("op",t,function(){const e=["Difference","Intersection","Union","XOR"];return jt("CutoutOperation",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),bt(this.#e.createCutoutFromOperation(e,t))}replaceText(e,t,r=-1,o=-1){Zt("id",e,Nt()),Zt("text",t,Wt()),Zt("from",r,Nt()),Zt("to",o,Nt()),bt(this.#e.replaceText(e,t,r,o))}removeText(e,t=-1,r=-1){Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),bt(this.#e.removeText(e,t,r))}setTextColor(e,t,r=-1,o=-1){Zt("id",e,Nt()),Zt("from",r,Nt()),Zt("to",o,Nt()),bt(this.#e.setTextColor(e,Jt.fromColor(t),r,o))}getTextColors(e,t=-1,r=-1){Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt());const o=this.#e.getTextColors(e,t,r);return Tt(bt(o)).map((e=>Jt.toColor(e)))}getTextFontWeights(e,t=-1,r=-1){return Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),Tt(bt(this.#e.getTextFontWeights(e,t,r)))}getTextFontStyles(e,t=-1,r=-1){return Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),Tt(bt(this.#e.getTextFontStyles(e,t,r)))}getTextCases(e,t=-1,r=-1){return Zt("id",e,Nt()),Zt("from",t,Nt()),Zt("to",r,Nt()),Tt(bt(this.#e.getTextCases(e,t,r)))}setTextCase(e,t,r=-1,o=-1){Zt("id",e,Nt()),Zt("textCase",t,Wt()),Zt("from",r,Nt()),Zt("to",o,Nt()),bt(this.#e.setTextCase(e,t,r,o))}canToggleBoldFont(e,t=-1,r=-1){return Zt("id",e,Nt()),bt(this.#e.canToggleBoldFont(e,t,r))}canToggleItalicFont(e,t=-1,r=-1){return Zt("id",e,Nt()),bt(this.#e.canToggleItalicFont(e,t,r))}toggleBoldFont(e,t=-1,r=-1){Zt("id",e,Nt()),bt(this.#e.toggleBoldFont(e,t,r))}toggleItalicFont(e,t=-1,r=-1){Zt("id",e,Nt()),bt(this.#e.toggleItalicFont(e,t,r))}setFont(e,t,r){Zt("block",e,Nt()),Zt("fontFileUri",t,Wt()),bt(this.#e.setFont(e,t,r))}getTypeface(e){return Zt("block",e,Nt()),bt(this.#e.getTypeface(e))}getTextCursorRange(){return bt(this.#e.getTextCursorRange())}hasFill(e){return Zt("id",e,Nt()),bt(this.#e.hasFill(e))}isFillEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isFillEnabled(e))}setFillEnabled(e,t){return Zt("id",e,Nt()),bt(this.#e.setFillEnabled(e,t))}getFill(e){return Zt("id",e,Nt()),bt(this.#e.getFill(e))}setFill(e,t){return Zt("id",e,Nt()),Zt("fill",t,Nt()),bt(this.#e.setFill(e,t))}setFillSolidColor(e,t,r,o,n=1){Zt("id",e,Nt()),bt(this.#e.setFillSolidColor(e,t,r,o,n))}getFillSolidColor(e){return Zt("id",e,Nt()),bt(this.#e.getFillSolidColor(e))}setPlaceholderEnabled(e,t){Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaceholderEnabled(e,t))}isPlaceholderEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderEnabled(e))}hasPlaceholderBehavior(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaceholderBehavior(e))}setPlaceholderBehaviorEnabled(e,t){Zt("id",e,Nt()),bt(this.#e.setPlaceholderBehaviorEnabled(e,t))}isPlaceholderBehaviorEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderBehaviorEnabled(e))}hasPlaceholderControls(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaceholderControls(e))}setPlaceholderControlsOverlayEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaceholderControlsOverlayEnabled(e,t))}isPlaceholderControlsOverlayEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderControlsOverlayEnabled(e))}setPlaceholderControlsButtonEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaceholderControlsButtonEnabled(e,t))}isPlaceholderControlsButtonEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isPlaceholderControlsButtonEnabled(e))}setMetadata(e,t,r){Zt("id",e,Nt()),Zt("key",t,Wt()),Zt("value",r,Wt()),bt(this.#e.setMetadata(e,t,r))}getMetadata(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.getMetadata(e,t))}hasMetadata(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.hasMetadata(e,t))}findAllMetadata(e){return Zt("id",e,Nt()),Tt(bt(this.#e.findAllMetadata(e)))}removeMetadata(e,t){Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.removeMetadata(e,t))}setScopeEnabled(e,t,r){Zt("id",e,Nt()),Zt("key",t,Wt()),Zt("enabled",r,$t()),bt(this.#e.setScopeEnabled(e,t,r))}isScopeEnabled(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.isScopeEnabled(e,t))}isAllowedByScope(e,t){return Zt("id",e,Nt()),Zt("key",t,Wt()),bt(this.#e.isAllowedByScope(e,t))}hasDuration(e){return Zt("id",e,Nt()),bt(this.#e.hasDuration(e))}setDuration(e,t){return Zt("id",e,Nt()),Zt("duration",t,Ht()),bt(this.#e.setDuration(e,t))}getDuration(e){return Zt("id",e,Nt()),bt(this.#e.getDuration(e))}hasTimeOffset(e){return Zt("id",e,Nt()),bt(this.#e.hasTimeOffset(e))}setTimeOffset(e,t){return Zt("id",e,Nt()),Zt("offset",t,Ht()),bt(this.#e.setTimeOffset(e,t))}getTimeOffset(e){return Zt("id",e,Nt()),bt(this.#e.getTimeOffset(e))}hasTrim(e){return Zt("id",e,Nt()),bt(this.#e.hasTrim(e))}setTrimOffset(e,t){return Zt("id",e,Nt()),Zt("offset",t,Ht()),bt(this.#e.setTrimOffset(e,t))}getTrimOffset(e){return Zt("id",e,Nt()),bt(this.#e.getTrimOffset(e))}setTrimLength(e,t){return Zt("id",e,Nt()),Zt("length",t,Ht()),bt(this.#e.setTrimLength(e,t))}getTrimLength(e){return Zt("id",e,Nt()),bt(this.#e.getTrimLength(e))}getTotalSceneDuration(e){return Zt("scene",e,Nt()),bt(this.#e.getTotalSceneDuration(e))}setPlaying(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setPlaying(e,t))}isPlaying(e){return Zt("id",e,Nt()),bt(this.#e.isPlaying(e))}hasPlaybackTime(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaybackTime(e))}setPlaybackTime(e,t){return Zt("id",e,Nt()),Zt("time",t,Ht()),bt(this.#e.setPlaybackTime(e,t))}getPlaybackTime(e){return Zt("id",e,Nt()),bt(this.#e.getPlaybackTime(e))}isVisibleAtCurrentPlaybackTime(e){return Zt("id",e,Nt()),bt(this.#e.isVisibleAtCurrentPlaybackTime(e))}setSoloPlaybackEnabled(e,t){return Zt("id",e,Nt()),Zt("enabled",t,$t()),bt(this.#e.setSoloPlaybackEnabled(e,t))}isSoloPlaybackEnabled(e){return Zt("id",e,Nt()),bt(this.#e.isSoloPlaybackEnabled(e))}hasPlaybackControl(e){return Zt("id",e,Nt()),bt(this.#e.hasPlaybackControl(e))}setLooping(e,t){Zt("id",e,Nt()),Zt("looping",t,$t()),bt(this.#e.setLooping(e,t))}isLooping(e){return Zt("id",e,Nt()),bt(this.#e.isLooping(e))}setMuted(e,t){Zt("id",e,Nt()),Zt("muted",t,$t()),bt(this.#e.setMuted(e,t))}isMuted(e){return Zt("id",e,Nt()),bt(this.#e.isMuted(e))}setVolume(e,t){Zt("id",e,Nt()),Zt("volume",t,Ht()),bt(this.#e.setVolume(e,t))}getVolume(e){return Zt("id",e,Nt()),bt(this.#e.getVolume(e))}async forceLoadAVResource(e){return Zt("id",e,Nt()),vt((t=>this.#e.forceLoadAVResource(e,t)))}unstable_isAVResourceLoaded(e){return Zt("id",e,Nt()),bt(this.#e.unstable_isAVResourceLoaded(e))}getAVResourceTotalDuration(e){return Zt("id",e,Nt()),bt(this.#e.getAVResourceTotalDuration(e))}getVideoWidth(e){return Zt("id",e,Nt()),bt(this.#e.getVideoWidth(e))}getVideoHeight(e){return Zt("id",e,Nt()),bt(this.#e.getVideoHeight(e))}generateVideoThumbnailSequence(e,t,r,o,n,i){Zt("id",e,Nt()),Zt("thumbnailHeight",t,Nt()),Zt("timeBegin",r,Ht()),Zt("timeEnd",o,Ht()),Zt("numberOfFrames",n,Nt());const a=this.#e.generateVideoThumbnailSequence(e,t,r,o,n,(e=>{"error"in e?i(0,new Error(e.error)):i(e.frameIndex,new ImageData(new Uint8ClampedArray(e.imageData),e.width,e.height))}));return()=>{this.#e.cancelVideoThumbnailSequenceGeneration(a)}}generateAudioThumbnailSequence(e,t,r,o,n,i,a){Zt("id",e,Nt()),Zt("samplesPerChunk",t,Nt()),Zt("timeBegin",r,Ht()),Zt("timeEnd",o,Ht()),Zt("numberOfSamples",n,Nt()),Zt("numberOfChannels",i,Nt());const s=this.#e.generateAudioThumbnailSequence(e,t,r,o,n,i,(e=>{"error"in e?a(0,new Error(e.error)):a(e.chunkIndex,e.sampleData)}));return()=>{this.#e.cancelAudioThumbnailSequenceGeneration(s)}}async getVideoFillThumbnail(e,t){return Zt("id",e,Nt()),Zt("thumbnailHeight",t,Nt()),new Promise(((r,o)=>{this.#e.getVideoFillThumbnail(e,t,(e=>{"error"in e?o(e.error):r(new rr([e],{type:"image/jpeg"}))}))}))}async getVideoFillThumbnailAtlas(e,t,r,o){return Zt("id",e,Nt()),Zt("numberOfColumns",t,Nt()),Zt("numberOfRows",r,Nt()),Zt("thumbnailHeight",o,Nt()),new Promise(((n,i)=>{this.#e.getVideoFillThumbnailAtlas(e,t,r,o,(e=>{"error"in e?i(e.error):n(new rr([e],{type:"image/jpeg"}))}))}))}async getPageThumbnailAtlas(e,t,r,o){return Zt("id",e,Nt()),Zt("numberOfColumns",t,Nt()),Zt("numberOfRows",r,Nt()),new Promise(((n,i)=>{this.#e.getPageThumbnailAtlas(e,t,r,o,(e=>{"error"in e?i(e.error):n(new rr([e],{type:"image/jpeg"}))}))}))}setNativePixelBuffer(e,t){Zt("id",e,Nt()),t instanceof HTMLVideoElement&&(t.width=t.videoWidth,t.height=t.videoHeight),bt(this.#e.setNativePixelBuffer(e,t))}getState(e){return Zt("id",e,Nt()),bt(this.#e.getState(e))}setState(e,t){Zt("id",e,Nt()),bt(this.#e.setState(e,t))}onStateChanged=(e,t)=>{Zt("ids",e,Ut(Nt()));const r=this.#e.subscribeToBlockState(e,(e=>{try{t(Tt(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(r))}}};u([mt],BlockAPI.prototype,"loadFromString",1),u([mt],BlockAPI.prototype,"create",1),u([mt],BlockAPI.prototype,"createFill",1),u([ft],BlockAPI.prototype,"getType",1),u([mt],BlockAPI.prototype,"select",1),u([mt],BlockAPI.prototype,"setSelected",1),u([ft],BlockAPI.prototype,"isSelected",1),u([ft],BlockAPI.prototype,"findAllSelected",1),u([ft],BlockAPI.prototype,"isGroupable",1),u([mt],BlockAPI.prototype,"group",1),u([mt],BlockAPI.prototype,"ungroup",1),u([mt],BlockAPI.prototype,"enterGroup",1),u([mt],BlockAPI.prototype,"exitGroup",1),u([ft],BlockAPI.prototype,"isCombinable",1),u([mt],BlockAPI.prototype,"combine",1),u([mt],BlockAPI.prototype,"setName",1),u([ft],BlockAPI.prototype,"getName",1),u([ft],BlockAPI.prototype,"getUUID",1),u([ft],BlockAPI.prototype,"findByName",1),u([ft],BlockAPI.prototype,"findByType",1),u([ft],BlockAPI.prototype,"findAll",1),u([ft],BlockAPI.prototype,"findAllPlaceholders",1),u([mt],BlockAPI.prototype,"createShape",1),u([ft],BlockAPI.prototype,"hasShape",1),u([ft],BlockAPI.prototype,"getShape",1),u([mt],BlockAPI.prototype,"setShape",1),u([ft],BlockAPI.prototype,"isVisible",1),u([mt],BlockAPI.prototype,"setVisible",1),u([ft],BlockAPI.prototype,"isClipped",1),u([mt],BlockAPI.prototype,"setClipped",1),u([ft],BlockAPI.prototype,"isTransformLocked",1),u([mt],BlockAPI.prototype,"setTransformLocked",1),u([ft],BlockAPI.prototype,"getPositionX",1),u([ft],BlockAPI.prototype,"getPositionXMode",1),u([ft],BlockAPI.prototype,"getPositionY",1),u([ft],BlockAPI.prototype,"getPositionYMode",1),u([mt],BlockAPI.prototype,"setPositionX",1),u([mt],BlockAPI.prototype,"setPositionXMode",1),u([mt],BlockAPI.prototype,"setPositionY",1),u([mt],BlockAPI.prototype,"setPositionYMode",1),u([mt],BlockAPI.prototype,"setAlwaysOnTop",1),u([mt],BlockAPI.prototype,"setAlwaysOnBottom",1),u([ft],BlockAPI.prototype,"isAlwaysOnTop",1),u([ft],BlockAPI.prototype,"isAlwaysOnBottom",1),u([mt],BlockAPI.prototype,"bringToFront",1),u([mt],BlockAPI.prototype,"sendToBack",1),u([mt],BlockAPI.prototype,"bringForward",1),u([mt],BlockAPI.prototype,"sendBackward",1),u([ft],BlockAPI.prototype,"getRotation",1),u([mt],BlockAPI.prototype,"setRotation",1),u([ft],BlockAPI.prototype,"getFlipHorizontal",1),u([ft],BlockAPI.prototype,"getFlipVertical",1),u([mt],BlockAPI.prototype,"setFlipHorizontal",1),u([mt],BlockAPI.prototype,"setFlipVertical",1),u([ft],BlockAPI.prototype,"hasContentFillMode",1),u([ft],BlockAPI.prototype,"getWidth",1),u([ft],BlockAPI.prototype,"getWidthMode",1),u([ft],BlockAPI.prototype,"getHeight",1),u([ft],BlockAPI.prototype,"getHeightMode",1),u([mt],BlockAPI.prototype,"setWidth",1),u([mt],BlockAPI.prototype,"setWidthMode",1),u([mt],BlockAPI.prototype,"setHeight",1),u([mt],BlockAPI.prototype,"setHeightMode",1),u([ft],BlockAPI.prototype,"getFrameX",1),u([ft],BlockAPI.prototype,"getFrameY",1),u([ft],BlockAPI.prototype,"getFrameWidth",1),u([ft],BlockAPI.prototype,"getFrameHeight",1),u([mt],BlockAPI.prototype,"setContentFillMode",1),u([ft],BlockAPI.prototype,"getContentFillMode",1),u([mt],BlockAPI.prototype,"duplicate",1),u([mt],BlockAPI.prototype,"destroy",1),u([ft],BlockAPI.prototype,"isValid",1),u([ft],BlockAPI.prototype,"getParent",1),u([ft],BlockAPI.prototype,"getChildren",1),u([mt],BlockAPI.prototype,"insertChild",1),u([mt],BlockAPI.prototype,"appendChild",1),u([ft],BlockAPI.prototype,"referencesAnyVariables",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxX",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxY",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxWidth",1),u([ft],BlockAPI.prototype,"getGlobalBoundingBoxHeight",1),u([ft],BlockAPI.prototype,"getScreenSpaceBoundingBoxXYWH",1),u([mt],BlockAPI.prototype,"alignHorizontally",1),u([mt],BlockAPI.prototype,"alignVertically",1),u([ft],BlockAPI.prototype,"isAlignable",1),u([mt],BlockAPI.prototype,"distributeHorizontally",1),u([mt],BlockAPI.prototype,"distributeVertically",1),u([mt],BlockAPI.prototype,"isDistributable",1),u([mt],BlockAPI.prototype,"fillParent",1),u([mt],BlockAPI.prototype,"resizeContentAware",1),u([mt],BlockAPI.prototype,"scale",1),u([ft],BlockAPI.prototype,"findAllProperties",1),u([ft],BlockAPI.prototype,"isPropertyReadable",1),u([ft],BlockAPI.prototype,"isPropertyWritable",1),u([ft],BlockAPI.prototype,"getPropertyType",1),u([ft],BlockAPI.prototype,"getEnumValues",1),u([mt],BlockAPI.prototype,"setBool",1),u([ft],BlockAPI.prototype,"getBool",1),u([mt],BlockAPI.prototype,"setInt",1),u([ft],BlockAPI.prototype,"getInt",1),u([mt],BlockAPI.prototype,"setFloat",1),u([ft],BlockAPI.prototype,"getFloat",1),u([mt],BlockAPI.prototype,"setDouble",1),u([ft],BlockAPI.prototype,"getDouble",1),u([mt],BlockAPI.prototype,"setString",1),u([ft],BlockAPI.prototype,"getString",1),u([mt],BlockAPI.prototype,"setColor",1),u([ft],BlockAPI.prototype,"getColor",1),u([mt],BlockAPI.prototype,"setColorRGBA",1),u([ft],BlockAPI.prototype,"getColorRGBA",1),u([mt],BlockAPI.prototype,"setColorSpot",1),u([ft],BlockAPI.prototype,"getColorSpotName",1),u([ft],BlockAPI.prototype,"getColorSpotTint",1),u([mt],BlockAPI.prototype,"setGradientColorStops",1),u([ft],BlockAPI.prototype,"getGradientColorStops",1),u([ft],BlockAPI.prototype,"getSourceSet",1),u([mt],BlockAPI.prototype,"setSourceSet",1),u([mt],BlockAPI.prototype,"setEnum",1),u([ft],BlockAPI.prototype,"getEnum",1),u([ft],BlockAPI.prototype,"hasCrop",1),u([mt],BlockAPI.prototype,"setCropScaleX",1),u([mt],BlockAPI.prototype,"setCropScaleY",1),u([mt],BlockAPI.prototype,"setCropRotation",1),u([mt],BlockAPI.prototype,"setCropScaleRatio",1),u([mt],BlockAPI.prototype,"setCropTranslationX",1),u([mt],BlockAPI.prototype,"setCropTranslationY",1),u([mt],BlockAPI.prototype,"resetCrop",1),u([ft],BlockAPI.prototype,"getCropScaleX",1),u([ft],BlockAPI.prototype,"getCropScaleY",1),u([ft],BlockAPI.prototype,"getCropRotation",1),u([ft],BlockAPI.prototype,"getCropScaleRatio",1),u([ft],BlockAPI.prototype,"getCropTranslationX",1),u([ft],BlockAPI.prototype,"getCropTranslationY",1),u([mt],BlockAPI.prototype,"adjustCropToFillFrame",1),u([mt],BlockAPI.prototype,"flipCropHorizontal",1),u([mt],BlockAPI.prototype,"flipCropVertical",1),u([ft],BlockAPI.prototype,"hasOpacity",1),u([mt],BlockAPI.prototype,"setOpacity",1),u([ft],BlockAPI.prototype,"getOpacity",1),u([ft],BlockAPI.prototype,"hasBlendMode",1),u([mt],BlockAPI.prototype,"setBlendMode",1),u([ft],BlockAPI.prototype,"getBlendMode",1),u([ft],BlockAPI.prototype,"hasFillColor",1),u([ft],BlockAPI.prototype,"isIncludedInExport",1),u([mt],BlockAPI.prototype,"setIncludedInExport",1),u([mt],BlockAPI.prototype,"setFillColorRGBA",1),u([ft],BlockAPI.prototype,"getFillColorRGBA",1),u([mt],BlockAPI.prototype,"setFillColorEnabled",1),u([ft],BlockAPI.prototype,"isFillColorEnabled",1),u([mt],BlockAPI.prototype,"createEffect",1),u([ft],BlockAPI.prototype,"hasEffects",1),u([ft],BlockAPI.prototype,"getEffects",1),u([mt],BlockAPI.prototype,"insertEffect",1),u([mt],BlockAPI.prototype,"appendEffect",1),u([mt],BlockAPI.prototype,"removeEffect",1),u([ft],BlockAPI.prototype,"hasEffectEnabled",1),u([mt],BlockAPI.prototype,"setEffectEnabled",1),u([ft],BlockAPI.prototype,"isEffectEnabled",1),u([mt],BlockAPI.prototype,"createBlur",1),u([ft],BlockAPI.prototype,"hasBlur",1),u([mt],BlockAPI.prototype,"setBlur",1),u([ft],BlockAPI.prototype,"getBlur",1),u([mt],BlockAPI.prototype,"setBlurEnabled",1),u([ft],BlockAPI.prototype,"isBlurEnabled",1),u([ft],BlockAPI.prototype,"hasBackgroundColor",1),u([mt],BlockAPI.prototype,"setBackgroundColorRGBA",1),u([ft],BlockAPI.prototype,"getBackgroundColorRGBA",1),u([mt],BlockAPI.prototype,"setBackgroundColorEnabled",1),u([ft],BlockAPI.prototype,"isBackgroundColorEnabled",1),u([ft],BlockAPI.prototype,"hasStroke",1),u([mt],BlockAPI.prototype,"setStrokeEnabled",1),u([ft],BlockAPI.prototype,"isStrokeEnabled",1),u([mt],BlockAPI.prototype,"setStrokeColorRGBA",1),u([mt],BlockAPI.prototype,"setStrokeColor",1),u([ft],BlockAPI.prototype,"getStrokeColorRGBA",1),u([ft],BlockAPI.prototype,"getStrokeColor",1),u([mt],BlockAPI.prototype,"setStrokeWidth",1),u([ft],BlockAPI.prototype,"getStrokeWidth",1),u([mt],BlockAPI.prototype,"setStrokeStyle",1),u([ft],BlockAPI.prototype,"getStrokeStyle",1),u([mt],BlockAPI.prototype,"setStrokePosition",1),u([ft],BlockAPI.prototype,"getStrokePosition",1),u([mt],BlockAPI.prototype,"setStrokeCornerGeometry",1),u([ft],BlockAPI.prototype,"getStrokeCornerGeometry",1),u([ft],BlockAPI.prototype,"hasDropShadow",1),u([mt],BlockAPI.prototype,"setDropShadowEnabled",1),u([ft],BlockAPI.prototype,"isDropShadowEnabled",1),u([mt],BlockAPI.prototype,"setDropShadowColorRGBA",1),u([mt],BlockAPI.prototype,"setDropShadowColor",1),u([ft],BlockAPI.prototype,"getDropShadowColorRGBA",1),u([ft],BlockAPI.prototype,"getDropShadowColor",1),u([mt],BlockAPI.prototype,"setDropShadowOffsetX",1),u([ft],BlockAPI.prototype,"getDropShadowOffsetX",1),u([mt],BlockAPI.prototype,"setDropShadowOffsetY",1),u([ft],BlockAPI.prototype,"getDropShadowOffsetY",1),u([mt],BlockAPI.prototype,"setDropShadowBlurRadiusX",1),u([ft],BlockAPI.prototype,"getDropShadowBlurRadiusX",1),u([mt],BlockAPI.prototype,"setDropShadowBlurRadiusY",1),u([ft],BlockAPI.prototype,"getDropShadowBlurRadiusY",1),u([mt],BlockAPI.prototype,"setDropShadowClip",1),u([ft],BlockAPI.prototype,"getDropShadowClip",1),u([mt],BlockAPI.prototype,"createCutoutFromBlocks",1),u([mt],BlockAPI.prototype,"createCutoutFromPath",1),u([mt],BlockAPI.prototype,"createCutoutFromOperation",1),u([mt],BlockAPI.prototype,"replaceText",1),u([mt],BlockAPI.prototype,"removeText",1),u([mt],BlockAPI.prototype,"setTextColor",1),u([ft],BlockAPI.prototype,"getTextColors",1),u([ft],BlockAPI.prototype,"getTextFontWeights",1),u([ft],BlockAPI.prototype,"getTextFontStyles",1),u([ft],BlockAPI.prototype,"getTextCases",1),u([mt],BlockAPI.prototype,"setTextCase",1),u([mt],BlockAPI.prototype,"setFont",1),u([ft],BlockAPI.prototype,"getTypeface",1),u([ft],BlockAPI.prototype,"getTextCursorRange",1),u([ft],BlockAPI.prototype,"hasFill",1),u([ft],BlockAPI.prototype,"isFillEnabled",1),u([mt],BlockAPI.prototype,"setFillEnabled",1),u([ft],BlockAPI.prototype,"getFill",1),u([mt],BlockAPI.prototype,"setFill",1),u([mt],BlockAPI.prototype,"setFillSolidColor",1),u([ft],BlockAPI.prototype,"getFillSolidColor",1),u([mt],BlockAPI.prototype,"setPlaceholderEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderEnabled",1),u([ft],BlockAPI.prototype,"hasPlaceholderBehavior",1),u([mt],BlockAPI.prototype,"setPlaceholderBehaviorEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderBehaviorEnabled",1),u([ft],BlockAPI.prototype,"hasPlaceholderControls",1),u([mt],BlockAPI.prototype,"setPlaceholderControlsOverlayEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderControlsOverlayEnabled",1),u([mt],BlockAPI.prototype,"setPlaceholderControlsButtonEnabled",1),u([ft],BlockAPI.prototype,"isPlaceholderControlsButtonEnabled",1),u([mt],BlockAPI.prototype,"setMetadata",1),u([ft],BlockAPI.prototype,"getMetadata",1),u([ft],BlockAPI.prototype,"hasMetadata",1),u([ft],BlockAPI.prototype,"findAllMetadata",1),u([mt],BlockAPI.prototype,"removeMetadata",1),u([mt],BlockAPI.prototype,"setScopeEnabled",1),u([ft],BlockAPI.prototype,"isScopeEnabled",1),u([ft],BlockAPI.prototype,"isAllowedByScope",1),u([ft],BlockAPI.prototype,"hasDuration",1),u([mt],BlockAPI.prototype,"setDuration",1),u([ft],BlockAPI.prototype,"getDuration",1),u([ft],BlockAPI.prototype,"hasTimeOffset",1),u([mt],BlockAPI.prototype,"setTimeOffset",1),u([ft],BlockAPI.prototype,"getTimeOffset",1),u([ft],BlockAPI.prototype,"hasTrim",1),u([mt],BlockAPI.prototype,"setTrimOffset",1),u([ft],BlockAPI.prototype,"getTrimOffset",1),u([mt],BlockAPI.prototype,"setTrimLength",1),u([ft],BlockAPI.prototype,"getTrimLength",1),u([ft],BlockAPI.prototype,"getTotalSceneDuration",1),u([mt],BlockAPI.prototype,"setPlaying",1),u([ft],BlockAPI.prototype,"isPlaying",1),u([ft],BlockAPI.prototype,"hasPlaybackTime",1),u([mt],BlockAPI.prototype,"setPlaybackTime",1),u([ft],BlockAPI.prototype,"getPlaybackTime",1),u([ft],BlockAPI.prototype,"isVisibleAtCurrentPlaybackTime",1),u([mt],BlockAPI.prototype,"setSoloPlaybackEnabled",1),u([ft],BlockAPI.prototype,"isSoloPlaybackEnabled",1),u([ft],BlockAPI.prototype,"hasPlaybackControl",1),u([mt],BlockAPI.prototype,"setLooping",1),u([ft],BlockAPI.prototype,"isLooping",1),u([mt],BlockAPI.prototype,"setMuted",1),u([ft],BlockAPI.prototype,"isMuted",1),u([mt],BlockAPI.prototype,"setVolume",1),u([ft],BlockAPI.prototype,"getVolume",1),u([mt],BlockAPI.prototype,"forceLoadAVResource",1),u([ft],BlockAPI.prototype,"unstable_isAVResourceLoaded",1),u([ft],BlockAPI.prototype,"getAVResourceTotalDuration",1),u([ft],BlockAPI.prototype,"getVideoWidth",1),u([ft],BlockAPI.prototype,"getVideoHeight",1),u([ft],BlockAPI.prototype,"getVideoFillThumbnail",1),u([ft],BlockAPI.prototype,"getVideoFillThumbnailAtlas",1),u([ft],BlockAPI.prototype,"getPageThumbnailAtlas",1),u([ft],BlockAPI.prototype,"getState",1),u([mt],BlockAPI.prototype,"setState",1);var EditorAPI=class{#e;constructor(e){this.#e=e}unlockWithLicense(e){bt(this.#e.unlockWithLicense(e))}startTracking(e,t){this.#e.startTracking(e,t,"")}setTrackingMetadata(e){this.#e.setTrackingMetadata(e)}getTrackingMetadata(){return bt(this.#e.getTrackingMetadata())}getActiveLicense(){return bt(this.#e.getActiveLicense())}onStateChanged=e=>{const t=this.#e.subscribeToEditorState(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};setEditMode(e){Zt("keypath",e,Wt()),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){bt(this.#e.destroyHistory(e))}setActiveHistory(e){bt(this.#e.setActiveHistory(e))}getActiveHistory(){return this.#e.getActiveHistory()}addUndoStep(){bt(this.#e.addUndoStep())}undo(){bt(this.#e.undo())}redo(){bt(this.#e.redo())}canUndo(){return bt(this.#e.canUndo())}canRedo(){return bt(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()||bt(this.#e.unsubscribe(t))}};onRoleChanged=e=>{const t=this.#e.subscribeToRoleChange(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};setSettingBool(e,t){return Zt("keypath",e,Wt()),Zt("value",t,$t()),bt(this.#e.setSettingBool(e,t))}getSettingBool(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingBool(e))}setSettingInt(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Nt()),bt(this.#e.setSettingInt(e,t))}getSettingInt(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingInt(e))}setSettingFloat(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Ht()),bt(this.#e.setSettingFloat(e,t))}getSettingFloat(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingFloat(e))}setSettingString(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setSettingString(e,t))}getSettingString(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingString(e))}setSettingColor(e,t){return Zt("keypath",e,Wt()),bt(this.#e.setSettingColor(e,Jt.fromColor(t)))}getSettingColor(e){return Zt("keypath",e,Wt()),Jt.toColor(bt(this.#e.getSettingColor(e)))}setSettingColorRGBA(e,t,r,o,n=1){return Zt("keypath",e,Wt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),Zt("a",n,Ht()),bt(this.#e.setSettingColorRGBA(e,t,r,o,n))}getSettingColorRGBA(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingColorRGBA(e))}setSettingEnum(e,t){return Zt("keypath",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setSettingEnum(e,t))}getSettingEnum(e){return Zt("keypath",e,Wt()),bt(this.#e.getSettingEnum(e))}getSettingEnumOptions(e){return Zt("keypath",e,Wt()),Tt(bt(this.#e.getSettingEnumOptions(e)))}setRole(e){return bt(this.#e.setRole(e))}getRole(){return bt(this.#e.getRole())}findAllSettings(){return Tt(this.#e.findAllSettings())}getSettingType(e){Zt("keypath",e,Wt());return bt(this.#e.getSettingType(e))}getAvailableMemory(){return bt(this.#e.getAvailableMemory())}getUsedMemory(){return bt(this.#e.getUsedMemory())}getMaxExportSize(){return bt(this.#e.getMaxExportSize())}setURIResolver(e){return bt(this.#e.setURIResolver(e))}defaultURIResolver(e){return this.#e.defaultURIResolver(e)}getAbsoluteURI(e){return bt(this.#e.getAbsoluteURI(e))}findAllScopes(){return Tt(this.#e.findAllScopes())}setGlobalScope(e,t){Zt("key",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setGlobalScope(e,t))}getGlobalScope(e){return Zt("key",e,Wt()),bt(this.#e.getGlobalScope(e))}findAllSpotColors(){return Tt(this.#e.findAllSpotColors())}getSpotColorRGBA(e){return Zt("name",e,Wt()),this.#e.getSpotColorRGB(e)}getSpotColorCMYK(e){return Zt("name",e,Wt()),this.#e.getSpotColorCMYK(e)}setSpotColorRGB(e,t,r,o){return Zt("name",e,Wt()),Zt("r",t,Ht()),Zt("g",r,Ht()),Zt("b",o,Ht()),this.#e.setSpotColorRGB(e,t,r,o)}setSpotColorCMYK(e,t,r,o,n){return Zt("name",e,Wt()),Zt("c",t,Ht()),Zt("m",r,Ht()),Zt("y",o,Ht()),Zt("k",n,Ht()),this.#e.setSpotColorCMYK(e,t,r,o,n)}removeSpotColor(e){return Zt("name",e,Wt()),bt(this.#e.removeSpotColor(e))}setSpotColorForCutoutType(e,t){return Zt("type",e,Wt()),Zt("color",t,Wt()),bt(this.#e.setSpotColorForCutoutType(e,t))}getSpotColorForCutoutType(e){return Zt("type",e,Wt()),bt(this.#e.getSpotColorForCutoutType(e))}convertColorToColorSpace(e,t){return Zt("colorSpace",t,Wt()),Jt.toColor(bt(this.#e.convertColorToColorSpace(Jt.fromColor(e),t)))}createBuffer(){return this.#e.createBuffer()}destroyBuffer(e){bt(this.#e.destroyBuffer(e))}setBufferData(e,t,r){Zt("offset",t,Nt()),bt(this.#e.setBufferData(e,t,r))}getBufferData(e,t,r){Zt("offset",t,Nt()),Zt("length",r,Nt());const o=this.#e.getBufferData(e,t,r);if("error"in o)throw new Error(o.error);return o}setBufferLength(e,t){Zt("length",t,Nt()),bt(this.#e.setBufferLength(e,t))}getBufferLength(e){return bt(this.#e.getBufferLength(e))}};u([mt],EditorAPI.prototype,"setEditMode",1),u([ft],EditorAPI.prototype,"getEditMode",1),u([ft],EditorAPI.prototype,"getCursorType",1),u([ft],EditorAPI.prototype,"getCursorRotation",1),u([ft],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceX",1),u([ft],EditorAPI.prototype,"getTextCursorPositionInScreenSpaceY",1),u([mt],EditorAPI.prototype,"createHistory",1),u([mt],EditorAPI.prototype,"destroyHistory",1),u([mt],EditorAPI.prototype,"setActiveHistory",1),u([ft],EditorAPI.prototype,"getActiveHistory",1),u([mt],EditorAPI.prototype,"addUndoStep",1),u([mt],EditorAPI.prototype,"undo",1),u([mt],EditorAPI.prototype,"redo",1),u([ft],EditorAPI.prototype,"canUndo",1),u([ft],EditorAPI.prototype,"canRedo",1),u([mt],EditorAPI.prototype,"setSettingBool",1),u([ft],EditorAPI.prototype,"getSettingBool",1),u([mt],EditorAPI.prototype,"setSettingInt",1),u([ft],EditorAPI.prototype,"getSettingInt",1),u([mt],EditorAPI.prototype,"setSettingFloat",1),u([ft],EditorAPI.prototype,"getSettingFloat",1),u([mt],EditorAPI.prototype,"setSettingString",1),u([ft],EditorAPI.prototype,"getSettingString",1),u([mt],EditorAPI.prototype,"setSettingColor",1),u([ft],EditorAPI.prototype,"getSettingColor",1),u([mt],EditorAPI.prototype,"setSettingColorRGBA",1),u([ft],EditorAPI.prototype,"getSettingColorRGBA",1),u([mt],EditorAPI.prototype,"setSettingEnum",1),u([ft],EditorAPI.prototype,"getSettingEnum",1),u([mt],EditorAPI.prototype,"setRole",1),u([ft],EditorAPI.prototype,"getRole",1),u([ft],EditorAPI.prototype,"getAvailableMemory",1),u([ft],EditorAPI.prototype,"getUsedMemory",1),u([ft],EditorAPI.prototype,"getMaxExportSize",1),u([mt],EditorAPI.prototype,"setURIResolver",1),u([ft],EditorAPI.prototype,"defaultURIResolver",1),u([ft],EditorAPI.prototype,"getAbsoluteURI",1),u([ft],EditorAPI.prototype,"findAllScopes",1),u([mt],EditorAPI.prototype,"setGlobalScope",1),u([ft],EditorAPI.prototype,"getGlobalScope",1),u([ft],EditorAPI.prototype,"findAllSpotColors",1),u([ft],EditorAPI.prototype,"getSpotColorRGBA",1),u([ft],EditorAPI.prototype,"getSpotColorCMYK",1),u([mt],EditorAPI.prototype,"setSpotColorRGB",1),u([mt],EditorAPI.prototype,"setSpotColorCMYK",1),u([mt],EditorAPI.prototype,"removeSpotColor",1),u([mt],EditorAPI.prototype,"setSpotColorForCutoutType",1),u([mt],EditorAPI.prototype,"getSpotColorForCutoutType",1);var EventAPI=class{#e;constructor(e){this.#e=e}subscribe=(e,t)=>{Zt("blocks",e,Ut());const r=this.#e.subscribe(e,(e=>{try{t(Tt(e,!0))}catch(e){console.error(e)}}));return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(r))}}},SceneAPI=class{#e;constructor(e){this.#e=e}async loadFromString(e){return Zt("sceneContent",e,Wt()),vt((t=>this.#e.loadSceneFromString(e,t)))}async loadFromURL(e){return Zt("url",e,Wt()),vt((t=>this.#e.loadSceneFromURL(e,t)))}async saveToString(){const e=this.get();if(null==e)throw new Error("No scene available.");return vt((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 rr([r],{type:tr.Zip}))}))}))}create(e="Free"){Zt("sceneLayout",e,Qt());return bt(this.#e.createScene(e))}createVideo(){return bt(this.#e.createVideoScene())}createFromImage(e,t=300,r=1,o="Free",n=0,i=!1){return Zt("url",e,Wt()),Zt("dpi",t,Gt(Ht(),0)),Zt("pixelScaleFactor",r,Gt(Ht(),0)),Zt("sceneLayout",o,Qt()),vt((a=>this.#e.createSceneFromImage(e,t,r,o,n,i,a)))}createFromVideo(e){return Zt("url",e,Wt()),vt((t=>this.#e.createSceneFromVideo(e,t)))}get(){const e=bt(this.#e.findByType("scene")),t=Tt(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return Zt("content",e,Wt()),vt((t=>this.#e.applyTemplateFromString(e,t)))}async applyTemplateFromURL(e){return Zt("url",e,Wt()),vt((t=>this.#e.applyTemplateFromURL(e,t)))}getMode(){const e=this.get();return bt(this.#e.getSceneMode(e))}setDesignUnit(e){Zt("designUnit",e,function(){const e=["Pixel","Millimeter","Inch"];return jt("DesignUnit",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}());const t=this.get();bt(this.#e.setDesignUnit(t,e))}getDesignUnit(){const e=this.get();return bt(this.#e.getDesignUnit(e))}getPages(){return Tt(bt(this.#e.getPages()))}getCurrentPage(){const e=this.get();if(null==e)return null;const t=bt(this.#e.findNearestToViewPortCenterByType(e,"//ly.img.ubq/page")),r=Tt(t);return r.length>0?r[0]:null}findNearestToViewPortCenterByType(e){Zt("type",e,Wt());const t=this.get();if(null==t)return[];const r=bt(this.#e.findNearestToViewPortCenterByType(t,e));return Tt(r)}findNearestToViewPortCenterByKind(e){Zt("kind",e,Wt());const t=this.get();if(null==t)return[];const r=bt(this.#e.findNearestToViewPortCenterByKind(t,e));return Tt(r)}setZoomLevel(e=1){const t=this.get();Zt("zoomLevel",e,Gt(Ht(),0)),this.#e.setZoomLevel(t,e)}getZoomLevel(){const e=this.get();return bt(this.#e.getZoomLevel(e))}async zoomToBlock(e,t=0,r=0,o=0,n=0){return Zt("id",e,Nt()),vt((i=>this.#e.zoomToBlock(e,t,r,o,n,i)))}enableZoomAutoFit(e,t,r=0,o=0,n=0,i=0){return Zt("id",e,Nt()),Zt("axis",t,function(){const e=["Horizontal","Vertical","Both"];return jt("ZoomAutoFitAxis",(t=>!("string"!=typeof t||!e.includes(t))||{message:`expected one of ${e.map((e=>`"${e}"`)).join(", ")}, but got "${t}"`}))}()),"Horizontal"===t?(Zt("paddingBefore",r,Ht()),Zt("paddingAfter",o,Ht()),bt(this.#e.enableZoomAutoFit(e,t,r,0,o,0))):"Vertical"===t?(Zt("paddingBefore",r,Ht()),Zt("paddingAfter",o,Ht()),bt(this.#e.enableZoomAutoFit(e,t,0,r,0,o))):(Zt("paddingLeft",r,Ht()),Zt("paddingTop",o,Ht()),Zt("paddingRight",n,Ht()),Zt("paddingBottom",i,Ht()),bt(this.#e.enableZoomAutoFit(e,t,r,o,n,i)))}disableZoomAutoFit(e){return Zt("blockOrScene",e,Nt()),bt(this.#e.disableZoomAutoFit(e))}isZoomAutoFitEnabled(e){return Zt("blockOrScene",e,Nt()),bt(this.#e.isZoomAutoFitEnabled(e))}unstable_enableCameraPositionClamping(e,t=0,r=0,o=0,n=0,i=0,a=0,s=0,u=0){return Zt("ids",e,Ut(Ht())),Zt("paddingLeft",t,Ht()),Zt("paddingTop",r,Ht()),Zt("paddingRight",o,Ht()),Zt("paddingBottom",n,Ht()),Zt("scaledPaddingLeft",t,Ht()),Zt("scaledPaddingTop",r,Ht()),Zt("scaledPaddingRight",o,Ht()),Zt("scaledPaddingBottom",n,Ht()),bt(this.#e.unstable_enableCameraPositionClamping(e,t,r,o,n,i,a,s,u))}unstable_disableCameraPositionClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_disableCameraPositionClamping(e))}unstable_isCameraPositionClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_isCameraPositionClampingEnabled(e))}unstable_enableCameraZoomClamping(e,t=-1,r=-1,o=0,n=0,i=0,a=0){return Zt("ids",e,Ut(Ht())),Zt("minZoomLimit",t,Ht()),Zt("maxZoomLimit",r,Ht()),Zt("paddingLeft",o,Ht()),Zt("paddingTop",n,Ht()),Zt("paddingRight",i,Ht()),Zt("paddingBottom",a,Ht()),bt(this.#e.unstable_enableCameraZoomClamping(e,t,r,o,n,i,a))}unstable_disableCameraZoomClamping(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_disableCameraZoomClamping(e))}unstable_isCameraZoomClampingEnabled(e=this.get()){if(null==e)throw new Error("No scene available.");return bt(this.#e.unstable_isCameraZoomClampingEnabled(e))}onZoomLevelChanged=e=>{const t=this.#e.subscribeToZoomLevel(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}};onActiveChanged=e=>{const t=this.#e.subscribeToActiveSceneChange(e);return()=>{this.#e.isDeleted()||bt(this.#e.unsubscribe(t))}}};function or(e,t){const r=new Set;function o(o){r.add(o);e?.(((e,...t)=>{o(e);for(const e of t)o(e)}));return()=>{r.delete(o),t?.()}}return o.emit=function(e,...t){for(const o of r){o(e);for(const e of t)o(e)}},o.handlers=r,o}u([mt],SceneAPI.prototype,"loadFromString",1),u([mt],SceneAPI.prototype,"loadFromURL",1),u([mt],SceneAPI.prototype,"create",1),u([mt],SceneAPI.prototype,"createVideo",1),u([mt],SceneAPI.prototype,"createFromImage",1),u([mt],SceneAPI.prototype,"createFromVideo",1),u([ft],SceneAPI.prototype,"get",1),u([mt],SceneAPI.prototype,"applyTemplateFromString",1),u([mt],SceneAPI.prototype,"applyTemplateFromURL",1),u([ft],SceneAPI.prototype,"getMode",1),u([mt],SceneAPI.prototype,"setDesignUnit",1),u([ft],SceneAPI.prototype,"getDesignUnit",1),u([ft],SceneAPI.prototype,"getPages",1),u([ft],SceneAPI.prototype,"getCurrentPage",1),u([ft],SceneAPI.prototype,"findNearestToViewPortCenterByType",1),u([ft],SceneAPI.prototype,"findNearestToViewPortCenterByKind",1),u([mt],SceneAPI.prototype,"setZoomLevel",1),u([ft],SceneAPI.prototype,"getZoomLevel",1),u([mt],SceneAPI.prototype,"zoomToBlock",1),u([mt],SceneAPI.prototype,"enableZoomAutoFit",1),u([mt],SceneAPI.prototype,"disableZoomAutoFit",1),u([ft],SceneAPI.prototype,"isZoomAutoFitEnabled",1);var nr=e=>t=>function(r){return t((function(t){r(e(t))}))};function ir(e){return t=>function(r){let o=!1;const n=t((function(e){o=!0,r(e)}));return o||r(e instanceof Function?e():e),n}}var ar=(e=((e,t)=>e===t))=>t=>function(r){let o;return t((function(t){e(t,o)||(o=t,r(t))}))},sr=e=>{const t=new Set;let r=null;return function(o){return t.add(o),null===r&&(r=e((function(e){t.forEach((t=>t(e)))}))),function(){t.delete(o),0===t.size&&(r?.(),r=null)}}};function ur(e,...t){return t.reduce(((e,t)=>t(e)),e)}var cr=(...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 lr(e){return function(t){let r=null;const o=e((function(e){r?.(),r=e?e(t):e}));return function(){o(),r?.(),r=null}}}function dr(...e){const t=Array.from(e);return function(e){const r=new Array(t.length),o=t.map(((t,o)=>t((function(t){r[o]=t,e(r)}))));return function(){o.forEach((e=>e())),r.length=0}}}var pr,hr,fr,mr,gr,yr,br,vr,wr,_r,Er,Sr=Symbol("NO_VALUE");function Cr(e){let t=Sr;const r=or();return{subscribe:r,value:()=>(t===Sr&&(t=e()),t),update(e){t=e,r.emit(t)}}}var kr=class{constructor(e){p(this,mr),p(this,yr),p(this,vr),p(this,_r),p(this,pr,void 0),p(this,hr,null),p(this,fr,void 0),c(this,"singlePageMode",f(this,yr,br).call(this,"features/singlePageModeEnabled")),c(this,"role"),c(this,"pageTitleShow",f(this,yr,br).call(this,"page/title/show")),c(this,"pageTitleshowPageTitleTemplate",f(this,yr,br).call(this,"page/title/showPageTitleTemplate")),c(this,"pageTitleAppendPageName",f(this,yr,br).call(this,"page/title/appendPageName")),c(this,"pageTitleShowOnSinglePage",f(this,yr,br).call(this,"page/title/showOnSinglePage")),c(this,"separator",f(this,_r,Er).call(this,"page/title/separator")),c(this,"pageTitleFont",f(this,_r,Er).call(this,"page/title/fontFileUri")),c(this,"dimOutOfPageAreas",f(this,yr,br).call(this,"page/dimOutOfPageAreas")),c(this,"singlePointPanning",f(this,yr,br).call(this,"touch/singlePointPanning")),c(this,"touchPinchAction",f(this,vr,wr).call(this,"touch/pinchAction")),c(this,"touchRotateAction",f(this,vr,wr).call(this,"touch/rotateAction")),c(this,"dragStartCanSelect",f(this,yr,br).call(this,"touch/dragStartCanSelect")),c(this,"featureHspSelectiveAdjustmentsEnabled",f(this,yr,br).call(this,"features/hspSelectiveAdjustmentsEnabled")),c(this,"featureLayerListEnabled",f(this,yr,br).call(this,"features/layerListEnabled")),c(this,"unstable_videoExportInactivityTimeout",Cr((()=>1e4))),h(this,pr,e);const t=or((()=>{1===t.handlers.size&&f(this,mr,gr).call(this)}),(()=>{var e;0===t.handlers.size&&(null==(e=d(this,hr))||e.call(this))}));h(this,fr,t),this.role={subscribe:ur((e=>d(this,pr).onRoleChanged(e)),ar(),sr),update:e=>{d(this,pr).setRole(e)},value:()=>d(this,pr).getRole()}}dispose(){var e;d(this,fr).handlers.clear(),null==(e=d(this,hr))||e.call(this)}};pr=new WeakMap,hr=new WeakMap,fr=new WeakMap,mr=new WeakSet,gr=function(){if(d(this,hr))throw new Error("Settings Changed Event callback is already registered.");const e=d(this,pr).onSettingsChanged((()=>{d(this,fr).emit()}));h(this,hr,(()=>{e(),h(this,hr,null)}))},yr=new WeakSet,br=function(e){const t=()=>d(this,pr).getSettingBool(e);return{subscribe:ur((e=>d(this,fr).call(this,e)),nr(t),ar(),sr),update:t=>{d(this,pr).setSettingBool(e,t),d(this,fr).emit()},value:t}},vr=new WeakSet,wr=function(e){const t=()=>d(this,pr).getSettingEnum(e);return{subscribe:ur((e=>d(this,fr).call(this,e)),nr(t),ar(),sr),update:t=>{d(this,pr).setSettingEnum(e,t),d(this,fr).emit()},value:t}},_r=new WeakSet,Er=function(e){const t=()=>d(this,pr).getSettingString(e);return{subscribe:ur((e=>d(this,fr).call(this,e)),nr(t),ar(),sr),update:t=>{d(this,pr).setSettingString(e,t),d(this,fr).emit()},value:t}};var VariableAPI=class{#e;constructor(e){this.#e=e}findAll(){return Tt(this.#e.findAllVariables())}setString(e,t){return Zt("key",e,Wt()),Zt("value",t,Wt()),bt(this.#e.setVariableString(e,t))}getString(e){return Zt("key",e,Wt()),bt(this.#e.getVariableString(e))}remove(e){return Zt("key",e,Wt()),bt(this.#e.removeVariable(e))}};u([ft],VariableAPI.prototype,"findAll",1),u([mt],VariableAPI.prototype,"setString",1),u([ft],VariableAPI.prototype,"getString",1),u([mt],VariableAPI.prototype,"remove",1);var xr={Info:"Info",Warning:"Warning",Error:"Error"};function Tr(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)}}function Ar(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).href}function Pr(e){return"/"!==e[e.length-1]?`${e}/`:e}var qr=async function(e,t,r=fetch,o,n=new Set(o.findAllSources())){const i=e.map((async e=>{const i=function(e,t){const r=e.endsWith("/"),o=t.startsWith("/");return r&&o?`${e.substring(0,e.length-1)}${t}`:r||o?`${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;n.has(e)||o.addLocalSource(e),i.forEach((r=>{r.meta&&Object.entries(r.meta).forEach((([e,o])=>{const n=o.toString();if(n.includes("{{base_url}}")){const o=n.replace("{{base_url}}",t);r.meta&&(r.meta[e]=o)}})),r.payload?.typeface&&r.payload.typeface.fonts.forEach((e=>{e.uri.includes("{{base_url}}")&&(e.uri=e.uri.replace("{{base_url}}",t))})),r.payload?.sourceSet&&r.payload.sourceSet.forEach((e=>{e.uri.includes("{{base_url}}")&&(e.uri=e.uri.replace("{{base_url}}",t))})),o.addAssetToSource(e,r)}))}))}));await Promise.all(i)};var Fr=async function(e,t,r,o){const n=["ly.img.sticker","ly.img.vectorpath","ly.img.colors.defaultPalette","ly.img.filter.lut","ly.img.filter.duotone","ly.img.effect","ly.img.blur","ly.img.typeface"].filter((e=>!r.includes(e)));await qr(n,t,o,e)};var Lr=async function(e,t,r,o,n,i,a="https://cdn.img.ly/assets/demo/v2"){const s=new Set(e.findAllSources()),u="ly.img.image.upload";!n||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"!==o||!n||r.includes(c)||s.has(c)||e.addLocalSource(c,["video/mp4","video/quicktime"]);const l="ly.img.audio.upload";"Video"!==o||!n||r.includes(l)||s.has(l)||e.addLocalSource(l,["audio/mpeg","audio/mp3","audio/x-m4a","audio/wav"]);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")),"Video"!==o||s.has("ly.img.video.template")||r.includes("ly.img.video.template")||(e.addLocalSource("ly.img.video.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.video.template")),await qr(d,a,i,e)};function Dr(e,t){let r;const o=new Set;function n(){const o=window.devicePixelRatio,{width:i,height:a}=e.getBoundingClientRect();t(i*o,a*o,o),r=matchMedia(`(resolution: ${o}dppx)`),r.addEventListener("change",n,{once:!0})}n();const i=new ResizeObserver((function([e]){const{width:r,height:n}=e.target.getBoundingClientRect();if(r<=0||n<=0)return;const i=window.devicePixelRatio,a=setTimeout((function(){o.delete(a),t(r*i,n*i,i)}),0);o.add(a)}));return i.observe(e),()=>{r.removeEventListener("change",n),i.disconnect();for(const e of o)clearTimeout(e);o.clear(),e=null,t=null}}var Br=s(tt()),Rr=(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))(Rr||{}),Mr=Rr,Ir=s(ut());function Or(e,t){const{block:r,event:o}=t;return ur((t=>{const n=r.getType(e),i=(0,Ir.default)(o.subscribe([e],(function(o){o.some((e=>"Destroyed"===e.type))&&!r.isValid(e)||r.getType(e)!==n?i():t(o)})));return i}),sr)}var jr=function(e,t,r,o){const n=function(e,t){if(!t)return e;let r;return(...o)=>{const n=e(...o);return t(n,r)||(r=n),r}}(t,o?.equals),i=or();return{subscribe:ur(cr(e,i),nr(n),ar(),sr),update:r,value:n,flush:()=>i.emit()}};var Ur=class{settings;clampCamera=!1;clampResult=Cr((()=>({sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}})));zoomLevel;#t;viewportPadding=Cr((()=>({x:40,y:48})));autoFit;scrollPercentage;sceneSize;scroll;constructor(e){const{block:t,scene:r,_ubq:o}=e,n=ur(r.onActiveChanged,ir(),nr((()=>r.get()))),i=ur(n,nr((r=>null!=r&&t.isValid(r)?ur(Or(r,e),ir([]),nr((()=>t.getFloat(r,"scene/dpi")))):()=>()=>{})),lr),a=ur(n,nr((()=>{const r=t.findByType("camera")[0];return null==r?()=>()=>{}:ur(Or(r,e),ir([]),nr((()=>r)))})),lr);this.settings={subscribe:ur(a,nr((e=>({width:t.getFloat(e,"camera/resolution/width"),height:t.getFloat(e,"camera/resolution/height"),pixelRatio:t.getFloat(e,"camera/pixelRatio")}))),ar(Br.default),sr),update({width:e,height:r,pixelRatio:o}){const n=t.findByType("camera")[0];null!=n&&(t.setFloat(n,"camera/resolution/width",e),t.setFloat(n,"camera/resolution/height",r),t.setFloat(n,"camera/pixelRatio",o))},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=jr(cr(r.onZoomLevelChanged,i),(()=>{const e=r.get(),{pixelRatio:o}=this.settings.value();return null!=e&&t.isValid(e)?r.getZoomLevel()/o:1}),(e=>{const o=r.get(),{pixelRatio:n}=this.settings.value();null!=o&&t.isValid(o)&&r.setZoomLevel(e*n)})),this.#t={subscribe:ur(a,nr((e=>new yt(o).getValue(e,Mr.Camera,"zoomLevel"))),ar()),value(){const e=t.findByType("camera")[0];return null==e?1:new yt(o).getValue(e,Mr.Camera,"zoomLevel")}},this.autoFit=jr(r.onZoomLevelChanged,(()=>{const e=r.get();return null!=e&&r.isZoomAutoFitEnabled(e)})),this.scrollPercentage={subscribe:ur(this.clampResult.subscribe,nr((e=>e.scrollPercentage)),ar(Br.default)),value:()=>this.clampResult.value().scrollPercentage},this.sceneSize={subscribe:ur(dr(this.clampResult.subscribe,this.#t.subscribe,this.settings.subscribe),nr((([e,t,r])=>{const o=e?.sceneSize??this.clampResult.value().sceneSize??{x:0,y:0},n=t??this.#t.value()??10,i=r?.pixelRatio??this.settings.value().pixelRatio??1;return{x:o.x*n/i,y:o.y*n/i}})),ar(Br.default)),value:()=>{const e=this.clampResult.value().sceneSize??{x:0,y:0},t=this.#t.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 o=this.#t.value(),n=this.settings.value().pixelRatio,i=e.x*n/o,a=e.y*n/o,s={x:t.getPositionX(r)+i,y:t.getPositionY(r)+a};t.setPositionX(r,s.x),t.setPositionY(r,s.y)}}},$r="apiFallbackTypefaces";function Nr(e,t,r=void 0){const o=e=>{bt(t.setContext("")),e.preventDefault()},n=e=>{bt(t.setContext("!canvas")),r&&r(),e.preventDefault()};return e.addEventListener("webglcontextlost",o,!1),e.addEventListener("webglcontextrestored",n,!1),()=>{e.removeEventListener("webglcontextlost",o),e.removeEventListener("webglcontextrestored",n)}}var Hr=!1;var Vr="https://api.img.ly/activate";var Wr=s(lt()),zr="./cesdk-v1.27.1-rc.0-46BMFTP2.data",Gr="./cesdk-v1.27.1-rc.0-EY6RHE4D.wasm",Yr=Wr.default,Xr=!("undefined"==typeof window||!window.document||!window.document.createElement)&&navigator&&navigator.userAgent||"",Zr=-1!==Xr.indexOf("Edge"),Kr=!!Xr.match(/msie|trident/i),Qr=/\b(iPad|iPhone|iPod)\b/.test(Xr)&&/WebKit/.test(Xr)&&!/Edge/.test(Xr)&&("undefined"==typeof window||!("MSStream"in window)),Jr=(e,t)=>{if(null!=t){return[t,e.split("/").pop()].join("")}return new URL(e,window.location.origin)};function eo(){try{return new WebAssembly.Memory({initial:to(Qr?512:32),maximum:to(2048)})}catch(e){return new WebAssembly.Memory({initial:to(32),maximum:to(2048)})}}function to(e){return 1024*e*1024/65536}async function ro(e,t){const{core:r}=t,o=t.logger,n=Jr(Gr,r.baseURL).toString(),i=Jr(zr,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(Vr,{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")?n:e.endsWith(".data")?i:t+e,print:e=>{e&&"undefined"!==e&&o(e,"Info")},printErr:e=>{e&&"undefined"!==e&&o(e,"Error")},logReadFiles:!1,printWithColors:!0,wasmMemory:eo()};Yr(c).then((async o=>{o.specialHTMLTargets["!canvas"]=e;o.emscripten_ubq_settings_forceWebGL1=Qr||!!t?.forceWebGL1;const n=bt(o.createEngine("!canvas",t.audioOutput??"auto"));!function(e,t){if(!t)throw new Error("Missing license key");bt(e.unlockWithLicense(t))}(n,await s),function(e,t){const r=new yt(e),o=new EditorAPI(e),n=new AssetAPI(e);o.setRole(t.role??"Creator"),Hr&&(r.execute("cesdk/getVersionInfo").then((e=>console.debug(e))),r.execute("cesdk/getCapabilitiesInfo").then((e=>console.debug(e)))),o.setSettingString("basePath",t.baseURL),o.setSettingBool("showBuildVersion",Hr||!1),t.featureFlags?.preventScrolling&&(o.setSettingBool("touch/singlePointPanning",!1),o.setSettingBool("touch/dragStartCanSelect",!1)),n.addLocalSource("ly.img.text"),function(){Hr&&(o.setSettingBool("features/hspSelectiveAdjustmentsEnabled",!1),o.setSettingBool("features/layerListEnabled",!1),o.setSettingBool("features/templatingEnabled",!0));const e=!!t.featureFlags?.singlePageMode;o.setSettingBool("features/singlePageModeEnabled",e),o.setSettingBool("features/effectsEnabled",!0)}(),function(){const t=new VariableAPI(e);(Hr||"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.startTracking(t.license,t.userId??"")}(n,t),r(n)})).catch(a)}))}async function oo(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 no=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?.()}},io=s(tt()),ao=Symbol("NO_VALUE"),so=class{callId;_value=ao;_lastUpdateValue=ao;_readFromEngine;constructor(e,t){this.callId=e,this._readFromEngine=t,this.read(),this._lastUpdateValue=this._value}readCachedValue(){return this._value===ao||this.revalidate?this.read():this._value}revalidate=!1;invalidate(){this.revalidate=!0}read(){const e=this._readFromEngine();return this.revalidate=!1,(0,io.default)(this._value,e)?this._value:(this._value=e,e)}updateValueAndCheckDirty(){try{const e=this.read(),t=this._lastUpdateValue!==e;return this._lastUpdateValue=e,t}catch{return this._lastUpdateValue=ao,!0}}update(e){this._readFromEngine=e}},uo=class{readCalls=new Map;registeredReactions=new Set;activeReactions=new Set;get isTracking(){return this.activeReactions.size>0}_getterCalled(e,t){if(this.isTracking){if(this.readCalls.has(e)){this.readCalls.get(e).update(t)}else this.readCalls.set(e,new so(e,t));for(const t of this.activeReactions)t.readCalls.add(e)}}_setterCalled(){for(const e of this.readCalls.values())e.invalidate()}read(e,t){return this.isTracking&&this.readCalls.has(e)?this.readCalls.get(e).readCachedValue():t()}#r=0;createReaction(e){return new no(this,e)}_registerReaction(e){this.registeredReactions.add(e)}_unregisterReaction(e){this.registeredReactions.delete(e)}_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)}#o=new Set;updateDirtyReactions(){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)if(!t.dirty)for(const r of t.readCalls)if(e.has(r)){t.dirty=!0;break}for(const e of this.registeredReactions)if(!this.#o.has(e)&&e.dirty)try{this.#o.add(e),e.update()}finally{e.dirty=!1,this.#o.delete(e)}this._cleanupReadCalls()}_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){gt[r]??=0;const o=gt[r]++;return function(...n){const i=this,a=`${r}${o}-${JSON.stringify(n,null,0)}`;function s(){return Reflect.apply(t,i,n)}return e._getterCalled(a,s),e.read(a,s)}}(this,e,t)}decorateObject(e){return function(e,t){const r=t.constructor?.name??crypto.randomUUID(),o=[];let n=!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)&&ht in a)if("getter"===i[ht].type){let a=function(...t){if(n)throw new Error("Disposed @getter proxy called");const o=this,a=`${r}-${s.toString()}-${JSON.stringify(t,null,0)}`;function u(){return Reflect.apply(i,o,t)}return e._getterCalled(a,u),e.read(a,u)};const u=Object.hasOwnProperty.call(t,"fnName")?()=>{t[s]=i}:()=>delete t[s];o.push(u),t[s]=a}else if("setter"===i[ht].type){let r=function(...t){if(n)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];o.push(a),t[s]=r}}var a;return function(){n=!0;for(const e of o)e();o.length=0}}(this,e)}dispose(){this.registeredReactions.forEach((e=>e.dispose())),this.registeredReactions.clear(),this.readCalls.clear(),this.activeReactions.clear()}},co='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 lo(e,t){let r;return t.onStateChanged((()=>{const o=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(!Kr&&!Zr)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 co;case"Text":return"text";default:return"auto"}}(t.getCursorType(),t.getCursorRotation());if(o!==r){r=o;const t=new CustomEvent("cesdk-cursor",{composed:!0,bubbles:!0,cancelable:!0,detail:o});e.dispatchEvent(t)&&e.style.setProperty("cursor",o)}}))}var po=function(e,t,r,o){let n,i=null;const a=r.onStateChanged((()=>{n=r.getEditMode(),"Text"!==n||i?"Text"!==n&&i&&(i(),i=null):i=function(){const n=i();return()=>{n?.()};function i(){let n=!1,i="";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 a=u();l();const s=d();return e.parentElement.appendChild(a),p(),()=>{s(),c()};function u(){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 c(){a.blur(),a.remove()}function l(){const t=r.getTextCursorPositionInScreenSpaceX(),o=r.getTextCursorPositionInScreenSpaceY(),{left:n,top:i}=e.getBoundingClientRect();a.style.left=`${n+t/window.devicePixelRatio}px`,a.style.top=`${i+o/window.devicePixelRatio}px`}function d(){const t=e.getRootNode();a.addEventListener("input",v),a.addEventListener("keydown",_),a.addEventListener("copy",g),a.addEventListener("cut",y),a.addEventListener("compositionstart",E),a.addEventListener("compositionend",S),a.addEventListener("beforeinput",T),a.addEventListener("focusout",A),t.addEventListener("touchend",x),t.addEventListener("mousedown",x),t.addEventListener("mouseup",k);const o=r.onStateChanged((()=>{l()}));return()=>{a.removeEventListener("input",v),a.removeEventListener("keydown",_),a.removeEventListener("copy",g),a.removeEventListener("cut",y),a.removeEventListener("compositionstart",E),a.removeEventListener("compositionend",S),a.removeEventListener("beforeinput",T),a.removeEventListener("focusout",A),t.removeEventListener("mousedown",x),t.removeEventListener("mouseup",k),t.removeEventListener("touchend",x),o()}}function p(){null!==a.parentElement&&(a.focus(),h()||setTimeout((()=>a.focus()),0))}function h(){return a.getRootNode().activeElement===a}function f(e){return[...e].length}function m(e){const t=e.selectionEnd??e.selectionStart??0;return f(e.value.substring(0,t))}function g(e){try{t.useInternalAPI((t=>{const r=bt(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function y(e){try{t.useInternalAPI((r=>{const o=bt(r.getSelectedText());if(""!==o&&e.clipboardData){e.clipboardData.setData("text/plain",o),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 b(){return!(!n||t.ubq.unstable_isTextCursorInCompositionRange())&&(await S(),!0)}function v(e){const r=e.target,{value:o}=r;if(n){const e=m(a);t.execute("ubq/text/compositionUpdate",{value:o,cursorPosition:e})}else o.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 _(e){if(b(),1===e.key.length&&(i=e.key),"a"===e.key&&(e.metaKey||e.ctrlKey))return n&&S(),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=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&&(a.value="")}async function E(){n=!0,await t.execute("ubq/text/compositionStart")}async function S(){n?(n=!1,a.value="",t.execute("ubq/text/compositionEnd")):a.value=""}async function C(){if(!n)return;o();if(await b())return;const e=t.ubq.unstable_getCursorPosition(),r=t.ubq.unstable_getCompositionRange(),i=e.end-r.start,s=m(a);e.start>=r.start&&e.start<=1+r.end&&i!==s&&S()}async function k(){C()}async function x(t){C(),t.target===e&&"Text"===r.getEditMode()&&(p(),t.preventDefault())}async function T(e){if(n&&!e.isComposing&&S(),null===e.data)return;const r=e.target,o=e.data;if(await b())w(i);else if(n){const e=f(o);t.execute("ubq/text/compositionUpdate",{value:o,cursorPosition:e})}else o.length>0&&("\n"!==o[0]&&w(o),r.value="")}function A(e){if(F(e.relatedTarget)&&P(e.relatedTarget));else{q(e)}}function P(t){const r=new CustomEvent("cesdk-blur",{composed:!0,bubbles:!0,cancelable:!0,detail:t});return e.dispatchEvent(r)}function q(t){const r=new CustomEvent("cesdk-refocus",{composed:!0,bubbles:!0,cancelable:!0,detail:t.relatedTarget}),o=e.dispatchEvent(r);return o&&p(),o}function F(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()=>{i?.(),a()}};function ho(e,t,r){const o=[],n=r=>{if("touch"===r.pointerType)return;const o=fo(e,r);t.execute("ubq/inputs/mousemove",o)},i=n=>{if("touch"===n.pointerType)return;const i={...fo(e,n),button:mo(n.button),state:0,shiftIsHeld:!!n.shiftKey};o[n.button]=!1,n.currentTarget.releasePointerCapture(n.pointerId),t.execute("ubq/inputs/mousebutton",i),r()},a=r=>{if("touch"===r.pointerType)return;const n={...fo(e,r),button:mo(r.button),state:1,shiftIsHeld:!!r.shiftKey};o[r.button]=!0,r.currentTarget.setPointerCapture(r.pointerId),t.execute("ubq/inputs/mousebutton",n)},s=r=>{if("touch"===r.pointerType)return;const n={...fo(e,r),shiftIsHeld:!!r.shiftKey};o.forEach(((e,r)=>{if(e){const e={...n,button:r,state:0};t.execute("ubq/inputs/mousebutton",e)}})),o.length=0},u=e=>{e.cancelable&&e.preventDefault()};return e.addEventListener("pointerdown",a),e.addEventListener("pointerup",i),e.addEventListener("pointercancel",i),e.addEventListener("pointermove",n),e.addEventListener("lostpointercapture",s),e.addEventListener("touchmove",u,{passive:!1}),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointerup",i),e.removeEventListener("pointercancel",i),e.removeEventListener("pointermove",n),e.removeEventListener("lostpointercapture",s),e.removeEventListener("touchmove",u),e=null}}function fo(e,t){const r=e.getBoundingClientRect(),o=r?.top??0,n=r?.left??0;return{position:{x:(t.clientX-n)*window.devicePixelRatio,y:(t.clientY-o)*window.devicePixelRatio},isTouch:!1,timestamp:t.timeStamp}}function mo(e){switch(e){case 0:return 0;case 1:return 2;case 2:return 1;default:return 255}}var go=class{ubq;enabled;initialTarget;target;dispose;constructor(e,t){this.ubq=t,this.enabled=jr(e.editor.onSettingsChanged,(()=>{const t=e.editor.getSettingBool("mouse/enableZoom"),r=e.editor.getSettingBool("mouse/enableScroll");return t||r})),this.target=Cr((()=>{})),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=cr(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={...fo(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}}},yo=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 o=e.touches.item(r);t[r]=bo(o)}this.touches=t}touchUpdate(e){for(let t=0;t<e.touches.length;t++){const r=e.touches.item(t),o=this.touches.find((e=>e.identifier===r.identifier));if(!o)return;o.x=r.clientX,o.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,o],n){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 ${n} rgb(${t},${r},${o})`,i.style.borderRadius="50%",i.style.borderStyle=n,i.style.backgroundColor=`rgba(${t},${r},${o}, 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,o){if(!e){const[t,r,n]=o??[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},${n})`,e.style.borderStyle="dashed",e.style.backgroundColor=`rgba(${t},${r},${n}, 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(bo)}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 bo(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 vo=class _PanRecognizer extends yo{static PAN_THRESHOLD=10;makeEvent(e){const t=0===e.state?{x:0,y:0}:this.currentTransform;return{...e,panDistance:t}}calculateTransform(){const e=_o(this.touches),t=_o(this.baseTouches);return{x:e.x-t.x,y:e.y-t.y}}emptyTransform(){return{x:0,y:0}}shouldStart(){return super.shouldStart()&&wo(this.calculateTransform())>_PanRecognizer.PAN_THRESHOLD}};function wo(e){return Math.sqrt(e.x**2+e.y**2)}function _o(e){let t=0,r=0;for(let o=0;o<e.length;o++){const n=e[o];t+=n.x,r+=n.y}return t/=e.length,r/=e.length,{x:t,y:r}}var Eo=class _PinchRecognizer extends yo{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}},So=class _PointRecognizer extends yo{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&&wo(this.calculateTransform())>_PointRecognizer.DISTANCE_THRESHOLD}shouldStop(){return 1!==this.touches.length}},Co=class _RotateRecognizer extends yo{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 ko(e,t){const r=[],o=new So;r.push(o.listen(e)),r.push(o.addListener((r=>{"button"in r?t.execute("ubq/inputs/mousebutton",xo(e,r)):t.execute("ubq/inputs/mousemove",xo(e,r))})));const n=new vo;r.push(n.listen(e)),r.push(n.addListener((r=>{t.execute("ubq/inputs/touchpan",xo(e,r))})));const i=new Eo;r.push(i.listen(e)),r.push(i.addListener((r=>{t.execute("ubq/inputs/touchpinch",xo(e,r))})));const a=new Co;return r.push(a.listen(e)),r.push(a.addListener((r=>{t.execute("ubq/inputs/touchrotate",xo(e,r))}))),()=>{r.forEach((e=>e()))}}function xo(e,t){const r=window.devicePixelRatio??1,{top:o,left:n}=e.getBoundingClientRect();if(1===r&&0===o&&0===n)return t;const i=e=>({x:(e.x-n)*r,y:(e.y-o)*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 To(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}var Ao,Po,qo="assets/core/worker-host-v1.27.1-rc.0-KDJMPE3L.js",Fo="application/javascript";(Po=Ao||(Ao={})).start=function(e){return{...e,msg:"exportVideo"}},Po.abort=function(){return{msg:"exportVideoAbort"}},Po.finished=function(e){return{...e,msg:"exportVideoFinished"}},Po.error=function(e){return{...e,msg:"exportVideoError"}},Po.progress=function(e){return{...e,msg:"exportVideoProgress"}},Po.log=function(e){return{...e,msg:"exportLog"}};var Lo=class{configuration;constructor(e){this.configuration=e}async exportVideo(e,t,r,o,n,i){const{abortSignal:a,inactivityTimeout:s}=n??{},u=await async function(e){const t=qo.toString().split("/").pop(),r=await async function(e){if(!(e=e.toString()).includes("://")||e.includes(window.location.origin))return e;const t=`const _importScripts = importScripts;\n const _fixImports = (url) => new URL(url, '${new URL(e).href.split("/").slice(0,-1).join("/")}/').href;\n importScripts = (...urls) => _importScripts(...urls.map(_fixImports));`;return URL.createObjectURL(new Blob([`${t}importScripts("${e}")`],{type:Fo}))}(new URL(t,e.core.baseURL));return new Worker(r)}(this.configuration),c=function(e){return{baseURL:e.baseURL,license:e.license,core:e.core,role:e.role,presets:e.presets,featureFlags:e.featureFlags,forceWebGL1:e.forceWebGL1,audioOutput:e.audioOutput}}(this.configuration),l=new Promise(((e,t)=>{if(u.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?n?.onProgress?.(r.renderedFrames,r.encodedFrames,r.totalFrames):"exportLog"===r.msg?this.configuration.logger(r.message,r.logLevel):console.error("Unknown message received ",r)},a){let e=!1;const t=()=>{e||(e=!0,u.postMessage(Ao.abort()))};a.addEventListener("abort",t,{once:!0})}}));u.postMessage(Ao.start({sceneString:e,engineSettings:t,pluginURLs:r,config:c,exportOptions:o,workerOptions:i,inactivityTimeout:s}));const d=()=>{u.postMessage({msg:"setVisibility",visible:"visible"===document.visibilityState})};return document.addEventListener("visibilitychange",d),l.finally((()=>{u.terminate(),document.removeEventListener("visibilitychange",d)})),l}};var Do=10,Bo=1e4;globalThis.ubq_browserTabHidden=!0;var Ro={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 Mo(e,t,r){return async(o,n,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 o of r)switch(e.getSettingType(o)){case"Bool":t.set(o,e.getSettingBool(o));break;case"Int":t.set(o,e.getSettingInt(o));break;case"Float":t.set(o,e.getSettingFloat(o));break;case"String":t.set(o,e.getSettingString(o));break;case"Color":t.set(o,e.getSettingColor(o));break;case"Enum":t.set(o,e.getSettingEnum(o))}return t}(t.editor),l=t.settings.unstable_videoExportInactivityTimeout.value(),d=t.editor.getActiveLicense(),p={scopes:Object.fromEntries(t.editor.findAllScopes().map((e=>[e,t.editor.getGlobalScope(e)])))};try{p.trackingMetadata=t.editor.getTrackingMetadata()}catch{p.trackingMetadata=void 0}const h={block:o,width:a.targetWidth,height:a.targetHeight,...a};if(e.featureFlags?.exportWorker??1){return new Lo({...e,license:d}).exportVideo(u,c,r,h,{abortSignal:a.abortSignal,inactivityTimeout:l,onProgress:i},p)}return async function(e,t,r,o,n={},i,a){let s,u,c=0,l=null;const d=a?.visibility??Ro;globalThis.ubq_exportVideoTimeout=a?.inactivityTimeout;const p=d.subscribe((()=>{null!==l&&(l=Date.now()),globalThis.ubq_browserTabHidden=!d.value()}));let h=null;function f(){clearTimeout(u),p(),h?.()}try{let p=function(){if(!0===d.value()&&null!==l&&Date.now()-l>Bo)s(new Error("Video export timed out due to inactivity."));else{if(c<Do){for(const e of S)e.update?.(C);g.update()}u=setTimeout(p,1)}};const m=new OffscreenCanvas(64,64),g=await ro(m,{...e,audioOutput:"none"}),y=new AssetAPI(g),b=new SceneAPI(g),v=new BlockAPI(g),w=new EditorAPI(g),_=new EventAPI(g),E=new VariableAPI(g);if(h=()=>{g.delete()},function(e,t){for(const[r,o]of t)switch(e.getSettingType(r)){case"Bool":e.setSettingBool(r,o);break;case"Int":e.setSettingInt(r,o);break;case"Float":e.setSettingFloat(r,o);break;case"String":e.setSettingString(r,o);break;case"Color":e.setSettingColor(r,o);break;case"Enum":{const t=r,n=o;e.setSettingEnum(t,n)}}}(w,t),i?.trackingMetadata&&w.setTrackingMetadata(i.trackingMetadata),i?.scopes)for(const[e,t]of Object.entries(i.scopes))w.setGlobalScope(e,t);const S=await Promise.all(r.map((e=>oo(e)))),C={asset:y,block:v,scene:b,editor:w,event:_,variable:E};for(const e of S)e.initialize?.(C);const k=await b.loadFromString(o),x=n.block?v.getDuration(n.block):v.getTotalSceneDuration(b.get());p();const T=await new Promise(((t,r)=>{s=r,e.abortSignal?.addEventListener("abort",(()=>{r(new Error("AbortSignal received"))})),g.exportVideoToBuffer(n.block??k,n.timeOffset??0,n.duration??x,tr.Mp4,((e,t,r)=>{c=e-t,l=Date.now(),a?.onProgress?.(e,t,r)}),(e=>{"error"in e?r(e.error):t(e)}),{h264Profile:n.h264Profile??77,h264Level:n.h264Level??52,framerate:n.framerate??30,useTargetSize:void 0!==n.width&&void 0!==n.height,targetWidth:n.width??0,targetHeight:n.height??0})})),A=new Uint8Array(T.byteLength);return A.set(T),f(),A}catch(e){throw f(),e}}(a.abortSignal?{...e,abortSignal:a.abortSignal}:e,c,r,u,h,p,{onProgress:i,visibility:gn,inactivityTimeout:l}).then((e=>new Blob([e],{type:tr.Mp4})))}}var Io,Oo,jo,Uo,$o,No,Ho,Vo,Wo,zo,Go,Yo,Xo,Zo,Ko,Qo,Jo,en,tn,rn,on,nn,an,sn,un,cn,ln,dn,pn,hn,fn,mn,gn={value:()=>"visible"===document.visibilityState,subscribe:ur((Io=document,Oo="visibilitychange",function(e){return Io.addEventListener(Oo,e),function(){Io.removeEventListener(Oo,e)}}),nr((()=>"visible"===document.visibilityState)))},CreativeEngine=class{constructor(e,t,r){p(this,Xo),p(this,Ko),p(this,tn),p(this,on),p(this,an),p(this,ln),p(this,pn),p(this,fn),c(this,"asset"),c(this,"block"),c(this,"editor"),c(this,"event"),c(this,"scene"),c(this,"variable"),p(this,jo,void 0),c(this,"reactor"),p(this,Uo,void 0),p(this,$o,void 0),p(this,No,void 0),p(this,Ho,void 0),p(this,Vo,void 0),p(this,Wo,[]),p(this,zo,[]),p(this,Go,void 0),p(this,Yo,[]),p(this,Jo,[]),p(this,en,void 0),p(this,un,(0,dt.default)(function(){f(this,pn,hn).call(this)}.bind(this),100,{leading:!0,trailing:!1})),p(this,cn,void 0),h(this,Go,e),h(this,$o,new yt(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),h(this,jo,new kr(this.editor)),h(this,Vo,new go(this,e)),d(this,Yo).push(d(this,Vo).dispose);const o=new uo;this.reactor=o;const n=[this.reactor.decorateObject(d(this,$o)),this.reactor.decorateObject(this.block),this.reactor.decorateObject(this.editor),this.reactor.decorateObject(this.scene),this.reactor.decorateObject(this.variable)],i=this.addPostUpdateCallback(o.updateDirtyReactions.bind(o));d(this,Yo).push((()=>{n.forEach((e=>e())),i(),this.reactor.dispose()})),this.block.exportVideo=Mo(r,{block:this.block,scene:this.scene,editor:this.editor,settings:d(this,jo)},d(this,Wo)),"getInternalCanvas"in t?(h(this,No,t.getInternalCanvas()),h(this,Ho,t)):h(this,No,t),h(this,Uo,new Ur(this)),f(this,tn,rn).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=r,this.helper=d(this,$o))}async unstable_addPlugin(e){null!=e.url&&d(this,Wo).push(e.url);const t=e.url?await oo(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)}d(this,zo).push(t)}unstable_setVideoExportInactivityTimeout(e){d(this,jo).unstable_videoExportInactivityTimeout.update(e)}addPostUpdateCallback(e){return d(this,Jo).push(e),()=>{const t=d(this,Jo).indexOf(e);-1!==t&&d(this,Jo).splice(t,1)}}setWheelEventTarget(e){return d(this,Vo).setTarget(e)}get element(){return d(this,Ho)}dispose(){d(this,Yo).forEach((e=>e())),f(this,ln,dn).call(this),this.asset.dispose(),h(this,No,null),d(this,Ho)?.dispose(),h(this,Ho,void 0),h(this,$o,null),this.block=null,this.scene=null,this.variable=null,this.asset=null,this.editor=null,this.event=null,d(this,Jo).length=0,d(this,Go).delete(),h(this,Go,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 o="04f4d9c1ee";let n;o&&console.log(`[CreativeEngine] Revision ${o}`),r||(n=function(){customElements.get("cesdk-canvas")||customElements.define("cesdk-canvas",class HTMLCreativeEngineCanvasElement extends HTMLElement{#n;constructor(){super(),this.#n=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.#n)}getInternalCanvas(){if(!this.#n)throw new Error("Internal canvas element is undefined");return this.#n}dispose(){this.#n?.remove(),this.#n=void 0}clear(){if(!this.#n)return;const e=this.#n.width;this.#n.width=1,this.#n.width=e}});return document.createElement("cesdk-canvas")}(),r=n.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.27.1-rc.0/assets"){const r={...e,license:e.license??"",featureFlags:e.featureFlags??{},baseURL:e.baseURL??t,core:e.core??{baseURL:"core/"},logger:e.logger??Tr,presets:e.presets??{}};return r.baseURL=Ar(r.baseURL),r.baseURL=Pr(r.baseURL),r.core.baseURL=Ar(r.core.baseURL,r.baseURL),r.core.baseURL=Pr(r.core.baseURL),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"),e.presets?.typefaces&&t.push("config.presets.typefaces has been removed. Please use the AssetAPI to add typefaces instead and use `ui.typefaceLibraries` to populate the typeface selection dropdown in the UI."),t):t}(e))a.logger(t,"Warning");const s=new this(await ro(r,a),n??r,a);return function(e,t){if(e)try{const r=t.editor,o=t.asset;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 o=e.variables[r];t.variable.setString(r,String(o.value))}if(e.presets?.typefaces){o.addLocalSource($r);for(const[t,r]of Object.entries(e.presets.typefaces))o.addAssetToSource($r,{id:t,payload:{typeface:{name:r.family,fonts:r.fonts.map((e=>({subFamily:`${e.weight} ${e.style}`,style:e.style,uri:e.fontURL,weight:e.weight})))}}})}}catch(e){console.error(e)}}(e,s),s}async addDefaultAssetSources({baseURL:e="https://cdn.img.ly/assets/v3",excludeAssetSourceIds:t=[]}={}){return Fr(this.asset,e,t)}async addDemoAssetSources({baseURL:e="https://cdn.img.ly/assets/demo/v2",excludeAssetSourceIds:t=[],sceneMode:r="Design",withUploadAssetSources:o=!1}={}){return Lr(this.asset,this.scene,t,r,o,void 0,e)}get _ubq(){return d(this,Go)}get _camera(){return d(this,Uo)}get _helper(){return d(this,$o)}};jo=new WeakMap,Uo=new WeakMap,$o=new WeakMap,No=new WeakMap,Ho=new WeakMap,Vo=new WeakMap,Wo=new WeakMap,zo=new WeakMap,Go=new WeakMap,Yo=new WeakMap,Xo=new WeakSet,Zo=function(){if(!d(this,Ho))return;const e=d(this,Ho).getInternalCanvas(),t=e.getBoundingClientRect();if(0===t.width||0===t.height)return;const r="undefined"!=typeof window?window.devicePixelRatio:1,o=t.width*r,n=t.height*r;e.width!==o&&(e.width=o),e.height!==n&&(e.height=n)},Ko=new WeakSet,Qo=function(){const{width:e,height:t}=d(this,No),r="undefined"!=typeof window?window.devicePixelRatio:1,{height:o,width:n,pixelRatio:i}=d(this,Uo).settings.value();if(!(To(n,e,1e-4)&&To(o,t,1e-4)&&To(i,r,1e-4)||(d(this,Uo).settings.update({height:t,width:e,pixelRatio:r}),To(i,r,1e-4)||null===this.scene.get()))){const e=this.scene.getZoomLevel();this.scene.setZoomLevel(e*(r/i))}},Jo=new WeakMap,en=new WeakMap,tn=new WeakSet,rn=function(e=!0){f(this,on,nn).call(this,e),f(this,an,sn).call(this)},on=new WeakSet,nn=function(e=!0){let t,r=!1,o=0;if(d(this,en))return;const n=()=>{if(h(this,en,requestAnimationFrame(n)),!r)try{f(this,pn,hn).call(this,e),o=0}catch(e){throw o++,o>=10&&(console.error("Repeated exceptions in update loop. Stopping loop."),t?.(),f(this,ln,dn).call(this)),e}};h(this,en,requestAnimationFrame(n))},an=new WeakSet,sn=function(){if(e=d(this,No),!("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement))return;var e;const t=d(this,Ho)??d(this,No),r=f(this,pn,hn).bind(this,!1),o=[ho(t,d(this,$o),r),d(this,Vo).initialize(t),po(t,d(this,$o),this.editor,r),lo(t,this.editor),ko(t,d(this,$o)),Nr(d(this,No),d(this,Go),(()=>{d(this,No).width=d(this,No).width})),Dr(t,d(this,un))];h(this,cn,(()=>{o.reverse().forEach((e=>e()))}))},un=new WeakMap,cn=new WeakMap,ln=new WeakSet,dn=function(){var e;null==(e=d(this,cn))||e.call(this),h(this,cn,void 0),d(this,en)&&(cancelAnimationFrame(d(this,en)),h(this,en,0))},pn=new WeakSet,hn=function(e=!0){for(const e of d(this,zo))e.update?.(this);if(e){1===this.block.findByType("scene").length&&f(this,fn,mn).call(this)}f(this,Xo,Zo).call(this),f(this,Ko,Qo).call(this),d(this,Go).update();for(const e of d(this,Jo))e()},fn=new WeakSet,mn=function(){if(d(this,Uo).clampCamera){const e={sceneSize:{x:0,y:0},scrollPercentage:{x:NaN,y:NaN}};d(this,$o).execute("cesdk/clampCameraAndRender",{horizontalPaddingInPixels:this._camera.viewportPadding.value().x,verticalPaddingInPixels:this._camera.viewportPadding.value().y}).then((e=>{(0,pt.default)(d(this,Uo).clampResult.value(),e)||d(this,Uo).clampResult.update(e)}),(()=>{(0,pt.default)(d(this,Uo).clampResult.value(),e)||d(this,Uo).clampResult.update(e)}))}else d(this,$o).execute("ubq/render")};var yn=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},bn=1e4,vn=1e6;async function wn(){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,o)=>{setTimeout((()=>{o(new Error("Timed out during video export"))}),bn);const n=new VideoEncoder({output:()=>r(!0),error:e=>o(e)});n.configure(e);const i=new VideoFrame(t,{timestamp:0,duration:vn/e.framerate});n.encode(i,{keyFrame:!0}),i.close(),n.flush().then((()=>{"closed"!==n.state&&n.close()}))}))}async function _n(){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"))}),bn);const o=new AudioEncoder({output:()=>t(!0),error:r});o.configure(e);const n=1024,i=new Float32Array(n*e.numberOfChannels);for(let e=0;e<n;++e){const t=e/n;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:n,numberOfChannels:e.numberOfChannels,timestamp:t*n/e.sampleRate*vn,data:i});o.encode(r),r.close()}o.flush().then((()=>{"closed"!==o.state&&o.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 Sn(){return Promise.all([wn(),_n()]).then((e=>e.every((e=>e))),(()=>!1))}var Cn=function(){try{const e=!0,t=!0,r="globalThis"in window,o="BigInt"in window,n="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 yn()&&e&&t&&r&&o&&n&&i&&a&&s&&u&&c}catch{return!1}};export{xr as LogLevel,tr as MimeType,Lo as WorkerClient,CreativeEngine as default,Cn as supportsBrowser,En as supportsVideo,Sn as supportsVideoExport,yn as supportsWasm};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
ieee754/index.js:
|