UNPKG

trtc-sdk-v5

Version:
1 lines 721 kB
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__require=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')})),__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__publicField=(e,t,r)=>__defNormalProp(e,"symbol"!=typeof t?t+"":t,r);async function authEffect({sdkAppId:e,userId:t,userSig:r,core:n}){var o;const i=Math.round((new Date).getTime()/1e3);try{const a=await n.schedule.getAbilityConfig(e,n.schedule.ScheduleRequestType.TRTC_AUTO_CONF,{sdkAppId:e,userId:t,userSig:r,timestamp:i});n.log.info(`virtual background ability response: ${JSON.stringify(a)}`);const{data:s}=a;return(null==(o=null==s?void 0:s.trtcAutoConf)?void 0:o.web_ar)?{auth:!0,timestamp:i}:{auth:!1}}catch(e){return n.log.error("virtual background fetch error",e),{auth:!1}}}var UserRule={sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"}};function startValidateRule(e){return{name:"VirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:__spreadProps(__spreadValues({},UserRule),{type:{required:!1,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},blurLevel:{required:!1,type:"number",min:1,max:10},onAbort:{required:!1}}),validate(t,r,n,o){var i;const{RtcError:a,ErrorCode:s,ErrorCodeDictionary:c}=e.errorModule;if(!t)return;const{type:A,src:u,onAbort:l}=t;if("image"===A&&!u)throw new a({code:s.INVALID_PARAMETER,extraCode:c.INVALID_PARAMETER_REQUIRED,fnName:n,messageParams:{key:"src"}});if(l&&!e.utils.isFunction(l))throw new a({code:s.INVALID_PARAMETER,extraCode:c.INVALID_PARAMETER_TYPE,fnName:n,messageParams:{key:"onAbort",value:typeof l,rule:{type:"Function"}}});if(!(null==(i=e.room.videoManager.cameraTrack)?void 0:i.mediaTrack))throw new a({code:s.INVALID_OPERATION,extraCode:c.INVALID_OPERATION_NEED_VIDEO,fnName:n})}}}function updateValidateRule(e){return{name:"UpdateVirtualBackgroundOptions",type:"object",required:!0,allowEmpty:!1,properties:{type:{required:!0,type:"string",values:["image","blur"]},src:{required:!1,type:"string"},blurLevel:{required:!1,type:"number",min:1,max:10}},validate(t,r,n,o){if(!t)return;const{RtcError:i,ErrorCode:a,ErrorCodeDictionary:s}=e.errorModule,{type:c,src:A}=t;if("image"===c&&!A)throw new i({code:a.INVALID_PARAMETER,extraCode:s.INVALID_PARAMETER_REQUIRED,fnName:n,messageParams:{key:"src"}})}}}function stopValidateRule(e){return{name:"StopVirtualBackgroundOptions",required:!1}}var createMediapipeSolutionsWasm=function(){let e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(t){const r=void 0!==(t=t||{})?t:{};let n,o;r.ready=new Promise(((e,t)=>{n=e,o=t})),Object.getOwnPropertyDescriptor(r.ready,"_main")||(Object.defineProperty(r.ready,"_main",{configurable:!0,get(){_e("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(r.ready,"_main",{configurable:!0,set(){_e("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(r.ready,"_emscripten_stack_get_end")||(Object.defineProperty(r.ready,"_emscripten_stack_get_end",{configurable:!0,get(){_e("You are getting _emscripten_stack_get_end 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(r.ready,"_emscripten_stack_get_end",{configurable:!0,set(){_e("You are setting _emscripten_stack_get_end 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(r.ready,"_emscripten_stack_get_free")||(Object.defineProperty(r.ready,"_emscripten_stack_get_free",{configurable:!0,get(){_e("You are getting _emscripten_stack_get_free 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(r.ready,"_emscripten_stack_get_free",{configurable:!0,set(){_e("You are setting _emscripten_stack_get_free 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(r.ready,"_emscripten_stack_init")||(Object.defineProperty(r.ready,"_emscripten_stack_init",{configurable:!0,get(){_e("You are getting _emscripten_stack_init 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(r.ready,"_emscripten_stack_init",{configurable:!0,set(){_e("You are setting _emscripten_stack_init 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(r.ready,"_stackSave")||(Object.defineProperty(r.ready,"_stackSave",{configurable:!0,get(){_e("You are getting _stackSave 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(r.ready,"_stackSave",{configurable:!0,set(){_e("You are setting _stackSave 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(r.ready,"_stackRestore")||(Object.defineProperty(r.ready,"_stackRestore",{configurable:!0,get(){_e("You are getting _stackRestore 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(r.ready,"_stackRestore",{configurable:!0,set(){_e("You are setting _stackRestore 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(r.ready,"_stackAlloc")||(Object.defineProperty(r.ready,"_stackAlloc",{configurable:!0,get(){_e("You are getting _stackAlloc 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(r.ready,"_stackAlloc",{configurable:!0,set(){_e("You are setting _stackAlloc 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(r.ready,"___wasm_call_ctors")||(Object.defineProperty(r.ready,"___wasm_call_ctors",{configurable:!0,get(){_e("You are getting ___wasm_call_ctors 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(r.ready,"___wasm_call_ctors",{configurable:!0,set(){_e("You are setting ___wasm_call_ctors 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(r.ready,"_fflush")||(Object.defineProperty(r.ready,"_fflush",{configurable:!0,get(){_e("You are getting _fflush 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(r.ready,"_fflush",{configurable:!0,set(){_e("You are setting _fflush 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(r.ready,"___errno_location")||(Object.defineProperty(r.ready,"___errno_location",{configurable:!0,get(){_e("You are getting ___errno_location 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(r.ready,"___errno_location",{configurable:!0,set(){_e("You are setting ___errno_location 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(r.ready,"_malloc")||(Object.defineProperty(r.ready,"_malloc",{configurable:!0,get(){_e("You are getting _malloc 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(r.ready,"_malloc",{configurable:!0,set(){_e("You are setting _malloc 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(r.ready,"_free")||(Object.defineProperty(r.ready,"_free",{configurable:!0,get(){_e("You are getting _free 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(r.ready,"_free",{configurable:!0,set(){_e("You are setting _free 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(r.ready,"_setThrew")||(Object.defineProperty(r.ready,"_setThrew",{configurable:!0,get(){_e("You are getting _setThrew 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(r.ready,"_setThrew",{configurable:!0,set(){_e("You are setting _setThrew 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(r.ready,"___cxa_is_pointer_type")||(Object.defineProperty(r.ready,"___cxa_is_pointer_type",{configurable:!0,get(){_e("You are getting ___cxa_is_pointer_type 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(r.ready,"___cxa_is_pointer_type",{configurable:!0,set(){_e("You are setting ___cxa_is_pointer_type 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(r.ready,"___cxa_can_catch")||(Object.defineProperty(r.ready,"___cxa_can_catch",{configurable:!0,get(){_e("You are getting ___cxa_can_catch 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(r.ready,"___cxa_can_catch",{configurable:!0,set(){_e("You are setting ___cxa_can_catch 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(r.ready,"_saveSetjmp")||(Object.defineProperty(r.ready,"_saveSetjmp",{configurable:!0,get(){_e("You are getting _saveSetjmp 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(r.ready,"_saveSetjmp",{configurable:!0,set(){_e("You are setting _saveSetjmp 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(r.ready,"_memalign")||(Object.defineProperty(r.ready,"_memalign",{configurable:!0,get(){_e("You are getting _memalign 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(r.ready,"_memalign",{configurable:!0,set(){_e("You are setting _memalign 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(r.ready,"_emscripten_main_thread_process_queued_calls")||(Object.defineProperty(r.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,get(){_e("You are getting _emscripten_main_thread_process_queued_calls 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(r.ready,"_emscripten_main_thread_process_queued_calls",{configurable:!0,set(){_e("You are setting _emscripten_main_thread_process_queued_calls 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(r.ready,"_emscripten_webgl_make_context_current")||(Object.defineProperty(r.ready,"_emscripten_webgl_make_context_current",{configurable:!0,get(){_e("You are getting _emscripten_webgl_make_context_current 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(r.ready,"_emscripten_webgl_make_context_current",{configurable:!0,set(){_e("You are setting _emscripten_webgl_make_context_current 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(r.ready,"_emscripten_webgl_get_current_context")||(Object.defineProperty(r.ready,"_emscripten_webgl_get_current_context",{configurable:!0,get(){_e("You are getting _emscripten_webgl_get_current_context 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(r.ready,"_emscripten_webgl_get_current_context",{configurable:!0,set(){_e("You are setting _emscripten_webgl_get_current_context 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(r.ready,"__get_tzname")||(Object.defineProperty(r.ready,"__get_tzname",{configurable:!0,get(){_e("You are getting __get_tzname 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(r.ready,"__get_tzname",{configurable:!0,set(){_e("You are setting __get_tzname 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(r.ready,"__get_daylight")||(Object.defineProperty(r.ready,"__get_daylight",{configurable:!0,get(){_e("You are getting __get_daylight 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(r.ready,"__get_daylight",{configurable:!0,set(){_e("You are setting __get_daylight 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(r.ready,"__get_timezone")||(Object.defineProperty(r.ready,"__get_timezone",{configurable:!0,get(){_e("You are getting __get_timezone 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(r.ready,"__get_timezone",{configurable:!0,set(){_e("You are setting __get_timezone 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(r.ready,"_emscripten_builtin_malloc")||(Object.defineProperty(r.ready,"_emscripten_builtin_malloc",{configurable:!0,get(){_e("You are getting _emscripten_builtin_malloc 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(r.ready,"_emscripten_builtin_malloc",{configurable:!0,set(){_e("You are setting _emscripten_builtin_malloc 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(r.ready,"_emscripten_builtin_free")||(Object.defineProperty(r.ready,"_emscripten_builtin_free",{configurable:!0,get(){_e("You are getting _emscripten_builtin_free 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(r.ready,"_emscripten_builtin_free",{configurable:!0,set(){_e("You are setting _emscripten_builtin_free 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(r.ready,"_emscripten_builtin_memalign")||(Object.defineProperty(r.ready,"_emscripten_builtin_memalign",{configurable:!0,get(){_e("You are getting _emscripten_builtin_memalign 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(r.ready,"_emscripten_builtin_memalign",{configurable:!0,set(){_e("You are setting _emscripten_builtin_memalign 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(r.ready,"___getTypeName")||(Object.defineProperty(r.ready,"___getTypeName",{configurable:!0,get(){_e("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(r.ready,"___getTypeName",{configurable:!0,set(){_e("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(r.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(r.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get(){_e("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(r.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set(){_e("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(r.ready,"onRuntimeInitialized")||(Object.defineProperty(r.ready,"onRuntimeInitialized",{configurable:!0,get(){_e("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(r.ready,"onRuntimeInitialized",{configurable:!0,set(){_e("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")}}));let i,a={};for(i in r)r.hasOwnProperty(i)&&(a[i]=r[i]);let s=[],c="./this.program",A=function(e,t){throw t};const u="object"==typeof window,l="function"==typeof importScripts,d="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,g=!u&&!d&&!l;if(r.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)");let f,h,p,E,m="";if(!u&&!l)throw new Error("environment detection error");if(l?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=0!==m.indexOf("blob:")?m.substr(0,m.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?)");f=function(e){const t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},l&&(p=function(e){const t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=function(e,t,r){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)},E=function(e){document.title=e};let I=r.print||console.log.bind(console),y=r.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(r[i]=a[i]);function _(e){_.shown||(_.shown={}),_.shown[e]||(_.shown[e]=1,y(e))}a=null,r.arguments&&(s=r.arguments),Object.getOwnPropertyDescriptor(r,"arguments")||Object.defineProperty(r,"arguments",{configurable:!0,get(){_e("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)")}}),r.thisProgram&&(c=r.thisProgram),Object.getOwnPropertyDescriptor(r,"thisProgram")||Object.defineProperty(r,"thisProgram",{configurable:!0,get(){_e("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)")}}),r.quit&&(A=r.quit),Object.getOwnPropertyDescriptor(r,"quit")||Object.defineProperty(r,"quit",{configurable:!0,get(){_e("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)")}}),v(void 0===r.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),v(void 0===r.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),v(void 0===r.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),v(void 0===r.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),v(void 0===r.read,"Module.read option was removed (modify read_ in JS)"),v(void 0===r.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),v(void 0===r.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),v(void 0===r.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),v(void 0===r.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(r,"read")||Object.defineProperty(r,"read",{configurable:!0,get(){_e("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(r,"readAsync")||Object.defineProperty(r,"readAsync",{configurable:!0,get(){_e("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(r,"readBinary")||Object.defineProperty(r,"readBinary",{configurable:!0,get(){_e("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(r,"setWindowTitle")||Object.defineProperty(r,"setWindowTitle",{configurable:!0,get(){_e("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)")}}),v(!g,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");let w=0;const C=function(e){w=e};let b;r.wasmBinary&&(b=r.wasmBinary),Object.getOwnPropertyDescriptor(r,"wasmBinary")||Object.defineProperty(r,"wasmBinary",{configurable:!0,get(){_e("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)")}});const B=r.noExitRuntime||!0;let D;Object.getOwnPropertyDescriptor(r,"noExitRuntime")||Object.defineProperty(r,"noExitRuntime",{configurable:!0,get(){_e("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&&_e("no native wasm support detected");let O,T=!1;function v(e,t){e||_e(`Assertion failed: ${t}`)}const Q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(e,t,r){const n=t+r;let o=t;for(;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&Q)return Q.decode(e.subarray(t,o));let i="";for(;t<o;){let r=e[t++];if(!(128&r)){i+=String.fromCharCode(r);continue}const n=63&e[t++];if(192==(224&r)){i+=String.fromCharCode((31&r)<<6|n);continue}const o=63&e[t++];if(224==(240&r)?r=(15&r)<<12|n<<6|o:(240!=(248&r)&&_(`Invalid UTF-8 leading byte 0x${r.toString(16)} encountered when deserializing a UTF-8 string in wasm memory to a JS string!`),r=(7&r)<<18|n<<12|o<<6|63&e[t++]),r<65536)i+=String.fromCharCode(r);else{const e=r-65536;i+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return i}function M(e,t){return e?P(z,e,t):""}function R(e,t,r,n){if(!(n>0))return 0;const o=r,i=r+n-1;for(let n=0;n<e.length;++n){let o=e.charCodeAt(n);if(o>=55296&&o<=57343){o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n)}if(o<=127){if(r>=i)break;t[r++]=o}else if(o<=2047){if(r+1>=i)break;t[r++]=192|o>>6,t[r++]=128|63&o}else if(o<=65535){if(r+2>=i)break;t[r++]=224|o>>12,t[r++]=128|o>>6&63,t[r++]=128|63&o}else{if(r+3>=i)break;o>=2097152&&_(`Invalid Unicode code point 0x${o.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-0x1FFFFF).`),t[r++]=240|o>>18,t[r++]=128|o>>12&63,t[r++]=128|o>>6&63,t[r++]=128|63&o}}return t[r]=0,r-o}function S(e,t,r){return v("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),R(e,z,t,r)}function F(e){let t=0;for(let r=0;r<e.length;++r){let 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}const x="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function k(e,t){v(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");let r=e,n=r>>1;const o=n+t/2;for(;!(n>=o)&&K[n];)++n;if(r=n<<1,r-e>32&&x)return x.decode(z.subarray(e,r));let i="";for(let r=0;!(r>=t/2);++r){const t=$[e+2*r>>1];if(0==t)break;i+=String.fromCharCode(t)}return i}function N(e,t,r){if(v(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),v("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;const n=t,o=(r-=2)<2*e.length?r/2:e.length;for(let r=0;r<o;++r){const n=e.charCodeAt(r);$[t>>1]=n,t+=2}return $[t>>1]=0,t-n}function U(e){return 2*e.length}function j(e,t){v(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");let r=0,n="";for(;!(r>=t/4);){const t=Z[e+4*r>>2];if(0==t)break;if(++r,t>=65536){const e=t-65536;n+=String.fromCharCode(55296|e>>10,56320|1023&e)}else n+=String.fromCharCode(t)}return n}function L(e,t,r){if(v(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),v("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;const n=t,o=n+r-4;for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);if(n>=55296&&n<=57343){n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)}if(Z[t>>2]=n,(t+=4)+4>o)break}return Z[t>>2]=0,t-n}function H(e){let t=0;for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}function G(e){const t=F(e)+1,r=un(t);return r&&R(e,V,r,t),r}function Y(e,t){v(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),V.set(e,t)}function X(e,t){return e%t>0&&(e+=t-e%t),e}let W,V,z,$,K,Z,J,q,ee;function te(e){W=e,r.HEAP8=V=new Int8Array(e),r.HEAP16=$=new Int16Array(e),r.HEAP32=Z=new Int32Array(e),r.HEAPU8=z=new Uint8Array(e),r.HEAPU16=K=new Uint16Array(e),r.HEAPU32=J=new Uint32Array(e),r.HEAPF32=q=new Float32Array(e),r.HEAPF64=ee=new Float64Array(e)}const re=5242880;r.TOTAL_STACK&&v(re===r.TOTAL_STACK,"the stack size can no longer be determined at runtime");const ne=r.INITIAL_MEMORY||16777216;let oe;function ie(){const e=gn();v(!(3&e)),J[1+(e>>2)]=34821223,J[2+(e>>2)]=2310721022,Z[0]=1668509029}function ae(){if(T)return;const e=gn(),t=J[1+(e>>2)],r=J[2+(e>>2)];34821223==t&&2310721022==r||_e(`Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x${r.toString(16)} ${t.toString(16)}`),1668509029!==Z[0]&&_e("Runtime error: The application has corrupted its heap memory area (address zero)!")}Object.getOwnPropertyDescriptor(r,"INITIAL_MEMORY")||Object.defineProperty(r,"INITIAL_MEMORY",{configurable:!0,get(){_e("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)")}}),v(ne>=re,`INITIAL_MEMORY should be larger than TOTAL_STACK, was ${ne}! (TOTAL_STACK=5242880)`),v("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),v(!r.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),v(16777216==ne,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){const 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)"}();const se=[],ce=[],Ae=[],ue=[];let le=!1,de=!1;function ge(){return B||!1}v(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),v(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),v(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),v(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");let fe=0,he=null,pe=null;const Ee={};function me(e){const t=e;for(;;){if(!Ee[e])return e;e=t+Math.random()}}function Ie(e){fe++,r.monitorRunDependencies&&r.monitorRunDependencies(fe),e?(v(!Ee[e]),Ee[e]=1,null===he&&"undefined"!=typeof setInterval&&(he=setInterval((()=>{if(T)return clearInterval(he),void(he=null);let e=!1;for(const t in Ee)e||(e=!0,y("still waiting on run dependencies:")),y(`dependency: ${t}`);e&&y("(end of list)")}),1e4))):y("warning: run dependency added without ID")}function ye(e){if(fe--,r.monitorRunDependencies&&r.monitorRunDependencies(fe),e?(v(Ee[e]),delete Ee[e]):y("warning: run dependency removed without ID"),0==fe&&(null!==he&&(clearInterval(he),he=null),pe)){const e=pe;pe=null,e()}}function _e(e){r.onAbort&&r.onAbort(e),y(e+=""),T=!0,O=1;const t=`abort(${e}) at ${function(){let e=function(){let e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}();r.extraStackTrace&&(e+=`\n${r.extraStackTrace()}`);return xe(e)}()}`;e=t;const n=new WebAssembly.RuntimeError(e);throw o(n),n}r.preloadedImages={},r.preloadedAudios={};function we(e,t){return function(){const n=e;let o=t;return t||(o=r.asm),v(le,`native function \`${n}\` called before runtime initialization`),v(!de,`native function \`${n}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`),o[e]||v(o[e],`exported native function \`${n}\` not found`),o[e].apply(null,arguments)}}let Ce;var be;let Be,De;Ce="selfie_segmentation_solution_simd_wasm_bin.wasm",Ce.startsWith("data:application/octet-stream;base64,")||(be=Ce,Ce=r.locateFile?r.locateFile(be,m):m+be);const Oe={460656(){let e=!0;if(e){const t=Qr;if("function"!=typeof t)return void("undefined"!=typeof console&&console.error('Expected Emscripten global function "findCanvasEventTarget" not found. WebGL context creation may fail.'));Qr=function(e){if(0==e){if(r&&r.canvas)return r.canvas;if(r&&r.canvasCssSelector)return t(r.canvasCssSelector);"undefined"!=typeof console&&console.warn("Module properties canvas and canvasCssSelector not found during WebGL context creation.")}return t(e)},e=!1}},461441:()=>"undefined"!=typeof wasmOffsetConverter};function Te(e,t){if(Se.mainLoop.timingMode=e,Se.mainLoop.timingValue=t,!Se.mainLoop.func)return y("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(Se.mainLoop.running||(Se.mainLoop.running=!0),0==e)Se.mainLoop.scheduler=function(){const e=0|Math.max(0,Se.mainLoop.tickStartTime+t-ve());setTimeout(Se.mainLoop.runner,e)},Se.mainLoop.method="timeout";else if(1==e)Se.mainLoop.scheduler=function(){Se.requestAnimationFrame(Se.mainLoop.runner)},Se.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){const e=[],t="setimmediate";addEventListener("message",(function(r){r.data!==t&&r.data.target!==t||(r.stopPropagation(),e.shift()())}),!0),setImmediate=function(n){e.push(n),l?(void 0===r.setImmediates&&(r.setImmediates=[]),r.setImmediates.push(n),postMessage({target:t})):postMessage(t,"*")}}Se.mainLoop.scheduler=function(){setImmediate(Se.mainLoop.runner)},Se.mainLoop.method="immediate"}return 0}let ve;function Qe(e){!function(e,t){if(O=e,function(){const e=I,t=y;let n=!1;I=y=function(e){n=!0};try{const e=r._fflush;e&&e(0),["stdout","stderr"].forEach((e=>{const t=Ze.analyzePath(`/dev/${e}`);if(!t)return;const r=t.object,{rdev:o}=r,i=We.ttys[o];i&&i.output&&i.output.length&&(n=!0)}))}catch(e){}I=e,y=t,n&&_("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.")}(),ge()){if(!t){const t=`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)`;o(t),y(t)}}else ae(),de=!0;On(e)}(e)}function Pe(e,t,n,o,i){v(!Se.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."),Se.mainLoop.func=e,Se.mainLoop.arg=o;const a=Se.mainLoop.currentlyRunningMainloop;function s(){return!(a<Se.mainLoop.currentlyRunningMainloop)||(function(){if(!ge())try{Qe(O)}catch(e){if(e instanceof Bn)return;throw e}}(),!1)}if(Se.mainLoop.running=!1,Se.mainLoop.runner=function(){if(!T)if(Se.mainLoop.queue.length>0){const e=Date.now(),t=Se.mainLoop.queue.shift();if(t.func(t.arg),Se.mainLoop.remainingBlockers){const e=Se.mainLoop.remainingBlockers;let r=e%1==0?e-1:Math.floor(e);t.counted?Se.mainLoop.remainingBlockers=r:(r+=.5,Se.mainLoop.remainingBlockers=(8*e+r)/9)}if(I(`main loop blocker "${t.name}" took ${Date.now()-e} ms`),Se.mainLoop.updateStatus(),!s())return;setTimeout(Se.mainLoop.runner,0)}else s()&&(Se.mainLoop.currentFrameNumber=Se.mainLoop.currentFrameNumber+1|0,1==Se.mainLoop.timingMode&&Se.mainLoop.timingValue>1&&Se.mainLoop.currentFrameNumber%Se.mainLoop.timingValue!=0?Se.mainLoop.scheduler():(0==Se.mainLoop.timingMode&&(Se.mainLoop.tickStartTime=ve()),Dr.newRenderingFrameStarted(),void 0!==Dr&&Dr.currentContext&&!Dr.currentContextIsProxied&&!Dr.currentContext.attributes.explicitSwapControl&&Dr.currentContext.GLctx.commit&&Dr.currentContext.GLctx.commit(),"timeout"===Se.mainLoop.method&&r.ctx&&(_("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!"),Se.mainLoop.method=""),Se.mainLoop.runIter(e),ae(),s()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Se.mainLoop.scheduler())))},i||(t&&t>0?Te(0,1e3/t):Te(1,1),Se.mainLoop.scheduler()),n)throw"unwind"}function Me(e,t){if(T)y("user callback triggered after application aborted. Ignoring.");else if(t)e();else try{e()}catch(e){if(e instanceof Bn)return;if("unwind"!==e)throw e&&"object"==typeof e&&e.stack&&y(`exception thrown: ${[e,e.stack]}`),e}}function Re(e,t){return setTimeout((()=>{Me(e)}),t)}ve=d?function(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Se={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){Se.mainLoop.scheduler=null,Se.mainLoop.currentlyRunningMainloop++},resume(){Se.mainLoop.currentlyRunningMainloop++;const{timingMode:e}=Se.mainLoop,{timingValue:t}=Se.mainLoop,{func:r}=Se.mainLoop;Se.mainLoop.func=null,Pe(r,0,!1,Se.mainLoop.arg,!0),Te(e,t),Se.mainLoop.scheduler()},updateStatus(){if(r.setStatus){const e=r.statusMessage||"Please wait...",t=Se.mainLoop.remainingBlockers,n=Se.mainLoop.expectedBlockers;t?t<n?r.setStatus(`${e} (${n-t}/${n})`):r.setStatus(e):r.setStatus("")}},runIter(e){if(!T){if(r.preMainLoop){if(!1===r.preMainLoop())return}Me(e),r.postMainLoop&&r.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init(){if(r.preloadPlugins||(r.preloadPlugins=[]),Se.initted)return;Se.initted=!0;try{new Blob,Se.hasBlobConstructor=!0}catch(e){Se.hasBlobConstructor=!1,I("warning: no blob constructor, cannot create blobs with mimetypes")}Se.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Se.hasBlobConstructor?null:I("warning: no BlobBuilder"),Se.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,r.noImageDecoding||void 0!==Se.URLObject||(I("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),r.noImageDecoding=!0);const e={canHandle:function(e){return!r.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,n,o){let i=null;if(Se.hasBlobConstructor)try{i=new Blob([e],{type:Se.getMimetype(t)}),i.size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Se.getMimetype(t)}))}catch(e){_(`Blob constructor present but fails: ${e}; falling back to blob builder`)}if(!i){const t=new Se.BlobBuilder;t.append(new Uint8Array(e).buffer),i=t.getBlob()}const a=Se.URLObject.createObjectURL(i);v("string"==typeof a,"createObjectURL must return a url as a string");const s=new Image;s.onload=function(){v(s.complete,`Image ${t} could not be decoded`);const o=document.createElement("canvas");o.width=s.width,o.height=s.height;o.getContext("2d").drawImage(s,0,0),r.preloadedImages[t]=o,Se.URLObject.revokeObjectURL(a),n&&n(e)},s.onerror=function(e){I(`Image ${a} could not be decoded`),o&&o()},s.src=a}};r.preloadPlugins.push(e);const t={};t.canHandle=function(e){return!r.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},t.handle=function(e,t,n,o){let i=!1;function a(o){i||(i=!0,r.preloadedAudios[t]=o,n&&n(e))}function s(){i||(i=!0,r.preloadedAudios[t]=new Audio,o&&o())}if(!Se.hasBlobConstructor)return s();{try{var c=new Blob([e],{type:Se.getMimetype(t)})}catch(e){return s()}const r=Se.URLObject.createObjectURL(c);v("string"==typeof r,"createObjectURL must return a url as a string");const n=new Audio;n.addEventListener("canplaythrough",(()=>{a(n)}),!1),n.onerror=function(r){i||(I(`warning: browser could not fully decode audio ${t}, trying slower base64 approach`),n.src=`data:audio/x-${t.substr(-3)};base64,${function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let r="",n=0,o=0;for(let i=0;i<e.length;i++)for(n=n<<8|e[i],o+=8;o>=6;){const e=n>>o-6&63;o-=6,r+=t[e]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e)}`,a(n))},n.src=r,Re((()=>{a(n)}),1e4)}},r.preloadPlugins.push(t);const{canvas:n}=r},createContext(e,t,n,o){if(t&&r.ctx&&e==r.canvas)return r.ctx;let i,a;if(t){const t={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(o)for(const e in o)t[e]=o[e];void 0!==Dr&&(a=Dr.createContext(e,t),a&&(i=Dr.getContext(a).GLctx))}else i=e.getContext("2d");return i?(n&&(t||v(void 0===rn,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),r.ctx=i,t&&Dr.makeContextCurrent(a),r.useWebGL=t,Se.moduleContextCreatedCallbacks.forEach((e=>{e()})),Se.init()),i):null},destroyContext(e,t,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,t){Se.lockPointer=e,Se.resizeCanvas=t,void 0===Se.lockPointer&&(Se.lockPointer=!0),void 0===Se.resizeCanvas&&(Se.resizeCanvas=!1);const{canvas:n}=r;Se.fullscreenHandlersInstalled||(Se.fullscreenHandlersInstalled=!0);const o=document.createElement("div");n.parentNode.insertBefore(o,n),o.appendChild(n),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?function(){o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),o.requestFullscreen()},requestFullScreen(){_e("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")},exitFullscreen(){if(!Se.isFullscreen)return!1;return(document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){}).apply(document,[]),!0},nextRAF:0,fakeRequestAnimationFrame(e){const t=Date.now();if(0===Se.nextRAF)Se.nextRAF=t+1e3/60;else for(;t+2>=Se.nextRAF;)Se.nextRAF+=1e3/60;const r=Math.max(Se.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame(e){if("function"==typeof requestAnimationFrame)return void requestAnimationFrame(e);(0,Se.fakeRequestAnimationFrame)(e)},safeSetTimeout:e=>Re(e),safeRequestAnimationFrame:e=>Se.requestAnimationFrame((()=>{Me(e)})),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){let 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(e){if(Se.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Se.mouseMovementX=Se.mouseMovementY=0:(Se.mouseMovementX=Se.getMovementX(e),Se.mouseMovementY=Se.getMovementY(e)),"undefined"!=typeof SDL?(Se.mouseX=SDL.mouseX+Se.mouseMovementX,Se.mouseY=SDL.mouseY+Se.mouseMovementY):(Se.mouseX+=Se.mouseMovementX,Se.mouseY+=Se.mouseMovementY);else{const t=r.canvas.getBoundingClientRect(),n=r.canvas.width,o=r.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(v(void 0!==i&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){const{touch:r}=e;if(void 0===r)return;let s=r.pageX-(i+t.left),c=r.pageY-(a+t.top);s*=n/t.width,c*=o/t.height;const A={x:s,y:c};if("touchstart"===e.type)Se.lastTouches[r.identifier]=A,Se.touches[r.identifier]=A;else if("touchend"===e.type||"touchmove"===e.type){let e=Se.touches[r.identifier];e||(e=A),Se.lastTouches[r.identifier]=e,Se.touches[r.identifier]=A}return}let s=e.pageX-(i+t.left),c=e.pageY-(a+t.top);s*=n/t.width,c*=o/t.height,Se.mouseMovementX=s-Se.mouseX,Se.mouseMovementY=c-Se.mouseY,Se.mouseX=s,Se.mouseY=c}},resizeListeners:[],updateResizeListeners(){const{canvas:e}=r;Se.resizeListeners.forEach((t=>{t(e.width,e.height)}))},setCanvasSize(e,t,n){const{canvas:o}=r;Se.updateCanvasDimensions(o,e,t),n||Se.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){let e=J[SDL.screen>>2];e|=8388608,Z[SDL.screen>>2]=e}Se.updateCanvasDimensions(r.canvas),Se.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){let e=J[SDL.screen>>2];e&=-8388609,Z[SDL.screen>>2]=e}Se.updateCanvasDimensions(r.canvas),Se.updateResizeListeners()},updateCanvasDimensions(e,t,n){t&&n?(e.widthNative=t,e.heightNative=n):(t=e.widthNative,n=e.heightNative);let o=t,i=n;if(r.forcedAspectRatio&&r.forcedAspectRatio>0&&(o/i<r.forcedAspectRatio?o=Math.round(i*r.forcedAspectRatio):i=Math.round(o/r.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){const e=Math.min(screen.width/o,screen.height/i);o=Math.round(o*e),i=Math.round(i*e)}Se.resizeCanvas?(e.width!=o&&(e.width=o),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!=n&&(e.height=n),void 0!==e.style&&(o!=t||i!=n?(e.style.setProperty("width",`${o}px`,"important"),e.style.setProperty("height",`${i}px`,"important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))}};function Fe(e){for(;e.length>0;){const t=e.shift();if("function"==typeof t){t(r);continue}const{func:n}=t;"number"==typeof n?void 0===t.arg?oe.get(n)():oe.get(n)(t.arg):n(void 0===t.arg?null:t.arg)}}function xe(e){return e.replace(/\b_Z[\w\d_]+/g,(e=>{const t=(r=e,_("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),r);var r;return e===t?e:`${t} [${e}]`}))}function ke(e){this.excPtr=e,this.ptr=e-16,this.set_type=function(e){Z[this.ptr+4>>2]=e},this.get_type=function(){return Z[this.ptr+4>>2]},this.set_destructor=function(e){Z[this.ptr+8>>2]=e},this.get_destructor=function(){return Z[this.ptr+8>>2]},this.set_refcount=function(e){Z[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,V[this.ptr+12|0]=e},this.get_caught=function(){return 0!=V[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,V[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=V[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(){const e=Z[this.ptr>>2];Z[this.ptr>>2]=e+1},this.release_ref=function(){const e=Z[this.ptr>>2];return Z[this.ptr>>2]=e-1,v(e>0),1===e}}function Ne(e){this.free=function(){An(this.ptr),this.ptr=0},this.set_base_ptr=function(e){Z[this.ptr>>2]=e},this.get_base_ptr=function(){return Z[this.ptr>>2]},this.set_adjusted_ptr=function(e){Z[this.ptr+4>>2]=e},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return Z[this.ptr+4>>2]},this.get_exception_ptr=function(){if(wn(this.get_exception_info().get_type()))return Z[this.get_base_ptr()>>2];const e=this.get_adjusted_ptr();return 0!==e?e:this.get_base_ptr()},this.get_exception_info=function(){return new ke(this.get_base_ptr())},void 0===e?(this.ptr=un(8),this.set_adjusted_ptr(0)):this.ptr=e}const Ue=[];let je=0;function Le(e){try{return An(new ke(e).ptr)}catch(e){y(`e