@cesdk/engine 1.6.0 → 1.6.3
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/README.md +34 -24
- package/assets/core/cesdk.wasm +0 -0
- package/index.d.ts +8 -4
- package/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={7643:(e,t,r)=>{var n=r(5557),o=r(4349),i=r(407),a=r(5134),s=r(9951);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},3872:(e,t,r)=>{var n=r(2470),o=r(7289),i=r(7614),a=r(3067),s=r(9346);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},5674:(e,t,r)=>{var n=r(489)(r(4818),"Map");e.exports=n},2462:(e,t,r)=>{var n=r(6290),o=r(4951),i=r(440),a=r(6180),s=r(7719);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},4691:(e,t,r)=>{var n=r(3872),o=r(1490),i=r(2594),a=r(5953),s=r(4667),c=r(4615);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},9652:(e,t,r)=>{var n=r(4818).Symbol;e.exports=n},4600:(e,t,r)=>{var n=r(4818).Uint8Array;e.exports=n},6562:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7554:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},1998:(e,t,r)=>{var n=r(1453),o=r(5664),i=r(5860),a=r(9571),s=r(8347),c=r(1859),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),l=!r&&o(e),d=!r&&!l&&a(e),p=!r&&!l&&!d&&c(e),f=r||l||d||p,m=f?n(e.length,String):[],g=m.length;for(var h in e)!t&&!u.call(e,h)||f&&("length"==h||d&&("offset"==h||"parent"==h)||p&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||s(h,g))||m.push(h);return m}},3675:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}},4656:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},8247:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},1612:(e,t,r)=>{var n=r(6912),o=r(3355);e.exports=function(e,t,r){(void 0!==r&&!o(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},6258:(e,t,r)=>{var n=r(6912),o=r(3355),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];i.call(e,t)&&o(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},8620:(e,t,r)=>{var n=r(3355);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},6912:(e,t,r)=>{var n=r(4698);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},8528:(e,t,r)=>{var n=r(4820),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},8288:(e,t,r)=>{var n=r(4656),o=r(1813);e.exports=function e(t,r,i,a,s){var c=-1,u=t.length;for(i||(i=o),s||(s=[]);++c<u;){var l=t[c];r>0&&i(l)?r>1?e(l,r-1,i,a,s):n(s,l):a||(s[s.length]=l)}return s}},3153:(e,t,r)=>{var n=r(7572)();e.exports=n},2759:(e,t,r)=>{var n=r(9652),o=r(5135),i=r(3744),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},6651:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},3216:(e,t,r)=>{var n=r(830),o=r(931),i=r(4820),a=r(1304),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,p=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?p:s).test(a(e))}},9920:(e,t,r)=>{var n=r(2759),o=r(7906),i=r(1408),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},3339:(e,t,r)=>{var n=r(4820),o=r(7839),i=r(3003),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},7604:(e,t,r)=>{var n=r(4691),o=r(1612),i=r(3153),a=r(480),s=r(4820),c=r(2551),u=r(7700);e.exports=function e(t,r,l,d,p){t!==r&&i(r,(function(i,c){if(p||(p=new n),s(i))a(t,r,c,l,e,d,p);else{var f=d?d(u(t,c),i,c+"",t,r,p):void 0;void 0===f&&(f=i),o(t,c,f)}}),c)}},480:(e,t,r)=>{var n=r(1612),o=r(8192),i=r(9947),a=r(6581),s=r(1172),c=r(5664),u=r(5860),l=r(5274),d=r(9571),p=r(830),f=r(4820),m=r(1969),g=r(1859),h=r(7700),E=r(2963);e.exports=function(e,t,r,y,v,_,b){var w=h(e,r),T=h(t,r),O=b.get(T);if(O)n(e,r,O);else{var D=_?_(w,T,r+"",e,t,b):void 0,P=void 0===D;if(P){var x=u(T),S=!x&&d(T),R=!x&&!S&&g(T);D=T,x||S||R?u(w)?D=w:l(w)?D=a(w):S?(P=!1,D=o(T,!0)):R?(P=!1,D=i(T,!0)):D=[]:m(T)||c(T)?(D=w,c(w)?D=E(w):f(w)&&!p(w)||(D=s(T))):P=!1}P&&(b.set(T,D),v(D,T,y,_,b),b.delete(T)),n(e,r,D)}}},1445:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},5757:(e,t,r)=>{var n=r(1191),o=r(2549),i=r(6613);e.exports=function(e,t){return i(o(e,t,n),e+"")}},4274:(e,t,r)=>{var n=r(7477),o=r(4698),i=r(1191),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},1453:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},5208:(e,t,r)=>{var n=r(9652),o=r(3675),i=r(5860),a=r(1918),s=n?n.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},8275:e=>{e.exports=function(e){return function(t){return e(t)}}},1254:(e,t,r)=>{var n=r(4600);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},8192:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},9947:(e,t,r)=>{var n=r(1254);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},6581:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},7200:(e,t,r)=>{var n=r(6258),o=r(6912);e.exports=function(e,t,r,i){var a=!r;r||(r={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(r[u],e[u],u,r,e):void 0;void 0===l&&(l=e[u]),a?o(r,u,l):n(r,u,l)}return r}},8940:(e,t,r)=>{var n=r(4818)["__core-js_shared__"];e.exports=n},3102:(e,t,r)=>{var n=r(5757),o=r(7072);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,a)}return t}))}},7572:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===r(i[c],c,i))break}return t}}},4698:(e,t,r)=>{var n=r(489),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},3566:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},6330:(e,t,r)=>{var n=r(5513);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},489:(e,t,r)=>{var n=r(3216),o=r(3626);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},4966:(e,t,r)=>{var n=r(6148)(Object.getPrototypeOf,Object);e.exports=n},5135:(e,t,r)=>{var n=r(9652),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},3626:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},4530:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},5557:(e,t,r)=>{var n=r(2037);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},4349:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},407:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},5134:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},9951:(e,t,r)=>{var n=r(2037);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},1172:(e,t,r)=>{var n=r(8528),o=r(4966),i=r(7839);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},1813:(e,t,r)=>{var n=r(9652),o=r(5664),i=r(5860),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},8347:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},7072:(e,t,r)=>{var n=r(3355),o=r(8809),i=r(8347),a=r(4820);e.exports=function(e,t,r){if(!a(r))return!1;var s=typeof t;return!!("number"==s?o(r)&&i(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5513:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},931:(e,t,r)=>{var n,o=r(8940),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},7839:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},2470:e=>{e.exports=function(){this.__data__=[],this.size=0}},7289:(e,t,r)=>{var n=r(8620),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},7614:(e,t,r)=>{var n=r(8620);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},3067:(e,t,r)=>{var n=r(8620);e.exports=function(e){return n(this.__data__,e)>-1}},9346:(e,t,r)=>{var n=r(8620);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},6290:(e,t,r)=>{var n=r(7643),o=r(3872),i=r(5674);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},4951:(e,t,r)=>{var n=r(6330);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},440:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).get(e)}},6180:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).has(e)}},7719:(e,t,r)=>{var n=r(6330);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},2037:(e,t,r)=>{var n=r(489)(Object,"create");e.exports=n},3003:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},9693:(e,t,r)=>{e=r.nmd(e);var n=r(3566),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},3744:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},6148:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},2549:(e,t,r)=>{var n=r(6562),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),c=Array(s);++a<s;)c[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=r(c),n(e,this,u)}}},4818:(e,t,r)=>{var n=r(3566),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},7700:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},6613:(e,t,r)=>{var n=r(4274),o=r(3546)(n);e.exports=o},3546:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},1490:(e,t,r)=>{var n=r(3872);e.exports=function(){this.__data__=new n,this.size=0}},2594:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},5953:e=>{e.exports=function(e){return this.__data__.get(e)}},4667:e=>{e.exports=function(e){return this.__data__.has(e)}},4615:(e,t,r)=>{var n=r(3872),o=r(5674),i=r(2462);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},1304:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5153:e=>{var t="a-z\\xdf-\\xf6\\xf8-\\xff",r="A-Z\\xc0-\\xd6\\xd8-\\xde",n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+n+"]",i="\\d+",a="["+t+"]",s="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bf"+t+r+"]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",l="["+r+"]",d="(?:"+a+"|"+s+")",p="(?:"+l+"|"+s+")",f="(?:['’](?:d|ll|m|re|s|t|ve))?",m="(?:['’](?:D|LL|M|RE|S|T|VE))?",g="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",h="[\\ufe0e\\ufe0f]?",E=h+g+"(?:\\u200d(?:"+["[^\\ud800-\\udfff]",c,u].join("|")+")"+h+g+")*",y="(?:"+["[\\u2700-\\u27bf]",c,u].join("|")+")"+E,v=RegExp([l+"?"+a+"+"+f+"(?="+[o,l,"$"].join("|")+")",p+"+"+m+"(?="+[o,l+d,"$"].join("|")+")",l+"?"+d+"+"+f,l+"+"+m,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,y].join("|"),"g");e.exports=function(e){return e.match(v)||[]}},7477:e=>{e.exports=function(e){return function(){return e}}},3355:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9423:(e,t,r)=>{var n=r(8288);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},1191:e=>{e.exports=function(e){return e}},5664:(e,t,r)=>{var n=r(6651),o=r(1408),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},5860:e=>{var t=Array.isArray;e.exports=t},8809:(e,t,r)=>{var n=r(830),o=r(7906);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},5274:(e,t,r)=>{var n=r(8809),o=r(1408);e.exports=function(e){return o(e)&&n(e)}},9571:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=r(8585),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},830:(e,t,r)=>{var n=r(2759),o=r(4820);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},7906:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4820:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1408:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1969:(e,t,r)=>{var n=r(2759),o=r(4966),i=r(1408),a=Function.prototype,s=Object.prototype,c=a.toString,u=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=u.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==l}},1918:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1859:(e,t,r)=>{var n=r(9920),o=r(8275),i=r(9693),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},2551:(e,t,r)=>{var n=r(1998),o=r(3339),i=r(8809);e.exports=function(e){return i(e)?n(e,!0):o(e)}},7168:(e,t,r)=>{var n=r(7604),o=r(3102)((function(e,t,r){n(e,t,r)}));e.exports=o},8585:e=>{e.exports=function(){return!1}},2963:(e,t,r)=>{var n=r(7200),o=r(2551);e.exports=function(e){return n(e,o(e))}},8395:(e,t,r)=>{var n=r(5208);e.exports=function(e){return null==e?"":n(e)}},5377:(e,t,r)=>{var n=r(7554),o=r(3675),i=r(1445),a=r(1453),s=r(5274),c=Math.max;e.exports=function(e){if(!e||!e.length)return[];var t=0;return e=n(e,(function(e){if(s(e))return t=c(e.length,t),!0})),a(t,(function(t){return o(e,i(t))}))}},582:(e,t,r)=>{var n=r(8247),o=r(4530),i=r(8395),a=r(5153);e.exports=function(e,t,r){return e=i(e),void 0===(t=r?void 0:t)?o(e)?a(e):n(e):e.match(t)||[]}},3145:(e,t,r)=>{var n=r(5757)(r(5377));e.exports=n},7984:(e,t,r)=>{e.exports=r.p+"assets/core/cesdk.data"},2934:(e,t,r)=>{e.exports=r.p+"assets/core/cesdk.wasm"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="";var n={};(()=>{r.d(n,{Il:()=>M,yQ:()=>e,Ju:()=>O,in:()=>be,HY:()=>pe,uU:()=>x,ZP:()=>Et});var e={};r.r(e);const t={canManageAssets:!1,getGroups:()=>Promise.resolve([]),findAssets(){throw new Error("Implementation required")},getAsset(){throw new Error("Implementation required")},updateAsset(){throw new Error("Implementation required")},addAsset(){throw new Error("Implementation required")},removeAsset(){throw new Error("Implementation required")},getTypes(){throw new Error("Implementation required")},hasType(){throw new Error("Implementation required")}};var o,i,a,s,c,u,l,d,p,f,m,g,h,E=r(9423),y=r.n(E),v=r(582),_=r.n(v),b=r(3145),w=r.n(b);function T(e){switch(e){case 0:return c.Left;case 1:return c.Middle;case 2:return c.Right;default:return c.Unknown}}!function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(o||(o={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(i||(i={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Center=2]="Center"}(a||(a={})),function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom",e[e.Center=2]="Center"}(s||(s={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(c||(c={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(u||(u={})),function(e){e[e.Key0=0]="Key0",e[e.Key1=1]="Key1",e[e.Key2=2]="Key2",e[e.Key3=3]="Key3",e[e.Key4=4]="Key4",e[e.Key5=5]="Key5",e[e.Key6=6]="Key6",e[e.Key7=7]="Key7",e[e.Key8=8]="Key8",e[e.Key9=9]="Key9",e[e.A=10]="A",e[e.B=11]="B",e[e.C=12]="C",e[e.D=13]="D",e[e.E=14]="E",e[e.F=15]="F",e[e.G=16]="G",e[e.H=17]="H",e[e.I=18]="I",e[e.J=19]="J",e[e.K=20]="K",e[e.L=21]="L",e[e.M=22]="M",e[e.N=23]="N",e[e.O=24]="O",e[e.P=25]="P",e[e.Q=26]="Q",e[e.R=27]="R",e[e.S=28]="S",e[e.T=29]="T",e[e.U=30]="U",e[e.V=31]="V",e[e.W=32]="W",e[e.X=33]="X",e[e.Y=34]="Y",e[e.Z=35]="Z",e[e.ArrowLeft=36]="ArrowLeft",e[e.ArrowRight=37]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowDown=39]="ArrowDown",e[e.Backspace=40]="Backspace",e[e.Enter=41]="Enter",e[e.Space=42]="Space",e[e.Escape=43]="Escape",e[e.Delete=44]="Delete",e[e.Control=45]="Control",e[e.Option=46]="Option",e[e.Shift=47]="Shift",e[e.Unknown=255]="Unknown"}(l||(l={})),function(e){e[e.Thin=100]="Thin",e[e.ExtraLight=200]="ExtraLight",e[e.Light=300]="Light",e[e.Normal=400]="Normal",e[e.Medium=500]="Medium",e[e.SemiBold=600]="SemiBold",e[e.Bold=700]="Bold",e[e.ExtraBold=800]="ExtraBold",e[e.Heavy=900]="Heavy"}(d||(d={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(p||(p={})),function(e){e.Bold="bold",e.Italic="italic"}(f||(f={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(m||(m={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack"}(g||(g={})),function(e){e.Scene="//ly.img.ubq/scene",e.Stack="//ly.img.ubq/stack",e.Camera="//ly.img.ubq/camera",e.Page="//ly.img.ubq/page",e.Image="//ly.img.ubq/image",e.Video="//ly.img.ubq/video",e.Text="//ly.img.ubq/text",e.Sticker="//ly.img.ubq/sticker",e.VectorPath="//ly.img.ubq/vector_path",e.RectShape="//ly.img.ubq/shapes/rect",e.LineShape="//ly.img.ubq/shapes/line",e.StarShape="//ly.img.ubq/shapes/star",e.PolygonShape="//ly.img.ubq/shapes/polygon",e.EllipseShape="//ly.img.ubq/shapes/ellipse",e.Group="//ly.img.ubq/group"}(h||(h={}));const O=h;var D,P;!function(e){e[e.Information=0]="Information",e[e.Warning=1]="Warning",e[e.Error=2]="Error"}(D||(D={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(P||(P={}));const x=P;var S,R,M,F,A;!function(e){e.Unknown="",e.Boolean="bool",e.Boolean2="ubq/math/bool2",e.Int="int",e.UInt8="uint8_t",e.Int32="int32_t",e.UInt32="uint32_t",e.Int2="ubq/math/ivec2",e.Size2="ubq/types/Size2",e.Color="ubq/types/Color",e.Double="double",e.Float="float",e.Float2="ubq/math/vec2",e.Float3="ubq/math/vec3",e.Float4="ubq/math/vec4",e.String="string",e.HorizontalTextAlignment="ubq/types/HorizontalTextAlignment",e.VerticalTextAlignment="ubq/types/VerticalTextAlignment",e.Margin2D="ubq/types/OuterMargin2D"}(S||(S={})),function(e){e[e.Pixel=0]="Pixel",e[e.Millimeter=1]="Millimeter",e[e.Inch=2]="Inch"}(R||(R={})),function(e){e.toDesignUnit=function(t){return t===e.Pixel?"px":t===e.Millimeter?"mm":t===e.Inch?"in":void 0},e.fromDesignUnit=function(t){return"px"===t?e.Pixel:"mm"===t?e.Millimeter:"in"===t?e.Inch:void 0},e.getLabel=function(t){switch(t){case e.Pixel:return"px";case e.Millimeter:return"mm";case e.Inch:return"in";default:return""}},e.convertToPoints=function(t,r,n){switch(r){case e.Pixel:return t/n*72;case e.Inch:return 72*t;case e.Millimeter:return 72*t/25.4;default:throw new Error("Unknown design unit!")}}}(R||(R={})),function(e){let t;!function(e){e[e.sRGB=0]="sRGB",e[e.CMYK=1]="CMYK",e[e.SpotColor=2]="SpotColor"}(t=e.ColorSpace||(e.ColorSpace={})),e.fromRGBA=function(e){return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColor:{name:"",rgbApproximation:e,cmykApproximation:{c:.75,m:.68,y:.67,k:.9}}}},e.toRGBA=function(e){switch(e.colorSpace){case t.sRGB:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case t.SpotColor:return e.spotColor.rgbApproximation;case t.CMYK:throw new Error("CMYK to RGBA conversion not supported!");default:throw new Error("Unknown color space!")}}}(M||(M={})),function(e){e.Transform="ubq/editMode/transform",e.Crop="ubq/editMode/crop",e.Text="ubq/editMode/text"}(F||(F={})),function(e){e[e.Arrow=0]="Arrow",e[e.Move=1]="Move",e[e.MoveNotPermitted=2]="MoveNotPermitted",e[e.Resize=3]="Resize",e[e.Rotate=4]="Rotate",e[e.Text=5]="Text"}(A||(A={}));const k=(e,t)=>({x:e.x*t,y:e.y*t});function I(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}class C{constructor(e){Object.defineProperty(this,"ubq",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}async createElement(e,t,r){const n=await this.execute("ubq/designblocks/create",e);this.execute("ubq/designblocks/addToParent",[n,t]);const o=U(this.ubq.getLastFrameWidth(t)),i=U(this.ubq.getLastFrameHeight(t)),{position:a,size:s}=function(e,t,r=8/13){const n=((e,t)=>{const r=e.x/e.y,n=t.x/t.y;return k(t,r>n?e.y/t.y:e.x/t.x)})(e,t),o=k(n,r);return{position:{x:.5*(e.x-o.x),y:.5*(e.y-o.y)},size:o}}({x:o,y:i},{x:r.width,y:r.height},8/13);this.execute("ubq/layout/setAbsoluteSize",{id:n,size:{width:s.x,height:s.y}}),s.x||this.execute("ubq/layout/setAutoWidth",{id:n}),s.y||this.execute("ubq/layout/setAutoHeight",{id:n});const c=function(e={x:50,y:50}){return{x:Math.random()*e.x,y:Math.random()*e.y}}({x:.08*o,y:.08*i});return await this.execute("ubq/layout/setAbsolutePosition",{id:n,position:{left:a.x+c.x,top:a.y+c.y}}),n}setValue(e,t,r,n){return this.useInternalAPI((o=>U(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>U(n.getValue(e,t,r))))}async getEditorState(){return this.execute("ubq/editor/getEditorState")}async setEditorState(e){return this.execute("ubq/editor/setEditorState",e)}async execute(e,t){return new Promise((r=>{this.useInternalAPI((n=>n.ubqExecute(e,t,(e=>{const t=U(e);r(t)})))).delete()}))}}function U(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)}}var N,j,L,H,B,X,Q,G=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},q=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};j=new WeakMap,L=new WeakMap,H=new WeakMap,B=new WeakMap,N=new WeakSet,X=async function(e,t){return this.helper.execute("ubq/assets/getMetadata",[e,t])},Q=async function(e,t){const r=await this.helper.execute("ubq/assets/getRegisteredCategoryIDsForType",t),n=[];return await Promise.all(r.map((async t=>{if(t.endsWith(e)){const e=await this.helper.execute("ubq/assets/getAssetsInCategory",t);n.splice(n.length-1,0,...e)}}))),n};class W extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function z(e){return"object"==typeof e&&null!=e}function V(e){return"string"==typeof e?JSON.stringify(e):""+e}function Y(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:c="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+V(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:c}}function*$(e,t,r,n){var o;z(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=Y(o,t,r,n);e&&(yield e)}}function*K(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&z(t.schema)&&z(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c=!0;for(const r of t.validator(e,s))c=!1,yield[r,void 0];for(let[r,u,l]of t.entries(e,s)){const t=K(u,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,u],coerce:i,mask:a});for(const n of t)n[0]?(c=!1,yield[n[0],void 0]):i&&(u=n[1],void 0===r?e=u:e instanceof Map?e.set(r,u):e instanceof Set?e.add(u):z(e)&&(e[r]=u))}if(c)for(const r of t.refiner(e,s))c=!1,yield[r,void 0];c&&(yield[void 0,e])}class Z{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>$(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>$(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=J(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=J(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!J(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=J(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return J(e,this,t)}}function J(e,t,r={}){const n=K(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new W(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function ee(e,t){return new Z({type:e,schema:null,validator:t})}function te(e){return new Z({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+V(e)})}function re(){return ee("boolean",(e=>"boolean"==typeof e))}function ne(){return ee("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+V(e)))}function oe(){return ee("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+V(e)))}function ie(){return ee("string",(e=>"string"==typeof e||"Expected a string, but received: "+V(e)))}function ae(e,t,r={}){const{exclusive:n}=r;return ce(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function se(e){return ce(e,"nonempty",(t=>function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function ce(e,t,r){return new Z({...e,*refiner(n,o){yield*e.refiner(n,o);const i=$(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function ue(e,t,r){const[n]=J(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function le(){const e=/image\/(png|jpeg|x-tga)|video\/mp4|application\/octet-stream|application\/pdf/;return ee("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/x-tga", "video/mp4", "application/pdf" or "application/octet-stream", but got "${t}"`}))}var de;!function(e){e.Png="image/png",e.Jpeg="image/jpeg",e.Tga="image/x-tga",e.Mp4="video/mp4",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip"}(de||(de={}));const pe=de;var fe;!function(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.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/CompositedText",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Fill="ubq/types/Fill",e.BackgroundColor="ubq/types/BackgroundColor",e.Stroke="ubq/types/Stroke",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState"}(fe||(fe={}));const me=fe,ge=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};var he,Ee,ye=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},ve=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class _e{constructor(e){he.set(this,void 0),Ee.set(this,void 0),ye(this,he,e,"f"),ye(this,Ee,new C(e),"f")}async export(e,t=pe.Png){return ue("handle",e,oe()),ue("mimeType",t,le()),new Promise(((r,n)=>{ve(this,he,"f").exportToBuffer(e,t,(e=>{"error"in e?n(e.error):r(new Blob([e],{type:t}))}),{jpegQuality:.9,pngCompressionLevel:5,useTargetSize:!1,targetWidth:0,targetHeight:0})}))}async unstable_exportVideo(e,t,r,n=pe.Mp4,o,i,a,s){return ue("handle",e,oe()),ue("mimeType",n,le()),ue("resolutionWidth",o,ne()),ue("resolutionHeight",i,ne()),ue("framerate",a,oe()),new Promise(((c,u)=>{ve(this,he,"f").exportVideoToBuffer(e,t,r,n,s,(e=>{"error"in e?u(e.error):c(new Blob([e],{type:n}))}),{h264Profile:77,h264Level:52,framerate:a,useTargetSize:!0,targetWidth:o,targetHeight:i})}))}async loadFromString(e){return ue("content",e,ie()),new Promise((t=>{ve(this,he,"f").loadBlocksFromString(e,(e=>{const r=U(e);t(ge(r))}))}))}async saveToString(e){return ue("blocks",e,te(oe())),new Promise((t=>{ve(this,he,"f").saveBlocksToString(e,(e=>{const r=U(e);t(r)}))}))}create(e){return ue("type",e,ie()),U(ve(this,he,"f").create(e))}unstable_createFromAsset(e,t,r,n){return ue("id",e,ie()),ue("type",t,ie()),ue("mimeType",r,ie()),new Promise(((o,i)=>{ve(this,he,"f").createFromAsset(e,t,r,n,(e=>{try{o(U(e))}catch(e){i(e)}}))}))}getType(e){return ue("id",e,ne()),U(ve(this,he,"f").getType(e))}setSelected(e,t){return ue("id",e,ne()),ue("selected",t,re()),U(ve(this,he,"f").setSelected(e,t))}isSelected(e){return ue("id",e,ne()),U(ve(this,he,"f").isSelected(e))}findAllSelected(){return ge(ve(this,he,"f").findAllSelected())}isGroupable(e){return ue("ids",e,se(te(oe()))),U(ve(this,he,"f").isGroupable(e))}group(e){return ue("ids",e,se(te(oe()))),U(ve(this,he,"f").group(e))}ungroup(e){return ue("id",e,oe()),U(ve(this,he,"f").ungroup(e))}enterGroup(e){return ue("id",e,oe()),U(ve(this,he,"f").enterGroup(e))}exitGroup(e){return ue("id",e,oe()),U(ve(this,he,"f").exitGroup(e))}setName(e,t){return ue("id",e,ne()),ue("name",t,ie()),ve(this,Ee,"f").setValue(e,me.Common,"name",t)}getName(e){return ue("id",e,ne()),ve(this,Ee,"f").getValue(e,me.Common,"name")}findByName(e){ue("name",e,ie());const t=ve(this,he,"f").findByName(e);return ge(t)}findByType(e){ue("type",e,ie());const t=U(ve(this,he,"f").findByType(e));return ge(t)}findAll(){return ge(ve(this,he,"f").findAll())}findAllPlaceholders(){return ge(ve(this,he,"f").findAllPlaceholders())}isVisible(e){return ue("id",e,ne()),U(ve(this,he,"f").isVisible(e))}setVisible(e,t){return ue("id",e,ne()),ue("visible",t,re()),U(ve(this,he,"f").setVisible(e,t))}isClipped(e){return ue("id",e,ne()),U(ve(this,he,"f").isClipped(e))}setClipped(e,t){return ue("id",e,ne()),ue("clipped",t,re()),U(ve(this,he,"f").setClipped(e,t))}getPositionX(e){return ue("id",e,ne()),U(ve(this,he,"f").getPositionX(e))}getPositionXMode(e){return ue("id",e,ne()),U(ve(this,he,"f").getPositionXMode(e))}getPositionY(e){return ue("id",e,ne()),U(ve(this,he,"f").getPositionY(e))}getPositionYMode(e){return ue("id",e,ne()),U(ve(this,he,"f").getPositionYMode(e))}setPositionX(e,t){return ue("id",e,ne()),ue("value",t,oe()),U(ve(this,he,"f").setPositionX(e,t))}setPositionXMode(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setPositionXMode(e,t))}setPositionY(e,t){return ue("id",e,ne()),ue("value",t,oe()),U(ve(this,he,"f").setPositionY(e,t))}setPositionYMode(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setPositionYMode(e,t))}getRotation(e){return ue("id",e,ne()),U(ve(this,he,"f").getRotation(e))}setRotation(e,t){return ue("id",e,ne()),ue("radians",t,oe()),U(ve(this,he,"f").setRotation(e,t))}getFlipHorizontal(e){return ue("id",e,ne()),U(ve(this,he,"f").getFlip(e)).horizontal}getFlipVertical(e){return ue("id",e,ne()),U(ve(this,he,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return ue("id",e,ne()),ue("flip",t,re()),U(ve(this,he,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return ue("id",e,ne()),ue("flip",t,re()),U(ve(this,he,"f").setFlipVertical(e,t))}getWidth(e){return ue("id",e,ne()),U(ve(this,he,"f").getWidth(e))}getWidthMode(e){return ue("id",e,ne()),U(ve(this,he,"f").getWidthMode(e))}getHeight(e){return ue("id",e,ne()),U(ve(this,he,"f").getHeight(e))}getHeightMode(e){return ue("id",e,ne()),U(ve(this,he,"f").getHeightMode(e))}getContentFillMode(e){return ue("id",e,ne()),U(ve(this,he,"f").getContentFillMode(e))}setWidth(e,t){return ue("id",e,ne()),ue("value",t,oe()),U(ve(this,he,"f").setWidth(e,t))}setWidthMode(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setWidthMode(e,t))}setHeight(e,t){return ue("id",e,ne()),ue("value",t,oe()),U(ve(this,he,"f").setHeight(e,t))}setHeightMode(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setHeightMode(e,t))}setContentFillMode(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setContentFillMode(e,t))}getFrameWidth(e){return ue("id",e,ne()),U(ve(this,he,"f").getLastFrameWidth(e))}getFrameHeight(e){return ue("id",e,ne()),U(ve(this,he,"f").getLastFrameHeight(e))}duplicate(e){return ue("id",e,ne()),U(ve(this,he,"f").duplicate(e))}destroy(e){return ue("id",e,ne()),U(ve(this,he,"f").destroy(e))}isValid(e){return ue("id",e,ne()),ve(this,he,"f").isValid(e)}getParent(e){return ue("id",e,ne()),U(ve(this,he,"f").getParent(e))}getChildren(e){ue("id",e,ne());const t=U(ve(this,he,"f").getChildren(e));return ge(t)}insertChild(e,t,r){return ue("parent",e,oe()),ue("child",t,oe()),ue("index",r,ae(oe(),0)),U(ve(this,he,"f").insertChild(e,t,r))}appendChild(e,t){return ue("parent",e,oe()),ue("child",t,oe()),U(ve(this,he,"f").appendChild(e,t))}referencesAnyVariables(e){return ue("id",e,ne()),U(ve(this,he,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return ue("id",e,ne()),U(ve(this,he,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return ue("id",e,ne()),U(ve(this,he,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return ue("id",e,ne()),U(ve(this,he,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return ue("id",e,ne()),U(ve(this,he,"f").getGlobalBoundingBoxHeight(e))}scale(e,t,r=0,n=0){return ue("id",e,ne()),U(ve(this,he,"f").scale(e,t,r,n))}findAllProperties(e){return ue("id",e,ne()),ge(U(ve(this,he,"f").findAllProperties(e)))}getPropertyType(e){return ue("property",e,ie()),U(ve(this,he,"f").getPropertyType(e))}getEnumValues(e){return ue("enumProperty",e,ie()),ge(U(ve(this,he,"f").getEnumValues(e)))}setBool(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,re()),U(ve(this,he,"f").setBool(e,t,r))}getBool(e,t){return ue("id",e,ne()),ue("property",t,ie()),U(ve(this,he,"f").getBool(e,t))}setInt(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,ne()),U(ve(this,he,"f").setInt(e,t,r))}getInt(e,t){return ue("id",e,ne()),ue("property",t,ie()),U(ve(this,he,"f").getInt(e,t))}setFloat(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,oe()),U(ve(this,he,"f").setFloat(e,t,r))}getFloat(e,t){return ue("id",e,ne()),ue("property",t,ie()),U(ve(this,he,"f").getFloat(e,t))}setString(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,ie()),U(ve(this,he,"f").setString(e,t,r))}getString(e,t){return ue("id",e,ne()),ue("property",t,ie()),U(ve(this,he,"f").getString(e,t))}setColorRGBA(e,t,r,n,o,i){return ue("id",e,ne()),ue("property",t,ie()),ue("r",r,oe()),ue("g",n,oe()),ue("b",o,oe()),ue("a",i,oe()),U(ve(this,he,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return ue("id",e,ne()),ue("property",t,ie()),U(ve(this,he,"f").getColorRGBA(e,t))}setEnum(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,ie()),U(ve(this,he,"f").setEnum(e,t,r))}getEnum(e,t){return ue("id",e,ne()),ue("property",t,ie()),U(ve(this,he,"f").getEnum(e,t))}hasCrop(e){return ue("id",e,ne()),U(ve(this,he,"f").hasCrop(e))}setCropScaleX(e,t){return ue("id",e,ne()),ue("scaleX",t,oe()),U(ve(this,he,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return ue("id",e,ne()),ue("scaleY",t,oe()),U(ve(this,he,"f").setCropScaleY(e,t))}setCropRotation(e,t){return ue("id",e,ne()),ue("rotation",t,oe()),U(ve(this,he,"f").setCropRotation(e,t))}setCropTranslationX(e,t){return ue("id",e,ne()),ue("translationX",t,oe()),U(ve(this,he,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return ue("id",e,ne()),ue("translationY",t,oe()),U(ve(this,he,"f").setCropTranslationY(e,t))}resetCrop(e){return ue("id",e,ne()),U(ve(this,he,"f").resetCrop(e))}getCropScaleX(e){return ue("id",e,ne()),U(ve(this,he,"f").getCropScaleX(e))}getCropScaleY(e){return ue("id",e,ne()),U(ve(this,he,"f").getCropScaleY(e))}getCropRotation(e){return ue("id",e,ne()),U(ve(this,he,"f").getCropRotation(e))}getCropTranslationX(e){return ue("id",e,ne()),U(ve(this,he,"f").getCropTranslationX(e))}getCropTranslationY(e){return ue("id",e,ne()),U(ve(this,he,"f").getCropTranslationY(e))}hasOpacity(e){return ue("id",e,ne()),U(ve(this,he,"f").hasOpacity(e))}setOpacity(e,t){return ue("id",e,ne()),ue("opacity",t,oe()),U(ve(this,he,"f").setOpacity(e,t))}getOpacity(e){return ue("id",e,ne()),U(ve(this,he,"f").getOpacity(e))}setBlendMode(e,t){return ue("id",e,ne()),ue("blendMode",t,ie()),U(ve(this,he,"f").setBlendMode(e,t))}getBlendMode(e){return ue("id",e,ne()),U(ve(this,he,"f").getBlendMode(e))}hasFillColor(e){return ue("id",e,ne()),U(ve(this,he,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),U(ve(this,he,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return ue("id",e,ne()),U(ve(this,he,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),U(ve(this,he,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return ue("id",e,ne()),U(ve(this,he,"f").isFillColorEnabled(e))}hasBackgroundColor(e){return ue("id",e,ne()),U(ve(this,he,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),U(ve(this,he,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return ue("id",e,ne()),U(ve(this,he,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),U(ve(this,he,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return ue("id",e,ne()),U(ve(this,he,"f").isBackgroundColorEnabled(e))}hasStroke(e){return ue("id",e,ne()),U(ve(this,he,"f").hasStroke(e))}setStrokeEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),U(ve(this,he,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return ue("id",e,ne()),U(ve(this,he,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),U(ve(this,he,"f").setStrokeColorRGBA(e,t,r,n,o))}getStrokeColorRGBA(e){return ue("id",e,ne()),U(ve(this,he,"f").getStrokeColorRGBA(e))}setStrokeWidth(e,t){return ue("id",e,ne()),ue("width",t,oe()),U(ve(this,he,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return ue("id",e,ne()),U(ve(this,he,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return ue("id",e,ne()),U(ve(this,he,"f").getStrokeStyle(e))}setStrokePosition(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setStrokePosition(e,t))}getStrokePosition(e){return ue("id",e,ne()),U(ve(this,he,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return ue("id",e,ne()),U(ve(this,he,"f").getStrokeCornerGeometry(e))}hasOutline(e){return ue("id",e,ne()),this.hasStroke(e)}setOutlineColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),this.setStrokeColorRGBA(e,t,r,n,o)}getOutlineColorRGBA(e){return ue("id",e,ne()),this.getStrokeColorRGBA(e)}setOutlineEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),this.setStrokeEnabled(e,t)}isOutlineEnabled(e){return ue("id",e,ne()),this.isStrokeEnabled(e)}setOutlineWidth(e,t){return ue("id",e,ne()),ue("width",t,oe()),this.setStrokeWidth(e,t)}getOutlineWidth(e){return ue("id",e,ne()),this.getStrokeWidth(e)}hasFill(e){return ue("id",e,ne()),U(ve(this,he,"f").hasFill(e))}isFillEnabled(e){return ue("id",e,ne()),U(ve(this,he,"f").isFillEnabled(e))}setFillEnabled(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setFillEnabled(e,t))}setFillType(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setFillType(e,t))}getFillType(e){return ue("id",e,ne()),U(ve(this,he,"f").getFillType(e))}setFillSolidColor(e,t,r,n,o){ue("id",e,ne()),U(ve(this,he,"f").setFillSolidColor(e,t,n,r,o))}getFillSolidColor(e){return ue("id",e,ne()),U(ve(this,he,"f").getFillSolidColor(e))}setFillGradientType(e,t){ue("id",e,ne()),U(ve(this,he,"f").setFillGradientType(e,t))}getFillGradientType(e){return ue("id",e,ne()),U(ve(this,he,"f").getFillGradientType(e))}addFillGradientColorStop(e,t,r,n,o,i){ue("id",e,ne()),U(ve(this,he,"f").addFillGradientColorStop(e,t,r,n,o,i))}removeFillGradientColorStop(e,t){ue("id",e,ne()),U(ve(this,he,"f").removeFillGradientColorStop(e,t))}getFillGradientColorStops(e){return ue("id",e,ne()),ge(ve(this,he,"f").getFillGradientColorStops(e))}setFillGradientColorStops(e,t){ue("id",e,ne()),U(ve(this,he,"f").setFillGradientColorStops(e,t))}setFillGradientControlPoint(e,t,r,n){return ue("id",e,ne()),U(ve(this,he,"f").setFillGradientControlPoint(e,t,r,n))}getFillGradientControlPointX(e,t){return ue("id",e,ne()),U(ve(this,he,"f").getFillGradientControlPointX(e,t))}getFillGradientControlPointY(e,t){return ue("id",e,ne()),U(ve(this,he,"f").getFillGradientControlPointY(e,t))}setFillGradientRadius(e,t){return ue("id",e,ne()),U(ve(this,he,"f").setFillGradientRadius(e,t))}getFillGradientRadius(e){return ue("id",e,ne()),U(ve(this,he,"f").getFillGradientRadius(e))}}he=new WeakMap,Ee=new WeakMap;var be,we=r(7168),Te=r.n(we);!function(e){e.Info="Info",e.Warning="Warning",e.Error="Error"}(be||(be={}));const Oe={baseURL:"/extensions/",entries:["ly.img.cesdk.filters.duotone","ly.img.cesdk.filters.lut","ly.img.cesdk.stickers.emoticons","ly.img.cesdk.vectorpaths","ly.img.cesdk.vectorpaths.abstract","ly.img.cesdk.fonts","ly.img.cesdk.images.samples","ly.img.cesdk.effects","ly.img.cesdk.stickers.doodle","ly.img.cesdk.stickers.hand","ly.img.cesdk.stickers.emoji"]},De={company_name:{value:"img.ly"},first_name:{value:"Charly"},last_name:{value:"Williams"},address:{value:"742 Evergreen Terrace"},city:{value:"Springfield"}},Pe=(e,t)=>{const r=`[UBQ] ${e}`;switch(t){case be.Warning:console.warn(r);break;case be.Error:console.error(r);break;case be.Info:default:console.log(r)}},xe={log:Pe},Se={colorPalettes:{primary:{meta:{default:!0},entries:["#FFFFFF","#000000","#6686FF","#66CCFF","#54FFEA","#E75050","#F28855","#FFF763"]}},pageFormats:{"din-a0":{width:1189,height:841,unit:"mm"},"din-a1":{width:841,height:594,unit:"mm"},"din-a2":{width:594,height:420,unit:"mm"},"din-a3":{width:420,height:297,unit:"mm"},"din-a4":{width:297,height:210,unit:"mm"},"din-a5":{width:210,height:148,unit:"mm"},"din-a6":{meta:{default:!0},width:148,height:105,unit:"mm"},"din-a65":{width:210,height:105,unit:"mm"},"din-b5":{width:250,height:176,unit:"mm"},square:{width:105,height:105,unit:"mm"},"twitter-profile":{width:400,height:400,unit:"px"},"twitter-image":{width:1024,height:512,unit:"px"},"twitter-header":{width:1500,height:500,unit:"px"},"instagram-profile":{width:180,height:180,unit:"px"},"instagram-photo":{width:1080,height:1080,unit:"px"},"instagram-story":{width:1080,height:1920,unit:"px"},"american-letter":{width:8.5,height:11,unit:"in"},"american-legal":{width:8.5,height:14,unit:"in"},"16:10":{width:1600,height:1e3,unit:"px"},"16:9":{width:1600,height:900,unit:"px"},"16:10@2400p":{width:3840,height:2400,unit:"px"},"16:9@2160p":{width:3840,height:2160,unit:"px"},"business-card":{width:85,height:55,unit:"mm"}}},Re={baseURL:"core/"},Me={maskSpotColor:void 0,dpi:300,pixelScaleFactor:1},Fe={title:{fontFileUri:"bundle://ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",show:!0},dimOutOfPageAreas:!0};function Ae(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).toString()}function ke(e){return"/"!==e[e.length-1]?`${e}/`:e}function Ie(e={}){var t,r,n,o,i,a,s,c,u,l,d,p,f,m,g;const h={license:e.license,role:null!==(t=e.role)&&void 0!==t?t:"Creator",featureFlags:null!==(r=e.featureFlags)&&void 0!==r?r:{},baseURL:null!==(n=e.baseURL)&&void 0!==n?n:"https://cdn.img.ly/packages/imgly/cesdk-engine/1.6.0/assets",core:null!==(o=e.core)&&void 0!==o?o:Object.assign({},Re),extensions:null!==(i=e.extensions)&&void 0!==i?i:Object.assign({},Oe),callbacks:null!==(a=e.callbacks)&&void 0!==a?a:Object.assign({},xe),variables:null!==(s=e.variables)&&void 0!==s?s:Object.assign({},De),presets:null!==(c=e.presets)&&void 0!==c?c:Object.assign({},Se),scene:null!==(u=e.scene)&&void 0!==u?u:Object.assign({},Me),page:Te()({},Fe,null!==(l=e.page)&&void 0!==l?l:{}),assetSources:Te()({},e.assetSources),defaultFont:null!==(d=e.defaultFont)&&void 0!==d?d:void 0};return null!==(p=(m=h.extensions).baseURL)&&void 0!==p||(m.baseURL=Oe.baseURL),null!==(f=(g=h.extensions).entries)&&void 0!==f||(g.entries=Object.assign({},Oe.entries)),Object.entries(Se).forEach((([e,t])=>{var r;h.presets[e]=null!==(r=h.presets[e])&&void 0!==r?r:Object.assign({},t)})),h.baseURL=Ae(h.baseURL),h.baseURL=ke(h.baseURL),h.core.baseURL=Ae(h.core.baseURL,h.baseURL),h.core.baseURL=ke(h.core.baseURL),h.extensions.baseURL=ke(h.extensions.baseURL),h.extensions.entries=h.extensions.entries.map((e=>ke(e))),h}var Ce,Ue,Ne=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},je=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Le{constructor(e){Ce.set(this,void 0),Ue.set(this,void 0),Ne(this,Ce,e,"f"),Ne(this,Ue,new C(e),"f")}onStateChanged(e){const t=je(this,Ce,"f").subscribeToEditorState(e);return()=>{U(je(this,Ce,"f").unsubscribe(t))}}setEditMode(e){ue("keypath",e,ie()),je(this,Ce,"f").setEditMode(e)}getEditMode(){return je(this,Ce,"f").getEditMode()}getCursorType(){return je(this,Ce,"f").getCursorType()}getCursorRotation(){return je(this,Ce,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return je(this,Ce,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return je(this,Ce,"f").getTextCursorPositionInScreenSpaceY()}setZoomLevel(e=1){ue("zoomLevel",e,ae(oe(),0)),je(this,Ce,"f").setZoomLevel(e)}getZoomLevel(){return U(je(this,Ce,"f").getZoomLevel())}addUndoStep(){U(je(this,Ce,"f").addUndoStep())}undo(){U(je(this,Ce,"f").undo())}redo(){U(je(this,Ce,"f").redo())}canUndo(){return U(je(this,Ce,"f").canUndo())}canRedo(){return U(je(this,Ce,"f").canRedo())}setSettingBool(e,t){return ue("keypath",e,ie()),ue("value",t,re()),U(je(this,Ce,"f").setSettingBool(e,t))}getSettingBool(e){return ue("keypath",e,ie()),U(je(this,Ce,"f").getSettingBool(e))}setSettingInt(e,t){return ue("keypath",e,ie()),ue("value",t,ne()),U(je(this,Ce,"f").setSettingFloat(e,t))}getSettingInt(e){return ue("keypath",e,ie()),U(je(this,Ce,"f").getSettingFloat(e))}setSettingFloat(e,t){return ue("keypath",e,ie()),ue("value",t,oe()),U(je(this,Ce,"f").setSettingFloat(e,t))}getSettingFloat(e){return ue("keypath",e,ie()),U(je(this,Ce,"f").getSettingFloat(e))}setSettingString(e,t){return ue("keypath",e,ie()),ue("value",t,ie()),U(je(this,Ce,"f").setSettingString(e,t))}getSettingString(e){return ue("keypath",e,ie()),U(je(this,Ce,"f").getSettingString(e))}setSettingColorRGBA(e,t,r,n,o){return ue("keypath",e,ie()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),U(je(this,Ce,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return ue("keypath",e,ie()),U(je(this,Ce,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return ue("keypath",e,ie()),ue("value",t,ie()),U(je(this,Ce,"f").setSettingEnum(e,t))}getSettingEnum(e){return ue("keypath",e,ie()),U(je(this,Ce,"f").getSettingEnum(e))}}Ce=new WeakMap,Ue=new WeakMap;var He,Be=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Xe{constructor(e){He.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,He,e,"f")}subscribe(e,t){ue("blocks",e,te());const r=Be(this,He,"f").subscribe(e,(e=>{try{t(ge(e,!0))}catch(e){console.error(e)}}));return()=>{U(Be(this,He,"f").unsubscribe(r))}}}He=new WeakMap;var Qe,Ge=(Qe="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(e,r){t=e,n=r})),Object.getOwnPropertyDescriptor(o.ready,"_main")||(Object.defineProperty(o.ready,"_main",{configurable:!0,get:function(){He("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"_main",{configurable:!0,set:function(){He("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___getTypeName")||(Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,get:function(){He("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,set:function(){He("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get:function(){He("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set:function(){He("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___stdio_exit")||(Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,get:function(){He("You are getting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,set:function(){He("You are setting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"onRuntimeInitialized")||(Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,get:function(){He("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,set:function(){He("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),o.expectedDataFileDownloads||(o.expectedDataFileDownloads=0),o.expectedDataFileDownloads++,o.ENVIRONMENT_IS_PTHREAD||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 o.locateFilePackage||o.locateFile||(o.locateFile=o.locateFilePackage,T("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var r,n,i,a,s=o.locateFile?o.locateFile(t,""):t,c=e.remote_package_size,u=null,l=o.getPreloadedPackage?o.getPreloadedPackage(s,c):null;function d(){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}o.FS_createPath("/","ly.img.cesdk",!0,!0),o.FS_createPath("/ly.img.cesdk","images",!0,!0),o.FS_createPath("/ly.img.cesdk","shaders",!0,!0),o.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),o.FS_createPath("/ly.img.cesdk","presets",!0,!0),o.FS_createPath("/ly.img.cesdk","fonts",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,o.addRunDependency("fp "+this.name)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){o.FS_createDataFile(this.name,null,e,!0,!0,!0),o.removeRunDependency("fp "+this.name),this.requests[this.name]=null}};for(var n=e.files,i=0;i<n.length;++i)new r(n[i].start,n[i].end,n[i].audio||0).open("GET",n[i].filename);function a(n){t(n,"Loading data file failed."),t(n instanceof ArrayBuffer,"bad input to processPackageData");var i=new Uint8Array(n);r.prototype.byteArray=i;for(var a=e.files,s=0;s<a.length;++s)r.prototype.requests[a[s].filename].onload();o.removeRunDependency("datafile_cesdk.data")}o.addRunDependency("datafile_cesdk.data"),o.preloadResults||(o.preloadResults={}),o.preloadResults["cesdk.data"]={fromCache:!1},l?(a(l),l=null):u=a}l||(r=s,n=c,i=function(e){u?(u(e),u=null):l=e},(a=new XMLHttpRequest).open("GET",r,!0),a.responseType="arraybuffer",a.onprogress=function(e){var t=r,i=n;if(e.total&&(i=e.total),e.loaded){a.addedTotal?o.dataFileDownloads[t].loaded=e.loaded:(a.addedTotal=!0,o.dataFileDownloads||(o.dataFileDownloads={}),o.dataFileDownloads[t]={loaded:e.loaded,total:i});var s=0,c=0,u=0;for(var l in o.dataFileDownloads){var d=o.dataFileDownloads[l];s+=d.total,c+=d.loaded,u++}s=Math.ceil(s*o.expectedDataFileDownloads/u),o.setStatus&&o.setStatus("Downloading data... ("+c+"/"+s+")")}else o.dataFileDownloads||o.setStatus&&o.setStatus("Downloading data...")},a.onerror=function(e){throw new Error("NetworkError for: "+r)},a.onload=function(e){if(!(200==a.status||304==a.status||206==a.status||0==a.status&&a.response))throw new Error(a.statusText+" : "+a.responseURL);var t=a.response;i(t)},a.send(null)),o.calledRun?d():(o.preRun||(o.preRun=[]),o.preRun.push(d))}({files:[{filename:"/ly.img.cesdk/images/watermark.png",start:0,end:90147},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:90147,end:90629},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:90629,end:91083},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:91083,end:92720},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:92720,end:93438},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:93438,end:93940},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:93940,end:96803},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:96803,end:97175},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:97175,end:99480},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:99480,end:113080},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:113080,end:113574},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:113574,end:114156},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:114156,end:114456},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:114456,end:115241},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:115241,end:116208},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:116208,end:116771},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:116771,end:123088},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:123088,end:123772},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:123772,end:123984},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:123984,end:124499},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:124499,end:128388},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:128388,end:130505},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:130505,end:131469},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:131469,end:132416},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:132416,end:132997},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:132997,end:133487},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:133487,end:138050},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:138050,end:148035},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:148035,end:151202},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:151202,end:153840},{filename:"/ly.img.cesdk/presets/.keep",start:153840,end:153840},{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:153840,end:424600}],remote_package_size:424600,package_uuid:"8b3ef78e-22e2-4f88-87f4-395168105bb2"}),o.ENVIRONMENT_IS_PTHREAD&&(o.preRun=[]);var i=o.preRun.slice();"object"==typeof window&&"object"==typeof window.performance?o.performance=performance:"object"==typeof r.g&&"object"==typeof r.g.perf_hooks&&"object"==typeof r.g.perf_hooks.performance?o.performance=r.g.perf_hooks.performance:o.performance={mark:function(){},measure:function(){}},o.emscripten_ubq_asyncFetchStates=new Map,o.emscripten_ubq_asyncFetchCompletedBytes=new Map,o.emscripten_ubq_asyncFetchTotalBytes=new Map,o.emscripten_ubq_asyncFetchHeaders=new Map,o.emscripten_ubq_asyncFetchNextHandle=0,o.emscripten_ubq_asyncFetchNextHeaderHandle=0;const a={PENDING:0,FINISHED:1,ALLOCATED:2,ERROR:3},s=["GET","POST"];if(o.emscripten_ubq_codec_decoders=new Map,o.emscripten_ubq_codec_encoders=new Map,o.emscripten_ubq_codec_decoderNextHandle=1,o.emscripten_ubq_codec_encoderNextHandle=1,o.emscripten_ubq_codec_createVideoDecoder=function(e){const t=new VideoDecoder({output:r=>{if(t.decodedFrames%=t.numberOfFrames,t.decodedFrames++,t.probing&&1===t.decodedFrames)return(n=o.ctx).bindTexture(n.TEXTURE_2D,e[0]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),void r.close();if(t.decodeQueueSize>0||t.probing)return void r.close();var n=o.ctx;const i=(t.decodedFrames-1)%e.length;n.bindTexture(n.TEXTURE_2D,e[i]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),r.close(),t.textureUploadFlag=!0},error:e=>console.error(e)});return t.decodedFrames=0,t},!o.preRun)throw"Module.preRun should exist because file support used it; did a pre-js delete it?";i.forEach((function(e){if(o.preRun.indexOf(e)<0)throw"All preRun tasks that exist before user pre-js code should remain after; did you replace Module or modify Module.preRun?"}));var c=Object.assign({},o),u=[],l="./this.program",d=(e,t)=>{throw t},p="object"==typeof window,f="function"==typeof importScripts,m="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g=!p&&!m&&!f;if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var h,E,y,v="";function _(e){return o.locateFile?o.locateFile(e,v):v+e}function b(e){if(e instanceof cp)return;let t=e;e&&"object"==typeof e&&e.stack&&(t=[e,e.stack]),T("exiting due to exception: "+t)}if(g){if("object"==typeof process||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(h=function(e){return read(e)}),y=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),I("object"==typeof t),t)},E=function(e,t,r){setTimeout((()=>t(y(e))),0)},"undefined"!=typeof scriptArgs?u=scriptArgs:void 0!==arguments&&(u=arguments),"function"==typeof quit&&(d=(e,t)=>{b(t),quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!p&&!f)throw new Error("environment detection error");if(f?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),Qe&&(v=Qe),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},f&&(y=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),E=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var w=o.print||console.log.bind(console),T=o.printErr||console.warn.bind(console);function O(e){O.shown||(O.shown={}),O.shown[e]||(O.shown[e]=1,T(e))}Object.assign(o,c),c=null,o.arguments&&(u=o.arguments),Object.getOwnPropertyDescriptor(o,"arguments")||Object.defineProperty(o,"arguments",{configurable:!0,get:function(){He("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),o.thisProgram&&(l=o.thisProgram),Object.getOwnPropertyDescriptor(o,"thisProgram")||Object.defineProperty(o,"thisProgram",{configurable:!0,get:function(){He("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),o.quit&&(d=o.quit),Object.getOwnPropertyDescriptor(o,"quit")||Object.defineProperty(o,"quit",{configurable:!0,get:function(){He("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),I(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),I(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),I(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),I(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),I(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),I(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(o,"read")||Object.defineProperty(o,"read",{configurable:!0,get:function(){He("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"readAsync")||Object.defineProperty(o,"readAsync",{configurable:!0,get:function(){He("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"readBinary")||Object.defineProperty(o,"readBinary",{configurable:!0,get:function(){He("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"setWindowTitle")||Object.defineProperty(o,"setWindowTitle",{configurable:!0,get:function(){He("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),I(!m,"node environment detected but not enabled at build time. Add 'node' to `-s ENVIRONMENT` to enable."),I(!g,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");var D,P=0,x=e=>{P=e},S=()=>P;o.wasmBinary&&(D=o.wasmBinary),Object.getOwnPropertyDescriptor(o,"wasmBinary")||Object.defineProperty(o,"wasmBinary",{configurable:!0,get:function(){He("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var R,M=o.noExitRuntime||!0;function F(e,t="i8",r){switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return X[e>>0];case"i16":return G[e>>1];case"i32":return W[e>>2];case"i64":return Number(Y[e>>3]);case"float":return V[e>>2];case"double":return Number(K[e>>3]);default:He("invalid type for getValue: "+t)}return null}Object.getOwnPropertyDescriptor(o,"noExitRuntime")||Object.defineProperty(o,"noExitRuntime",{configurable:!0,get:function(){He("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),"object"!=typeof WebAssembly&&He("no native wasm support detected");var A,k=!1;function I(e,t){e||He("Assertion failed"+(t?": "+t:""))}var C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function U(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&C)return C.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|c:(240!=(248&a)&&O("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|c<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function N(e,t){return e?U(Q,e,t):""}function j(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>1114111&&O("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function L(e,t,r){return I("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),j(e,Q,t,r)}function H(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}var B,X,Q,G,q,W,z,V,Y,$,K,Z="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function J(e,t){I(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&q[n];)++n;if((r=n<<1)-e>32&&Z)return Z.decode(Q.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=G[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function ee(e,t,r){if(I(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),I("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);G[t>>1]=a,t+=2}return G[t>>1]=0,t-n}function te(e){return 2*e.length}function re(e,t){I(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var o=W[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function ne(e,t,r){if(I(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),I("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),W[t>>2]=a,(t+=4)+4>o)break}return W[t>>2]=0,t-n}function oe(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}function ie(e){var t=H(e)+1,r=Ud(t);return r&&j(e,X,r,t),r}function ae(e){var t=H(e)+1,r=zd(t);return j(e,X,r,t),r}function se(e,t){I(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),X.set(e,t)}function ce(e,t,r){for(var n=0;n<e.length;++n)I(e.charCodeAt(n)===(255&e.charCodeAt(n))),X[t++>>0]=e.charCodeAt(n);r||(X[t>>0]=0)}function ue(e,t){return e%t>0&&(e+=t-e%t),e}function le(e){B=e,o.HEAP8=X=new Int8Array(e),o.HEAP16=G=new Int16Array(e),o.HEAP32=W=new Int32Array(e),o.HEAPU8=Q=new Uint8Array(e),o.HEAPU16=q=new Uint16Array(e),o.HEAPU32=z=new Uint32Array(e),o.HEAPF32=V=new Float32Array(e),o.HEAPF64=K=new Float64Array(e),o.HEAP64=Y=new BigInt64Array(e),o.HEAPU64=$=new BigUint64Array(e)}var de=5242880;o.TOTAL_STACK&&I(de===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var pe,fe=o.INITIAL_MEMORY||268435456;function me(){var e=Gd();I(0==(3&e)),W[e+4>>2]=34821223,W[e+8>>2]=2310721022,W[0]=1668509029}function ge(){if(!k){var e=Gd(),t=z[e+4>>2],r=z[e+8>>2];34821223==t&&2310721022==r||He("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16)),1668509029!==W[0]&&He("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Object.getOwnPropertyDescriptor(o,"INITIAL_MEMORY")||Object.defineProperty(o,"INITIAL_MEMORY",{configurable:!0,get:function(){He("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),I(fe>=de,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+fe+"! (TOTAL_STACK="+de+")"),I("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),I(!o.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),I(268435456==fe,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"}();var he=[],Ee=[],ye=[],ve=[],_e=[],be=!1,we=!1,Te=0;function Oe(){return M||Te>0}function De(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)Me(o.preRun.shift());$e(he)}function Pe(){ge(),I(!be),be=!0,o.noFSInit||yt.init.initialized||yt.init(),yt.ignorePermissions=!1,lt.init(),$e(Ee)}function xe(){ge(),$e(ye)}function Se(){ge(),we=!0}function Re(){if(ge(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)Ae(o.postRun.shift());$e(_e)}function Me(e){he.unshift(e)}function Fe(e){Ee.unshift(e)}function Ae(e){_e.unshift(e)}I(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),I(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),I(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),I(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var ke=0,Ie=null,Ce=null,Ue={};function Ne(e){for(var t=e;;){if(!Ue[e])return e;e=t+Math.random()}}function je(e){ke++,o.monitorRunDependencies&&o.monitorRunDependencies(ke),e?(I(!Ue[e]),Ue[e]=1,null===Ie&&"undefined"!=typeof setInterval&&(Ie=setInterval((function(){if(k)return clearInterval(Ie),void(Ie=null);var e=!1;for(var t in Ue)e||(e=!0,T("still waiting on run dependencies:")),T("dependency: "+t);e&&T("(end of list)")}),1e4))):T("warning: run dependency added without ID")}function Le(e){if(ke--,o.monitorRunDependencies&&o.monitorRunDependencies(ke),e?(I(Ue[e]),delete Ue[e]):T("warning: run dependency removed without ID"),0==ke&&(null!==Ie&&(clearInterval(Ie),Ie=null),Ce)){var t=Ce;Ce=null,t()}}function He(e){o.onAbort&&o.onAbort(e),T(e="Aborted("+e+")"),k=!0,A=1;var t=new WebAssembly.RuntimeError(e);throw n(t),t}o.preloadedImages={},o.preloadedAudios={};var Be,Xe="data:application/octet-stream;base64,";function Ge(e){return e.startsWith(Xe)}function qe(e){return e.startsWith("file://")}function We(e,t){return function(){var r=e,n=t;return t||(n=o.asm),I(be,"native function `"+r+"` called before runtime initialization"),I(!we,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||I(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function ze(e){try{if(e==Be&&D)return new Uint8Array(D);if(y)return y(e);throw"both async and sync fetching of the wasm failed"}catch(e){He(e)}}function Ve(){return D||!p&&!f||"function"!=typeof fetch?Promise.resolve().then((function(){return ze(Be)})):fetch(Be,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Be+"'";return e.arrayBuffer()})).catch((function(){return ze(Be)}))}function Ye(){var e={env:Cd,wasi_snapshot_preview1:Cd};function t(e,t){var r=e.exports;o.asm=r,I(R=o.asm.memory,"memory not found in wasm exports"),le(R.buffer),I(pe=o.asm.__indirect_function_table,"table not found in wasm exports"),Fe(o.asm.__wasm_call_ctors),Le("wasm-instantiate")}je("wasm-instantiate");var r=o;function i(e){I(o===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function a(t){return Ve().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){T("failed to asynchronously prepare wasm: "+e),qe(Be)&&T("warning: Loading from a file URI ("+Be+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),He(e)}))}if(o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return T("Module.instantiateWasm callback failed with error: "+e),!1}return(D||"function"!=typeof WebAssembly.instantiateStreaming||Ge(Be)||"function"!=typeof fetch?a(i):fetch(Be,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(i,(function(e){return T("wasm streaming compile failed: "+e),T("falling back to ArrayBuffer instantiation"),a(i)}))}))).catch(n),{}}function $e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?et(r)():et(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(o)}}function Ke(e){return O("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function Ze(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=Ke(e);return e===t?e:t+" ["+e+"]"}))}Ge(Be="cesdk.wasm")||(Be=_(Be));var Je=[];function et(e){var t=Je[e];return t||(e>=Je.length&&(Je.length=e+1),Je[e]=t=pe.get(e)),I(pe.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function tt(e){if(e instanceof cp||"unwind"==e)return A;d(1,e)}function rt(e,t,r,n){He("Assertion failed: "+N(e)+", at: "+[t?N(t):"unknown filename",r,n?N(n):"unknown function"])}function nt(e){return Ud(e+16)+16}function ot(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){W[this.ptr+4>>2]=e},this.get_type=function(){return W[this.ptr+4>>2]},this.set_destructor=function(e){W[this.ptr+8>>2]=e},this.get_destructor=function(){return W[this.ptr+8>>2]},this.set_refcount=function(e){W[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,X[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=X[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,X[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=X[this.ptr+13>>0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=W[this.ptr>>2];W[this.ptr>>2]=e+1},this.release_ref=function(){var e=W[this.ptr>>2];return W[this.ptr>>2]=e-1,I(e>0),1===e}}function it(e,t,r){throw new ot(e).init(t,r),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch."}function at(e){return W[jd()>>2]=e,e}var st={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=st.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=st.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=st.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return st.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return st.normalize(e.join("/"))},join2:function(e,t){return st.normalize(e+"/"+t)}};function ct(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){He("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var ut={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:yt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=st.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(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=ut.resolve(e).substr(1),t=ut.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},lt={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){lt.ttys[e]={input:[],output:[],ops:t},yt.registerDevice(e,lt.stream_ops)},stream_ops:{open:function(e){var t=lt.ttys[e.node.rdev];if(!t)throw new yt.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new yt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new yt.ErrnoError(29)}if(void 0===s&&0===i)throw new yt.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new yt.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new yt.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=kd(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(U(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(T(U(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(T(U(e.output,0)),e.output=[])}}};function dt(e,t){Q.fill(0,e,e+t)}function pt(e,t){return I(t,"alignment argument is required"),Math.ceil(e/t)*t}function ft(e){e=pt(e,65536);var t=Bd(65536,e);return t?(dt(t,e),t):0}var mt={ops_table:null,mount:function(e){return mt.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(yt.isBlkdev(r)||yt.isFIFO(r))throw new yt.ErrnoError(63);mt.ops_table||(mt.ops_table={dir:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr,lookup:mt.node_ops.lookup,mknod:mt.node_ops.mknod,rename:mt.node_ops.rename,unlink:mt.node_ops.unlink,rmdir:mt.node_ops.rmdir,readdir:mt.node_ops.readdir,symlink:mt.node_ops.symlink},stream:{llseek:mt.stream_ops.llseek}},file:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr},stream:{llseek:mt.stream_ops.llseek,read:mt.stream_ops.read,write:mt.stream_ops.write,allocate:mt.stream_ops.allocate,mmap:mt.stream_ops.mmap,msync:mt.stream_ops.msync}},link:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr,readlink:mt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:mt.node_ops.getattr,setattr:mt.node_ops.setattr},stream:yt.chrdev_stream_ops}});var o=yt.createNode(e,t,r,n);return yt.isDir(o.mode)?(o.node_ops=mt.ops_table.dir.node,o.stream_ops=mt.ops_table.dir.stream,o.contents={}):yt.isFile(o.mode)?(o.node_ops=mt.ops_table.file.node,o.stream_ops=mt.ops_table.file.stream,o.usedBytes=0,o.contents=null):yt.isLink(o.mode)?(o.node_ops=mt.ops_table.link.node,o.stream_ops=mt.ops_table.link.stream):yt.isChrdev(o.mode)&&(o.node_ops=mt.ops_table.chrdev.node,o.stream_ops=mt.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(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:function(e){var t={};return t.dev=yt.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,yt.isDir(e.mode)?t.size=4096:yt.isFile(e.mode)?t.size=e.usedBytes:yt.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:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&mt.resizeFileStorage(e,t.size)},lookup:function(e,t){throw yt.genericErrors[44]},mknod:function(e,t,r,n){return mt.createNode(e,t,r,n)},rename:function(e,t,r){if(yt.isDir(e.mode)){var n;try{n=yt.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new yt.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:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=yt.lookupNode(e,t);for(var n in r.contents)throw new yt.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=mt.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!yt.isLink(e.mode))throw new yt.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(I(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(I(!(t instanceof ArrayBuffer)),t.buffer===X.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return I(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(mt.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&yt.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new yt.ErrnoError(28);return n},allocate:function(e,t,r){mt.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new yt.ErrnoError(28);if(!yt.isFile(e.node.mode))throw new yt.ErrnoError(43);var a,s,c=e.node.contents;if(2&i||c.buffer!==B){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),s=!0,!(a=ft(r)))throw new yt.ErrnoError(48);X.set(c,a)}else s=!1,a=c.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!yt.isFile(e.node.mode))throw new yt.ErrnoError(43);return 2&o||mt.stream_ops.write(e,t,0,n,r,!1),0}}};function gt(e,t,r,n){var o=n?"":Ne("al "+e);E(e,(function(r){I(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&Le(o)}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&je(o)}var ht={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},Et={},yt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ut.resolve(yt.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new yt.ErrnoError(32);for(var o=st.normalizeArray(e.split("/").filter((e=>!!e)),!1),i=yt.root,a="/",s=0;s<o.length;s++){var c=s===o.length-1;if(c&&t.parent)break;if(i=yt.lookupNode(i,o[s]),a=st.join2(a,o[s]),yt.isMountpoint(i)&&(!c||c&&t.follow_mount)&&(i=i.mounted.root),!c||t.follow)for(var u=0;yt.isLink(i.mode);){var l=yt.readlink(a);if(a=ut.resolve(st.dirname(a),l),i=yt.lookupPath(a,{recurse_count:t.recurse_count}).node,u++>40)throw new yt.ErrnoError(32)}}return{path:a,node:i}},getPath:e=>{for(var t;;){if(yt.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%yt.nameTable.length},hashAddNode:e=>{var t=yt.hashName(e.parent.id,e.name);e.name_next=yt.nameTable[t],yt.nameTable[t]=e},hashRemoveNode:e=>{var t=yt.hashName(e.parent.id,e.name);if(yt.nameTable[t]===e)yt.nameTable[t]=e.name_next;else for(var r=yt.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=yt.mayLookup(e);if(r)throw new yt.ErrnoError(r,e);for(var n=yt.hashName(e.id,t),o=yt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return yt.lookup(e,t)},createNode:(e,t,r,n)=>{I("object"==typeof e);var o=new yt.FSNode(e,t,r,n);return yt.hashAddNode(o),o},destroyNode:e=>{yt.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=yt.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>yt.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>yt.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return yt.lookupNode(e,t),20}catch(e){}return yt.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=yt.lookupNode(e,t)}catch(e){return e.errno}var o=yt.nodePermissions(e,"wx");if(o)return o;if(r){if(!yt.isDir(n.mode))return 54;if(yt.isRoot(n)||yt.getPath(n)===yt.cwd())return 10}else if(yt.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?yt.isLink(e.mode)?32:yt.isDir(e.mode)&&("r"!==yt.flagsToPermissionString(t)||512&t)?31:yt.nodePermissions(e,yt.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=yt.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!yt.streams[r])return r;throw new yt.ErrnoError(33)},getStream:e=>yt.streams[e],createStream:(e,t,r)=>{yt.FSStream||(yt.FSStream=function(){},yt.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),e=Object.assign(new yt.FSStream,e);var n=yt.nextfd(t,r);return e.fd=n,yt.streams[n]=e,e},closeStream:e=>{yt.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=yt.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new yt.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{yt.devices[e]={stream_ops:t}},getDevice:e=>yt.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),yt.syncFSRequests++,yt.syncFSRequests>1&&T("warning: "+yt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=yt.getMounts(yt.root.mount),n=0;function o(e){return I(yt.syncFSRequests>0),yt.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{if("string"==typeof e)throw e;var n,o="/"===r,i=!r;if(o&&yt.root)throw new yt.ErrnoError(10);if(!o&&!i){var a=yt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,yt.isMountpoint(n))throw new yt.ErrnoError(10);if(!yt.isDir(n.mode))throw new yt.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?yt.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=yt.lookupPath(e,{follow_mount:!1});if(!yt.isMountpoint(t.node))throw new yt.ErrnoError(28);var r=t.node,n=r.mounted,o=yt.getMounts(n);Object.keys(yt.nameTable).forEach((e=>{for(var t=yt.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&yt.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);I(-1!==i),r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=yt.lookupPath(e,{parent:!0}).node,o=st.basename(e);if(!o||"."===o||".."===o)throw new yt.ErrnoError(28);var i=yt.mayCreate(n,o);if(i)throw new yt.ErrnoError(i);if(!n.node_ops.mknod)throw new yt.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,yt.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,yt.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{yt.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,yt.mknod(e,t,r)),symlink:(e,t)=>{if(!ut.resolve(e))throw new yt.ErrnoError(44);var r=yt.lookupPath(t,{parent:!0}).node;if(!r)throw new yt.ErrnoError(44);var n=st.basename(t),o=yt.mayCreate(r,n);if(o)throw new yt.ErrnoError(o);if(!r.node_ops.symlink)throw new yt.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=st.dirname(e),i=st.dirname(t),a=st.basename(e),s=st.basename(t);if(r=yt.lookupPath(e,{parent:!0}).node,n=yt.lookupPath(t,{parent:!0}).node,!r||!n)throw new yt.ErrnoError(44);if(r.mount!==n.mount)throw new yt.ErrnoError(75);var c,u=yt.lookupNode(r,a),l=ut.relative(e,i);if("."!==l.charAt(0))throw new yt.ErrnoError(28);if("."!==(l=ut.relative(t,o)).charAt(0))throw new yt.ErrnoError(55);try{c=yt.lookupNode(n,s)}catch(e){}if(u!==c){var d=yt.isDir(u.mode),p=yt.mayDelete(r,a,d);if(p)throw new yt.ErrnoError(p);if(p=c?yt.mayDelete(n,s,d):yt.mayCreate(n,s))throw new yt.ErrnoError(p);if(!r.node_ops.rename)throw new yt.ErrnoError(63);if(yt.isMountpoint(u)||c&&yt.isMountpoint(c))throw new yt.ErrnoError(10);if(n!==r&&(p=yt.nodePermissions(r,"w")))throw new yt.ErrnoError(p);yt.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{yt.hashAddNode(u)}}},rmdir:e=>{var t=yt.lookupPath(e,{parent:!0}).node,r=st.basename(e),n=yt.lookupNode(t,r),o=yt.mayDelete(t,r,!0);if(o)throw new yt.ErrnoError(o);if(!t.node_ops.rmdir)throw new yt.ErrnoError(63);if(yt.isMountpoint(n))throw new yt.ErrnoError(10);t.node_ops.rmdir(t,r),yt.destroyNode(n)},readdir:e=>{var t=yt.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new yt.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=yt.lookupPath(e,{parent:!0}).node;if(!t)throw new yt.ErrnoError(44);var r=st.basename(e),n=yt.lookupNode(t,r),o=yt.mayDelete(t,r,!1);if(o)throw new yt.ErrnoError(o);if(!t.node_ops.unlink)throw new yt.ErrnoError(63);if(yt.isMountpoint(n))throw new yt.ErrnoError(10);t.node_ops.unlink(t,r),yt.destroyNode(n)},readlink:e=>{var t=yt.lookupPath(e).node;if(!t)throw new yt.ErrnoError(44);if(!t.node_ops.readlink)throw new yt.ErrnoError(28);return ut.resolve(yt.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=yt.lookupPath(e,{follow:!t}).node;if(!r)throw new yt.ErrnoError(44);if(!r.node_ops.getattr)throw new yt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>yt.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?yt.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new yt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{yt.chmod(e,t,!0)},fchmod:(e,t)=>{var r=yt.getStream(e);if(!r)throw new yt.ErrnoError(8);yt.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?yt.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new yt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{yt.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=yt.getStream(e);if(!n)throw new yt.ErrnoError(8);yt.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new yt.ErrnoError(28);var r;if(!(r="string"==typeof e?yt.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new yt.ErrnoError(63);if(yt.isDir(r.mode))throw new yt.ErrnoError(31);if(!yt.isFile(r.mode))throw new yt.ErrnoError(28);var n=yt.nodePermissions(r,"w");if(n)throw new yt.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=yt.getStream(e);if(!r)throw new yt.ErrnoError(8);if(0==(2097155&r.flags))throw new yt.ErrnoError(28);yt.truncate(r.node,t)},utime:(e,t,r)=>{var n=yt.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,i)=>{if(""===e)throw new yt.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?yt.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=st.normalize(e);try{a=yt.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new yt.ErrnoError(20)}else a=yt.mknod(e,r,0),s=!0;if(!a)throw new yt.ErrnoError(44);if(yt.isChrdev(a.mode)&&(t&=-513),65536&t&&!yt.isDir(a.mode))throw new yt.ErrnoError(54);if(!s){var c=yt.mayOpen(a,t);if(c)throw new yt.ErrnoError(c)}512&t&&yt.truncate(a,0),t&=-131713;var u=yt.createStream({node:a,path:yt.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);return u.stream_ops.open&&u.stream_ops.open(u),!o.logReadFiles||1&t||(yt.readFiles||(yt.readFiles={}),e in yt.readFiles||(yt.readFiles[e]=1)),u},close:e=>{if(yt.isClosed(e))throw new yt.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{yt.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(yt.isClosed(e))throw new yt.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new yt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new yt.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new yt.ErrnoError(28);if(yt.isClosed(e))throw new yt.ErrnoError(8);if(1==(2097155&e.flags))throw new yt.ErrnoError(8);if(yt.isDir(e.node.mode))throw new yt.ErrnoError(31);if(!e.stream_ops.read)throw new yt.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new yt.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new yt.ErrnoError(28);if(yt.isClosed(e))throw new yt.ErrnoError(8);if(0==(2097155&e.flags))throw new yt.ErrnoError(8);if(yt.isDir(e.node.mode))throw new yt.ErrnoError(31);if(!e.stream_ops.write)throw new yt.ErrnoError(28);e.seekable&&1024&e.flags&&yt.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new yt.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(yt.isClosed(e))throw new yt.ErrnoError(8);if(t<0||r<=0)throw new yt.ErrnoError(28);if(0==(2097155&e.flags))throw new yt.ErrnoError(8);if(!yt.isFile(e.node.mode)&&!yt.isDir(e.node.mode))throw new yt.ErrnoError(43);if(!e.stream_ops.allocate)throw new yt.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new yt.ErrnoError(2);if(1==(2097155&e.flags))throw new yt.ErrnoError(2);if(!e.stream_ops.mmap)throw new yt.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new yt.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=yt.open(e,t.flags),o=yt.stat(e).size,i=new Uint8Array(o);return yt.read(n,i,0,o,0),"utf8"===t.encoding?r=U(i,0):"binary"===t.encoding&&(r=i),yt.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=yt.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(H(t)+1),i=j(t,o,0,o.length);yt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");yt.write(n,t,0,t.byteLength,void 0,r.canOwn)}yt.close(n)},cwd:()=>yt.currentPath,chdir:e=>{var t=yt.lookupPath(e,{follow:!0});if(null===t.node)throw new yt.ErrnoError(44);if(!yt.isDir(t.node.mode))throw new yt.ErrnoError(54);var r=yt.nodePermissions(t.node,"x");if(r)throw new yt.ErrnoError(r);yt.currentPath=t.path},createDefaultDirectories:()=>{yt.mkdir("/tmp"),yt.mkdir("/home"),yt.mkdir("/home/web_user")},createDefaultDevices:()=>{yt.mkdir("/dev"),yt.registerDevice(yt.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),yt.mkdev("/dev/null",yt.makedev(1,3)),lt.register(yt.makedev(5,0),lt.default_tty_ops),lt.register(yt.makedev(6,0),lt.default_tty1_ops),yt.mkdev("/dev/tty",yt.makedev(5,0)),yt.mkdev("/dev/tty1",yt.makedev(6,0));var e=ct();yt.createDevice("/dev","random",e),yt.createDevice("/dev","urandom",e),yt.mkdir("/dev/shm"),yt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{yt.mkdir("/proc");var e=yt.mkdir("/proc/self");yt.mkdir("/proc/self/fd"),yt.mount({mount:()=>{var t=yt.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=yt.getStream(r);if(!n)throw new yt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?yt.createDevice("/dev","stdin",o.stdin):yt.symlink("/dev/tty","/dev/stdin"),o.stdout?yt.createDevice("/dev","stdout",null,o.stdout):yt.symlink("/dev/tty","/dev/stdout"),o.stderr?yt.createDevice("/dev","stderr",null,o.stderr):yt.symlink("/dev/tty1","/dev/stderr");var e=yt.open("/dev/stdin",0),t=yt.open("/dev/stdout",1),r=yt.open("/dev/stderr",1);I(0===e.fd,"invalid handle for stdin ("+e.fd+")"),I(1===t.fd,"invalid handle for stdout ("+t.fd+")"),I(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:()=>{yt.ErrnoError||(yt.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,Et)if(Et[t]===e){this.code=t;break}},this.setErrno(e),this.message=ht[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=Ze(this.stack))},yt.ErrnoError.prototype=new Error,yt.ErrnoError.prototype.constructor=yt.ErrnoError,[44].forEach((e=>{yt.genericErrors[e]=new yt.ErrnoError(e),yt.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{yt.ensureErrnoError(),yt.nameTable=new Array(4096),yt.mount(mt,{},"/"),yt.createDefaultDirectories(),yt.createDefaultDevices(),yt.createSpecialDirectories(),yt.filesystems={MEMFS:mt}},init:(e,t,r)=>{I(!yt.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),yt.init.initialized=!0,yt.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=t||o.stdout,o.stderr=r||o.stderr,yt.createStandardStreams()},quit:()=>{yt.init.initialized=!1,Hd();for(var e=0;e<yt.streams.length;e++){var t=yt.streams[e];t&&yt.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=yt.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=yt.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=yt.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=st.basename(e),n=yt.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:yt.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=st.join2(e,i);try{yt.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=st.join2("string"==typeof e?e:yt.getPath(e),t),a=yt.getMode(n,o);return yt.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:yt.getPath(e),a=t?st.join2(e,t):e);var s=yt.getMode(n,o),c=yt.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,d=r.length;l<d;++l)u[l]=r.charCodeAt(l);r=u}yt.chmod(c,146|s);var p=yt.open(c,577);yt.write(p,r,0,r.length,0,i),yt.close(p),yt.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=st.join2("string"==typeof e?e:yt.getPath(e),t),i=yt.getMode(!!r,!!n);yt.createDevice.major||(yt.createDevice.major=64);var a=yt.makedev(yt.createDevice.major++,0);return yt.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new yt.ErrnoError(29)}if(void 0===c&&0===a)throw new yt.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new yt.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),yt.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!h)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=kd(h(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new yt.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):kd(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!f)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 c=yt.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return yt.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>{yt.forceLoadFile(c);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(I(a>=0),i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,a,s,c,u)=>{var l=t?ut.resolve(st.join2(e,t)):e,d=Ne("cp "+l);function p(r){function p(r){u&&u(),s||yt.createDataFile(e,t,r,n,o,c),i&&i(),Le(d)}bo.handledByPreloadPlugin(r,l,p,(()=>{a&&a(),Le(d)}))||p(r)}je(d),"string"==typeof r?gt(r,(e=>p(e)),a):p(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=yt.indexedDB();try{var o=n.open(yt.DB_NAME(),yt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(yt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([yt.DB_STORE_NAME],"readwrite"),i=n.objectStore(yt.DB_STORE_NAME),a=0,s=0,c=e.length;function u(){0==s?t():r()}e.forEach((e=>{var t=i.put(yt.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&u()},t.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=yt.indexedDB();try{var o=n.open(yt.DB_NAME(),yt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([yt.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(yt.DB_STORE_NAME),s=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{yt.analyzePath(e).exists&&yt.unlink(e),yt.createDataFile(st.dirname(e),st.basename(e),t.result,!0,!0,!0),++s+c==u&&l()},t.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r},absolutePath:()=>{He("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:()=>{He("FS.createFolder has been removed; use FS.mkdir instead")},createLink:()=>{He("FS.createLink has been removed; use FS.symlink instead")},joinPath:()=>{He("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:()=>{He("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:()=>{He("FS.standardizePath has been removed; use PATH.normalize instead")}},vt={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if("/"===t[0])return t;var n;if(-100===e)n=yt.cwd();else{var o=yt.getStream(e);if(!o)throw new yt.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new yt.ErrnoError(44);return n}return st.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&st.normalize(t)!==st.normalize(yt.getPath(e.node)))return-54;throw e}return W[r>>2]=n.dev,W[r+4>>2]=0,W[r+8>>2]=n.ino,W[r+12>>2]=n.mode,W[r+16>>2]=n.nlink,W[r+20>>2]=n.uid,W[r+24>>2]=n.gid,W[r+28>>2]=n.rdev,W[r+32>>2]=0,Y[r+40>>3]=BigInt(n.size),W[r+48>>2]=4096,W[r+52>>2]=n.blocks,W[r+56>>2]=n.atime.getTime()/1e3|0,W[r+60>>2]=0,W[r+64>>2]=n.mtime.getTime()/1e3|0,W[r+68>>2]=0,W[r+72>>2]=n.ctime.getTime()/1e3|0,W[r+76>>2]=0,Y[r+80>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){var i=Q.slice(e,e+r);yt.msync(t,i,o,r,n)},doMkdir:function(e,t){return"/"===(e=st.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),yt.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return yt.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=yt.readlink(e),o=Math.min(r,H(n)),i=X[t+o];return L(n,t,r+1),X[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=yt.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&yt.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=yt.getStream(r);return n&&yt.close(n),yt.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=W[t+8*i>>2],s=W[t+(8*i+4)>>2],c=yt.read(e,X,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=W[t+8*i>>2],s=W[t+(8*i+4)>>2],c=yt.write(e,X,a,s,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return I(null!=vt.varargs),vt.varargs+=4,W[vt.varargs-4>>2]},getStr:function(e){return N(e)},getStreamFromFD:function(e){var t=yt.getStream(e);if(!t)throw new yt.ErrnoError(8);return t},get64:function(e,t){return I(e>=0?0===t:-1===t),e}};function _t(e,t,r){vt.varargs=r;try{var n=vt.getStreamFromFD(e);switch(t){case 0:return(o=vt.get())<0?-28:yt.open(n.path,n.flags,0,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=vt.get();return n.flags|=o,0;case 5:return o=vt.get(),G[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return at(28),-1}}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function bt(e,t){try{var r=vt.getStreamFromFD(e);return vt.doStat(yt.stat,r.path,t)}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function wt(e,t,r,n){try{t=vt.getStr(t);var o=256&n,i=4096&n;return I(!(n&=-4353),n),t=vt.calculateAt(e,t,i),vt.doStat(o?yt.lstat:yt.stat,t,r)}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function Tt(e,t,r){try{var n=vt.getStreamFromFD(e);n.getdents||(n.getdents=yt.readdir(n.path));for(var o=280,i=0,a=yt.llseek(n,0,1),s=Math.floor(a/o);s<n.getdents.length&&i+o<=r;){var c,u,l=n.getdents[s];if("."===l)c=n.node.id,u=4;else if(".."===l)c=yt.lookupPath(n.path,{parent:!0}).node.id,u=4;else{var d=yt.lookupNode(n.node,l);c=d.id,u=yt.isChrdev(d.mode)?2:yt.isDir(d.mode)?4:yt.isLink(d.mode)?10:8}I(c),Y[t+i>>3]=BigInt(c),Y[t+i+8>>3]=BigInt((s+1)*o),G[t+i+16>>1]=280,X[t+i+18>>0]=u,L(l,t+i+19,256),i+=o,s+=1}return yt.llseek(n,s*o,0),i}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function Ot(e,t,r){vt.varargs=r;try{var n=vt.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=vt.get();return W[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=vt.get(),yt.ioctl(n,t,o);default:He("bad ioctl syscall "+t)}}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function Dt(e,t){try{return e=vt.getStr(e),vt.doStat(yt.lstat,e,t)}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function Pt(e,t,r){vt.varargs=r;try{var n=vt.getStr(e),o=r?vt.get():0;return yt.open(n,t,o).fd}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function xt(e,t){try{return e=vt.getStr(e),vt.doStat(yt.stat,e,t)}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function St(e,t){He("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Rt(e,t){He("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}var Mt={};function Ft(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function At(e){return this.fromWireType(z[e>>2])}var kt={},It={},Ct={},Ut=48,Nt=57;function jt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=Ut&&t<=Nt?"_"+e:e}function Lt(e,t){return e=jt(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function Ht(e,t){var r=Lt(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var Bt=void 0;function Xt(e){throw new Bt(e)}function Qt(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Xt("Mismatched type converter count");for(var o=0;o<e.length;++o)Jt(e[o],n[o])}e.forEach((function(e){Ct[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){It.hasOwnProperty(e)?o[t]=It[e]:(i.push(e),kt.hasOwnProperty(e)||(kt[e]=[]),kt[e].push((function(){o[t]=It[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function Gt(e){var t=Mt[e];delete Mt[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;Qt([e],o,(function(e){return r.forEach((function(t,r){var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],c=t.setter,u=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];c(u,e,s.toWireType(r,t)),Ft(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError("Incorrect number of tuple elements for "+t.name+": expected="+n+", actual="+o.length);for(var s=i(),c=0;c<n;++c)r[c].write(s,o[c]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:At,destructorFunction:a}]}))}var qt={};function Wt(e){var t=qt[e];delete qt[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;Qt([e],o.map((function(e){return e.getterReturnType})).concat(o.map((function(e){return e.setterArgumentType}))),(function(e){var i={};return o.forEach((function(t,r){var n=t.fieldName,a=e[r],s=t.getter,c=t.getterContext,u=e[r+o.length],l=t.setter,d=t.setterContext;i[n]={read:function(e){return a.fromWireType(s(c,e))},write:function(e,t){var r=[];l(d,e,u.toWireType(r,t)),Ft(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:At,destructorFunction:n}]}))}function zt(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Vt(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Yt=e}var Yt=void 0;function $t(e){for(var t="",r=e;Q[r];)t+=Yt[Q[r++]];return t}var Kt=void 0;function Zt(e){throw new Kt(e)}function Jt(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||Zt('type "'+n+'" must have a positive integer typeid pointer'),It.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Zt("Cannot register type '"+n+"' twice")}if(It[e]=t,delete Ct[e],kt.hasOwnProperty(e)){var o=kt[e];delete kt[e],o.forEach((function(e){e()}))}}function er(e,t,r){switch(t){case 0:return r?function(e){return X[e]}:function(e){return Q[e]};case 1:return r?function(e){return G[e>>1]}:function(e){return q[e>>1]};case 2:return r?function(e){return W[e>>2]}:function(e){return z[e>>2]};case 3:return r?function(e){return Y[e>>3]}:function(e){return $[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function tr(e,t,r,n,o){t=$t(t);var i=rr(r),a=-1!=t.indexOf("u");a&&(o=(BigInt(1)<<BigInt(64))-BigInt(1)),Jt(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r)throw new TypeError('Cannot convert "'+zt(r)+'" to '+this.name);if(r<n||r>o)throw new TypeError('Passing a number "'+zt(r)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+o+"]!");return r},argPackAdvance:8,readValueFromPointer:er(t,i,!a),destructorFunction:null})}function rr(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function nr(e,t,r,n,o){var i=rr(r);Jt(e,{name:t=$t(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=X;else if(2===r)n=G;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=W}return this.fromWireType(n[e>>i])},destructorFunction:null})}function or(e){if(!(this instanceof Fr))return!1;if(!(e instanceof Fr))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function ir(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function ar(e){Zt(e.$$.ptrType.registeredClass.name+" instance already deleted")}var sr=!1;function cr(e){}function ur(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function lr(e){e.count.value-=1,0===e.count.value&&ur(e)}function dr(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=dr(e,t,r.baseClass);return null===n?null:r.downcast(n)}var pr={};function fr(){return Object.keys(_r).length}function mr(){var e=[];for(var t in _r)_r.hasOwnProperty(t)&&e.push(_r[t]);return e}var gr=[];function hr(){for(;gr.length;){var e=gr.pop();e.$$.deleteScheduled=!1,e.delete()}}var Er=void 0;function yr(e){Er=e,gr.length&&Er&&Er(hr)}function vr(){o.getInheritedInstanceCount=fr,o.getLiveInheritedInstances=mr,o.flushPendingDeletes=hr,o.setDelayFunction=yr}var _r={};function br(e,t){for(void 0===t&&Zt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function wr(e,t){return t=br(e,t),_r[t]}function Tr(e,t){return t.ptrType&&t.ptr||Xt("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Xt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Dr(Object.create(e,{$$:{value:t}}))}function Or(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=wr(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Tr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Tr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=pr[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var c=dr(t,this.registeredClass,i.registeredClass);return null===c?o.call(this):this.isSmartPointer?Tr(i.registeredClass.instancePrototype,{ptrType:i,ptr:c,smartPtrType:this,smartPtr:e}):Tr(i.registeredClass.instancePrototype,{ptrType:i,ptr:c})}function Dr(e){return"undefined"==typeof FinalizationRegistry?(Dr=e=>e,e):(sr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),lr(e.$$)})),Dr=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <0x"+t.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Or),sr.register(e,r,e)}return e},cr=e=>sr.unregister(e),Dr(e))}function Pr(){if(this.$$.ptr||ar(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Dr(Object.create(Object.getPrototypeOf(this),{$$:{value:ir(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function xr(){this.$$.ptr||ar(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Zt("Object already scheduled for deletion"),cr(this),lr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Sr(){return!this.$$.ptr}function Rr(){return this.$$.ptr||ar(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Zt("Object already scheduled for deletion"),gr.push(this),1===gr.length&&Er&&Er(hr),this.$$.deleteScheduled=!0,this}function Mr(){Fr.prototype.isAliasOf=or,Fr.prototype.clone=Pr,Fr.prototype.delete=xr,Fr.prototype.isDeleted=Sr,Fr.prototype.deleteLater=Rr}function Fr(){}function Ar(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Zt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function kr(e,t,r){o.hasOwnProperty(e)?((void 0===r||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[r])&&Zt("Cannot register public name '"+e+"' twice"),Ar(o,e,e),o.hasOwnProperty(r)&&Zt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),o[e].overloadTable[r]=t):(o[e]=t,void 0!==r&&(o[e].numArguments=r))}function Ir(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Cr(e,t,r){for(;t!==r;)t.upcast||Zt("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Ur(e,t){if(null===t)return this.isReference&&Zt("null is not a valid "+this.name),0;t.$$||Zt('Cannot pass "'+zt(t)+'" as a '+this.name),t.$$.ptr||Zt("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Cr(t.$$.ptr,r,this.registeredClass)}function Nr(e,t){var r;if(null===t)return this.isReference&&Zt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Zt('Cannot pass "'+zt(t)+'" as a '+this.name),t.$$.ptr||Zt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Zt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=Cr(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Zt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Zt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,cn.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:Zt("Unsupporting sharing policy")}return r}function jr(e,t){if(null===t)return this.isReference&&Zt("null is not a valid "+this.name),0;t.$$||Zt('Cannot pass "'+zt(t)+'" as a '+this.name),t.$$.ptr||Zt("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Zt("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Cr(t.$$.ptr,r,this.registeredClass)}function Lr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Hr(e){this.rawDestructor&&this.rawDestructor(e)}function Br(e){null!==e&&e.delete()}function Xr(){Qr.prototype.getPointee=Lr,Qr.prototype.destructor=Hr,Qr.prototype.argPackAdvance=8,Qr.prototype.readValueFromPointer=At,Qr.prototype.deleteObject=Br,Qr.prototype.fromWireType=Or}function Qr(e,t,r,n,o,i,a,s,c,u,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=u,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=Nr:n?(this.toWireType=Ur,this.destructorFunction=null):(this.toWireType=jr,this.destructorFunction=null)}function Gr(e,t,r){o.hasOwnProperty(e)||Xt("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==r?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r)}function qr(e,t){e=$t(e);var r=et(t);return"function"!=typeof r&&Zt("unknown function pointer with signature "+e+": "+t),r}var Wr=void 0;function zr(e){var t=Ld(e),r=$t(t);return Nd(t),r}function Vr(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||It[t]||(Ct[t]?Ct[t].forEach(e):(r.push(t),n[t]=!0))})),new Wr(e+": "+r.map(zr).join([", "]))}function Yr(e,t,r,n,o,i,a,s,c,u,l,d,p){l=$t(l),i=qr(o,i),s&&(s=qr(a,s)),u&&(u=qr(c,u)),p=qr(d,p);var f=jt(l);kr(f,(function(){Vr("Cannot construct "+l+" due to unbound types",[n])})),Qt([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Fr.prototype;var a=Lt(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new Kt("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Kt(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Kt("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)})),c=Object.create(o,{constructor:{value:a}});a.prototype=c;var d=new Ir(l,a,c,p,r,i,s,u),m=new Qr(l,d,!0,!1,!1),g=new Qr(l+"*",d,!1,!1,!1),h=new Qr(l+" const*",d,!1,!0,!1);return pr[e]={pointerType:g,constPointerType:h},Gr(f,a),[m,g,h]}))}function $r(e,t){for(var r=[],n=0;n<e;n++)r.push(W[(t>>2)+n]);return r}function Kr(e,t,r,n,o,i){I(t>0);var a=$r(t,r);o=qr(n,o),Qt([],[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 Kt("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]=()=>{Vr("Cannot construct "+e.name+" due to unbound types",a)},Qt([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Jr(r,n,null,o,i),[]})),[]}))}function Zr(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 n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Jr(e,t,r,n,o){var i=t.length;i<2&&Zt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){s=!0;break}var u="void"!==t[0].name,l="",d="";for(c=0;c<i-2;++c)l+=(0!==c?", ":"")+"arg"+c,d+=(0!==c?", ":"")+"arg"+c+"Wired";var p="return function "+jt(e)+"("+l+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var f=s?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Zt,n,o,Ft,t[0],t[1]];for(a&&(p+="var thisWired = classParam.toWireType("+f+", this);\n"),c=0;c<i-2;++c)p+="var arg"+c+"Wired = argType"+c+".toWireType("+f+", arg"+c+"); // "+t[c+2].name+"\n",m.push("argType"+c),g.push(t[c+2]);if(a&&(d="thisWired"+(d.length>0?", ":"")+d),p+=(u?"var rv = ":"")+"invoker(fn"+(d.length>0?", ":"")+d+");\n",s)p+="runDestructors(destructors);\n";else for(c=a?1:2;c<t.length;++c){var h=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(p+=h+"_dtor("+h+"); // "+t[c].name+"\n",m.push(h+"_dtor"),g.push(t[c].destructorFunction))}return u&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",m.push(p),Zr(Function,m).apply(null,g)}function en(e,t,r,n,o,i,a,s){var c=$r(r,n);t=$t(t),i=qr(o,i),Qt([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){Vr("Cannot call "+n+" due to unbound types",c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,u[t]=o):(Ar(u,t,n),u[t].overloadTable[r-2]=o),Qt([],c,(function(o){var s=Jr(n,o,e,i,a);return void 0===u[t].overloadTable?(s.argCount=r-2,u[t]=s):u[t].overloadTable[r-2]=s,[]})),[]}))}var tn=[],rn=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function nn(e){e>4&&0==--rn[e].refcount&&(rn[e]=void 0,tn.push(e))}function on(){for(var e=0,t=5;t<rn.length;++t)void 0!==rn[t]&&++e;return e}function an(){for(var e=5;e<rn.length;++e)if(void 0!==rn[e])return rn[e];return null}function sn(){o.count_emval_handles=on,o.get_first_emval=an}var cn={toValue:function(e){return e||Zt("Cannot use deleted val. handle = "+e),rn[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=tn.length?tn.pop():rn.length;return rn[t]={refcount:1,value:e},t}}};function un(e,t){Jt(e,{name:t=$t(t),fromWireType:function(e){var t=cn.toValue(e);return nn(e),t},toWireType:function(e,t){return cn.toHandle(t)},argPackAdvance:8,readValueFromPointer:At,destructorFunction:null})}function ln(e,t,r){switch(t){case 0:return function(e){var t=r?X:Q;return this.fromWireType(t[e])};case 1:return function(e){var t=r?G:q;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?W:z;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function dn(e,t,r,n){var o=rr(r);function i(){}t=$t(t),i.values={},Jt(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:ln(t,o,n),destructorFunction:null}),kr(t,i)}function pn(e,t){var r=It[e];return void 0===r&&Zt(t+" has unknown type "+zr(e)),r}function fn(e,t,r){var n=pn(e,"enum");t=$t(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Lt(n.name+"_"+t,(function(){}))}});o.values[r]=i,o[t]=i}function mn(e,t){switch(t){case 2:return function(e){return this.fromWireType(V[e>>2])};case 3:return function(e){return this.fromWireType(K[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function gn(e,t,r){var n=rr(r);Jt(e,{name:t=$t(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+zt(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:mn(t,n),destructorFunction:null})}function hn(e,t,r,n,o,i){var a=$r(t,r);e=$t(e),o=qr(n,o),kr(e,(function(){Vr("Cannot call "+e+" due to unbound types",a)}),t-1),Qt([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Gr(e,Jr(e,n,null,o,i),t-1),[]}))}function En(e,t,r,n,o){t=$t(t),-1===o&&(o=4294967295);var i=rr(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var c=t.includes("unsigned"),u=(e,r)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+zt(e)+'" to '+r);if(e<n||e>o)throw new TypeError('Passing a number "'+zt(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+o+"]!")};Jt(e,{name:t,fromWireType:a,toWireType:c?function(e,t){return u(t,this.name),t>>>0}:function(e,t){return u(t,this.name),t},argPackAdvance:8,readValueFromPointer:er(t,i,0!==n),destructorFunction:null})}function yn(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=z,r=t[e>>=2],o=t[e+1];return new n(B,o,r)}Jt(e,{name:r=$t(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function vn(e,t,r,n,o,i,a,s,c,u,l,d){r=$t(r),i=qr(o,i),s=qr(a,s),u=qr(c,u),d=qr(l,d),Qt([e],[t],(function(e){return e=e[0],[new Qr(r,e.registeredClass,!1,!1,!0,e,n,i,s,u,d)]}))}function _n(e,t){var r="std::string"===(t=$t(t));Jt(e,{name:t,fromWireType:function(e){var t,n=z[e>>2];if(r)for(var o=e+4,i=0;i<=n;++i){var a=e+4+i;if(i==n||0==Q[a]){var s=N(o,a-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=a+1}}else{var c=new Array(n);for(i=0;i<n;++i)c[i]=String.fromCharCode(Q[e+4+i]);t=c.join("")}return Nd(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Zt("Cannot pass non-string to std::string");var o=(r&&n?()=>H(t):()=>t.length)(),i=Ud(4+o+1);if(z[i>>2]=o,r&&n)L(t,i+4,o+1);else if(n)for(var a=0;a<o;++a){var s=t.charCodeAt(a);s>255&&(Nd(i),Zt("String has UTF-16 code units that do not fit in 8 bits")),Q[i+4+a]=s}else for(a=0;a<o;++a)Q[i+4+a]=t[a];return null!==e&&e.push(Nd,i),i},argPackAdvance:8,readValueFromPointer:At,destructorFunction:function(e){Nd(e)}})}function bn(e,t,r){var n,o,i,a,s;r=$t(r),2===t?(n=J,o=ee,a=te,i=()=>q,s=1):4===t&&(n=re,o=ne,a=oe,i=()=>z,s=2),Jt(e,{name:r,fromWireType:function(e){for(var r,o=z[e>>2],a=i(),c=e+4,u=0;u<=o;++u){var l=e+4+u*t;if(u==o||0==a[l>>s]){var d=n(c,l-c);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),c=l+t}}return Nd(e),r},toWireType:function(e,n){"string"!=typeof n&&Zt("Cannot pass non-string to C++ string type "+r);var i=a(n),c=Ud(4+i+t);return z[c>>2]=i>>s,o(n,c+4,i+t),null!==e&&e.push(Nd,c),c},argPackAdvance:8,readValueFromPointer:At,destructorFunction:function(e){Nd(e)}})}function wn(e,t,r,n,o,i){Mt[e]={name:$t(t),rawConstructor:qr(r,n),rawDestructor:qr(o,i),elements:[]}}function Tn(e,t,r,n,o,i,a,s,c){Mt[e].elements.push({getterReturnType:t,getter:qr(r,n),getterContext:o,setterArgumentType:i,setter:qr(a,s),setterContext:c})}function On(e,t,r,n,o,i){qt[e]={name:$t(t),rawConstructor:qr(r,n),rawDestructor:qr(o,i),fields:[]}}function Dn(e,t,r,n,o,i,a,s,c,u){qt[e].fields.push({fieldName:$t(t),getterReturnType:r,getter:qr(n,o),getterContext:i,setterArgumentType:a,setter:qr(s,c),setterContext:u})}function Pn(e,t){Jt(e,{isVoid:!0,name:t=$t(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function xn(){throw"longjmp"}function Sn(e,t,r){e=cn.toValue(e),t=pn(t,"emval::as");var n=[],o=cn.toHandle(n);return W[r>>2]=o,t.toWireType(n,e)}function Rn(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=pn(W[(t>>2)+n],"parameter "+n);return r}function Mn(e,t,r,n){e=cn.toValue(e);for(var o=Rn(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var c=e.apply(void 0,i);return cn.toHandle(c)}function Fn(e){var t=[];return W[e>>2]=cn.toHandle(t),t}var An={};function kn(e){var t=An[e];return void 0===t?$t(e):t}var In=[];function Cn(e,t,r,n,o){return(e=In[e])(t=cn.toValue(t),r=kn(r),Fn(n),o)}function Un(e,t,r,n){(e=In[e])(t=cn.toValue(t),r=kn(r),null,n)}function Nn(){return"object"==typeof globalThis?globalThis:Function("return this")()}function jn(e){return 0===e?cn.toHandle(Nn()):(e=kn(e),cn.toHandle(Nn()[e]))}function Ln(e){var t=In.length;return In.push(e),t}var Hn=[];function Bn(e,t){var r=Rn(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Hn[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],c="",u=0;u<e-1;++u)c+=(0!==u?", ":"")+"arg"+u,a.push("argType"+u),s.push(r[1+u]);var l="return function "+jt("methodCaller_"+o)+"(handle, name, destructors, args) {\n",d=0;for(u=0;u<e-1;++u)l+=" var arg"+u+" = argType"+u+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=r[u+1].argPackAdvance;for(l+=" var rv = handle[name]("+c+");\n",u=0;u<e-1;++u)r[u+1].deleteObject&&(l+=" argType"+u+".deleteObject(arg"+u+");\n");return n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",a.push(l),i=Ln(Zr(Function,a).apply(null,s)),Hn[o]=i,i}function Xn(e,t){return e=cn.toValue(e),t=cn.toValue(t),cn.toHandle(e[t])}function Qn(e){e>4&&(rn[e].refcount+=1)}function Gn(e,t){return(e=cn.toValue(e))instanceof cn.toValue(t)}function qn(e){return"number"==typeof(e=cn.toValue(e))}function Wn(e){return"string"==typeof(e=cn.toValue(e))}function zn(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+r+'], "parameter '+r+'");\nvar arg'+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle",n)(pn,o,cn.toHandle)}var Vn,Yn={};function $n(e,t,r,n){e=cn.toValue(e);var o=Yn[t];return o||(o=zn(t),Yn[t]=o),o(e,r,n)}function Kn(){return cn.toHandle([])}function Zn(e){return cn.toHandle(kn(e))}function Jn(){return cn.toHandle({})}function eo(e){Ft(cn.toValue(e)),nn(e)}function to(e,t,r){e=cn.toValue(e),t=cn.toValue(t),r=cn.toValue(r),e[t]=r}function ro(e,t){var r=(e=pn(e,"_emval_take_value")).readValueFromPointer(t);return cn.toHandle(r)}function no(e){throw cn.toValue(e)}function oo(e,t){var r=new Date(1e3*W[e>>2]);W[t>>2]=r.getUTCSeconds(),W[t+4>>2]=r.getUTCMinutes(),W[t+8>>2]=r.getUTCHours(),W[t+12>>2]=r.getUTCDate(),W[t+16>>2]=r.getUTCMonth(),W[t+20>>2]=r.getUTCFullYear()-1900,W[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;W[t+28>>2]=o}function io(e,t){var r=new Date(1e3*W[e>>2]);W[t>>2]=r.getSeconds(),W[t+4>>2]=r.getMinutes(),W[t+8>>2]=r.getHours(),W[t+12>>2]=r.getDate(),W[t+16>>2]=r.getMonth(),W[t+20>>2]=r.getFullYear()-1900,W[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;W[t+28>>2]=o,W[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));W[t+32>>2]=s}function ao(e){var t=new Date(W[e+20>>2]+1900,W[e+16>>2],W[e+12>>2],W[e+8>>2],W[e+4>>2],W[e>>2],0),r=W[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)W[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var c=Math.max(a,i),u=r>0?s:c;t.setTime(t.getTime()+6e4*(u-n))}W[e+24>>2]=t.getDay();var l=(t.getTime()-o.getTime())/864e5|0;return W[e+28>>2]=l,W[e>>2]=t.getSeconds(),W[e+4>>2]=t.getMinutes(),W[e+8>>2]=t.getHours(),W[e+12>>2]=t.getDate(),W[e+16>>2]=t.getMonth(),t.getTime()/1e3|0}function so(e,t,r,n,o,i,a,s){try{var c=yt.getStream(o);if(!c)return-8;var u=yt.mmap(c,e,t,i,r,n),l=u.ptr;return W[a>>2]=u.allocated,l}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function co(e,t,r,n,o,i){try{var a=yt.getStream(o);a&&(2&r&&vt.doMsync(e,a,t,n,i),yt.munmap(a))}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return-e.errno}}function uo(e,t,r){var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),c=Math.max(a,s);function u(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}W[e>>2]=60*c,W[t>>2]=Number(a!=s);var l=u(o),d=u(i),p=ie(l),f=ie(d);s<a?(W[r>>2]=p,W[r+4>>2]=f):(W[r>>2]=f,W[r+4>>2]=p)}function lo(e,t,r){lo.called||(lo.called=!0,uo(e,t,r))}function po(){He("native code called abort()")}Vn=()=>performance.now();var fo=!0;function mo(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!fo)return at(28),-1;r=Vn()}return W[t>>2]=r/1e3|0,W[t+4>>2]=r%1e3*1e3*1e3|0,0}function go(e,t){if(bo.mainLoop.timingMode=e,bo.mainLoop.timingValue=t,!bo.mainLoop.func)return T("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(bo.mainLoop.running||(bo.mainLoop.running=!0),0==e)bo.mainLoop.scheduler=function(){var e=0|Math.max(0,bo.mainLoop.tickStartTime+t-Vn());setTimeout(bo.mainLoop.runner,e)},bo.mainLoop.method="timeout";else if(1==e)bo.mainLoop.scheduler=function(){bo.requestAnimationFrame(bo.mainLoop.runner)},bo.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(function(e){e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),f?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}bo.mainLoop.scheduler=function(){setImmediate(bo.mainLoop.runner)},bo.mainLoop.method="immediate"}return 0}function ho(e){fp(e)}function Eo(){if(!Oe())try{ho(A)}catch(e){tt(e)}}function yo(e,t,r,n,i){I(!bo.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."),bo.mainLoop.func=e,bo.mainLoop.arg=n;var a=bo.mainLoop.currentlyRunningMainloop;function s(){return!(a<bo.mainLoop.currentlyRunningMainloop&&(Eo(),1))}if(bo.mainLoop.running=!1,bo.mainLoop.runner=function(){if(!k)if(bo.mainLoop.queue.length>0){var t=Date.now(),r=bo.mainLoop.queue.shift();if(r.func(r.arg),bo.mainLoop.remainingBlockers){var n=bo.mainLoop.remainingBlockers,i=n%1==0?n-1:Math.floor(n);r.counted?bo.mainLoop.remainingBlockers=i:(i+=.5,bo.mainLoop.remainingBlockers=(8*n+i)/9)}if(w('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),bo.mainLoop.updateStatus(),!s())return;setTimeout(bo.mainLoop.runner,0)}else s()&&(bo.mainLoop.currentFrameNumber=bo.mainLoop.currentFrameNumber+1|0,1==bo.mainLoop.timingMode&&bo.mainLoop.timingValue>1&&bo.mainLoop.currentFrameNumber%bo.mainLoop.timingValue!=0?bo.mainLoop.scheduler():(0==bo.mainLoop.timingMode&&(bo.mainLoop.tickStartTime=Vn()),"timeout"===bo.mainLoop.method&&o.ctx&&(O("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),bo.mainLoop.method=""),bo.mainLoop.runIter(e),ge(),s()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),bo.mainLoop.scheduler())))},i||(t&&t>0?go(0,1e3/t):go(1,1),bo.mainLoop.scheduler()),r)throw"unwind"}function vo(e,t){if(we||k)T("user callback triggered after runtime exited or application aborted. Ignoring.");else if(t)e();else try{e()}catch(e){tt(e)}}function _o(e,t){return setTimeout((function(){vo(e)}),t)}var bo={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){bo.mainLoop.scheduler=null,bo.mainLoop.currentlyRunningMainloop++},resume:function(){bo.mainLoop.currentlyRunningMainloop++;var e=bo.mainLoop.timingMode,t=bo.mainLoop.timingValue,r=bo.mainLoop.func;bo.mainLoop.func=null,yo(r,0,!1,bo.mainLoop.arg,!0),go(e,t),bo.mainLoop.scheduler()},updateStatus:function(){if(o.setStatus){var e=o.statusMessage||"Please wait...",t=bo.mainLoop.remainingBlockers,r=bo.mainLoop.expectedBlockers;t?t<r?o.setStatus(e+" ("+(r-t)+"/"+r+")"):o.setStatus(e):o.setStatus("")}},runIter:function(e){if(!k){if(o.preMainLoop&&!1===o.preMainLoop())return;vo(e),o.postMainLoop&&o.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(o.preloadPlugins||(o.preloadPlugins=[]),!bo.initted){bo.initted=!0;try{new Blob,bo.hasBlobConstructor=!0}catch(e){bo.hasBlobConstructor=!1,w("warning: no blob constructor, cannot create blobs with mimetypes")}bo.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:bo.hasBlobConstructor?null:w("warning: no BlobBuilder"),bo.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,o.noImageDecoding||void 0!==bo.URLObject||(w("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),o.noImageDecoding=!0);var e={canHandle:function(e){return!o.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var i=null;if(bo.hasBlobConstructor)try{(i=new Blob([e],{type:bo.getMimetype(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:bo.getMimetype(t)}))}catch(e){O("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var a=new bo.BlobBuilder;a.append(new Uint8Array(e).buffer),i=a.getBlob()}var s=bo.URLObject.createObjectURL(i);I("string"==typeof s,"createObjectURL must return a url as a string");var c=new Image;c.onload=()=>{I(c.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=c.width,n.height=c.height,n.getContext("2d").drawImage(c,0,0),o.preloadedImages[t]=n,bo.URLObject.revokeObjectURL(s),r&&r(e)},c.onerror=e=>{w("Image "+s+" could not be decoded"),n&&n()},c.src=s}};o.preloadPlugins.push(e);var t={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var i=!1;function a(n){i||(i=!0,o.preloadedAudios[t]=n,r&&r(e))}function s(){i||(i=!0,o.preloadedAudios[t]=new Audio,n&&n())}if(!bo.hasBlobConstructor)return s();try{var c=new Blob([e],{type:bo.getMimetype(t)})}catch(e){return s()}var u=bo.URLObject.createObjectURL(c);I("string"==typeof u,"createObjectURL must return a url as a string");var l=new Audio;l.addEventListener("canplaythrough",(function(){a(l)}),!1),l.onerror=function(r){i||(w("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),l.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(l))},l.src=u,_o((function(){a(l)}),1e4)}};o.preloadPlugins.push(t);var r=o.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&r.addEventListener("click",(function(e){!bo.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){bo.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},handledByPreloadPlugin:function(e,t,r,n){bo.init();var i=!1;return o.preloadPlugins.forEach((function(o){i||o.canHandle(t)&&(o.handle(e,t,r,n),i=!0)})),i},createContext:function(e,t,r,n){if(t&&o.ctx&&e==o.canvas)return o.ctx;var i,a;if(t){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var c in n)s[c]=n[c];void 0!==Mo&&(a=Mo.createContext(e,s))&&(i=Mo.getContext(a).GLctx)}else i=e.getContext("2d");return i?(r&&(t||I(void 0===Pd,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=i,t&&Mo.makeContextCurrent(a),o.useWebGL=t,bo.moduleContextCreatedCallbacks.forEach((function(e){e()})),bo.init()),i):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){bo.lockPointer=e,bo.resizeCanvas=t,void 0===bo.lockPointer&&(bo.lockPointer=!0),void 0===bo.resizeCanvas&&(bo.resizeCanvas=!1);var r=o.canvas;function n(){bo.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=bo.exitFullscreen,bo.lockPointer&&r.requestPointerLock(),bo.isFullscreen=!0,bo.resizeCanvas?bo.setFullscreenCanvasSize():bo.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),bo.resizeCanvas?bo.setWindowedCanvasSize():bo.updateCanvasDimensions(r)),o.onFullScreen&&o.onFullScreen(bo.isFullscreen),o.onFullscreen&&o.onFullscreen(bo.isFullscreen)}bo.fullscreenHandlersInstalled||(bo.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var i=document.createElement("div");r.parentNode.insertBefore(i,r),i.appendChild(r),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()},requestFullScreen:function(){He("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen:function(){return!!bo.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===bo.nextRAF)bo.nextRAF=t+1e3/60;else for(;t+2>=bo.nextRAF;)bo.nextRAF+=1e3/60;var r=Math.max(bo.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,bo.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e){return _o(e)},safeRequestAnimationFrame:function(e){return bo.requestAnimationFrame((function(){vo(e)}))},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(bo.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?bo.mouseMovementX=bo.mouseMovementY=0:(bo.mouseMovementX=bo.getMovementX(e),bo.mouseMovementY=bo.getMovementY(e)),"undefined"!=typeof SDL?(bo.mouseX=SDL.mouseX+bo.mouseMovementX,bo.mouseY=SDL.mouseY+bo.mouseMovementY):(bo.mouseX+=bo.mouseMovementX,bo.mouseY+=bo.mouseMovementY);else{var t=o.canvas.getBoundingClientRect(),r=o.canvas.width,n=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(I(void 0!==i&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var c=s.pageX-(i+t.left),u=s.pageY-(a+t.top),l={x:c*=r/t.width,y:u*=n/t.height};if("touchstart"===e.type)bo.lastTouches[s.identifier]=l,bo.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=bo.touches[s.identifier];d||(d=l),bo.lastTouches[s.identifier]=d,bo.touches[s.identifier]=l}return}var p=e.pageX-(i+t.left),f=e.pageY-(a+t.top);p*=r/t.width,f*=n/t.height,bo.mouseMovementX=p-bo.mouseX,bo.mouseMovementY=f-bo.mouseY,bo.mouseX=p,bo.mouseY=f}},resizeListeners:[],updateResizeListeners:function(){var e=o.canvas;bo.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,r){var n=o.canvas;bo.updateCanvasDimensions(n,e,t),r||bo.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=z[SDL.screen>>2];e|=8388608,W[SDL.screen>>2]=e}bo.updateCanvasDimensions(o.canvas),bo.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=z[SDL.screen>>2];e&=-8388609,W[SDL.screen>>2]=e}bo.updateCanvasDimensions(o.canvas),bo.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,i=r;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/i<o.forcedAspectRatio?n=Math.round(i*o.forcedAspectRatio):i=Math.round(n/o.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/i);n=Math.round(n*a),i=Math.round(i*a)}bo.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||i!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},wo={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){wo.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return wo.setErrorCode(12296),0;if(t)for(;;){var i=W[t>>2];if(12321==i){var a=W[t+4>>2];wo.contextAttributes.alpha=a>0}else if(12325==i){var s=W[t+4>>2];wo.contextAttributes.depth=s>0}else if(12326==i){var c=W[t+4>>2];wo.contextAttributes.stencil=c>0}else if(12337==i){var u=W[t+4>>2];wo.contextAttributes.antialias=u>0}else if(12338==i)u=W[t+4>>2],wo.contextAttributes.antialias=1==u;else if(12544==i){var l=W[t+4>>2];wo.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(W[o>>2]=1),r&&n>0&&(W[r>>2]=62002),wo.setErrorCode(12288),1):(wo.setErrorCode(12300),0)}};function To(e,t,r,n,o){return wo.chooseConfig(e,t,r,n,o)}function Oo(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function Do(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function Po(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function xo(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function So(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function Ro(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var Mo={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Mo.lastError||(Mo.lastError=e)},getNewId:function(e){for(var t=Mo.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?W[n+4*i>>2]:-1;o+=N(W[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?Mo.registerContext(r,t):0},registerContext:function(e,t){var r=Mo.getNewId(Mo.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Mo.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Mo.initExtensions(n),r},makeContextCurrent:function(e){return Mo.currentContext=Mo.contexts[e],o.ctx=Pd=Mo.currentContext&&Mo.currentContext.GLctx,!(e&&!Pd)},getContext:function(e){return Mo.contexts[e]},deleteContext:function(e){Mo.currentContext===Mo.contexts[e]&&(Mo.currentContext=null),"object"==typeof Vl&&Vl.removeAllHandlersOnTarget(Mo.contexts[e].GLctx.canvas),Mo.contexts[e]&&Mo.contexts[e].GLctx.canvas&&(Mo.contexts[e].GLctx.canvas.GLctxObject=void 0),Mo.contexts[e]=null},initExtensions:function(e){if(e||(e=Mo.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;Oo(t),Do(t),Po(t),xo(t),So(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),Ro(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}};function Fo(e,t,r,n){if(62e3!=e)return wo.setErrorCode(12296),0;for(var i=1;;){var a=W[n>>2];if(12440!=a){if(12344==a)break;return wo.setErrorCode(12292),0}i=W[n+4>>2],n+=8}return i<2||i>3?(wo.setErrorCode(12293),0):(wo.contextAttributes.majorVersion=i-1,wo.contextAttributes.minorVersion=0,wo.context=Mo.createContext(o.canvas,wo.contextAttributes),0!=wo.context?(wo.setErrorCode(12288),Mo.makeContextCurrent(wo.context),o.useWebGL=!0,bo.moduleContextCreatedCallbacks.forEach((function(e){e()})),Mo.makeContextCurrent(null),62004):(wo.setErrorCode(12297),0))}function Ao(e,t,r,n){return 62e3!=e?(wo.setErrorCode(12296),0):62002!=t?(wo.setErrorCode(12293),0):(wo.setErrorCode(12288),62006)}function ko(e,t){return 62e3!=e?(wo.setErrorCode(12296),0):62004!=t?(wo.setErrorCode(12294),0):(Mo.deleteContext(wo.context),wo.setErrorCode(12288),wo.currentContext==t&&(wo.currentContext=0),1)}function Io(e,t){return 62e3!=e?(wo.setErrorCode(12296),0):62006!=t?(wo.setErrorCode(12301),1):(wo.currentReadSurface==t&&(wo.currentReadSurface=0),wo.currentDrawSurface==t&&(wo.currentDrawSurface=0),wo.setErrorCode(12288),1)}function Co(e,t,r,n){if(62e3!=e)return wo.setErrorCode(12296),0;if(62002!=t)return wo.setErrorCode(12293),0;if(!n)return wo.setErrorCode(12300),0;switch(wo.setErrorCode(12288),r){case 12320:return W[n>>2]=wo.contextAttributes.alpha?32:24,1;case 12321:return W[n>>2]=wo.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return W[n>>2]=8,1;case 12325:return W[n>>2]=wo.contextAttributes.depth?24:0,1;case 12326:return W[n>>2]=wo.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return W[n>>2]=12344,1;case 12328:return W[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return W[n>>2]=0,1;case 12330:case 12332:return W[n>>2]=4096,1;case 12331:return W[n>>2]=16777216,1;case 12337:return W[n>>2]=wo.contextAttributes.antialias?4:0,1;case 12338:return W[n>>2]=wo.contextAttributes.antialias?1:0,1;case 12339:case 12352:return W[n>>2]=4,1;case 12341:case 12342:case 12343:return W[n>>2]=-1,1;case 12348:return W[n>>2]=1,1;case 12351:return W[n>>2]=12430,1;default:return wo.setErrorCode(12292),0}}function Uo(e){return wo.setErrorCode(12288),62e3}function No(){return wo.errorCode}function jo(e,t,r){return 62e3==e?(t&&(W[t>>2]=1),r&&(W[r>>2]=4),wo.defaultDisplayInitialized=!0,wo.setErrorCode(12288),1):(wo.setErrorCode(12296),0)}function Lo(e,t,r,n){return 62e3!=e?(wo.setErrorCode(12296),0):0!=n&&62004!=n?(wo.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(wo.setErrorCode(12301),0):(Mo.makeContextCurrent(n?wo.context:null),wo.currentContext=n,wo.currentDrawSurface=t,wo.currentReadSurface=r,wo.setErrorCode(12288),1)}function Ho(){if(wo.defaultDisplayInitialized)if(o.ctx){if(!o.ctx.isContextLost())return wo.setErrorCode(12288),1;wo.setErrorCode(12302)}else wo.setErrorCode(12290);else wo.setErrorCode(12289);return 0}function Bo(e){return 62e3!=e?(wo.setErrorCode(12296),0):(wo.currentContext=0,wo.currentReadSurface=0,wo.currentDrawSurface=0,wo.defaultDisplayInitialized=!1,wo.setErrorCode(12288),1)}function Xo(e){I("number"==typeof e),console.error(N(e))}function Qo(e){I("number"==typeof e),console.log(N(e))}function Go(e){I("number"==typeof e),console.warn(N(e))}function qo(){}function Wo(){return 2147483648}function zo(e){Pd.activeTexture(e)}function Vo(e,t){Pd.attachShader(Mo.programs[e],Mo.shaders[t])}function Yo(e,t){Pd.beginQuery(e,Mo.queries[t])}function $o(e,t){Pd.disjointTimerQueryExt.beginQueryEXT(e,Mo.queries[t])}function Ko(e){Pd.beginTransformFeedback(e)}function Zo(e,t,r){Pd.bindAttribLocation(Mo.programs[e],t,N(r))}function Jo(e,t){35051==e?Pd.currentPixelPackBufferBinding=t:35052==e&&(Pd.currentPixelUnpackBufferBinding=t),Pd.bindBuffer(e,Mo.buffers[t])}function ei(e,t,r){Pd.bindBufferBase(e,t,Mo.buffers[r])}function ti(e,t,r,n,o){Pd.bindBufferRange(e,t,Mo.buffers[r],n,o)}function ri(e,t){Pd.bindFramebuffer(e,Mo.framebuffers[t])}function ni(e,t){Pd.bindRenderbuffer(e,Mo.renderbuffers[t])}function oi(e,t){Pd.bindSampler(e,Mo.samplers[t])}function ii(e,t){Pd.bindTexture(e,Mo.textures[t])}function ai(e,t){Pd.bindTransformFeedback(e,Mo.transformFeedbacks[t])}function si(e){Pd.bindVertexArray(Mo.vaos[e])}function ci(e){Pd.bindVertexArray(Mo.vaos[e])}function ui(e,t,r,n){Pd.blendColor(e,t,r,n)}function li(e){Pd.blendEquation(e)}function di(e,t){Pd.blendEquationSeparate(e,t)}function pi(e,t){Pd.blendFunc(e,t)}function fi(e,t,r,n){Pd.blendFuncSeparate(e,t,r,n)}function mi(e,t,r,n,o,i,a,s,c,u){Pd.blitFramebuffer(e,t,r,n,o,i,a,s,c,u)}function gi(e,t,r,n){Mo.currentContext.version>=2?r?Pd.bufferData(e,Q,n,r,t):Pd.bufferData(e,t,n):Pd.bufferData(e,r?Q.subarray(r,r+t):t,n)}function hi(e,t,r,n){Mo.currentContext.version>=2?Pd.bufferSubData(e,t,Q,n,r):Pd.bufferSubData(e,t,Q.subarray(n,n+r))}function Ei(e){return Pd.checkFramebufferStatus(e)}function yi(e){Pd.clear(e)}function vi(e,t,r,n){Pd.clearBufferfi(e,t,r,n)}function _i(e,t,r){Pd.clearBufferfv(e,t,V,r>>2)}function bi(e,t,r){Pd.clearBufferiv(e,t,W,r>>2)}function wi(e,t,r){Pd.clearBufferuiv(e,t,z,r>>2)}function Ti(e,t,r,n){Pd.clearColor(e,t,r,n)}function Oi(e){Pd.clearDepth(e)}function Di(e){Pd.clearStencil(e)}function Pi(e,t){return I(t===(0|t)),(e>>>0)+4294967296*t}function xi(e,t,r,n){return Pd.clientWaitSync(Mo.syncs[e],t,Pi(r,n))}function Si(e,t,r,n){Pd.colorMask(!!e,!!t,!!r,!!n)}function Ri(e){Pd.compileShader(Mo.shaders[e])}function Mi(e,t,r,n,o,i,a,s){Mo.currentContext.version>=2?Pd.currentPixelUnpackBufferBinding?Pd.compressedTexImage2D(e,t,r,n,o,i,a,s):Pd.compressedTexImage2D(e,t,r,n,o,i,Q,s,a):Pd.compressedTexImage2D(e,t,r,n,o,i,s?Q.subarray(s,s+a):null)}function Fi(e,t,r,n,o,i,a,s,c){Pd.currentPixelUnpackBufferBinding?Pd.compressedTexImage3D(e,t,r,n,o,i,a,s,c):Pd.compressedTexImage3D(e,t,r,n,o,i,a,Q,c,s)}function Ai(e,t,r,n,o,i,a,s,c){Mo.currentContext.version>=2?Pd.currentPixelUnpackBufferBinding?Pd.compressedTexSubImage2D(e,t,r,n,o,i,a,s,c):Pd.compressedTexSubImage2D(e,t,r,n,o,i,a,Q,c,s):Pd.compressedTexSubImage2D(e,t,r,n,o,i,a,c?Q.subarray(c,c+s):null)}function ki(e,t,r,n,o,i,a,s,c,u,l){Pd.currentPixelUnpackBufferBinding?Pd.compressedTexSubImage3D(e,t,r,n,o,i,a,s,c,u,l):Pd.compressedTexSubImage3D(e,t,r,n,o,i,a,s,c,Q,l,u)}function Ii(e,t,r,n,o){Pd.copyBufferSubData(e,t,r,n,o)}function Ci(e,t,r,n,o,i,a,s){Pd.copyTexImage2D(e,t,r,n,o,i,a,s)}function Ui(e,t,r,n,o,i,a,s){Pd.copyTexSubImage2D(e,t,r,n,o,i,a,s)}function Ni(e,t,r,n,o,i,a,s,c){Pd.copyTexSubImage3D(e,t,r,n,o,i,a,s,c)}function ji(){var e=Mo.getNewId(Mo.programs),t=Pd.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,Mo.programs[e]=t,e}function Li(e){var t=Mo.getNewId(Mo.shaders);return Mo.shaders[t]=Pd.createShader(e),t}function Hi(e){Pd.cullFace(e)}function Bi(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.buffers[n];o&&(Pd.deleteBuffer(o),o.name=0,Mo.buffers[n]=null,n==Pd.currentPixelPackBufferBinding&&(Pd.currentPixelPackBufferBinding=0),n==Pd.currentPixelUnpackBufferBinding&&(Pd.currentPixelUnpackBufferBinding=0))}}function Xi(e,t){for(var r=0;r<e;++r){var n=W[t+4*r>>2],o=Mo.framebuffers[n];o&&(Pd.deleteFramebuffer(o),o.name=0,Mo.framebuffers[n]=null)}}function Qi(e){if(e){var t=Mo.programs[e];t?(Pd.deleteProgram(t),t.name=0,Mo.programs[e]=null):Mo.recordError(1281)}}function Gi(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.queries[n];o&&(Pd.deleteQuery(o),Mo.queries[n]=null)}}function qi(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.queries[n];o&&(Pd.disjointTimerQueryExt.deleteQueryEXT(o),Mo.queries[n]=null)}}function Wi(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.renderbuffers[n];o&&(Pd.deleteRenderbuffer(o),o.name=0,Mo.renderbuffers[n]=null)}}function zi(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.samplers[n];o&&(Pd.deleteSampler(o),o.name=0,Mo.samplers[n]=null)}}function Vi(e){if(e){var t=Mo.shaders[e];t?(Pd.deleteShader(t),Mo.shaders[e]=null):Mo.recordError(1281)}}function Yi(e){if(e){var t=Mo.syncs[e];t?(Pd.deleteSync(t),t.name=0,Mo.syncs[e]=null):Mo.recordError(1281)}}function $i(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.textures[n];o&&(Pd.deleteTexture(o),o.name=0,Mo.textures[n]=null)}}function Ki(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2],o=Mo.transformFeedbacks[n];o&&(Pd.deleteTransformFeedback(o),o.name=0,Mo.transformFeedbacks[n]=null)}}function Zi(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2];Pd.deleteVertexArray(Mo.vaos[n]),Mo.vaos[n]=null}}function Ji(e,t){for(var r=0;r<e;r++){var n=W[t+4*r>>2];Pd.deleteVertexArray(Mo.vaos[n]),Mo.vaos[n]=null}}function ea(e){Pd.depthFunc(e)}function ta(e){Pd.depthMask(!!e)}function ra(e,t){Pd.depthRange(e,t)}function na(e,t){Pd.detachShader(Mo.programs[e],Mo.shaders[t])}function oa(e){Pd.disable(e)}function ia(e){Pd.disableVertexAttribArray(e)}function aa(e,t,r){Pd.drawArrays(e,t,r)}function sa(e,t,r,n){Pd.drawArraysInstanced(e,t,r,n)}function ca(e,t,r,n){Pd.drawArraysInstanced(e,t,r,n)}function ua(e,t,r,n){Pd.drawArraysInstanced(e,t,r,n)}function la(e,t,r,n,o){Pd.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)}function da(e,t,r,n){Pd.drawArraysInstanced(e,t,r,n)}function pa(e,t,r,n){Pd.drawArraysInstanced(e,t,r,n)}var fa=[];function ma(e,t){for(var r=fa[e],n=0;n<e;n++)r[n]=W[t+4*n>>2];Pd.drawBuffers(r)}function ga(e,t){for(var r=fa[e],n=0;n<e;n++)r[n]=W[t+4*n>>2];Pd.drawBuffers(r)}function ha(e,t){for(var r=fa[e],n=0;n<e;n++)r[n]=W[t+4*n>>2];Pd.drawBuffers(r)}function Ea(e,t,r,n){Pd.drawElements(e,t,r,n)}function ya(e,t,r,n,o){Pd.drawElementsInstanced(e,t,r,n,o)}function va(e,t,r,n,o){Pd.drawElementsInstanced(e,t,r,n,o)}function _a(e,t,r,n,o){Pd.drawElementsInstanced(e,t,r,n,o)}function ba(e,t,r,n,o,i,a){Pd.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)}function wa(e,t,r,n,o){Pd.drawElementsInstanced(e,t,r,n,o)}function Ta(e,t,r,n,o){Pd.drawElementsInstanced(e,t,r,n,o)}function Oa(e,t,r,n){Pd.drawElements(e,t,r,n)}function Da(e,t,r,n,o,i){Oa(e,n,o,i)}function Pa(e){Pd.enable(e)}function xa(e){Pd.enableVertexAttribArray(e)}function Sa(e){Pd.endQuery(e)}function Ra(e){Pd.disjointTimerQueryExt.endQueryEXT(e)}function Ma(){Pd.endTransformFeedback()}function Fa(e,t){var r=Pd.fenceSync(e,t);if(r){var n=Mo.getNewId(Mo.syncs);return r.name=n,Mo.syncs[n]=r,n}return 0}function Aa(){Pd.finish()}function ka(){Pd.flush()}function Ia(e,t,r,n){Pd.framebufferRenderbuffer(e,t,r,Mo.renderbuffers[n])}function Ca(e,t,r,n,o){Pd.framebufferTexture2D(e,t,r,Mo.textures[n],o)}function Ua(e,t,r,n,o){Pd.framebufferTextureLayer(e,t,Mo.textures[r],n,o)}function Na(e){Pd.frontFace(e)}function ja(e,t,r,n){for(var o=0;o<e;o++){var i=Pd[r](),a=i&&Mo.getNewId(n);i?(i.name=a,n[a]=i):Mo.recordError(1282),W[t+4*o>>2]=a}}function La(e,t){ja(e,t,"createBuffer",Mo.buffers)}function Ha(e,t){ja(e,t,"createFramebuffer",Mo.framebuffers)}function Ba(e,t){ja(e,t,"createQuery",Mo.queries)}function Xa(e,t){for(var r=0;r<e;r++){var n=Pd.disjointTimerQueryExt.createQueryEXT();if(!n){for(Mo.recordError(1282);r<e;)W[t+4*r++>>2]=0;return}var o=Mo.getNewId(Mo.queries);n.name=o,Mo.queries[o]=n,W[t+4*r>>2]=o}}function Qa(e,t){ja(e,t,"createRenderbuffer",Mo.renderbuffers)}function Ga(e,t){ja(e,t,"createSampler",Mo.samplers)}function qa(e,t){ja(e,t,"createTexture",Mo.textures)}function Wa(e,t){ja(e,t,"createTransformFeedback",Mo.transformFeedbacks)}function za(e,t){ja(e,t,"createVertexArray",Mo.vaos)}function Va(e,t){ja(e,t,"createVertexArray",Mo.vaos)}function Ya(e){Pd.generateMipmap(e)}function $a(e,t,r,n,o,i,a,s){t=Mo.programs[t];var c=Pd[e](t,r);if(c){var u=s&&L(c.name,s,n);o&&(W[o>>2]=u),i&&(W[i>>2]=c.size),a&&(W[a>>2]=c.type)}}function Ka(e,t,r,n,o,i,a){$a("getActiveAttrib",e,t,r,n,o,i,a)}function Za(e,t,r,n,o,i,a){$a("getActiveUniform",e,t,r,n,o,i,a)}function Ja(e,t,r,n,o){e=Mo.programs[e];var i=Pd.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=L(i,o,r);n&&(W[n>>2]=a)}else n&&(W[n>>2]=0)}function es(e,t,r,n){if(n)if(e=Mo.programs[e],35393!=r){var o=Pd.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)W[n+4*i>>2]=o[i];else W[n>>2]=o}else{var a=Pd.getActiveUniformBlockName(e,t);W[n>>2]=a.length+1}else Mo.recordError(1281)}function ts(e,t,r,n,o){if(o)if(t>0&&0==r)Mo.recordError(1281);else{e=Mo.programs[e];for(var i=[],a=0;a<t;a++)i.push(W[r+4*a>>2]);var s=Pd.getActiveUniforms(e,i,n);if(s){var c=s.length;for(a=0;a<c;a++)W[o+4*a>>2]=s[a]}}else Mo.recordError(1281)}function rs(e,t,r,n){var o=Pd.getAttachedShaders(Mo.programs[e]),i=o.length;i>t&&(i=t),W[r>>2]=i;for(var a=0;a<i;++a){var s=Mo.shaders.indexOf(o[a]);W[n+4*a>>2]=s}}function ns(e,t){return Pd.getAttribLocation(Mo.programs[e],N(t))}function os(e){return z[e>>2]+4294967296*W[e+4>>2]}function is(e){return z[e>>2]+4294967296*z[e+4>>2]}function as(e,t){z[e>>2]=t,z[e+4>>2]=(t-z[e>>2])/4294967296;var r=t>=0?is(e):os(e);r!=t&&O("writeI53ToI64() out of range: serialized JS Number "+t+" to Wasm heap as bytes lo=0x"+z[e>>2].toString(16)+", hi=0x"+z[e+4>>2].toString(16)+", which deserializes back to "+r+" instead!")}function ss(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&Mo.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Pd.getParameter(34467);n=o?o.length:0;break;case 33309:if(Mo.currentContext.version<2)return void Mo.recordError(1282);n=2*(Pd.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(Mo.currentContext.version<2)return void Mo.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=Pd.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void Mo.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Mo.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:W[t+4*a>>2]=i[a];break;case 2:V[t+4*a>>2]=i[a];break;case 4:X[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return Mo.recordError(1280),void T("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Mo.recordError(1280),void T("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:as(t,n);break;case 0:W[t>>2]=n;break;case 2:V[t>>2]=n;break;case 4:X[t>>0]=n?1:0}}else Mo.recordError(1281)}function cs(e,t){ss(e,t,4)}function us(e,t,r){r?as(r,Pd.getBufferParameter(e,t)):Mo.recordError(1281)}function ls(e,t,r){r?W[r>>2]=Pd.getBufferParameter(e,t):Mo.recordError(1281)}function ds(){var e=Pd.getError()||Mo.lastError;return Mo.lastError=0,e}function ps(e,t){ss(e,t,2)}function fs(e,t){return Pd.getFragDataLocation(Mo.programs[e],N(t))}function ms(e,t,r,n){var o=Pd.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),W[n>>2]=o}function gs(e,t,r,n){if(r){var o,i=Pd.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void Mo.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void Mo.recordError(1280);o=0|i.name}break;default:return void Mo.recordError(1280)}switch(n){case 1:as(r,o);break;case 0:W[r>>2]=o;break;case 2:V[r>>2]=o;break;case 4:X[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else Mo.recordError(1281)}function hs(e,t,r){gs(e,t,r,1)}function Es(e,t){ss(e,t,1)}function ys(e,t,r){gs(e,t,r,0)}function vs(e,t){ss(e,t,0)}function _s(e,t,r,n,o){if(n<0)Mo.recordError(1281);else if(o){var i=Pd.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)W[o+4*a>>2]=i[a]}else Mo.recordError(1281)}function bs(e,t,r,n,o){Mo.recordError(1282)}function ws(e,t,r,n){var o=Pd.getProgramInfoLog(Mo.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?L(o,n,t):0;r&&(W[r>>2]=i)}function Ts(e,t,r){if(r)if(e>=Mo.counter)Mo.recordError(1281);else if(e=Mo.programs[e],35716==t){var n=Pd.getProgramInfoLog(e);null===n&&(n="(unknown error)"),W[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<Pd.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,Pd.getActiveUniform(e,o).name.length+1);W[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<Pd.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,Pd.getActiveAttrib(e,o).name.length+1);W[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<Pd.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Pd.getActiveUniformBlockName(e,o).length+1);W[r>>2]=e.maxUniformBlockNameLength}else W[r>>2]=Pd.getProgramParameter(e,t);else Mo.recordError(1281)}function Os(e,t,r){if(r){var n,o=Mo.queries[e];as(r,"boolean"==typeof(n=Mo.currentContext.version<2?Pd.disjointTimerQueryExt.getQueryObjectEXT(o,t):Pd.getQueryParameter(o,t))?n?1:0:n)}else Mo.recordError(1281)}function Ds(e,t,r){if(r){var n,o=Mo.queries[e],i=Pd.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,W[r>>2]=n}else Mo.recordError(1281)}function Ps(e,t,r){if(r){var n,o=Mo.queries[e];as(r,"boolean"==typeof(n=Mo.currentContext.version<2?Pd.disjointTimerQueryExt.getQueryObjectEXT(o,t):Pd.getQueryParameter(o,t))?n?1:0:n)}else Mo.recordError(1281)}function xs(e,t,r){if(r){var n,o=Mo.queries[e],i=Pd.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,W[r>>2]=n}else Mo.recordError(1281)}function Ss(e,t,r){if(r){var n,o=Mo.queries[e],i=Pd.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,W[r>>2]=n}else Mo.recordError(1281)}function Rs(e,t,r){r?W[r>>2]=Pd.getQuery(e,t):Mo.recordError(1281)}function Ms(e,t,r){r?W[r>>2]=Pd.disjointTimerQueryExt.getQueryEXT(e,t):Mo.recordError(1281)}function Fs(e,t,r){r?W[r>>2]=Pd.getRenderbufferParameter(e,t):Mo.recordError(1281)}function As(e,t,r){r?V[r>>2]=Pd.getSamplerParameter(Mo.samplers[e],t):Mo.recordError(1281)}function ks(e,t,r){r?W[r>>2]=Pd.getSamplerParameter(Mo.samplers[e],t):Mo.recordError(1281)}function Is(e,t,r,n){var o=Pd.getShaderInfoLog(Mo.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?L(o,n,t):0;r&&(W[r>>2]=i)}function Cs(e,t,r,n){var o=Pd.getShaderPrecisionFormat(e,t);W[r>>2]=o.rangeMin,W[r+4>>2]=o.rangeMax,W[n>>2]=o.precision}function Us(e,t,r,n){var o=Pd.getShaderSource(Mo.shaders[e]);if(o){var i=t>0&&n?L(o,n,t):0;r&&(W[r>>2]=i)}}function Ns(e,t,r){if(r)if(35716==t){var n=Pd.getShaderInfoLog(Mo.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;W[r>>2]=o}else if(35720==t){var i=Pd.getShaderSource(Mo.shaders[e]),a=i?i.length+1:0;W[r>>2]=a}else W[r>>2]=Pd.getShaderParameter(Mo.shaders[e],t);else Mo.recordError(1281)}function js(e){var t=H(e)+1,r=Ud(t);return L(e,r,t),r}function Ls(e){var t=Mo.stringCache[e];if(!t){switch(e){case 7939:var r=Pd.getSupportedExtensions()||[];t=js((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Pd.getParameter(e);n||Mo.recordError(1280),t=n&&js(n);break;case 7938:var o=Pd.getParameter(7938);t=js(o=Mo.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")");break;case 35724:var i=Pd.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=js(i);break;default:Mo.recordError(1280)}Mo.stringCache[e]=t}return t}function Hs(e,t){if(Mo.currentContext.version<2)return Mo.recordError(1282),0;var r=Mo.stringiCache[e];if(r)return t<0||t>=r.length?(Mo.recordError(1281),0):r[t];if(7939===e){var n=Pd.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return js(e)})),r=Mo.stringiCache[e]=n,t<0||t>=r.length?(Mo.recordError(1281),0):r[t]}return Mo.recordError(1280),0}function Bs(e,t,r,n,o){if(r<0)Mo.recordError(1281);else if(o){var i=Pd.getSyncParameter(Mo.syncs[e],t);null!==i&&(W[o>>2]=i,n&&(W[n>>2]=1))}else Mo.recordError(1281)}function Xs(e,t,r){r?V[r>>2]=Pd.getTexParameter(e,t):Mo.recordError(1281)}function Qs(e,t,r){r?W[r>>2]=Pd.getTexParameter(e,t):Mo.recordError(1281)}function Gs(e,t,r,n,o,i,a){e=Mo.programs[e];var s=Pd.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var c=L(s.name,a,r);n&&(W[n>>2]=c)}else n&&(W[n>>2]=0);o&&(W[o>>2]=s.size),i&&(W[i>>2]=s.type)}}function qs(e,t){return Pd.getUniformBlockIndex(Mo.programs[e],N(t))}function Ws(e,t,r,n){if(n)if(t>0&&(0==r||0==n))Mo.recordError(1281);else{e=Mo.programs[e];for(var o=[],i=0;i<t;i++)o.push(N(W[r+4*i>>2]));var a=Pd.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)W[n+4*i>>2]=a[i]}}else Mo.recordError(1281)}function zs(e){return parseInt(e)}function Vs(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function Ys(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<Pd.getProgramParameter(e,35718);++t){var i=Pd.getActiveUniform(e,t),a=i.name,s=i.size,c=Vs(a),u=c>0?a.slice(0,c):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[u]=[s,l],r=0;r<s;++r)n[l]=r,e.uniformArrayNamesById[l++]=u}}function $s(e,t){if(t=N(t),e=Mo.programs[e]){Ys(e);var r=e.uniformLocsById,n=0,o=t,i=Vs(t);i>0&&(n=zs(t.slice(i+1))>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||Pd.getUniformLocation(e,t)))return n}else Mo.recordError(1281);return-1}function Ks(e){var t=Pd.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=Pd.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}Mo.recordError(1282)}function Zs(e,t,r,n){if(r){Ys(e=Mo.programs[e]);var o=Pd.getUniform(e,Ks(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:W[r>>2]=o;break;case 2:V[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:W[r+4*i>>2]=o[i];break;case 2:V[r+4*i>>2]=o[i]}}else Mo.recordError(1281)}function Js(e,t,r){Zs(e,t,r,2)}function ec(e,t,r){Zs(e,t,r,0)}function tc(e,t,r){Zs(e,t,r,0)}function rc(e,t,r,n){if(r){var o=Pd.getVertexAttrib(e,t);if(34975==t)W[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:W[r>>2]=o;break;case 2:V[r>>2]=o;break;case 5:W[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:W[r+4*i>>2]=o[i];break;case 2:V[r+4*i>>2]=o[i];break;case 5:W[r+4*i>>2]=Math.fround(o[i])}}else Mo.recordError(1281)}function nc(e,t,r){rc(e,t,r,0)}function oc(e,t,r){rc(e,t,r,0)}function ic(e,t,r){r?W[r>>2]=Pd.getVertexAttribOffset(e,t):Mo.recordError(1281)}function ac(e,t,r){rc(e,t,r,2)}function sc(e,t,r){rc(e,t,r,5)}function cc(e,t){Pd.hint(e,t)}function uc(e,t,r){for(var n=fa[t],o=0;o<t;o++)n[o]=W[r+4*o>>2];Pd.invalidateFramebuffer(e,n)}function lc(e,t,r,n,o,i,a){for(var s=fa[t],c=0;c<t;c++)s[c]=W[r+4*c>>2];Pd.invalidateSubFramebuffer(e,s,n,o,i,a)}function dc(e){var t=Mo.buffers[e];return t?Pd.isBuffer(t):0}function pc(e){return Pd.isEnabled(e)}function fc(e){var t=Mo.framebuffers[e];return t?Pd.isFramebuffer(t):0}function mc(e){return(e=Mo.programs[e])?Pd.isProgram(e):0}function gc(e){var t=Mo.queries[e];return t?Pd.isQuery(t):0}function hc(e){var t=Mo.queries[e];return t?Pd.disjointTimerQueryExt.isQueryEXT(t):0}function Ec(e){var t=Mo.renderbuffers[e];return t?Pd.isRenderbuffer(t):0}function yc(e){var t=Mo.samplers[e];return t?Pd.isSampler(t):0}function vc(e){var t=Mo.shaders[e];return t?Pd.isShader(t):0}function _c(e){return Pd.isSync(Mo.syncs[e])}function bc(e){var t=Mo.textures[e];return t?Pd.isTexture(t):0}function wc(e){return Pd.isTransformFeedback(Mo.transformFeedbacks[e])}function Tc(e){var t=Mo.vaos[e];return t?Pd.isVertexArray(t):0}function Oc(e){var t=Mo.vaos[e];return t?Pd.isVertexArray(t):0}function Dc(e){Pd.lineWidth(e)}function Pc(e){e=Mo.programs[e],Pd.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}}function xc(e,t,r,n,o,i){Pd.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,W,t>>2,W,r>>2,W,n>>2,z,o>>2,i)}function Sc(e,t,r,n,o,i,a,s){Pd.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,W,t>>2,r,W,n>>2,W,o>>2,W,i>>2,z,a>>2,s)}function Rc(){Pd.pauseTransformFeedback()}function Mc(e,t){3317==e&&(Mo.unpackAlignment=t),Pd.pixelStorei(e,t)}function Fc(e,t){Pd.polygonOffset(e,t)}function Ac(e,t,r,n){Mo.recordError(1280)}function kc(e,t,r){Mo.recordError(1280)}function Ic(e,t){Pd.disjointTimerQueryExt.queryCounterEXT(Mo.queries[e],t)}function Cc(e){Pd.readBuffer(e)}function Uc(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}function Nc(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}function jc(e){return 0==(e-=5120)?X:1==e?Q:2==e?G:4==e?W:6==e?V:5==e||28922==e||28520==e||30779==e||30782==e?z:q}function Lc(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function Hc(e,t,r,n,o,i){var a=jc(e),s=Lc(a),c=1<<s,u=Uc(r,n,Nc(t)*c,Mo.unpackAlignment);return a.subarray(o>>s,o+u>>s)}function Bc(e,t,r,n,o,i,a){if(Mo.currentContext.version>=2)if(Pd.currentPixelPackBufferBinding)Pd.readPixels(e,t,r,n,o,i,a);else{var s=jc(i);Pd.readPixels(e,t,r,n,o,i,s,a>>Lc(s))}else{var c=Hc(i,o,r,n,a);c?Pd.readPixels(e,t,r,n,o,i,c):Mo.recordError(1280)}}function Xc(){}function Qc(e,t,r,n){Pd.renderbufferStorage(e,t,r,n)}function Gc(e,t,r,n,o){Pd.renderbufferStorageMultisample(e,t,r,n,o)}function qc(){Pd.resumeTransformFeedback()}function Wc(e,t){Pd.sampleCoverage(e,!!t)}function zc(e,t,r){Pd.samplerParameterf(Mo.samplers[e],t,r)}function Vc(e,t,r){var n=V[r>>2];Pd.samplerParameterf(Mo.samplers[e],t,n)}function Yc(e,t,r){Pd.samplerParameteri(Mo.samplers[e],t,r)}function $c(e,t,r){var n=W[r>>2];Pd.samplerParameteri(Mo.samplers[e],t,n)}function Kc(e,t,r,n){Pd.scissor(e,t,r,n)}function Zc(){Mo.recordError(1280)}function Jc(e,t,r,n){var o=Mo.getSource(e,t,r,n);if(Mo.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}Pd.shaderSource(Mo.shaders[e],o)}function eu(e,t,r){Pd.stencilFunc(e,t,r)}function tu(e,t,r,n){Pd.stencilFuncSeparate(e,t,r,n)}function ru(e){Pd.stencilMask(e)}function nu(e,t){Pd.stencilMaskSeparate(e,t)}function ou(e,t,r){Pd.stencilOp(e,t,r)}function iu(e,t,r,n){Pd.stencilOpSeparate(e,t,r,n)}function au(e,t,r,n,o,i,a,s,c){if(Mo.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)),Mo.currentContext.version>=2)if(Pd.currentPixelUnpackBufferBinding)Pd.texImage2D(e,t,r,n,o,i,a,s,c);else if(c){var u=jc(s);Pd.texImage2D(e,t,r,n,o,i,a,s,u,c>>Lc(u))}else Pd.texImage2D(e,t,r,n,o,i,a,s,null);else Pd.texImage2D(e,t,r,n,o,i,a,s,c?Hc(s,a,n,o,c):null)}function su(e,t,r,n,o,i,a,s,c,u){if(Pd.currentPixelUnpackBufferBinding)Pd.texImage3D(e,t,r,n,o,i,a,s,c,u);else if(u){var l=jc(c);Pd.texImage3D(e,t,r,n,o,i,a,s,c,l,u>>Lc(l))}else Pd.texImage3D(e,t,r,n,o,i,a,s,c,null)}function cu(e,t,r){Pd.texParameterf(e,t,r)}function uu(e,t,r){var n=V[r>>2];Pd.texParameterf(e,t,n)}function lu(e,t,r){Pd.texParameteri(e,t,r)}function du(e,t,r){var n=W[r>>2];Pd.texParameteri(e,t,n)}function pu(e,t,r,n,o){Pd.texStorage2D(e,t,r,n,o)}function fu(e,t,r,n,o,i){Pd.texStorage3D(e,t,r,n,o,i)}function mu(e,t,r,n,o,i,a,s,c){if(Mo.currentContext.version>=2&&36193==s&&(s=5131),Mo.currentContext.version>=2)if(Pd.currentPixelUnpackBufferBinding)Pd.texSubImage2D(e,t,r,n,o,i,a,s,c);else if(c){var u=jc(s);Pd.texSubImage2D(e,t,r,n,o,i,a,s,u,c>>Lc(u))}else Pd.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var l=null;c&&(l=Hc(s,a,o,i,c)),Pd.texSubImage2D(e,t,r,n,o,i,a,s,l)}}function gu(e,t,r,n,o,i,a,s,c,u,l){if(Pd.currentPixelUnpackBufferBinding)Pd.texSubImage3D(e,t,r,n,o,i,a,s,c,u,l);else if(l){var d=jc(u);Pd.texSubImage3D(e,t,r,n,o,i,a,s,c,u,d,l>>Lc(d))}else Pd.texSubImage3D(e,t,r,n,o,i,a,s,c,u,null)}function hu(e,t,r,n){e=Mo.programs[e];for(var o=[],i=0;i<t;i++)o.push(N(W[r+4*i>>2]));Pd.transformFeedbackVaryings(e,o,n)}function Eu(e,t){Pd.uniform1f(Ks(e),t)}var yu=[];function vu(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform1fv(Ks(e),V,r>>2,t);else{if(t<=288)for(var n=yu[t-1],o=0;o<t;++o)n[o]=V[r+4*o>>2];else n=V.subarray(r>>2,r+4*t>>2);Pd.uniform1fv(Ks(e),n)}}function _u(e,t){Pd.uniform1i(Ks(e),t)}var bu=[];function wu(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform1iv(Ks(e),W,r>>2,t);else{if(t<=288)for(var n=bu[t-1],o=0;o<t;++o)n[o]=W[r+4*o>>2];else n=W.subarray(r>>2,r+4*t>>2);Pd.uniform1iv(Ks(e),n)}}function Tu(e,t){Pd.uniform1ui(Ks(e),t)}function Ou(e,t,r){Pd.uniform1uiv(Ks(e),z,r>>2,t)}function Du(e,t,r){Pd.uniform2f(Ks(e),t,r)}function Pu(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform2fv(Ks(e),V,r>>2,2*t);else{if(t<=144)for(var n=yu[2*t-1],o=0;o<2*t;o+=2)n[o]=V[r+4*o>>2],n[o+1]=V[r+(4*o+4)>>2];else n=V.subarray(r>>2,r+8*t>>2);Pd.uniform2fv(Ks(e),n)}}function xu(e,t,r){Pd.uniform2i(Ks(e),t,r)}function Su(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform2iv(Ks(e),W,r>>2,2*t);else{if(t<=144)for(var n=bu[2*t-1],o=0;o<2*t;o+=2)n[o]=W[r+4*o>>2],n[o+1]=W[r+(4*o+4)>>2];else n=W.subarray(r>>2,r+8*t>>2);Pd.uniform2iv(Ks(e),n)}}function Ru(e,t,r){Pd.uniform2ui(Ks(e),t,r)}function Mu(e,t,r){Pd.uniform2uiv(Ks(e),z,r>>2,2*t)}function Fu(e,t,r,n){Pd.uniform3f(Ks(e),t,r,n)}function Au(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform3fv(Ks(e),V,r>>2,3*t);else{if(t<=96)for(var n=yu[3*t-1],o=0;o<3*t;o+=3)n[o]=V[r+4*o>>2],n[o+1]=V[r+(4*o+4)>>2],n[o+2]=V[r+(4*o+8)>>2];else n=V.subarray(r>>2,r+12*t>>2);Pd.uniform3fv(Ks(e),n)}}function ku(e,t,r,n){Pd.uniform3i(Ks(e),t,r,n)}function Iu(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform3iv(Ks(e),W,r>>2,3*t);else{if(t<=96)for(var n=bu[3*t-1],o=0;o<3*t;o+=3)n[o]=W[r+4*o>>2],n[o+1]=W[r+(4*o+4)>>2],n[o+2]=W[r+(4*o+8)>>2];else n=W.subarray(r>>2,r+12*t>>2);Pd.uniform3iv(Ks(e),n)}}function Cu(e,t,r,n){Pd.uniform3ui(Ks(e),t,r,n)}function Uu(e,t,r){Pd.uniform3uiv(Ks(e),z,r>>2,3*t)}function Nu(e,t,r,n,o){Pd.uniform4f(Ks(e),t,r,n,o)}function ju(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform4fv(Ks(e),V,r>>2,4*t);else{if(t<=72){var n=yu[4*t-1],o=V;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=V.subarray(r>>2,r+16*t>>2);Pd.uniform4fv(Ks(e),n)}}function Lu(e,t,r,n,o){Pd.uniform4i(Ks(e),t,r,n,o)}function Hu(e,t,r){if(Mo.currentContext.version>=2)Pd.uniform4iv(Ks(e),W,r>>2,4*t);else{if(t<=72)for(var n=bu[4*t-1],o=0;o<4*t;o+=4)n[o]=W[r+4*o>>2],n[o+1]=W[r+(4*o+4)>>2],n[o+2]=W[r+(4*o+8)>>2],n[o+3]=W[r+(4*o+12)>>2];else n=W.subarray(r>>2,r+16*t>>2);Pd.uniform4iv(Ks(e),n)}}function Bu(e,t,r,n,o){Pd.uniform4ui(Ks(e),t,r,n,o)}function Xu(e,t,r){Pd.uniform4uiv(Ks(e),z,r>>2,4*t)}function Qu(e,t,r){e=Mo.programs[e],Pd.uniformBlockBinding(e,t,r)}function Gu(e,t,r,n){if(Mo.currentContext.version>=2)Pd.uniformMatrix2fv(Ks(e),!!r,V,n>>2,4*t);else{if(t<=72)for(var o=yu[4*t-1],i=0;i<4*t;i+=4)o[i]=V[n+4*i>>2],o[i+1]=V[n+(4*i+4)>>2],o[i+2]=V[n+(4*i+8)>>2],o[i+3]=V[n+(4*i+12)>>2];else o=V.subarray(n>>2,n+16*t>>2);Pd.uniformMatrix2fv(Ks(e),!!r,o)}}function qu(e,t,r,n){Pd.uniformMatrix2x3fv(Ks(e),!!r,V,n>>2,6*t)}function Wu(e,t,r,n){Pd.uniformMatrix2x4fv(Ks(e),!!r,V,n>>2,8*t)}function zu(e,t,r,n){if(Mo.currentContext.version>=2)Pd.uniformMatrix3fv(Ks(e),!!r,V,n>>2,9*t);else{if(t<=32)for(var o=yu[9*t-1],i=0;i<9*t;i+=9)o[i]=V[n+4*i>>2],o[i+1]=V[n+(4*i+4)>>2],o[i+2]=V[n+(4*i+8)>>2],o[i+3]=V[n+(4*i+12)>>2],o[i+4]=V[n+(4*i+16)>>2],o[i+5]=V[n+(4*i+20)>>2],o[i+6]=V[n+(4*i+24)>>2],o[i+7]=V[n+(4*i+28)>>2],o[i+8]=V[n+(4*i+32)>>2];else o=V.subarray(n>>2,n+36*t>>2);Pd.uniformMatrix3fv(Ks(e),!!r,o)}}function Vu(e,t,r,n){Pd.uniformMatrix3x2fv(Ks(e),!!r,V,n>>2,6*t)}function Yu(e,t,r,n){Pd.uniformMatrix3x4fv(Ks(e),!!r,V,n>>2,12*t)}function $u(e,t,r,n){if(Mo.currentContext.version>=2)Pd.uniformMatrix4fv(Ks(e),!!r,V,n>>2,16*t);else{if(t<=18){var o=yu[16*t-1],i=V;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=V.subarray(n>>2,n+64*t>>2);Pd.uniformMatrix4fv(Ks(e),!!r,o)}}function Ku(e,t,r,n){Pd.uniformMatrix4x2fv(Ks(e),!!r,V,n>>2,8*t)}function Zu(e,t,r,n){Pd.uniformMatrix4x3fv(Ks(e),!!r,V,n>>2,12*t)}function Ju(e){e=Mo.programs[e],Pd.useProgram(e),Pd.currentProgram=e}function el(e){Pd.validateProgram(Mo.programs[e])}function tl(e,t){Pd.vertexAttrib1f(e,t)}function rl(e,t){Pd.vertexAttrib1f(e,V[t>>2])}function nl(e,t,r){Pd.vertexAttrib2f(e,t,r)}function ol(e,t){Pd.vertexAttrib2f(e,V[t>>2],V[t+4>>2])}function il(e,t,r,n){Pd.vertexAttrib3f(e,t,r,n)}function al(e,t){Pd.vertexAttrib3f(e,V[t>>2],V[t+4>>2],V[t+8>>2])}function sl(e,t,r,n,o){Pd.vertexAttrib4f(e,t,r,n,o)}function cl(e,t){Pd.vertexAttrib4f(e,V[t>>2],V[t+4>>2],V[t+8>>2],V[t+12>>2])}function ul(e,t){Pd.vertexAttribDivisor(e,t)}function ll(e,t){Pd.vertexAttribDivisor(e,t)}function dl(e,t){Pd.vertexAttribDivisor(e,t)}function pl(e,t){Pd.vertexAttribDivisor(e,t)}function fl(e,t){Pd.vertexAttribDivisor(e,t)}function ml(e,t,r,n,o){Pd.vertexAttribI4i(e,t,r,n,o)}function gl(e,t){Pd.vertexAttribI4i(e,W[t>>2],W[t+4>>2],W[t+8>>2],W[t+12>>2])}function hl(e,t,r,n,o){Pd.vertexAttribI4ui(e,t,r,n,o)}function El(e,t){Pd.vertexAttribI4ui(e,z[t>>2],z[t+4>>2],z[t+8>>2],z[t+12>>2])}function yl(e,t,r,n,o){Pd.vertexAttribIPointer(e,t,r,n,o)}function vl(e,t,r,n,o,i){Pd.vertexAttribPointer(e,t,r,!!n,o,i)}function _l(e,t,r,n){Pd.viewport(e,t,r,n)}function bl(e,t,r,n){Pd.waitSync(Mo.syncs[e],t,Pi(r,n))}function wl(e,t,r){Q.copyWithin(e,t,t+r)}function Tl(e){try{return R.grow(e-B.byteLength+65535>>>16),le(R.buffer),1}catch(t){T("emscripten_realloc_buffer: Attempted to grow heap from "+B.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}function Ol(e){var t=Q.length;I((e>>>=0)>t);var r=2147483648;if(e>r)return T("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is 2147483648 bytes!"),!1;for(var n=1;n<=4;n*=2){var o=t*(1+.2/n);o=Math.min(o,e+100663296);var i=Math.min(r,ue(Math.max(e,o),65536));if(Tl(i))return!0}return T("Failed to grow the heap from "+t+" bytes to "+i+" bytes, not enough memory!"),!1}function Dl(e,t,r,n,i,a,s,c,u){const l=o.UTF8ToString(e,e+t),d=o.HEAPU8.subarray(a,a+s),p=o.HEAPU32.subarray(c/4,c/4+u),f=o.emscripten_ubq_codec_decoderNextHandle++,m=[];for(let e=0;e<u;e++)m[e]=Mo.textures[p[e]];const g={codec:l,codedWidth:r,codedHeight:n,description:new Uint8Array(d)};try{const e=o.emscripten_ubq_codec_createVideoDecoder(m);e.configure(g),e.numberOfFrames=i,o.emscripten_ubq_codec_decoders.set(f,{videoDecoder:e,decoderConfig:g,textures:m})}catch{return 0}return f}function Pl(e,t,r,n,i){const a=o.UTF8ToString(e,e+t),s=o.emscripten_ubq_codec_encoderNextHandle++,c=o.specialHTMLTargets["!canvas"];c.width=r,c.height=n;const u={codec:a,width:r,height:n,avc:{format:"annexb"},fps:i};try{const e=new VideoEncoder({output:e=>{const t=o._malloc(e.byteLength),r=o.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),o.emscripten_ubq_codec_muxChunk(s,t,e.byteLength),o._free(t)},error:e=>console.error(e)});e.configure(u),o.emscripten_ubq_codec_encoders.set(s,{videoEncoder:e,encoderConfig:u,groupOfPictures:150,frameIndex:0})}catch{return 0}return s}function xl(e,t,r,n,i,a){const s=o.emscripten_ubq_codec_decoders.get(e);"closed"===s.videoDecoder.state&&(s.videoDecoder=o.emscripten_ubq_codec_createVideoDecoder(s.texture),s.videoDecoder.configure(s.decoderConfig));const c=s.videoDecoder,u=o.HEAPU8.subarray(i,i+a),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:u});try{c.decode(l)}catch(e){return console.error(e),!1}return!0}function Sl(e){o.emscripten_ubq_codec_decoders.get(e).videoDecoder.close(),o.emscripten_ubq_codec_decoders.delete(e)}function Rl(e){o.emscripten_ubq_codec_encoders.get(e).videoEncoder.close(),o.emscripten_ubq_codec_encoders.delete(e)}function Ml(e,t,r){const n=o.emscripten_ubq_codec_encoders.get(e),i=1e6*n.frameIndex/n.encoderConfig.fps,a=n.frameIndex%n.groupOfPictures==0,s=o.specialHTMLTargets["!canvas"],c=new VideoFrame(s,{timestamp:i});n.videoEncoder.encode(c,{keyFrame:a}),c.close(),n.frameIndex++}async function Fl(e){var t=o.emscripten_ubq_codec_getOnFinalizedEncodingCallback();const r=o.emscripten_ubq_codec_encoders.get(e);await r.videoEncoder.flush(),t.invoke()}async function Al(e){const t=o.emscripten_ubq_codec_decoders.get(e).videoDecoder;await t.flush(),t.decodedFrames=0}function kl(e){return o.emscripten_ubq_codec_decoders.get(e).videoDecoder.decodedFrames}function Il(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder}function Cl(e){const t=o.emscripten_ubq_codec_decoders.get(e).videoDecoder;t.decodedFrames=0,t.probing=!0}function Ul(e){const t=o.emscripten_ubq_codec_decoders.get(e).videoDecoder;t.probing=!1,t.decodedFrames=0}function Nl(e){const t=o.emscripten_ubq_codec_decoders.get(e),r=!0===t.videoDecoder.textureUploadFlag;return t.videoDecoder.textureUploadFlag=!1,r}function jl(e){if(o.emscripten_ubq_asyncFetchStates.has(e)){const t=o.emscripten_ubq_asyncFetchStates.get(e);if(t.state==a.ALLOCATED)return!0;if(t.state==a.FINISHED){const r=t.result.length,n=o._malloc(r);return o.HEAPU8.set(t.result,n),t.resultAddress=n,t.resultLength=r,t.state=a.ALLOCATED,o.emscripten_ubq_asyncFetchStates.set(e,t),!0}}return!1}function Ll(e,t,r,n){let i=o.UTF8ToString(e,t),a=o.UTF8ToString(r,n),s=o.emscripten_ubq_asyncFetchNextHeaderHandle++;return o.emscripten_ubq_asyncFetchHeaders.set(s,{key:i,value:a}),s}function Hl(e){return o.emscripten_ubq_asyncFetchHeaders.has(e)?o.emscripten_ubq_asyncFetchHeaders.get(e):0}function Bl(e,t,r,n,i,c,u,l,d){let p=o.UTF8ToString(t,r),f=o.UTF8ToString(l,d),m=o.emscripten_ubq_asyncFetchNextHandle++;o.emscripten_ubq_asyncFetchStates.set(m,{state:a.PENDING});let g={};for(let e=0;e<i;e++){const t=o.getValue(n+4*e,"i32"),r=o.emscripten_ubq_asyncFetchHeaders.get(t);g[r.key]=r.value}const h=s[e];let E;return"GET"!==h&&"HEAD"!==h&&(E=new Uint8Array(o.HEAPU8.buffer,c,u)),fetch(p,{method:h,headers:g,body:E,mode:"cors",credentials:f}).then((e=>{if(e.status>=200&&e.status<=209){let t=0;return e.headers.has("Content-Length")&&(t=+e.headers.get("Content-Length")),o.emscripten_ubq_asyncFetchTotalBytes.set(m,t),async function(e,t){const r=e.getReader();let n=0,i=[];for(;;){const{done:e,value:t}=await r.read();if(e)break;i.push(t),n+=t.length,o.emscripten_ubq_asyncFetchCompletedBytes.set(m,n)}let a=new Uint8Array(n),s=0;for(let e of i)a.set(e,s),s+=e.length;return a}(e.body)}return Promise.reject(e.statusText)})).then((e=>{o.emscripten_ubq_asyncFetchStates.set(m,{state:a.FINISHED,result:e})})).catch((e=>{o.emscripten_ubq_asyncFetchStates.set(m,{state:a.ERROR,error:e})})),m}function Xl(e){return!!o.emscripten_ubq_asyncFetchStates.has(e)&&(o.emscripten_ubq_asyncFetchStates.delete(e),!0)}function Ql(e){return o.emscripten_ubq_asyncFetchCompletedBytes.has(e)?o.emscripten_ubq_asyncFetchCompletedBytes.get(e):0}function Gl(e){if(o.emscripten_ubq_asyncFetchStates.has(e)){const t=o.emscripten_ubq_asyncFetchStates.get(e);if(t.state==a.ALLOCATED)return t.resultAddress}return-1}function ql(e){if(o.emscripten_ubq_asyncFetchStates.has(e)){const t=o.emscripten_ubq_asyncFetchStates.get(e);if(t.state==a.ALLOCATED)return t.resultLength}return-1}function Wl(e){return o.emscripten_ubq_asyncFetchStates.has(e)?o.emscripten_ubq_asyncFetchStates.get(e).state:-1}function zl(e){return o.emscripten_ubq_asyncFetchTotalBytes.has(e)?o.emscripten_ubq_asyncFetchTotalBytes.get(e):0}var Vl={inEventHandler:0,removeAllEventListeners:function(){for(var e=Vl.eventHandlers.length-1;e>=0;--e)Vl._removeHandler(e);Vl.eventHandlers=[],Vl.deferredCalls=[]},registerRemoveEventListeners:function(){Vl.removeEventListenersRegistered||(ve.push(Vl.removeAllEventListeners),Vl.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in Vl.deferredCalls){var i=Vl.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Vl.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Vl.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Vl.deferredCalls.length;++t)Vl.deferredCalls[t].targetFunction==e&&(Vl.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return Vl.inEventHandler&&Vl.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Vl.canPerformEventHandlerRequests())for(var e=0;e<Vl.deferredCalls.length;++e){var t=Vl.deferredCalls[e];Vl.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Vl.eventHandlers.length;++r)Vl.eventHandlers[r].target!=e||t&&t!=Vl.eventHandlers[r].eventTypeString||Vl._removeHandler(r--)},_removeHandler:function(e){var t=Vl.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Vl.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){var t=function(t){++Vl.inEventHandler,Vl.currentEventHandler=e,Vl.runDeferredCalls(),e.handlerFunc(t),Vl.runDeferredCalls(),--Vl.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Vl.eventHandlers.push(e),Vl.registerRemoveEventListeners();else for(var r=0;r<Vl.eventHandlers.length;++r)Vl.eventHandlers[r].target==e.target&&Vl.eventHandlers[r].eventTypeString==e.eventTypeString&&Vl._removeHandler(r--)},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Yl=["default","low-power","high-performance"];function $l(e){return e>2?N(e):e}var Kl=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];function Zl(e){return e=$l(e),Kl[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}function Jl(e){return Zl(e)}function ed(e,t){I(t);var r=t>>2,n=W[r+6],o={alpha:!!W[r+0],depth:!!W[r+1],stencil:!!W[r+2],antialias:!!W[r+3],premultipliedAlpha:!!W[r+4],preserveDrawingBuffer:!!W[r+5],powerPreference:Yl[n],failIfMajorPerformanceCaveat:!!W[r+7],majorVersion:W[r+8],minorVersion:W[r+9],enableExtensionsByDefault:W[r+10],explicitSwapControl:W[r+11],proxyContextToMainThread:W[r+12],renderViaOffscreenBackBuffer:W[r+13]},i=Jl(e);return i?o.explicitSwapControl?0:Mo.createContext(i,o):0}function td(e,t){return ed(e,t)}function rd(e){Mo.currentContext==e&&(Mo.currentContext=0),Mo.deleteContext(e)}function nd(e){I(e);for(var t=e>>2,r=0;r<14;++r)W[t+r]=0;W[t+0]=W[t+1]=W[t+3]=W[t+4]=W[t+8]=W[t+10]=1}function od(e){return Mo.makeContextCurrent(e)?0:-5}var id={};function ad(){return l||"./this.program"}function sd(){if(!sd.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",_:ad()};for(var t in id)void 0===id[t]?delete e[t]:e[t]=id[t];var r=[];for(var t in e)r.push(t+"="+e[t]);sd.strings=r}return sd.strings}function cd(e,t){var r=0;return sd().forEach((function(n,o){var i=t+r;W[e+4*o>>2]=i,ce(n,i),r+=n.length+1})),0}function ud(e,t){var r=sd();W[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),W[t>>2]=n,0}function ld(e){try{var t=vt.getStreamFromFD(e);return yt.close(t),0}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return e.errno}}function dd(e,t,r,n,o){try{var i=0|Number(n&BigInt(4294967295));I(!(0|Number(n>>BigInt(32))),"offsets over 2^32 not yet supported");var a=vt.getStreamFromFD(e),s=vt.doReadv(a,t,r,i);return W[o>>2]=s,0}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return e.errno}}function pd(e,t,r,n){try{var o=vt.getStreamFromFD(e),i=vt.doReadv(o,t,r);return W[n>>2]=i,0}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return e.errno}}function fd(e,t,r,n){try{var o=0|Number(t&BigInt(4294967295)),i=0|Number(t>>BigInt(32)),a=vt.getStreamFromFD(e),s=4294967296*i+(o>>>0),c=9007199254740992;return s<=-c||s>=c?-61:(yt.llseek(a,s,r),Y[n>>3]=BigInt(a.position),a.getdents&&0===s&&0===r&&(a.getdents=null),0)}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return e.errno}}function md(e,t,r,n){try{var o=vt.getStreamFromFD(e),i=vt.doWritev(o,t,r);return W[n>>2]=i,0}catch(e){if(void 0===yt||!(e instanceof yt.ErrnoError))throw e;return e.errno}}function gd(){return S()}function hd(e){var t=Date.now();return W[e>>2]=t/1e3|0,W[e+4>>2]=t%1e3*1e3|0,0}function Ed(e){x(e)}function yd(e){return e%4==0&&(e%100!=0||e%400==0)}function vd(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}var _d=[31,29,31,30,31,30,31,31,30,31,30,31],bd=[31,28,31,30,31,30,31,31,30,31,30,31];function wd(e,t){for(var r=new Date(e.getTime());t>0;){var n=yd(r.getFullYear()),o=r.getMonth(),i=(n?_d:bd)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function Td(e,t,r,n){var o=W[n+40>>2],i={tm_sec:W[n>>2],tm_min:W[n+4>>2],tm_hour:W[n+8>>2],tm_mday:W[n+12>>2],tm_mon:W[n+16>>2],tm_year:W[n+20>>2],tm_wday:W[n+24>>2],tm_yday:W[n+28>>2],tm_isdst:W[n+32>>2],tm_gmtoff:W[n+36>>2],tm_zone:o?N(o):""},a=N(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 c in s)a=a.replace(new RegExp(c,"g"),s[c]);var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function p(e,t){return d(e,t,"0")}function f(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function m(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var t=wd(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=m(r),i=m(n);return f(o,t)<=0?f(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var h={"%a":function(e){return u[e.tm_wday].substring(0,3)},"%A":function(e){return u[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return p((e.tm_year+1900)/100|0,2)},"%d":function(e){return p(e.tm_mday,2)},"%e":function(e){return d(e.tm_mday,2," ")},"%g":function(e){return g(e).toString().substring(2)},"%G":function(e){return g(e)},"%H":function(e){return p(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),p(t,2)},"%j":function(e){return p(e.tm_mday+vd(yd(e.tm_year+1900)?_d:bd,e.tm_mon-1),3)},"%m":function(e){return p(e.tm_mon+1,2)},"%M":function(e){return p(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return p(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:wd(t,7-t.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(f(r,n)<0){var o=vd(yd(n.getFullYear())?_d:bd,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return p(Math.ceil(i/7),2)}return 0===f(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=m(r),i=m(n),a=wd(new Date(e.tm_year+1900,0,1),e.tm_yday);return f(a,o)<0?"53":f(i,a)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),p(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),r=1===t.getDay()?t:wd(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(f(r,n)<0){var o=vd(yd(n.getFullYear())?_d:bd,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return p(Math.ceil(i/7),2)}return 0===f(r,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(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":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var c in a=a.replace(/%%/g,"\0\0"),h)a.includes(c)&&(a=a.replace(new RegExp(c,"g"),h[c](i)));var E=kd(a=a.replace(/\0\0/g,"%"),!1);return E.length>t?0:(se(E,e),E.length-1)}function Od(e,t,r,n){return Td(e,t,r,n)}function Dd(e){var t=Date.now()/1e3|0;return e&&(W[e>>2]=t),t}var Pd,xd=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=yt.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Sd=365,Rd=146;Object.defineProperties(xd.prototype,{read:{get:function(){return(this.mode&Sd)===Sd},set:function(e){e?this.mode|=Sd:this.mode&=~Sd}},write:{get:function(){return(this.mode&Rd)===Rd},set:function(e){e?this.mode|=Rd:this.mode&=~Rd}},isFolder:{get:function(){return yt.isDir(this.mode)}},isDevice:{get:function(){return yt.isChrdev(this.mode)}}}),yt.FSNode=xd,yt.staticInit(),o.FS_createPath=yt.createPath,o.FS_createDataFile=yt.createDataFile,o.FS_createPreloadedFile=yt.createPreloadedFile,o.FS_createLazyFile=yt.createLazyFile,o.FS_createDevice=yt.createDevice,o.FS_unlink=yt.unlink,Et={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Bt=o.InternalError=Ht(Error,"InternalError"),Vt(),Kt=o.BindingError=Ht(Error,"BindingError"),Mr(),vr(),Xr(),Wr=o.UnboundTypeError=Ht(Error,"UnboundTypeError"),sn(),o.requestFullscreen=function(e,t){bo.requestFullscreen(e,t)},o.requestFullScreen=function(){bo.requestFullScreen()},o.requestAnimationFrame=function(e){bo.requestAnimationFrame(e)},o.setCanvasSize=function(e,t,r){bo.setCanvasSize(e,t,r)},o.pauseMainLoop=function(){bo.mainLoop.pause()},o.resumeMainLoop=function(){bo.mainLoop.resume()},o.getUserMedia=function(){bo.getUserMedia()},o.createContext=function(e,t,r,n){return bo.createContext(e,t,r,n)};for(var Md=0;Md<32;++Md)fa.push(new Array(Md));var Fd=new Float32Array(288);for(Md=0;Md<288;++Md)yu[Md]=Fd.subarray(0,Md+1);var Ad=new Int32Array(288);for(Md=0;Md<288;++Md)bu[Md]=Ad.subarray(0,Md+1);function kd(e,t,r){var n=r>0?r:H(e)+1,o=new Array(n),i=j(e,o,0,o.length);return t&&(o.length=i),o}"function"==typeof atob&&atob;var Id,Cd={__assert_fail:rt,__cxa_allocate_exception:nt,__cxa_throw:it,__syscall_fcntl64:_t,__syscall_fstat64:bt,__syscall_fstatat64:wt,__syscall_getdents64:Tt,__syscall_ioctl:Ot,__syscall_lstat64:Dt,__syscall_open:Pt,__syscall_stat64:xt,_dlopen_js:St,_dlsym_js:Rt,_embind_finalize_value_array:Gt,_embind_finalize_value_object:Wt,_embind_register_bigint:tr,_embind_register_bool:nr,_embind_register_class:Yr,_embind_register_class_constructor:Kr,_embind_register_class_function:en,_embind_register_emval:un,_embind_register_enum:dn,_embind_register_enum_value:fn,_embind_register_float:gn,_embind_register_function:hn,_embind_register_integer:En,_embind_register_memory_view:yn,_embind_register_smart_ptr:vn,_embind_register_std_string:_n,_embind_register_std_wstring:bn,_embind_register_value_array:wn,_embind_register_value_array_element:Tn,_embind_register_value_object:On,_embind_register_value_object_field:Dn,_embind_register_void:Pn,_emscripten_throw_longjmp:xn,_emval_as:Sn,_emval_call:Mn,_emval_call_method:Cn,_emval_call_void_method:Un,_emval_decref:nn,_emval_get_global:jn,_emval_get_method_caller:Bn,_emval_get_property:Xn,_emval_incref:Qn,_emval_instanceof:Gn,_emval_is_number:qn,_emval_is_string:Wn,_emval_new:$n,_emval_new_array:Kn,_emval_new_cstring:Zn,_emval_new_object:Jn,_emval_run_destructors:eo,_emval_set_property:to,_emval_take_value:ro,_emval_throw:no,_gmtime_js:oo,_localtime_js:io,_mktime_js:ao,_mmap_js:so,_munmap_js:co,_tzset_js:lo,abort:po,clock_gettime:mo,eglChooseConfig:To,eglCreateContext:Fo,eglCreateWindowSurface:Ao,eglDestroyContext:ko,eglDestroySurface:Io,eglGetConfigAttrib:Co,eglGetDisplay:Uo,eglGetError:No,eglInitialize:jo,eglMakeCurrent:Lo,eglSwapBuffers:Ho,eglTerminate:Bo,emscripten_console_error:Xo,emscripten_console_log:Qo,emscripten_console_warn:Go,emscripten_debugger:qo,emscripten_get_heap_max:Wo,emscripten_get_now:Vn,emscripten_glActiveTexture:zo,emscripten_glAttachShader:Vo,emscripten_glBeginQuery:Yo,emscripten_glBeginQueryEXT:$o,emscripten_glBeginTransformFeedback:Ko,emscripten_glBindAttribLocation:Zo,emscripten_glBindBuffer:Jo,emscripten_glBindBufferBase:ei,emscripten_glBindBufferRange:ti,emscripten_glBindFramebuffer:ri,emscripten_glBindRenderbuffer:ni,emscripten_glBindSampler:oi,emscripten_glBindTexture:ii,emscripten_glBindTransformFeedback:ai,emscripten_glBindVertexArray:si,emscripten_glBindVertexArrayOES:ci,emscripten_glBlendColor:ui,emscripten_glBlendEquation:li,emscripten_glBlendEquationSeparate:di,emscripten_glBlendFunc:pi,emscripten_glBlendFuncSeparate:fi,emscripten_glBlitFramebuffer:mi,emscripten_glBufferData:gi,emscripten_glBufferSubData:hi,emscripten_glCheckFramebufferStatus:Ei,emscripten_glClear:yi,emscripten_glClearBufferfi:vi,emscripten_glClearBufferfv:_i,emscripten_glClearBufferiv:bi,emscripten_glClearBufferuiv:wi,emscripten_glClearColor:Ti,emscripten_glClearDepthf:Oi,emscripten_glClearStencil:Di,emscripten_glClientWaitSync:xi,emscripten_glColorMask:Si,emscripten_glCompileShader:Ri,emscripten_glCompressedTexImage2D:Mi,emscripten_glCompressedTexImage3D:Fi,emscripten_glCompressedTexSubImage2D:Ai,emscripten_glCompressedTexSubImage3D:ki,emscripten_glCopyBufferSubData:Ii,emscripten_glCopyTexImage2D:Ci,emscripten_glCopyTexSubImage2D:Ui,emscripten_glCopyTexSubImage3D:Ni,emscripten_glCreateProgram:ji,emscripten_glCreateShader:Li,emscripten_glCullFace:Hi,emscripten_glDeleteBuffers:Bi,emscripten_glDeleteFramebuffers:Xi,emscripten_glDeleteProgram:Qi,emscripten_glDeleteQueries:Gi,emscripten_glDeleteQueriesEXT:qi,emscripten_glDeleteRenderbuffers:Wi,emscripten_glDeleteSamplers:zi,emscripten_glDeleteShader:Vi,emscripten_glDeleteSync:Yi,emscripten_glDeleteTextures:$i,emscripten_glDeleteTransformFeedbacks:Ki,emscripten_glDeleteVertexArrays:Zi,emscripten_glDeleteVertexArraysOES:Ji,emscripten_glDepthFunc:ea,emscripten_glDepthMask:ta,emscripten_glDepthRangef:ra,emscripten_glDetachShader:na,emscripten_glDisable:oa,emscripten_glDisableVertexAttribArray:ia,emscripten_glDrawArrays:aa,emscripten_glDrawArraysInstanced:sa,emscripten_glDrawArraysInstancedANGLE:ca,emscripten_glDrawArraysInstancedARB:ua,emscripten_glDrawArraysInstancedBaseInstanceWEBGL:la,emscripten_glDrawArraysInstancedEXT:da,emscripten_glDrawArraysInstancedNV:pa,emscripten_glDrawBuffers:ma,emscripten_glDrawBuffersEXT:ga,emscripten_glDrawBuffersWEBGL:ha,emscripten_glDrawElements:Ea,emscripten_glDrawElementsInstanced:ya,emscripten_glDrawElementsInstancedANGLE:va,emscripten_glDrawElementsInstancedARB:_a,emscripten_glDrawElementsInstancedBaseVertexBaseInstanceWEBGL:ba,emscripten_glDrawElementsInstancedEXT:wa,emscripten_glDrawElementsInstancedNV:Ta,emscripten_glDrawRangeElements:Da,emscripten_glEnable:Pa,emscripten_glEnableVertexAttribArray:xa,emscripten_glEndQuery:Sa,emscripten_glEndQueryEXT:Ra,emscripten_glEndTransformFeedback:Ma,emscripten_glFenceSync:Fa,emscripten_glFinish:Aa,emscripten_glFlush:ka,emscripten_glFramebufferRenderbuffer:Ia,emscripten_glFramebufferTexture2D:Ca,emscripten_glFramebufferTextureLayer:Ua,emscripten_glFrontFace:Na,emscripten_glGenBuffers:La,emscripten_glGenFramebuffers:Ha,emscripten_glGenQueries:Ba,emscripten_glGenQueriesEXT:Xa,emscripten_glGenRenderbuffers:Qa,emscripten_glGenSamplers:Ga,emscripten_glGenTextures:qa,emscripten_glGenTransformFeedbacks:Wa,emscripten_glGenVertexArrays:za,emscripten_glGenVertexArraysOES:Va,emscripten_glGenerateMipmap:Ya,emscripten_glGetActiveAttrib:Ka,emscripten_glGetActiveUniform:Za,emscripten_glGetActiveUniformBlockName:Ja,emscripten_glGetActiveUniformBlockiv:es,emscripten_glGetActiveUniformsiv:ts,emscripten_glGetAttachedShaders:rs,emscripten_glGetAttribLocation:ns,emscripten_glGetBooleanv:cs,emscripten_glGetBufferParameteri64v:us,emscripten_glGetBufferParameteriv:ls,emscripten_glGetError:ds,emscripten_glGetFloatv:ps,emscripten_glGetFragDataLocation:fs,emscripten_glGetFramebufferAttachmentParameteriv:ms,emscripten_glGetInteger64i_v:hs,emscripten_glGetInteger64v:Es,emscripten_glGetIntegeri_v:ys,emscripten_glGetIntegerv:vs,emscripten_glGetInternalformativ:_s,emscripten_glGetProgramBinary:bs,emscripten_glGetProgramInfoLog:ws,emscripten_glGetProgramiv:Ts,emscripten_glGetQueryObjecti64vEXT:Os,emscripten_glGetQueryObjectivEXT:Ds,emscripten_glGetQueryObjectui64vEXT:Ps,emscripten_glGetQueryObjectuiv:xs,emscripten_glGetQueryObjectuivEXT:Ss,emscripten_glGetQueryiv:Rs,emscripten_glGetQueryivEXT:Ms,emscripten_glGetRenderbufferParameteriv:Fs,emscripten_glGetSamplerParameterfv:As,emscripten_glGetSamplerParameteriv:ks,emscripten_glGetShaderInfoLog:Is,emscripten_glGetShaderPrecisionFormat:Cs,emscripten_glGetShaderSource:Us,emscripten_glGetShaderiv:Ns,emscripten_glGetString:Ls,emscripten_glGetStringi:Hs,emscripten_glGetSynciv:Bs,emscripten_glGetTexParameterfv:Xs,emscripten_glGetTexParameteriv:Qs,emscripten_glGetTransformFeedbackVarying:Gs,emscripten_glGetUniformBlockIndex:qs,emscripten_glGetUniformIndices:Ws,emscripten_glGetUniformLocation:$s,emscripten_glGetUniformfv:Js,emscripten_glGetUniformiv:ec,emscripten_glGetUniformuiv:tc,emscripten_glGetVertexAttribIiv:nc,emscripten_glGetVertexAttribIuiv:oc,emscripten_glGetVertexAttribPointerv:ic,emscripten_glGetVertexAttribfv:ac,emscripten_glGetVertexAttribiv:sc,emscripten_glHint:cc,emscripten_glInvalidateFramebuffer:uc,emscripten_glInvalidateSubFramebuffer:lc,emscripten_glIsBuffer:dc,emscripten_glIsEnabled:pc,emscripten_glIsFramebuffer:fc,emscripten_glIsProgram:mc,emscripten_glIsQuery:gc,emscripten_glIsQueryEXT:hc,emscripten_glIsRenderbuffer:Ec,emscripten_glIsSampler:yc,emscripten_glIsShader:vc,emscripten_glIsSync:_c,emscripten_glIsTexture:bc,emscripten_glIsTransformFeedback:wc,emscripten_glIsVertexArray:Tc,emscripten_glIsVertexArrayOES:Oc,emscripten_glLineWidth:Dc,emscripten_glLinkProgram:Pc,emscripten_glMultiDrawArraysInstancedBaseInstanceWEBGL:xc,emscripten_glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL:Sc,emscripten_glPauseTransformFeedback:Rc,emscripten_glPixelStorei:Mc,emscripten_glPolygonOffset:Fc,emscripten_glProgramBinary:Ac,emscripten_glProgramParameteri:kc,emscripten_glQueryCounterEXT:Ic,emscripten_glReadBuffer:Cc,emscripten_glReadPixels:Bc,emscripten_glReleaseShaderCompiler:Xc,emscripten_glRenderbufferStorage:Qc,emscripten_glRenderbufferStorageMultisample:Gc,emscripten_glResumeTransformFeedback:qc,emscripten_glSampleCoverage:Wc,emscripten_glSamplerParameterf:zc,emscripten_glSamplerParameterfv:Vc,emscripten_glSamplerParameteri:Yc,emscripten_glSamplerParameteriv:$c,emscripten_glScissor:Kc,emscripten_glShaderBinary:Zc,emscripten_glShaderSource:Jc,emscripten_glStencilFunc:eu,emscripten_glStencilFuncSeparate:tu,emscripten_glStencilMask:ru,emscripten_glStencilMaskSeparate:nu,emscripten_glStencilOp:ou,emscripten_glStencilOpSeparate:iu,emscripten_glTexImage2D:au,emscripten_glTexImage3D:su,emscripten_glTexParameterf:cu,emscripten_glTexParameterfv:uu,emscripten_glTexParameteri:lu,emscripten_glTexParameteriv:du,emscripten_glTexStorage2D:pu,emscripten_glTexStorage3D:fu,emscripten_glTexSubImage2D:mu,emscripten_glTexSubImage3D:gu,emscripten_glTransformFeedbackVaryings:hu,emscripten_glUniform1f:Eu,emscripten_glUniform1fv:vu,emscripten_glUniform1i:_u,emscripten_glUniform1iv:wu,emscripten_glUniform1ui:Tu,emscripten_glUniform1uiv:Ou,emscripten_glUniform2f:Du,emscripten_glUniform2fv:Pu,emscripten_glUniform2i:xu,emscripten_glUniform2iv:Su,emscripten_glUniform2ui:Ru,emscripten_glUniform2uiv:Mu,emscripten_glUniform3f:Fu,emscripten_glUniform3fv:Au,emscripten_glUniform3i:ku,emscripten_glUniform3iv:Iu,emscripten_glUniform3ui:Cu,emscripten_glUniform3uiv:Uu,emscripten_glUniform4f:Nu,emscripten_glUniform4fv:ju,emscripten_glUniform4i:Lu,emscripten_glUniform4iv:Hu,emscripten_glUniform4ui:Bu,emscripten_glUniform4uiv:Xu,emscripten_glUniformBlockBinding:Qu,emscripten_glUniformMatrix2fv:Gu,emscripten_glUniformMatrix2x3fv:qu,emscripten_glUniformMatrix2x4fv:Wu,emscripten_glUniformMatrix3fv:zu,emscripten_glUniformMatrix3x2fv:Vu,emscripten_glUniformMatrix3x4fv:Yu,emscripten_glUniformMatrix4fv:$u,emscripten_glUniformMatrix4x2fv:Ku,emscripten_glUniformMatrix4x3fv:Zu,emscripten_glUseProgram:Ju,emscripten_glValidateProgram:el,emscripten_glVertexAttrib1f:tl,emscripten_glVertexAttrib1fv:rl,emscripten_glVertexAttrib2f:nl,emscripten_glVertexAttrib2fv:ol,emscripten_glVertexAttrib3f:il,emscripten_glVertexAttrib3fv:al,emscripten_glVertexAttrib4f:sl,emscripten_glVertexAttrib4fv:cl,emscripten_glVertexAttribDivisor:ul,emscripten_glVertexAttribDivisorANGLE:ll,emscripten_glVertexAttribDivisorARB:dl,emscripten_glVertexAttribDivisorEXT:pl,emscripten_glVertexAttribDivisorNV:fl,emscripten_glVertexAttribI4i:ml,emscripten_glVertexAttribI4iv:gl,emscripten_glVertexAttribI4ui:hl,emscripten_glVertexAttribI4uiv:El,emscripten_glVertexAttribIPointer:yl,emscripten_glVertexAttribPointer:vl,emscripten_glViewport:_l,emscripten_glWaitSync:bl,emscripten_memcpy_big:wl,emscripten_resize_heap:Ol,emscripten_ubq_codec_createDecoder:Dl,emscripten_ubq_codec_createEncoder:Pl,emscripten_ubq_codec_decodeSample:xl,emscripten_ubq_codec_destroyDecoder:Sl,emscripten_ubq_codec_destroyEncoder:Rl,emscripten_ubq_codec_encodeFrame:Ml,emscripten_ubq_codec_finalizeEncoding:Fl,emscripten_ubq_codec_flushDecoder:Al,emscripten_ubq_codec_getNumberOfDecodedFrames:kl,emscripten_ubq_codec_isSupported:Il,emscripten_ubq_codec_startProbing:Cl,emscripten_ubq_codec_stopProbing:Ul,emscripten_ubq_codec_testAndClearTextureUpdateFlag:Nl,emscripten_ubq_fetch_allocateFetchResult:jl,emscripten_ubq_fetch_createHeader:Ll,emscripten_ubq_fetch_deleteHeader:Hl,emscripten_ubq_fetch_dispatchAsyncFetch:Bl,emscripten_ubq_fetch_freeFetchResult:Xl,emscripten_ubq_fetch_getFetchCompletedBytes:Ql,emscripten_ubq_fetch_getFetchResultAddress:Gl,emscripten_ubq_fetch_getFetchResultLength:ql,emscripten_ubq_fetch_getFetchState:Wl,emscripten_ubq_fetch_getFetchTotalBytes:zl,emscripten_webgl_create_context:td,emscripten_webgl_destroy_context:rd,emscripten_webgl_init_context_attributes:nd,emscripten_webgl_make_context_current:od,environ_get:cd,environ_sizes_get:ud,exit:ho,fd_close:ld,fd_pread:dd,fd_read:pd,fd_seek:fd,fd_write:md,getTempRet0:gd,gettimeofday:hd,invoke_ii:Vd,invoke_iii:Yd,invoke_iiii:Kd,invoke_iiiii:np,invoke_iiiiii:ep,invoke_iiiiiii:rp,invoke_v:ap,invoke_vi:Zd,invoke_vii:Jd,invoke_viii:$d,invoke_viiii:tp,invoke_viiiii:op,invoke_viiiiii:sp,invoke_viiiiiiiii:ip,setTempRet0:Ed,strftime_l:Od,time:Dd},Ud=(Ye(),o.___wasm_call_ctors=We("__wasm_call_ctors"),o._malloc=We("malloc")),Nd=(o._main=We("main"),o._free=We("free")),jd=o.___errno_location=We("__errno_location"),Ld=(o._saveSetjmp=We("saveSetjmp"),o.___getTypeName=We("__getTypeName")),Hd=(o.___embind_register_native_and_builtin_types=We("__embind_register_native_and_builtin_types"),o.___stdio_exit=We("__stdio_exit")),Bd=(o.___dl_seterr=We("__dl_seterr"),o._emscripten_main_thread_process_queued_calls=We("emscripten_main_thread_process_queued_calls"),o._emscripten_builtin_memalign=We("emscripten_builtin_memalign")),Xd=o._setThrew=We("setThrew"),Qd=o._emscripten_stack_init=function(){return(Qd=o._emscripten_stack_init=o.asm.emscripten_stack_init).apply(null,arguments)},Gd=(o._emscripten_stack_get_free=function(){return(o._emscripten_stack_get_free=o.asm.emscripten_stack_get_free).apply(null,arguments)},o._emscripten_stack_get_base=function(){return(o._emscripten_stack_get_base=o.asm.emscripten_stack_get_base).apply(null,arguments)},o._emscripten_stack_get_end=function(){return(Gd=o._emscripten_stack_get_end=o.asm.emscripten_stack_get_end).apply(null,arguments)}),qd=o.stackSave=We("stackSave"),Wd=o.stackRestore=We("stackRestore"),zd=o.stackAlloc=We("stackAlloc");function Vd(e,t){var r=qd();try{return et(e)(t)}catch(e){if(Wd(r),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function Yd(e,t,r){var n=qd();try{return et(e)(t,r)}catch(e){if(Wd(n),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function $d(e,t,r,n){var o=qd();try{et(e)(t,r,n)}catch(e){if(Wd(o),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function Kd(e,t,r,n){var o=qd();try{return et(e)(t,r,n)}catch(e){if(Wd(o),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function Zd(e,t){var r=qd();try{et(e)(t)}catch(e){if(Wd(r),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function Jd(e,t,r){var n=qd();try{et(e)(t,r)}catch(e){if(Wd(n),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function ep(e,t,r,n,o,i){var a=qd();try{return et(e)(t,r,n,o,i)}catch(e){if(Wd(a),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function tp(e,t,r,n,o){var i=qd();try{et(e)(t,r,n,o)}catch(e){if(Wd(i),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function rp(e,t,r,n,o,i,a){var s=qd();try{return et(e)(t,r,n,o,i,a)}catch(e){if(Wd(s),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function np(e,t,r,n,o){var i=qd();try{return et(e)(t,r,n,o)}catch(e){if(Wd(i),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function op(e,t,r,n,o,i){var a=qd();try{et(e)(t,r,n,o,i)}catch(e){if(Wd(a),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function ip(e,t,r,n,o,i,a,s,c,u){var l=qd();try{et(e)(t,r,n,o,i,a,s,c,u)}catch(e){if(Wd(l),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function ap(e){var t=qd();try{et(e)()}catch(e){if(Wd(t),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function sp(e,t,r,n,o,i,a){var s=qd();try{et(e)(t,r,n,o,i,a)}catch(e){if(Wd(s),e!==e+0&&"longjmp"!==e)throw e;Xd(1,0)}}function cp(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function up(e){I(0==ke,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'),I(0==he.length,"cannot call main when preRun functions remain to be called");var t=o._main,r=(e=e||[]).length+1,n=zd(4*(r+1));W[n>>2]=ae(l);for(var i=1;i<r;i++)W[(n>>2)+i]=ae(e[i-1]);W[(n>>2)+r]=0;try{var a=t(r,n);return fp(a,!0),a}catch(e){return tt(e)}}function lp(){Qd(),me()}function dp(e){function r(){Id||(Id=!0,o.calledRun=!0,k||(Pe(),xe(),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),gp&&up(e),Re()))}e=e||u,ke>0||(lp(),De(),ke>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),r()}),1)):r(),ge()))}function pp(){var e=w,t=T,r=!1;w=T=e=>{r=!0};try{Hd(),["stdout","stderr"].forEach((function(e){var t=yt.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=lt.ttys[n];o&&o.output&&o.output.length&&(r=!0)}}))}catch(e){}w=e,T=t,r&&O("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}function fp(e,t){if(A=e,Te||pp(),Oe()){if(!t){var r="program exited (with status: "+e+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";n(r),T(r)}}else Se();mp(e)}function mp(e){A=e,Oe()||(o.onExit&&o.onExit(e),k=!0),d(e,new cp(e))}if(Object.getOwnPropertyDescriptor(o,"intArrayFromString")||(o.intArrayFromString=()=>He("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"intArrayToString")||(o.intArrayToString=()=>He("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ccall")||(o.ccall=()=>He("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"cwrap")||(o.cwrap=()=>He("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setValue")||(o.setValue=()=>He("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.getValue=F,Object.getOwnPropertyDescriptor(o,"allocate")||(o.allocate=()=>He("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF8ArrayToString")||(o.UTF8ArrayToString=()=>He("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.UTF8ToString=N,Object.getOwnPropertyDescriptor(o,"stringToUTF8Array")||(o.stringToUTF8Array=()=>He("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF8")||(o.stringToUTF8=()=>He("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF8")||(o.lengthBytesUTF8=()=>He("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=()=>He("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPreRun")||(o.addOnPreRun=()=>He("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnInit")||(o.addOnInit=()=>He("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPreMain")||(o.addOnPreMain=()=>He("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnExit")||(o.addOnExit=()=>He("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPostRun")||(o.addOnPostRun=()=>He("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeStringToMemory")||(o.writeStringToMemory=()=>He("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeArrayToMemory")||(o.writeArrayToMemory=()=>He("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeAsciiToMemory")||(o.writeAsciiToMemory=()=>He("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.addRunDependency=je,o.removeRunDependency=Le,Object.getOwnPropertyDescriptor(o,"FS_createFolder")||(o.FS_createFolder=()=>He("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.FS_createPath=yt.createPath,o.FS_createDataFile=yt.createDataFile,o.FS_createPreloadedFile=yt.createPreloadedFile,o.FS_createLazyFile=yt.createLazyFile,Object.getOwnPropertyDescriptor(o,"FS_createLink")||(o.FS_createLink=()=>He("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.FS_createDevice=yt.createDevice,o.FS_unlink=yt.unlink,Object.getOwnPropertyDescriptor(o,"getLEB")||(o.getLEB=()=>He("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFunctionTables")||(o.getFunctionTables=()=>He("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"alignFunctionTables")||(o.alignFunctionTables=()=>He("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFunctions")||(o.registerFunctions=()=>He("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addFunction")||(o.addFunction=()=>He("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"removeFunction")||(o.removeFunction=()=>He("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=()=>He("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"prettyPrint")||(o.prettyPrint=()=>He("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=()=>He("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getCompilerSetting")||(o.getCompilerSetting=()=>He("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"print")||(o.print=()=>He("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"printErr")||(o.printErr=()=>He("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getTempRet0")||(o.getTempRet0=()=>He("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setTempRet0")||(o.setTempRet0=()=>He("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callMain")||(o.callMain=()=>He("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"abort")||(o.abort=()=>He("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"keepRuntimeAlive")||(o.keepRuntimeAlive=()=>He("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"zeroMemory")||(o.zeroMemory=()=>He("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToNewUTF8")||(o.stringToNewUTF8=()=>He("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscripten_realloc_buffer")||(o.emscripten_realloc_buffer=()=>He("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ENV")||(o.ENV=()=>He("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"withStackSave")||(o.withStackSave=()=>He("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ERRNO_CODES")||(o.ERRNO_CODES=()=>He("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ERRNO_MESSAGES")||(o.ERRNO_MESSAGES=()=>He("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setErrNo")||(o.setErrNo=()=>He("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetPton4")||(o.inetPton4=()=>He("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetNtop4")||(o.inetNtop4=()=>He("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetPton6")||(o.inetPton6=()=>He("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetNtop6")||(o.inetNtop6=()=>He("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readSockaddr")||(o.readSockaddr=()=>He("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeSockaddr")||(o.writeSockaddr=()=>He("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"DNS")||(o.DNS=()=>He("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getHostByName")||(o.getHostByName=()=>He("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Protocols")||(o.Protocols=()=>He("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Sockets")||(o.Sockets=()=>He("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getRandomDevice")||(o.getRandomDevice=()=>He("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"traverseStack")||(o.traverseStack=()=>He("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertFrameToPC")||(o.convertFrameToPC=()=>He("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UNWIND_CACHE")||(o.UNWIND_CACHE=()=>He("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"saveInUnwindCache")||(o.saveInUnwindCache=()=>He("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertPCtoSourceLocation")||(o.convertPCtoSourceLocation=()=>He("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readAsmConstArgsArray")||(o.readAsmConstArgsArray=()=>He("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readAsmConstArgs")||(o.readAsmConstArgs=()=>He("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"mainThreadEM_ASM")||(o.mainThreadEM_ASM=()=>He("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jstoi_q")||(o.jstoi_q=()=>He("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jstoi_s")||(o.jstoi_s=()=>He("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getExecutableName")||(o.getExecutableName=()=>He("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"listenOnce")||(o.listenOnce=()=>He("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"autoResumeAudioContext")||(o.autoResumeAudioContext=()=>He("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=()=>He("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callRuntimeCallbacks")||(o.callRuntimeCallbacks=()=>He("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"wasmTableMirror")||(o.wasmTableMirror=()=>He("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setWasmTableEntry")||(o.setWasmTableEntry=()=>He("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getWasmTableEntry")||(o.getWasmTableEntry=()=>He("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"handleException")||(o.handleException=()=>He("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runtimeKeepalivePush")||(o.runtimeKeepalivePush=()=>He("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runtimeKeepalivePop")||(o.runtimeKeepalivePop=()=>He("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callUserCallback")||(o.callUserCallback=()=>He("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"maybeExit")||(o.maybeExit=()=>He("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"safeSetTimeout")||(o.safeSetTimeout=()=>He("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"asmjsMangle")||(o.asmjsMangle=()=>He("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"asyncLoad")||(o.asyncLoad=()=>He("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"alignMemory")||(o.alignMemory=()=>He("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"mmapAlloc")||(o.mmapAlloc=()=>He("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"reallyNegative")||(o.reallyNegative=()=>He("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"unSign")||(o.unSign=()=>He("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"reSign")||(o.reSign=()=>He("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"formatString")||(o.formatString=()=>He("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PATH")||(o.PATH=()=>He("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PATH_FS")||(o.PATH_FS=()=>He("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SYSCALLS")||(o.SYSCALLS=()=>He("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getSocketFromFD")||(o.getSocketFromFD=()=>He("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getSocketAddress")||(o.getSocketAddress=()=>He("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"JSEvents")||(o.JSEvents=()=>He("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerKeyEventCallback")||(o.registerKeyEventCallback=()=>He("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.specialHTMLTargets=Kl,Object.getOwnPropertyDescriptor(o,"maybeCStringToJsString")||(o.maybeCStringToJsString=()=>He("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"findEventTarget")||(o.findEventTarget=()=>He("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"findCanvasEventTarget")||(o.findCanvasEventTarget=()=>He("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getBoundingClientRect")||(o.getBoundingClientRect=()=>He("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillMouseEventData")||(o.fillMouseEventData=()=>He("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerMouseEventCallback")||(o.registerMouseEventCallback=()=>He("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerWheelEventCallback")||(o.registerWheelEventCallback=()=>He("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerUiEventCallback")||(o.registerUiEventCallback=()=>He("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFocusEventCallback")||(o.registerFocusEventCallback=()=>He("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillDeviceOrientationEventData")||(o.fillDeviceOrientationEventData=()=>He("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerDeviceOrientationEventCallback")||(o.registerDeviceOrientationEventCallback=()=>He("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillDeviceMotionEventData")||(o.fillDeviceMotionEventData=()=>He("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerDeviceMotionEventCallback")||(o.registerDeviceMotionEventCallback=()=>He("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"screenOrientation")||(o.screenOrientation=()=>He("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillOrientationChangeEventData")||(o.fillOrientationChangeEventData=()=>He("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerOrientationChangeEventCallback")||(o.registerOrientationChangeEventCallback=()=>He("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillFullscreenChangeEventData")||(o.fillFullscreenChangeEventData=()=>He("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFullscreenChangeEventCallback")||(o.registerFullscreenChangeEventCallback=()=>He("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerRestoreOldStyle")||(o.registerRestoreOldStyle=()=>He("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"hideEverythingExceptGivenElement")||(o.hideEverythingExceptGivenElement=()=>He("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"restoreHiddenElements")||(o.restoreHiddenElements=()=>He("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setLetterbox")||(o.setLetterbox=()=>He("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"currentFullscreenStrategy")||(o.currentFullscreenStrategy=()=>He("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"restoreOldWindowedStyle")||(o.restoreOldWindowedStyle=()=>He("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"softFullscreenResizeWebGLRenderTarget")||(o.softFullscreenResizeWebGLRenderTarget=()=>He("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"doRequestFullscreen")||(o.doRequestFullscreen=()=>He("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillPointerlockChangeEventData")||(o.fillPointerlockChangeEventData=()=>He("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerPointerlockChangeEventCallback")||(o.registerPointerlockChangeEventCallback=()=>He("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerPointerlockErrorEventCallback")||(o.registerPointerlockErrorEventCallback=()=>He("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"requestPointerLock")||(o.requestPointerLock=()=>He("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillVisibilityChangeEventData")||(o.fillVisibilityChangeEventData=()=>He("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerVisibilityChangeEventCallback")||(o.registerVisibilityChangeEventCallback=()=>He("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerTouchEventCallback")||(o.registerTouchEventCallback=()=>He("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillGamepadEventData")||(o.fillGamepadEventData=()=>He("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerGamepadEventCallback")||(o.registerGamepadEventCallback=()=>He("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerBeforeUnloadEventCallback")||(o.registerBeforeUnloadEventCallback=()=>He("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillBatteryEventData")||(o.fillBatteryEventData=()=>He("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"battery")||(o.battery=()=>He("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerBatteryEventCallback")||(o.registerBatteryEventCallback=()=>He("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setCanvasElementSize")||(o.setCanvasElementSize=()=>He("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getCanvasElementSize")||(o.getCanvasElementSize=()=>He("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"demangle")||(o.demangle=()=>He("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"demangleAll")||(o.demangleAll=()=>He("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jsStackTrace")||(o.jsStackTrace=()=>He("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=()=>He("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getEnvStrings")||(o.getEnvStrings=()=>He("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"checkWasiClock")||(o.checkWasiClock=()=>He("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64")||(o.writeI53ToI64=()=>He("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64Clamped")||(o.writeI53ToI64Clamped=()=>He("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64Signaling")||(o.writeI53ToI64Signaling=()=>He("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToU64Clamped")||(o.writeI53ToU64Clamped=()=>He("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToU64Signaling")||(o.writeI53ToU64Signaling=()=>He("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readI53FromI64")||(o.readI53FromI64=()=>He("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readI53FromU64")||(o.readI53FromU64=()=>He("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertI32PairToI53")||(o.convertI32PairToI53=()=>He("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertU32PairToI53")||(o.convertU32PairToI53=()=>He("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setImmediateWrapped")||(o.setImmediateWrapped=()=>He("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"clearImmediateWrapped")||(o.clearImmediateWrapped=()=>He("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"polyfillSetImmediate")||(o.polyfillSetImmediate=()=>He("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"uncaughtExceptionCount")||(o.uncaughtExceptionCount=()=>He("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exceptionLast")||(o.exceptionLast=()=>He("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exceptionCaught")||(o.exceptionCaught=()=>He("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ExceptionInfo")||(o.ExceptionInfo=()=>He("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"CatchInfo")||(o.CatchInfo=()=>He("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exception_addRef")||(o.exception_addRef=()=>He("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exception_decRef")||(o.exception_decRef=()=>He("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Browser")||(o.Browser=()=>He("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"funcWrappers")||(o.funcWrappers=()=>He("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=()=>He("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setMainLoop")||(o.setMainLoop=()=>He("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"wget")||(o.wget=()=>He("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS")||(o.FS=()=>He("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"MEMFS")||(o.MEMFS=()=>He("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"TTY")||(o.TTY=()=>He("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PIPEFS")||(o.PIPEFS=()=>He("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SOCKFS")||(o.SOCKFS=()=>He("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"_setNetworkCallback")||(o._setNetworkCallback=()=>He("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"tempFixedLengthArray")||(o.tempFixedLengthArray=()=>He("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"miniTempWebGLFloatBuffers")||(o.miniTempWebGLFloatBuffers=()=>He("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heapObjectForWebGLType")||(o.heapObjectForWebGLType=()=>He("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heapAccessShiftForWebGLHeap")||(o.heapAccessShiftForWebGLHeap=()=>He("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GL")||(o.GL=()=>He("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGet")||(o.emscriptenWebGLGet=()=>He("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"computeUnpackAlignedImageSize")||(o.computeUnpackAlignedImageSize=()=>He("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetTexPixelData")||(o.emscriptenWebGLGetTexPixelData=()=>He("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetUniform")||(o.emscriptenWebGLGetUniform=()=>He("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglGetUniformLocation")||(o.webglGetUniformLocation=()=>He("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglPrepareUniformLocationsBeforeFirstUse")||(o.webglPrepareUniformLocationsBeforeFirstUse=()=>He("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglGetLeftBracePos")||(o.webglGetLeftBracePos=()=>He("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetVertexAttrib")||(o.emscriptenWebGLGetVertexAttrib=()=>He("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeGLArray")||(o.writeGLArray=()=>He("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"AL")||(o.AL=()=>He("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_unicode")||(o.SDL_unicode=()=>He("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_ttfContext")||(o.SDL_ttfContext=()=>He("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_audio")||(o.SDL_audio=()=>He("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL")||(o.SDL=()=>He("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_gfx")||(o.SDL_gfx=()=>He("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLUT")||(o.GLUT=()=>He("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"EGL")||(o.EGL=()=>He("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLFW_Window")||(o.GLFW_Window=()=>He("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLFW")||(o.GLFW=()=>He("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLEW")||(o.GLEW=()=>He("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"IDBStore")||(o.IDBStore=()=>He("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runAndAbortIfError")||(o.runAndAbortIfError=()=>He("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetIndexed")||(o.emscriptenWebGLGetIndexed=()=>He("'emscriptenWebGLGetIndexed' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"InternalError")||(o.InternalError=()=>He("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"BindingError")||(o.BindingError=()=>He("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UnboundTypeError")||(o.UnboundTypeError=()=>He("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PureVirtualError")||(o.PureVirtualError=()=>He("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_embind")||(o.init_embind=()=>He("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwInternalError")||(o.throwInternalError=()=>He("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwBindingError")||(o.throwBindingError=()=>He("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwUnboundTypeError")||(o.throwUnboundTypeError=()=>He("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ensureOverloadTable")||(o.ensureOverloadTable=()=>He("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exposePublicSymbol")||(o.exposePublicSymbol=()=>He("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"replacePublicSymbol")||(o.replacePublicSymbol=()=>He("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"extendError")||(o.extendError=()=>He("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"createNamedFunction")||(o.createNamedFunction=()=>He("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredInstances")||(o.registeredInstances=()=>He("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getBasestPointer")||(o.getBasestPointer=()=>He("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerInheritedInstance")||(o.registerInheritedInstance=()=>He("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"unregisterInheritedInstance")||(o.unregisterInheritedInstance=()=>He("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getInheritedInstance")||(o.getInheritedInstance=()=>He("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getInheritedInstanceCount")||(o.getInheritedInstanceCount=()=>He("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getLiveInheritedInstances")||(o.getLiveInheritedInstances=()=>He("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredTypes")||(o.registeredTypes=()=>He("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"awaitingDependencies")||(o.awaitingDependencies=()=>He("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"typeDependencies")||(o.typeDependencies=()=>He("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredPointers")||(o.registeredPointers=()=>He("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerType")||(o.registerType=()=>He("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"whenDependentTypesAreResolved")||(o.whenDependentTypesAreResolved=()=>He("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind_charCodes")||(o.embind_charCodes=()=>He("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind_init_charCodes")||(o.embind_init_charCodes=()=>He("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readLatin1String")||(o.readLatin1String=()=>He("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getTypeName")||(o.getTypeName=()=>He("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heap32VectorToArray")||(o.heap32VectorToArray=()=>He("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"requireRegisteredType")||(o.requireRegisteredType=()=>He("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getShiftFromSize")||(o.getShiftFromSize=()=>He("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"integerReadValueFromPointer")||(o.integerReadValueFromPointer=()=>He("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"enumReadValueFromPointer")||(o.enumReadValueFromPointer=()=>He("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"floatReadValueFromPointer")||(o.floatReadValueFromPointer=()=>He("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"simpleReadValueFromPointer")||(o.simpleReadValueFromPointer=()=>He("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runDestructors")||(o.runDestructors=()=>He("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"new_")||(o.new_=()=>He("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"craftInvokerFunction")||(o.craftInvokerFunction=()=>He("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind__requireFunction")||(o.embind__requireFunction=()=>He("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"tupleRegistrations")||(o.tupleRegistrations=()=>He("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"structRegistrations")||(o.structRegistrations=()=>He("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"genericPointerToWireType")||(o.genericPointerToWireType=()=>He("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"constNoSmartPtrRawPointerToWireType")||(o.constNoSmartPtrRawPointerToWireType=()=>He("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"nonConstNoSmartPtrRawPointerToWireType")||(o.nonConstNoSmartPtrRawPointerToWireType=()=>He("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_RegisteredPointer")||(o.init_RegisteredPointer=()=>He("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer")||(o.RegisteredPointer=()=>He("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_getPointee")||(o.RegisteredPointer_getPointee=()=>He("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_destructor")||(o.RegisteredPointer_destructor=()=>He("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_deleteObject")||(o.RegisteredPointer_deleteObject=()=>He("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_fromWireType")||(o.RegisteredPointer_fromWireType=()=>He("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runDestructor")||(o.runDestructor=()=>He("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"releaseClassHandle")||(o.releaseClassHandle=()=>He("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"finalizationRegistry")||(o.finalizationRegistry=()=>He("'finalizationRegistry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"detachFinalizer_deps")||(o.detachFinalizer_deps=()=>He("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"detachFinalizer")||(o.detachFinalizer=()=>He("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"attachFinalizer")||(o.attachFinalizer=()=>He("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"makeClassHandle")||(o.makeClassHandle=()=>He("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_ClassHandle")||(o.init_ClassHandle=()=>He("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle")||(o.ClassHandle=()=>He("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_isAliasOf")||(o.ClassHandle_isAliasOf=()=>He("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwInstanceAlreadyDeleted")||(o.throwInstanceAlreadyDeleted=()=>He("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_clone")||(o.ClassHandle_clone=()=>He("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_delete")||(o.ClassHandle_delete=()=>He("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"deletionQueue")||(o.deletionQueue=()=>He("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_isDeleted")||(o.ClassHandle_isDeleted=()=>He("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_deleteLater")||(o.ClassHandle_deleteLater=()=>He("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"flushPendingDeletes")||(o.flushPendingDeletes=()=>He("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"delayFunction")||(o.delayFunction=()=>He("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setDelayFunction")||(o.setDelayFunction=()=>He("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredClass")||(o.RegisteredClass=()=>He("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"shallowCopyInternalPointer")||(o.shallowCopyInternalPointer=()=>He("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"downcastPointer")||(o.downcastPointer=()=>He("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"upcastPointer")||(o.upcastPointer=()=>He("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"validateThis")||(o.validateThis=()=>He("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"char_0")||(o.char_0=()=>He("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"char_9")||(o.char_9=()=>He("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"makeLegalFunctionName")||(o.makeLegalFunctionName=()=>He("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_handle_array")||(o.emval_handle_array=()=>He("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_free_list")||(o.emval_free_list=()=>He("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_symbols")||(o.emval_symbols=()=>He("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_emval")||(o.init_emval=()=>He("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"count_emval_handles")||(o.count_emval_handles=()=>He("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"get_first_emval")||(o.get_first_emval=()=>He("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getStringOrSymbol")||(o.getStringOrSymbol=()=>He("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Emval")||(o.Emval=()=>He("'Emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_newers")||(o.emval_newers=()=>He("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"craftEmvalAllocator")||(o.craftEmvalAllocator=()=>He("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_get_global")||(o.emval_get_global=()=>He("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_methodCallers")||(o.emval_methodCallers=()=>He("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_registeredMethods")||(o.emval_registeredMethods=()=>He("'emval_registeredMethods' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"warnOnce")||(o.warnOnce=()=>He("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackSave")||(o.stackSave=()=>He("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackRestore")||(o.stackRestore=()=>He("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackAlloc")||(o.stackAlloc=()=>He("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"AsciiToString")||(o.AsciiToString=()=>He("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToAscii")||(o.stringToAscii=()=>He("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF16ToString")||(o.UTF16ToString=()=>He("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF16")||(o.stringToUTF16=()=>He("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF16")||(o.lengthBytesUTF16=()=>He("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF32ToString")||(o.UTF32ToString=()=>He("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF32")||(o.stringToUTF32=()=>He("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF32")||(o.lengthBytesUTF32=()=>He("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocateUTF8")||(o.allocateUTF8=()=>He("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocateUTF8OnStack")||(o.allocateUTF8OnStack=()=>He("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.writeStackCookie=me,o.checkStackCookie=ge,Object.getOwnPropertyDescriptor(o,"ALLOC_NORMAL")||Object.defineProperty(o,"ALLOC_NORMAL",{configurable:!0,get:function(){He("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_STACK")||Object.defineProperty(o,"ALLOC_STACK",{configurable:!0,get:function(){He("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Ce=function e(){Id||dp(),Id||(Ce=e)},o.run=dp,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var gp=!0;return o.noInitialRun&&(gp=!1),dp(),e.ready});const qe=Ge;var We=r(2934),ze=r(7984);const Ve=qe,Ye=(e,t)=>null!=t?[t,e.split("/").pop()].join(""):new URL(e,window.location.origin);var $e,Ke,Ze=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Je=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class et{constructor(e){$e.set(this,void 0),Ke.set(this,void 0),Ze(this,$e,e,"f"),Ze(this,Ke,new C(e),"f")}async loadFromString(e){return ue("sceneContent",e,ie()),new Promise((t=>{Je(this,$e,"f").loadSceneFromString(e,(e=>{const r=U(e);t(r)}))}))}async loadFromURL(e){return ue("url",e,ie()),new Promise((t=>{Je(this,$e,"f").loadSceneFromURL(e,(e=>{const r=U(e);t(r)}))}))}async saveToString(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Je(this,$e,"f").saveSceneToString(r,(t=>{const r=U(t);e(r)}))}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Je(this,$e,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new Blob([r],{type:pe.Zip}))}))}))}create(){return U(Je(this,$e,"f").createScene({layout:g.Free}))}createFromImage(e,t=300,r=1){return ue("url",e,ie()),ue("dpi",t,ae(oe(),0)),ue("pixelScaleFactor",r,ae(oe(),0)),new Promise((n=>{Je(this,$e,"f").createSceneFromImage(e,t,r,g.Free,0,!1,(e=>{const t=U(e);n(t)}))}))}get(){const e=U(Je(this,$e,"f").findByType(O.Scene)),t=ge(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return ue("content",e,ie()),new Promise((t=>{Je(this,$e,"f").applyTemplateFromString(e,(e=>{U(e),t()}))}))}async applyTemplateFromURL(e){return ue("url",e,ie()),new Promise((t=>{Je(this,$e,"f").applyTemplateFromURL(e,(e=>{U(e),t()}))}))}unstable_setDesignUnit(e){ue("designUnit",e,ie()),U(Je(this,$e,"f").unstable_setDesignUnit(R.fromDesignUnit(e)))}unstable_getDesignUnit(){return R.toDesignUnit(U(Je(this,$e,"f").unstable_getDesignUnit()))}}function tt(e,t){var r,n;const o=null==e?void 0:e.getBoundingClientRect(),i=null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0,a=null!==(n=null==o?void 0:o.left)&&void 0!==n?n:0,s=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(t),c=s?t.changedTouches[0].clientX:t.clientX,u=s?t.changedTouches[0].clientY:t.clientY;return{position:{x:(c-a)*window.devicePixelRatio,y:(u-i)*window.devicePixelRatio},isOverUIElement:!1,isTouch:s,timestamp:Date.now()}}$e=new WeakMap,Ke=new WeakMap;var rt,nt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class ot{constructor(e){rt.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,rt,e,"f")}findAll(){return ge(nt(this,rt,"f").findAllVariables())}setString(e,t){return ue("key",e,ie()),ue("value",t,ie()),U(nt(this,rt,"f").setVariableString(e,t))}getString(e){return ue("key",e,ie()),U(nt(this,rt,"f").getVariableString(e))}remove(e){return ue("key",e,ie()),U(nt(this,rt,"f").removeVariable(e))}}rt=new WeakMap;var it,at,st,ct,ut,lt,dt,pt,ft,mt,gt=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},ht=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Et{constructor(e,r,n){it.add(this),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scene",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"variable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_assetRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),at.set(this,void 0),st.set(this,void 0),ct.set(this,void 0),ut.set(this,(()=>{const e=this.block.findByType(O.Camera)[0];if(!e)return;if(void 0===ht(this,st,"f"))return;const{width:t,height:r}=ht(this,st,"f"),n=ht(this,at,"f").getValue(e,me.Camera,"resolution");I(n.width,t,1e-4)&&I(n.height,r,1e-4)||ht(this,at,"f").setValue(e,me.Camera,"resolution",{width:t,height:r}),"undefined"!=typeof window&&(I(ht(this,at,"f").getValue(e,me.Camera,"pixelRatio"),window.devicePixelRatio,1e-4)||ht(this,at,"f").setValue(e,me.Camera,"pixelRatio",window.devicePixelRatio))})),lt.set(this,void 0),dt.set(this,void 0),gt(this,ct,e,"f"),gt(this,at,new C(e),"f"),gt(this,st,r,"f"),this.block=new _e(e),this.scene=new et(e),this.variable=new ot(e),this.editor=new Le(e),this.event=new Xe(e),this.unstable_assetRegistry=new class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:"ly.img.AssetRegistry"}),Object.defineProperty(this,"assetSources",{enumerable:!0,configurable:!0,writable:!0,value:[]})}async getGroups(e){return(await Promise.all(this.assetSources.map((t=>t.getGroups(e))))).reduce(((e,t)=>(e.push(...t),e)),[])}getTypes(){return this.assetSources.reduce(((e,t)=>{const r=t.getTypes();return e.push(...r),e}),[])}hasType(e){return this.assetSources.some((t=>t.hasType(e)))}getSources(e){return e?this.assetSources.filter((t=>t.hasType(e))):this.assetSources}getSource(e){return this.assetSources.find((t=>t.id===e))}addSource(e){this.assetSources.push(e)}removeSource(e){const t=this.assetSources.findIndex((t=>t.id===e));return t>=0&&(this.assetSources.splice(t,1),!0)}},this.unstable_assetRegistry.addSource(new class{constructor(e,t,r={}){var n,o,i,a;N.add(this),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"canManageAssets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"helper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),j.set(this,void 0),L.set(this,void 0),H.set(this,void 0),B.set(this,void 0),this.id=e,this.helper=new C(t),this.canManageAssets=null!==(n=r.canManageAssets)&&void 0!==n&&n,G(this,j,null!==(o=r.hasType)&&void 0!==o?o:()=>!1,"f"),G(this,L,null!==(i=r.getLabel)&&void 0!==i?i:(e,t)=>t,"f"),G(this,H,null!==(a=r.getTags)&&void 0!==a?a:()=>[],"f"),G(this,B,r.defaultFont,"f")}getAsset(){throw new Error("Method not implemented.")}addAsset(){throw new Error("Method not implemented.")}updateAsset(){throw new Error("Method not implemented.")}removeAsset(){throw new Error("Method not implemented.")}getTypes(){throw new Error("Method not implemented")}async findAssets(e,t){const r=await this.getAssets(e,t),n=this.filterAssets(r,t),o=n.length,i=t.page,a=this.sliceAssets(n,t);return{assets:a,total:o,currentPage:i,nextPage:(t.page-1)*t.perPage+a.length<o?i+1:void 0}}getGroups(e){return this.helper.execute("ubq/assets/getRegisteredCategoryIDsForType",e)}hasType(e){return"ly.img.text"===e||"ly.img.video"===e||q(this,j,"f").call(this,e)}async getAssetIds(e,{groups:t,excludeGroups:r}){let n=[];if(t&&Array.isArray(t)&&t.length>0)n=await this.getAssetIdsForGroups(e,t,r);else{const t=await this.helper.execute("ubq/assets/getRegisteredAssetIDsForType",e),o=await this.getGroups(e);n=await(o.length>0?this.getAssetIdsForGroups(e,o,r,t):t)}return n}async getAssets(e,t){if("ly.img.text"===e)return async function(e,t,r,n=(e=>e)){return async function(e,t,r){var n,o;let i=[];const a=null!==(n=Object.values(await async function(){const e={},r=await t.execute("ubq/assets/getRegisteredAssetIDsForType","ly.img.font");return await Promise.all(r.map((async r=>{var n;const o=await t.execute("ubq/assets/getMetadata",[r,"fontFamily"]);(null!==(n=e[o])&&void 0!==n?n:e[o]=[]).push({assetId:r})}))),e}()).find((e=>(e.length>i.length&&(i=e),e.some((e=>e.assetId===r))))))&&void 0!==n?n:i,s=null!==(o=a.find((e=>e.assetId===r)))&&void 0!==o?o:a[0];if(void 0===s)return e;await async function(e){await Promise.all([...e.map((e=>t.execute("ubq/assets/getMetadata",[e.assetId,"fontWeight"]).then((t=>{e.fontWeight=t})))),...e.map((e=>t.execute("ubq/assets/getMetadata",[e.assetId,"fontStyle"]).then((t=>{e.fontStyle=t}))))])}(a);const c=a.filter((e=>e.fontStyle===s.fontStyle));if(0===c.length)return e;const u=await Promise.all(e.map((async e=>{var r,n,o;const i=null===(o=(Array.isArray(null===(r=e.meta)||void 0===r?void 0:r.fontWeight)?null===(n=e.meta)||void 0===n?void 0:n.fontWeight:[]).map((e=>c.find((t=>t.fontWeight===e)))).filter(Boolean)[0])||void 0===o?void 0:o.assetId,a=null!=i?i:null==s?void 0:s.assetId,u=await t.execute("ubq/assets/getMetadata",[a,"fontFileUri"]);return Object.assign(Object.assign({},e),{meta:Object.assign(Object.assign({},e.meta),{fontId:a,uri:u})})})));return u}([{id:"title",type:"ly.img.text",label:n("title"),thumbUri:"",size:{width:1,height:1},meta:{fontScale:2,fontWeight:[700,800,900,600,500]},context:t},{id:"headline",type:"ly.img.text",label:n("headline"),thumbUri:"",size:{width:1,height:1},meta:{fontScale:1.4,fontWeight:[500,600,700]},context:t},{id:"paragraph",type:"ly.img.text",label:n("paragraph"),thumbUri:"",size:{width:1,height:1},meta:{fontScale:1,fontWeight:[400,300,500]},context:t}],e,r)}(this.helper,{sourceId:this.id},q(this,B,"f"),(e=>q(this,L,"f").call(this,"ly.img.text",e)));if("ly.img.vectorpath"===e){let r=[];t.groups&&t.groups.includes("//ly.img.cesdk.vectorpaths/category/vectorpaths")&&(r=await async function(e,t=(e=>e)){return[O.RectShape,O.LineShape,O.StarShape,O.PolygonShape,O.EllipseShape].map((r=>({id:r,type:"ly.img.vectorpath",label:t(r),thumbUri:"",size:{width:1,height:1},context:e})))}({sourceId:this.id},(e=>q(this,L,"f").call(this,"ly.img.vectorpath",e))));const n=await this.getGenericAssets(e,t);return[...r,...n]}return this.getGenericAssets(e,t)}async getGenericAssets(e,t){const{groups:r,locale:n}=t,o=await this.getAssetIds(e,t);return await Promise.all(o.map((async t=>{const{thumbUri:o,size:i,meta:a}=await this.getAssetMetaData(t,e),s=q(this,L,"f").call(this,e,t),c=q(this,H,"f").call(this,e,t);return{id:t,type:e,groups:r,thumbUri:o,size:i,meta:a,locale:n,label:s,tags:c,context:{sourceId:this.id}}})))}async getAssetMetaData(e,t){const[r,n,o,i,a,s,c]=await Promise.all([q(this,N,"m",X).call(this,e,"thumbPath"),q(this,N,"m",X).call(this,e,"width"),q(this,N,"m",X).call(this,e,"height"),"ly.img.vectorpath"===t?q(this,N,"m",X).call(this,e,"vectorPath"):Promise.resolve(""),"ly.img.image"===t?q(this,N,"m",X).call(this,e,"imagePath"):Promise.resolve(void 0),"ly.img.video"===t?q(this,N,"m",X).call(this,e,"videoPath"):Promise.resolve(void 0),"ly.img.sticker"===t?q(this,N,"m",X).call(this,e,"imageUri"):Promise.resolve(void 0)]),u=U(this.helper.ubq.getAbsoluteURI(r));return i?{thumbUri:u,size:{width:n,height:o},meta:{vectorPath:i}}:{thumbUri:u,size:{width:n,height:o},meta:{uri:a||c||s}}}filterAssets(e,t){const{query:r}=t;if(!r)return e;const n=_()(r.toLowerCase());return r?e.filter((e=>{if(e.label||e.tags){const t=[e.label||"",e.tags||""].join(",").toLowerCase();return n.every((e=>t.match(e)))}if(e.id){const t=e.id.toLowerCase();return n.every((e=>t.match(e)))}return!0})):e}sliceAssets(e,{page:t,perPage:r}){const n=((null!=t?t:1)-1)*r;return e.slice(n,n+r)}async getAssetIdsForGroups(e,t,r=[],n=[]){const o={},i={},a=await Promise.all(t.map((async t=>{const n=await q(this,N,"m",Q).call(this,t,e);return r.includes(t)?(n.forEach((e=>{i[e]=!0})),[]):n.filter((e=>!o[e]&&!i[e]&&(o[e]=!0,!0)))}))),s=n.filter((e=>!o[e]&&!i[e])),c=w()(...a,s);return y()(c).filter(Boolean)}}("local",e,{defaultFont:n.defaultFont})),function(e){const r={assets:[],total:0,currentPage:1,nextPage:void 0};return Object.entries(e).map((([e,n])=>{const o=n.types||["ly.img.image"];if(!n.findAssets)throw new Error("New asset source needs to define `findAssets` at least");return Object.assign(Object.assign(Object.assign({id:e},t),n),{findAssets:async(e,t)=>o.includes(e)&&await n.findAssets(e,t)||Promise.resolve(r),hasType:e=>o.includes(e)})}))}(n.assetSources).forEach((e=>this.unstable_assetRegistry.addSource(e))),ht(this,at,"f").useInternalAPI((e=>{e.setPreUpdateCallback(ht(this,ut,"f"))})),ht(this,it,"m",pt).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=n,this.helper=ht(this,at,"f"),this.onPostUpdate=e=>{ht(this,at,"f").useInternalAPI((t=>{t.setPostUpdateCallback(e)}))})}dispose(){ht(this,it,"m",ft).call(this),ht(this,at,"f").useInternalAPI((e=>{e.setPreUpdateCallback(null)})),gt(this,st,null,"f"),gt(this,at,null,"f"),this.block=null,this.scene=null,this.variable=null,ht(this,ct,"f").delete(),gt(this,ct,null,"f")}static async init(e,t){console.log("[CreativeEngine] Revision 1725e72a313885bfedf35f0adc1489bf50648b0e"),"undefined"==typeof document||t||(t=document.createElement("canvas"));const r=Ie(e);return new this(await function(e,t){const r=Ie(t),{core:n}=r,o=null!==(s=null===(a=null==(i=r)?void 0:i.callbacks)||void 0===a?void 0:a.log)&&void 0!==s?s:Pe;var i,a,s;return new Promise(((t,i)=>{let a,s;return Ve({locateFile:(e,t)=>{if(e.endsWith(".wasm")){const e=Ye(We,n.baseURL).toString();return a=e,e}if(e.endsWith(".data")){const e=Ye(ze,n.baseURL).toString();return s=e,e}return t+e},print:e=>{e&&"undefined"!==e&&o(e,be.Info)},printErr:e=>{e&&"undefined"!==e&&o(e,be.Error)},onRuntimeInitialized:()=>{o("Engine has been initialized.",be.Info)},logReadFiles:!1,printWithColors:!0}).then((n=>{let o="";"string"==typeof e?o=e:void 0!==e&&(n.specialHTMLTargets["!canvas"]=e,o="!canvas");const a=n.createEngine(o);if(a.isValid()){const e=a.value();!function(e,t){var r;const n=new C(e);function o(e,t){return n.execute("ubq/settings/set",[e,t])}o("ubq://license",t.license||""),o("ubq://role",x[t.role]),o("ubq://basePath",t.baseURL),o("ubq://touchScrollingEnabled",!(null===(r=t.featureFlags)||void 0===r?void 0:r.preventScrolling)),Object.entries(t.presets.images||{}).forEach((([e,t])=>{n.execute("ubq/assets/registerImage",[e,t.thumbnailURL||t.imageURL,t.imageURL,t.width,t.height])})),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const o=`${e}_${r.weight}_${r.style}`;n.execute("ubq/assets/registerFont",[o,r.fontURL,t.family,r.weight,r.style])}))})),function(){const{imageMattingOnly:e,singlePageMode:r}=t.featureFlags||{};"undefined"!=typeof window&&("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window||o("ubq://features/videosEnabled",!1)),o("ubq://features/singlePageModeEnabled",r),o("cesdk://trackActivePage",!r),o("ubq://features/effectsEnabled",!0)}(),o("ubq://page/title/fontFileUri",t.page.title.fontFileUri),o("ubq://page/title/show",t.page.title.show),o("ubq://page/dimOutOfPageAreas",t.page.dimOutOfPageAreas),function(){if(void 0!==t.scene.maskSpotColor){const{rgbApproximation:e}=t.scene.maskSpotColor,r=M.fromRGBA(Object.assign(Object.assign({},e),{a:1}));n.execute("cesdk/setSpecialSpotColor",r)}}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{n.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){var r;const n=null!==(r=t.variables)&&void 0!==r?r:{};Object.entries(n).forEach((([t,r])=>{U(e.setVariableString(t,r.value.toString()))}))}()}(e,r),t(e)}else{const e=a.error();i(new Error(e.publicMessage())),e.delete()}a.delete()})).catch((e=>{e instanceof Error&&(e.wasmPath=a,e.dataPath=s),i(e)}))}))}(t,r),t,r)}}at=new WeakMap,st=new WeakMap,ct=new WeakMap,ut=new WeakMap,lt=new WeakMap,dt=new WeakMap,it=new WeakSet,pt=function(e=!0){if(ht(this,lt,"f"))return;if("undefined"!=typeof HTMLCanvasElement&&ht(this,st,"f")instanceof HTMLCanvasElement){const e=function(e,t){const r=r=>{const n=tt(e,r);n.isTouch&&r.preventDefault(),t.execute("ubq/inputs/mousemove",n)},n=r=>{const n=Object.assign(Object.assign({},tt(e,r)),{button:T(r instanceof MouseEvent?r.button:c.Left),state:u.Up,shiftIsHeld:r.shiftKey});t.execute("ubq/inputs/mousebutton",n)},o=r=>{const n=Object.assign(Object.assign({},tt(e,r)),{button:T(r instanceof MouseEvent?r.button:c.Left),state:u.Down,shiftIsHeld:r.shiftKey});t.execute("ubq/inputs/mousebutton",n)};return e.addEventListener("mousemove",r),e.addEventListener("mousedown",o),e.addEventListener("mouseup",n),e.addEventListener("touchmove",r),e.addEventListener("touchstart",o),e.addEventListener("touchend",n),e.addEventListener("touchcancel",n),()=>{e.removeEventListener("mousemove",r),e.removeEventListener("mousedown",o),e.removeEventListener("mouseup",n),e.removeEventListener("touchmove",r),e.removeEventListener("touchstart",o),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n)}}(ht(this,st,"f"),ht(this,at,"f")),t=function(e,t){let r=null;const n=t.useInternalAPI((n=>n.addEventCallback("EditorStateUpdatedEvent",(async()=>{const{editMode:n}=await t.getEditorState();n!==F.Text||r?n!==F.Text&&r&&(r(),r=null):r=function(){var r;let n=!1;const o=document.createElement("textarea");return o.id="ubq_internal-inline_text_editing_html_representation",o.autocapitalize="none",o.spellcheck=!1,o.cols=4096,o.style.contain="strict",o.style.opacity="0",o.style.pointerEvents="none",o.style.zIndex="-1",o.style.position="absolute",o.style.width="1px",o.style.height="1px",o.style.padding="0",o.style.margin="-1px",o.style.overflow="hidden",o.style.clip="rect(0, 0, 0, 0)",o.style.whiteSpace="nowrap",o.style.border="0",o.addEventListener("input",a),o.addEventListener("keydown",s),o.addEventListener("copy",i),o.addEventListener("compositionstart",c),o.addEventListener("compositionupdate",u),o.addEventListener("compositionend",d),null===(r=null==e?void 0:e.parentElement)||void 0===r||r.appendChild(o),o.focus(),()=>{var t;o.removeEventListener("input",a),o.removeEventListener("keydown",s),o.removeEventListener("copy",i),o.removeEventListener("compositionstart",c),o.removeEventListener("compositionupdate",u),o.removeEventListener("compositionend",d),null===(t=null==e?void 0:e.parentElement)||void 0===t||t.removeChild(o)};function i(e){try{t.useInternalAPI((t=>{const r=U(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function a(e){var r,o;const i=e.target,{value:a}=i;let s=a.length;if(n){s=null!==(o=null!==(r=i.selectionEnd)&&void 0!==r?r:i.selectionStart)&&void 0!==o?o:0;const e=[...a];for(let t=0;t<e.length;t+=1)t<s&&(s-=e[t].length-1);t.execute("ubq/text/compositionUpdate",{value:a,cursorPosition:s})}else if(a.length>0){if("\n"!==a[0]){const e={key:l.Unknown,characters:a,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",e)}i.value=""}}async function s(e){if("a"===e.key&&(e.metaKey||e.ctrlKey))return n&&(await t.execute("ubq/text/compositionEnd"),n=!1,e.currentTarget&&(o.value="")),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void async function(){const e=await t.getEditorState();t.setEditorState(Object.assign(Object.assign({},e),{editMode:F.Transform}))}();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:l.Unknown,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=l.Key0;break;case"1":t.key=l.Key1;break;case"2":t.key=l.Key2;break;case"3":t.key=l.Key3;break;case"4":t.key=l.Key4;break;case"5":t.key=l.Key5;break;case"6":t.key=l.Key6;break;case"7":t.key=l.Key7;break;case"8":t.key=l.Key8;break;case"9":t.key=l.Key9;break;case"A":t.key=l.A;break;case"B":t.key=l.B;break;case"C":t.key=l.C;break;case"D":t.key=l.D;break;case"E":t.key=l.E;break;case"F":t.key=l.F;break;case"G":t.key=l.G;break;case"H":t.key=l.H;break;case"I":t.key=l.I;break;case"J":t.key=l.J;break;case"K":t.key=l.K;break;case"L":t.key=l.L;break;case"M":t.key=l.M;break;case"N":t.key=l.N;break;case"O":t.key=l.O;break;case"P":t.key=l.P;break;case"Q":t.key=l.Q;break;case"R":t.key=l.R;break;case"S":t.key=l.S;break;case"T":t.key=l.T;break;case"U":t.key=l.U;break;case"V":t.key=l.V;break;case"W":t.key=l.W;break;case"X":t.key=l.X;break;case"Y":t.key=l.Y;break;case"Z":t.key=l.Z;break;case" ":t.key=l.Space;break;case"ESCAPE":t.key=l.Escape,t.characters="";break;case"BACKSPACE":t.key=l.Backspace,t.characters="";break;case"DELETE":t.key=l.Delete,t.characters="";break;case"ENTER":t.key=l.Enter,t.characters="\n";break;case"CONTROL":t.key=l.Control,t.characters="";break;case"ALT":t.key=l.Option,t.characters="";break;case"SHIFT":t.key=l.Shift,t.characters="";break;case"ARROWLEFT":t.key=l.ArrowLeft,t.characters="";break;case"ARROWRIGHT":t.key=l.ArrowRight,t.characters="";break;case"ARROWUP":t.key=l.ArrowUp,t.characters="";break;case"ARROWDOWN":t.key=l.ArrowDown,t.characters="";break;case"DEAD":t.key=l.Unknown,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",r),e.currentTarget&&(o.value="")}async function c(){n=!0,await t.execute("ubq/text/compositionStart")}function u(){n=!0}async function d(){n=!1,await t.execute("ubq/text/compositionEnd"),o.value=""}}()}))));return()=>{null==r||r(),n.dispose(),n.delete()}}(ht(this,st,"f"),ht(this,at,"f"));gt(this,dt,(()=>{e(),t()}),"f")}const t=()=>{ht(this,it,"m",mt).call(this,e),gt(this,lt,requestAnimationFrame(t),"f")};gt(this,lt,requestAnimationFrame(t),"f")},ft=function(){var e;null===(e=ht(this,dt,"f"))||void 0===e||e.call(this),gt(this,dt,void 0,"f"),ht(this,lt,"f")&&(cancelAnimationFrame(ht(this,lt,"f")),gt(this,lt,0,"f"))},mt=function(e=!0){e&&void 0!==ht(this,st,"f")&&1===this.block.findByType(O.Scene).length&&ht(this,at,"f").execute("ubq/render",{displayWidth:ht(this,st,"f").width,displayHeight:ht(this,st,"f").height}),ht(this,ct,"f").update()}})();var o=n.Il,i=n.yQ,a=n.Ju,s=n.in,c=n.HY,u=n.uU,l=n.ZP;export{o as Color,i as ConfigTypes,a as DesignBlockType,s as LogLevel,c as MimeType,u as Role,l as default};
|
|
1
|
+
var e={7643:(e,t,r)=>{var n=r(5557),o=r(4349),i=r(407),a=r(5134),s=r(9951);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},3872:(e,t,r)=>{var n=r(2470),o=r(7289),i=r(7614),a=r(3067),s=r(9346);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},5674:(e,t,r)=>{var n=r(489)(r(4818),"Map");e.exports=n},2462:(e,t,r)=>{var n=r(6290),o=r(4951),i=r(440),a=r(6180),s=r(7719);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},4691:(e,t,r)=>{var n=r(3872),o=r(1490),i=r(2594),a=r(5953),s=r(4667),c=r(4615);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,e.exports=u},9652:(e,t,r)=>{var n=r(4818).Symbol;e.exports=n},4600:(e,t,r)=>{var n=r(4818).Uint8Array;e.exports=n},6562:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7554:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}},1998:(e,t,r)=>{var n=r(1453),o=r(5664),i=r(5860),a=r(9571),s=r(8347),c=r(1859),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),l=!r&&o(e),d=!r&&!l&&a(e),f=!r&&!l&&!d&&c(e),m=r||l||d||f,p=m?n(e.length,String):[],h=p.length;for(var g in e)!t&&!u.call(e,g)||m&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,h))||p.push(g);return p}},3675:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}},4656:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},8247:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},1612:(e,t,r)=>{var n=r(6912),o=r(3355);e.exports=function(e,t,r){(void 0!==r&&!o(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},6258:(e,t,r)=>{var n=r(6912),o=r(3355),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];i.call(e,t)&&o(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},8620:(e,t,r)=>{var n=r(3355);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},6912:(e,t,r)=>{var n=r(4698);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},8528:(e,t,r)=>{var n=r(4820),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},8288:(e,t,r)=>{var n=r(4656),o=r(1813);e.exports=function e(t,r,i,a,s){var c=-1,u=t.length;for(i||(i=o),s||(s=[]);++c<u;){var l=t[c];r>0&&i(l)?r>1?e(l,r-1,i,a,s):n(s,l):a||(s[s.length]=l)}return s}},3153:(e,t,r)=>{var n=r(7572)();e.exports=n},2759:(e,t,r)=>{var n=r(9652),o=r(5135),i=r(3744),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},6651:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},3216:(e,t,r)=>{var n=r(830),o=r(931),i=r(4820),a=r(1304),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,f=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?f:s).test(a(e))}},9920:(e,t,r)=>{var n=r(2759),o=r(7906),i=r(1408),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[n(e)]}},3339:(e,t,r)=>{var n=r(4820),o=r(7839),i=r(3003),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},7604:(e,t,r)=>{var n=r(4691),o=r(1612),i=r(3153),a=r(480),s=r(4820),c=r(2551),u=r(7700);e.exports=function e(t,r,l,d,f){t!==r&&i(r,(function(i,c){if(f||(f=new n),s(i))a(t,r,c,l,e,d,f);else{var m=d?d(u(t,c),i,c+"",t,r,f):void 0;void 0===m&&(m=i),o(t,c,m)}}),c)}},480:(e,t,r)=>{var n=r(1612),o=r(8192),i=r(9947),a=r(6581),s=r(1172),c=r(5664),u=r(5860),l=r(5274),d=r(9571),f=r(830),m=r(4820),p=r(1969),h=r(1859),g=r(7700),v=r(2963);e.exports=function(e,t,r,y,b,_,w){var E=g(e,r),x=g(t,r),k=w.get(x);if(k)n(e,r,k);else{var S=_?_(E,x,r+"",e,t,w):void 0,T=void 0===S;if(T){var C=u(x),P=!C&&d(x),A=!C&&!P&&h(x);S=x,C||P||A?u(E)?S=E:l(E)?S=a(E):P?(T=!1,S=o(x,!0)):A?(T=!1,S=i(x,!0)):S=[]:p(x)||c(x)?(S=E,c(E)?S=v(E):m(E)&&!f(E)||(S=s(x))):T=!1}T&&(w.set(x,S),b(S,x,y,_,w),w.delete(x)),n(e,r,S)}}},1445:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},5757:(e,t,r)=>{var n=r(1191),o=r(2549),i=r(6613);e.exports=function(e,t){return i(o(e,t,n),e+"")}},4274:(e,t,r)=>{var n=r(7477),o=r(4698),i=r(1191),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},1453:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},5208:(e,t,r)=>{var n=r(9652),o=r(3675),i=r(5860),a=r(1918),s=n?n.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},8275:e=>{e.exports=function(e){return function(t){return e(t)}}},1254:(e,t,r)=>{var n=r(4600);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},8192:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},9947:(e,t,r)=>{var n=r(1254);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},6581:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},7200:(e,t,r)=>{var n=r(6258),o=r(6912);e.exports=function(e,t,r,i){var a=!r;r||(r={});for(var s=-1,c=t.length;++s<c;){var u=t[s],l=i?i(r[u],e[u],u,r,e):void 0;void 0===l&&(l=e[u]),a?o(r,u,l):n(r,u,l)}return r}},8940:(e,t,r)=>{var n=r(4818)["__core-js_shared__"];e.exports=n},3102:(e,t,r)=>{var n=r(5757),o=r(7072);e.exports=function(e){return n((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,a)}return t}))}},7572:e=>{e.exports=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===r(i[c],c,i))break}return t}}},4698:(e,t,r)=>{var n=r(489),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},3566:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},6330:(e,t,r)=>{var n=r(5513);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},489:(e,t,r)=>{var n=r(3216),o=r(3626);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},4966:(e,t,r)=>{var n=r(6148)(Object.getPrototypeOf,Object);e.exports=n},5135:(e,t,r)=>{var n=r(9652),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},3626:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},4530:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},5557:(e,t,r)=>{var n=r(2037);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},4349:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},407:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},5134:(e,t,r)=>{var n=r(2037),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},9951:(e,t,r)=>{var n=r(2037);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},1172:(e,t,r)=>{var n=r(8528),o=r(4966),i=r(7839);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},1813:(e,t,r)=>{var n=r(9652),o=r(5664),i=r(5860),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},8347:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},7072:(e,t,r)=>{var n=r(3355),o=r(8809),i=r(8347),a=r(4820);e.exports=function(e,t,r){if(!a(r))return!1;var s=typeof t;return!!("number"==s?o(r)&&i(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5513:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},931:(e,t,r)=>{var n,o=r(8940),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},7839:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},2470:e=>{e.exports=function(){this.__data__=[],this.size=0}},7289:(e,t,r)=>{var n=r(8620),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},7614:(e,t,r)=>{var n=r(8620);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},3067:(e,t,r)=>{var n=r(8620);e.exports=function(e){return n(this.__data__,e)>-1}},9346:(e,t,r)=>{var n=r(8620);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},6290:(e,t,r)=>{var n=r(7643),o=r(3872),i=r(5674);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},4951:(e,t,r)=>{var n=r(6330);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},440:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).get(e)}},6180:(e,t,r)=>{var n=r(6330);e.exports=function(e){return n(this,e).has(e)}},7719:(e,t,r)=>{var n=r(6330);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},2037:(e,t,r)=>{var n=r(489)(Object,"create");e.exports=n},3003:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},9693:(e,t,r)=>{e=r.nmd(e);var n=r(3566),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},3744:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},6148:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},2549:(e,t,r)=>{var n=r(6562),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),c=Array(s);++a<s;)c[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=r(c),n(e,this,u)}}},4818:(e,t,r)=>{var n=r(3566),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},7700:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},6613:(e,t,r)=>{var n=r(4274),o=r(3546)(n);e.exports=o},3546:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},1490:(e,t,r)=>{var n=r(3872);e.exports=function(){this.__data__=new n,this.size=0}},2594:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},5953:e=>{e.exports=function(e){return this.__data__.get(e)}},4667:e=>{e.exports=function(e){return this.__data__.has(e)}},4615:(e,t,r)=>{var n=r(3872),o=r(5674),i=r(2462);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},1304:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5153:e=>{var t="a-z\\xdf-\\xf6\\xf8-\\xff",r="A-Z\\xc0-\\xd6\\xd8-\\xde",n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+n+"]",i="\\d+",a="["+t+"]",s="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bf"+t+r+"]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",l="["+r+"]",d="(?:"+a+"|"+s+")",f="(?:"+l+"|"+s+")",m="(?:['’](?:d|ll|m|re|s|t|ve))?",p="(?:['’](?:D|LL|M|RE|S|T|VE))?",h="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",g="[\\ufe0e\\ufe0f]?",v=g+h+"(?:\\u200d(?:"+["[^\\ud800-\\udfff]",c,u].join("|")+")"+g+h+")*",y="(?:"+["[\\u2700-\\u27bf]",c,u].join("|")+")"+v,b=RegExp([l+"?"+a+"+"+m+"(?="+[o,l,"$"].join("|")+")",f+"+"+p+"(?="+[o,l+d,"$"].join("|")+")",l+"?"+d+"+"+m,l+"+"+p,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,y].join("|"),"g");e.exports=function(e){return e.match(b)||[]}},7477:e=>{e.exports=function(e){return function(){return e}}},3355:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9423:(e,t,r)=>{var n=r(8288);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},1191:e=>{e.exports=function(e){return e}},5664:(e,t,r)=>{var n=r(6651),o=r(1408),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},5860:e=>{var t=Array.isArray;e.exports=t},8809:(e,t,r)=>{var n=r(830),o=r(7906);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},5274:(e,t,r)=>{var n=r(8809),o=r(1408);e.exports=function(e){return o(e)&&n(e)}},9571:(e,t,r)=>{e=r.nmd(e);var n=r(4818),o=r(8585),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},830:(e,t,r)=>{var n=r(2759),o=r(4820);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},7906:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4820:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1408:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1969:(e,t,r)=>{var n=r(2759),o=r(4966),i=r(1408),a=Function.prototype,s=Object.prototype,c=a.toString,u=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=n(e))return!1;var t=o(e);if(null===t)return!0;var r=u.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==l}},1918:(e,t,r)=>{var n=r(2759),o=r(1408);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1859:(e,t,r)=>{var n=r(9920),o=r(8275),i=r(9693),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},2551:(e,t,r)=>{var n=r(1998),o=r(3339),i=r(8809);e.exports=function(e){return i(e)?n(e,!0):o(e)}},7168:(e,t,r)=>{var n=r(7604),o=r(3102)((function(e,t,r){n(e,t,r)}));e.exports=o},8585:e=>{e.exports=function(){return!1}},2963:(e,t,r)=>{var n=r(7200),o=r(2551);e.exports=function(e){return n(e,o(e))}},8395:(e,t,r)=>{var n=r(5208);e.exports=function(e){return null==e?"":n(e)}},5377:(e,t,r)=>{var n=r(7554),o=r(3675),i=r(1445),a=r(1453),s=r(5274),c=Math.max;e.exports=function(e){if(!e||!e.length)return[];var t=0;return e=n(e,(function(e){if(s(e))return t=c(e.length,t),!0})),a(t,(function(t){return o(e,i(t))}))}},582:(e,t,r)=>{var n=r(8247),o=r(4530),i=r(8395),a=r(5153);e.exports=function(e,t,r){return e=i(e),void 0===(t=r?void 0:t)?o(e)?a(e):n(e):e.match(t)||[]}},3145:(e,t,r)=>{var n=r(5757)(r(5377));e.exports=n},7984:(e,t,r)=>{e.exports=r.p+"assets/core/cesdk.data"},2934:(e,t,r)=>{e.exports=r.p+"assets/core/cesdk.wasm"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="";var n={};(()=>{r.d(n,{Il:()=>F,yQ:()=>e,Ju:()=>k,in:()=>we,HY:()=>fe,uU:()=>C,ZP:()=>vt});var e={};r.r(e);const t={canManageAssets:!1,getGroups:()=>Promise.resolve([]),findAssets(){throw new Error("Implementation required")},getAsset(){throw new Error("Implementation required")},updateAsset(){throw new Error("Implementation required")},addAsset(){throw new Error("Implementation required")},removeAsset(){throw new Error("Implementation required")},getTypes(){throw new Error("Implementation required")},hasType(){throw new Error("Implementation required")}};var o,i,a,s,c,u,l,d,f,m,p,h,g,v=r(9423),y=r.n(v),b=r(582),_=r.n(b),w=r(3145),E=r.n(w);function x(e){switch(e){case 0:return c.Left;case 1:return c.Middle;case 2:return c.Right;default:return c.Unknown}}!function(e){e[e.Pending=0]="Pending",e[e.Ready=1]="Ready",e[e.Error=2]="Error"}(o||(o={})),function(e){e.Added="DesignBlockAddedEvent",e.Updated="DesignBlockUpdatedEvent",e.Removed="DesignBlockRemovedEvent"}(i||(i={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Center=2]="Center"}(a||(a={})),function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom",e[e.Center=2]="Center"}(s||(s={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Middle=2]="Middle",e[e.Unknown=255]="Unknown"}(c||(c={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(u||(u={})),function(e){e[e.Key0=0]="Key0",e[e.Key1=1]="Key1",e[e.Key2=2]="Key2",e[e.Key3=3]="Key3",e[e.Key4=4]="Key4",e[e.Key5=5]="Key5",e[e.Key6=6]="Key6",e[e.Key7=7]="Key7",e[e.Key8=8]="Key8",e[e.Key9=9]="Key9",e[e.A=10]="A",e[e.B=11]="B",e[e.C=12]="C",e[e.D=13]="D",e[e.E=14]="E",e[e.F=15]="F",e[e.G=16]="G",e[e.H=17]="H",e[e.I=18]="I",e[e.J=19]="J",e[e.K=20]="K",e[e.L=21]="L",e[e.M=22]="M",e[e.N=23]="N",e[e.O=24]="O",e[e.P=25]="P",e[e.Q=26]="Q",e[e.R=27]="R",e[e.S=28]="S",e[e.T=29]="T",e[e.U=30]="U",e[e.V=31]="V",e[e.W=32]="W",e[e.X=33]="X",e[e.Y=34]="Y",e[e.Z=35]="Z",e[e.ArrowLeft=36]="ArrowLeft",e[e.ArrowRight=37]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.ArrowDown=39]="ArrowDown",e[e.Backspace=40]="Backspace",e[e.Enter=41]="Enter",e[e.Space=42]="Space",e[e.Escape=43]="Escape",e[e.Delete=44]="Delete",e[e.Control=45]="Control",e[e.Option=46]="Option",e[e.Shift=47]="Shift",e[e.Unknown=255]="Unknown"}(l||(l={})),function(e){e[e.Thin=100]="Thin",e[e.ExtraLight=200]="ExtraLight",e[e.Light=300]="Light",e[e.Normal=400]="Normal",e[e.Medium=500]="Medium",e[e.SemiBold=600]="SemiBold",e[e.Bold=700]="Bold",e[e.ExtraBold=800]="ExtraBold",e[e.Heavy=900]="Heavy"}(d||(d={})),function(e){e[e.Normal=0]="Normal",e[e.Italic=1]="Italic"}(f||(f={})),function(e){e.Bold="bold",e.Italic="italic"}(m||(m={})),function(e){e[e.Undefined=0]="Undefined",e[e.DesignUnit=1]="DesignUnit",e[e.Percent=2]="Percent",e[e.Auto=3]="Auto"}(p||(p={})),function(e){e[e.Free=0]="Free",e[e.VerticalStack=1]="VerticalStack",e[e.HorizontalStack=2]="HorizontalStack"}(h||(h={})),function(e){e.Scene="//ly.img.ubq/scene",e.Stack="//ly.img.ubq/stack",e.Camera="//ly.img.ubq/camera",e.Page="//ly.img.ubq/page",e.Image="//ly.img.ubq/image",e.Video="//ly.img.ubq/video",e.Text="//ly.img.ubq/text",e.Sticker="//ly.img.ubq/sticker",e.VectorPath="//ly.img.ubq/vector_path",e.RectShape="//ly.img.ubq/shapes/rect",e.LineShape="//ly.img.ubq/shapes/line",e.StarShape="//ly.img.ubq/shapes/star",e.PolygonShape="//ly.img.ubq/shapes/polygon",e.EllipseShape="//ly.img.ubq/shapes/ellipse",e.Group="//ly.img.ubq/group"}(g||(g={}));const k=g;var S,T;!function(e){e[e.Information=0]="Information",e[e.Warning=1]="Warning",e[e.Error=2]="Error"}(S||(S={})),function(e){e[e.Creator=0]="Creator",e[e.Adopter=1]="Adopter",e[e.Viewer=2]="Viewer",e[e.Presenter=3]="Presenter"}(T||(T={}));const C=T;var P,A,F,D,L;!function(e){e.Unknown="",e.Boolean="bool",e.Boolean2="ubq/math/bool2",e.Int="int",e.UInt8="uint8_t",e.Int32="int32_t",e.UInt32="uint32_t",e.Int2="ubq/math/ivec2",e.Size2="ubq/types/Size2",e.Color="ubq/types/Color",e.Double="double",e.Float="float",e.Float2="ubq/math/vec2",e.Float3="ubq/math/vec3",e.Float4="ubq/math/vec4",e.String="string",e.HorizontalTextAlignment="ubq/types/HorizontalTextAlignment",e.VerticalTextAlignment="ubq/types/VerticalTextAlignment",e.Margin2D="ubq/types/OuterMargin2D"}(P||(P={})),function(e){e[e.Pixel=0]="Pixel",e[e.Millimeter=1]="Millimeter",e[e.Inch=2]="Inch"}(A||(A={})),function(e){e.toDesignUnit=function(t){return t===e.Pixel?"px":t===e.Millimeter?"mm":t===e.Inch?"in":void 0},e.fromDesignUnit=function(t){return"px"===t?e.Pixel:"mm"===t?e.Millimeter:"in"===t?e.Inch:void 0},e.getLabel=function(t){switch(t){case e.Pixel:return"px";case e.Millimeter:return"mm";case e.Inch:return"in";default:return""}},e.convertToPoints=function(t,r,n){switch(r){case e.Pixel:return t/n*72;case e.Inch:return 72*t;case e.Millimeter:return 72*t/25.4;default:throw new Error("Unknown design unit!")}}}(A||(A={})),function(e){let t;!function(e){e[e.sRGB=0]="sRGB",e[e.CMYK=1]="CMYK",e[e.SpotColor=2]="SpotColor"}(t=e.ColorSpace||(e.ColorSpace={})),e.fromRGBA=function(e){return{colorSpace:t.sRGB,components:{x:e.r,y:e.g,z:e.b,w:e.a},spotColor:{name:"",rgbApproximation:e,cmykApproximation:{c:.75,m:.68,y:.67,k:.9}}}},e.toRGBA=function(e){switch(e.colorSpace){case t.sRGB:return{r:e.components.x,g:e.components.y,b:e.components.z,a:e.components.w};case t.SpotColor:return e.spotColor.rgbApproximation;case t.CMYK:throw new Error("CMYK to RGBA conversion not supported!");default:throw new Error("Unknown color space!")}}}(F||(F={})),function(e){e.Transform="ubq/editMode/transform",e.Crop="ubq/editMode/crop",e.Text="ubq/editMode/text"}(D||(D={})),function(e){e[e.Arrow=0]="Arrow",e[e.Move=1]="Move",e[e.MoveNotPermitted=2]="MoveNotPermitted",e[e.Resize=3]="Resize",e[e.Rotate=4]="Rotate",e[e.Text=5]="Text"}(L||(L={}));const I=(e,t)=>({x:e.x*t,y:e.y*t});function R(e,t,r=Number.EPSILON){return Math.abs(e-t)<r}class M{constructor(e){Object.defineProperty(this,"ubq",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ubq=e}useInternalAPI(e){const t=this.ubq.getInternalAPI();try{return e(t)}finally{t.delete()}}async createElement(e,t,r){const n=await this.execute("ubq/designblocks/create",e);this.execute("ubq/designblocks/addToParent",[n,t]);const o=O(this.ubq.getLastFrameWidth(t)),i=O(this.ubq.getLastFrameHeight(t)),{position:a,size:s}=function(e,t,r=8/13){const n=((e,t)=>{const r=e.x/e.y,n=t.x/t.y;return I(t,r>n?e.y/t.y:e.x/t.x)})(e,t),o=I(n,r);return{position:{x:.5*(e.x-o.x),y:.5*(e.y-o.y)},size:o}}({x:o,y:i},{x:r.width,y:r.height},8/13);this.execute("ubq/layout/setAbsoluteSize",{id:n,size:{width:s.x,height:s.y}}),s.x||this.execute("ubq/layout/setAutoWidth",{id:n}),s.y||this.execute("ubq/layout/setAutoHeight",{id:n});const c=function(e={x:50,y:50}){return{x:Math.random()*e.x,y:Math.random()*e.y}}({x:.08*o,y:.08*i});return await this.execute("ubq/layout/setAbsolutePosition",{id:n,position:{left:a.x+c.x,top:a.y+c.y}}),n}setValue(e,t,r,n){return this.useInternalAPI((o=>O(o.setValue(e,t,r,n))))}getValue(e,t,r){return this.useInternalAPI((n=>O(n.getValue(e,t,r))))}async getEditorState(){return this.execute("ubq/editor/getEditorState")}async setEditorState(e){return this.execute("ubq/editor/setEditorState",e)}async execute(e,t){return new Promise((r=>{this.useInternalAPI((n=>n.ubqExecute(e,t,(e=>{const t=O(e);r(t)})))).delete()}))}}function O(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)}}var B,U,N,j,q,G,W,z=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},V=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};U=new WeakMap,N=new WeakMap,j=new WeakMap,q=new WeakMap,B=new WeakSet,G=async function(e,t){return this.helper.execute("ubq/assets/getMetadata",[e,t])},W=async function(e,t){const r=await this.helper.execute("ubq/assets/getRegisteredCategoryIDsForType",t),n=[];return await Promise.all(r.map((async t=>{if(t.endsWith(e)){const e=await this.helper.execute("ubq/assets/getAssetsInCategory",t);n.splice(n.length-1,0,...e)}}))),n};class H extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function $(e){return"object"==typeof e&&null!=e}function Y(e){return"string"==typeof e?JSON.stringify(e):""+e}function X(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:c="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+Y(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:c}}function*K(e,t,r,n){var o;$(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const o of e){const e=X(o,t,r,n);e&&(yield e)}}function*Q(e,t,r={}){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&$(t.schema)&&$(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c=!0;for(const r of t.validator(e,s))c=!1,yield[r,void 0];for(let[r,u,l]of t.entries(e,s)){const t=Q(u,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,u],coerce:i,mask:a});for(const n of t)n[0]?(c=!1,yield[n[0],void 0]):i&&(u=n[1],void 0===r?e=u:e instanceof Map?e.set(r,u):e instanceof Set?e.add(u):$(e)&&(e[r]=u))}if(c)for(const r of t.refiner(e,s))c=!1,yield[r,void 0];c&&(yield[void 0,e])}class Z{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>K(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>K(o(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=J(e,t);if(r[0])throw r[0]}(e,this)}create(e){return function(e,t){const r=J(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}(e,this)}is(e){return function(e,t){return!J(e,t)[0]}(e,this)}mask(e){return function(e,t){const r=J(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return J(e,this,t)}}function J(e,t,r={}){const n=Q(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);return o[0]?[new H(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function ee(e,t){return new Z({type:e,schema:null,validator:t})}function te(e){return new Z({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Y(e)})}function re(){return ee("boolean",(e=>"boolean"==typeof e))}function ne(){return ee("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||"Expected an integer, but received: "+Y(e)))}function oe(){return ee("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Y(e)))}function ie(){return ee("string",(e=>"string"==typeof e||"Expected a string, but received: "+Y(e)))}function ae(e,t,r={}){const{exclusive:n}=r;return ce(e,"min",(r=>n?r>t:r>=t||"Expected a "+e.type+" greater than "+(n?"":"or equal to ")+t+" but received `"+r+"`"))}function se(e){return ce(e,"nonempty",(t=>function(e){return e instanceof Map||e instanceof Set?e.size:e.length}(t)>0||"Expected a nonempty "+e.type+" but received an empty one"))}function ce(e,t,r){return new Z({...e,*refiner(n,o){yield*e.refiner(n,o);const i=K(r(n,o),o,e,n);for(const e of i)yield{...e,refinement:t}}})}function ue(e,t,r){const[n]=J(t,r);if(n)throw n.message=`Error in argument '${e}': ${n.message}`,n}function le(){const e=/image\/(png|jpeg|x-tga)|video\/mp4|application\/octet-stream|application\/pdf/;return ee("MimeType",(t=>!("string"!=typeof t||!e.test(t))||{message:`expected one of "image/png", "image/jpeg", "image/x-tga", "video/mp4", "application/pdf" or "application/octet-stream", but got "${t}"`}))}var de;!function(e){e.Png="image/png",e.Jpeg="image/jpeg",e.Tga="image/x-tga",e.Mp4="video/mp4",e.Binary="application/octet-stream",e.Pdf="application/pdf",e.Zip="application/zip"}(de||(de={}));const fe=de;var me;!function(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.Sticker="ubq/designblocks/Sticker",e.Text="ubq/designblocks/CompositedText",e.Crop="ubq/types/Crop",e.Scale="ubq/scene/Scale",e.Opacity="ubq/types/Opacity",e.FillColor="ubq/types/FillColor",e.Fill="ubq/types/Fill",e.BackgroundColor="ubq/types/BackgroundColor",e.Stroke="ubq/types/Stroke",e.Group="ubq/designblocks/Group",e.VectorPath="ubq/designblocks/VectorPath",e.PendingState="ubq/designblocks/PendingState",e.ErrorState="ubq/designblocks/ErrorState"}(me||(me={}));const pe=me,he=(e,t=!0)=>{const r=[];for(let t=0;t<e.size();t+=1)r.push(e.get(t));return t&&e.delete(),r};var ge,ve,ye=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},be=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class _e{constructor(e){ge.set(this,void 0),ve.set(this,void 0),ye(this,ge,e,"f"),ye(this,ve,new M(e),"f")}async export(e,t=fe.Png){return ue("handle",e,oe()),ue("mimeType",t,le()),new Promise(((r,n)=>{be(this,ge,"f").exportToBuffer(e,t,(e=>{"error"in e?n(e.error):r(new Blob([e],{type:t}))}),{jpegQuality:.9,pngCompressionLevel:5,useTargetSize:!1,targetWidth:0,targetHeight:0})}))}async unstable_exportVideo(e,t,r,n=fe.Mp4,o,i,a,s){return ue("handle",e,oe()),ue("mimeType",n,le()),ue("resolutionWidth",o,ne()),ue("resolutionHeight",i,ne()),ue("framerate",a,oe()),new Promise(((c,u)=>{be(this,ge,"f").exportVideoToBuffer(e,t,r,n,s,(e=>{"error"in e?u(e.error):c(new Blob([e],{type:n}))}),{h264Profile:77,h264Level:52,framerate:a,useTargetSize:!0,targetWidth:o,targetHeight:i})}))}async loadFromString(e){return ue("content",e,ie()),new Promise((t=>{be(this,ge,"f").loadBlocksFromString(e,(e=>{const r=O(e);t(he(r))}))}))}async saveToString(e){return ue("blocks",e,te(oe())),new Promise((t=>{be(this,ge,"f").saveBlocksToString(e,(e=>{const r=O(e);t(r)}))}))}create(e){return ue("type",e,ie()),O(be(this,ge,"f").create(e))}unstable_createFromAsset(e,t,r,n){return ue("id",e,ie()),ue("type",t,ie()),ue("mimeType",r,ie()),new Promise(((o,i)=>{be(this,ge,"f").createFromAsset(e,t,r,n,(e=>{try{o(O(e))}catch(e){i(e)}}))}))}getType(e){return ue("id",e,ne()),O(be(this,ge,"f").getType(e))}setSelected(e,t){return ue("id",e,ne()),ue("selected",t,re()),O(be(this,ge,"f").setSelected(e,t))}isSelected(e){return ue("id",e,ne()),O(be(this,ge,"f").isSelected(e))}findAllSelected(){return he(be(this,ge,"f").findAllSelected())}isGroupable(e){return ue("ids",e,se(te(oe()))),O(be(this,ge,"f").isGroupable(e))}group(e){return ue("ids",e,se(te(oe()))),O(be(this,ge,"f").group(e))}ungroup(e){return ue("id",e,oe()),O(be(this,ge,"f").ungroup(e))}enterGroup(e){return ue("id",e,oe()),O(be(this,ge,"f").enterGroup(e))}exitGroup(e){return ue("id",e,oe()),O(be(this,ge,"f").exitGroup(e))}setName(e,t){return ue("id",e,ne()),ue("name",t,ie()),be(this,ve,"f").setValue(e,pe.Common,"name",t)}getName(e){return ue("id",e,ne()),be(this,ve,"f").getValue(e,pe.Common,"name")}findByName(e){ue("name",e,ie());const t=be(this,ge,"f").findByName(e);return he(t)}findByType(e){ue("type",e,ie());const t=O(be(this,ge,"f").findByType(e));return he(t)}findAll(){return he(be(this,ge,"f").findAll())}findAllPlaceholders(){return he(be(this,ge,"f").findAllPlaceholders())}isVisible(e){return ue("id",e,ne()),O(be(this,ge,"f").isVisible(e))}setVisible(e,t){return ue("id",e,ne()),ue("visible",t,re()),O(be(this,ge,"f").setVisible(e,t))}isClipped(e){return ue("id",e,ne()),O(be(this,ge,"f").isClipped(e))}setClipped(e,t){return ue("id",e,ne()),ue("clipped",t,re()),O(be(this,ge,"f").setClipped(e,t))}getPositionX(e){return ue("id",e,ne()),O(be(this,ge,"f").getPositionX(e))}getPositionXMode(e){return ue("id",e,ne()),O(be(this,ge,"f").getPositionXMode(e))}getPositionY(e){return ue("id",e,ne()),O(be(this,ge,"f").getPositionY(e))}getPositionYMode(e){return ue("id",e,ne()),O(be(this,ge,"f").getPositionYMode(e))}setPositionX(e,t){return ue("id",e,ne()),ue("value",t,oe()),O(be(this,ge,"f").setPositionX(e,t))}setPositionXMode(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setPositionXMode(e,t))}setPositionY(e,t){return ue("id",e,ne()),ue("value",t,oe()),O(be(this,ge,"f").setPositionY(e,t))}setPositionYMode(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setPositionYMode(e,t))}getRotation(e){return ue("id",e,ne()),O(be(this,ge,"f").getRotation(e))}setRotation(e,t){return ue("id",e,ne()),ue("radians",t,oe()),O(be(this,ge,"f").setRotation(e,t))}getFlipHorizontal(e){return ue("id",e,ne()),O(be(this,ge,"f").getFlip(e)).horizontal}getFlipVertical(e){return ue("id",e,ne()),O(be(this,ge,"f").getFlip(e)).vertical}setFlipHorizontal(e,t){return ue("id",e,ne()),ue("flip",t,re()),O(be(this,ge,"f").setFlipHorizontal(e,t))}setFlipVertical(e,t){return ue("id",e,ne()),ue("flip",t,re()),O(be(this,ge,"f").setFlipVertical(e,t))}hasPlaceholderContent(e){return ue("id",e,ne()),O(be(this,ge,"f").hasPlaceholderContent(e))}getWidth(e){return ue("id",e,ne()),O(be(this,ge,"f").getWidth(e))}getWidthMode(e){return ue("id",e,ne()),O(be(this,ge,"f").getWidthMode(e))}getHeight(e){return ue("id",e,ne()),O(be(this,ge,"f").getHeight(e))}getHeightMode(e){return ue("id",e,ne()),O(be(this,ge,"f").getHeightMode(e))}getContentFillMode(e){return ue("id",e,ne()),O(be(this,ge,"f").getContentFillMode(e))}setWidth(e,t){return ue("id",e,ne()),ue("value",t,oe()),O(be(this,ge,"f").setWidth(e,t))}setWidthMode(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setWidthMode(e,t))}setHeight(e,t){return ue("id",e,ne()),ue("value",t,oe()),O(be(this,ge,"f").setHeight(e,t))}setHeightMode(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setHeightMode(e,t))}setContentFillMode(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setContentFillMode(e,t))}getFrameWidth(e){return ue("id",e,ne()),O(be(this,ge,"f").getLastFrameWidth(e))}getFrameHeight(e){return ue("id",e,ne()),O(be(this,ge,"f").getLastFrameHeight(e))}duplicate(e){return ue("id",e,ne()),O(be(this,ge,"f").duplicate(e))}destroy(e){return ue("id",e,ne()),O(be(this,ge,"f").destroy(e))}isValid(e){return ue("id",e,ne()),be(this,ge,"f").isValid(e)}getParent(e){return ue("id",e,ne()),O(be(this,ge,"f").getParent(e))}getChildren(e){ue("id",e,ne());const t=O(be(this,ge,"f").getChildren(e));return he(t)}insertChild(e,t,r){return ue("parent",e,oe()),ue("child",t,oe()),ue("index",r,ae(oe(),0)),O(be(this,ge,"f").insertChild(e,t,r))}appendChild(e,t){return ue("parent",e,oe()),ue("child",t,oe()),O(be(this,ge,"f").appendChild(e,t))}referencesAnyVariables(e){return ue("id",e,ne()),O(be(this,ge,"f").referencesAnyVariables(e))}getGlobalBoundingBoxX(e){return ue("id",e,ne()),O(be(this,ge,"f").getGlobalBoundingBoxX(e))}getGlobalBoundingBoxY(e){return ue("id",e,ne()),O(be(this,ge,"f").getGlobalBoundingBoxY(e))}getGlobalBoundingBoxWidth(e){return ue("id",e,ne()),O(be(this,ge,"f").getGlobalBoundingBoxWidth(e))}getGlobalBoundingBoxHeight(e){return ue("id",e,ne()),O(be(this,ge,"f").getGlobalBoundingBoxHeight(e))}scale(e,t,r=0,n=0){return ue("id",e,ne()),O(be(this,ge,"f").scale(e,t,r,n))}findAllProperties(e){return ue("id",e,ne()),he(O(be(this,ge,"f").findAllProperties(e)))}getPropertyType(e){return ue("property",e,ie()),O(be(this,ge,"f").getPropertyType(e))}getEnumValues(e){return ue("enumProperty",e,ie()),he(O(be(this,ge,"f").getEnumValues(e)))}setBool(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,re()),O(be(this,ge,"f").setBool(e,t,r))}getBool(e,t){return ue("id",e,ne()),ue("property",t,ie()),O(be(this,ge,"f").getBool(e,t))}setInt(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,ne()),O(be(this,ge,"f").setInt(e,t,r))}getInt(e,t){return ue("id",e,ne()),ue("property",t,ie()),O(be(this,ge,"f").getInt(e,t))}setFloat(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,oe()),O(be(this,ge,"f").setFloat(e,t,r))}getFloat(e,t){return ue("id",e,ne()),ue("property",t,ie()),O(be(this,ge,"f").getFloat(e,t))}setString(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,ie()),O(be(this,ge,"f").setString(e,t,r))}getString(e,t){return ue("id",e,ne()),ue("property",t,ie()),O(be(this,ge,"f").getString(e,t))}setColorRGBA(e,t,r,n,o,i){return ue("id",e,ne()),ue("property",t,ie()),ue("r",r,oe()),ue("g",n,oe()),ue("b",o,oe()),ue("a",i,oe()),O(be(this,ge,"f").setColorRGBA(e,t,r,n,o,i))}getColorRGBA(e,t){return ue("id",e,ne()),ue("property",t,ie()),O(be(this,ge,"f").getColorRGBA(e,t))}setEnum(e,t,r){return ue("id",e,ne()),ue("property",t,ie()),ue("value",r,ie()),O(be(this,ge,"f").setEnum(e,t,r))}getEnum(e,t){return ue("id",e,ne()),ue("property",t,ie()),O(be(this,ge,"f").getEnum(e,t))}hasCrop(e){return ue("id",e,ne()),O(be(this,ge,"f").hasCrop(e))}setCropScaleX(e,t){return ue("id",e,ne()),ue("scaleX",t,oe()),O(be(this,ge,"f").setCropScaleX(e,t))}setCropScaleY(e,t){return ue("id",e,ne()),ue("scaleY",t,oe()),O(be(this,ge,"f").setCropScaleY(e,t))}setCropRotation(e,t){return ue("id",e,ne()),ue("rotation",t,oe()),O(be(this,ge,"f").setCropRotation(e,t))}setCropTranslationX(e,t){return ue("id",e,ne()),ue("translationX",t,oe()),O(be(this,ge,"f").setCropTranslationX(e,t))}setCropTranslationY(e,t){return ue("id",e,ne()),ue("translationY",t,oe()),O(be(this,ge,"f").setCropTranslationY(e,t))}resetCrop(e){return ue("id",e,ne()),O(be(this,ge,"f").resetCrop(e))}getCropScaleX(e){return ue("id",e,ne()),O(be(this,ge,"f").getCropScaleX(e))}getCropScaleY(e){return ue("id",e,ne()),O(be(this,ge,"f").getCropScaleY(e))}getCropRotation(e){return ue("id",e,ne()),O(be(this,ge,"f").getCropRotation(e))}getCropTranslationX(e){return ue("id",e,ne()),O(be(this,ge,"f").getCropTranslationX(e))}getCropTranslationY(e){return ue("id",e,ne()),O(be(this,ge,"f").getCropTranslationY(e))}hasOpacity(e){return ue("id",e,ne()),O(be(this,ge,"f").hasOpacity(e))}setOpacity(e,t){return ue("id",e,ne()),ue("opacity",t,oe()),O(be(this,ge,"f").setOpacity(e,t))}getOpacity(e){return ue("id",e,ne()),O(be(this,ge,"f").getOpacity(e))}setBlendMode(e,t){return ue("id",e,ne()),ue("blendMode",t,ie()),O(be(this,ge,"f").setBlendMode(e,t))}getBlendMode(e){return ue("id",e,ne()),O(be(this,ge,"f").getBlendMode(e))}hasFillColor(e){return ue("id",e,ne()),O(be(this,ge,"f").hasFillColor(e))}setFillColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),O(be(this,ge,"f").setFillColorRGBA(e,t,r,n,o))}getFillColorRGBA(e){return ue("id",e,ne()),O(be(this,ge,"f").getFillColorRGBA(e))}setFillColorEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),O(be(this,ge,"f").setFillColorEnabled(e,t))}isFillColorEnabled(e){return ue("id",e,ne()),O(be(this,ge,"f").isFillColorEnabled(e))}hasBackgroundColor(e){return ue("id",e,ne()),O(be(this,ge,"f").hasBackgroundColor(e))}setBackgroundColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),O(be(this,ge,"f").setBackgroundColorRGBA(e,t,r,n,o))}getBackgroundColorRGBA(e){return ue("id",e,ne()),O(be(this,ge,"f").getBackgroundColorRGBA(e))}setBackgroundColorEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),O(be(this,ge,"f").setBackgroundColorEnabled(e,t))}isBackgroundColorEnabled(e){return ue("id",e,ne()),O(be(this,ge,"f").isBackgroundColorEnabled(e))}hasStroke(e){return ue("id",e,ne()),O(be(this,ge,"f").hasStroke(e))}setStrokeEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),O(be(this,ge,"f").setStrokeEnabled(e,t))}isStrokeEnabled(e){return ue("id",e,ne()),O(be(this,ge,"f").isStrokeEnabled(e))}setStrokeColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),O(be(this,ge,"f").setStrokeColorRGBA(e,t,r,n,o))}getStrokeColorRGBA(e){return ue("id",e,ne()),O(be(this,ge,"f").getStrokeColorRGBA(e))}setStrokeWidth(e,t){return ue("id",e,ne()),ue("width",t,oe()),O(be(this,ge,"f").setStrokeWidth(e,t))}getStrokeWidth(e){return ue("id",e,ne()),O(be(this,ge,"f").getStrokeWidth(e))}setStrokeStyle(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setStrokeStyle(e,t))}getStrokeStyle(e){return ue("id",e,ne()),O(be(this,ge,"f").getStrokeStyle(e))}setStrokePosition(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setStrokePosition(e,t))}getStrokePosition(e){return ue("id",e,ne()),O(be(this,ge,"f").getStrokePosition(e))}setStrokeCornerGeometry(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setStrokeCornerGeometry(e,t))}getStrokeCornerGeometry(e){return ue("id",e,ne()),O(be(this,ge,"f").getStrokeCornerGeometry(e))}hasOutline(e){return ue("id",e,ne()),this.hasStroke(e)}setOutlineColorRGBA(e,t,r,n,o){return ue("id",e,ne()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),this.setStrokeColorRGBA(e,t,r,n,o)}getOutlineColorRGBA(e){return ue("id",e,ne()),this.getStrokeColorRGBA(e)}setOutlineEnabled(e,t){return ue("id",e,ne()),ue("enabled",t,re()),this.setStrokeEnabled(e,t)}isOutlineEnabled(e){return ue("id",e,ne()),this.isStrokeEnabled(e)}setOutlineWidth(e,t){return ue("id",e,ne()),ue("width",t,oe()),this.setStrokeWidth(e,t)}getOutlineWidth(e){return ue("id",e,ne()),this.getStrokeWidth(e)}hasFill(e){return ue("id",e,ne()),O(be(this,ge,"f").hasFill(e))}isFillEnabled(e){return ue("id",e,ne()),O(be(this,ge,"f").isFillEnabled(e))}setFillEnabled(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setFillEnabled(e,t))}setFillType(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setFillType(e,t))}getFillType(e){return ue("id",e,ne()),O(be(this,ge,"f").getFillType(e))}setFillSolidColor(e,t,r,n,o){ue("id",e,ne()),O(be(this,ge,"f").setFillSolidColor(e,t,n,r,o))}getFillSolidColor(e){return ue("id",e,ne()),O(be(this,ge,"f").getFillSolidColor(e))}setFillGradientType(e,t){ue("id",e,ne()),O(be(this,ge,"f").setFillGradientType(e,t))}getFillGradientType(e){return ue("id",e,ne()),O(be(this,ge,"f").getFillGradientType(e))}addFillGradientColorStop(e,t,r,n,o,i){ue("id",e,ne()),O(be(this,ge,"f").addFillGradientColorStop(e,t,r,n,o,i))}removeFillGradientColorStop(e,t){ue("id",e,ne()),O(be(this,ge,"f").removeFillGradientColorStop(e,t))}getFillGradientColorStops(e){return ue("id",e,ne()),he(be(this,ge,"f").getFillGradientColorStops(e))}setFillGradientColorStops(e,t){ue("id",e,ne()),O(be(this,ge,"f").setFillGradientColorStops(e,t))}setFillGradientControlPoint(e,t,r,n){return ue("id",e,ne()),O(be(this,ge,"f").setFillGradientControlPoint(e,t,r,n))}getFillGradientControlPointX(e,t){return ue("id",e,ne()),O(be(this,ge,"f").getFillGradientControlPointX(e,t))}getFillGradientControlPointY(e,t){return ue("id",e,ne()),O(be(this,ge,"f").getFillGradientControlPointY(e,t))}setFillGradientRadius(e,t){return ue("id",e,ne()),O(be(this,ge,"f").setFillGradientRadius(e,t))}getFillGradientRadius(e){return ue("id",e,ne()),O(be(this,ge,"f").getFillGradientRadius(e))}}ge=new WeakMap,ve=new WeakMap;var we,Ee=r(7168),xe=r.n(Ee);!function(e){e.Info="Info",e.Warning="Warning",e.Error="Error"}(we||(we={}));const ke={baseURL:"/extensions/",entries:["ly.img.cesdk.filters.duotone","ly.img.cesdk.filters.lut","ly.img.cesdk.stickers.emoticons","ly.img.cesdk.vectorpaths","ly.img.cesdk.vectorpaths.abstract","ly.img.cesdk.fonts","ly.img.cesdk.images.samples","ly.img.cesdk.effects","ly.img.cesdk.stickers.doodle","ly.img.cesdk.stickers.hand","ly.img.cesdk.stickers.emoji"]},Se={company_name:{value:"img.ly"},first_name:{value:"Charly"},last_name:{value:"Williams"},address:{value:"742 Evergreen Terrace"},city:{value:"Springfield"}},Te=(e,t)=>{const r=`[UBQ] ${e}`;switch(t){case we.Warning:console.warn(r);break;case we.Error:console.error(r);break;case we.Info:default:console.log(r)}},Ce={log:Te},Pe={colorPalettes:{primary:{meta:{default:!0},entries:["#FFFFFF","#000000","#6686FF","#66CCFF","#54FFEA","#E75050","#F28855","#FFF763"]}},pageFormats:{"din-a0":{width:1189,height:841,unit:"mm"},"din-a1":{width:841,height:594,unit:"mm"},"din-a2":{width:594,height:420,unit:"mm"},"din-a3":{width:420,height:297,unit:"mm"},"din-a4":{width:297,height:210,unit:"mm"},"din-a5":{width:210,height:148,unit:"mm"},"din-a6":{meta:{default:!0},width:148,height:105,unit:"mm"},"din-a65":{width:210,height:105,unit:"mm"},"din-b5":{width:250,height:176,unit:"mm"},square:{width:105,height:105,unit:"mm"},"twitter-profile":{width:400,height:400,unit:"px"},"twitter-image":{width:1024,height:512,unit:"px"},"twitter-header":{width:1500,height:500,unit:"px"},"instagram-profile":{width:180,height:180,unit:"px"},"instagram-photo":{width:1080,height:1080,unit:"px"},"instagram-story":{width:1080,height:1920,unit:"px"},"american-letter":{width:8.5,height:11,unit:"in"},"american-legal":{width:8.5,height:14,unit:"in"},"16:10":{width:1600,height:1e3,unit:"px"},"16:9":{width:1600,height:900,unit:"px"},"16:10@2400p":{width:3840,height:2400,unit:"px"},"16:9@2160p":{width:3840,height:2160,unit:"px"},"business-card":{width:85,height:55,unit:"mm"}}},Ae={baseURL:"core/"},Fe={maskSpotColor:void 0,dpi:300,pixelScaleFactor:1},De={title:{fontFileUri:"bundle://ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",show:!0},dimOutOfPageAreas:!0};function Le(e,t=("undefined"==typeof window?"":window.location.href)){return new URL(e,""===t?void 0:t).toString()}function Ie(e){return"/"!==e[e.length-1]?`${e}/`:e}function Re(e={}){var t,r,n,o,i,a,s,c,u,l,d,f,m,p,h;const g={license:e.license,role:null!==(t=e.role)&&void 0!==t?t:"Creator",featureFlags:null!==(r=e.featureFlags)&&void 0!==r?r:{},baseURL:null!==(n=e.baseURL)&&void 0!==n?n:"https://cdn.img.ly/packages/imgly/cesdk-engine/1.6.3/assets",core:null!==(o=e.core)&&void 0!==o?o:Object.assign({},Ae),extensions:null!==(i=e.extensions)&&void 0!==i?i:Object.assign({},ke),callbacks:null!==(a=e.callbacks)&&void 0!==a?a:Object.assign({},Ce),variables:null!==(s=e.variables)&&void 0!==s?s:Object.assign({},Se),presets:null!==(c=e.presets)&&void 0!==c?c:Object.assign({},Pe),scene:null!==(u=e.scene)&&void 0!==u?u:Object.assign({},Fe),page:xe()({},De,null!==(l=e.page)&&void 0!==l?l:{}),assetSources:xe()({},e.assetSources),defaultFont:null!==(d=e.defaultFont)&&void 0!==d?d:void 0};return null!==(f=(p=g.extensions).baseURL)&&void 0!==f||(p.baseURL=ke.baseURL),null!==(m=(h=g.extensions).entries)&&void 0!==m||(h.entries=Object.assign({},ke.entries)),Object.entries(Pe).forEach((([e,t])=>{var r;g.presets[e]=null!==(r=g.presets[e])&&void 0!==r?r:Object.assign({},t)})),g.baseURL=Le(g.baseURL),g.baseURL=Ie(g.baseURL),g.core.baseURL=Le(g.core.baseURL,g.baseURL),g.core.baseURL=Ie(g.core.baseURL),g.extensions.baseURL=Ie(g.extensions.baseURL),g.extensions.entries=g.extensions.entries.map((e=>Ie(e))),g}var Me,Oe,Be=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Ue=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ne{constructor(e){Me.set(this,void 0),Oe.set(this,void 0),Be(this,Me,e,"f"),Be(this,Oe,new M(e),"f")}onStateChanged(e){const t=Ue(this,Me,"f").subscribeToEditorState(e);return()=>{O(Ue(this,Me,"f").unsubscribe(t))}}setEditMode(e){ue("keypath",e,ie()),Ue(this,Me,"f").setEditMode(e)}getEditMode(){return Ue(this,Me,"f").getEditMode()}getCursorType(){return Ue(this,Me,"f").getCursorType()}getCursorRotation(){return Ue(this,Me,"f").getCursorRotation()}getTextCursorPositionInScreenSpaceX(){return Ue(this,Me,"f").getTextCursorPositionInScreenSpaceX()}getTextCursorPositionInScreenSpaceY(){return Ue(this,Me,"f").getTextCursorPositionInScreenSpaceY()}setZoomLevel(e=1){ue("zoomLevel",e,ae(oe(),0)),Ue(this,Me,"f").setZoomLevel(e)}getZoomLevel(){return O(Ue(this,Me,"f").getZoomLevel())}addUndoStep(){O(Ue(this,Me,"f").addUndoStep())}undo(){O(Ue(this,Me,"f").undo())}redo(){O(Ue(this,Me,"f").redo())}canUndo(){return O(Ue(this,Me,"f").canUndo())}canRedo(){return O(Ue(this,Me,"f").canRedo())}setSettingBool(e,t){return ue("keypath",e,ie()),ue("value",t,re()),O(Ue(this,Me,"f").setSettingBool(e,t))}getSettingBool(e){return ue("keypath",e,ie()),O(Ue(this,Me,"f").getSettingBool(e))}setSettingInt(e,t){return ue("keypath",e,ie()),ue("value",t,ne()),O(Ue(this,Me,"f").setSettingFloat(e,t))}getSettingInt(e){return ue("keypath",e,ie()),O(Ue(this,Me,"f").getSettingFloat(e))}setSettingFloat(e,t){return ue("keypath",e,ie()),ue("value",t,oe()),O(Ue(this,Me,"f").setSettingFloat(e,t))}getSettingFloat(e){return ue("keypath",e,ie()),O(Ue(this,Me,"f").getSettingFloat(e))}setSettingString(e,t){return ue("keypath",e,ie()),ue("value",t,ie()),O(Ue(this,Me,"f").setSettingString(e,t))}getSettingString(e){return ue("keypath",e,ie()),O(Ue(this,Me,"f").getSettingString(e))}setSettingColorRGBA(e,t,r,n,o){return ue("keypath",e,ie()),ue("r",t,oe()),ue("g",r,oe()),ue("b",n,oe()),ue("a",o,oe()),O(Ue(this,Me,"f").setSettingColorRGBA(e,t,r,n,o))}getSettingColorRGBA(e){return ue("keypath",e,ie()),O(Ue(this,Me,"f").getSettingColorRGBA(e))}setSettingEnum(e,t){return ue("keypath",e,ie()),ue("value",t,ie()),O(Ue(this,Me,"f").setSettingEnum(e,t))}getSettingEnum(e){return ue("keypath",e,ie()),O(Ue(this,Me,"f").getSettingEnum(e))}}Me=new WeakMap,Oe=new WeakMap;var je,qe=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ge{constructor(e){je.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,je,e,"f")}subscribe(e,t){ue("blocks",e,te());const r=qe(this,je,"f").subscribe(e,(e=>{try{t(he(e,!0))}catch(e){console.error(e)}}));return()=>{O(qe(this,je,"f").unsubscribe(r))}}}je=new WeakMap;var We,ze=(We="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(e,r){t=e,n=r})),Object.getOwnPropertyDescriptor(o.ready,"_main")||(Object.defineProperty(o.ready,"_main",{configurable:!0,get:function(){Ve("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"_main",{configurable:!0,set:function(){Ve("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___getTypeName")||(Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,get:function(){Ve("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,set:function(){Ve("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get:function(){Ve("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set:function(){Ve("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___stdio_exit")||(Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,get:function(){Ve("You are getting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,set:function(){Ve("You are setting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"onRuntimeInitialized")||(Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,get:function(){Ve("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,set:function(){Ve("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),o.expectedDataFileDownloads||(o.expectedDataFileDownloads=0),o.expectedDataFileDownloads++,o.ENVIRONMENT_IS_PTHREAD||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 o.locateFilePackage||o.locateFile||(o.locateFile=o.locateFilePackage,x("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var r,n,i,a,s=o.locateFile?o.locateFile(t,""):t,c=e.remote_package_size,u=null,l=o.getPreloadedPackage?o.getPreloadedPackage(s,c):null;function d(){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}o.FS_createPath("/","ly.img.cesdk",!0,!0),o.FS_createPath("/ly.img.cesdk","images",!0,!0),o.FS_createPath("/ly.img.cesdk","shaders",!0,!0),o.FS_createPath("/ly.img.cesdk/shaders","common",!0,!0),o.FS_createPath("/ly.img.cesdk","presets",!0,!0),o.FS_createPath("/ly.img.cesdk","fonts",!0,!0),r.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,o.addRunDependency("fp "+this.name)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){o.FS_createDataFile(this.name,null,e,!0,!0,!0),o.removeRunDependency("fp "+this.name),this.requests[this.name]=null}};for(var n=e.files,i=0;i<n.length;++i)new r(n[i].start,n[i].end,n[i].audio||0).open("GET",n[i].filename);function a(n){t(n,"Loading data file failed."),t(n instanceof ArrayBuffer,"bad input to processPackageData");var i=new Uint8Array(n);r.prototype.byteArray=i;for(var a=e.files,s=0;s<a.length;++s)r.prototype.requests[a[s].filename].onload();o.removeRunDependency("datafile_cesdk.data")}o.addRunDependency("datafile_cesdk.data"),o.preloadResults||(o.preloadResults={}),o.preloadResults["cesdk.data"]={fromCache:!1},l?(a(l),l=null):u=a}l||(r=s,n=c,i=function(e){u?(u(e),u=null):l=e},(a=new XMLHttpRequest).open("GET",r,!0),a.responseType="arraybuffer",a.onprogress=function(e){var t=r,i=n;if(e.total&&(i=e.total),e.loaded){a.addedTotal?o.dataFileDownloads[t].loaded=e.loaded:(a.addedTotal=!0,o.dataFileDownloads||(o.dataFileDownloads={}),o.dataFileDownloads[t]={loaded:e.loaded,total:i});var s=0,c=0,u=0;for(var l in o.dataFileDownloads){var d=o.dataFileDownloads[l];s+=d.total,c+=d.loaded,u++}s=Math.ceil(s*o.expectedDataFileDownloads/u),o.setStatus&&o.setStatus("Downloading data... ("+c+"/"+s+")")}else o.dataFileDownloads||o.setStatus&&o.setStatus("Downloading data...")},a.onerror=function(e){throw new Error("NetworkError for: "+r)},a.onload=function(e){if(!(200==a.status||304==a.status||206==a.status||0==a.status&&a.response))throw new Error(a.statusText+" : "+a.responseURL);var t=a.response;i(t)},a.send(null)),o.calledRun?d():(o.preRun||(o.preRun=[]),o.preRun.push(d))}({files:[{filename:"/ly.img.cesdk/images/watermark.png",start:0,end:90147},{filename:"/ly.img.cesdk/shaders/liquid.sksl",start:90147,end:90629},{filename:"/ly.img.cesdk/shaders/mirror.sksl",start:90629,end:91083},{filename:"/ly.img.cesdk/shaders/outliner.sksl",start:91083,end:92720},{filename:"/ly.img.cesdk/shaders/tv_glitch.sksl",start:92720,end:93438},{filename:"/ly.img.cesdk/shaders/mask_color.sksl",start:93438,end:93940},{filename:"/ly.img.cesdk/shaders/lut_filter.sksl",start:93940,end:96803},{filename:"/ly.img.cesdk/shaders/vignette.sksl",start:96803,end:97175},{filename:"/ly.img.cesdk/shaders/sharpie.sksl",start:97175,end:99480},{filename:"/ly.img.cesdk/shaders/hsp_selective_adjustments.sksl",start:99480,end:113080},{filename:"/ly.img.cesdk/shaders/half_tone.sksl",start:113080,end:113574},{filename:"/ly.img.cesdk/shaders/tiltshift.sksl",start:113574,end:114156},{filename:"/ly.img.cesdk/shaders/pixelize.sksl",start:114156,end:114456},{filename:"/ly.img.cesdk/shaders/linocut.sksl",start:114456,end:115241},{filename:"/ly.img.cesdk/shaders/glow.sksl",start:115241,end:116208},{filename:"/ly.img.cesdk/shaders/radial_pixel.sksl",start:116208,end:116771},{filename:"/ly.img.cesdk/shaders/black_and_white_color_mixer.sksl",start:116771,end:123088},{filename:"/ly.img.cesdk/shaders/shifter.sksl",start:123088,end:123772},{filename:"/ly.img.cesdk/shaders/posterize.sksl",start:123772,end:123984},{filename:"/ly.img.cesdk/shaders/dot_pattern.sksl",start:123984,end:124499},{filename:"/ly.img.cesdk/shaders/adjustments.sksl",start:124499,end:128388},{filename:"/ly.img.cesdk/shaders/extrude_blur.sksl",start:128388,end:130505},{filename:"/ly.img.cesdk/shaders/duotone_filter.sksl",start:130505,end:131469},{filename:"/ly.img.cesdk/shaders/cross_cut.sksl",start:131469,end:132416},{filename:"/ly.img.cesdk/shaders/placeholder_overlay_lines.sksl",start:132416,end:132997},{filename:"/ly.img.cesdk/shaders/common/ubq_constants.sksl",start:132997,end:133487},{filename:"/ly.img.cesdk/shaders/common/ubq_adjustments.sksl",start:133487,end:138050},{filename:"/ly.img.cesdk/shaders/common/ubq_color_conversions.sksl",start:138050,end:148035},{filename:"/ly.img.cesdk/shaders/common/ubq_hue_constants.sksl",start:148035,end:151202},{filename:"/ly.img.cesdk/shaders/common/ubq_noise.sksl",start:151202,end:153840},{filename:"/ly.img.cesdk/presets/.keep",start:153840,end:153840},{filename:"/ly.img.cesdk/fonts/imgly_font_inter_semibold.otf",start:153840,end:424600}],remote_package_size:424600,package_uuid:"f44ed5e1-5b12-46ea-a294-d640eb5be4c2"}),o.ENVIRONMENT_IS_PTHREAD&&(o.preRun=[]);var i=o.preRun.slice();"object"==typeof window&&"object"==typeof window.performance?o.performance=performance:"object"==typeof r.g&&"object"==typeof r.g.perf_hooks&&"object"==typeof r.g.perf_hooks.performance?o.performance=r.g.perf_hooks.performance:o.performance={mark:function(){},measure:function(){}},o.emscripten_ubq_asyncFetchStates=new Map,o.emscripten_ubq_asyncFetchCompletedBytes=new Map,o.emscripten_ubq_asyncFetchTotalBytes=new Map,o.emscripten_ubq_asyncFetchHeaders=new Map,o.emscripten_ubq_asyncFetchNextHandle=0,o.emscripten_ubq_asyncFetchNextHeaderHandle=0;const a={PENDING:0,FINISHED:1,ALLOCATED:2,ERROR:3},s=["GET","POST"];if(o.emscripten_ubq_codec_decoders=new Map,o.emscripten_ubq_codec_encoders=new Map,o.emscripten_ubq_codec_decoderNextHandle=1,o.emscripten_ubq_codec_encoderNextHandle=1,o.emscripten_ubq_codec_createVideoDecoder=function(e){const t=new VideoDecoder({output:r=>{if(t.decodedFrames%=t.numberOfFrames,t.decodedFrames++,t.probing&&1===t.decodedFrames)return(n=o.ctx).bindTexture(n.TEXTURE_2D,e[0]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),void r.close();if(t.decodeQueueSize>0||t.probing)return void r.close();var n=o.ctx;const i=(t.decodedFrames-1)%e.length;n.bindTexture(n.TEXTURE_2D,e[i]),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),r.close(),t.textureUploadFlag=!0},error:e=>console.error(e)});return t.decodedFrames=0,t},!o.preRun)throw"Module.preRun should exist because file support used it; did a pre-js delete it?";i.forEach((function(e){if(o.preRun.indexOf(e)<0)throw"All preRun tasks that exist before user pre-js code should remain after; did you replace Module or modify Module.preRun?"}));var c=Object.assign({},o),u=[],l="./this.program",d=(e,t)=>{throw t},f="object"==typeof window,m="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,h=!f&&!p&&!m;if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var g,v,y,b="";function _(e){return o.locateFile?o.locateFile(e,b):b+e}function w(e){if(e instanceof pf)return;let t=e;e&&"object"==typeof e&&e.stack&&(t=[e,e.stack]),x("exiting due to exception: "+t)}if(h){if("object"==typeof process||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(g=function(e){return read(e)}),y=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),N("object"==typeof t),t)},v=function(e,t,r){setTimeout((()=>t(y(e))),0)},"undefined"!=typeof scriptArgs?u=scriptArgs:void 0!==arguments&&(u=arguments),"function"==typeof quit&&(d=(e,t)=>{if(Ce)throw t;w(t),quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!f&&!m)throw new Error("environment detection error");if(m?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),We&&(b=We),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");g=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(y=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),v=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var E=o.print||console.log.bind(console),x=o.printErr||console.warn.bind(console);function k(e){k.shown||(k.shown={}),k.shown[e]||(k.shown[e]=1,x(e))}function S(e,t){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get:function(){Ve("Module."+e+" has been replaced with plain "+t+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function T(e){Object.getOwnPropertyDescriptor(o,e)&&Ve("`Module."+e+"` was supplied but `"+e+"` not included in INCOMING_MODULE_JS_API")}function C(e,t){var r="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";return t&&(r+=". Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you"),r}function P(e,t){Object.getOwnPropertyDescriptor(o,e)||Object.defineProperty(o,e,{configurable:!0,get:function(){Ve(C(e,t))}})}function A(e,t){Object.getOwnPropertyDescriptor(o,e)||(o[e]=()=>Ve(C(e,t)))}Object.assign(o,c),c=null,Ud(),o.arguments&&(u=o.arguments),S("arguments","arguments_"),o.thisProgram&&(l=o.thisProgram),S("thisProgram","thisProgram"),o.quit&&(d=o.quit),S("quit","quit_"),N(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),N(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),N(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),N(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),N(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),N(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),N(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),N(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),N(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),S("read","read_"),S("readAsync","readAsync"),S("readBinary","readBinary"),S("setWindowTitle","setWindowTitle"),N(!p,"node environment detected but not enabled at build time. Add 'node' to `-s ENVIRONMENT` to enable."),N(!h,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");var F,D=0,L=e=>{D=e},I=()=>D;o.wasmBinary&&(F=o.wasmBinary),S("wasmBinary","wasmBinary");var R,M=o.noExitRuntime||!0;function O(e,t="i8",r){switch("*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return $[e>>0];case"i16":return X[e>>1];case"i32":return Q[e>>2];case"i64":return Number(ee[e>>3]);case"float":return J[e>>2];case"double":return Number(re[e>>3]);default:Ve("invalid type for getValue: "+t)}return null}S("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&Ve("no native wasm support detected");var B,U=!1;function N(e,t){e||Ve("Assertion failed"+(t?": "+t:""))}var j="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function q(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&j)return j.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|c:(240!=(248&a)&&k("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|c<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function G(e,t){return e?q(Y,e,t):""}function W(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>1114111&&k("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function z(e,t,r){return N("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),W(e,Y,t,r)}function V(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}var H,$,Y,X,K,Q,Z,J,ee,te,re,ne="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function oe(e,t){N(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&K[n];)++n;if((r=n<<1)-e>32&&ne)return ne.decode(Y.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=X[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function ie(e,t,r){if(N(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),N("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);X[t>>1]=a,t+=2}return X[t>>1]=0,t-n}function ae(e){return 2*e.length}function se(e,t){N(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var o=Q[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function ce(e,t,r){if(N(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),N("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),Q[t>>2]=a,(t+=4)+4>o)break}return Q[t>>2]=0,t-n}function ue(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}function le(e){var t=V(e)+1,r=qd(t);return r&&W(e,$,r,t),r}function de(e){var t=V(e)+1,r=Zd(t);return W(e,$,r,t),r}function fe(e,t){N(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),$.set(e,t)}function me(e,t,r){for(var n=0;n<e.length;++n)N(e.charCodeAt(n)===(255&e.charCodeAt(n))),$[t++>>0]=e.charCodeAt(n);r||($[t>>0]=0)}function pe(e){H=e,o.HEAP8=$=new Int8Array(e),o.HEAP16=X=new Int16Array(e),o.HEAP32=Q=new Int32Array(e),o.HEAPU8=Y=new Uint8Array(e),o.HEAPU16=K=new Uint16Array(e),o.HEAPU32=Z=new Uint32Array(e),o.HEAPF32=J=new Float32Array(e),o.HEAPF64=re=new Float64Array(e),o.HEAP64=ee=new BigInt64Array(e),o.HEAPU64=te=new BigUint64Array(e)}var he=5242880;o.TOTAL_STACK&&N(he===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var ge,ve=o.INITIAL_MEMORY||268435456;function ye(){var e=Xd();N(0==(3&e)),Q[e>>2]=34821223,Q[e+4>>2]=2310721022,Q[0]=1668509029}function be(){if(!U){var e=Xd(),t=Z[e>>2],r=Z[e+4>>2];34821223==t&&2310721022==r||Ve("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16)),1668509029!==Q[0]&&Ve("Runtime error: The application has corrupted its heap memory area (address zero)!")}}S("INITIAL_MEMORY","INITIAL_MEMORY"),N(ve>=he,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+ve+"! (TOTAL_STACK="+he+")"),N("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),N(!o.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),N(268435456==ve,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"}();var _e=[],we=[],Ee=[],xe=[],ke=[],Se=!1,Te=!1,Ce=0;function Pe(){return M||Ce>0}function Ae(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)Re(o.preRun.shift());et(_e)}function Fe(){be(),N(!Se),Se=!0,o.noFSInit||Et.init.initialized||Et.init(),Et.ignorePermissions=!1,pt.init(),et(we)}function De(){be(),et(Ee)}function Le(){be(),Te=!0}function Ie(){if(be(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)Oe(o.postRun.shift());et(ke)}function Re(e){_e.unshift(e)}function Me(e){we.unshift(e)}function Oe(e){ke.unshift(e)}N(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),N(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),N(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),N(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Be=0,Ue=null,Ne=null,je={};function qe(e){for(var t=e;;){if(!je[e])return e;e=t+Math.random()}}function Ge(e){Be++,o.monitorRunDependencies&&o.monitorRunDependencies(Be),e?(N(!je[e]),je[e]=1,null===Ue&&"undefined"!=typeof setInterval&&(Ue=setInterval((function(){if(U)return clearInterval(Ue),void(Ue=null);var e=!1;for(var t in je)e||(e=!0,x("still waiting on run dependencies:")),x("dependency: "+t);e&&x("(end of list)")}),1e4))):x("warning: run dependency added without ID")}function ze(e){if(Be--,o.monitorRunDependencies&&o.monitorRunDependencies(Be),e?(N(je[e]),delete je[e]):x("warning: run dependency removed without ID"),0==Be&&(null!==Ue&&(clearInterval(Ue),Ue=null),Ne)){var t=Ne;Ne=null,t()}}function Ve(e){o.onAbort&&o.onAbort(e),x(e="Aborted("+e+")"),U=!0,B=1;var t=new WebAssembly.RuntimeError(e);throw n(t),t}o.preloadedImages={},o.preloadedAudios={};var He,$e="data:application/octet-stream;base64,";function Ye(e){return e.startsWith($e)}function Xe(e){return e.startsWith("file://")}function Ke(e,t){return function(){var r=e,n=t;return t||(n=o.asm),N(Se,"native function `"+r+"` called before runtime initialization"),N(!Te,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||N(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function Qe(e){try{if(e==He&&F)return new Uint8Array(F);if(y)return y(e);throw"both async and sync fetching of the wasm failed"}catch(e){Ve(e)}}function Ze(){return F||!f&&!m||"function"!=typeof fetch?Promise.resolve().then((function(){return Qe(He)})):fetch(He,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+He+"'";return e.arrayBuffer()})).catch((function(){return Qe(He)}))}function Je(){var e={env:jd,wasi_snapshot_preview1:jd};function t(e,t){var r=e.exports;o.asm=r,N(R=o.asm.memory,"memory not found in wasm exports"),pe(R.buffer),N(ge=o.asm.__indirect_function_table,"table not found in wasm exports"),Me(o.asm.__wasm_call_ctors),ze("wasm-instantiate")}Ge("wasm-instantiate");var r=o;function i(e){N(o===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function a(t){return Ze().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){x("failed to asynchronously prepare wasm: "+e),Xe(He)&&x("warning: Loading from a file URI ("+He+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),Ve(e)}))}if(o.instantiateWasm)try{return o.instantiateWasm(e,t)}catch(e){return x("Module.instantiateWasm callback failed with error: "+e),!1}return(F||"function"!=typeof WebAssembly.instantiateStreaming||Ye(He)||"function"!=typeof fetch?a(i):fetch(He,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(i,(function(e){return x("wasm streaming compile failed: "+e),x("falling back to ArrayBuffer instantiation"),a(i)}))}))).catch(n),{}}function et(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?ot(r)():ot(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(o)}}function tt(e){return k("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function rt(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=tt(e);return e===t?e:t+" ["+e+"]"}))}Ye(He="cesdk.wasm")||(He=_(He));var nt=[];function ot(e){var t=nt[e];return t||(e>=nt.length&&(nt.length=e+1),nt[e]=t=ge.get(e)),N(ge.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function it(e){if(e instanceof pf||"unwind"==e)return B;d(1,e)}function at(e,t,r,n){Ve("Assertion failed: "+G(e)+", at: "+[t?G(t):"unknown filename",r,n?G(n):"unknown function"])}function st(e){return qd(e+16)+16}function ct(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){Q[this.ptr+4>>2]=e},this.get_type=function(){return Q[this.ptr+4>>2]},this.set_destructor=function(e){Q[this.ptr+8>>2]=e},this.get_destructor=function(){return Q[this.ptr+8>>2]},this.set_refcount=function(e){Q[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,$[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=$[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,$[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=$[this.ptr+13>>0]},this.init=function(e,t){this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=Q[this.ptr>>2];Q[this.ptr>>2]=e+1},this.release_ref=function(){var e=Q[this.ptr>>2];return Q[this.ptr>>2]=e-1,N(e>0),1===e}}function ut(e,t,r){throw new ct(e).init(t,r),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s NO_DISABLE_EXCEPTION_CATCHING or -s EXCEPTION_CATCHING_ALLOWED=[..] to catch."}function lt(e){return Q[Wd()>>2]=e,e}var dt={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=dt.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=dt.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=dt.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return dt.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return dt.normalize(e.join("/"))},join2:function(e,t){return dt.normalize(e+"/"+t)}};function ft(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){Ve("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var mt={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Et.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=dt.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(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=mt.resolve(e).substr(1),t=mt.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},pt={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){pt.ttys[e]={input:[],output:[],ops:t},Et.registerDevice(e,pt.stream_ops)},stream_ops:{open:function(e){var t=pt.ttys[e.node.rdev];if(!t)throw new Et.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Et.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Et.ErrnoError(29)}if(void 0===s&&0===i)throw new Et.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Et.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new Et.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=Bd(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(q(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(q(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(x(q(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(x(q(e.output,0)),e.output=[])}}};function ht(e,t){Y.fill(0,e,e+t)}function gt(e,t){return N(t,"alignment argument is required"),Math.ceil(e/t)*t}function vt(e){e=gt(e,65536);var t=Hd(65536,e);return t?(ht(t,e),t):0}var yt={ops_table:null,mount:function(e){return yt.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(Et.isBlkdev(r)||Et.isFIFO(r))throw new Et.ErrnoError(63);yt.ops_table||(yt.ops_table={dir:{node:{getattr:yt.node_ops.getattr,setattr:yt.node_ops.setattr,lookup:yt.node_ops.lookup,mknod:yt.node_ops.mknod,rename:yt.node_ops.rename,unlink:yt.node_ops.unlink,rmdir:yt.node_ops.rmdir,readdir:yt.node_ops.readdir,symlink:yt.node_ops.symlink},stream:{llseek:yt.stream_ops.llseek}},file:{node:{getattr:yt.node_ops.getattr,setattr:yt.node_ops.setattr},stream:{llseek:yt.stream_ops.llseek,read:yt.stream_ops.read,write:yt.stream_ops.write,allocate:yt.stream_ops.allocate,mmap:yt.stream_ops.mmap,msync:yt.stream_ops.msync}},link:{node:{getattr:yt.node_ops.getattr,setattr:yt.node_ops.setattr,readlink:yt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:yt.node_ops.getattr,setattr:yt.node_ops.setattr},stream:Et.chrdev_stream_ops}});var o=Et.createNode(e,t,r,n);return Et.isDir(o.mode)?(o.node_ops=yt.ops_table.dir.node,o.stream_ops=yt.ops_table.dir.stream,o.contents={}):Et.isFile(o.mode)?(o.node_ops=yt.ops_table.file.node,o.stream_ops=yt.ops_table.file.stream,o.usedBytes=0,o.contents=null):Et.isLink(o.mode)?(o.node_ops=yt.ops_table.link.node,o.stream_ops=yt.ops_table.link.stream):Et.isChrdev(o.mode)&&(o.node_ops=yt.ops_table.chrdev.node,o.stream_ops=yt.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(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:function(e){var t={};return t.dev=Et.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,Et.isDir(e.mode)?t.size=4096:Et.isFile(e.mode)?t.size=e.usedBytes:Et.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:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&yt.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Et.genericErrors[44]},mknod:function(e,t,r,n){return yt.createNode(e,t,r,n)},rename:function(e,t,r){if(Et.isDir(e.mode)){var n;try{n=Et.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Et.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:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=Et.lookupNode(e,t);for(var n in r.contents)throw new Et.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=yt.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!Et.isLink(e.mode))throw new Et.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(N(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(N(!(t instanceof ArrayBuffer)),t.buffer===$.buffer&&(i=!1),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return N(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(yt.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Et.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Et.ErrnoError(28);return n},allocate:function(e,t,r){yt.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new Et.ErrnoError(28);if(!Et.isFile(e.node.mode))throw new Et.ErrnoError(43);var a,s,c=e.node.contents;if(2&i||c.buffer!==H){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),s=!0,!(a=vt(r)))throw new Et.ErrnoError(48);$.set(c,a)}else s=!1,a=c.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!Et.isFile(e.node.mode))throw new Et.ErrnoError(43);return 2&o||yt.stream_ops.write(e,t,0,n,r,!1),0}}};function bt(e,t,r,n){var o=n?"":qe("al "+e);v(e,(function(r){N(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&ze(o)}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Ge(o)}var _t={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},wt={},Et={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=mt.resolve(Et.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Et.ErrnoError(32);for(var r=dt.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=Et.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=Et.lookupNode(n,r[i]),o=dt.join2(o,r[i]),Et.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;Et.isLink(n.mode);){var c=Et.readlink(o);if(o=mt.resolve(dt.dirname(o),c),n=Et.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Et.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(Et.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Et.nameTable.length},hashAddNode:e=>{var t=Et.hashName(e.parent.id,e.name);e.name_next=Et.nameTable[t],Et.nameTable[t]=e},hashRemoveNode:e=>{var t=Et.hashName(e.parent.id,e.name);if(Et.nameTable[t]===e)Et.nameTable[t]=e.name_next;else for(var r=Et.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=Et.mayLookup(e);if(r)throw new Et.ErrnoError(r,e);for(var n=Et.hashName(e.id,t),o=Et.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Et.lookup(e,t)},createNode:(e,t,r,n)=>{N("object"==typeof e);var o=new Et.FSNode(e,t,r,n);return Et.hashAddNode(o),o},destroyNode:e=>{Et.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=Et.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Et.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>Et.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return Et.lookupNode(e,t),20}catch(e){}return Et.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=Et.lookupNode(e,t)}catch(e){return e.errno}var o=Et.nodePermissions(e,"wx");if(o)return o;if(r){if(!Et.isDir(n.mode))return 54;if(Et.isRoot(n)||Et.getPath(n)===Et.cwd())return 10}else if(Et.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Et.isLink(e.mode)?32:Et.isDir(e.mode)&&("r"!==Et.flagsToPermissionString(t)||512&t)?31:Et.nodePermissions(e,Et.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=Et.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!Et.streams[r])return r;throw new Et.ErrnoError(33)},getStream:e=>Et.streams[e],createStream:(e,t,r)=>{Et.FSStream||(Et.FSStream=function(){},Et.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),e=Object.assign(new Et.FSStream,e);var n=Et.nextfd(t,r);return e.fd=n,Et.streams[n]=e,e},closeStream:e=>{Et.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=Et.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new Et.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{Et.devices[e]={stream_ops:t}},getDevice:e=>Et.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),Et.syncFSRequests++,Et.syncFSRequests>1&&x("warning: "+Et.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=Et.getMounts(Et.root.mount),n=0;function o(e){return N(Et.syncFSRequests>0),Et.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{if("string"==typeof e)throw e;var n,o="/"===r,i=!r;if(o&&Et.root)throw new Et.ErrnoError(10);if(!o&&!i){var a=Et.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Et.isMountpoint(n))throw new Et.ErrnoError(10);if(!Et.isDir(n.mode))throw new Et.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?Et.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=Et.lookupPath(e,{follow_mount:!1});if(!Et.isMountpoint(t.node))throw new Et.ErrnoError(28);var r=t.node,n=r.mounted,o=Et.getMounts(n);Object.keys(Et.nameTable).forEach((e=>{for(var t=Et.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Et.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);N(-1!==i),r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=Et.lookupPath(e,{parent:!0}).node,o=dt.basename(e);if(!o||"."===o||".."===o)throw new Et.ErrnoError(28);var i=Et.mayCreate(n,o);if(i)throw new Et.ErrnoError(i);if(!n.node_ops.mknod)throw new Et.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Et.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Et.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Et.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,Et.mknod(e,t,r)),symlink:(e,t)=>{if(!mt.resolve(e))throw new Et.ErrnoError(44);var r=Et.lookupPath(t,{parent:!0}).node;if(!r)throw new Et.ErrnoError(44);var n=dt.basename(t),o=Et.mayCreate(r,n);if(o)throw new Et.ErrnoError(o);if(!r.node_ops.symlink)throw new Et.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=dt.dirname(e),i=dt.dirname(t),a=dt.basename(e),s=dt.basename(t);if(r=Et.lookupPath(e,{parent:!0}).node,n=Et.lookupPath(t,{parent:!0}).node,!r||!n)throw new Et.ErrnoError(44);if(r.mount!==n.mount)throw new Et.ErrnoError(75);var c,u=Et.lookupNode(r,a),l=mt.relative(e,i);if("."!==l.charAt(0))throw new Et.ErrnoError(28);if("."!==(l=mt.relative(t,o)).charAt(0))throw new Et.ErrnoError(55);try{c=Et.lookupNode(n,s)}catch(e){}if(u!==c){var d=Et.isDir(u.mode),f=Et.mayDelete(r,a,d);if(f)throw new Et.ErrnoError(f);if(f=c?Et.mayDelete(n,s,d):Et.mayCreate(n,s))throw new Et.ErrnoError(f);if(!r.node_ops.rename)throw new Et.ErrnoError(63);if(Et.isMountpoint(u)||c&&Et.isMountpoint(c))throw new Et.ErrnoError(10);if(n!==r&&(f=Et.nodePermissions(r,"w")))throw new Et.ErrnoError(f);Et.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{Et.hashAddNode(u)}}},rmdir:e=>{var t=Et.lookupPath(e,{parent:!0}).node,r=dt.basename(e),n=Et.lookupNode(t,r),o=Et.mayDelete(t,r,!0);if(o)throw new Et.ErrnoError(o);if(!t.node_ops.rmdir)throw new Et.ErrnoError(63);if(Et.isMountpoint(n))throw new Et.ErrnoError(10);t.node_ops.rmdir(t,r),Et.destroyNode(n)},readdir:e=>{var t=Et.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Et.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=Et.lookupPath(e,{parent:!0}).node;if(!t)throw new Et.ErrnoError(44);var r=dt.basename(e),n=Et.lookupNode(t,r),o=Et.mayDelete(t,r,!1);if(o)throw new Et.ErrnoError(o);if(!t.node_ops.unlink)throw new Et.ErrnoError(63);if(Et.isMountpoint(n))throw new Et.ErrnoError(10);t.node_ops.unlink(t,r),Et.destroyNode(n)},readlink:e=>{var t=Et.lookupPath(e).node;if(!t)throw new Et.ErrnoError(44);if(!t.node_ops.readlink)throw new Et.ErrnoError(28);return mt.resolve(Et.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=Et.lookupPath(e,{follow:!t}).node;if(!r)throw new Et.ErrnoError(44);if(!r.node_ops.getattr)throw new Et.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Et.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?Et.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Et.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{Et.chmod(e,t,!0)},fchmod:(e,t)=>{var r=Et.getStream(e);if(!r)throw new Et.ErrnoError(8);Et.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?Et.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Et.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{Et.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=Et.getStream(e);if(!n)throw new Et.ErrnoError(8);Et.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new Et.ErrnoError(28);var r;if(!(r="string"==typeof e?Et.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Et.ErrnoError(63);if(Et.isDir(r.mode))throw new Et.ErrnoError(31);if(!Et.isFile(r.mode))throw new Et.ErrnoError(28);var n=Et.nodePermissions(r,"w");if(n)throw new Et.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=Et.getStream(e);if(!r)throw new Et.ErrnoError(8);if(0==(2097155&r.flags))throw new Et.ErrnoError(28);Et.truncate(r.node,t)},utime:(e,t,r)=>{var n=Et.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,i)=>{if(""===e)throw new Et.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?Et.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=dt.normalize(e);try{a=Et.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new Et.ErrnoError(20)}else a=Et.mknod(e,r,0),s=!0;if(!a)throw new Et.ErrnoError(44);if(Et.isChrdev(a.mode)&&(t&=-513),65536&t&&!Et.isDir(a.mode))throw new Et.ErrnoError(54);if(!s){var c=Et.mayOpen(a,t);if(c)throw new Et.ErrnoError(c)}512&t&&Et.truncate(a,0),t&=-131713;var u=Et.createStream({node:a,path:Et.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);return u.stream_ops.open&&u.stream_ops.open(u),!o.logReadFiles||1&t||(Et.readFiles||(Et.readFiles={}),e in Et.readFiles||(Et.readFiles[e]=1)),u},close:e=>{if(Et.isClosed(e))throw new Et.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Et.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(Et.isClosed(e))throw new Et.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Et.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Et.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new Et.ErrnoError(28);if(Et.isClosed(e))throw new Et.ErrnoError(8);if(1==(2097155&e.flags))throw new Et.ErrnoError(8);if(Et.isDir(e.node.mode))throw new Et.ErrnoError(31);if(!e.stream_ops.read)throw new Et.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new Et.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new Et.ErrnoError(28);if(Et.isClosed(e))throw new Et.ErrnoError(8);if(0==(2097155&e.flags))throw new Et.ErrnoError(8);if(Et.isDir(e.node.mode))throw new Et.ErrnoError(31);if(!e.stream_ops.write)throw new Et.ErrnoError(28);e.seekable&&1024&e.flags&&Et.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new Et.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(Et.isClosed(e))throw new Et.ErrnoError(8);if(t<0||r<=0)throw new Et.ErrnoError(28);if(0==(2097155&e.flags))throw new Et.ErrnoError(8);if(!Et.isFile(e.node.mode)&&!Et.isDir(e.node.mode))throw new Et.ErrnoError(43);if(!e.stream_ops.allocate)throw new Et.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new Et.ErrnoError(2);if(1==(2097155&e.flags))throw new Et.ErrnoError(2);if(!e.stream_ops.mmap)throw new Et.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new Et.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=Et.open(e,t.flags),o=Et.stat(e).size,i=new Uint8Array(o);return Et.read(n,i,0,o,0),"utf8"===t.encoding?r=q(i,0):"binary"===t.encoding&&(r=i),Et.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=Et.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(V(t)+1),i=W(t,o,0,o.length);Et.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Et.write(n,t,0,t.byteLength,void 0,r.canOwn)}Et.close(n)},cwd:()=>Et.currentPath,chdir:e=>{var t=Et.lookupPath(e,{follow:!0});if(null===t.node)throw new Et.ErrnoError(44);if(!Et.isDir(t.node.mode))throw new Et.ErrnoError(54);var r=Et.nodePermissions(t.node,"x");if(r)throw new Et.ErrnoError(r);Et.currentPath=t.path},createDefaultDirectories:()=>{Et.mkdir("/tmp"),Et.mkdir("/home"),Et.mkdir("/home/web_user")},createDefaultDevices:()=>{Et.mkdir("/dev"),Et.registerDevice(Et.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Et.mkdev("/dev/null",Et.makedev(1,3)),pt.register(Et.makedev(5,0),pt.default_tty_ops),pt.register(Et.makedev(6,0),pt.default_tty1_ops),Et.mkdev("/dev/tty",Et.makedev(5,0)),Et.mkdev("/dev/tty1",Et.makedev(6,0));var e=ft();Et.createDevice("/dev","random",e),Et.createDevice("/dev","urandom",e),Et.mkdir("/dev/shm"),Et.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Et.mkdir("/proc");var e=Et.mkdir("/proc/self");Et.mkdir("/proc/self/fd"),Et.mount({mount:()=>{var t=Et.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=Et.getStream(r);if(!n)throw new Et.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?Et.createDevice("/dev","stdin",o.stdin):Et.symlink("/dev/tty","/dev/stdin"),o.stdout?Et.createDevice("/dev","stdout",null,o.stdout):Et.symlink("/dev/tty","/dev/stdout"),o.stderr?Et.createDevice("/dev","stderr",null,o.stderr):Et.symlink("/dev/tty1","/dev/stderr");var e=Et.open("/dev/stdin",0),t=Et.open("/dev/stdout",1),r=Et.open("/dev/stderr",1);N(0===e.fd,"invalid handle for stdin ("+e.fd+")"),N(1===t.fd,"invalid handle for stdout ("+t.fd+")"),N(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:()=>{Et.ErrnoError||(Et.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,wt)if(wt[t]===e){this.code=t;break}},this.setErrno(e),this.message=_t[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=rt(this.stack))},Et.ErrnoError.prototype=new Error,Et.ErrnoError.prototype.constructor=Et.ErrnoError,[44].forEach((e=>{Et.genericErrors[e]=new Et.ErrnoError(e),Et.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{Et.ensureErrnoError(),Et.nameTable=new Array(4096),Et.mount(yt,{},"/"),Et.createDefaultDirectories(),Et.createDefaultDevices(),Et.createSpecialDirectories(),Et.filesystems={MEMFS:yt}},init:(e,t,r)=>{N(!Et.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Et.init.initialized=!0,Et.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=t||o.stdout,o.stderr=r||o.stderr,Et.createStandardStreams()},quit:()=>{Et.init.initialized=!1,Vd();for(var e=0;e<Et.streams.length;e++){var t=Et.streams[e];t&&Et.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=Et.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=Et.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Et.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=dt.basename(e),n=Et.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:Et.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=dt.join2(e,i);try{Et.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=dt.join2("string"==typeof e?e:Et.getPath(e),t),a=Et.getMode(n,o);return Et.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:Et.getPath(e),a=t?dt.join2(e,t):e);var s=Et.getMode(n,o),c=Et.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,d=r.length;l<d;++l)u[l]=r.charCodeAt(l);r=u}Et.chmod(c,146|s);var f=Et.open(c,577);Et.write(f,r,0,r.length,0,i),Et.close(f),Et.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=dt.join2("string"==typeof e?e:Et.getPath(e),t),i=Et.getMode(!!r,!!n);Et.createDevice.major||(Et.createDevice.major=64);var a=Et.makedev(Et.createDevice.major++,0);return Et.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new Et.ErrnoError(29)}if(void 0===c&&0===a)throw new Et.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new Et.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),Et.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!g)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Bd(g(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Et.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Bd(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new 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 c=Et.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return Et.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>{Et.forceLoadFile(c);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(N(a>=0),i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,a,s,c,u)=>{var l=t?mt.resolve(dt.join2(e,t)):e,d=qe("cp "+l);function f(r){function f(r){u&&u(),s||Et.createDataFile(e,t,r,n,o,c),i&&i(),ze(d)}So.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),ze(d)}))||f(r)}Ge(d),"string"==typeof r?bt(r,(e=>f(e)),a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=Et.indexedDB();try{var o=n.open(Et.DB_NAME(),Et.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(Et.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([Et.DB_STORE_NAME],"readwrite"),i=n.objectStore(Et.DB_STORE_NAME),a=0,s=0,c=e.length;function u(){0==s?t():r()}e.forEach((e=>{var t=i.put(Et.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&u()},t.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=Et.indexedDB();try{var o=n.open(Et.DB_NAME(),Et.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([Et.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(Et.DB_STORE_NAME),s=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{Et.analyzePath(e).exists&&Et.unlink(e),Et.createDataFile(dt.dirname(e),dt.basename(e),t.result,!0,!0,!0),++s+c==u&&l()},t.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r},absolutePath:()=>{Ve("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:()=>{Ve("FS.createFolder has been removed; use FS.mkdir instead")},createLink:()=>{Ve("FS.createLink has been removed; use FS.symlink instead")},joinPath:()=>{Ve("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:()=>{Ve("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:()=>{Ve("FS.standardizePath has been removed; use PATH.normalize instead")}},xt={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if("/"===t[0])return t;var n;if(-100===e)n=Et.cwd();else{var o=Et.getStream(e);if(!o)throw new Et.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new Et.ErrnoError(44);return n}return dt.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&dt.normalize(t)!==dt.normalize(Et.getPath(e.node)))return-54;throw e}return Q[r>>2]=n.dev,Q[r+4>>2]=0,Q[r+8>>2]=n.ino,Q[r+12>>2]=n.mode,Q[r+16>>2]=n.nlink,Q[r+20>>2]=n.uid,Q[r+24>>2]=n.gid,Q[r+28>>2]=n.rdev,Q[r+32>>2]=0,ee[r+40>>3]=BigInt(n.size),Q[r+48>>2]=4096,Q[r+52>>2]=n.blocks,Q[r+56>>2]=n.atime.getTime()/1e3|0,Q[r+60>>2]=0,Q[r+64>>2]=n.mtime.getTime()/1e3|0,Q[r+68>>2]=0,Q[r+72>>2]=n.ctime.getTime()/1e3|0,Q[r+76>>2]=0,ee[r+80>>3]=BigInt(n.ino),0},doMsync:function(e,t,r,n,o){var i=Y.slice(e,e+r);Et.msync(t,i,o,r,n)},doMkdir:function(e,t){return"/"===(e=dt.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),Et.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Et.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=Et.readlink(e),o=Math.min(r,V(n)),i=$[t+o];return z(n,t,r+1),$[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=Et.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&Et.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=Et.getStream(r);return n&&Et.close(n),Et.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=Q[t+8*i>>2],s=Q[t+(8*i+4)>>2],c=Et.read(e,$,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=Q[t+8*i>>2],s=Q[t+(8*i+4)>>2],c=Et.write(e,$,a,s,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return N(null!=xt.varargs),xt.varargs+=4,Q[xt.varargs-4>>2]},getStr:function(e){return G(e)},getStreamFromFD:function(e){var t=Et.getStream(e);if(!t)throw new Et.ErrnoError(8);return t},get64:function(e,t){return N(e>=0?0===t:-1===t),e}};function kt(e,t,r){xt.varargs=r;try{var n=xt.getStreamFromFD(e);switch(t){case 0:return(o=xt.get())<0?-28:Et.open(n.path,n.flags,0,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=xt.get();return n.flags|=o,0;case 5:return o=xt.get(),X[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return lt(28),-1}}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function St(e,t){try{var r=xt.getStreamFromFD(e);return xt.doStat(Et.stat,r.path,t)}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function Tt(e,t,r,n){try{t=xt.getStr(t);var o=256&n,i=4096&n;return N(!(n&=-4353),n),t=xt.calculateAt(e,t,i),xt.doStat(o?Et.lstat:Et.stat,t,r)}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function Ct(e,t,r){try{var n=xt.getStreamFromFD(e);n.getdents||(n.getdents=Et.readdir(n.path));for(var o=280,i=0,a=Et.llseek(n,0,1),s=Math.floor(a/o);s<n.getdents.length&&i+o<=r;){var c,u,l=n.getdents[s];if("."===l)c=n.node.id,u=4;else if(".."===l)c=Et.lookupPath(n.path,{parent:!0}).node.id,u=4;else{var d=Et.lookupNode(n.node,l);c=d.id,u=Et.isChrdev(d.mode)?2:Et.isDir(d.mode)?4:Et.isLink(d.mode)?10:8}N(c),ee[t+i>>3]=BigInt(c),ee[t+i+8>>3]=BigInt((s+1)*o),X[t+i+16>>1]=280,$[t+i+18>>0]=u,z(l,t+i+19,256),i+=o,s+=1}return Et.llseek(n,s*o,0),i}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function Pt(e,t,r){xt.varargs=r;try{var n=xt.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=xt.get();return Q[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=xt.get(),Et.ioctl(n,t,o);default:Ve("bad ioctl syscall "+t)}}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function At(e,t){try{return e=xt.getStr(e),xt.doStat(Et.lstat,e,t)}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function Ft(e,t,r){xt.varargs=r;try{var n=xt.getStr(e),o=r?xt.get():0;return Et.open(n,t,o).fd}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function Dt(e,t){try{return e=xt.getStr(e),xt.doStat(Et.stat,e,t)}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function Lt(e,t){Ve("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function It(e,t){Ve("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}var Rt={};function Mt(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Ot(e){return this.fromWireType(Z[e>>2])}var Bt={},Ut={},Nt={},jt=48,qt=57;function Gt(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=jt&&t<=qt?"_"+e:e}function Wt(e,t){return e=Gt(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function zt(e,t){var r=Wt(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var Vt=void 0;function Ht(e){throw new Vt(e)}function $t(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Ht("Mismatched type converter count");for(var o=0;o<e.length;++o)nr(e[o],n[o])}e.forEach((function(e){Nt[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){Ut.hasOwnProperty(e)?o[t]=Ut[e]:(i.push(e),Bt.hasOwnProperty(e)||(Bt[e]=[]),Bt[e].push((function(){o[t]=Ut[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function Yt(e){var t=Rt[e];delete Rt[e];var r=t.elements,n=r.length,o=r.map((function(e){return e.getterReturnType})).concat(r.map((function(e){return e.setterArgumentType}))),i=t.rawConstructor,a=t.rawDestructor;$t([e],o,(function(e){return r.forEach((function(t,r){var o=e[r],i=t.getter,a=t.getterContext,s=e[r+n],c=t.setter,u=t.setterContext;t.read=e=>o.fromWireType(i(a,e)),t.write=(e,t)=>{var r=[];c(u,e,s.toWireType(r,t)),Mt(r)}})),[{name:t.name,fromWireType:function(e){for(var t=new Array(n),o=0;o<n;++o)t[o]=r[o].read(e);return a(e),t},toWireType:function(e,o){if(n!==o.length)throw new TypeError("Incorrect number of tuple elements for "+t.name+": expected="+n+", actual="+o.length);for(var s=i(),c=0;c<n;++c)r[c].write(s,o[c]);return null!==e&&e.push(a,s),s},argPackAdvance:8,readValueFromPointer:Ot,destructorFunction:a}]}))}var Xt={};function Kt(e){var t=Xt[e];delete Xt[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;$t([e],o.map((function(e){return e.getterReturnType})).concat(o.map((function(e){return e.setterArgumentType}))),(function(e){var i={};return o.forEach((function(t,r){var n=t.fieldName,a=e[r],s=t.getter,c=t.getterContext,u=e[r+o.length],l=t.setter,d=t.setterContext;i[n]={read:function(e){return a.fromWireType(s(c,e))},write:function(e,t){var r=[];l(d,e,u.toWireType(r,t)),Mt(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:Ot,destructorFunction:n}]}))}function Qt(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Zt(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Jt=e}var Jt=void 0;function er(e){for(var t="",r=e;Y[r];)t+=Jt[Y[r++]];return t}var tr=void 0;function rr(e){throw new tr(e)}function nr(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||rr('type "'+n+'" must have a positive integer typeid pointer'),Ut.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;rr("Cannot register type '"+n+"' twice")}if(Ut[e]=t,delete Nt[e],Bt.hasOwnProperty(e)){var o=Bt[e];delete Bt[e],o.forEach((function(e){e()}))}}function or(e,t,r){switch(t){case 0:return r?function(e){return $[e]}:function(e){return Y[e]};case 1:return r?function(e){return X[e>>1]}:function(e){return K[e>>1]};case 2:return r?function(e){return Q[e>>2]}:function(e){return Z[e>>2]};case 3:return r?function(e){return ee[e>>3]}:function(e){return te[e>>3]};default:throw new TypeError("Unknown integer type: "+e)}}function ir(e,t,r,n,o){t=er(t);var i=ar(r),a=-1!=t.indexOf("u");a&&(o=(BigInt(1)<<BigInt(64))-BigInt(1)),nr(e,{name:t,fromWireType:function(e){return e},toWireType:function(e,r){if("bigint"!=typeof r)throw new TypeError('Cannot convert "'+Qt(r)+'" to '+this.name);if(r<n||r>o)throw new TypeError('Passing a number "'+Qt(r)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+o+"]!");return r},argPackAdvance:8,readValueFromPointer:or(t,i,!a),destructorFunction:null})}function ar(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function sr(e,t,r,n,o){var i=ar(r);nr(e,{name:t=er(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=$;else if(2===r)n=X;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=Q}return this.fromWireType(n[e>>i])},destructorFunction:null})}function cr(e){if(!(this instanceof Mr))return!1;if(!(e instanceof Mr))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function ur(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function lr(e){rr(e.$$.ptrType.registeredClass.name+" instance already deleted")}var dr=!1;function fr(e){}function mr(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function pr(e){e.count.value-=1,0===e.count.value&&mr(e)}function hr(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=hr(e,t,r.baseClass);return null===n?null:r.downcast(n)}var gr={};function vr(){return Object.keys(kr).length}function yr(){var e=[];for(var t in kr)kr.hasOwnProperty(t)&&e.push(kr[t]);return e}var br=[];function _r(){for(;br.length;){var e=br.pop();e.$$.deleteScheduled=!1,e.delete()}}var wr=void 0;function Er(e){wr=e,br.length&&wr&&wr(_r)}function xr(){o.getInheritedInstanceCount=vr,o.getLiveInheritedInstances=yr,o.flushPendingDeletes=_r,o.setDelayFunction=Er}var kr={};function Sr(e,t){for(void 0===t&&rr("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function Tr(e,t){return t=Sr(e,t),kr[t]}function Cr(e,t){return t.ptrType&&t.ptr||Ht("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ht("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ar(Object.create(e,{$$:{value:t}}))}function Pr(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Tr(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Cr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Cr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=gr[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var c=hr(t,this.registeredClass,i.registeredClass);return null===c?o.call(this):this.isSmartPointer?Cr(i.registeredClass.instancePrototype,{ptrType:i,ptr:c,smartPtrType:this,smartPtr:e}):Cr(i.registeredClass.instancePrototype,{ptrType:i,ptr:c})}function Ar(e){return"undefined"==typeof FinalizationRegistry?(Ar=e=>e,e):(dr=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),pr(e.$$)})),Ar=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <0x"+t.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Pr),dr.register(e,r,e)}return e},fr=e=>dr.unregister(e),Ar(e))}function Fr(){if(this.$$.ptr||lr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Ar(Object.create(Object.getPrototypeOf(this),{$$:{value:ur(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Dr(){this.$$.ptr||lr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&rr("Object already scheduled for deletion"),fr(this),pr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Lr(){return!this.$$.ptr}function Ir(){return this.$$.ptr||lr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&rr("Object already scheduled for deletion"),br.push(this),1===br.length&&wr&&wr(_r),this.$$.deleteScheduled=!0,this}function Rr(){Mr.prototype.isAliasOf=cr,Mr.prototype.clone=Fr,Mr.prototype.delete=Dr,Mr.prototype.isDeleted=Lr,Mr.prototype.deleteLater=Ir}function Mr(){}function Or(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||rr("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function Br(e,t,r){o.hasOwnProperty(e)?((void 0===r||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[r])&&rr("Cannot register public name '"+e+"' twice"),Or(o,e,e),o.hasOwnProperty(r)&&rr("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),o[e].overloadTable[r]=t):(o[e]=t,void 0!==r&&(o[e].numArguments=r))}function Ur(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Nr(e,t,r){for(;t!==r;)t.upcast||rr("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function jr(e,t){if(null===t)return this.isReference&&rr("null is not a valid "+this.name),0;t.$$||rr('Cannot pass "'+Qt(t)+'" as a '+this.name),t.$$.ptr||rr("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return Nr(t.$$.ptr,r,this.registeredClass)}function qr(e,t){var r;if(null===t)return this.isReference&&rr("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||rr('Cannot pass "'+Qt(t)+'" as a '+this.name),t.$$.ptr||rr("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&rr("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=Nr(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&rr("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:rr("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,fn.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:rr("Unsupporting sharing policy")}return r}function Gr(e,t){if(null===t)return this.isReference&&rr("null is not a valid "+this.name),0;t.$$||rr('Cannot pass "'+Qt(t)+'" as a '+this.name),t.$$.ptr||rr("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&rr("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return Nr(t.$$.ptr,r,this.registeredClass)}function Wr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function zr(e){this.rawDestructor&&this.rawDestructor(e)}function Vr(e){null!==e&&e.delete()}function Hr(){$r.prototype.getPointee=Wr,$r.prototype.destructor=zr,$r.prototype.argPackAdvance=8,$r.prototype.readValueFromPointer=Ot,$r.prototype.deleteObject=Vr,$r.prototype.fromWireType=Pr}function $r(e,t,r,n,o,i,a,s,c,u,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=u,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=qr:n?(this.toWireType=jr,this.destructorFunction=null):(this.toWireType=Gr,this.destructorFunction=null)}function Yr(e,t,r){o.hasOwnProperty(e)||Ht("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==r?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r)}function Xr(e,t){e=er(e);var r=ot(t);return"function"!=typeof r&&rr("unknown function pointer with signature "+e+": "+t),r}var Kr=void 0;function Qr(e){var t=zd(e),r=er(t);return Gd(t),r}function Zr(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||Ut[t]||(Nt[t]?Nt[t].forEach(e):(r.push(t),n[t]=!0))})),new Kr(e+": "+r.map(Qr).join([", "]))}function Jr(e,t,r,n,o,i,a,s,c,u,l,d,f){l=er(l),i=Xr(o,i),s&&(s=Xr(a,s)),u&&(u=Xr(c,u)),f=Xr(d,f);var m=Gt(l);Br(m,(function(){Zr("Cannot construct "+l+" due to unbound types",[n])})),$t([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Mr.prototype;var a=Wt(m,(function(){if(Object.getPrototypeOf(this)!==c)throw new tr("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new tr(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new tr("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)})),c=Object.create(o,{constructor:{value:a}});a.prototype=c;var d=new Ur(l,a,c,f,r,i,s,u),p=new $r(l,d,!0,!1,!1),h=new $r(l+"*",d,!1,!1,!1),g=new $r(l+" const*",d,!1,!0,!1);return gr[e]={pointerType:h,constPointerType:g},Yr(m,a),[p,h,g]}))}function en(e,t){for(var r=[],n=0;n<e;n++)r.push(Q[(t>>2)+n]);return r}function tn(e,t,r,n,o,i){N(t>0);var a=en(t,r);o=Xr(n,o),$t([],[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 tr("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]=()=>{Zr("Cannot construct "+e.name+" due to unbound types",a)},$t([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=nn(r,n,null,o,i),[]})),[]}))}function rn(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=Wt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function nn(e,t,r,n,o){var i=t.length;i<2&&rr("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){s=!0;break}var u="void"!==t[0].name,l="",d="";for(c=0;c<i-2;++c)l+=(0!==c?", ":"")+"arg"+c,d+=(0!==c?", ":"")+"arg"+c+"Wired";var f="return function "+Gt(e)+"("+l+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(f+="var destructors = [];\n");var m=s?"destructors":"null",p=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],h=[rr,n,o,Mt,t[0],t[1]];for(a&&(f+="var thisWired = classParam.toWireType("+m+", this);\n"),c=0;c<i-2;++c)f+="var arg"+c+"Wired = argType"+c+".toWireType("+m+", arg"+c+"); // "+t[c+2].name+"\n",p.push("argType"+c),h.push(t[c+2]);if(a&&(d="thisWired"+(d.length>0?", ":"")+d),f+=(u?"var rv = ":"")+"invoker(fn"+(d.length>0?", ":"")+d+");\n",s)f+="runDestructors(destructors);\n";else for(c=a?1:2;c<t.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(f+=g+"_dtor("+g+"); // "+t[c].name+"\n",p.push(g+"_dtor"),h.push(t[c].destructorFunction))}return u&&(f+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f+="}\n",p.push(f),rn(Function,p).apply(null,h)}function on(e,t,r,n,o,i,a,s){var c=en(r,n);t=er(t),i=Xr(o,i),$t([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){Zr("Cannot call "+n+" due to unbound types",c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,u[t]=o):(Or(u,t,n),u[t].overloadTable[r-2]=o),$t([],c,(function(o){var s=nn(n,o,e,i,a);return void 0===u[t].overloadTable?(s.argCount=r-2,u[t]=s):u[t].overloadTable[r-2]=s,[]})),[]}))}var an=[],sn=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function cn(e){e>4&&0==--sn[e].refcount&&(sn[e]=void 0,an.push(e))}function un(){for(var e=0,t=5;t<sn.length;++t)void 0!==sn[t]&&++e;return e}function ln(){for(var e=5;e<sn.length;++e)if(void 0!==sn[e])return sn[e];return null}function dn(){o.count_emval_handles=un,o.get_first_emval=ln}var fn={toValue:function(e){return e||rr("Cannot use deleted val. handle = "+e),sn[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=an.length?an.pop():sn.length;return sn[t]={refcount:1,value:e},t}}};function mn(e,t){nr(e,{name:t=er(t),fromWireType:function(e){var t=fn.toValue(e);return cn(e),t},toWireType:function(e,t){return fn.toHandle(t)},argPackAdvance:8,readValueFromPointer:Ot,destructorFunction:null})}function pn(e,t,r){switch(t){case 0:return function(e){var t=r?$:Y;return this.fromWireType(t[e])};case 1:return function(e){var t=r?X:K;return this.fromWireType(t[e>>1])};case 2:return function(e){var t=r?Q:Z;return this.fromWireType(t[e>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function hn(e,t,r,n){var o=ar(r);function i(){}t=er(t),i.values={},nr(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:function(e,t){return t.value},argPackAdvance:8,readValueFromPointer:pn(t,o,n),destructorFunction:null}),Br(t,i)}function gn(e,t){var r=Ut[e];return void 0===r&&rr(t+" has unknown type "+Qr(e)),r}function vn(e,t,r){var n=gn(e,"enum");t=er(t);var o=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Wt(n.name+"_"+t,(function(){}))}});o.values[r]=i,o[t]=i}function yn(e,t){switch(t){case 2:return function(e){return this.fromWireType(J[e>>2])};case 3:return function(e){return this.fromWireType(re[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function bn(e,t,r){var n=ar(r);nr(e,{name:t=er(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Qt(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:yn(t,n),destructorFunction:null})}function _n(e,t,r,n,o,i){var a=en(t,r);e=er(e),o=Xr(n,o),Br(e,(function(){Zr("Cannot call "+e+" due to unbound types",a)}),t-1),$t([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Yr(e,nn(e,n,null,o,i),t-1),[]}))}function wn(e,t,r,n,o){t=er(t),-1===o&&(o=4294967295);var i=ar(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var c=t.includes("unsigned"),u=(e,r)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+Qt(e)+'" to '+r);if(e<n||e>o)throw new TypeError('Passing a number "'+Qt(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+o+"]!")};nr(e,{name:t,fromWireType:a,toWireType:c?function(e,t){return u(t,this.name),t>>>0}:function(e,t){return u(t,this.name),t},argPackAdvance:8,readValueFromPointer:or(t,i,0!==n),destructorFunction:null})}function En(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function o(e){var t=Z,r=t[e>>=2],o=t[e+1];return new n(H,o,r)}nr(e,{name:r=er(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function xn(e,t,r,n,o,i,a,s,c,u,l,d){r=er(r),i=Xr(o,i),s=Xr(a,s),u=Xr(c,u),d=Xr(l,d),$t([e],[t],(function(e){return e=e[0],[new $r(r,e.registeredClass,!1,!1,!0,e,n,i,s,u,d)]}))}function kn(e,t){var r="std::string"===(t=er(t));nr(e,{name:t,fromWireType:function(e){var t,n=Z[e>>2];if(r)for(var o=e+4,i=0;i<=n;++i){var a=e+4+i;if(i==n||0==Y[a]){var s=G(o,a-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=a+1}}else{var c=new Array(n);for(i=0;i<n;++i)c[i]=String.fromCharCode(Y[e+4+i]);t=c.join("")}return Gd(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||rr("Cannot pass non-string to std::string");var o=(r&&n?()=>V(t):()=>t.length)(),i=qd(4+o+1);if(Z[i>>2]=o,r&&n)z(t,i+4,o+1);else if(n)for(var a=0;a<o;++a){var s=t.charCodeAt(a);s>255&&(Gd(i),rr("String has UTF-16 code units that do not fit in 8 bits")),Y[i+4+a]=s}else for(a=0;a<o;++a)Y[i+4+a]=t[a];return null!==e&&e.push(Gd,i),i},argPackAdvance:8,readValueFromPointer:Ot,destructorFunction:function(e){Gd(e)}})}function Sn(e,t,r){var n,o,i,a,s;r=er(r),2===t?(n=oe,o=ie,a=ae,i=()=>K,s=1):4===t&&(n=se,o=ce,a=ue,i=()=>Z,s=2),nr(e,{name:r,fromWireType:function(e){for(var r,o=Z[e>>2],a=i(),c=e+4,u=0;u<=o;++u){var l=e+4+u*t;if(u==o||0==a[l>>s]){var d=n(c,l-c);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),c=l+t}}return Gd(e),r},toWireType:function(e,n){"string"!=typeof n&&rr("Cannot pass non-string to C++ string type "+r);var i=a(n),c=qd(4+i+t);return Z[c>>2]=i>>s,o(n,c+4,i+t),null!==e&&e.push(Gd,c),c},argPackAdvance:8,readValueFromPointer:Ot,destructorFunction:function(e){Gd(e)}})}function Tn(e,t,r,n,o,i){Rt[e]={name:er(t),rawConstructor:Xr(r,n),rawDestructor:Xr(o,i),elements:[]}}function Cn(e,t,r,n,o,i,a,s,c){Rt[e].elements.push({getterReturnType:t,getter:Xr(r,n),getterContext:o,setterArgumentType:i,setter:Xr(a,s),setterContext:c})}function Pn(e,t,r,n,o,i){Xt[e]={name:er(t),rawConstructor:Xr(r,n),rawDestructor:Xr(o,i),fields:[]}}function An(e,t,r,n,o,i,a,s,c,u){Xt[e].fields.push({fieldName:er(t),getterReturnType:r,getter:Xr(n,o),getterContext:i,setterArgumentType:a,setter:Xr(s,c),setterContext:u})}function Fn(e,t){nr(e,{isVoid:!0,name:t=er(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function Dn(){throw 1/0}function Ln(e,t,r){e=fn.toValue(e),t=gn(t,"emval::as");var n=[],o=fn.toHandle(n);return Q[r>>2]=o,t.toWireType(n,e)}function In(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=gn(Q[(t>>2)+n],"parameter "+n);return r}function Rn(e,t,r,n){e=fn.toValue(e);for(var o=In(t,r),i=new Array(t),a=0;a<t;++a){var s=o[a];i[a]=s.readValueFromPointer(n),n+=s.argPackAdvance}var c=e.apply(void 0,i);return fn.toHandle(c)}function Mn(e){var t=[];return Q[e>>2]=fn.toHandle(t),t}var On={};function Bn(e){var t=On[e];return void 0===t?er(e):t}var Un=[];function Nn(e,t,r,n,o){return(e=Un[e])(t=fn.toValue(t),r=Bn(r),Mn(n),o)}function jn(e,t,r,n){(e=Un[e])(t=fn.toValue(t),r=Bn(r),null,n)}function qn(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Gn(e){return 0===e?fn.toHandle(qn()):(e=Bn(e),fn.toHandle(qn()[e]))}function Wn(e){var t=Un.length;return Un.push(e),t}var zn=[];function Vn(e,t){var r=In(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=zn[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],c="",u=0;u<e-1;++u)c+=(0!==u?", ":"")+"arg"+u,a.push("argType"+u),s.push(r[1+u]);var l="return function "+Gt("methodCaller_"+o)+"(handle, name, destructors, args) {\n",d=0;for(u=0;u<e-1;++u)l+=" var arg"+u+" = argType"+u+".readValueFromPointer(args"+(d?"+"+d:"")+");\n",d+=r[u+1].argPackAdvance;for(l+=" var rv = handle[name]("+c+");\n",u=0;u<e-1;++u)r[u+1].deleteObject&&(l+=" argType"+u+".deleteObject(arg"+u+");\n");return n.isVoid||(l+=" return retType.toWireType(destructors, rv);\n"),l+="};\n",a.push(l),i=Wn(rn(Function,a).apply(null,s)),zn[o]=i,i}function Hn(e,t){return e=fn.toValue(e),t=fn.toValue(t),fn.toHandle(e[t])}function $n(e){e>4&&(sn[e].refcount+=1)}function Yn(e,t){return(e=fn.toValue(e))instanceof fn.toValue(t)}function Xn(e){return"number"==typeof(e=fn.toValue(e))}function Kn(e){return"string"==typeof(e=fn.toValue(e))}function Qn(e){for(var t="",r=0;r<e;++r)t+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+e+"(constructor, argTypes, args) {\n";for(r=0;r<e;++r)n+="var argType"+r+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+r+'], "parameter '+r+'");\nvar arg'+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\n";return n+="var obj = new constructor("+t+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle",n)(gn,o,fn.toHandle)}var Zn,Jn={};function eo(e,t,r,n){e=fn.toValue(e);var o=Jn[t];return o||(o=Qn(t),Jn[t]=o),o(e,r,n)}function to(){return fn.toHandle([])}function ro(e){return fn.toHandle(Bn(e))}function no(){return fn.toHandle({})}function oo(e){Mt(fn.toValue(e)),cn(e)}function io(e,t,r){e=fn.toValue(e),t=fn.toValue(t),r=fn.toValue(r),e[t]=r}function ao(e,t){var r=(e=gn(e,"_emval_take_value")).readValueFromPointer(t);return fn.toHandle(r)}function so(e){throw fn.toValue(e)}function co(e,t){var r=new Date(1e3*Q[e>>2]);Q[t>>2]=r.getUTCSeconds(),Q[t+4>>2]=r.getUTCMinutes(),Q[t+8>>2]=r.getUTCHours(),Q[t+12>>2]=r.getUTCDate(),Q[t+16>>2]=r.getUTCMonth(),Q[t+20>>2]=r.getUTCFullYear()-1900,Q[t+24>>2]=r.getUTCDay();var n=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),o=(r.getTime()-n)/864e5|0;Q[t+28>>2]=o}function uo(e,t){var r=new Date(1e3*Q[e>>2]);Q[t>>2]=r.getSeconds(),Q[t+4>>2]=r.getMinutes(),Q[t+8>>2]=r.getHours(),Q[t+12>>2]=r.getDate(),Q[t+16>>2]=r.getMonth(),Q[t+20>>2]=r.getFullYear()-1900,Q[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;Q[t+28>>2]=o,Q[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(i!=a&&r.getTimezoneOffset()==Math.min(a,i));Q[t+32>>2]=s}function lo(e){var t=new Date(Q[e+20>>2]+1900,Q[e+16>>2],Q[e+12>>2],Q[e+8>>2],Q[e+4>>2],Q[e>>2],0),r=Q[e+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);if(r<0)Q[e+32>>2]=Number(i!=a&&s==n);else if(r>0!=(s==n)){var c=Math.max(a,i),u=r>0?s:c;t.setTime(t.getTime()+6e4*(u-n))}Q[e+24>>2]=t.getDay();var l=(t.getTime()-o.getTime())/864e5|0;return Q[e+28>>2]=l,Q[e>>2]=t.getSeconds(),Q[e+4>>2]=t.getMinutes(),Q[e+8>>2]=t.getHours(),Q[e+12>>2]=t.getDate(),Q[e+16>>2]=t.getMonth(),t.getTime()/1e3|0}function fo(e,t,r,n,o,i,a,s){try{var c=Et.getStream(o);if(!c)return-8;var u=Et.mmap(c,e,t,i,r,n),l=u.ptr;return Q[a>>2]=u.allocated,l}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function mo(e,t,r,n,o,i){try{var a=Et.getStream(o);a&&(2&r&&xt.doMsync(e,a,t,n,i),Et.munmap(a))}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return-e.errno}}function po(e,t,r){var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),c=Math.max(a,s);function u(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}Q[e>>2]=60*c,Q[t>>2]=Number(a!=s);var l=u(o),d=u(i),f=le(l),m=le(d);s<a?(Q[r>>2]=f,Q[r+4>>2]=m):(Q[r>>2]=m,Q[r+4>>2]=f)}function ho(e,t,r){ho.called||(ho.called=!0,po(e,t,r))}function go(){Ve("native code called abort()")}Zn=()=>performance.now();var vo=!0;function yo(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!vo)return lt(28),-1;r=Zn()}return Q[t>>2]=r/1e3|0,Q[t+4>>2]=r%1e3*1e3*1e3|0,0}function bo(e,t){if(So.mainLoop.timingMode=e,So.mainLoop.timingValue=t,!So.mainLoop.func)return x("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."),1;if(So.mainLoop.running||(So.mainLoop.running=!0),0==e)So.mainLoop.scheduler=function(){var e=0|Math.max(0,So.mainLoop.tickStartTime+t-Zn());setTimeout(So.mainLoop.runner,e)},So.mainLoop.method="timeout";else if(1==e)So.mainLoop.scheduler=function(){So.requestAnimationFrame(So.mainLoop.runner)},So.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var r=[],n="setimmediate";addEventListener("message",(function(e){e.data!==n&&e.data.target!==n||(e.stopPropagation(),r.shift()())}),!0),setImmediate=function(e){r.push(e),m?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}So.mainLoop.scheduler=function(){setImmediate(So.mainLoop.runner)},So.mainLoop.method="immediate"}return 0}function _o(e){bf(e)}function wo(){if(!Pe())try{_o(B)}catch(e){it(e)}}function Eo(e,t,r,n,i){N(!So.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."),So.mainLoop.func=e,So.mainLoop.arg=n;var a=So.mainLoop.currentlyRunningMainloop;function s(){return!(a<So.mainLoop.currentlyRunningMainloop&&(wo(),1))}if(So.mainLoop.running=!1,So.mainLoop.runner=function(){if(!U)if(So.mainLoop.queue.length>0){var t=Date.now(),r=So.mainLoop.queue.shift();if(r.func(r.arg),So.mainLoop.remainingBlockers){var n=So.mainLoop.remainingBlockers,i=n%1==0?n-1:Math.floor(n);r.counted?So.mainLoop.remainingBlockers=i:(i+=.5,So.mainLoop.remainingBlockers=(8*n+i)/9)}if(E('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),So.mainLoop.updateStatus(),!s())return;setTimeout(So.mainLoop.runner,0)}else s()&&(So.mainLoop.currentFrameNumber=So.mainLoop.currentFrameNumber+1|0,1==So.mainLoop.timingMode&&So.mainLoop.timingValue>1&&So.mainLoop.currentFrameNumber%So.mainLoop.timingValue!=0?So.mainLoop.scheduler():(0==So.mainLoop.timingMode&&(So.mainLoop.tickStartTime=Zn()),"timeout"===So.mainLoop.method&&o.ctx&&(k("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),So.mainLoop.method=""),So.mainLoop.runIter(e),be(),s()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),So.mainLoop.scheduler())))},i||(t&&t>0?bo(0,1e3/t):bo(1,1),So.mainLoop.scheduler()),r)throw"unwind"}function xo(e,t){if(Te||U)x("user callback triggered after runtime exited or application aborted. Ignoring.");else if(t)e();else try{e()}catch(e){it(e)}}function ko(e,t){return setTimeout((function(){xo(e)}),t)}var So={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){So.mainLoop.scheduler=null,So.mainLoop.currentlyRunningMainloop++},resume:function(){So.mainLoop.currentlyRunningMainloop++;var e=So.mainLoop.timingMode,t=So.mainLoop.timingValue,r=So.mainLoop.func;So.mainLoop.func=null,Eo(r,0,!1,So.mainLoop.arg,!0),bo(e,t),So.mainLoop.scheduler()},updateStatus:function(){if(o.setStatus){var e=o.statusMessage||"Please wait...",t=So.mainLoop.remainingBlockers,r=So.mainLoop.expectedBlockers;t?t<r?o.setStatus(e+" ("+(r-t)+"/"+r+")"):o.setStatus(e):o.setStatus("")}},runIter:function(e){if(!U){if(o.preMainLoop&&!1===o.preMainLoop())return;xo(e),o.postMainLoop&&o.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(o.preloadPlugins||(o.preloadPlugins=[]),!So.initted){So.initted=!0;try{new Blob,So.hasBlobConstructor=!0}catch(e){So.hasBlobConstructor=!1,E("warning: no blob constructor, cannot create blobs with mimetypes")}So.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:So.hasBlobConstructor?null:E("warning: no BlobBuilder"),So.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,o.noImageDecoding||void 0!==So.URLObject||(E("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),o.noImageDecoding=!0);var e={canHandle:function(e){return!o.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var i=null;if(So.hasBlobConstructor)try{(i=new Blob([e],{type:So.getMimetype(t)})).size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:So.getMimetype(t)}))}catch(e){k("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var a=new So.BlobBuilder;a.append(new Uint8Array(e).buffer),i=a.getBlob()}var s=So.URLObject.createObjectURL(i);N("string"==typeof s,"createObjectURL must return a url as a string");var c=new Image;c.onload=()=>{N(c.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=c.width,n.height=c.height,n.getContext("2d").drawImage(c,0,0),o.preloadedImages[t]=n,So.URLObject.revokeObjectURL(s),r&&r(e)},c.onerror=e=>{E("Image "+s+" could not be decoded"),n&&n()},c.src=s}};o.preloadPlugins.push(e);var t={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var i=!1;function a(n){i||(i=!0,o.preloadedAudios[t]=n,r&&r(e))}function s(){i||(i=!0,o.preloadedAudios[t]=new Audio,n&&n())}if(!So.hasBlobConstructor)return s();try{var c=new Blob([e],{type:So.getMimetype(t)})}catch(e){return s()}var u=So.URLObject.createObjectURL(c);N("string"==typeof u,"createObjectURL must return a url as a string");var l=new Audio;l.addEventListener("canplaythrough",(function(){a(l)}),!1),l.onerror=function(r){i||(E("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),l.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){var a=n>>o-6&63;o-=6,r+=t[a]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(l))},l.src=u,ko((function(){a(l)}),1e4)}};o.preloadPlugins.push(t);var r=o.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&r.addEventListener("click",(function(e){!So.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){So.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},handledByPreloadPlugin:function(e,t,r,n){So.init();var i=!1;return o.preloadPlugins.forEach((function(o){i||o.canHandle(t)&&(o.handle(e,t,r,n),i=!0)})),i},createContext:function(e,t,r,n){if(t&&o.ctx&&e==o.canvas)return o.ctx;var i,a;if(t){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var c in n)s[c]=n[c];void 0!==Ro&&(a=Ro.createContext(e,s))&&(i=Ro.getContext(a).GLctx)}else i=e.getContext("2d");return i?(r&&(t||N(void 0===Fd,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=i,t&&Ro.makeContextCurrent(a),o.useWebGL=t,So.moduleContextCreatedCallbacks.forEach((function(e){e()})),So.init()),i):null},destroyContext:function(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t){So.lockPointer=e,So.resizeCanvas=t,void 0===So.lockPointer&&(So.lockPointer=!0),void 0===So.resizeCanvas&&(So.resizeCanvas=!1);var r=o.canvas;function n(){So.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=So.exitFullscreen,So.lockPointer&&r.requestPointerLock(),So.isFullscreen=!0,So.resizeCanvas?So.setFullscreenCanvasSize():So.updateCanvasDimensions(r)):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),So.resizeCanvas?So.setWindowedCanvasSize():So.updateCanvasDimensions(r)),o.onFullScreen&&o.onFullScreen(So.isFullscreen),o.onFullscreen&&o.onFullscreen(So.isFullscreen)}So.fullscreenHandlersInstalled||(So.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var i=document.createElement("div");r.parentNode.insertBefore(i,r),i.appendChild(r),i.requestFullscreen=i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||(i.webkitRequestFullscreen?function(){i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(i.webkitRequestFullScreen?function(){i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i.requestFullscreen()},requestFullScreen:function(){Ve("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen:function(){return!!So.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===So.nextRAF)So.nextRAF=t+1e3/60;else for(;t+2>=So.nextRAF;)So.nextRAF+=1e3/60;var r=Math.max(So.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"function"!=typeof requestAnimationFrame?(0,So.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:function(e){return ko(e)},safeRequestAnimationFrame:function(e){return So.requestAnimationFrame((function(){xo(e)}))},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail/3;break;case"mousewheel":t=e.wheelDelta/120;break;case"wheel":switch(t=e.deltaY,e.deltaMode){case 0:t/=100;break;case 1:t/=3;break;case 2:t*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(So.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?So.mouseMovementX=So.mouseMovementY=0:(So.mouseMovementX=So.getMovementX(e),So.mouseMovementY=So.getMovementY(e)),"undefined"!=typeof SDL?(So.mouseX=SDL.mouseX+So.mouseMovementX,So.mouseY=SDL.mouseY+So.mouseMovementY):(So.mouseX+=So.mouseMovementX,So.mouseY+=So.mouseMovementY);else{var t=o.canvas.getBoundingClientRect(),r=o.canvas.width,n=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(N(void 0!==i&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var c=s.pageX-(i+t.left),u=s.pageY-(a+t.top),l={x:c*=r/t.width,y:u*=n/t.height};if("touchstart"===e.type)So.lastTouches[s.identifier]=l,So.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=So.touches[s.identifier];d||(d=l),So.lastTouches[s.identifier]=d,So.touches[s.identifier]=l}return}var f=e.pageX-(i+t.left),m=e.pageY-(a+t.top);f*=r/t.width,m*=n/t.height,So.mouseMovementX=f-So.mouseX,So.mouseMovementY=m-So.mouseY,So.mouseX=f,So.mouseY=m}},resizeListeners:[],updateResizeListeners:function(){var e=o.canvas;So.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,r){var n=o.canvas;So.updateCanvasDimensions(n,e,t),r||So.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=Z[SDL.screen>>2];e|=8388608,Q[SDL.screen>>2]=e}So.updateCanvasDimensions(o.canvas),So.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=Z[SDL.screen>>2];e&=-8388609,Q[SDL.screen>>2]=e}So.updateCanvasDimensions(o.canvas),So.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var n=t,i=r;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/i<o.forcedAspectRatio?n=Math.round(i*o.forcedAspectRatio):i=Math.round(n/o.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/i);n=Math.round(n*a),i=Math.round(i*a)}So.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=i&&(e.height=i),void 0!==e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),void 0!==e.style&&(n!=t||i!=r?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}},To={errorCode:12288,defaultDisplayInitialized:!1,currentContext:0,currentReadSurface:0,currentDrawSurface:0,contextAttributes:{alpha:!1,depth:!1,stencil:!1,antialias:!1},stringCache:{},setErrorCode:function(e){To.errorCode=e},chooseConfig:function(e,t,r,n,o){if(62e3!=e)return To.setErrorCode(12296),0;if(t)for(;;){var i=Q[t>>2];if(12321==i){var a=Q[t+4>>2];To.contextAttributes.alpha=a>0}else if(12325==i){var s=Q[t+4>>2];To.contextAttributes.depth=s>0}else if(12326==i){var c=Q[t+4>>2];To.contextAttributes.stencil=c>0}else if(12337==i){var u=Q[t+4>>2];To.contextAttributes.antialias=u>0}else if(12338==i)u=Q[t+4>>2],To.contextAttributes.antialias=1==u;else if(12544==i){var l=Q[t+4>>2];To.contextAttributes.lowLatency=12547!=l}else if(12344==i)break;t+=8}return r&&n||o?(o&&(Q[o>>2]=1),r&&n>0&&(Q[r>>2]=62002),To.setErrorCode(12288),1):(To.setErrorCode(12300),0)}};function Co(e,t,r,n,o){return To.chooseConfig(e,t,r,n,o)}function Po(e){var t=e.getExtension("ANGLE_instanced_arrays");if(t)return e.vertexAttribDivisor=function(e,r){t.vertexAttribDivisorANGLE(e,r)},e.drawArraysInstanced=function(e,r,n,o){t.drawArraysInstancedANGLE(e,r,n,o)},e.drawElementsInstanced=function(e,r,n,o,i){t.drawElementsInstancedANGLE(e,r,n,o,i)},1}function Ao(e){var t=e.getExtension("OES_vertex_array_object");if(t)return e.createVertexArray=function(){return t.createVertexArrayOES()},e.deleteVertexArray=function(e){t.deleteVertexArrayOES(e)},e.bindVertexArray=function(e){t.bindVertexArrayOES(e)},e.isVertexArray=function(e){return t.isVertexArrayOES(e)},1}function Fo(e){var t=e.getExtension("WEBGL_draw_buffers");if(t)return e.drawBuffers=function(e,r){t.drawBuffersWEBGL(e,r)},1}function Do(e){return!!(e.dibvbi=e.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function Lo(e){return!!(e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function Io(e){return!!(e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw"))}var Ro={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){Ro.lastError||(Ro.lastError=e)},getNewId:function(e){for(var t=Ro.counter++,r=e.length;r<t;r++)e[r]=null;return t},getSource:function(e,t,r,n){for(var o="",i=0;i<t;++i){var a=n?Q[n+4*i>>2]:-1;o+=G(Q[r+4*i>>2],a<0?void 0:a)}return o},createContext:function(e,t){e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(t,r){var n=e.getContextSafariWebGL2Fixed(t,r);return"webgl"==t==n instanceof WebGLRenderingContext?n:null});var r=t.majorVersion>1?e.getContext("webgl2",t):e.getContext("webgl",t);return r?Ro.registerContext(r,t):0},registerContext:function(e,t){var r=Ro.getNewId(Ro.contexts),n={handle:r,attributes:t,version:t.majorVersion,GLctx:e};return e.canvas&&(e.canvas.GLctxObject=n),Ro.contexts[r]=n,(void 0===t.enableExtensionsByDefault||t.enableExtensionsByDefault)&&Ro.initExtensions(n),r},makeContextCurrent:function(e){return Ro.currentContext=Ro.contexts[e],o.ctx=Fd=Ro.currentContext&&Ro.currentContext.GLctx,!(e&&!Fd)},getContext:function(e){return Ro.contexts[e]},deleteContext:function(e){Ro.currentContext===Ro.contexts[e]&&(Ro.currentContext=null),"object"==typeof Zl&&Zl.removeAllHandlersOnTarget(Ro.contexts[e].GLctx.canvas),Ro.contexts[e]&&Ro.contexts[e].GLctx.canvas&&(Ro.contexts[e].GLctx.canvas.GLctxObject=void 0),Ro.contexts[e]=null},initExtensions:function(e){if(e||(e=Ro.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var t=e.GLctx;Po(t),Ao(t),Fo(t),Do(t),Lo(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),Io(t),(t.getSupportedExtensions()||[]).forEach((function(e){e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}};function Mo(e,t,r,n){if(62e3!=e)return To.setErrorCode(12296),0;for(var i=1;;){var a=Q[n>>2];if(12440!=a){if(12344==a)break;return To.setErrorCode(12292),0}i=Q[n+4>>2],n+=8}return i<2||i>3?(To.setErrorCode(12293),0):(To.contextAttributes.majorVersion=i-1,To.contextAttributes.minorVersion=0,To.context=Ro.createContext(o.canvas,To.contextAttributes),0!=To.context?(To.setErrorCode(12288),Ro.makeContextCurrent(To.context),o.useWebGL=!0,So.moduleContextCreatedCallbacks.forEach((function(e){e()})),Ro.makeContextCurrent(null),62004):(To.setErrorCode(12297),0))}function Oo(e,t,r,n){return 62e3!=e?(To.setErrorCode(12296),0):62002!=t?(To.setErrorCode(12293),0):(To.setErrorCode(12288),62006)}function Bo(e,t){return 62e3!=e?(To.setErrorCode(12296),0):62004!=t?(To.setErrorCode(12294),0):(Ro.deleteContext(To.context),To.setErrorCode(12288),To.currentContext==t&&(To.currentContext=0),1)}function Uo(e,t){return 62e3!=e?(To.setErrorCode(12296),0):62006!=t?(To.setErrorCode(12301),1):(To.currentReadSurface==t&&(To.currentReadSurface=0),To.currentDrawSurface==t&&(To.currentDrawSurface=0),To.setErrorCode(12288),1)}function No(e,t,r,n){if(62e3!=e)return To.setErrorCode(12296),0;if(62002!=t)return To.setErrorCode(12293),0;if(!n)return To.setErrorCode(12300),0;switch(To.setErrorCode(12288),r){case 12320:return Q[n>>2]=To.contextAttributes.alpha?32:24,1;case 12321:return Q[n>>2]=To.contextAttributes.alpha?8:0,1;case 12322:case 12323:case 12324:return Q[n>>2]=8,1;case 12325:return Q[n>>2]=To.contextAttributes.depth?24:0,1;case 12326:return Q[n>>2]=To.contextAttributes.stencil?8:0,1;case 12327:case 12335:case 12340:return Q[n>>2]=12344,1;case 12328:return Q[n>>2]=62002,1;case 12329:case 12333:case 12334:case 12345:case 12346:case 12347:case 12349:case 12350:case 12354:return Q[n>>2]=0,1;case 12330:case 12332:return Q[n>>2]=4096,1;case 12331:return Q[n>>2]=16777216,1;case 12337:return Q[n>>2]=To.contextAttributes.antialias?4:0,1;case 12338:return Q[n>>2]=To.contextAttributes.antialias?1:0,1;case 12339:case 12352:return Q[n>>2]=4,1;case 12341:case 12342:case 12343:return Q[n>>2]=-1,1;case 12348:return Q[n>>2]=1,1;case 12351:return Q[n>>2]=12430,1;default:return To.setErrorCode(12292),0}}function jo(e){return To.setErrorCode(12288),62e3}function qo(){return To.errorCode}function Go(e,t,r){return 62e3==e?(t&&(Q[t>>2]=1),r&&(Q[r>>2]=4),To.defaultDisplayInitialized=!0,To.setErrorCode(12288),1):(To.setErrorCode(12296),0)}function Wo(e,t,r,n){return 62e3!=e?(To.setErrorCode(12296),0):0!=n&&62004!=n?(To.setErrorCode(12294),0):0!=r&&62006!=r||0!=t&&62006!=t?(To.setErrorCode(12301),0):(Ro.makeContextCurrent(n?To.context:null),To.currentContext=n,To.currentDrawSurface=t,To.currentReadSurface=r,To.setErrorCode(12288),1)}function zo(){if(To.defaultDisplayInitialized)if(o.ctx){if(!o.ctx.isContextLost())return To.setErrorCode(12288),1;To.setErrorCode(12302)}else To.setErrorCode(12290);else To.setErrorCode(12289);return 0}function Vo(e){return 62e3!=e?(To.setErrorCode(12296),0):(To.currentContext=0,To.currentReadSurface=0,To.currentDrawSurface=0,To.defaultDisplayInitialized=!1,To.setErrorCode(12288),1)}function Ho(e){N("number"==typeof e),console.error(G(e))}function $o(e){N("number"==typeof e),console.log(G(e))}function Yo(e){N("number"==typeof e),console.warn(G(e))}function Xo(){}function Ko(){return 2147483648}function Qo(e){Fd.activeTexture(e)}function Zo(e,t){Fd.attachShader(Ro.programs[e],Ro.shaders[t])}function Jo(e,t){Fd.beginQuery(e,Ro.queries[t])}function ei(e,t){Fd.disjointTimerQueryExt.beginQueryEXT(e,Ro.queries[t])}function ti(e){Fd.beginTransformFeedback(e)}function ri(e,t,r){Fd.bindAttribLocation(Ro.programs[e],t,G(r))}function ni(e,t){35051==e?Fd.currentPixelPackBufferBinding=t:35052==e&&(Fd.currentPixelUnpackBufferBinding=t),Fd.bindBuffer(e,Ro.buffers[t])}function oi(e,t,r){Fd.bindBufferBase(e,t,Ro.buffers[r])}function ii(e,t,r,n,o){Fd.bindBufferRange(e,t,Ro.buffers[r],n,o)}function ai(e,t){Fd.bindFramebuffer(e,Ro.framebuffers[t])}function si(e,t){Fd.bindRenderbuffer(e,Ro.renderbuffers[t])}function ci(e,t){Fd.bindSampler(e,Ro.samplers[t])}function ui(e,t){Fd.bindTexture(e,Ro.textures[t])}function li(e,t){Fd.bindTransformFeedback(e,Ro.transformFeedbacks[t])}function di(e){Fd.bindVertexArray(Ro.vaos[e])}function fi(e){Fd.bindVertexArray(Ro.vaos[e])}function mi(e,t,r,n){Fd.blendColor(e,t,r,n)}function pi(e){Fd.blendEquation(e)}function hi(e,t){Fd.blendEquationSeparate(e,t)}function gi(e,t){Fd.blendFunc(e,t)}function vi(e,t,r,n){Fd.blendFuncSeparate(e,t,r,n)}function yi(e,t,r,n,o,i,a,s,c,u){Fd.blitFramebuffer(e,t,r,n,o,i,a,s,c,u)}function bi(e,t,r,n){Ro.currentContext.version>=2?r?Fd.bufferData(e,Y,n,r,t):Fd.bufferData(e,t,n):Fd.bufferData(e,r?Y.subarray(r,r+t):t,n)}function _i(e,t,r,n){Ro.currentContext.version>=2?Fd.bufferSubData(e,t,Y,n,r):Fd.bufferSubData(e,t,Y.subarray(n,n+r))}function wi(e){return Fd.checkFramebufferStatus(e)}function Ei(e){Fd.clear(e)}function xi(e,t,r,n){Fd.clearBufferfi(e,t,r,n)}function ki(e,t,r){Fd.clearBufferfv(e,t,J,r>>2)}function Si(e,t,r){Fd.clearBufferiv(e,t,Q,r>>2)}function Ti(e,t,r){Fd.clearBufferuiv(e,t,Z,r>>2)}function Ci(e,t,r,n){Fd.clearColor(e,t,r,n)}function Pi(e){Fd.clearDepth(e)}function Ai(e){Fd.clearStencil(e)}function Fi(e,t){return N(t===(0|t)),(e>>>0)+4294967296*t}function Di(e,t,r,n){return Fd.clientWaitSync(Ro.syncs[e],t,Fi(r,n))}function Li(e,t,r,n){Fd.colorMask(!!e,!!t,!!r,!!n)}function Ii(e){Fd.compileShader(Ro.shaders[e])}function Ri(e,t,r,n,o,i,a,s){Ro.currentContext.version>=2?Fd.currentPixelUnpackBufferBinding?Fd.compressedTexImage2D(e,t,r,n,o,i,a,s):Fd.compressedTexImage2D(e,t,r,n,o,i,Y,s,a):Fd.compressedTexImage2D(e,t,r,n,o,i,s?Y.subarray(s,s+a):null)}function Mi(e,t,r,n,o,i,a,s,c){Fd.currentPixelUnpackBufferBinding?Fd.compressedTexImage3D(e,t,r,n,o,i,a,s,c):Fd.compressedTexImage3D(e,t,r,n,o,i,a,Y,c,s)}function Oi(e,t,r,n,o,i,a,s,c){Ro.currentContext.version>=2?Fd.currentPixelUnpackBufferBinding?Fd.compressedTexSubImage2D(e,t,r,n,o,i,a,s,c):Fd.compressedTexSubImage2D(e,t,r,n,o,i,a,Y,c,s):Fd.compressedTexSubImage2D(e,t,r,n,o,i,a,c?Y.subarray(c,c+s):null)}function Bi(e,t,r,n,o,i,a,s,c,u,l){Fd.currentPixelUnpackBufferBinding?Fd.compressedTexSubImage3D(e,t,r,n,o,i,a,s,c,u,l):Fd.compressedTexSubImage3D(e,t,r,n,o,i,a,s,c,Y,l,u)}function Ui(e,t,r,n,o){Fd.copyBufferSubData(e,t,r,n,o)}function Ni(e,t,r,n,o,i,a,s){Fd.copyTexImage2D(e,t,r,n,o,i,a,s)}function ji(e,t,r,n,o,i,a,s){Fd.copyTexSubImage2D(e,t,r,n,o,i,a,s)}function qi(e,t,r,n,o,i,a,s,c){Fd.copyTexSubImage3D(e,t,r,n,o,i,a,s,c)}function Gi(){var e=Ro.getNewId(Ro.programs),t=Fd.createProgram();return t.name=e,t.maxUniformLength=t.maxAttributeLength=t.maxUniformBlockNameLength=0,t.uniformIdCounter=1,Ro.programs[e]=t,e}function Wi(e){var t=Ro.getNewId(Ro.shaders);return Ro.shaders[t]=Fd.createShader(e),t}function zi(e){Fd.cullFace(e)}function Vi(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.buffers[n];o&&(Fd.deleteBuffer(o),o.name=0,Ro.buffers[n]=null,n==Fd.currentPixelPackBufferBinding&&(Fd.currentPixelPackBufferBinding=0),n==Fd.currentPixelUnpackBufferBinding&&(Fd.currentPixelUnpackBufferBinding=0))}}function Hi(e,t){for(var r=0;r<e;++r){var n=Q[t+4*r>>2],o=Ro.framebuffers[n];o&&(Fd.deleteFramebuffer(o),o.name=0,Ro.framebuffers[n]=null)}}function $i(e){if(e){var t=Ro.programs[e];t?(Fd.deleteProgram(t),t.name=0,Ro.programs[e]=null):Ro.recordError(1281)}}function Yi(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.queries[n];o&&(Fd.deleteQuery(o),Ro.queries[n]=null)}}function Xi(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.queries[n];o&&(Fd.disjointTimerQueryExt.deleteQueryEXT(o),Ro.queries[n]=null)}}function Ki(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.renderbuffers[n];o&&(Fd.deleteRenderbuffer(o),o.name=0,Ro.renderbuffers[n]=null)}}function Qi(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.samplers[n];o&&(Fd.deleteSampler(o),o.name=0,Ro.samplers[n]=null)}}function Zi(e){if(e){var t=Ro.shaders[e];t?(Fd.deleteShader(t),Ro.shaders[e]=null):Ro.recordError(1281)}}function Ji(e){if(e){var t=Ro.syncs[e];t?(Fd.deleteSync(t),t.name=0,Ro.syncs[e]=null):Ro.recordError(1281)}}function ea(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.textures[n];o&&(Fd.deleteTexture(o),o.name=0,Ro.textures[n]=null)}}function ta(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2],o=Ro.transformFeedbacks[n];o&&(Fd.deleteTransformFeedback(o),o.name=0,Ro.transformFeedbacks[n]=null)}}function ra(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2];Fd.deleteVertexArray(Ro.vaos[n]),Ro.vaos[n]=null}}function na(e,t){for(var r=0;r<e;r++){var n=Q[t+4*r>>2];Fd.deleteVertexArray(Ro.vaos[n]),Ro.vaos[n]=null}}function oa(e){Fd.depthFunc(e)}function ia(e){Fd.depthMask(!!e)}function aa(e,t){Fd.depthRange(e,t)}function sa(e,t){Fd.detachShader(Ro.programs[e],Ro.shaders[t])}function ca(e){Fd.disable(e)}function ua(e){Fd.disableVertexAttribArray(e)}function la(e,t,r){Fd.drawArrays(e,t,r)}function da(e,t,r,n){Fd.drawArraysInstanced(e,t,r,n)}function fa(e,t,r,n){Fd.drawArraysInstanced(e,t,r,n)}function ma(e,t,r,n){Fd.drawArraysInstanced(e,t,r,n)}function pa(e,t,r,n,o){Fd.dibvbi.drawArraysInstancedBaseInstanceWEBGL(e,t,r,n,o)}function ha(e,t,r,n){Fd.drawArraysInstanced(e,t,r,n)}function ga(e,t,r,n){Fd.drawArraysInstanced(e,t,r,n)}var va=[];function ya(e,t){for(var r=va[e],n=0;n<e;n++)r[n]=Q[t+4*n>>2];Fd.drawBuffers(r)}function ba(e,t){for(var r=va[e],n=0;n<e;n++)r[n]=Q[t+4*n>>2];Fd.drawBuffers(r)}function _a(e,t){for(var r=va[e],n=0;n<e;n++)r[n]=Q[t+4*n>>2];Fd.drawBuffers(r)}function wa(e,t,r,n){Fd.drawElements(e,t,r,n)}function Ea(e,t,r,n,o){Fd.drawElementsInstanced(e,t,r,n,o)}function xa(e,t,r,n,o){Fd.drawElementsInstanced(e,t,r,n,o)}function ka(e,t,r,n,o){Fd.drawElementsInstanced(e,t,r,n,o)}function Sa(e,t,r,n,o,i,a){Fd.dibvbi.drawElementsInstancedBaseVertexBaseInstanceWEBGL(e,t,r,n,o,i,a)}function Ta(e,t,r,n,o){Fd.drawElementsInstanced(e,t,r,n,o)}function Ca(e,t,r,n,o){Fd.drawElementsInstanced(e,t,r,n,o)}function Pa(e,t,r,n){Fd.drawElements(e,t,r,n)}function Aa(e,t,r,n,o,i){Pa(e,n,o,i)}function Fa(e){Fd.enable(e)}function Da(e){Fd.enableVertexAttribArray(e)}function La(e){Fd.endQuery(e)}function Ia(e){Fd.disjointTimerQueryExt.endQueryEXT(e)}function Ra(){Fd.endTransformFeedback()}function Ma(e,t){var r=Fd.fenceSync(e,t);if(r){var n=Ro.getNewId(Ro.syncs);return r.name=n,Ro.syncs[n]=r,n}return 0}function Oa(){Fd.finish()}function Ba(){Fd.flush()}function Ua(e,t,r,n){Fd.framebufferRenderbuffer(e,t,r,Ro.renderbuffers[n])}function Na(e,t,r,n,o){Fd.framebufferTexture2D(e,t,r,Ro.textures[n],o)}function ja(e,t,r,n,o){Fd.framebufferTextureLayer(e,t,Ro.textures[r],n,o)}function qa(e){Fd.frontFace(e)}function Ga(e,t,r,n){for(var o=0;o<e;o++){var i=Fd[r](),a=i&&Ro.getNewId(n);i?(i.name=a,n[a]=i):Ro.recordError(1282),Q[t+4*o>>2]=a}}function Wa(e,t){Ga(e,t,"createBuffer",Ro.buffers)}function za(e,t){Ga(e,t,"createFramebuffer",Ro.framebuffers)}function Va(e,t){Ga(e,t,"createQuery",Ro.queries)}function Ha(e,t){for(var r=0;r<e;r++){var n=Fd.disjointTimerQueryExt.createQueryEXT();if(!n){for(Ro.recordError(1282);r<e;)Q[t+4*r++>>2]=0;return}var o=Ro.getNewId(Ro.queries);n.name=o,Ro.queries[o]=n,Q[t+4*r>>2]=o}}function $a(e,t){Ga(e,t,"createRenderbuffer",Ro.renderbuffers)}function Ya(e,t){Ga(e,t,"createSampler",Ro.samplers)}function Xa(e,t){Ga(e,t,"createTexture",Ro.textures)}function Ka(e,t){Ga(e,t,"createTransformFeedback",Ro.transformFeedbacks)}function Qa(e,t){Ga(e,t,"createVertexArray",Ro.vaos)}function Za(e,t){Ga(e,t,"createVertexArray",Ro.vaos)}function Ja(e){Fd.generateMipmap(e)}function es(e,t,r,n,o,i,a,s){t=Ro.programs[t];var c=Fd[e](t,r);if(c){var u=s&&z(c.name,s,n);o&&(Q[o>>2]=u),i&&(Q[i>>2]=c.size),a&&(Q[a>>2]=c.type)}}function ts(e,t,r,n,o,i,a){es("getActiveAttrib",e,t,r,n,o,i,a)}function rs(e,t,r,n,o,i,a){es("getActiveUniform",e,t,r,n,o,i,a)}function ns(e,t,r,n,o){e=Ro.programs[e];var i=Fd.getActiveUniformBlockName(e,t);if(i)if(o&&r>0){var a=z(i,o,r);n&&(Q[n>>2]=a)}else n&&(Q[n>>2]=0)}function os(e,t,r,n){if(n)if(e=Ro.programs[e],35393!=r){var o=Fd.getActiveUniformBlockParameter(e,t,r);if(null!==o)if(35395==r)for(var i=0;i<o.length;i++)Q[n+4*i>>2]=o[i];else Q[n>>2]=o}else{var a=Fd.getActiveUniformBlockName(e,t);Q[n>>2]=a.length+1}else Ro.recordError(1281)}function is(e,t,r,n,o){if(o)if(t>0&&0==r)Ro.recordError(1281);else{e=Ro.programs[e];for(var i=[],a=0;a<t;a++)i.push(Q[r+4*a>>2]);var s=Fd.getActiveUniforms(e,i,n);if(s){var c=s.length;for(a=0;a<c;a++)Q[o+4*a>>2]=s[a]}}else Ro.recordError(1281)}function as(e,t,r,n){var o=Fd.getAttachedShaders(Ro.programs[e]),i=o.length;i>t&&(i=t),Q[r>>2]=i;for(var a=0;a<i;++a){var s=Ro.shaders.indexOf(o[a]);Q[n+4*a>>2]=s}}function ss(e,t){return Fd.getAttribLocation(Ro.programs[e],G(t))}function cs(e){return Z[e>>2]+4294967296*Q[e+4>>2]}function us(e){return Z[e>>2]+4294967296*Z[e+4>>2]}function ls(e,t){Z[e>>2]=t,Z[e+4>>2]=(t-Z[e>>2])/4294967296;var r=t>=0?us(e):cs(e);r!=t&&k("writeI53ToI64() out of range: serialized JS Number "+t+" to Wasm heap as bytes lo=0x"+Z[e>>2].toString(16)+", hi=0x"+Z[e+4>>2].toString(16)+", which deserializes back to "+r+" instead!")}function ds(e,t,r){if(t){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=r&&1!=r&&Ro.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Fd.getParameter(34467);n=o?o.length:0;break;case 33309:if(Ro.currentContext.version<2)return void Ro.recordError(1282);n=2*(Fd.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(Ro.currentContext.version<2)return void Ro.recordError(1280);n=33307==e?3:0}if(void 0===n){var i=Fd.getParameter(e);switch(typeof i){case"number":n=i;break;case"boolean":n=i?1:0;break;case"string":return void Ro.recordError(1280);case"object":if(null===i)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void Ro.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:Q[t+4*a>>2]=i[a];break;case 2:J[t+4*a>>2]=i[a];break;case 4:$[t+a>>0]=i[a]?1:0}return}try{n=0|i.name}catch(t){return Ro.recordError(1280),void x("GL_INVALID_ENUM in glGet"+r+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+t+")")}}break;default:return Ro.recordError(1280),void x("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:ls(t,n);break;case 0:Q[t>>2]=n;break;case 2:J[t>>2]=n;break;case 4:$[t>>0]=n?1:0}}else Ro.recordError(1281)}function fs(e,t){ds(e,t,4)}function ms(e,t,r){r?ls(r,Fd.getBufferParameter(e,t)):Ro.recordError(1281)}function ps(e,t,r){r?Q[r>>2]=Fd.getBufferParameter(e,t):Ro.recordError(1281)}function hs(){var e=Fd.getError()||Ro.lastError;return Ro.lastError=0,e}function gs(e,t){ds(e,t,2)}function vs(e,t){return Fd.getFragDataLocation(Ro.programs[e],G(t))}function ys(e,t,r,n){var o=Fd.getFramebufferAttachmentParameter(e,t,r);(o instanceof WebGLRenderbuffer||o instanceof WebGLTexture)&&(o=0|o.name),Q[n>>2]=o}function bs(e,t,r,n){if(r){var o,i=Fd.getIndexedParameter(e,t);switch(typeof i){case"boolean":o=i?1:0;break;case"number":o=i;break;case"object":if(null===i)switch(e){case 35983:case 35368:o=0;break;default:return void Ro.recordError(1280)}else{if(!(i instanceof WebGLBuffer))return void Ro.recordError(1280);o=0|i.name}break;default:return void Ro.recordError(1280)}switch(n){case 1:ls(r,o);break;case 0:Q[r>>2]=o;break;case 2:J[r>>2]=o;break;case 4:$[r>>0]=o?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+n}}else Ro.recordError(1281)}function _s(e,t,r){bs(e,t,r,1)}function ws(e,t){ds(e,t,1)}function Es(e,t,r){bs(e,t,r,0)}function xs(e,t){ds(e,t,0)}function ks(e,t,r,n,o){if(n<0)Ro.recordError(1281);else if(o){var i=Fd.getInternalformatParameter(e,t,r);if(null!==i)for(var a=0;a<i.length&&a<n;++a)Q[o+4*a>>2]=i[a]}else Ro.recordError(1281)}function Ss(e,t,r,n,o){Ro.recordError(1282)}function Ts(e,t,r,n){var o=Fd.getProgramInfoLog(Ro.programs[e]);null===o&&(o="(unknown error)");var i=t>0&&n?z(o,n,t):0;r&&(Q[r>>2]=i)}function Cs(e,t,r){if(r)if(e>=Ro.counter)Ro.recordError(1281);else if(e=Ro.programs[e],35716==t){var n=Fd.getProgramInfoLog(e);null===n&&(n="(unknown error)"),Q[r>>2]=n.length+1}else if(35719==t){if(!e.maxUniformLength)for(var o=0;o<Fd.getProgramParameter(e,35718);++o)e.maxUniformLength=Math.max(e.maxUniformLength,Fd.getActiveUniform(e,o).name.length+1);Q[r>>2]=e.maxUniformLength}else if(35722==t){if(!e.maxAttributeLength)for(o=0;o<Fd.getProgramParameter(e,35721);++o)e.maxAttributeLength=Math.max(e.maxAttributeLength,Fd.getActiveAttrib(e,o).name.length+1);Q[r>>2]=e.maxAttributeLength}else if(35381==t){if(!e.maxUniformBlockNameLength)for(o=0;o<Fd.getProgramParameter(e,35382);++o)e.maxUniformBlockNameLength=Math.max(e.maxUniformBlockNameLength,Fd.getActiveUniformBlockName(e,o).length+1);Q[r>>2]=e.maxUniformBlockNameLength}else Q[r>>2]=Fd.getProgramParameter(e,t);else Ro.recordError(1281)}function Ps(e,t,r){if(r){var n,o=Ro.queries[e];ls(r,"boolean"==typeof(n=Ro.currentContext.version<2?Fd.disjointTimerQueryExt.getQueryObjectEXT(o,t):Fd.getQueryParameter(o,t))?n?1:0:n)}else Ro.recordError(1281)}function As(e,t,r){if(r){var n,o=Ro.queries[e],i=Fd.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,Q[r>>2]=n}else Ro.recordError(1281)}function Fs(e,t,r){if(r){var n,o=Ro.queries[e];ls(r,"boolean"==typeof(n=Ro.currentContext.version<2?Fd.disjointTimerQueryExt.getQueryObjectEXT(o,t):Fd.getQueryParameter(o,t))?n?1:0:n)}else Ro.recordError(1281)}function Ds(e,t,r){if(r){var n,o=Ro.queries[e],i=Fd.getQueryParameter(o,t);n="boolean"==typeof i?i?1:0:i,Q[r>>2]=n}else Ro.recordError(1281)}function Ls(e,t,r){if(r){var n,o=Ro.queries[e],i=Fd.disjointTimerQueryExt.getQueryObjectEXT(o,t);n="boolean"==typeof i?i?1:0:i,Q[r>>2]=n}else Ro.recordError(1281)}function Is(e,t,r){r?Q[r>>2]=Fd.getQuery(e,t):Ro.recordError(1281)}function Rs(e,t,r){r?Q[r>>2]=Fd.disjointTimerQueryExt.getQueryEXT(e,t):Ro.recordError(1281)}function Ms(e,t,r){r?Q[r>>2]=Fd.getRenderbufferParameter(e,t):Ro.recordError(1281)}function Os(e,t,r){r?J[r>>2]=Fd.getSamplerParameter(Ro.samplers[e],t):Ro.recordError(1281)}function Bs(e,t,r){r?Q[r>>2]=Fd.getSamplerParameter(Ro.samplers[e],t):Ro.recordError(1281)}function Us(e,t,r,n){var o=Fd.getShaderInfoLog(Ro.shaders[e]);null===o&&(o="(unknown error)");var i=t>0&&n?z(o,n,t):0;r&&(Q[r>>2]=i)}function Ns(e,t,r,n){var o=Fd.getShaderPrecisionFormat(e,t);Q[r>>2]=o.rangeMin,Q[r+4>>2]=o.rangeMax,Q[n>>2]=o.precision}function js(e,t,r,n){var o=Fd.getShaderSource(Ro.shaders[e]);if(o){var i=t>0&&n?z(o,n,t):0;r&&(Q[r>>2]=i)}}function qs(e,t,r){if(r)if(35716==t){var n=Fd.getShaderInfoLog(Ro.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;Q[r>>2]=o}else if(35720==t){var i=Fd.getShaderSource(Ro.shaders[e]),a=i?i.length+1:0;Q[r>>2]=a}else Q[r>>2]=Fd.getShaderParameter(Ro.shaders[e],t);else Ro.recordError(1281)}function Gs(e){var t=V(e)+1,r=qd(t);return z(e,r,t),r}function Ws(e){var t=Ro.stringCache[e];if(!t){switch(e){case 7939:var r=Fd.getSupportedExtensions()||[];t=Gs((r=r.concat(r.map((function(e){return"GL_"+e})))).join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Fd.getParameter(e);n||Ro.recordError(1280),t=n&&Gs(n);break;case 7938:var o=Fd.getParameter(7938);t=Gs(o=Ro.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")");break;case 35724:var i=Fd.getParameter(35724),a=i.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),i="OpenGL ES GLSL ES "+a[1]+" ("+i+")"),t=Gs(i);break;default:Ro.recordError(1280)}Ro.stringCache[e]=t}return t}function zs(e,t){if(Ro.currentContext.version<2)return Ro.recordError(1282),0;var r=Ro.stringiCache[e];if(r)return t<0||t>=r.length?(Ro.recordError(1281),0):r[t];if(7939===e){var n=Fd.getSupportedExtensions()||[];return n=(n=n.concat(n.map((function(e){return"GL_"+e})))).map((function(e){return Gs(e)})),r=Ro.stringiCache[e]=n,t<0||t>=r.length?(Ro.recordError(1281),0):r[t]}return Ro.recordError(1280),0}function Vs(e,t,r,n,o){if(r<0)Ro.recordError(1281);else if(o){var i=Fd.getSyncParameter(Ro.syncs[e],t);null!==i&&(Q[o>>2]=i,n&&(Q[n>>2]=1))}else Ro.recordError(1281)}function Hs(e,t,r){r?J[r>>2]=Fd.getTexParameter(e,t):Ro.recordError(1281)}function $s(e,t,r){r?Q[r>>2]=Fd.getTexParameter(e,t):Ro.recordError(1281)}function Ys(e,t,r,n,o,i,a){e=Ro.programs[e];var s=Fd.getTransformFeedbackVarying(e,t);if(s){if(a&&r>0){var c=z(s.name,a,r);n&&(Q[n>>2]=c)}else n&&(Q[n>>2]=0);o&&(Q[o>>2]=s.size),i&&(Q[i>>2]=s.type)}}function Xs(e,t){return Fd.getUniformBlockIndex(Ro.programs[e],G(t))}function Ks(e,t,r,n){if(n)if(t>0&&(0==r||0==n))Ro.recordError(1281);else{e=Ro.programs[e];for(var o=[],i=0;i<t;i++)o.push(G(Q[r+4*i>>2]));var a=Fd.getUniformIndices(e,o);if(a){var s=a.length;for(i=0;i<s;i++)Q[n+4*i>>2]=a[i]}}else Ro.recordError(1281)}function Qs(e){return parseInt(e)}function Zs(e){return"]"==e.slice(-1)&&e.lastIndexOf("[")}function Js(e){var t,r,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},t=0;t<Fd.getProgramParameter(e,35718);++t){var i=Fd.getActiveUniform(e,t),a=i.name,s=i.size,c=Zs(a),u=c>0?a.slice(0,c):a,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[u]=[s,l],r=0;r<s;++r)n[l]=r,e.uniformArrayNamesById[l++]=u}}function ec(e,t){if(t=G(t),e=Ro.programs[e]){Js(e);var r=e.uniformLocsById,n=0,o=t,i=Zs(t);i>0&&(n=Qs(t.slice(i+1))>>>0,o=t.slice(0,i));var a=e.uniformSizeAndIdsByName[o];if(a&&n<a[0]&&(r[n+=a[1]]=r[n]||Fd.getUniformLocation(e,t)))return n}else Ro.recordError(1281);return-1}function tc(e){var t=Fd.currentProgram;if(t){var r=t.uniformLocsById[e];return"number"==typeof r&&(t.uniformLocsById[e]=r=Fd.getUniformLocation(t,t.uniformArrayNamesById[e]+(r>0?"["+r+"]":""))),r}Ro.recordError(1282)}function rc(e,t,r,n){if(r){Js(e=Ro.programs[e]);var o=Fd.getUniform(e,tc(t));if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:Q[r>>2]=o;break;case 2:J[r>>2]=o}else for(var i=0;i<o.length;i++)switch(n){case 0:Q[r+4*i>>2]=o[i];break;case 2:J[r+4*i>>2]=o[i]}}else Ro.recordError(1281)}function nc(e,t,r){rc(e,t,r,2)}function oc(e,t,r){rc(e,t,r,0)}function ic(e,t,r){rc(e,t,r,0)}function ac(e,t,r,n){if(r){var o=Fd.getVertexAttrib(e,t);if(34975==t)Q[r>>2]=o&&o.name;else if("number"==typeof o||"boolean"==typeof o)switch(n){case 0:Q[r>>2]=o;break;case 2:J[r>>2]=o;break;case 5:Q[r>>2]=Math.fround(o)}else for(var i=0;i<o.length;i++)switch(n){case 0:Q[r+4*i>>2]=o[i];break;case 2:J[r+4*i>>2]=o[i];break;case 5:Q[r+4*i>>2]=Math.fround(o[i])}}else Ro.recordError(1281)}function sc(e,t,r){ac(e,t,r,0)}function cc(e,t,r){ac(e,t,r,0)}function uc(e,t,r){r?Q[r>>2]=Fd.getVertexAttribOffset(e,t):Ro.recordError(1281)}function lc(e,t,r){ac(e,t,r,2)}function dc(e,t,r){ac(e,t,r,5)}function fc(e,t){Fd.hint(e,t)}function mc(e,t,r){for(var n=va[t],o=0;o<t;o++)n[o]=Q[r+4*o>>2];Fd.invalidateFramebuffer(e,n)}function pc(e,t,r,n,o,i,a){for(var s=va[t],c=0;c<t;c++)s[c]=Q[r+4*c>>2];Fd.invalidateSubFramebuffer(e,s,n,o,i,a)}function hc(e){var t=Ro.buffers[e];return t?Fd.isBuffer(t):0}function gc(e){return Fd.isEnabled(e)}function vc(e){var t=Ro.framebuffers[e];return t?Fd.isFramebuffer(t):0}function yc(e){return(e=Ro.programs[e])?Fd.isProgram(e):0}function bc(e){var t=Ro.queries[e];return t?Fd.isQuery(t):0}function _c(e){var t=Ro.queries[e];return t?Fd.disjointTimerQueryExt.isQueryEXT(t):0}function wc(e){var t=Ro.renderbuffers[e];return t?Fd.isRenderbuffer(t):0}function Ec(e){var t=Ro.samplers[e];return t?Fd.isSampler(t):0}function xc(e){var t=Ro.shaders[e];return t?Fd.isShader(t):0}function kc(e){return Fd.isSync(Ro.syncs[e])}function Sc(e){var t=Ro.textures[e];return t?Fd.isTexture(t):0}function Tc(e){return Fd.isTransformFeedback(Ro.transformFeedbacks[e])}function Cc(e){var t=Ro.vaos[e];return t?Fd.isVertexArray(t):0}function Pc(e){var t=Ro.vaos[e];return t?Fd.isVertexArray(t):0}function Ac(e){Fd.lineWidth(e)}function Fc(e){e=Ro.programs[e],Fd.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}}function Dc(e,t,r,n,o,i){Fd.mdibvbi.multiDrawArraysInstancedBaseInstanceWEBGL(e,Q,t>>2,Q,r>>2,Q,n>>2,Z,o>>2,i)}function Lc(e,t,r,n,o,i,a,s){Fd.mdibvbi.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(e,Q,t>>2,r,Q,n>>2,Q,o>>2,Q,i>>2,Z,a>>2,s)}function Ic(){Fd.pauseTransformFeedback()}function Rc(e,t){3317==e&&(Ro.unpackAlignment=t),Fd.pixelStorei(e,t)}function Mc(e,t){Fd.polygonOffset(e,t)}function Oc(e,t,r,n){Ro.recordError(1280)}function Bc(e,t,r){Ro.recordError(1280)}function Uc(e,t){Fd.disjointTimerQueryExt.queryCounterEXT(Ro.queries[e],t)}function Nc(e){Fd.readBuffer(e)}function jc(e,t,r,n){var o;return t*(e*r+(o=n)-1&-o)}function qc(e){return{5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1}function Gc(e){return 0==(e-=5120)?$:1==e?Y:2==e?X:4==e?Q:6==e?J:5==e||28922==e||28520==e||30779==e||30782==e?Z:K}function Wc(e){return 31-Math.clz32(e.BYTES_PER_ELEMENT)}function zc(e,t,r,n,o,i){var a=Gc(e),s=Wc(a),c=1<<s,u=jc(r,n,qc(t)*c,Ro.unpackAlignment);return a.subarray(o>>s,o+u>>s)}function Vc(e,t,r,n,o,i,a){if(Ro.currentContext.version>=2)if(Fd.currentPixelPackBufferBinding)Fd.readPixels(e,t,r,n,o,i,a);else{var s=Gc(i);Fd.readPixels(e,t,r,n,o,i,s,a>>Wc(s))}else{var c=zc(i,o,r,n,a);c?Fd.readPixels(e,t,r,n,o,i,c):Ro.recordError(1280)}}function Hc(){}function $c(e,t,r,n){Fd.renderbufferStorage(e,t,r,n)}function Yc(e,t,r,n,o){Fd.renderbufferStorageMultisample(e,t,r,n,o)}function Xc(){Fd.resumeTransformFeedback()}function Kc(e,t){Fd.sampleCoverage(e,!!t)}function Qc(e,t,r){Fd.samplerParameterf(Ro.samplers[e],t,r)}function Zc(e,t,r){var n=J[r>>2];Fd.samplerParameterf(Ro.samplers[e],t,n)}function Jc(e,t,r){Fd.samplerParameteri(Ro.samplers[e],t,r)}function eu(e,t,r){var n=Q[r>>2];Fd.samplerParameteri(Ro.samplers[e],t,n)}function tu(e,t,r,n){Fd.scissor(e,t,r,n)}function ru(){Ro.recordError(1280)}function nu(e,t,r,n){var o=Ro.getSource(e,t,r,n);if(Ro.currentContext.version>=2&&o.includes("#version 100")){var i="";(o=(o=o.replace(/#extension GL_OES_standard_derivatives : enable/g,"")).replace(/#extension GL_EXT_shader_texture_lod : enable/g,"")).includes("gl_FragColor")&&(i+="out mediump vec4 GL_FragColor;\n",o=o.replace(/gl_FragColor/g,"GL_FragColor")),o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=(o=o.includes("attribute")?(o=o.replace(/attribute/g,"in")).replace(/varying/g,"out"):o.replace(/varying/g,"in")).replace(/textureCubeLodEXT/g,"textureCubeLod")).replace(/texture2DLodEXT/g,"texture2DLod")).replace(/texture2DProjLodEXT/g,"texture2DProjLod")).replace(/texture2DGradEXT/g,"texture2DGrad")).replace(/texture2DProjGradEXT/g,"texture2DProjGrad")).replace(/textureCubeGradEXT/g,"textureCubeGrad")).replace(/textureCube/g,"texture")).replace(/texture1D/g,"texture")).replace(/texture2D/g,"texture")).replace(/texture3D/g,"texture")).replace(/#version 100/g,"#version 300 es\n"+i)}Fd.shaderSource(Ro.shaders[e],o)}function ou(e,t,r){Fd.stencilFunc(e,t,r)}function iu(e,t,r,n){Fd.stencilFuncSeparate(e,t,r,n)}function au(e){Fd.stencilMask(e)}function su(e,t){Fd.stencilMaskSeparate(e,t)}function cu(e,t,r){Fd.stencilOp(e,t,r)}function uu(e,t,r,n){Fd.stencilOpSeparate(e,t,r,n)}function lu(e,t,r,n,o,i,a,s,c){if(Ro.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)),Ro.currentContext.version>=2)if(Fd.currentPixelUnpackBufferBinding)Fd.texImage2D(e,t,r,n,o,i,a,s,c);else if(c){var u=Gc(s);Fd.texImage2D(e,t,r,n,o,i,a,s,u,c>>Wc(u))}else Fd.texImage2D(e,t,r,n,o,i,a,s,null);else Fd.texImage2D(e,t,r,n,o,i,a,s,c?zc(s,a,n,o,c):null)}function du(e,t,r,n,o,i,a,s,c,u){if(Fd.currentPixelUnpackBufferBinding)Fd.texImage3D(e,t,r,n,o,i,a,s,c,u);else if(u){var l=Gc(c);Fd.texImage3D(e,t,r,n,o,i,a,s,c,l,u>>Wc(l))}else Fd.texImage3D(e,t,r,n,o,i,a,s,c,null)}function fu(e,t,r){Fd.texParameterf(e,t,r)}function mu(e,t,r){var n=J[r>>2];Fd.texParameterf(e,t,n)}function pu(e,t,r){Fd.texParameteri(e,t,r)}function hu(e,t,r){var n=Q[r>>2];Fd.texParameteri(e,t,n)}function gu(e,t,r,n,o){Fd.texStorage2D(e,t,r,n,o)}function vu(e,t,r,n,o,i){Fd.texStorage3D(e,t,r,n,o,i)}function yu(e,t,r,n,o,i,a,s,c){if(Ro.currentContext.version>=2&&36193==s&&(s=5131),Ro.currentContext.version>=2)if(Fd.currentPixelUnpackBufferBinding)Fd.texSubImage2D(e,t,r,n,o,i,a,s,c);else if(c){var u=Gc(s);Fd.texSubImage2D(e,t,r,n,o,i,a,s,u,c>>Wc(u))}else Fd.texSubImage2D(e,t,r,n,o,i,a,s,null);else{var l=null;c&&(l=zc(s,a,o,i,c)),Fd.texSubImage2D(e,t,r,n,o,i,a,s,l)}}function bu(e,t,r,n,o,i,a,s,c,u,l){if(Fd.currentPixelUnpackBufferBinding)Fd.texSubImage3D(e,t,r,n,o,i,a,s,c,u,l);else if(l){var d=Gc(u);Fd.texSubImage3D(e,t,r,n,o,i,a,s,c,u,d,l>>Wc(d))}else Fd.texSubImage3D(e,t,r,n,o,i,a,s,c,u,null)}function _u(e,t,r,n){e=Ro.programs[e];for(var o=[],i=0;i<t;i++)o.push(G(Q[r+4*i>>2]));Fd.transformFeedbackVaryings(e,o,n)}function wu(e,t){Fd.uniform1f(tc(e),t)}var Eu=[];function xu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform1fv(tc(e),J,r>>2,t);else{if(t<=288)for(var n=Eu[t-1],o=0;o<t;++o)n[o]=J[r+4*o>>2];else n=J.subarray(r>>2,r+4*t>>2);Fd.uniform1fv(tc(e),n)}}function ku(e,t){Fd.uniform1i(tc(e),t)}var Su=[];function Tu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform1iv(tc(e),Q,r>>2,t);else{if(t<=288)for(var n=Su[t-1],o=0;o<t;++o)n[o]=Q[r+4*o>>2];else n=Q.subarray(r>>2,r+4*t>>2);Fd.uniform1iv(tc(e),n)}}function Cu(e,t){Fd.uniform1ui(tc(e),t)}function Pu(e,t,r){Fd.uniform1uiv(tc(e),Z,r>>2,t)}function Au(e,t,r){Fd.uniform2f(tc(e),t,r)}function Fu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform2fv(tc(e),J,r>>2,2*t);else{if(t<=144)for(var n=Eu[2*t-1],o=0;o<2*t;o+=2)n[o]=J[r+4*o>>2],n[o+1]=J[r+(4*o+4)>>2];else n=J.subarray(r>>2,r+8*t>>2);Fd.uniform2fv(tc(e),n)}}function Du(e,t,r){Fd.uniform2i(tc(e),t,r)}function Lu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform2iv(tc(e),Q,r>>2,2*t);else{if(t<=144)for(var n=Su[2*t-1],o=0;o<2*t;o+=2)n[o]=Q[r+4*o>>2],n[o+1]=Q[r+(4*o+4)>>2];else n=Q.subarray(r>>2,r+8*t>>2);Fd.uniform2iv(tc(e),n)}}function Iu(e,t,r){Fd.uniform2ui(tc(e),t,r)}function Ru(e,t,r){Fd.uniform2uiv(tc(e),Z,r>>2,2*t)}function Mu(e,t,r,n){Fd.uniform3f(tc(e),t,r,n)}function Ou(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform3fv(tc(e),J,r>>2,3*t);else{if(t<=96)for(var n=Eu[3*t-1],o=0;o<3*t;o+=3)n[o]=J[r+4*o>>2],n[o+1]=J[r+(4*o+4)>>2],n[o+2]=J[r+(4*o+8)>>2];else n=J.subarray(r>>2,r+12*t>>2);Fd.uniform3fv(tc(e),n)}}function Bu(e,t,r,n){Fd.uniform3i(tc(e),t,r,n)}function Uu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform3iv(tc(e),Q,r>>2,3*t);else{if(t<=96)for(var n=Su[3*t-1],o=0;o<3*t;o+=3)n[o]=Q[r+4*o>>2],n[o+1]=Q[r+(4*o+4)>>2],n[o+2]=Q[r+(4*o+8)>>2];else n=Q.subarray(r>>2,r+12*t>>2);Fd.uniform3iv(tc(e),n)}}function Nu(e,t,r,n){Fd.uniform3ui(tc(e),t,r,n)}function ju(e,t,r){Fd.uniform3uiv(tc(e),Z,r>>2,3*t)}function qu(e,t,r,n,o){Fd.uniform4f(tc(e),t,r,n,o)}function Gu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform4fv(tc(e),J,r>>2,4*t);else{if(t<=72){var n=Eu[4*t-1],o=J;r>>=2;for(var i=0;i<4*t;i+=4){var a=r+i;n[i]=o[a],n[i+1]=o[a+1],n[i+2]=o[a+2],n[i+3]=o[a+3]}}else n=J.subarray(r>>2,r+16*t>>2);Fd.uniform4fv(tc(e),n)}}function Wu(e,t,r,n,o){Fd.uniform4i(tc(e),t,r,n,o)}function zu(e,t,r){if(Ro.currentContext.version>=2)Fd.uniform4iv(tc(e),Q,r>>2,4*t);else{if(t<=72)for(var n=Su[4*t-1],o=0;o<4*t;o+=4)n[o]=Q[r+4*o>>2],n[o+1]=Q[r+(4*o+4)>>2],n[o+2]=Q[r+(4*o+8)>>2],n[o+3]=Q[r+(4*o+12)>>2];else n=Q.subarray(r>>2,r+16*t>>2);Fd.uniform4iv(tc(e),n)}}function Vu(e,t,r,n,o){Fd.uniform4ui(tc(e),t,r,n,o)}function Hu(e,t,r){Fd.uniform4uiv(tc(e),Z,r>>2,4*t)}function $u(e,t,r){e=Ro.programs[e],Fd.uniformBlockBinding(e,t,r)}function Yu(e,t,r,n){if(Ro.currentContext.version>=2)Fd.uniformMatrix2fv(tc(e),!!r,J,n>>2,4*t);else{if(t<=72)for(var o=Eu[4*t-1],i=0;i<4*t;i+=4)o[i]=J[n+4*i>>2],o[i+1]=J[n+(4*i+4)>>2],o[i+2]=J[n+(4*i+8)>>2],o[i+3]=J[n+(4*i+12)>>2];else o=J.subarray(n>>2,n+16*t>>2);Fd.uniformMatrix2fv(tc(e),!!r,o)}}function Xu(e,t,r,n){Fd.uniformMatrix2x3fv(tc(e),!!r,J,n>>2,6*t)}function Ku(e,t,r,n){Fd.uniformMatrix2x4fv(tc(e),!!r,J,n>>2,8*t)}function Qu(e,t,r,n){if(Ro.currentContext.version>=2)Fd.uniformMatrix3fv(tc(e),!!r,J,n>>2,9*t);else{if(t<=32)for(var o=Eu[9*t-1],i=0;i<9*t;i+=9)o[i]=J[n+4*i>>2],o[i+1]=J[n+(4*i+4)>>2],o[i+2]=J[n+(4*i+8)>>2],o[i+3]=J[n+(4*i+12)>>2],o[i+4]=J[n+(4*i+16)>>2],o[i+5]=J[n+(4*i+20)>>2],o[i+6]=J[n+(4*i+24)>>2],o[i+7]=J[n+(4*i+28)>>2],o[i+8]=J[n+(4*i+32)>>2];else o=J.subarray(n>>2,n+36*t>>2);Fd.uniformMatrix3fv(tc(e),!!r,o)}}function Zu(e,t,r,n){Fd.uniformMatrix3x2fv(tc(e),!!r,J,n>>2,6*t)}function Ju(e,t,r,n){Fd.uniformMatrix3x4fv(tc(e),!!r,J,n>>2,12*t)}function el(e,t,r,n){if(Ro.currentContext.version>=2)Fd.uniformMatrix4fv(tc(e),!!r,J,n>>2,16*t);else{if(t<=18){var o=Eu[16*t-1],i=J;n>>=2;for(var a=0;a<16*t;a+=16){var s=n+a;o[a]=i[s],o[a+1]=i[s+1],o[a+2]=i[s+2],o[a+3]=i[s+3],o[a+4]=i[s+4],o[a+5]=i[s+5],o[a+6]=i[s+6],o[a+7]=i[s+7],o[a+8]=i[s+8],o[a+9]=i[s+9],o[a+10]=i[s+10],o[a+11]=i[s+11],o[a+12]=i[s+12],o[a+13]=i[s+13],o[a+14]=i[s+14],o[a+15]=i[s+15]}}else o=J.subarray(n>>2,n+64*t>>2);Fd.uniformMatrix4fv(tc(e),!!r,o)}}function tl(e,t,r,n){Fd.uniformMatrix4x2fv(tc(e),!!r,J,n>>2,8*t)}function rl(e,t,r,n){Fd.uniformMatrix4x3fv(tc(e),!!r,J,n>>2,12*t)}function nl(e){e=Ro.programs[e],Fd.useProgram(e),Fd.currentProgram=e}function ol(e){Fd.validateProgram(Ro.programs[e])}function il(e,t){Fd.vertexAttrib1f(e,t)}function al(e,t){Fd.vertexAttrib1f(e,J[t>>2])}function sl(e,t,r){Fd.vertexAttrib2f(e,t,r)}function cl(e,t){Fd.vertexAttrib2f(e,J[t>>2],J[t+4>>2])}function ul(e,t,r,n){Fd.vertexAttrib3f(e,t,r,n)}function ll(e,t){Fd.vertexAttrib3f(e,J[t>>2],J[t+4>>2],J[t+8>>2])}function dl(e,t,r,n,o){Fd.vertexAttrib4f(e,t,r,n,o)}function fl(e,t){Fd.vertexAttrib4f(e,J[t>>2],J[t+4>>2],J[t+8>>2],J[t+12>>2])}function ml(e,t){Fd.vertexAttribDivisor(e,t)}function pl(e,t){Fd.vertexAttribDivisor(e,t)}function hl(e,t){Fd.vertexAttribDivisor(e,t)}function gl(e,t){Fd.vertexAttribDivisor(e,t)}function vl(e,t){Fd.vertexAttribDivisor(e,t)}function yl(e,t,r,n,o){Fd.vertexAttribI4i(e,t,r,n,o)}function bl(e,t){Fd.vertexAttribI4i(e,Q[t>>2],Q[t+4>>2],Q[t+8>>2],Q[t+12>>2])}function _l(e,t,r,n,o){Fd.vertexAttribI4ui(e,t,r,n,o)}function wl(e,t){Fd.vertexAttribI4ui(e,Z[t>>2],Z[t+4>>2],Z[t+8>>2],Z[t+12>>2])}function El(e,t,r,n,o){Fd.vertexAttribIPointer(e,t,r,n,o)}function xl(e,t,r,n,o,i){Fd.vertexAttribPointer(e,t,r,!!n,o,i)}function kl(e,t,r,n){Fd.viewport(e,t,r,n)}function Sl(e,t,r,n){Fd.waitSync(Ro.syncs[e],t,Fi(r,n))}function Tl(e,t,r){Y.copyWithin(e,t,t+r)}function Cl(e){try{return R.grow(e-H.byteLength+65535>>>16),pe(R.buffer),1}catch(t){x("emscripten_realloc_buffer: Attempted to grow heap from "+H.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}function Pl(e){var t=Y.length;N((e>>>=0)>t);var r,n=2147483648;if(e>n)return x("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is 2147483648 bytes!"),!1;for(var o=1;o<=4;o*=2){var i=t*(1+.2/o);i=Math.min(i,e+100663296);var a=Math.min(n,(r=Math.max(e,i))+(65536-r%65536)%65536);if(Cl(a))return!0}return x("Failed to grow the heap from "+t+" bytes to "+a+" bytes, not enough memory!"),!1}function Al(e,t,r,n,i,a,s,c,u){const l=o.UTF8ToString(e,e+t),d=o.HEAPU8.subarray(a,a+s),f=o.HEAPU32.subarray(c/4,c/4+u),m=o.emscripten_ubq_codec_decoderNextHandle++,p=[];for(let e=0;e<u;e++)p[e]=Ro.textures[f[e]];const h={codec:l,codedWidth:r,codedHeight:n,description:new Uint8Array(d)};try{const e=o.emscripten_ubq_codec_createVideoDecoder(p);e.configure(h),e.numberOfFrames=i,o.emscripten_ubq_codec_decoders.set(m,{videoDecoder:e,decoderConfig:h,textures:p})}catch{return 0}return m}function Fl(e,t,r,n,i){const a=o.UTF8ToString(e,e+t),s=o.emscripten_ubq_codec_encoderNextHandle++,c=o.specialHTMLTargets["!canvas"];c.width=r,c.height=n;const u={codec:a,width:r,height:n,avc:{format:"annexb"},fps:i};try{const e=new VideoEncoder({output:e=>{const t=o._malloc(e.byteLength),r=o.HEAPU8.subarray(t,t+e.byteLength);e.copyTo(r),o.emscripten_ubq_codec_muxChunk(s,t,e.byteLength),o._free(t)},error:e=>console.error(e)});e.configure(u),o.emscripten_ubq_codec_encoders.set(s,{videoEncoder:e,encoderConfig:u,groupOfPictures:150,frameIndex:0})}catch{return 0}return s}function Dl(e,t,r,n,i,a){const s=o.emscripten_ubq_codec_decoders.get(e);"closed"===s.videoDecoder.state&&(s.videoDecoder=o.emscripten_ubq_codec_createVideoDecoder(s.texture),s.videoDecoder.configure(s.decoderConfig));const c=s.videoDecoder,u=o.HEAPU8.subarray(i,i+a),l=new EncodedVideoChunk({type:t?"key":"delta",timestamp:r,duration:n,data:u});try{c.decode(l)}catch(e){return console.error(e),!1}return!0}function Ll(e){o.emscripten_ubq_codec_decoders.get(e).videoDecoder.close(),o.emscripten_ubq_codec_decoders.delete(e)}function Il(e){o.emscripten_ubq_codec_encoders.get(e).videoEncoder.close(),o.emscripten_ubq_codec_encoders.delete(e)}function Rl(e,t,r){const n=o.emscripten_ubq_codec_encoders.get(e),i=1e6*n.frameIndex/n.encoderConfig.fps,a=n.frameIndex%n.groupOfPictures==0,s=o.specialHTMLTargets["!canvas"],c=new VideoFrame(s,{timestamp:i});n.videoEncoder.encode(c,{keyFrame:a}),c.close(),n.frameIndex++}async function Ml(e){var t=o.emscripten_ubq_codec_getOnFinalizedEncodingCallback();const r=o.emscripten_ubq_codec_encoders.get(e);await r.videoEncoder.flush(),t.invoke()}async function Ol(e){const t=o.emscripten_ubq_codec_decoders.get(e).videoDecoder;await t.flush(),t.decodedFrames=0}function Bl(e){return o.emscripten_ubq_codec_decoders.get(e).videoDecoder.decodedFrames}function Ul(){return"undefined"!=typeof VideoFrame&&"undefined"!=typeof VideoDecoder&&"undefined"!=typeof VideoEncoder}function Nl(e){const t=o.emscripten_ubq_codec_decoders.get(e).videoDecoder;t.decodedFrames=0,t.probing=!0}function jl(e){const t=o.emscripten_ubq_codec_decoders.get(e).videoDecoder;t.probing=!1,t.decodedFrames=0}function ql(e){const t=o.emscripten_ubq_codec_decoders.get(e),r=!0===t.videoDecoder.textureUploadFlag;return t.videoDecoder.textureUploadFlag=!1,r}function Gl(e){if(o.emscripten_ubq_asyncFetchStates.has(e)){const t=o.emscripten_ubq_asyncFetchStates.get(e);if(t.state==a.ALLOCATED)return!0;if(t.state==a.FINISHED){const r=t.result.length,n=o._malloc(r);return o.HEAPU8.set(t.result,n),t.resultAddress=n,t.resultLength=r,t.state=a.ALLOCATED,o.emscripten_ubq_asyncFetchStates.set(e,t),!0}}return!1}function Wl(e,t,r,n){let i=o.UTF8ToString(e,t),a=o.UTF8ToString(r,n),s=o.emscripten_ubq_asyncFetchNextHeaderHandle++;return o.emscripten_ubq_asyncFetchHeaders.set(s,{key:i,value:a}),s}function zl(e){return o.emscripten_ubq_asyncFetchHeaders.has(e)?o.emscripten_ubq_asyncFetchHeaders.get(e):0}function Vl(e,t,r,n,i,c,u,l,d){let f=o.UTF8ToString(t,r),m=o.UTF8ToString(l,d),p=o.emscripten_ubq_asyncFetchNextHandle++;o.emscripten_ubq_asyncFetchStates.set(p,{state:a.PENDING});let h={};for(let e=0;e<i;e++){const t=o.getValue(n+4*e,"i32"),r=o.emscripten_ubq_asyncFetchHeaders.get(t);h[r.key]=r.value}const g=s[e];let v;return"GET"!==g&&"HEAD"!==g&&(v=new Uint8Array(o.HEAPU8.buffer,c,u)),fetch(f,{method:g,headers:h,body:v,mode:"cors",credentials:m}).then((e=>{if(e.status>=200&&e.status<=209){let t=0;return e.headers.has("Content-Length")&&(t=+e.headers.get("Content-Length")),o.emscripten_ubq_asyncFetchTotalBytes.set(p,t),async function(e,t){const r=e.getReader();let n=0,i=[];for(;;){const{done:e,value:t}=await r.read();if(e)break;i.push(t),n+=t.length,o.emscripten_ubq_asyncFetchCompletedBytes.set(p,n)}let a=new Uint8Array(n),s=0;for(let e of i)a.set(e,s),s+=e.length;return a}(e.body)}return Promise.reject(e.statusText)})).then((e=>{o.emscripten_ubq_asyncFetchStates.set(p,{state:a.FINISHED,result:e})})).catch((e=>{o.emscripten_ubq_asyncFetchStates.set(p,{state:a.ERROR,error:e})})),p}function Hl(e){return!!o.emscripten_ubq_asyncFetchStates.has(e)&&(o.emscripten_ubq_asyncFetchStates.delete(e),!0)}function $l(e){return o.emscripten_ubq_asyncFetchCompletedBytes.has(e)?o.emscripten_ubq_asyncFetchCompletedBytes.get(e):0}function Yl(e){if(o.emscripten_ubq_asyncFetchStates.has(e)){const t=o.emscripten_ubq_asyncFetchStates.get(e);if(t.state==a.ALLOCATED)return t.resultAddress}return-1}function Xl(e){if(o.emscripten_ubq_asyncFetchStates.has(e)){const t=o.emscripten_ubq_asyncFetchStates.get(e);if(t.state==a.ALLOCATED)return t.resultLength}return-1}function Kl(e){return o.emscripten_ubq_asyncFetchStates.has(e)?o.emscripten_ubq_asyncFetchStates.get(e).state:-1}function Ql(e){return o.emscripten_ubq_asyncFetchTotalBytes.has(e)?o.emscripten_ubq_asyncFetchTotalBytes.get(e):0}var Zl={inEventHandler:0,removeAllEventListeners:function(){for(var e=Zl.eventHandlers.length-1;e>=0;--e)Zl._removeHandler(e);Zl.eventHandlers=[],Zl.deferredCalls=[]},registerRemoveEventListeners:function(){Zl.removeEventListenersRegistered||(xe.push(Zl.removeAllEventListeners),Zl.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(e,t,r){function n(e,t){if(e.length!=t.length)return!1;for(var r in e)if(e[r]!=t[r])return!1;return!0}for(var o in Zl.deferredCalls){var i=Zl.deferredCalls[o];if(i.targetFunction==e&&n(i.argsList,r))return}Zl.deferredCalls.push({targetFunction:e,precedence:t,argsList:r}),Zl.deferredCalls.sort((function(e,t){return e.precedence<t.precedence}))},removeDeferredCalls:function(e){for(var t=0;t<Zl.deferredCalls.length;++t)Zl.deferredCalls[t].targetFunction==e&&(Zl.deferredCalls.splice(t,1),--t)},canPerformEventHandlerRequests:function(){return Zl.inEventHandler&&Zl.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(Zl.canPerformEventHandlerRequests())for(var e=0;e<Zl.deferredCalls.length;++e){var t=Zl.deferredCalls[e];Zl.deferredCalls.splice(e,1),--e,t.targetFunction.apply(null,t.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(e,t){for(var r=0;r<Zl.eventHandlers.length;++r)Zl.eventHandlers[r].target!=e||t&&t!=Zl.eventHandlers[r].eventTypeString||Zl._removeHandler(r--)},_removeHandler:function(e){var t=Zl.eventHandlers[e];t.target.removeEventListener(t.eventTypeString,t.eventListenerFunc,t.useCapture),Zl.eventHandlers.splice(e,1)},registerOrRemoveHandler:function(e){var t=function(t){++Zl.inEventHandler,Zl.currentEventHandler=e,Zl.runDeferredCalls(),e.handlerFunc(t),Zl.runDeferredCalls(),--Zl.inEventHandler};if(e.callbackfunc)e.eventListenerFunc=t,e.target.addEventListener(e.eventTypeString,t,e.useCapture),Zl.eventHandlers.push(e),Zl.registerRemoveEventListeners();else for(var r=0;r<Zl.eventHandlers.length;++r)Zl.eventHandlers[r].target==e.target&&Zl.eventHandlers[r].eventTypeString==e.eventTypeString&&Zl._removeHandler(r--)},getNodeNameForTarget:function(e){return e?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}},Jl=["default","low-power","high-performance"];function ed(e){return e>2?G(e):e}var td=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0];function rd(e){return e=ed(e),td[e]||("undefined"!=typeof document?document.querySelector(e):void 0)}function nd(e){return rd(e)}function od(e,t){N(t);var r=t>>2,n=Q[r+6],o={alpha:!!Q[r+0],depth:!!Q[r+1],stencil:!!Q[r+2],antialias:!!Q[r+3],premultipliedAlpha:!!Q[r+4],preserveDrawingBuffer:!!Q[r+5],powerPreference:Jl[n],failIfMajorPerformanceCaveat:!!Q[r+7],majorVersion:Q[r+8],minorVersion:Q[r+9],enableExtensionsByDefault:Q[r+10],explicitSwapControl:Q[r+11],proxyContextToMainThread:Q[r+12],renderViaOffscreenBackBuffer:Q[r+13]},i=nd(e);return i?o.explicitSwapControl?0:Ro.createContext(i,o):0}function id(e,t){return od(e,t)}function ad(e){Ro.currentContext==e&&(Ro.currentContext=0),Ro.deleteContext(e)}function sd(e){N(e);for(var t=e>>2,r=0;r<14;++r)Q[t+r]=0;Q[t+0]=Q[t+1]=Q[t+3]=Q[t+4]=Q[t+8]=Q[t+10]=1}function cd(e){return Ro.makeContextCurrent(e)?0:-5}var ud={};function ld(){return l||"./this.program"}function dd(){if(!dd.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",_:ld()};for(var t in ud)void 0===ud[t]?delete e[t]:e[t]=ud[t];var r=[];for(var t in e)r.push(t+"="+e[t]);dd.strings=r}return dd.strings}function fd(e,t){var r=0;return dd().forEach((function(n,o){var i=t+r;Q[e+4*o>>2]=i,me(n,i),r+=n.length+1})),0}function md(e,t){var r=dd();Q[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),Q[t>>2]=n,0}function pd(e){try{var t=xt.getStreamFromFD(e);return Et.close(t),0}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return e.errno}}function hd(e,t,r,n,o){try{var i=0|Number(n&BigInt(4294967295));N(!(0|Number(n>>BigInt(32))),"offsets over 2^32 not yet supported");var a=xt.getStreamFromFD(e),s=xt.doReadv(a,t,r,i);return Q[o>>2]=s,0}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return e.errno}}function gd(e,t,r,n){try{var o=xt.getStreamFromFD(e),i=xt.doReadv(o,t,r);return Q[n>>2]=i,0}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return e.errno}}function vd(e,t,r,n){try{var o=0|Number(t&BigInt(4294967295)),i=0|Number(t>>BigInt(32)),a=xt.getStreamFromFD(e),s=4294967296*i+(o>>>0),c=9007199254740992;return s<=-c||s>=c?-61:(Et.llseek(a,s,r),ee[n>>3]=BigInt(a.position),a.getdents&&0===s&&0===r&&(a.getdents=null),0)}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return e.errno}}function yd(e,t,r,n){try{var o=xt.getStreamFromFD(e),i=xt.doWritev(o,t,r);return Q[n>>2]=i,0}catch(e){if(void 0===Et||!(e instanceof Et.ErrnoError))throw e;return e.errno}}function bd(){return I()}function _d(e){var t=Date.now();return Q[e>>2]=t/1e3|0,Q[e+4>>2]=t%1e3*1e3|0,0}function wd(e){L(e)}function Ed(e){return e%4==0&&(e%100!=0||e%400==0)}function xd(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}var kd=[31,29,31,30,31,30,31,31,30,31,30,31],Sd=[31,28,31,30,31,30,31,31,30,31,30,31];function Td(e,t){for(var r=new Date(e.getTime());t>0;){var n=Ed(r.getFullYear()),o=r.getMonth(),i=(n?kd:Sd)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function Cd(e,t,r,n){var o=Q[n+40>>2],i={tm_sec:Q[n>>2],tm_min:Q[n+4>>2],tm_hour:Q[n+8>>2],tm_mday:Q[n+12>>2],tm_mon:Q[n+16>>2],tm_year:Q[n+20>>2],tm_wday:Q[n+24>>2],tm_yday:Q[n+28>>2],tm_isdst:Q[n+32>>2],tm_gmtoff:Q[n+36>>2],tm_zone:o?G(o):""},a=G(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 c in s)a=a.replace(new RegExp(c,"g"),s[c]);var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function f(e,t){return d(e,t,"0")}function m(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function p(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 h(e){var t=Td(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=p(r),i=p(n);return m(o,t)<=0?m(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var g={"%a":function(e){return u[e.tm_wday].substring(0,3)},"%A":function(e){return u[e.tm_wday]},"%b":function(e){return l[e.tm_mon].substring(0,3)},"%B":function(e){return l[e.tm_mon]},"%C":function(e){return f((e.tm_year+1900)/100|0,2)},"%d":function(e){return f(e.tm_mday,2)},"%e":function(e){return d(e.tm_mday,2," ")},"%g":function(e){return h(e).toString().substring(2)},"%G":function(e){return h(e)},"%H":function(e){return f(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),f(t,2)},"%j":function(e){return f(e.tm_mday+xd(Ed(e.tm_year+1900)?kd:Sd,e.tm_mon-1),3)},"%m":function(e){return f(e.tm_mon+1,2)},"%M":function(e){return f(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return f(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:Td(t,7-t.getDay()),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(r,n)<0){var o=xd(Ed(n.getFullYear())?kd:Sd,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return f(Math.ceil(i/7),2)}return 0===m(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),n=new Date(e.tm_year+1901,0,4),o=p(r),i=p(n),a=Td(new Date(e.tm_year+1900,0,1),e.tm_yday);return m(a,o)<0?"53":m(i,a)<=0?"01":(t=o.getFullYear()<e.tm_year+1900?e.tm_yday+32-o.getDate():e.tm_yday+1-o.getDate(),f(Math.ceil(t/7),2))},"%w":function(e){return e.tm_wday},"%W":function(e){var t=new Date(e.tm_year,0,1),r=1===t.getDay()?t:Td(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(m(r,n)<0){var o=xd(Ed(n.getFullYear())?kd:Sd,n.getMonth()-1)-31,i=31-r.getDate()+o+n.getDate();return f(Math.ceil(i/7),2)}return 0===m(r,t)?"01":"00"},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(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":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var c in a=a.replace(/%%/g,"\0\0"),g)a.includes(c)&&(a=a.replace(new RegExp(c,"g"),g[c](i)));var v=Bd(a=a.replace(/\0\0/g,"%"),!1);return v.length>t?0:(fe(v,e),v.length-1)}function Pd(e,t,r,n){return Cd(e,t,r,n)}function Ad(e){var t=Date.now()/1e3|0;return e&&(Q[e>>2]=t),t}var Fd,Dd=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Et.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Ld=365,Id=146;Object.defineProperties(Dd.prototype,{read:{get:function(){return(this.mode&Ld)===Ld},set:function(e){e?this.mode|=Ld:this.mode&=~Ld}},write:{get:function(){return(this.mode&Id)===Id},set:function(e){e?this.mode|=Id:this.mode&=~Id}},isFolder:{get:function(){return Et.isDir(this.mode)}},isDevice:{get:function(){return Et.isChrdev(this.mode)}}}),Et.FSNode=Dd,Et.staticInit(),o.FS_createPath=Et.createPath,o.FS_createDataFile=Et.createDataFile,o.FS_createPreloadedFile=Et.createPreloadedFile,o.FS_createLazyFile=Et.createLazyFile,o.FS_createDevice=Et.createDevice,o.FS_unlink=Et.unlink,wt={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},Vt=o.InternalError=zt(Error,"InternalError"),Zt(),tr=o.BindingError=zt(Error,"BindingError"),Rr(),xr(),Hr(),Kr=o.UnboundTypeError=zt(Error,"UnboundTypeError"),dn(),o.requestFullscreen=function(e,t){So.requestFullscreen(e,t)},o.requestFullScreen=function(){So.requestFullScreen()},o.requestAnimationFrame=function(e){So.requestAnimationFrame(e)},o.setCanvasSize=function(e,t,r){So.setCanvasSize(e,t,r)},o.pauseMainLoop=function(){So.mainLoop.pause()},o.resumeMainLoop=function(){So.mainLoop.resume()},o.getUserMedia=function(){So.getUserMedia()},o.createContext=function(e,t,r,n){return So.createContext(e,t,r,n)};for(var Rd=0;Rd<32;++Rd)va.push(new Array(Rd));var Md=new Float32Array(288);for(Rd=0;Rd<288;++Rd)Eu[Rd]=Md.subarray(0,Rd+1);var Od=new Int32Array(288);for(Rd=0;Rd<288;++Rd)Su[Rd]=Od.subarray(0,Rd+1);function Bd(e,t,r){var n=r>0?r:V(e)+1,o=new Array(n),i=W(e,o,0,o.length);return t&&(o.length=i),o}function Ud(){T("fetchSettings")}"function"==typeof atob&&atob;var Nd,jd={__assert_fail:at,__cxa_allocate_exception:st,__cxa_throw:ut,__syscall_fcntl64:kt,__syscall_fstat64:St,__syscall_fstatat64:Tt,__syscall_getdents64:Ct,__syscall_ioctl:Pt,__syscall_lstat64:At,__syscall_open:Ft,__syscall_stat64:Dt,_dlopen_js:Lt,_dlsym_js:It,_embind_finalize_value_array:Yt,_embind_finalize_value_object:Kt,_embind_register_bigint:ir,_embind_register_bool:sr,_embind_register_class:Jr,_embind_register_class_constructor:tn,_embind_register_class_function:on,_embind_register_emval:mn,_embind_register_enum:hn,_embind_register_enum_value:vn,_embind_register_float:bn,_embind_register_function:_n,_embind_register_integer:wn,_embind_register_memory_view:En,_embind_register_smart_ptr:xn,_embind_register_std_string:kn,_embind_register_std_wstring:Sn,_embind_register_value_array:Tn,_embind_register_value_array_element:Cn,_embind_register_value_object:Pn,_embind_register_value_object_field:An,_embind_register_void:Fn,_emscripten_throw_longjmp:Dn,_emval_as:Ln,_emval_call:Rn,_emval_call_method:Nn,_emval_call_void_method:jn,_emval_decref:cn,_emval_get_global:Gn,_emval_get_method_caller:Vn,_emval_get_property:Hn,_emval_incref:$n,_emval_instanceof:Yn,_emval_is_number:Xn,_emval_is_string:Kn,_emval_new:eo,_emval_new_array:to,_emval_new_cstring:ro,_emval_new_object:no,_emval_run_destructors:oo,_emval_set_property:io,_emval_take_value:ao,_emval_throw:so,_gmtime_js:co,_localtime_js:uo,_mktime_js:lo,_mmap_js:fo,_munmap_js:mo,_tzset_js:ho,abort:go,clock_gettime:yo,eglChooseConfig:Co,eglCreateContext:Mo,eglCreateWindowSurface:Oo,eglDestroyContext:Bo,eglDestroySurface:Uo,eglGetConfigAttrib:No,eglGetDisplay:jo,eglGetError:qo,eglInitialize:Go,eglMakeCurrent:Wo,eglSwapBuffers:zo,eglTerminate:Vo,emscripten_console_error:Ho,emscripten_console_log:$o,emscripten_console_warn:Yo,emscripten_debugger:Xo,emscripten_get_heap_max:Ko,emscripten_get_now:Zn,emscripten_glActiveTexture:Qo,emscripten_glAttachShader:Zo,emscripten_glBeginQuery:Jo,emscripten_glBeginQueryEXT:ei,emscripten_glBeginTransformFeedback:ti,emscripten_glBindAttribLocation:ri,emscripten_glBindBuffer:ni,emscripten_glBindBufferBase:oi,emscripten_glBindBufferRange:ii,emscripten_glBindFramebuffer:ai,emscripten_glBindRenderbuffer:si,emscripten_glBindSampler:ci,emscripten_glBindTexture:ui,emscripten_glBindTransformFeedback:li,emscripten_glBindVertexArray:di,emscripten_glBindVertexArrayOES:fi,emscripten_glBlendColor:mi,emscripten_glBlendEquation:pi,emscripten_glBlendEquationSeparate:hi,emscripten_glBlendFunc:gi,emscripten_glBlendFuncSeparate:vi,emscripten_glBlitFramebuffer:yi,emscripten_glBufferData:bi,emscripten_glBufferSubData:_i,emscripten_glCheckFramebufferStatus:wi,emscripten_glClear:Ei,emscripten_glClearBufferfi:xi,emscripten_glClearBufferfv:ki,emscripten_glClearBufferiv:Si,emscripten_glClearBufferuiv:Ti,emscripten_glClearColor:Ci,emscripten_glClearDepthf:Pi,emscripten_glClearStencil:Ai,emscripten_glClientWaitSync:Di,emscripten_glColorMask:Li,emscripten_glCompileShader:Ii,emscripten_glCompressedTexImage2D:Ri,emscripten_glCompressedTexImage3D:Mi,emscripten_glCompressedTexSubImage2D:Oi,emscripten_glCompressedTexSubImage3D:Bi,emscripten_glCopyBufferSubData:Ui,emscripten_glCopyTexImage2D:Ni,emscripten_glCopyTexSubImage2D:ji,emscripten_glCopyTexSubImage3D:qi,emscripten_glCreateProgram:Gi,emscripten_glCreateShader:Wi,emscripten_glCullFace:zi,emscripten_glDeleteBuffers:Vi,emscripten_glDeleteFramebuffers:Hi,emscripten_glDeleteProgram:$i,emscripten_glDeleteQueries:Yi,emscripten_glDeleteQueriesEXT:Xi,emscripten_glDeleteRenderbuffers:Ki,emscripten_glDeleteSamplers:Qi,emscripten_glDeleteShader:Zi,emscripten_glDeleteSync:Ji,emscripten_glDeleteTextures:ea,emscripten_glDeleteTransformFeedbacks:ta,emscripten_glDeleteVertexArrays:ra,emscripten_glDeleteVertexArraysOES:na,emscripten_glDepthFunc:oa,emscripten_glDepthMask:ia,emscripten_glDepthRangef:aa,emscripten_glDetachShader:sa,emscripten_glDisable:ca,emscripten_glDisableVertexAttribArray:ua,emscripten_glDrawArrays:la,emscripten_glDrawArraysInstanced:da,emscripten_glDrawArraysInstancedANGLE:fa,emscripten_glDrawArraysInstancedARB:ma,emscripten_glDrawArraysInstancedBaseInstanceWEBGL:pa,emscripten_glDrawArraysInstancedEXT:ha,emscripten_glDrawArraysInstancedNV:ga,emscripten_glDrawBuffers:ya,emscripten_glDrawBuffersEXT:ba,emscripten_glDrawBuffersWEBGL:_a,emscripten_glDrawElements:wa,emscripten_glDrawElementsInstanced:Ea,emscripten_glDrawElementsInstancedANGLE:xa,emscripten_glDrawElementsInstancedARB:ka,emscripten_glDrawElementsInstancedBaseVertexBaseInstanceWEBGL:Sa,emscripten_glDrawElementsInstancedEXT:Ta,emscripten_glDrawElementsInstancedNV:Ca,emscripten_glDrawRangeElements:Aa,emscripten_glEnable:Fa,emscripten_glEnableVertexAttribArray:Da,emscripten_glEndQuery:La,emscripten_glEndQueryEXT:Ia,emscripten_glEndTransformFeedback:Ra,emscripten_glFenceSync:Ma,emscripten_glFinish:Oa,emscripten_glFlush:Ba,emscripten_glFramebufferRenderbuffer:Ua,emscripten_glFramebufferTexture2D:Na,emscripten_glFramebufferTextureLayer:ja,emscripten_glFrontFace:qa,emscripten_glGenBuffers:Wa,emscripten_glGenFramebuffers:za,emscripten_glGenQueries:Va,emscripten_glGenQueriesEXT:Ha,emscripten_glGenRenderbuffers:$a,emscripten_glGenSamplers:Ya,emscripten_glGenTextures:Xa,emscripten_glGenTransformFeedbacks:Ka,emscripten_glGenVertexArrays:Qa,emscripten_glGenVertexArraysOES:Za,emscripten_glGenerateMipmap:Ja,emscripten_glGetActiveAttrib:ts,emscripten_glGetActiveUniform:rs,emscripten_glGetActiveUniformBlockName:ns,emscripten_glGetActiveUniformBlockiv:os,emscripten_glGetActiveUniformsiv:is,emscripten_glGetAttachedShaders:as,emscripten_glGetAttribLocation:ss,emscripten_glGetBooleanv:fs,emscripten_glGetBufferParameteri64v:ms,emscripten_glGetBufferParameteriv:ps,emscripten_glGetError:hs,emscripten_glGetFloatv:gs,emscripten_glGetFragDataLocation:vs,emscripten_glGetFramebufferAttachmentParameteriv:ys,emscripten_glGetInteger64i_v:_s,emscripten_glGetInteger64v:ws,emscripten_glGetIntegeri_v:Es,emscripten_glGetIntegerv:xs,emscripten_glGetInternalformativ:ks,emscripten_glGetProgramBinary:Ss,emscripten_glGetProgramInfoLog:Ts,emscripten_glGetProgramiv:Cs,emscripten_glGetQueryObjecti64vEXT:Ps,emscripten_glGetQueryObjectivEXT:As,emscripten_glGetQueryObjectui64vEXT:Fs,emscripten_glGetQueryObjectuiv:Ds,emscripten_glGetQueryObjectuivEXT:Ls,emscripten_glGetQueryiv:Is,emscripten_glGetQueryivEXT:Rs,emscripten_glGetRenderbufferParameteriv:Ms,emscripten_glGetSamplerParameterfv:Os,emscripten_glGetSamplerParameteriv:Bs,emscripten_glGetShaderInfoLog:Us,emscripten_glGetShaderPrecisionFormat:Ns,emscripten_glGetShaderSource:js,emscripten_glGetShaderiv:qs,emscripten_glGetString:Ws,emscripten_glGetStringi:zs,emscripten_glGetSynciv:Vs,emscripten_glGetTexParameterfv:Hs,emscripten_glGetTexParameteriv:$s,emscripten_glGetTransformFeedbackVarying:Ys,emscripten_glGetUniformBlockIndex:Xs,emscripten_glGetUniformIndices:Ks,emscripten_glGetUniformLocation:ec,emscripten_glGetUniformfv:nc,emscripten_glGetUniformiv:oc,emscripten_glGetUniformuiv:ic,emscripten_glGetVertexAttribIiv:sc,emscripten_glGetVertexAttribIuiv:cc,emscripten_glGetVertexAttribPointerv:uc,emscripten_glGetVertexAttribfv:lc,emscripten_glGetVertexAttribiv:dc,emscripten_glHint:fc,emscripten_glInvalidateFramebuffer:mc,emscripten_glInvalidateSubFramebuffer:pc,emscripten_glIsBuffer:hc,emscripten_glIsEnabled:gc,emscripten_glIsFramebuffer:vc,emscripten_glIsProgram:yc,emscripten_glIsQuery:bc,emscripten_glIsQueryEXT:_c,emscripten_glIsRenderbuffer:wc,emscripten_glIsSampler:Ec,emscripten_glIsShader:xc,emscripten_glIsSync:kc,emscripten_glIsTexture:Sc,emscripten_glIsTransformFeedback:Tc,emscripten_glIsVertexArray:Cc,emscripten_glIsVertexArrayOES:Pc,emscripten_glLineWidth:Ac,emscripten_glLinkProgram:Fc,emscripten_glMultiDrawArraysInstancedBaseInstanceWEBGL:Dc,emscripten_glMultiDrawElementsInstancedBaseVertexBaseInstanceWEBGL:Lc,emscripten_glPauseTransformFeedback:Ic,emscripten_glPixelStorei:Rc,emscripten_glPolygonOffset:Mc,emscripten_glProgramBinary:Oc,emscripten_glProgramParameteri:Bc,emscripten_glQueryCounterEXT:Uc,emscripten_glReadBuffer:Nc,emscripten_glReadPixels:Vc,emscripten_glReleaseShaderCompiler:Hc,emscripten_glRenderbufferStorage:$c,emscripten_glRenderbufferStorageMultisample:Yc,emscripten_glResumeTransformFeedback:Xc,emscripten_glSampleCoverage:Kc,emscripten_glSamplerParameterf:Qc,emscripten_glSamplerParameterfv:Zc,emscripten_glSamplerParameteri:Jc,emscripten_glSamplerParameteriv:eu,emscripten_glScissor:tu,emscripten_glShaderBinary:ru,emscripten_glShaderSource:nu,emscripten_glStencilFunc:ou,emscripten_glStencilFuncSeparate:iu,emscripten_glStencilMask:au,emscripten_glStencilMaskSeparate:su,emscripten_glStencilOp:cu,emscripten_glStencilOpSeparate:uu,emscripten_glTexImage2D:lu,emscripten_glTexImage3D:du,emscripten_glTexParameterf:fu,emscripten_glTexParameterfv:mu,emscripten_glTexParameteri:pu,emscripten_glTexParameteriv:hu,emscripten_glTexStorage2D:gu,emscripten_glTexStorage3D:vu,emscripten_glTexSubImage2D:yu,emscripten_glTexSubImage3D:bu,emscripten_glTransformFeedbackVaryings:_u,emscripten_glUniform1f:wu,emscripten_glUniform1fv:xu,emscripten_glUniform1i:ku,emscripten_glUniform1iv:Tu,emscripten_glUniform1ui:Cu,emscripten_glUniform1uiv:Pu,emscripten_glUniform2f:Au,emscripten_glUniform2fv:Fu,emscripten_glUniform2i:Du,emscripten_glUniform2iv:Lu,emscripten_glUniform2ui:Iu,emscripten_glUniform2uiv:Ru,emscripten_glUniform3f:Mu,emscripten_glUniform3fv:Ou,emscripten_glUniform3i:Bu,emscripten_glUniform3iv:Uu,emscripten_glUniform3ui:Nu,emscripten_glUniform3uiv:ju,emscripten_glUniform4f:qu,emscripten_glUniform4fv:Gu,emscripten_glUniform4i:Wu,emscripten_glUniform4iv:zu,emscripten_glUniform4ui:Vu,emscripten_glUniform4uiv:Hu,emscripten_glUniformBlockBinding:$u,emscripten_glUniformMatrix2fv:Yu,emscripten_glUniformMatrix2x3fv:Xu,emscripten_glUniformMatrix2x4fv:Ku,emscripten_glUniformMatrix3fv:Qu,emscripten_glUniformMatrix3x2fv:Zu,emscripten_glUniformMatrix3x4fv:Ju,emscripten_glUniformMatrix4fv:el,emscripten_glUniformMatrix4x2fv:tl,emscripten_glUniformMatrix4x3fv:rl,emscripten_glUseProgram:nl,emscripten_glValidateProgram:ol,emscripten_glVertexAttrib1f:il,emscripten_glVertexAttrib1fv:al,emscripten_glVertexAttrib2f:sl,emscripten_glVertexAttrib2fv:cl,emscripten_glVertexAttrib3f:ul,emscripten_glVertexAttrib3fv:ll,emscripten_glVertexAttrib4f:dl,emscripten_glVertexAttrib4fv:fl,emscripten_glVertexAttribDivisor:ml,emscripten_glVertexAttribDivisorANGLE:pl,emscripten_glVertexAttribDivisorARB:hl,emscripten_glVertexAttribDivisorEXT:gl,emscripten_glVertexAttribDivisorNV:vl,emscripten_glVertexAttribI4i:yl,emscripten_glVertexAttribI4iv:bl,emscripten_glVertexAttribI4ui:_l,emscripten_glVertexAttribI4uiv:wl,emscripten_glVertexAttribIPointer:El,emscripten_glVertexAttribPointer:xl,emscripten_glViewport:kl,emscripten_glWaitSync:Sl,emscripten_memcpy_big:Tl,emscripten_resize_heap:Pl,emscripten_ubq_codec_createDecoder:Al,emscripten_ubq_codec_createEncoder:Fl,emscripten_ubq_codec_decodeSample:Dl,emscripten_ubq_codec_destroyDecoder:Ll,emscripten_ubq_codec_destroyEncoder:Il,emscripten_ubq_codec_encodeFrame:Rl,emscripten_ubq_codec_finalizeEncoding:Ml,emscripten_ubq_codec_flushDecoder:Ol,emscripten_ubq_codec_getNumberOfDecodedFrames:Bl,emscripten_ubq_codec_isSupported:Ul,emscripten_ubq_codec_startProbing:Nl,emscripten_ubq_codec_stopProbing:jl,emscripten_ubq_codec_testAndClearTextureUpdateFlag:ql,emscripten_ubq_fetch_allocateFetchResult:Gl,emscripten_ubq_fetch_createHeader:Wl,emscripten_ubq_fetch_deleteHeader:zl,emscripten_ubq_fetch_dispatchAsyncFetch:Vl,emscripten_ubq_fetch_freeFetchResult:Hl,emscripten_ubq_fetch_getFetchCompletedBytes:$l,emscripten_ubq_fetch_getFetchResultAddress:Yl,emscripten_ubq_fetch_getFetchResultLength:Xl,emscripten_ubq_fetch_getFetchState:Kl,emscripten_ubq_fetch_getFetchTotalBytes:Ql,emscripten_webgl_create_context:id,emscripten_webgl_destroy_context:ad,emscripten_webgl_init_context_attributes:sd,emscripten_webgl_make_context_current:cd,environ_get:fd,environ_sizes_get:md,exit:_o,fd_close:pd,fd_pread:hd,fd_read:gd,fd_seek:vd,fd_write:yd,getTempRet0:bd,gettimeofday:_d,invoke_ii:Jd,invoke_iii:ef,invoke_iiii:rf,invoke_iiiii:uf,invoke_iiiiii:af,invoke_iiiiiii:cf,invoke_v:ff,invoke_vi:nf,invoke_vii:of,invoke_viii:tf,invoke_viiii:sf,invoke_viiiii:lf,invoke_viiiiii:mf,invoke_viiiiiiiii:df,setTempRet0:wd,strftime_l:Pd,time:Ad},qd=(Je(),o.___wasm_call_ctors=Ke("__wasm_call_ctors"),o._malloc=Ke("malloc")),Gd=(o._main=Ke("main"),o._free=Ke("free")),Wd=o.___errno_location=Ke("__errno_location"),zd=(o._saveSetjmp=Ke("saveSetjmp"),o.___getTypeName=Ke("__getTypeName")),Vd=(o.___embind_register_native_and_builtin_types=Ke("__embind_register_native_and_builtin_types"),o.___stdio_exit=Ke("__stdio_exit")),Hd=(o.___dl_seterr=Ke("__dl_seterr"),o._emscripten_main_thread_process_queued_calls=Ke("emscripten_main_thread_process_queued_calls"),o._emscripten_builtin_memalign=Ke("emscripten_builtin_memalign")),$d=o._setThrew=Ke("setThrew"),Yd=o._emscripten_stack_init=function(){return(Yd=o._emscripten_stack_init=o.asm.emscripten_stack_init).apply(null,arguments)},Xd=(o._emscripten_stack_get_free=function(){return(o._emscripten_stack_get_free=o.asm.emscripten_stack_get_free).apply(null,arguments)},o._emscripten_stack_get_base=function(){return(o._emscripten_stack_get_base=o.asm.emscripten_stack_get_base).apply(null,arguments)},o._emscripten_stack_get_end=function(){return(Xd=o._emscripten_stack_get_end=o.asm.emscripten_stack_get_end).apply(null,arguments)}),Kd=o.stackSave=Ke("stackSave"),Qd=o.stackRestore=Ke("stackRestore"),Zd=o.stackAlloc=Ke("stackAlloc");function Jd(e,t){var r=Kd();try{return ot(e)(t)}catch(e){if(Qd(r),e!==e+0)throw e;$d(1,0)}}function ef(e,t,r){var n=Kd();try{return ot(e)(t,r)}catch(e){if(Qd(n),e!==e+0)throw e;$d(1,0)}}function tf(e,t,r,n){var o=Kd();try{ot(e)(t,r,n)}catch(e){if(Qd(o),e!==e+0)throw e;$d(1,0)}}function rf(e,t,r,n){var o=Kd();try{return ot(e)(t,r,n)}catch(e){if(Qd(o),e!==e+0)throw e;$d(1,0)}}function nf(e,t){var r=Kd();try{ot(e)(t)}catch(e){if(Qd(r),e!==e+0)throw e;$d(1,0)}}function of(e,t,r){var n=Kd();try{ot(e)(t,r)}catch(e){if(Qd(n),e!==e+0)throw e;$d(1,0)}}function af(e,t,r,n,o,i){var a=Kd();try{return ot(e)(t,r,n,o,i)}catch(e){if(Qd(a),e!==e+0)throw e;$d(1,0)}}function sf(e,t,r,n,o){var i=Kd();try{ot(e)(t,r,n,o)}catch(e){if(Qd(i),e!==e+0)throw e;$d(1,0)}}function cf(e,t,r,n,o,i,a){var s=Kd();try{return ot(e)(t,r,n,o,i,a)}catch(e){if(Qd(s),e!==e+0)throw e;$d(1,0)}}function uf(e,t,r,n,o){var i=Kd();try{return ot(e)(t,r,n,o)}catch(e){if(Qd(i),e!==e+0)throw e;$d(1,0)}}function lf(e,t,r,n,o,i){var a=Kd();try{ot(e)(t,r,n,o,i)}catch(e){if(Qd(a),e!==e+0)throw e;$d(1,0)}}function df(e,t,r,n,o,i,a,s,c,u){var l=Kd();try{ot(e)(t,r,n,o,i,a,s,c,u)}catch(e){if(Qd(l),e!==e+0)throw e;$d(1,0)}}function ff(e){var t=Kd();try{ot(e)()}catch(e){if(Qd(t),e!==e+0)throw e;$d(1,0)}}function mf(e,t,r,n,o,i,a){var s=Kd();try{ot(e)(t,r,n,o,i,a)}catch(e){if(Qd(s),e!==e+0)throw e;$d(1,0)}}function pf(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function hf(e){N(0==Be,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'),N(0==_e.length,"cannot call main when preRun functions remain to be called");var t=o._main,r=(e=e||[]).length+1,n=Zd(4*(r+1));Q[n>>2]=de(l);for(var i=1;i<r;i++)Q[(n>>2)+i]=de(e[i-1]);Q[(n>>2)+r]=0;try{var a=t(r,n);return bf(a,!0),a}catch(e){return it(e)}}function gf(){Yd(),ye()}function vf(e){function r(){Nd||(Nd=!0,o.calledRun=!0,U||(Fe(),De(),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),wf&&hf(e),Ie()))}e=e||u,Be>0||(gf(),Ae(),Be>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),r()}),1)):r(),be()))}function yf(){var e=E,t=x,r=!1;E=x=e=>{r=!0};try{Vd(),["stdout","stderr"].forEach((function(e){var t=Et.analyzePath("/dev/"+e);if(t){var n=t.object.rdev,o=pt.ttys[n];o&&o.output&&o.output.length&&(r=!0)}}))}catch(e){}E=e,x=t,r&&k("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}function bf(e,t){if(B=e,Ce||yf(),Pe()){if(!t){var r="program exited (with status: "+e+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";n(r),x(r)}}else Le();_f(e)}function _f(e){B=e,Pe()||(o.onExit&&o.onExit(e),U=!0),d(e,new pf(e))}if(A("intArrayFromString",!1),A("intArrayToString",!1),A("ccall",!1),A("cwrap",!1),A("setValue",!1),o.getValue=O,A("allocate",!1),A("UTF8ArrayToString",!1),o.UTF8ToString=G,A("stringToUTF8Array",!1),A("stringToUTF8",!1),A("lengthBytesUTF8",!1),A("stackTrace",!1),A("addOnPreRun",!1),A("addOnInit",!1),A("addOnPreMain",!1),A("addOnExit",!1),A("addOnPostRun",!1),A("writeStringToMemory",!1),A("writeArrayToMemory",!1),A("writeAsciiToMemory",!1),o.addRunDependency=Ge,o.removeRunDependency=ze,A("FS_createFolder",!1),o.FS_createPath=Et.createPath,o.FS_createDataFile=Et.createDataFile,o.FS_createPreloadedFile=Et.createPreloadedFile,o.FS_createLazyFile=Et.createLazyFile,A("FS_createLink",!1),o.FS_createDevice=Et.createDevice,o.FS_unlink=Et.unlink,A("getLEB",!1),A("getFunctionTables",!1),A("alignFunctionTables",!1),A("registerFunctions",!1),A("addFunction",!1),A("removeFunction",!1),A("getFuncWrapper",!1),A("prettyPrint",!1),A("dynCall",!1),A("getCompilerSetting",!1),A("print",!1),A("printErr",!1),A("getTempRet0",!1),A("setTempRet0",!1),A("callMain",!1),A("abort",!1),A("keepRuntimeAlive",!1),A("zeroMemory",!1),A("stringToNewUTF8",!1),A("emscripten_realloc_buffer",!1),A("ENV",!1),A("withStackSave",!1),A("ERRNO_CODES",!1),A("ERRNO_MESSAGES",!1),A("setErrNo",!1),A("inetPton4",!1),A("inetNtop4",!1),A("inetPton6",!1),A("inetNtop6",!1),A("readSockaddr",!1),A("writeSockaddr",!1),A("DNS",!1),A("getHostByName",!1),A("Protocols",!1),A("Sockets",!1),A("getRandomDevice",!1),A("traverseStack",!1),A("convertFrameToPC",!1),A("UNWIND_CACHE",!1),A("saveInUnwindCache",!1),A("convertPCtoSourceLocation",!1),A("readAsmConstArgsArray",!1),A("readAsmConstArgs",!1),A("mainThreadEM_ASM",!1),A("jstoi_q",!1),A("jstoi_s",!1),A("getExecutableName",!1),A("listenOnce",!1),A("autoResumeAudioContext",!1),A("dynCall",!1),A("callRuntimeCallbacks",!1),A("wasmTableMirror",!1),A("setWasmTableEntry",!1),A("getWasmTableEntry",!1),A("handleException",!1),A("runtimeKeepalivePush",!1),A("runtimeKeepalivePop",!1),A("callUserCallback",!1),A("maybeExit",!1),A("safeSetTimeout",!1),A("asmjsMangle",!1),A("asyncLoad",!1),A("alignMemory",!1),A("mmapAlloc",!1),A("reallyNegative",!1),A("unSign",!1),A("reSign",!1),A("formatString",!1),A("PATH",!1),A("PATH_FS",!1),A("SYSCALLS",!1),A("getSocketFromFD",!1),A("getSocketAddress",!1),A("JSEvents",!1),A("registerKeyEventCallback",!1),o.specialHTMLTargets=td,A("maybeCStringToJsString",!1),A("findEventTarget",!1),A("findCanvasEventTarget",!1),A("getBoundingClientRect",!1),A("fillMouseEventData",!1),A("registerMouseEventCallback",!1),A("registerWheelEventCallback",!1),A("registerUiEventCallback",!1),A("registerFocusEventCallback",!1),A("fillDeviceOrientationEventData",!1),A("registerDeviceOrientationEventCallback",!1),A("fillDeviceMotionEventData",!1),A("registerDeviceMotionEventCallback",!1),A("screenOrientation",!1),A("fillOrientationChangeEventData",!1),A("registerOrientationChangeEventCallback",!1),A("fillFullscreenChangeEventData",!1),A("registerFullscreenChangeEventCallback",!1),A("registerRestoreOldStyle",!1),A("hideEverythingExceptGivenElement",!1),A("restoreHiddenElements",!1),A("setLetterbox",!1),A("currentFullscreenStrategy",!1),A("restoreOldWindowedStyle",!1),A("softFullscreenResizeWebGLRenderTarget",!1),A("doRequestFullscreen",!1),A("fillPointerlockChangeEventData",!1),A("registerPointerlockChangeEventCallback",!1),A("registerPointerlockErrorEventCallback",!1),A("requestPointerLock",!1),A("fillVisibilityChangeEventData",!1),A("registerVisibilityChangeEventCallback",!1),A("registerTouchEventCallback",!1),A("fillGamepadEventData",!1),A("registerGamepadEventCallback",!1),A("registerBeforeUnloadEventCallback",!1),A("fillBatteryEventData",!1),A("battery",!1),A("registerBatteryEventCallback",!1),A("setCanvasElementSize",!1),A("getCanvasElementSize",!1),A("demangle",!1),A("demangleAll",!1),A("jsStackTrace",!1),A("stackTrace",!1),A("getEnvStrings",!1),A("checkWasiClock",!1),A("writeI53ToI64",!1),A("writeI53ToI64Clamped",!1),A("writeI53ToI64Signaling",!1),A("writeI53ToU64Clamped",!1),A("writeI53ToU64Signaling",!1),A("readI53FromI64",!1),A("readI53FromU64",!1),A("convertI32PairToI53",!1),A("convertU32PairToI53",!1),A("setImmediateWrapped",!1),A("clearImmediateWrapped",!1),A("polyfillSetImmediate",!1),A("uncaughtExceptionCount",!1),A("exceptionLast",!1),A("exceptionCaught",!1),A("ExceptionInfo",!1),A("CatchInfo",!1),A("exception_addRef",!1),A("exception_decRef",!1),A("Browser",!1),A("funcWrappers",!1),A("getFuncWrapper",!1),A("setMainLoop",!1),A("wget",!1),A("FS",!1),A("MEMFS",!1),A("TTY",!1),A("PIPEFS",!1),A("SOCKFS",!1),A("_setNetworkCallback",!1),A("tempFixedLengthArray",!1),A("miniTempWebGLFloatBuffers",!1),A("heapObjectForWebGLType",!1),A("heapAccessShiftForWebGLHeap",!1),A("GL",!1),A("emscriptenWebGLGet",!1),A("computeUnpackAlignedImageSize",!1),A("emscriptenWebGLGetTexPixelData",!1),A("emscriptenWebGLGetUniform",!1),A("webglGetUniformLocation",!1),A("webglPrepareUniformLocationsBeforeFirstUse",!1),A("webglGetLeftBracePos",!1),A("emscriptenWebGLGetVertexAttrib",!1),A("writeGLArray",!1),A("AL",!1),A("SDL_unicode",!1),A("SDL_ttfContext",!1),A("SDL_audio",!1),A("SDL",!1),A("SDL_gfx",!1),A("GLUT",!1),A("EGL",!1),A("GLFW_Window",!1),A("GLFW",!1),A("GLEW",!1),A("IDBStore",!1),A("runAndAbortIfError",!1),A("emscriptenWebGLGetIndexed",!1),A("InternalError",!1),A("BindingError",!1),A("UnboundTypeError",!1),A("PureVirtualError",!1),A("init_embind",!1),A("throwInternalError",!1),A("throwBindingError",!1),A("throwUnboundTypeError",!1),A("ensureOverloadTable",!1),A("exposePublicSymbol",!1),A("replacePublicSymbol",!1),A("extendError",!1),A("createNamedFunction",!1),A("registeredInstances",!1),A("getBasestPointer",!1),A("registerInheritedInstance",!1),A("unregisterInheritedInstance",!1),A("getInheritedInstance",!1),A("getInheritedInstanceCount",!1),A("getLiveInheritedInstances",!1),A("registeredTypes",!1),A("awaitingDependencies",!1),A("typeDependencies",!1),A("registeredPointers",!1),A("registerType",!1),A("whenDependentTypesAreResolved",!1),A("embind_charCodes",!1),A("embind_init_charCodes",!1),A("readLatin1String",!1),A("getTypeName",!1),A("heap32VectorToArray",!1),A("requireRegisteredType",!1),A("getShiftFromSize",!1),A("integerReadValueFromPointer",!1),A("enumReadValueFromPointer",!1),A("floatReadValueFromPointer",!1),A("simpleReadValueFromPointer",!1),A("runDestructors",!1),A("new_",!1),A("craftInvokerFunction",!1),A("embind__requireFunction",!1),A("tupleRegistrations",!1),A("structRegistrations",!1),A("genericPointerToWireType",!1),A("constNoSmartPtrRawPointerToWireType",!1),A("nonConstNoSmartPtrRawPointerToWireType",!1),A("init_RegisteredPointer",!1),A("RegisteredPointer",!1),A("RegisteredPointer_getPointee",!1),A("RegisteredPointer_destructor",!1),A("RegisteredPointer_deleteObject",!1),A("RegisteredPointer_fromWireType",!1),A("runDestructor",!1),A("releaseClassHandle",!1),A("finalizationRegistry",!1),A("detachFinalizer_deps",!1),A("detachFinalizer",!1),A("attachFinalizer",!1),A("makeClassHandle",!1),A("init_ClassHandle",!1),A("ClassHandle",!1),A("ClassHandle_isAliasOf",!1),A("throwInstanceAlreadyDeleted",!1),A("ClassHandle_clone",!1),A("ClassHandle_delete",!1),A("deletionQueue",!1),A("ClassHandle_isDeleted",!1),A("ClassHandle_deleteLater",!1),A("flushPendingDeletes",!1),A("delayFunction",!1),A("setDelayFunction",!1),A("RegisteredClass",!1),A("shallowCopyInternalPointer",!1),A("downcastPointer",!1),A("upcastPointer",!1),A("validateThis",!1),A("char_0",!1),A("char_9",!1),A("makeLegalFunctionName",!1),A("emval_handle_array",!1),A("emval_free_list",!1),A("emval_symbols",!1),A("init_emval",!1),A("count_emval_handles",!1),A("get_first_emval",!1),A("getStringOrSymbol",!1),A("Emval",!1),A("emval_newers",!1),A("craftEmvalAllocator",!1),A("emval_get_global",!1),A("emval_methodCallers",!1),A("emval_registeredMethods",!1),A("warnOnce",!1),A("stackSave",!1),A("stackRestore",!1),A("stackAlloc",!1),A("AsciiToString",!1),A("stringToAscii",!1),A("UTF16ToString",!1),A("stringToUTF16",!1),A("lengthBytesUTF16",!1),A("UTF32ToString",!1),A("stringToUTF32",!1),A("lengthBytesUTF32",!1),A("allocateUTF8",!1),A("allocateUTF8OnStack",!1),o.writeStackCookie=ye,o.checkStackCookie=be,P("ALLOC_NORMAL",!1),P("ALLOC_STACK",!1),Ne=function e(){Nd||vf(),Nd||(Ne=e)},o.run=vf,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var wf=!0;return o.noInitialRun&&(wf=!1),vf(),e.ready});const Ve=ze;var He=r(2934),$e=r(7984);const Ye=Ve,Xe=(e,t)=>null!=t?[t,e.split("/").pop()].join(""):new URL(e,window.location.origin);var Ke,Qe,Ze=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Je=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class et{constructor(e){Ke.set(this,void 0),Qe.set(this,void 0),Ze(this,Ke,e,"f"),Ze(this,Qe,new M(e),"f")}async loadFromString(e){return ue("sceneContent",e,ie()),new Promise((t=>{Je(this,Ke,"f").loadSceneFromString(e,(e=>{const r=O(e);t(r)}))}))}async loadFromURL(e){return ue("url",e,ie()),new Promise((t=>{Je(this,Ke,"f").loadSceneFromURL(e,(e=>{const r=O(e);t(r)}))}))}async saveToString(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Je(this,Ke,"f").saveSceneToString(r,(t=>{const r=O(t);e(r)}))}))}async saveToArchive(){return new Promise(((e,t)=>{const r=this.get();null==r?t(new Error("No scene available.")):Je(this,Ke,"f").saveSceneToArchive(r,(r=>{"error"in r?t(r.error):e(new Blob([r],{type:fe.Zip}))}))}))}create(){return O(Je(this,Ke,"f").createScene({layout:h.Free}))}createFromImage(e,t=300,r=1){return ue("url",e,ie()),ue("dpi",t,ae(oe(),0)),ue("pixelScaleFactor",r,ae(oe(),0)),new Promise((n=>{Je(this,Ke,"f").createSceneFromImage(e,t,r,h.Free,0,!1,(e=>{const t=O(e);n(t)}))}))}get(){const e=O(Je(this,Ke,"f").findByType(k.Scene)),t=he(e);return t.length>0?t[0]:null}async applyTemplateFromString(e){return ue("content",e,ie()),new Promise((t=>{Je(this,Ke,"f").applyTemplateFromString(e,(e=>{O(e),t()}))}))}async applyTemplateFromURL(e){return ue("url",e,ie()),new Promise((t=>{Je(this,Ke,"f").applyTemplateFromURL(e,(e=>{O(e),t()}))}))}unstable_setDesignUnit(e){ue("designUnit",e,ie()),O(Je(this,Ke,"f").unstable_setDesignUnit(A.fromDesignUnit(e)))}unstable_getDesignUnit(){return A.toDesignUnit(O(Je(this,Ke,"f").unstable_getDesignUnit()))}}function tt(e,t){var r,n;const o=null==e?void 0:e.getBoundingClientRect(),i=null!==(r=null==o?void 0:o.top)&&void 0!==r?r:0,a=null!==(n=null==o?void 0:o.left)&&void 0!==n?n:0,s=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(t),c=s?t.changedTouches[0].clientX:t.clientX,u=s?t.changedTouches[0].clientY:t.clientY;return{position:{x:(c-a)*window.devicePixelRatio,y:(u-i)*window.devicePixelRatio},isOverUIElement:!1,isTouch:s,timestamp:Date.now()}}Ke=new WeakMap,Qe=new WeakMap;var rt,nt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class ot{constructor(e){rt.set(this,void 0),function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,rt,e,"f")}findAll(){return he(nt(this,rt,"f").findAllVariables())}setString(e,t){return ue("key",e,ie()),ue("value",t,ie()),O(nt(this,rt,"f").setVariableString(e,t))}getString(e){return ue("key",e,ie()),O(nt(this,rt,"f").getVariableString(e))}remove(e){return ue("key",e,ie()),O(nt(this,rt,"f").removeVariable(e))}}rt=new WeakMap;var it,at,st,ct,ut,lt,dt,ft,mt,pt,ht=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},gt=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class vt{constructor(e,r,n){it.add(this),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scene",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"variable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_assetRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),at.set(this,void 0),st.set(this,void 0),ct.set(this,void 0),ut.set(this,(()=>{const e=this.block.findByType(k.Camera)[0];if(!e)return;if(void 0===gt(this,st,"f"))return;const{width:t,height:r}=gt(this,st,"f"),n=gt(this,at,"f").getValue(e,pe.Camera,"resolution");R(n.width,t,1e-4)&&R(n.height,r,1e-4)||gt(this,at,"f").setValue(e,pe.Camera,"resolution",{width:t,height:r}),"undefined"!=typeof window&&(R(gt(this,at,"f").getValue(e,pe.Camera,"pixelRatio"),window.devicePixelRatio,1e-4)||gt(this,at,"f").setValue(e,pe.Camera,"pixelRatio",window.devicePixelRatio))})),lt.set(this,void 0),dt.set(this,void 0),ht(this,ct,e,"f"),ht(this,at,new M(e),"f"),ht(this,st,r,"f"),this.block=new _e(e),this.scene=new et(e),this.variable=new ot(e),this.editor=new Ne(e),this.event=new Ge(e),this.unstable_assetRegistry=new class{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:"ly.img.AssetRegistry"}),Object.defineProperty(this,"assetSources",{enumerable:!0,configurable:!0,writable:!0,value:[]})}async getGroups(e){return(await Promise.all(this.assetSources.map((t=>t.getGroups(e))))).reduce(((e,t)=>(e.push(...t),e)),[])}getTypes(){return this.assetSources.reduce(((e,t)=>{const r=t.getTypes();return e.push(...r),e}),[])}hasType(e){return this.assetSources.some((t=>t.hasType(e)))}getSources(e){return e?this.assetSources.filter((t=>t.hasType(e))):this.assetSources}getSource(e){return this.assetSources.find((t=>t.id===e))}addSource(e){this.assetSources.push(e)}removeSource(e){const t=this.assetSources.findIndex((t=>t.id===e));return t>=0&&(this.assetSources.splice(t,1),!0)}},this.unstable_assetRegistry.addSource(new class{constructor(e,t,r={}){var n,o,i,a;B.add(this),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"canManageAssets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"helper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),U.set(this,void 0),N.set(this,void 0),j.set(this,void 0),q.set(this,void 0),this.id=e,this.helper=new M(t),this.canManageAssets=null!==(n=r.canManageAssets)&&void 0!==n&&n,z(this,U,null!==(o=r.hasType)&&void 0!==o?o:()=>!1,"f"),z(this,N,null!==(i=r.getLabel)&&void 0!==i?i:(e,t)=>t,"f"),z(this,j,null!==(a=r.getTags)&&void 0!==a?a:()=>[],"f"),z(this,q,r.defaultFont,"f")}getAsset(){throw new Error("Method not implemented.")}addAsset(){throw new Error("Method not implemented.")}updateAsset(){throw new Error("Method not implemented.")}removeAsset(){throw new Error("Method not implemented.")}getTypes(){throw new Error("Method not implemented")}async findAssets(e,t){const r=await this.getAssets(e,t),n=this.filterAssets(r,t),o=n.length,i=t.page,a=this.sliceAssets(n,t);return{assets:a,total:o,currentPage:i,nextPage:(t.page-1)*t.perPage+a.length<o?i+1:void 0}}getGroups(e){return this.helper.execute("ubq/assets/getRegisteredCategoryIDsForType",e)}hasType(e){return"ly.img.text"===e||"ly.img.video"===e||V(this,U,"f").call(this,e)}async getAssetIds(e,{groups:t,excludeGroups:r}){let n=[];if(t&&Array.isArray(t)&&t.length>0)n=await this.getAssetIdsForGroups(e,t,r);else{const t=await this.helper.execute("ubq/assets/getRegisteredAssetIDsForType",e),o=await this.getGroups(e);n=await(o.length>0?this.getAssetIdsForGroups(e,o,r,t):t)}return n}async getAssets(e,t){if("ly.img.text"===e)return async function(e,t,r,n=(e=>e)){return async function(e,t,r){var n,o;let i=[];const a=null!==(n=Object.values(await async function(){const e={},r=await t.execute("ubq/assets/getRegisteredAssetIDsForType","ly.img.font");return await Promise.all(r.map((async r=>{var n;const o=await t.execute("ubq/assets/getMetadata",[r,"fontFamily"]);(null!==(n=e[o])&&void 0!==n?n:e[o]=[]).push({assetId:r})}))),e}()).find((e=>(e.length>i.length&&(i=e),e.some((e=>e.assetId===r))))))&&void 0!==n?n:i,s=null!==(o=a.find((e=>e.assetId===r)))&&void 0!==o?o:a[0];if(void 0===s)return e;await async function(e){await Promise.all([...e.map((e=>t.execute("ubq/assets/getMetadata",[e.assetId,"fontWeight"]).then((t=>{e.fontWeight=t})))),...e.map((e=>t.execute("ubq/assets/getMetadata",[e.assetId,"fontStyle"]).then((t=>{e.fontStyle=t}))))])}(a);const c=a.filter((e=>e.fontStyle===s.fontStyle));if(0===c.length)return e;const u=await Promise.all(e.map((async e=>{var r,n,o;const i=null===(o=(Array.isArray(null===(r=e.meta)||void 0===r?void 0:r.fontWeight)?null===(n=e.meta)||void 0===n?void 0:n.fontWeight:[]).map((e=>c.find((t=>t.fontWeight===e)))).filter(Boolean)[0])||void 0===o?void 0:o.assetId,a=null!=i?i:null==s?void 0:s.assetId,u=await t.execute("ubq/assets/getMetadata",[a,"fontFileUri"]);return Object.assign(Object.assign({},e),{meta:Object.assign(Object.assign({},e.meta),{fontId:a,uri:u})})})));return u}([{id:"title",type:"ly.img.text",label:n("title"),thumbUri:"",size:{width:1,height:1},meta:{fontScale:2,fontWeight:[700,800,900,600,500]},context:t},{id:"headline",type:"ly.img.text",label:n("headline"),thumbUri:"",size:{width:1,height:1},meta:{fontScale:1.4,fontWeight:[500,600,700]},context:t},{id:"paragraph",type:"ly.img.text",label:n("paragraph"),thumbUri:"",size:{width:1,height:1},meta:{fontScale:1,fontWeight:[400,300,500]},context:t}],e,r)}(this.helper,{sourceId:this.id},V(this,q,"f"),(e=>V(this,N,"f").call(this,"ly.img.text",e)));if("ly.img.vectorpath"===e){let r=[];t.groups&&t.groups.includes("//ly.img.cesdk.vectorpaths/category/vectorpaths")&&(r=await async function(e,t=(e=>e)){return[k.RectShape,k.LineShape,k.StarShape,k.PolygonShape,k.EllipseShape].map((r=>({id:r,type:"ly.img.vectorpath",label:t(r),thumbUri:"",size:{width:1,height:1},context:e})))}({sourceId:this.id},(e=>V(this,N,"f").call(this,"ly.img.vectorpath",e))));const n=await this.getGenericAssets(e,t);return[...r,...n]}return this.getGenericAssets(e,t)}async getGenericAssets(e,t){const{groups:r,locale:n}=t,o=await this.getAssetIds(e,t);return await Promise.all(o.map((async t=>{const{thumbUri:o,size:i,meta:a}=await this.getAssetMetaData(t,e),s=V(this,N,"f").call(this,e,t),c=V(this,j,"f").call(this,e,t);return{id:t,type:e,groups:r,thumbUri:o,size:i,meta:a,locale:n,label:s,tags:c,context:{sourceId:this.id}}})))}async getAssetMetaData(e,t){const[r,n,o,i,a,s,c]=await Promise.all([V(this,B,"m",G).call(this,e,"thumbPath"),V(this,B,"m",G).call(this,e,"width"),V(this,B,"m",G).call(this,e,"height"),"ly.img.vectorpath"===t?V(this,B,"m",G).call(this,e,"vectorPath"):Promise.resolve(""),"ly.img.image"===t?V(this,B,"m",G).call(this,e,"imagePath"):Promise.resolve(void 0),"ly.img.video"===t?V(this,B,"m",G).call(this,e,"videoPath"):Promise.resolve(void 0),"ly.img.sticker"===t?V(this,B,"m",G).call(this,e,"imageUri"):Promise.resolve(void 0)]),u=O(this.helper.ubq.getAbsoluteURI(r));return i?{thumbUri:u,size:{width:n,height:o},meta:{vectorPath:i}}:{thumbUri:u,size:{width:n,height:o},meta:{uri:a||c||s}}}filterAssets(e,t){const{query:r}=t;if(!r)return e;const n=_()(r.toLowerCase());return r?e.filter((e=>{if(e.label||e.tags){const t=[e.label||"",e.tags||""].join(",").toLowerCase();return n.every((e=>t.match(e)))}if(e.id){const t=e.id.toLowerCase();return n.every((e=>t.match(e)))}return!0})):e}sliceAssets(e,{page:t,perPage:r}){const n=((null!=t?t:1)-1)*r;return e.slice(n,n+r)}async getAssetIdsForGroups(e,t,r=[],n=[]){const o={},i={},a=await Promise.all(t.map((async t=>{const n=await V(this,B,"m",W).call(this,t,e);return r.includes(t)?(n.forEach((e=>{i[e]=!0})),[]):n.filter((e=>!o[e]&&!i[e]&&(o[e]=!0,!0)))}))),s=n.filter((e=>!o[e]&&!i[e])),c=E()(...a,s);return y()(c).filter(Boolean)}}("local",e,{defaultFont:n.defaultFont})),function(e){const r={assets:[],total:0,currentPage:1,nextPage:void 0};return Object.entries(e).map((([e,n])=>{const o=n.types||["ly.img.image"];if(!n.findAssets)throw new Error("New asset source needs to define `findAssets` at least");return Object.assign(Object.assign(Object.assign({id:e},t),n),{findAssets:async(e,t)=>o.includes(e)&&await n.findAssets(e,t)||Promise.resolve(r),hasType:e=>o.includes(e)})}))}(n.assetSources).forEach((e=>this.unstable_assetRegistry.addSource(e))),gt(this,at,"f").useInternalAPI((e=>{e.setPreUpdateCallback(gt(this,ut,"f"))})),gt(this,it,"m",ft).call(this),"undefined"!=typeof window&&window.Cypress&&(this.config=n,this.helper=gt(this,at,"f"),this.onPostUpdate=e=>{gt(this,at,"f").useInternalAPI((t=>{t.setPostUpdateCallback(e)}))})}dispose(){gt(this,it,"m",mt).call(this),gt(this,at,"f").useInternalAPI((e=>{e.setPreUpdateCallback(null)})),ht(this,st,null,"f"),ht(this,at,null,"f"),this.block=null,this.scene=null,this.variable=null,gt(this,ct,"f").delete(),ht(this,ct,null,"f")}static async init(e,t){console.log("[CreativeEngine] Revision c43c1ae9dae03b27bdadafc66dad2978035b5eec"),"undefined"==typeof document||t||(t=document.createElement("canvas"));const r=Re(e);return new this(await function(e,t){const r=Re(t),{core:n}=r,o=null!==(s=null===(a=null==(i=r)?void 0:i.callbacks)||void 0===a?void 0:a.log)&&void 0!==s?s:Te;var i,a,s;return new Promise(((t,i)=>{let a,s;return Ye({locateFile:(e,t)=>{if(e.endsWith(".wasm")){const e=Xe(He,n.baseURL).toString();return a=e,e}if(e.endsWith(".data")){const e=Xe($e,n.baseURL).toString();return s=e,e}return t+e},print:e=>{e&&"undefined"!==e&&o(e,we.Info)},printErr:e=>{e&&"undefined"!==e&&o(e,we.Error)},onRuntimeInitialized:()=>{o("Engine has been initialized.",we.Info)},logReadFiles:!1,printWithColors:!0}).then((n=>{let o="";"string"==typeof e?o=e:void 0!==e&&(n.specialHTMLTargets["!canvas"]=e,o="!canvas");const a=n.createEngine(o);if(a.isValid()){const e=a.value();!function(e,t){var r;const n=new M(e);function o(e,t){return n.execute("ubq/settings/set",[e,t])}o("ubq://license",t.license||""),o("ubq://role",C[t.role]),o("ubq://basePath",t.baseURL),o("ubq://touchScrollingEnabled",!(null===(r=t.featureFlags)||void 0===r?void 0:r.preventScrolling)),Object.entries(t.presets.images||{}).forEach((([e,t])=>{n.execute("ubq/assets/registerImage",[e,t.thumbnailURL||t.imageURL,t.imageURL,t.width,t.height])})),Object.entries(t.presets.typefaces||{}).forEach((([e,t])=>{(t.fonts||[]).forEach((r=>{const o=`${e}_${r.weight}_${r.style}`;n.execute("ubq/assets/registerFont",[o,r.fontURL,t.family,r.weight,r.style])}))})),function(){const{imageMattingOnly:e,singlePageMode:r}=t.featureFlags||{};"undefined"!=typeof window&&("VideoFrame"in window&&"VideoDecoder"in window&&"VideoEncoder"in window||o("ubq://features/videosEnabled",!1)),o("ubq://features/singlePageModeEnabled",r),o("cesdk://trackActivePage",!r),o("ubq://features/effectsEnabled",!0)}(),o("ubq://page/title/fontFileUri",t.page.title.fontFileUri),o("ubq://page/title/show",t.page.title.show),o("ubq://page/dimOutOfPageAreas",t.page.dimOutOfPageAreas),function(){if(void 0!==t.scene.maskSpotColor){const{rgbApproximation:e}=t.scene.maskSpotColor,r=F.fromRGBA(Object.assign(Object.assign({},e),{a:1}));n.execute("cesdk/setSpecialSpotColor",r)}}(),function(){var e;const r=null!==(e=t.extensions)&&void 0!==e?e:[];r.entries.forEach((e=>{n.execute("ubq/extension/register",`${r.baseURL+e}`)}))}(),function(){var r;const n=null!==(r=t.variables)&&void 0!==r?r:{};Object.entries(n).forEach((([t,r])=>{O(e.setVariableString(t,r.value.toString()))}))}()}(e,r),t(e)}else{const e=a.error();i(new Error(e.publicMessage())),e.delete()}a.delete()})).catch((e=>{e instanceof Error&&(e.wasmPath=a,e.dataPath=s),i(e)}))}))}(t,r),t,r)}}at=new WeakMap,st=new WeakMap,ct=new WeakMap,ut=new WeakMap,lt=new WeakMap,dt=new WeakMap,it=new WeakSet,ft=function(e=!0){if(gt(this,lt,"f"))return;if("undefined"!=typeof HTMLCanvasElement&>(this,st,"f")instanceof HTMLCanvasElement){const e=function(e,t){const r=r=>{const n=tt(e,r);n.isTouch&&r.preventDefault(),t.execute("ubq/inputs/mousemove",n)},n=r=>{const n=Object.assign(Object.assign({},tt(e,r)),{button:x(r instanceof MouseEvent?r.button:c.Left),state:u.Up,shiftIsHeld:r.shiftKey});t.execute("ubq/inputs/mousebutton",n)},o=r=>{const n=Object.assign(Object.assign({},tt(e,r)),{button:x(r instanceof MouseEvent?r.button:c.Left),state:u.Down,shiftIsHeld:r.shiftKey});t.execute("ubq/inputs/mousebutton",n)};return e.addEventListener("mousemove",r),e.addEventListener("mousedown",o),e.addEventListener("mouseup",n),e.addEventListener("touchmove",r),e.addEventListener("touchstart",o),e.addEventListener("touchend",n),e.addEventListener("touchcancel",n),()=>{e.removeEventListener("mousemove",r),e.removeEventListener("mousedown",o),e.removeEventListener("mouseup",n),e.removeEventListener("touchmove",r),e.removeEventListener("touchstart",o),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n)}}(gt(this,st,"f"),gt(this,at,"f")),t=function(e,t){let r=null;const n=t.useInternalAPI((n=>n.addEventCallback("EditorStateUpdatedEvent",(async()=>{const{editMode:n}=await t.getEditorState();n!==D.Text||r?n!==D.Text&&r&&(r(),r=null):r=function(){var r;let n=!1;const o=document.createElement("textarea");return o.id="ubq_internal-inline_text_editing_html_representation",o.autocapitalize="none",o.spellcheck=!1,o.cols=4096,o.style.contain="strict",o.style.opacity="0",o.style.pointerEvents="none",o.style.zIndex="-1",o.style.position="absolute",o.style.width="1px",o.style.height="1px",o.style.padding="0",o.style.margin="-1px",o.style.overflow="hidden",o.style.clip="rect(0, 0, 0, 0)",o.style.whiteSpace="nowrap",o.style.border="0",o.addEventListener("input",a),o.addEventListener("keydown",s),o.addEventListener("copy",i),o.addEventListener("compositionstart",c),o.addEventListener("compositionupdate",u),o.addEventListener("compositionend",d),null===(r=null==e?void 0:e.parentElement)||void 0===r||r.appendChild(o),o.focus(),()=>{var t;o.removeEventListener("input",a),o.removeEventListener("keydown",s),o.removeEventListener("copy",i),o.removeEventListener("compositionstart",c),o.removeEventListener("compositionupdate",u),o.removeEventListener("compositionend",d),null===(t=null==e?void 0:e.parentElement)||void 0===t||t.removeChild(o)};function i(e){try{t.useInternalAPI((t=>{const r=O(t.getSelectedText());""!==r&&e.clipboardData&&(e.clipboardData.setData("text/plain",r),e.preventDefault())}))}catch(e){console.error(e)}}function a(e){var r,o;const i=e.target,{value:a}=i;let s=a.length;if(n){s=null!==(o=null!==(r=i.selectionEnd)&&void 0!==r?r:i.selectionStart)&&void 0!==o?o:0;const e=[...a];for(let t=0;t<e.length;t+=1)t<s&&(s-=e[t].length-1);t.execute("ubq/text/compositionUpdate",{value:a,cursorPosition:s})}else if(a.length>0){if("\n"!==a[0]){const e={key:l.Unknown,characters:a,shiftIsHeld:!1,commandIsHeld:!1,optionIsHeld:!1,timestamp:Date.now()};t.execute("ubq/inputs/keyboardkey",e)}i.value=""}}async function s(e){if("a"===e.key&&(e.metaKey||e.ctrlKey))return n&&(await t.execute("ubq/text/compositionEnd"),n=!1,e.currentTarget&&(o.value="")),void await t.execute("ubq/text/selectAllText");if("Escape"===e.key)return void async function(){const e=await t.getEditorState();t.setEditorState(Object.assign(Object.assign({},e),{editMode:D.Transform}))}();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:l.Unknown,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=l.Key0;break;case"1":t.key=l.Key1;break;case"2":t.key=l.Key2;break;case"3":t.key=l.Key3;break;case"4":t.key=l.Key4;break;case"5":t.key=l.Key5;break;case"6":t.key=l.Key6;break;case"7":t.key=l.Key7;break;case"8":t.key=l.Key8;break;case"9":t.key=l.Key9;break;case"A":t.key=l.A;break;case"B":t.key=l.B;break;case"C":t.key=l.C;break;case"D":t.key=l.D;break;case"E":t.key=l.E;break;case"F":t.key=l.F;break;case"G":t.key=l.G;break;case"H":t.key=l.H;break;case"I":t.key=l.I;break;case"J":t.key=l.J;break;case"K":t.key=l.K;break;case"L":t.key=l.L;break;case"M":t.key=l.M;break;case"N":t.key=l.N;break;case"O":t.key=l.O;break;case"P":t.key=l.P;break;case"Q":t.key=l.Q;break;case"R":t.key=l.R;break;case"S":t.key=l.S;break;case"T":t.key=l.T;break;case"U":t.key=l.U;break;case"V":t.key=l.V;break;case"W":t.key=l.W;break;case"X":t.key=l.X;break;case"Y":t.key=l.Y;break;case"Z":t.key=l.Z;break;case" ":t.key=l.Space;break;case"ESCAPE":t.key=l.Escape,t.characters="";break;case"BACKSPACE":t.key=l.Backspace,t.characters="";break;case"DELETE":t.key=l.Delete,t.characters="";break;case"ENTER":t.key=l.Enter,t.characters="\n";break;case"CONTROL":t.key=l.Control,t.characters="";break;case"ALT":t.key=l.Option,t.characters="";break;case"SHIFT":t.key=l.Shift,t.characters="";break;case"ARROWLEFT":t.key=l.ArrowLeft,t.characters="";break;case"ARROWRIGHT":t.key=l.ArrowRight,t.characters="";break;case"ARROWUP":t.key=l.ArrowUp,t.characters="";break;case"ARROWDOWN":t.key=l.ArrowDown,t.characters="";break;case"DEAD":t.key=l.Unknown,t.characters=""}return t}(e);await t.execute("ubq/inputs/keyboardkey",r),e.currentTarget&&(o.value="")}async function c(){n=!0,await t.execute("ubq/text/compositionStart")}function u(){n=!0}async function d(){n=!1,await t.execute("ubq/text/compositionEnd"),o.value=""}}()}))));return()=>{null==r||r(),n.dispose(),n.delete()}}(gt(this,st,"f"),gt(this,at,"f"));ht(this,dt,(()=>{e(),t()}),"f")}const t=()=>{gt(this,it,"m",pt).call(this,e),ht(this,lt,requestAnimationFrame(t),"f")};ht(this,lt,requestAnimationFrame(t),"f")},mt=function(){var e;null===(e=gt(this,dt,"f"))||void 0===e||e.call(this),ht(this,dt,void 0,"f"),gt(this,lt,"f")&&(cancelAnimationFrame(gt(this,lt,"f")),ht(this,lt,0,"f"))},pt=function(e=!0){e&&void 0!==gt(this,st,"f")&&1===this.block.findByType(k.Scene).length&>(this,at,"f").execute("ubq/render",{displayWidth:gt(this,st,"f").width,displayHeight:gt(this,st,"f").height}),gt(this,ct,"f").update()}})();var o=n.Il,i=n.yQ,a=n.Ju,s=n.in,c=n.HY,u=n.uU,l=n.ZP;export{o as Color,i as ConfigTypes,a as DesignBlockType,s as LogLevel,c as MimeType,u as Role,l as default};
|