decoder-pro-audio-player.js 90 KB

1
  1. !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var r,t=(r="undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-audio-player.js",document.baseURI).href,async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t,o,n;(n=e).ready=new Promise(((e,r)=>{t=e,o=r})),(n=void 0!==n?n:{}).locateFile=function(e){return"decoder-pro-audio.wasm"==e&&"undefined"!=typeof JESSIBUCA_PRO_AUDIO_WASM_URL&&""!=JESSIBUCA_PRO_AUDIO_WASM_URL?JESSIBUCA_PRO_AUDIO_WASM_URL:e};var s,a,i,l=Object.assign({},n),u="./this.program",d="object"==typeof window,c="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,h="";function p(e){return n.locateFile?n.locateFile(e,h):h+e}if(f){const{createRequire:e}=await import("module");var m=e("undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-audio-player.js",document.baseURI).href),g=m("fs"),y=m("path");h=c?y.dirname(h)+"/":m("url").fileURLToPath(new URL("./","undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-audio-player.js",document.baseURI).href)),s=(e,r)=>(e=Q(e)?new URL(e):y.normalize(e),g.readFileSync(e,r?void 0:"utf8")),i=e=>{var r=s(e,!0);return r.buffer||(r=new Uint8Array(r)),r},a=function(e,r,t){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e=Q(e)?new URL(e):y.normalize(e),g.readFile(e,o?void 0:"utf8",((e,n)=>{e?t(e):r(o?n.buffer:n)}))},!n.thisProgram&&process.argv.length>1&&(u=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),n.inspect=()=>"[Emscripten Module object]"}else(d||c)&&(c?h=self.location.href:"undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),r&&(h=r),h=0!==h.indexOf("blob:")?h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},c&&(i=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),a=(e,r,t)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=()=>{200==o.status||0==o.status&&o.response?r(o.response):t()},o.onerror=t,o.send(null)});var v,w,b=n.print||console.log.bind(console),E=n.printErr||console.error.bind(console);Object.assign(n,l),l=null,n.arguments&&n.arguments,n.thisProgram&&(u=n.thisProgram),n.quit&&n.quit,n.wasmBinary&&(v=n.wasmBinary),n.noExitRuntime,"object"!=typeof WebAssembly&&V("no native wasm support detected");var S,k,C,_,D,A,T,P,F=!1;function $(e,r){e||V(r)}function R(){var e=w.buffer;n.HEAP8=S=new Int8Array(e),n.HEAP16=C=new Int16Array(e),n.HEAPU8=k=new Uint8Array(e),n.HEAPU16=_=new Uint16Array(e),n.HEAP32=D=new Int32Array(e),n.HEAPU32=A=new Uint32Array(e),n.HEAPF32=T=new Float32Array(e),n.HEAPF64=P=new Float64Array(e)}var O=[],M=[],U=[];function x(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)B(n.preRun.shift());ne(O)}function W(){n.noFSInit||Pe.init.initialized||Pe.init(),Pe.ignorePermissions=!1,ne(M)}function j(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)L(n.postRun.shift());ne(U)}function B(e){O.unshift(e)}function I(e){M.unshift(e)}function L(e){U.unshift(e)}var z=0,N=null;function H(e){z++,n.monitorRunDependencies&&n.monitorRunDependencies(z)}function q(e){if(z--,n.monitorRunDependencies&&n.monitorRunDependencies(z),0==z&&N){var r=N;N=null,r()}}function V(e){n.onAbort&&n.onAbort(e),E(e="Aborted("+e+")"),F=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw o(r),r}var G,J,X,K="data:application/octet-stream;base64,";function Z(e){return e.startsWith(K)}function Q(e){return e.startsWith("file://")}function Y(e){if(e==G&&v)return new Uint8Array(v);if(i)return i(e);throw"both async and sync fetching of the wasm failed"}function ee(e){if(!v&&(d||c)){if("function"==typeof fetch&&!Q(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>Y(e)));if(a)return new Promise(((r,t)=>{a(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>Y(e)))}function re(e,r,t){return ee(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{E(`failed to asynchronously prepare wasm: ${e}`),V(e)}))}function te(e,r,t,o){return e||"function"!=typeof WebAssembly.instantiateStreaming||Z(r)||Q(r)||f||"function"!=typeof fetch?re(r,t,o):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(o,(function(e){return E(`wasm streaming compile failed: ${e}`),E("falling back to ArrayBuffer instantiation"),re(r,t,o)}))))}function oe(){var e={a:ro};function r(e,r){return to=e.exports,w=to.D,R(),Or=to.G,I(to.E),q(),to}if(H(),n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(e){E(`Module.instantiateWasm callback failed with error: ${e}`),o(e)}return te(v,G,e,(function(e){r(e.instance)})).catch(o),{}}n.locateFile?Z(G="decoder-pro-audio.wasm")||(G=p(G)):G=new URL("decoder-pro-audio.wasm","undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("decoder-pro-audio-player.js",document.baseURI).href).href;var ne=e=>{for(;e.length>0;)e.shift()(n)};function se(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){A[this.ptr+4>>2]=e},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(e){A[this.ptr+8>>2]=e},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,S[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=S[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,S[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=S[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){A[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){if(lo(this.get_type()))return A[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var ae=(e,r,t)=>{throw new se(e).init(r,t),e},ie=e=>(D[no()>>2]=e,e),le={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,o=e.length-1;o>=0;o--){var n=e[o];"."===n?e.splice(o,1):".."===n?(e.splice(o,1),t++):t&&(e.splice(o,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=le.isAbs(e),t="/"===e.substr(-1);return(e=le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=le.splitPath(e),t=r[0],o=r[1];return t||o?(o&&(o=o.substr(0,o.length-1)),t+o):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=le.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return le.normalize(e.join("/"))},join2:(e,r)=>le.normalize(e+"/"+r)},ue=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(f)try{var e=m("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}V("initRandomDevice")},de=e=>(de=ue())(e),ce={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var o=t>=0?arguments[t]:Pe.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,r=le.isAbs(o)}return(r?"/":"")+(e=le.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ce.resolve(e).substr(1),r=ce.resolve(r).substr(1);for(var o=t(e.split("/")),n=t(r.split("/")),s=Math.min(o.length,n.length),a=s,i=0;i<s;i++)if(o[i]!==n[i]){a=i;break}var l=[];for(i=a;i<o.length;i++)l.push("..");return(l=l.concat(n.slice(a))).join("/")}},fe="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,he=(e,r,t)=>{for(var o=r+t,n=r;e[n]&&!(n>=o);)++n;if(n-r>16&&e.buffer&&fe)return fe.decode(e.subarray(r,n));for(var s="";r<n;){var a=e[r++];if(128&a){var i=63&e[r++];if(192!=(224&a)){var l=63&e[r++];if((a=224==(240&a)?(15&a)<<12|i<<6|l:(7&a)<<18|i<<12|l<<6|63&e[r++])<65536)s+=String.fromCharCode(a);else{var u=a-65536;s+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else s+=String.fromCharCode((31&a)<<6|i)}else s+=String.fromCharCode(a)}return s},pe=[],me=e=>{for(var r=0,t=0;t<e.length;++t){var o=e.charCodeAt(t);o<=127?r++:o<=2047?r+=2:o>=55296&&o<=57343?(r+=4,++t):r+=3}return r},ge=(e,r,t,o)=>{if(!(o>0))return 0;for(var n=t,s=t+o-1,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),i<=127){if(t>=s)break;r[t++]=i}else if(i<=2047){if(t+1>=s)break;r[t++]=192|i>>6,r[t++]=128|63&i}else if(i<=65535){if(t+2>=s)break;r[t++]=224|i>>12,r[t++]=128|i>>6&63,r[t++]=128|63&i}else{if(t+3>=s)break;r[t++]=240|i>>18,r[t++]=128|i>>12&63,r[t++]=128|i>>6&63,r[t++]=128|63&i}}return r[t]=0,t-n};function ye(e,r,t){var o=t>0?t:me(e)+1,n=new Array(o),s=ge(e,n,0,n.length);return r&&(n.length=s),n}var ve=()=>{if(!pe.length){var e=null;if(f){var r=Buffer.alloc(256),t=0,o=process.stdin.fd;try{t=g.readSync(o,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;pe=ye(e,!0)}return pe.shift()},we={ttys:[],init(){},shutdown(){},register(e,r){we.ttys[e]={input:[],output:[],ops:r},Pe.registerDevice(e,we.stream_ops)},stream_ops:{open(e){var r=we.ttys[e.node.rdev];if(!r)throw new Pe.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,o,n){if(!e.tty||!e.tty.ops.get_char)throw new Pe.ErrnoError(60);for(var s=0,a=0;a<o;a++){var i;try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new Pe.ErrnoError(29)}if(void 0===i&&0===s)throw new Pe.ErrnoError(6);if(null==i)break;s++,r[t+a]=i}return s&&(e.node.timestamp=Date.now()),s},write(e,r,t,o,n){if(!e.tty||!e.tty.ops.put_char)throw new Pe.ErrnoError(60);try{for(var s=0;s<o;s++)e.tty.ops.put_char(e.tty,r[t+s])}catch(e){throw new Pe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:e=>ve(),put_char(e,r){null===r||10===r?(b(he(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(b(he(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(E(he(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(E(he(e.output,0)),e.output=[])}}},be=e=>{V()},Ee={ops_table:null,mount:e=>Ee.createNode(null,"/",16895,0),createNode(e,r,t,o){if(Pe.isBlkdev(t)||Pe.isFIFO(t))throw new Pe.ErrnoError(63);Ee.ops_table||(Ee.ops_table={dir:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr,lookup:Ee.node_ops.lookup,mknod:Ee.node_ops.mknod,rename:Ee.node_ops.rename,unlink:Ee.node_ops.unlink,rmdir:Ee.node_ops.rmdir,readdir:Ee.node_ops.readdir,symlink:Ee.node_ops.symlink},stream:{llseek:Ee.stream_ops.llseek}},file:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr},stream:{llseek:Ee.stream_ops.llseek,read:Ee.stream_ops.read,write:Ee.stream_ops.write,allocate:Ee.stream_ops.allocate,mmap:Ee.stream_ops.mmap,msync:Ee.stream_ops.msync}},link:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr,readlink:Ee.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr},stream:Pe.chrdev_stream_ops}});var n=Pe.createNode(e,r,t,o);return Pe.isDir(n.mode)?(n.node_ops=Ee.ops_table.dir.node,n.stream_ops=Ee.ops_table.dir.stream,n.contents={}):Pe.isFile(n.mode)?(n.node_ops=Ee.ops_table.file.node,n.stream_ops=Ee.ops_table.file.stream,n.usedBytes=0,n.contents=null):Pe.isLink(n.mode)?(n.node_ops=Ee.ops_table.link.node,n.stream_ops=Ee.ops_table.link.stream):Pe.isChrdev(n.mode)&&(n.node_ops=Ee.ops_table.chrdev.node,n.stream_ops=Ee.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[r]=n,e.timestamp=n.timestamp),n},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var o=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=Pe.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,Pe.isDir(e.mode)?r.size=4096:Pe.isFile(e.mode)?r.size=e.usedBytes:Pe.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&Ee.resizeFileStorage(e,r.size)},lookup(e,r){throw Pe.genericErrors[44]},mknod:(e,r,t,o)=>Ee.createNode(e,r,t,o),rename(e,r,t){if(Pe.isDir(e.mode)){var o;try{o=Pe.lookupNode(r,t)}catch(e){}if(o)for(var n in o.contents)throw new Pe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=Pe.lookupNode(e,r);for(var o in t.contents)throw new Pe.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var o=Ee.createNode(e,r,41471,0);return o.link=t,o},readlink(e){if(!Pe.isLink(e.mode))throw new Pe.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,o,n){var s=e.node.contents;if(n>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,o);if(a>8&&s.subarray)r.set(s.subarray(n,n+a),t);else for(var i=0;i<a;i++)r[t+i]=s[n+i];return a},write(e,r,t,o,n,s){if(!o)return 0;var a=e.node;if(a.timestamp=Date.now(),r.subarray&&(!a.contents||a.contents.subarray)){if(s)return a.contents=r.subarray(t,t+o),a.usedBytes=o,o;if(0===a.usedBytes&&0===n)return a.contents=r.slice(t,t+o),a.usedBytes=o,o;if(n+o<=a.usedBytes)return a.contents.set(r.subarray(t,t+o),n),o}if(Ee.expandFileStorage(a,n+o),a.contents.subarray&&r.subarray)a.contents.set(r.subarray(t,t+o),n);else for(var i=0;i<o;i++)a.contents[n+i]=r[t+i];return a.usedBytes=Math.max(a.usedBytes,n+o),o},llseek(e,r,t){var o=r;if(1===t?o+=e.position:2===t&&Pe.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new Pe.ErrnoError(28);return o},allocate(e,r,t){Ee.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,o,n){if(!Pe.isFile(e.node.mode))throw new Pe.ErrnoError(43);var s,a,i=e.node.contents;if(2&n||i.buffer!==S.buffer){if((t>0||t+r<i.length)&&(i=i.subarray?i.subarray(t,t+r):Array.prototype.slice.call(i,t,t+r)),a=!0,!(s=be()))throw new Pe.ErrnoError(48);S.set(i,s)}else a=!1,s=i.byteOffset;return{ptr:s,allocated:a}},msync:(e,r,t,o,n)=>(Ee.stream_ops.write(e,r,0,o,t,!1),0)}},Se=(e,r,t,o)=>{var n=o?"":`al ${e}`;a(e,(t=>{$(t,`Loading data file "${e}" failed (no arrayBuffer).`),r(new Uint8Array(t)),n&&q()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),n&&H()},ke=(e,r,t,o,n,s)=>Pe.createDataFile(e,r,t,o,n,s),Ce=n.preloadPlugins||[],_e=(e,r,t,o)=>{"undefined"!=typeof Browser&&Browser.init();var n=!1;return Ce.forEach((s=>{n||s.canHandle(r)&&(s.handle(e,r,t,o),n=!0)})),n},De=(e,r,t,o,n,s,a,i,l,u)=>{var d=r?ce.resolve(le.join2(e,r)):e;function c(t){function c(t){u&&u(),i||ke(e,r,t,o,n,l),s&&s(),q()}_e(t,d,c,(()=>{a&&a(),q()}))||c(t)}H(),"string"==typeof t?Se(t,(e=>c(e)),a):c(t)},Ae=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r},Te=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},Pe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(e=ce.resolve(e)))return{path:"",node:null};if(r=Object.assign({follow_mount:!0,recurse_count:0},r),r.recurse_count>8)throw new Pe.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),o=Pe.root,n="/",s=0;s<t.length;s++){var a=s===t.length-1;if(a&&r.parent)break;if(o=Pe.lookupNode(o,t[s]),n=le.join2(n,t[s]),Pe.isMountpoint(o)&&(!a||a&&r.follow_mount)&&(o=o.mounted.root),!a||r.follow)for(var i=0;Pe.isLink(o.mode);){var l=Pe.readlink(n);if(n=ce.resolve(le.dirname(n),l),o=Pe.lookupPath(n,{recurse_count:r.recurse_count+1}).node,i++>40)throw new Pe.ErrnoError(32)}}return{path:n,node:o}},getPath(e){for(var r;;){if(Pe.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,o=0;o<r.length;o++)t=(t<<5)-t+r.charCodeAt(o)|0;return(e+t>>>0)%Pe.nameTable.length},hashAddNode(e){var r=Pe.hashName(e.parent.id,e.name);e.name_next=Pe.nameTable[r],Pe.nameTable[r]=e},hashRemoveNode(e){var r=Pe.hashName(e.parent.id,e.name);if(Pe.nameTable[r]===e)Pe.nameTable[r]=e.name_next;else for(var t=Pe.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=Pe.mayLookup(e);if(t)throw new Pe.ErrnoError(t,e);for(var o=Pe.hashName(e.id,r),n=Pe.nameTable[o];n;n=n.name_next){var s=n.name;if(n.parent.id===e.id&&s===r)return n}return Pe.lookup(e,r)},createNode(e,r,t,o){var n=new Pe.FSNode(e,r,t,o);return Pe.hashAddNode(n),n},destroyNode(e){Pe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>Pe.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup(e){var r=Pe.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{return Pe.lookupNode(e,r),20}catch(e){}return Pe.nodePermissions(e,"wx")},mayDelete(e,r,t){var o;try{o=Pe.lookupNode(e,r)}catch(e){return e.errno}var n=Pe.nodePermissions(e,"wx");if(n)return n;if(t){if(!Pe.isDir(o.mode))return 54;if(Pe.isRoot(o)||Pe.getPath(o)===Pe.cwd())return 10}else if(Pe.isDir(o.mode))return 31;return 0},mayOpen:(e,r)=>e?Pe.isLink(e.mode)?32:Pe.isDir(e.mode)&&("r"!==Pe.flagsToPermissionString(r)||512&r)?31:Pe.nodePermissions(e,Pe.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Pe.MAX_OPEN_FDS;e++)if(!Pe.streams[e])return e;throw new Pe.ErrnoError(33)},getStreamChecked(e){var r=Pe.getStream(e);if(!r)throw new Pe.ErrnoError(8);return r},getStream:e=>Pe.streams[e],createStream(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return Pe.FSStream||(Pe.FSStream=function(){this.shared={}},Pe.FSStream.prototype={},Object.defineProperties(Pe.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Pe.FSStream,e),-1==r&&(r=Pe.nextfd()),e.fd=r,Pe.streams[r]=e,e},closeStream(e){Pe.streams[e]=null},chrdev_stream_ops:{open(e){var r=Pe.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new Pe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){Pe.devices[e]={stream_ops:r}},getDevice:e=>Pe.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var o=t.pop();r.push(o),t.push.apply(t,o.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),Pe.syncFSRequests++,Pe.syncFSRequests>1&&E(`warning: ${Pe.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=Pe.getMounts(Pe.root.mount),o=0;function n(e){return Pe.syncFSRequests--,r(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,n(e));++o>=t.length&&n(null)}t.forEach((r=>{if(!r.type.syncfs)return s(null);r.type.syncfs(r,e,s)}))},mount(e,r,t){var o,n="/"===t,s=!t;if(n&&Pe.root)throw new Pe.ErrnoError(10);if(!n&&!s){var a=Pe.lookupPath(t,{follow_mount:!1});if(t=a.path,o=a.node,Pe.isMountpoint(o))throw new Pe.ErrnoError(10);if(!Pe.isDir(o.mode))throw new Pe.ErrnoError(54)}var i={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(i);return l.mount=i,i.root=l,n?Pe.root=l:o&&(o.mounted=i,o.mount&&o.mount.mounts.push(i)),l},unmount(e){var r=Pe.lookupPath(e,{follow_mount:!1});if(!Pe.isMountpoint(r.node))throw new Pe.ErrnoError(28);var t=r.node,o=t.mounted,n=Pe.getMounts(o);Object.keys(Pe.nameTable).forEach((e=>{for(var r=Pe.nameTable[e];r;){var t=r.name_next;n.includes(r.mount)&&Pe.destroyNode(r),r=t}})),t.mounted=null;var s=t.mount.mounts.indexOf(o);t.mount.mounts.splice(s,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var o=Pe.lookupPath(e,{parent:!0}).node,n=le.basename(e);if(!n||"."===n||".."===n)throw new Pe.ErrnoError(28);var s=Pe.mayCreate(o,n);if(s)throw new Pe.ErrnoError(s);if(!o.node_ops.mknod)throw new Pe.ErrnoError(63);return o.node_ops.mknod(o,n,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,Pe.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,Pe.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),o="",n=0;n<t.length;++n)if(t[n]){o+="/"+t[n];try{Pe.mkdir(o,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,Pe.mknod(e,r,t)),symlink(e,r){if(!ce.resolve(e))throw new Pe.ErrnoError(44);var t=Pe.lookupPath(r,{parent:!0}).node;if(!t)throw new Pe.ErrnoError(44);var o=le.basename(r),n=Pe.mayCreate(t,o);if(n)throw new Pe.ErrnoError(n);if(!t.node_ops.symlink)throw new Pe.ErrnoError(63);return t.node_ops.symlink(t,o,e)},rename(e,r){var t,o,n=le.dirname(e),s=le.dirname(r),a=le.basename(e),i=le.basename(r);if(t=Pe.lookupPath(e,{parent:!0}).node,o=Pe.lookupPath(r,{parent:!0}).node,!t||!o)throw new Pe.ErrnoError(44);if(t.mount!==o.mount)throw new Pe.ErrnoError(75);var l,u=Pe.lookupNode(t,a),d=ce.relative(e,s);if("."!==d.charAt(0))throw new Pe.ErrnoError(28);if("."!==(d=ce.relative(r,n)).charAt(0))throw new Pe.ErrnoError(55);try{l=Pe.lookupNode(o,i)}catch(e){}if(u!==l){var c=Pe.isDir(u.mode),f=Pe.mayDelete(t,a,c);if(f)throw new Pe.ErrnoError(f);if(f=l?Pe.mayDelete(o,i,c):Pe.mayCreate(o,i))throw new Pe.ErrnoError(f);if(!t.node_ops.rename)throw new Pe.ErrnoError(63);if(Pe.isMountpoint(u)||l&&Pe.isMountpoint(l))throw new Pe.ErrnoError(10);if(o!==t&&(f=Pe.nodePermissions(t,"w")))throw new Pe.ErrnoError(f);Pe.hashRemoveNode(u);try{t.node_ops.rename(u,o,i)}catch(e){throw e}finally{Pe.hashAddNode(u)}}},rmdir(e){var r=Pe.lookupPath(e,{parent:!0}).node,t=le.basename(e),o=Pe.lookupNode(r,t),n=Pe.mayDelete(r,t,!0);if(n)throw new Pe.ErrnoError(n);if(!r.node_ops.rmdir)throw new Pe.ErrnoError(63);if(Pe.isMountpoint(o))throw new Pe.ErrnoError(10);r.node_ops.rmdir(r,t),Pe.destroyNode(o)},readdir(e){var r=Pe.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new Pe.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=Pe.lookupPath(e,{parent:!0}).node;if(!r)throw new Pe.ErrnoError(44);var t=le.basename(e),o=Pe.lookupNode(r,t),n=Pe.mayDelete(r,t,!1);if(n)throw new Pe.ErrnoError(n);if(!r.node_ops.unlink)throw new Pe.ErrnoError(63);if(Pe.isMountpoint(o))throw new Pe.ErrnoError(10);r.node_ops.unlink(r,t),Pe.destroyNode(o)},readlink(e){var r=Pe.lookupPath(e).node;if(!r)throw new Pe.ErrnoError(44);if(!r.node_ops.readlink)throw new Pe.ErrnoError(28);return ce.resolve(Pe.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=Pe.lookupPath(e,{follow:!r}).node;if(!t)throw new Pe.ErrnoError(44);if(!t.node_ops.getattr)throw new Pe.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>Pe.stat(e,!0),chmod(e,r,t){var o;if(!(o="string"==typeof e?Pe.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new Pe.ErrnoError(63);o.node_ops.setattr(o,{mode:4095&r|-4096&o.mode,timestamp:Date.now()})},lchmod(e,r){Pe.chmod(e,r,!0)},fchmod(e,r){var t=Pe.getStreamChecked(e);Pe.chmod(t.node,r)},chown(e,r,t,o){var n;if(!(n="string"==typeof e?Pe.lookupPath(e,{follow:!o}).node:e).node_ops.setattr)throw new Pe.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown(e,r,t){Pe.chown(e,r,t,!0)},fchown(e,r,t){var o=Pe.getStreamChecked(e);Pe.chown(o.node,r,t)},truncate(e,r){if(r<0)throw new Pe.ErrnoError(28);var t;if(!(t="string"==typeof e?Pe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Pe.ErrnoError(63);if(Pe.isDir(t.mode))throw new Pe.ErrnoError(31);if(!Pe.isFile(t.mode))throw new Pe.ErrnoError(28);var o=Pe.nodePermissions(t,"w");if(o)throw new Pe.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=Pe.getStreamChecked(e);if(0==(2097155&t.flags))throw new Pe.ErrnoError(28);Pe.truncate(t.node,r)},utime(e,r,t){var o=Pe.lookupPath(e,{follow:!0}).node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new Pe.ErrnoError(44);var o;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?Ae(r):r)?4095&t|32768:0,"object"==typeof e)o=e;else{e=le.normalize(e);try{o=Pe.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var s=!1;if(64&r)if(o){if(128&r)throw new Pe.ErrnoError(20)}else o=Pe.mknod(e,t,0),s=!0;if(!o)throw new Pe.ErrnoError(44);if(Pe.isChrdev(o.mode)&&(r&=-513),65536&r&&!Pe.isDir(o.mode))throw new Pe.ErrnoError(54);if(!s){var a=Pe.mayOpen(o,r);if(a)throw new Pe.ErrnoError(a)}512&r&&!s&&Pe.truncate(o,0),r&=-131713;var i=Pe.createStream({node:o,path:Pe.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!n.logReadFiles||1&r||(Pe.readFiles||(Pe.readFiles={}),e in Pe.readFiles||(Pe.readFiles[e]=1)),i},close(e){if(Pe.isClosed(e))throw new Pe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Pe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Pe.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Pe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,o,n){if(o<0||n<0)throw new Pe.ErrnoError(28);if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(1==(2097155&e.flags))throw new Pe.ErrnoError(8);if(Pe.isDir(e.node.mode))throw new Pe.ErrnoError(31);if(!e.stream_ops.read)throw new Pe.ErrnoError(28);var s=void 0!==n;if(s){if(!e.seekable)throw new Pe.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,r,t,o,n);return s||(e.position+=a),a},write(e,r,t,o,n,s){if(o<0||n<0)throw new Pe.ErrnoError(28);if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(0==(2097155&e.flags))throw new Pe.ErrnoError(8);if(Pe.isDir(e.node.mode))throw new Pe.ErrnoError(31);if(!e.stream_ops.write)throw new Pe.ErrnoError(28);e.seekable&&1024&e.flags&&Pe.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new Pe.ErrnoError(70)}else n=e.position;var i=e.stream_ops.write(e,r,t,o,n,s);return a||(e.position+=i),i},allocate(e,r,t){if(Pe.isClosed(e))throw new Pe.ErrnoError(8);if(r<0||t<=0)throw new Pe.ErrnoError(28);if(0==(2097155&e.flags))throw new Pe.ErrnoError(8);if(!Pe.isFile(e.node.mode)&&!Pe.isDir(e.node.mode))throw new Pe.ErrnoError(43);if(!e.stream_ops.allocate)throw new Pe.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,o,n){if(0!=(2&o)&&0==(2&n)&&2!=(2097155&e.flags))throw new Pe.ErrnoError(2);if(1==(2097155&e.flags))throw new Pe.ErrnoError(2);if(!e.stream_ops.mmap)throw new Pe.ErrnoError(43);return e.stream_ops.mmap(e,r,t,o,n)},msync:(e,r,t,o,n)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,o,n):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new Pe.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,o=Pe.open(e,r.flags),n=Pe.stat(e).size,s=new Uint8Array(n);return Pe.read(o,s,0,n,0),"utf8"===r.encoding?t=he(s,0):"binary"===r.encoding&&(t=s),Pe.close(o),t},writeFile(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.flags=t.flags||577;var o=Pe.open(e,t.flags,t.mode);if("string"==typeof r){var n=new Uint8Array(me(r)+1),s=ge(r,n,0,n.length);Pe.write(o,n,0,s,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");Pe.write(o,r,0,r.byteLength,void 0,t.canOwn)}Pe.close(o)},cwd:()=>Pe.currentPath,chdir(e){var r=Pe.lookupPath(e,{follow:!0});if(null===r.node)throw new Pe.ErrnoError(44);if(!Pe.isDir(r.node.mode))throw new Pe.ErrnoError(54);var t=Pe.nodePermissions(r.node,"x");if(t)throw new Pe.ErrnoError(t);Pe.currentPath=r.path},createDefaultDirectories(){Pe.mkdir("/tmp"),Pe.mkdir("/home"),Pe.mkdir("/home/web_user")},createDefaultDevices(){Pe.mkdir("/dev"),Pe.registerDevice(Pe.makedev(1,3),{read:()=>0,write:(e,r,t,o,n)=>o}),Pe.mkdev("/dev/null",Pe.makedev(1,3)),we.register(Pe.makedev(5,0),we.default_tty_ops),we.register(Pe.makedev(6,0),we.default_tty1_ops),Pe.mkdev("/dev/tty",Pe.makedev(5,0)),Pe.mkdev("/dev/tty1",Pe.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=de(e).byteLength),e[--r]);Pe.createDevice("/dev","random",t),Pe.createDevice("/dev","urandom",t),Pe.mkdir("/dev/shm"),Pe.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Pe.mkdir("/proc");var e=Pe.mkdir("/proc/self");Pe.mkdir("/proc/self/fd"),Pe.mount({mount(){var r=Pe.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,o=Pe.getStreamChecked(t),n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return n.parent=n,n}},r}},{},"/proc/self/fd")},createStandardStreams(){n.stdin?Pe.createDevice("/dev","stdin",n.stdin):Pe.symlink("/dev/tty","/dev/stdin"),n.stdout?Pe.createDevice("/dev","stdout",null,n.stdout):Pe.symlink("/dev/tty","/dev/stdout"),n.stderr?Pe.createDevice("/dev","stderr",null,n.stderr):Pe.symlink("/dev/tty1","/dev/stderr"),Pe.open("/dev/stdin",0),Pe.open("/dev/stdout",1),Pe.open("/dev/stderr",1)},ensureErrnoError(){Pe.ErrnoError||(Pe.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Pe.ErrnoError.prototype=new Error,Pe.ErrnoError.prototype.constructor=Pe.ErrnoError,[44].forEach((e=>{Pe.genericErrors[e]=new Pe.ErrnoError(e),Pe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){Pe.ensureErrnoError(),Pe.nameTable=new Array(4096),Pe.mount(Ee,{},"/"),Pe.createDefaultDirectories(),Pe.createDefaultDevices(),Pe.createSpecialDirectories(),Pe.filesystems={MEMFS:Ee}},init(e,r,t){Pe.init.initialized=!0,Pe.ensureErrnoError(),n.stdin=e||n.stdin,n.stdout=r||n.stdout,n.stderr=t||n.stderr,Pe.createStandardStreams()},quit(){Pe.init.initialized=!1;for(var e=0;e<Pe.streams.length;e++){var r=Pe.streams[e];r&&Pe.close(r)}},findObject(e,r){var t=Pe.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(o=Pe.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var o=Pe.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=o.path,t.parentObject=o.node,t.name=le.basename(e),o=Pe.lookupPath(e,{follow:!r}),t.exists=!0,t.path=o.path,t.object=o.node,t.name=o.node.name,t.isRoot="/"===o.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,o){e="string"==typeof e?e:Pe.getPath(e);for(var n=r.split("/").reverse();n.length;){var s=n.pop();if(s){var a=le.join2(e,s);try{Pe.mkdir(a)}catch(e){}e=a}}return a},createFile(e,r,t,o,n){var s=le.join2("string"==typeof e?e:Pe.getPath(e),r),a=Te(o,n);return Pe.create(s,a)},createDataFile(e,r,t,o,n,s){var a=r;e&&(e="string"==typeof e?e:Pe.getPath(e),a=r?le.join2(e,r):e);var i=Te(o,n),l=Pe.create(a,i);if(t){if("string"==typeof t){for(var u=new Array(t.length),d=0,c=t.length;d<c;++d)u[d]=t.charCodeAt(d);t=u}Pe.chmod(l,146|i);var f=Pe.open(l,577);Pe.write(f,t,0,t.length,0,s),Pe.close(f),Pe.chmod(l,i)}return l},createDevice(e,r,t,o){var n=le.join2("string"==typeof e?e:Pe.getPath(e),r),s=Te(!!t,!!o);Pe.createDevice.major||(Pe.createDevice.major=64);var a=Pe.makedev(Pe.createDevice.major++,0);return Pe.registerDevice(a,{open(e){e.seekable=!1},close(e){o&&o.buffer&&o.buffer.length&&o(10)},read(e,r,o,n,s){for(var a=0,i=0;i<n;i++){var l;try{l=t()}catch(e){throw new Pe.ErrnoError(29)}if(void 0===l&&0===a)throw new Pe.ErrnoError(6);if(null==l)break;a++,r[o+i]=l}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,s){for(var a=0;a<n;a++)try{o(r[t+a])}catch(e){throw new Pe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}}),Pe.mkdev(n,s,a)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ye(s(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Pe.ErrnoError(29)}},createLazyFile(e,r,t,o,n){function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,o=Number(e.getResponseHeader("Content-length")),n=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,s=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,a=1048576;n||(a=o);var i=this;i.setDataGetter((e=>{var r=e*a,n=(e+1)*a-1;if(n=Math.min(n,o-1),void 0===i.chunks[e]&&(i.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>o-1)throw new Error("only "+o+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",t,!1),o!==a&&n.setRequestHeader("Range","bytes="+e+"-"+r),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+t+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):ye(n.responseText||"",!0)})(r,n)),void 0===i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]})),!s&&o||(a=o=1,o=this.getter(0).length,a=o,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=o,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!c)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new s;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var i={isDevice:!1,contents:a}}else i={isDevice:!1,url:t};var l=Pe.createFile(e,r,i,o,n);i.contents?l.contents=i.contents:i.url&&(l.contents=null,l.url=i.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};function d(e,r,t,o,n){var s=e.node.contents;if(n>=s.length)return 0;var a=Math.min(s.length-n,o);if(s.slice)for(var i=0;i<a;i++)r[t+i]=s[n+i];else for(i=0;i<a;i++)r[t+i]=s.get(n+i);return a}return Object.keys(l.stream_ops).forEach((e=>{var r=l.stream_ops[e];u[e]=function(){return Pe.forceLoadFile(l),r.apply(null,arguments)}})),u.read=(e,r,t,o,n)=>(Pe.forceLoadFile(l),d(e,r,t,o,n)),u.mmap=(e,r,t,o,n)=>{Pe.forceLoadFile(l);var s=be();if(!s)throw new Pe.ErrnoError(48);return d(e,S,s,r,t),{ptr:s,allocated:!0}},l.stream_ops=u,l}},Fe=(e,r)=>e?he(k,e,r):"",$e={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(le.isAbs(r))return r;var o;if(o=-100===e?Pe.cwd():$e.getStreamFromFD(e).path,0==r.length){if(!t)throw new Pe.ErrnoError(44);return o}return le.join2(o,r)},doStat(e,r,t){try{var o=e(r)}catch(e){if(e&&e.node&&le.normalize(r)!==le.normalize(Pe.getPath(e.node)))return-54;throw e}D[t>>2]=o.dev,D[t+4>>2]=o.mode,A[t+8>>2]=o.nlink,D[t+12>>2]=o.uid,D[t+16>>2]=o.gid,D[t+20>>2]=o.rdev,X=[o.size>>>0,(J=o.size,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[t+24>>2]=X[0],D[t+28>>2]=X[1],D[t+32>>2]=4096,D[t+36>>2]=o.blocks;var n=o.atime.getTime(),s=o.mtime.getTime(),a=o.ctime.getTime();return X=[Math.floor(n/1e3)>>>0,(J=Math.floor(n/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[t+40>>2]=X[0],D[t+44>>2]=X[1],A[t+48>>2]=n%1e3*1e3,X=[Math.floor(s/1e3)>>>0,(J=Math.floor(s/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[t+56>>2]=X[0],D[t+60>>2]=X[1],A[t+64>>2]=s%1e3*1e3,X=[Math.floor(a/1e3)>>>0,(J=Math.floor(a/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[t+72>>2]=X[0],D[t+76>>2]=X[1],A[t+80>>2]=a%1e3*1e3,X=[o.ino>>>0,(J=o.ino,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[t+88>>2]=X[0],D[t+92>>2]=X[1],0},doMsync(e,r,t,o,n){if(!Pe.isFile(r.node.mode))throw new Pe.ErrnoError(43);if(2&o)return 0;var s=k.slice(e,e+t);Pe.msync(r,s,n,t,o)},varargs:void 0,get(){var e=D[+$e.varargs>>2];return $e.varargs+=4,e},getp:()=>$e.get(),getStr:e=>Fe(e),getStreamFromFD:e=>Pe.getStreamChecked(e)};function Re(e,r,t){$e.varargs=t;try{var o=$e.getStreamFromFD(e);switch(r){case 0:if((n=$e.get())<0)return-28;for(;Pe.streams[n];)n++;return Pe.createStream(o,n).fd;case 1:case 2:case 6:case 7:return 0;case 3:return o.flags;case 4:var n=$e.get();return o.flags|=n,0;case 5:return n=$e.getp(),C[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return ie(28),-1}}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}}function Oe(e,r,t,o){$e.varargs=o;try{r=$e.getStr(r),r=$e.calculateAt(e,r);var n=o?$e.get():0;return Pe.open(r,t,n).fd}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return-e.errno}}var Me,Ue,xe,We=(e,r,t,o,n)=>{},je=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Me=e},Be=e=>{for(var r="",t=e;k[t];)r+=Me[k[t++]];return r},Ie={},Le={},ze={},Ne=e=>{throw new Ue(e)},He=e=>{throw new xe(e)},qe=(e,r,t)=>{function o(r){var o=t(r);o.length!==e.length&&He("Mismatched type converter count");for(var n=0;n<e.length;++n)Ge(e[n],o[n])}e.forEach((function(e){ze[e]=r}));var n=new Array(r.length),s=[],a=0;r.forEach(((e,r)=>{Le.hasOwnProperty(e)?n[r]=Le[e]:(s.push(e),Ie.hasOwnProperty(e)||(Ie[e]=[]),Ie[e].push((()=>{n[r]=Le[e],++a===s.length&&o(n)})))})),0===s.length&&o(n)};function Ve(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o=r.name;if(e||Ne(`type "${o}" must have a positive integer typeid pointer`),Le.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ne(`Cannot register type '${o}' twice`)}if(Le[e]=r,delete ze[e],Ie.hasOwnProperty(e)){var n=Ie[e];delete Ie[e],n.forEach((e=>e()))}}function Ge(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Ve(e,r,t)}var Je,Xe=8,Ke=(e,r,t,o)=>{Ge(e,{name:r=Be(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:o},argPackAdvance:Xe,readValueFromPointer:function(e){return this.fromWireType(k[e])},destructorFunction:null})},Ze=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Qe=e=>{Ne(e.$$.ptrType.registeredClass.name+" instance already deleted")},Ye=!1,er=e=>{},rr=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},tr=e=>{e.count.value-=1,0===e.count.value&&rr(e)},or=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var o=or(e,r,t.baseClass);return null===o?null:t.downcast(o)},nr={},sr=()=>Object.keys(cr).length,ar=()=>{var e=[];for(var r in cr)cr.hasOwnProperty(r)&&e.push(cr[r]);return e},ir=[],lr=()=>{for(;ir.length;){var e=ir.pop();e.$$.deleteScheduled=!1,e.delete()}},ur=e=>{Je=e,ir.length&&Je&&Je(lr)},dr=()=>{n.getInheritedInstanceCount=sr,n.getLiveInheritedInstances=ar,n.flushPendingDeletes=lr,n.setDelayFunction=ur},cr={},fr=(e,r)=>{for(void 0===r&&Ne("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},hr=(e,r)=>(r=fr(e,r),cr[r]),pr=(e,r)=>(r.ptrType&&r.ptr||He("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&He("Both smartPtrType and smartPtr must be specified"),r.count={value:1},gr(Object.create(e,{$$:{value:r}})));function mr(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=hr(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var o=t.clone();return this.destructor(e),o}function n(){return this.isSmartPointer?pr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):pr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,a=this.registeredClass.getActualType(r),i=nr[a];if(!i)return n.call(this);s=this.isConst?i.constPointerType:i.pointerType;var l=or(r,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?pr(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):pr(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}var gr=e=>"undefined"==typeof FinalizationRegistry?(gr=e=>e,e):(Ye=new FinalizationRegistry((e=>{tr(e.$$)})),gr=e=>{var r=e.$$;if(r.smartPtr){var t={$$:r};Ye.register(e,t,e)}return e},er=e=>Ye.unregister(e),gr(e)),yr=()=>{Object.assign(vr.prototype,{isAliasOf(e){if(!(this instanceof vr))return!1;if(!(e instanceof vr))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var o=e.$$.ptrType.registeredClass,n=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;o.baseClass;)n=o.upcast(n),o=o.baseClass;return r===o&&t===n},clone(){if(this.$$.ptr||Qe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=gr(Object.create(Object.getPrototypeOf(this),{$$:{value:Ze(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Qe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ne("Object already scheduled for deletion"),er(this),tr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Qe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ne("Object already scheduled for deletion"),ir.push(this),1===ir.length&&Je&&Je(lr),this.$$.deleteScheduled=!0,this}})};function vr(){}var wr=48,br=57,Er=e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=wr&&r<=br?`_${e}`:e};function Sr(e,r){return{[e=Er(e)]:function(){return r.apply(this,arguments)}}[e]}var kr=(e,r,t)=>{if(void 0===e[r].overloadTable){var o=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||Ne(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[o.argCount]=o}},Cr=(e,r,t)=>{n.hasOwnProperty(e)?((void 0===t||void 0!==n[e].overloadTable&&void 0!==n[e].overloadTable[t])&&Ne(`Cannot register public name '${e}' twice`),kr(n,e,e),n.hasOwnProperty(t)&&Ne(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),n[e].overloadTable[t]=r):(n[e]=r,void 0!==t&&(n[e].numArguments=t))};function _r(e,r,t,o,n,s,a,i){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=o,this.baseClass=n,this.getActualType=s,this.upcast=a,this.downcast=i,this.pureVirtualFunctions=[]}var Dr=(e,r,t)=>{for(;r!==t;)r.upcast||Ne(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Ar(e,r){if(null===r)return this.isReference&&Ne(`null is not a valid ${this.name}`),0;r.$$||Ne(`Cannot pass "${it(r)}" as a ${this.name}`),r.$$.ptr||Ne(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Dr(r.$$.ptr,t,this.registeredClass)}function Tr(e,r){var t;if(null===r)return this.isReference&&Ne(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r.$$||Ne(`Cannot pass "${it(r)}" as a ${this.name}`),r.$$.ptr||Ne(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Ne(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var o=r.$$.ptrType.registeredClass;if(t=Dr(r.$$.ptr,o,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Ne("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Ne(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var n=r.clone();t=this.rawShare(t,nt.toHandle((()=>n.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Ne("Unsupporting sharing policy")}return t}function Pr(e,r){if(null===r)return this.isReference&&Ne(`null is not a valid ${this.name}`),0;r.$$||Ne(`Cannot pass "${it(r)}" as a ${this.name}`),r.$$.ptr||Ne(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Ne(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return Dr(r.$$.ptr,t,this.registeredClass)}function Fr(e){return this.fromWireType(A[e>>2])}var $r=()=>{Object.assign(Rr.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor&&this.rawDestructor(e)},argPackAdvance:Xe,readValueFromPointer:Fr,deleteObject(e){null!==e&&e.delete()},fromWireType:mr})};function Rr(e,r,t,o,n,s,a,i,l,u,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=o,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=a,this.rawGetPointee=i,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=d,n||void 0!==r.baseClass?this.toWireType=Tr:o?(this.toWireType=Ar,this.destructorFunction=null):(this.toWireType=Pr,this.destructorFunction=null)}var Or,Mr,Ur=(e,r,t)=>{n.hasOwnProperty(e)||He("Replacing nonexistant public symbol"),void 0!==n[e].overloadTable&&void 0!==t?n[e].overloadTable[t]=r:(n[e]=r,n[e].argCount=t)},xr=(e,r,t)=>{var o=n["dynCall_"+e];return t&&t.length?o.apply(null,[r].concat(t)):o.call(null,r)},Wr=[],jr=e=>{var r=Wr[e];return r||(e>=Wr.length&&(Wr.length=e+1),Wr[e]=r=Or.get(e)),r},Br=(e,r,t)=>e.includes("j")?xr(e,r,t):jr(r).apply(null,t),Ir=(e,r)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),Br(e,r,t)}},Lr=(e,r)=>{var t=(e=Be(e)).includes("j")?Ir(e,r):jr(r);return"function"!=typeof t&&Ne(`unknown function pointer with signature ${e}: ${r}`),t},zr=(e,r)=>{var t=Sr(r,(function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t},Nr=e=>{var r=so(e),t=Be(r);return oo(r),t},Hr=(e,r)=>{var t=[],o={};throw r.forEach((function e(r){o[r]||Le[r]||(ze[r]?ze[r].forEach(e):(t.push(r),o[r]=!0))})),new Mr(`${e}: `+t.map(Nr).join([", "]))},qr=(e,r,t,o,n,s,a,i,l,u,d,c,f)=>{d=Be(d),s=Lr(n,s),i&&(i=Lr(a,i)),u&&(u=Lr(l,u)),f=Lr(c,f);var h=Er(d);Cr(h,(function(){Hr(`Cannot construct ${d} due to unbound types`,[o])})),qe([e,r,t],o?[o]:[],(function(r){var t,n;r=r[0],n=o?(t=r.registeredClass).instancePrototype:vr.prototype;var a=Sr(h,(function(){if(Object.getPrototypeOf(this)!==l)throw new Ue("Use 'new' to construct "+d);if(void 0===c.constructor_body)throw new Ue(d+" has no accessible constructor");var e=c.constructor_body[arguments.length];if(void 0===e)throw new Ue(`Tried to invoke ctor of ${d} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(c.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),l=Object.create(n,{constructor:{value:a}});a.prototype=l;var c=new _r(d,a,l,f,t,s,i,u);c.baseClass&&(void 0===c.baseClass.__derivedClasses&&(c.baseClass.__derivedClasses=[]),c.baseClass.__derivedClasses.push(c));var p=new Rr(d,c,!0,!1,!1),m=new Rr(d+"*",c,!1,!1,!1),g=new Rr(d+" const*",c,!1,!0,!1);return nr[e]={pointerType:m,constPointerType:g},Ur(h,a),[p,m,g]}))},Vr=(e,r)=>{for(var t=[],o=0;o<e;o++)t.push(A[r+4*o>>2]);return t},Gr=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function Jr(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=Sr(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var o=new t,n=e.apply(o,r);return n instanceof Object?n:o}function Xr(e,r,t,o,n,s){var a=r.length;a<2&&Ne("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var i=null!==r[1]&&null!==t,l=!1,u=1;u<r.length;++u)if(null!==r[u]&&void 0===r[u].destructorFunction){l=!0;break}var d="void"!==r[0].name,c="",f="";for(u=0;u<a-2;++u)c+=(0!==u?", ":"")+"arg"+u,f+=(0!==u?", ":"")+"arg"+u+"Wired";var h=`\n return function ${Er(e)}(${c}) {\n if (arguments.length !== ${a-2}) {\n throwBindingError('function ${e} called with ' + arguments.length + ' arguments, expected ${a-2}');\n }`;l&&(h+="var destructors = [];\n");var p=l?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],g=[Ne,o,n,Gr,r[0],r[1]];for(i&&(h+="var thisWired = classParam.toWireType("+p+", this);\n"),u=0;u<a-2;++u)h+="var arg"+u+"Wired = argType"+u+".toWireType("+p+", arg"+u+"); // "+r[u+2].name+"\n",m.push("argType"+u),g.push(r[u+2]);if(i&&(f="thisWired"+(f.length>0?", ":"")+f),h+=(d||s?"var rv = ":"")+"invoker(fn"+(f.length>0?", ":"")+f+");\n",l)h+="runDestructors(destructors);\n";else for(u=i?1:2;u<r.length;++u){var y=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==r[u].destructorFunction&&(h+=y+"_dtor("+y+"); // "+r[u].name+"\n",m.push(y+"_dtor"),g.push(r[u].destructorFunction))}return d&&(h+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),h+="}\n",m.push(h),Jr(Function,m).apply(null,g)}var Kr=(e,r,t,o,n,s)=>{var a=Vr(r,t);n=Lr(o,n),qe([],[e],(function(e){var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Ue(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{Hr(`Cannot construct ${e.name} due to unbound types`,a)},qe([],a,(o=>(o.splice(1,0,null),e.registeredClass.constructor_body[r-1]=Xr(t,o,null,n,s),[]))),[]}))},Zr=(e,r,t,o,n,s,a,i,l)=>{var u=Vr(t,o);r=Be(r),s=Lr(n,s),qe([],[e],(function(e){var o=`${(e=e[0]).name}.${r}`;function n(){Hr(`Cannot call ${o} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(r);var d=e.registeredClass.instancePrototype,c=d[r];return void 0===c||void 0===c.overloadTable&&c.className!==e.name&&c.argCount===t-2?(n.argCount=t-2,n.className=e.name,d[r]=n):(kr(d,r,o),d[r].overloadTable[t-2]=n),qe([],u,(function(n){var i=Xr(o,n,e,s,a,l);return void 0===d[r].overloadTable?(i.argCount=t-2,d[r]=i):d[r].overloadTable[t-2]=i,[]})),[]}))};function Qr(){Object.assign(Yr.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}})}function Yr(){this.allocated=[void 0],this.freelist=[]}var et=new Yr,rt=e=>{e>=et.reserved&&0==--et.get(e).refcount&&et.free(e)},tt=()=>{for(var e=0,r=et.reserved;r<et.allocated.length;++r)void 0!==et.allocated[r]&&++e;return e},ot=()=>{et.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),et.reserved=et.allocated.length,n.count_emval_handles=tt},nt={toValue:e=>(e||Ne("Cannot use deleted val. handle = "+e),et.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return et.allocate({refcount:1,value:e})}}};function st(e){return this.fromWireType(D[e>>2])}var at=(e,r)=>{Ge(e,{name:r=Be(r),fromWireType:e=>{var r=nt.toValue(e);return rt(e),r},toWireType:(e,r)=>nt.toHandle(r),argPackAdvance:Xe,readValueFromPointer:st,destructorFunction:null})},it=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},lt=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(T[e>>2])};case 8:return function(e){return this.fromWireType(P[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},ut=(e,r,t)=>{Ge(e,{name:r=Be(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:Xe,readValueFromPointer:lt(r,t),destructorFunction:null})},dt=(e,r,t)=>{switch(r){case 1:return t?e=>S[e>>0]:e=>k[e>>0];case 2:return t?e=>C[e>>1]:e=>_[e>>1];case 4:return t?e=>D[e>>2]:e=>A[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},ct=(e,r,t,o,n)=>{r=Be(r);var s=e=>e;if(0===o){var a=32-8*t;s=e=>e<<a>>>a}var i=r.includes("unsigned");Ge(e,{name:r,fromWireType:s,toWireType:i?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:Xe,readValueFromPointer:dt(r,t,0!==o),destructorFunction:null})},ft=(e,r,t)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function n(e){var r=A[e>>2],t=A[e+4>>2];return new o(S.buffer,t,r)}Ge(e,{name:t=Be(t),fromWireType:n,argPackAdvance:Xe,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},ht=(e,r,t)=>ge(e,k,r,t),pt=(e,r)=>{var t="std::string"===(r=Be(r));Ge(e,{name:r,fromWireType(e){var r,o=A[e>>2],n=e+4;if(t)for(var s=n,a=0;a<=o;++a){var i=n+a;if(a==o||0==k[i]){var l=Fe(s,i-s);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),s=i+1}}else{var u=new Array(o);for(a=0;a<o;++a)u[a]=String.fromCharCode(k[n+a]);r=u.join("")}return oo(e),r},toWireType(e,r){var o;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Ne("Cannot pass non-string to std::string"),o=t&&n?me(r):r.length;var s=io(4+o+1),a=s+4;if(A[s>>2]=o,t&&n)ht(r,a,o+1);else if(n)for(var i=0;i<o;++i){var l=r.charCodeAt(i);l>255&&(oo(a),Ne("String has UTF-16 code units that do not fit in 8 bits")),k[a+i]=l}else for(i=0;i<o;++i)k[a+i]=r[i];return null!==e&&e.push(oo,s),s},argPackAdvance:Xe,readValueFromPointer:Fr,destructorFunction(e){oo(e)}})},mt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,gt=(e,r)=>{for(var t=e,o=t>>1,n=o+r/2;!(o>=n)&&_[o];)++o;if((t=o<<1)-e>32&&mt)return mt.decode(k.subarray(e,t));for(var s="",a=0;!(a>=r/2);++a){var i=C[e+2*a>>1];if(0==i)break;s+=String.fromCharCode(i)}return s},yt=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<2)return 0;for(var o=r,n=(t-=2)<2*e.length?t/2:e.length,s=0;s<n;++s){var a=e.charCodeAt(s);C[r>>1]=a,r+=2}return C[r>>1]=0,r-o},vt=e=>2*e.length,wt=(e,r)=>{for(var t=0,o="";!(t>=r/4);){var n=D[e+4*t>>2];if(0==n)break;if(++t,n>=65536){var s=n-65536;o+=String.fromCharCode(55296|s>>10,56320|1023&s)}else o+=String.fromCharCode(n)}return o},bt=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<4)return 0;for(var o=r,n=o+t-4,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),D[r>>2]=a,(r+=4)+4>n)break}return D[r>>2]=0,r-o},Et=e=>{for(var r=0,t=0;t<e.length;++t){var o=e.charCodeAt(t);o>=55296&&o<=57343&&++t,r+=4}return r},St=(e,r,t)=>{var o,n,s,a,i;t=Be(t),2===r?(o=gt,n=yt,a=vt,s=()=>_,i=1):4===r&&(o=wt,n=bt,a=Et,s=()=>A,i=2),Ge(e,{name:t,fromWireType:e=>{for(var t,n=A[e>>2],a=s(),l=e+4,u=0;u<=n;++u){var d=e+4+u*r;if(u==n||0==a[d>>i]){var c=o(l,d-l);void 0===t?t=c:(t+=String.fromCharCode(0),t+=c),l=d+r}}return oo(e),t},toWireType:(e,o)=>{"string"!=typeof o&&Ne(`Cannot pass non-string to C++ string type ${t}`);var s=a(o),l=io(4+s+r);return A[l>>2]=s>>i,n(o,l+4,s+r),null!==e&&e.push(oo,l),l},argPackAdvance:Xe,readValueFromPointer:st,destructorFunction(e){oo(e)}})},kt=(e,r)=>{Ge(e,{isVoid:!0,name:r=Be(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},Ct={},_t=e=>{var r=Ct[e];return void 0===r?Be(e):r},Dt=[],At=(e,r,t,o)=>{(e=Dt[e])(r=nt.toValue(r),t=_t(t),null,o)},Tt=e=>{var r=Dt.length;return Dt.push(e),r},Pt=(e,r)=>{var t=Le[e];return void 0===t&&Ne(r+" has unknown type "+Nr(e)),t},Ft=(e,r)=>{for(var t=new Array(e),o=0;o<e;++o)t[o]=Pt(A[r+4*o>>2],"parameter "+o);return t},$t={},Rt=(e,r)=>{var t=Ft(e,r),o=t[0],n=o.name+"_$"+t.slice(1).map((function(e){return e.name})).join("_")+"$",s=$t[n];if(void 0!==s)return s;for(var a=["retType"],i=[o],l="",u=0;u<e-1;++u)l+=(0!==u?", ":"")+"arg"+u,a.push("argType"+u),i.push(t[1+u]);var d="return function "+Er("methodCaller_"+n)+"(handle, name, destructors, args) {\n",c=0;for(u=0;u<e-1;++u)d+=" var arg"+u+" = argType"+u+".readValueFromPointer(args"+(c?"+"+c:"")+");\n",c+=t[u+1].argPackAdvance;for(d+=" var rv = handle[name]("+l+");\n",u=0;u<e-1;++u)t[u+1].deleteObject&&(d+=" argType"+u+".deleteObject(arg"+u+");\n");o.isVoid||(d+=" return retType.toWireType(destructors, rv);\n"),d+="};\n",a.push(d);var f=Jr(Function,a).apply(null,i);return s=Tt(f),$t[n]=s,s},Ot=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,Mt=()=>{V("")},Ut=()=>Date.now(),xt=(e,r,t)=>k.copyWithin(e,r,r+t),Wt=e=>{V("OOM")},jt=e=>{k.length,Wt()},Bt={},It=()=>u||"./this.program",Lt=()=>{if(!Lt.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",_:It()};for(var r in Bt)void 0===Bt[r]?delete e[r]:e[r]=Bt[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Lt.strings=t}return Lt.strings},zt=(e,r)=>{for(var t=0;t<e.length;++t)S[r++>>0]=e.charCodeAt(t);S[r>>0]=0},Nt=(e,r)=>{var t=0;return Lt().forEach(((o,n)=>{var s=r+t;A[e+4*n>>2]=s,zt(o,s),t+=o.length+1})),0},Ht=(e,r)=>{var t=Lt();A[e>>2]=t.length;var o=0;return t.forEach((e=>o+=e.length+1)),A[r>>2]=o,0};function qt(e){try{var r=$e.getStreamFromFD(e);return Pe.close(r),0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}}function Vt(e,r){try{var t=$e.getStreamFromFD(e),o=t.tty?2:Pe.isDir(t.mode)?3:Pe.isLink(t.mode)?7:4;return S[r>>0]=o,C[r+2>>1]=0,X=[0,(J=0,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[r+8>>2]=X[0],D[r+12>>2]=X[1],X=[0,(J=0,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[r+16>>2]=X[0],D[r+20>>2]=X[1],0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}}var Gt=(e,r,t,o)=>{for(var n=0,s=0;s<t;s++){var a=A[r>>2],i=A[r+4>>2];r+=8;var l=Pe.read(e,S,a,i,o);if(l<0)return-1;if(n+=l,l<i)break;void 0!==o&&(o+=l)}return n};function Jt(e,r,t,o){try{var n=$e.getStreamFromFD(e),s=Gt(n,r,t);return A[o>>2]=s,0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}}function Xt(e,r,t,o,n){var s=Ot(r,t);try{if(isNaN(s))return 61;var a=$e.getStreamFromFD(e);return Pe.llseek(a,s,o),X=[a.position>>>0,(J=a.position,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],D[n>>2]=X[0],D[n+4>>2]=X[1],a.getdents&&0===s&&0===o&&(a.getdents=null),0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}}var Kt=(e,r,t,o)=>{for(var n=0,s=0;s<t;s++){var a=A[r>>2],i=A[r+4>>2];r+=8;var l=Pe.write(e,S,a,i,o);if(l<0)return-1;n+=l,void 0!==o&&(o+=l)}return n};function Zt(e,r,t,o){try{var n=$e.getStreamFromFD(e),s=Kt(n,r,t);return A[o>>2]=s,0}catch(e){if(void 0===Pe||"ErrnoError"!==e.name)throw e;return e.errno}}var Qt=function(e,r,t,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Pe.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=o},Yt=365,eo=146;Object.defineProperties(Qt.prototype,{read:{get:function(){return(this.mode&Yt)===Yt},set:function(e){e?this.mode|=Yt:this.mode&=~Yt}},write:{get:function(){return(this.mode&eo)===eo},set:function(e){e?this.mode|=eo:this.mode&=~eo}},isFolder:{get:function(){return Pe.isDir(this.mode)}},isDevice:{get:function(){return Pe.isChrdev(this.mode)}}}),Pe.FSNode=Qt,Pe.createPreloadedFile=De,Pe.staticInit(),je(),Ue=n.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},xe=n.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},yr(),dr(),$r(),Mr=n.UnboundTypeError=zr(Error,"UnboundTypeError"),Qr(),ot();var ro={p:ae,B:Re,v:Oe,t:We,n:Ke,r:qr,q:Kr,f:Zr,C:at,m:ut,c:ct,b:ft,l:pt,h:St,o:kt,d:At,i:rt,e:Rt,a:Mt,g:Ut,z:xt,u:jt,x:Nt,y:Ht,k:qt,w:Vt,A:Jt,s:Xt,j:Zt},to=oe(),oo=e=>(oo=to.F)(e),no=()=>(no=to.H)(),so=e=>(so=to.I)(e);n.__embind_initialize_bindings=()=>(n.__embind_initialize_bindings=to.J)();var ao,io=e=>(io=to.K)(e),lo=e=>(lo=to.M)(e);function uo(){function e(){ao||(ao=!0,n.calledRun=!0,F||(W(),t(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),j()))}z>0||(x(),z>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}if(n.dynCall_viiijj=(e,r,t,o,s,a,i,l)=>(n.dynCall_viiijj=to.N)(e,r,t,o,s,a,i,l),n.dynCall_jij=(e,r,t,o)=>(n.dynCall_jij=to.O)(e,r,t,o),n.dynCall_jii=(e,r,t)=>(n.dynCall_jii=to.P)(e,r,t),n.dynCall_jiji=(e,r,t,o,s)=>(n.dynCall_jiji=to.Q)(e,r,t,o,s),N=function e(){ao||uo(),ao||(N=e)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return uo(),e.ready});const o=1,n=2,s="fetch",a="websocket",i="debug",l="warn",u={playType:"player",container:"",videoBuffer:1e3,videoBufferDelay:1e3,networkDelay:1e4,isResize:!0,isFullResize:!1,isFlv:!1,isHls:!1,isFmp4:!1,isFmp4Private:!1,isWebrtc:!1,isWebrtcForZLM:!1,isWebrtcForSRS:!1,isWebrtcForOthers:!1,isNakedFlow:!1,isMpeg4:!1,isAliyunRtc:!1,isTs:!1,debug:!1,debugLevel:l,debugUuid:"",isMulti:!0,multiIndex:-1,hotKey:!1,loadingTimeout:10,heartTimeout:10,timeout:10,pageVisibilityHiddenTimeout:300,loadingTimeoutReplay:!0,heartTimeoutReplay:!0,loadingTimeoutReplayTimes:3,heartTimeoutReplayTimes:3,heartTimeoutReplayUseLastFrameShow:!0,replayUseLastFrameShow:!0,replayShowLoadingIcon:!1,supportDblclickFullscreen:!1,showBandwidth:!1,showPerformance:!1,mseCorrectTimeDuration:20,mseCorrectAudioTimeDuration:20,keepScreenOn:!0,isNotMute:!1,hasAudio:!0,hasVideo:!0,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,record:!1,ptz:!1,quality:!1,zoom:!1,close:!1,scale:!1,performance:!1,logSave:!1,aiFace:!1,aiObject:!1,aiOcclusion:!1,fullscreenFn:null,fullscreenExitFn:null,screenshotFn:null,playFn:null,pauseFn:null,recordFn:null,recordStopFn:null},extendOperateBtns:[],contextmenuBtns:[],watermarkConfig:{},controlAutoHide:!1,hasControl:!1,loadingIcon:!0,loadingIconStyle:{},loadingText:"",background:"",backgroundLoadingShow:!0,loadingBackground:"",loadingBackgroundWidth:0,loadingBackgroundHeight:0,decoder:"decoder-pro.js",decoderAudio:"decoder-pro-audio.js",decoderHard:"decoder-pro-hard.js",decoderHardNotWasm:"decoder-pro-hard-not-wasm.js",wasmMp4RecorderDecoder:"jessibuca-pro-mp4-recorder-decoder.js",decoderWASM:"",isDecoderUseCDN:!1,url:"",rotate:0,mirrorRotate:"none",aspectRatio:"default",playbackConfig:{playList:[],fps:"",showControl:!0,controlType:"normal",duration:0,startTime:"",showRateBtn:!1,rateConfig:[],showPrecision:"",showPrecisionBtn:!0,isCacheBeforeDecodeForFpsRender:!1,uiUsePlaybackPause:!1,isPlaybackPauseClearCache:!0,isUseFpsRender:!1,isUseLocalCalculateTime:!1,localOneFrameTimestamp:40,supportWheel:!1,useWCS:!1,useMSE:!1},qualityConfig:[],defaultStreamQuality:"",scaleConfig:["拉伸","缩放","正常"],forceNoOffscreen:!0,hiddenAutoPause:!1,protocol:n,demuxType:"flv",useWasm:!1,useMSE:!1,useWCS:!1,useSIMD:!0,useMThreading:!1,wcsUseVideoRender:!0,wcsUseWebgl2Render:!0,wasmUseVideoRender:!0,mseUseCanvasRender:!1,hlsUseCanvasRender:!1,webrtcUseCanvasRender:!1,useOffscreen:!1,useWebGPU:!1,mseDecodeErrorReplay:!0,wcsDecodeErrorReplay:!0,wasmDecodeErrorReplay:!0,simdDecodeErrorReplay:!0,simdDecodeErrorReplayType:"wasm",autoWasm:!0,decoderErrorAutoWasm:!0,hardDecodingNotSupportAutoWasm:!0,webglAlignmentErrorReplay:!0,webglContextLostErrorReplay:!0,openWebglAlignment:!1,syncAudioAndVideo:!0,syncAudioAndVideoDiff:400,playbackDelayTime:1e3,playbackFps:25,playbackForwardMaxRateDecodeIFrame:4,playbackCurrentTimeMove:!0,useVideoRender:!0,useCanvasRender:!1,networkDelayTimeoutReplay:!1,recordType:"mp4",checkFirstIFrame:!0,nakedFlowFps:25,audioEngine:null,isShowRecordingUI:!0,isShowZoomingUI:!0,useFaceDetector:!1,useObjectDetector:!1,useImageDetector:!1,useOcclusionDetector:!1,ptzPositionConfig:{},ptzShowType:"vertical",ptzClickType:"click",ptzStopEmitDelay:.3,ptzZoomShow:!1,ptzApertureShow:!1,ptzFocusShow:!1,ptzMoreArrowShow:!1,ptzCruiseShow:!1,ptzFogShow:!1,ptzWiperShow:!1,ptzSupportDraggable:!1,weiXinInAndroidAudioBufferSize:4800,isM7sCrypto:!1,m7sCryptoAudio:!1,isSm4Crypto:!1,isXorCrypto:!1,sm4CryptoKey:"",m7sCryptoKey:"",xorCryptoKey:"",cryptoKey:"",cryptoIV:"",cryptoKeyUrl:"",autoResize:!1,useWebFullScreen:!1,ptsMaxDiff:3600,aiFaceDetectLevel:2,aiFaceDetectWidth:240,aiFaceDetectShowRect:!0,aiFaceDetectInterval:1e3,aiFaceDetectRectConfig:{},aiObjectDetectLevel:2,aiObjectDetectWidth:240,aiObjectDetectShowRect:!0,aiObjectDetectInterval:1e3,aiObjectDetectRectConfig:{},aiOcclusionDetectInterval:1e3,aiImageDetectDrop:!1,aiImageDetectActive:!1,videoRenderSupportScale:!0,mediaSourceTsIsMaxDiffReplay:!0,controlHtml:"",isH265:!1,isWebrtcH265:!1,supportLockScreenPlayAudio:!0,supportHls265:!0,isEmitSEI:!1,pauseAndNextPlayUseLastFrameShow:!1,demuxUseWorker:!0,playFailedAndReplay:!0,showMessageConfig:{webglAlignmentError:"Webgl 渲染失败",webglContextLostError:"webgl 上下文丢失",mediaSourceH265NotSupport:"不支持硬解码H265",mediaSourceFull:"缓冲区已满",mediaSourceAppendBufferError:"初始化解码器失败",mseSourceBufferError:"解码失败",mseAddSourceBufferError:"初始化解码器失败",mediaSourceDecoderConfigurationError:"初始化解码器失败",mediaSourceTsIsMaxDiff:"流异常",mseWidthOrHeightChange:"流异常",mediaSourceAudioG711NotSupport:"硬解码不支持G711a/u音频格式",mediaSourceUseCanvasRenderPlayFailed:"MediaSource解码使用canvas渲染失败",webcodecsH265NotSupport:"不支持硬解码H265",webcodecsUnsupportedConfigurationError:"初始化解码器失败",webcodecsDecodeConfigureError:"初始化解码器失败",webcodecsDecodeError:"解码失败",wcsWidthOrHeightChange:"解码失败",wasmDecodeError:"解码失败",simdDecodeError:"解码失败",wasmWidthOrHeightChange:"流异常",wasmUseVideoRenderError:"video自动渲染失败",videoElementPlayingFailed:"video自动渲染失败",simdH264DecodeVideoWidthIsTooLarge:"不支持该分辨率的视频",networkDelayTimeout:"网络超时重播失败",fetchError:"请求失败",streamEnd:"请求结束",websocketError:"请求失败",webrtcError:"请求失败",hlsError:"请求失败",decoderWorkerInitError:"初始化worker失败",videoElementPlayingFailedForWebrtc:"video自动渲染失败",videoInfoError:"解析视频分辨率失败",webrtcStreamH265:"webrtc不支持H265",delayTimeout:"播放超时重播失败",loadingTimeout:"加载超时重播失败",loadingTimeoutRetryEnd:"加载超时重播失败",delayTimeoutRetryEnd:"播放超时重播失败"},videoElementPlayingFailedReplay:!0,mp4RecordUseWasm:!0,mseAutoCleanupSourceBuffer:!0,mseAutoCleanupMaxBackwardDuration:30,mseAutoCleanupMinBackwardDuration:10,widthOrHeightChangeReplay:!0,simdH264DecodeVideoWidthIsTooLargeReplay:!0,mediaSourceAudioG711NotSupportReplay:!0,mediaSourceAudioInitTimeoutReplay:!0,mediaSourceUseCanvasRenderPlayFailedReplay:!0,mediaSourceUseCanvasRenderPlayFailedReplayType:"video",widthOrHeightChangeReplayDelayTime:0,ghostWatermarkConfig:{on:5,off:5,content:"",fontSize:12,color:"white",opacity:.15,speed:.2},dynamicWatermarkConfig:{content:"",speed:.2,fontSize:12,color:"white",opacity:.15},isDropSameTimestampGop:!1,mseDecodeAudio:!0,nakedFlowH265DemuxUseNew:!0,extendDomConfig:{html:"",showBeforePlay:!1,showAfterLoading:!0},disableContextmenu:!1,websocket1006ErrorReplay:!0,websocket1006ErrorReplayDelayTime:0,streamErrorReplay:!1,streamErrorReplayDelayTime:0,streamEndReplay:!1,streamEndReplayDelayTime:0,mseDecoderUseWorker:!0,openMemoryLog:!0,mainThreadFetchUseWorker:!0,playFailedAndPausedShowPlayBtn:!0,mseCorrectionTimestamp:!0},d="init",c="playAudio",f="initAudio",h="audioCode",p="workerFetch",m="workerEnd",g="closeEnd",y=1,v=8,w="init",b="close",E="updateConfig",S="fetchStream",k="sendWsMessage",C="streamEnd",_="streamRate",D="streamAbps",A="streamSuccess",T="websocketOpen",P={playError:"playIsNotPauseOrUrlIsNull",fetchError:"fetchError",websocketError:"websocketError",webcodecsH265NotSupport:"webcodecsH265NotSupport",webcodecsDecodeError:"webcodecsDecodeError",webcodecsUnsupportedConfigurationError:"webcodecsUnsupportedConfigurationError",webcodecsDecodeConfigureError:"webcodecsDecodeConfigureError",mediaSourceH265NotSupport:"mediaSourceH265NotSupport",mediaSourceAudioG711NotSupport:"mediaSourceAudioG711NotSupport",mediaSourceAudioInitTimeout:"mediaSourceAudioInitTimeout",mediaSourceAudioNoDataTimeout:"mediaSourceAudioNoDataTimeout",mediaSourceDecoderConfigurationError:"mediaSourceDecoderConfigurationError",mediaSourceFull:"mseSourceBufferFull",mseSourceBufferError:"mseSourceBufferError",mseAddSourceBufferError:"mseAddSourceBufferError",mediaSourceAppendBufferError:"mediaSourceAppendBufferError",mediaSourceTsIsMaxDiff:"mediaSourceTsIsMaxDiff",mediaSourceUseCanvasRenderPlayFailed:"mediaSourceUseCanvasRenderPlayFailed",mediaSourceBufferedIsZeroError:"mediaSourceBufferedIsZeroError",wasmDecodeError:"wasmDecodeError",wasmUseVideoRenderError:"wasmUseVideoRenderError",hlsError:"hlsError",webrtcError:"webrtcError",webrtcClosed:"webrtcClosed",webrtcIceCandidateError:"webrtcIceCandidateError",webglAlignmentError:"webglAlignmentError",wasmWidthOrHeightChange:"wasmWidthOrHeightChange",mseWidthOrHeightChange:"mseWidthOrHeightChange",wcsWidthOrHeightChange:"wcsWidthOrHeightChange",widthOrHeightChange:"widthOrHeightChange",tallWebsocketClosedByError:"tallWebsocketClosedByError",flvDemuxBufferSizeTooLarge:"flvDemuxBufferSizeTooLarge",wasmDecodeVideoNoResponseError:"wasmDecodeVideoNoResponseError",audioChannelError:"audioChannelError",simdH264DecodeVideoWidthIsTooLarge:"simdH264DecodeVideoWidthIsTooLarge",simdDecodeError:"simdDecodeError",webglContextLostError:"webglContextLostError",videoElementPlayingFailed:"videoElementPlayingFailed",videoElementPlayingFailedForWebrtc:"videoElementPlayingFailedForWebrtc",decoderWorkerInitError:"decoderWorkerInitError",videoInfoError:"videoInfoError",videoCodecIdError:"videoCodecIdError",streamEnd:C,delayTimeout:"delayTimeout",loadingTimeout:"loadingTimeout",networkDelayTimeout:"networkDelayTimeout",aliyunRtcError:"aliyunRtcError",...{talkStreamError:"talkStreamError",talkStreamClose:"talkStreamClose"}},F=1,$=10,R=7,O=8,M=2,U="AbortError",x=0,W="idle",j="buffering",B="complete";var I,L,z=(I=function(e){!function(){var r="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=e.exports,o=function(){for(var e,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],o=0,n=t.length,s={};o<n;o++)if((e=t[o])&&e[1]in r){for(o=0;o<e.length;o++)s[t[0][o]]=e[o];return s}return!1}(),n={change:o.fullscreenchange,error:o.fullscreenerror},s={request:function(e,t){return new Promise(function(n,s){var a=function(){this.off("change",a),n()}.bind(this);this.on("change",a);var i=(e=e||r.documentElement)[o.requestFullscreen](t);i instanceof Promise&&i.then(a).catch(s)}.bind(this))},exit:function(){return new Promise(function(e,t){if(this.isFullscreen){var n=function(){this.off("change",n),e()}.bind(this);this.on("change",n);var s=r[o.exitFullscreen]();s instanceof Promise&&s.then(n).catch(t)}else e()}.bind(this))},toggle:function(e,r){return this.isFullscreen?this.exit():this.request(e,r)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,t){var o=n[e];o&&r.addEventListener(o,t,!1)},off:function(e,t){var o=n[e];o&&r.removeEventListener(o,t,!1)},raw:o};o?(Object.defineProperties(s,{isFullscreen:{get:function(){return Boolean(r[o.fullscreenElement])}},element:{enumerable:!0,get:function(){return r[o.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(r[o.fullscreenEnabled])}}}),t?e.exports=s:window.screenfull=s):t?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()},I(L={exports:{}},L.exports),L.exports);function N(e){return function(e){return e[0]>>4===$}(e)&&e[1]===x}function H(){return performance&&"function"==typeof performance.now?performance.now():Date.now()}function q(e){let r=0,t=H();return o=>{if(n=o,"[object Number]"!==Object.prototype.toString.call(n))return;var n;r+=o;const s=H(),a=s-t;a>=1e3&&(e(r/a*1e3),t=s,r=0)}}z.isEnabled,(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){}})();function V(){return"undefined"!=typeof WritableStream}function G(e){return e.ok&&e.status>=200&&e.status<=299}function J(){return function(e){let r="";if("object"==typeof e)try{r=JSON.stringify(e),r=JSON.parse(r)}catch(t){r=e}else r=e;return r}(u)}function X(e){return!0===e||"true"===e}function K(e){return!0!==e&&"true"!==e}var Z=function(e,r,t,o){return new(t||(t=Promise))((function(n,s){function a(e){try{l(o.next(e))}catch(e){s(e)}}function i(e){try{l(o.throw(e))}catch(e){s(e)}}function l(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,i)}l((o=o.apply(e,r||[])).next())}))};const Q=Symbol(32),Y=Symbol(16),ee=Symbol(8);class re{constructor(e){this.g=e,this.consumed=0,e&&(this.need=e.next().value)}setG(e){this.g=e,this.demand(e.next().value,!0)}consume(){this.buffer&&this.consumed&&(this.buffer.copyWithin(0,this.consumed),this.buffer=this.buffer.subarray(0,this.buffer.length-this.consumed),this.consumed=0)}demand(e,r){return r&&this.consume(),this.need=e,this.flush()}read(e){return Z(this,void 0,void 0,(function*(){return this.lastReadPromise&&(yield this.lastReadPromise),this.lastReadPromise=new Promise(((r,t)=>{var o;this.reject=t,this.resolve=e=>{delete this.lastReadPromise,delete this.resolve,delete this.need,r(e)};this.demand(e,!0)||null===(o=this.pull)||void 0===o||o.call(this,e)}))}))}readU32(){return this.read(Q)}readU16(){return this.read(Y)}readU8(){return this.read(ee)}close(){var e;this.g&&this.g.return(),this.buffer&&this.buffer.subarray(0,0),null===(e=this.reject)||void 0===e||e.call(this,new Error("EOF")),delete this.lastReadPromise}flush(){if(!this.buffer||!this.need)return;let e=null;const r=this.buffer.subarray(this.consumed);let t=0;const o=e=>r.length<(t=e);if("number"==typeof this.need){if(o(this.need))return;e=r.subarray(0,t)}else if(this.need===Q){if(o(4))return;e=r[0]<<24|r[1]<<16|r[2]<<8|r[3]}else if(this.need===Y){if(o(2))return;e=r[0]<<8|r[1]}else if(this.need===ee){if(o(1))return;e=r[0]}else if("buffer"in this.need){if("byteOffset"in this.need){if(o(this.need.byteLength-this.need.byteOffset))return;new Uint8Array(this.need.buffer,this.need.byteOffset).set(r.subarray(0,t)),e=this.need}else if(this.g)return void this.g.throw(new Error("Unsupported type"))}else{if(o(this.need.byteLength))return;new Uint8Array(this.need).set(r.subarray(0,t)),e=this.need}return this.consumed+=t,this.g?this.demand(this.g.next(e).value,!0):this.resolve&&this.resolve(e),e}write(e){if(e instanceof Uint8Array?this.malloc(e.length).set(e):"buffer"in e?this.malloc(e.byteLength).set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):this.malloc(e.byteLength).set(new Uint8Array(e)),!this.g&&!this.resolve)return new Promise((e=>this.pull=e));this.flush()}writeU32(e){this.malloc(4).set([e>>24&255,e>>16&255,e>>8&255,255&e]),this.flush()}writeU16(e){this.malloc(2).set([e>>8&255,255&e]),this.flush()}writeU8(e){this.malloc(1)[0]=e,this.flush()}malloc(e){if(this.buffer){const r=this.buffer.length,t=r+e;if(t<=this.buffer.buffer.byteLength-this.buffer.byteOffset)this.buffer=new Uint8Array(this.buffer.buffer,this.buffer.byteOffset,t);else{const e=new Uint8Array(t);e.set(this.buffer),this.buffer=e}return this.buffer.subarray(r,t)}return this.buffer=new Uint8Array(e),this.buffer}}re.U32=Q,re.U16=Y,re.U8=ee;class te{constructor(e){this.log=function(r){if(e._opt.debug&&e._opt.debugLevel==i){const s=e._opt.debugUuid?`[${e._opt.debugUuid}]`:"";for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];console.log(`JbPro${s}[✅✅✅][${r}]`,...o)}},this.warn=function(r){if(e._opt.debug&&(e._opt.debugLevel==i||e._opt.debugLevel==l)){const s=e._opt.debugUuid?`[${e._opt.debugUuid}]`:"";for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];console.log(`JbPro${s}[❗❗❗][${r}]`,...o)}},this.error=function(r){const t=e._opt.debugUuid?`[${e._opt.debugUuid}]`:"";for(var o=arguments.length,n=new Array(o>1?o-1:0),s=1;s<o;s++)n[s-1]=arguments[s];console.error(`JbPro${t}[❌❌❌][${r}]`,...n)}}}const oe={init:0,findFirstStartCode:1,findSecondStartCode:2};class ne extends class{on(e,r,t){const o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:r,ctx:t}),this}once(e,r,t){const o=this;function n(){o.off(e,n);for(var s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];r.apply(t,a)}return n._=r,this.on(e,n,t)}emit(e){const r=((this.e||(this.e={}))[e]||[]).slice();for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];for(let e=0;e<r.length;e+=1)r[e].fn.apply(r[e].ctx,o);return this}off(e,r){const t=this.e||(this.e={});if(!e)return Object.keys(t).forEach((e=>{delete t[e]})),void delete this.e;const o=t[e],n=[];if(o&&r)for(let e=0,t=o.length;e<t;e+=1)o[e].fn!==r&&o[e].fn._!==r&&n.push(o[e]);return n.length?t[e]=n:delete t[e],this}}{constructor(e){super(),this.player=e,this.isDestroyed=!1,this.reset()}destroy(){this.isDestroyed=!1,this.off(),this.reset()}reset(){this.stats=oe.init,this.tempBuffer=new Uint8Array(0),this.parsedOffset=0,this.versionLayer=0}dispatch(e,r){let t=new Uint8Array(this.tempBuffer.length+e.length);for(t.set(this.tempBuffer,0),t.set(e,this.tempBuffer.length),this.tempBuffer=t;!this.isDestroyed;){if(this.state==oe.Init){let e=!1;for(;this.tempBuffer.length-this.parsedOffset>=2&&!this.isDestroyed;)if(255==this.tempBuffer[this.parsedOffset]){if(!(!1&this.tempBuffer[this.parsedOffset+1])){this.versionLayer=this.tempBuffer[this.parsedOffset+1],this.state=oe.findFirstStartCode,this.fisrtStartCodeOffset=this.parsedOffset,this.parsedOffset+=2,e=!0;break}this.parsedOffset++}else this.parsedOffset++;if(e)continue;break}if(this.state==oe.findFirstStartCode){let e=!1;for(;this.tempBuffer.length-this.parsedOffset>=2&&!this.isDestroyed;)if(255==this.tempBuffer[this.parsedOffset]){if(this.tempBuffer[this.parsedOffset+1]==this.versionLayer){this.state=oe.findSecondStartCode,this.secondStartCodeOffset=this.parsedOffset,this.parsedOffset+=2,e=!0;break}this.parsedOffset++}else this.parsedOffset++;if(e)continue;break}if(this.state==oe.findSecondStartCode){let e=this.tempBuffer.slice(this.fisrtStartCodeOffset,this.secondStartCodeOffset);this.emit("data",e,r),this.tempBuffer=this.tempBuffer.slice(this.secondStartCodeOffset),this.fisrtStartCodeOffset=0,this.parsedOffset=2,this.state=oe.findFirstStartCode}}}}function se(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],i=[],l=new AbortController,u=null,x=null,I=null,L=!1,z=[],H=0,Z=0,Q=null,Y=null,ee=!1;const oe="audio worker";let se=()=>{const e=J();return{debug:e.debug,debugLevel:e.debugLevel,sampleRate:0,audioBufferSize:1024,videoBuffer:e.videoBuffer,isChrome:!1}},ae=function(){if(ee=!0,ie.fetchStatus!==j||K(ie._opt.isChrome)){if(l)try{l.abort(),l=null}catch(e){ie.debug.log(oe,"abort catch",e)}}else l=null,ie.debug.log(oe,`abort() and not abortController.abort() _status is ${ie.fetchStatus} and _isChrome is ${ie._opt.isChrome}`)},ie={isDestroyed:!1,fetchStatus:W,_opt:se(),mp3Demuxer:null,init:function(){ie.debug.log(oe,"init and opt is",ie._opt);ie.stopId=setInterval((()=>{let e=(new Date).getTime();Q||(Q=e);const r=e-Q;r>100&&ie.debug.warn(oe,`loop demux diff time is ${r}`),(()=>{let e=null;if(t.length)if(e=t[0],-1===ie.getDelay(e.ts))t.shift(),ie.doDecode(e);else for(;t.length;){if(e=t[0],!(ie.getDelay(e.ts)>ie._opt.videoBuffer)){ie.delay<0&&ie.debug.warn(oe,`loop() do not decode and delay is ${ie.delay}, bufferList is ${t.length}`);break}t.shift(),ie.doDecode(e)}else-1!==ie.delay&&ie.debug.log(oe,"loop() bufferList is empty and reset delay"),ie.resetAllDelay()})(),Q=(new Date).getTime()}),10)},doDecode:function(e){e.decoder.decode(e.payload,e.ts,e.isIFrame,e.cts)},getDelay:function(e){if(!e)return-1;if(ie.preDelayTimestamp&&ie.preDelayTimestamp>e)return ie.preDelayTimestamp-e>1e3&&ie.debug.warn(oe,`getDelay() and preDelayTimestamp is ${ie.preDelayTimestamp} > timestamp is ${e} more than ${ie.preDelayTimestamp-e}ms`),ie.preDelayTimestamp=e,ie.delay;if(ie.firstTimestamp){if(e){const r=Date.now()-ie.startTimestamp,t=e-ie.firstTimestamp;ie.delay=r>=t?r-t:t-r}}else ie.firstTimestamp=e,ie.startTimestamp=Date.now(),ie.delay=-1;return ie.preDelayTimestamp=e,ie.delay},resetAllDelay:function(){ie.firstTimestamp=null,ie.startTimestamp=null,ie.delay=-1,ie.preDelayTimestamp=null},close:function(){if(ie.debug.log(oe,"close"),ie.isDestroyed=!0,ae(),!u||1!==u.readyState&&2!==u.readyState?u&&ie.debug.log(oe,`close() and socket.readyState is ${u.readyState}`):(ee=!0,u.close(1e3,"Client disconnecting")),u=null,ie.stopId&&(clearInterval(ie.stopId),ie.stopId=null),ie.mp3Demuxer&&(ie.mp3Demuxer.destroy(),ie.mp3Demuxer=null),ie.writableStream&&K(ie.writableStream.locked)&&ie.writableStream.close().catch((()=>{ie.debug.log("worker","close() and writableStream.close() error",e)})),ie.writableStream=null,le)try{le.clear&&le.clear(),le=null}catch(e){ie.debug.warn(oe,"close() and audioDecoder.clear error",e)}x=null,ie._opt=se(),t=[],i=[],I=null,ie.resetAllDelay(),ie.fetchStatus=W,L=!1,z=[],H=0,Z=0,Q=null,Y=null,postMessage({cmd:g})},fetchStream:function(e,r){ie.debug.log(oe,"fetchStream, url is "+e,"options:",JSON.stringify(r)),x=q((e=>{postMessage({cmd:p,type:_,value:e})})),r.protocol===n?(I=new re(ie.demuxFlv()),fetch(e,{signal:l.signal}).then((e=>{if(ee)return ie.debug.log(oe,"request abort and run res.body.cancel()"),ie.fetchStatus=W,void e.body.cancel();if(!G(e))return ie.debug.warn(oe,`fetch response status is ${e.status} and ok is ${e.ok} and emit error and next abort()`),ae(),void postMessage({cmd:p,type:P.fetchError,value:`fetch response status is ${e.status} and ok is ${e.ok}`});if(postMessage({cmd:p,type:A}),V())ie.writableStream=new WritableStream({write:e=>l&&l.signal&&l.signal.aborted?(ie.debug.log(oe,"writableStream write() and abortController.signal.aborted is true so return"),void(ie.fetchStatus=B)):X(ee)?(ie.debug.log(oe,"writableStream write() and requestAbort is true so return"),void(ie.fetchStatus=B)):(ie.fetchStatus=j,x(e.byteLength),void I.write(e)),close:()=>{ie.fetchStatus=B,I=null,ae(),postMessage({cmd:p,type:C,value:s,msg:"fetch done"})},abort:e=>{if(l&&l.signal&&l.signal.aborted)return ie.debug.log(oe,"writableStream abort() and abortController.signal.aborted is true so return"),void(ie.fetchStatus=B);I=null,e.name!==U&&(ae(),postMessage({cmd:p,type:P.fetchError,value:e.toString()}))}}),e.body.pipeTo(ie.writableStream);else{const r=e.body.getReader(),t=()=>{r.read().then((e=>{let{done:r,value:o}=e;return r?(ie.fetchStatus=B,I=null,ae(),void postMessage({cmd:p,type:C,value:s,msg:"fetch done"})):l&&l.signal&&l.signal.aborted?(ie.debug.log(oe,"fetchNext().then() and abortController.signal.aborted is true so return"),void(ie.fetchStatus=B)):X(ee)?(ie.debug.log(oe,"fetchNext().then() and requestAbort is true so return"),void(ie.fetchStatus=B)):(ie.fetchStatus=j,x(o.byteLength),I.write(o),void t())})).catch((e=>{if(l&&l.signal&&l.signal.aborted)return ie.debug.log(oe,"fetchNext().catch() and abortController.signal.aborted is true so return"),void(ie.fetchStatus=B);I=null,e.name!==U&&(ae(),postMessage({cmd:p,type:P.fetchError,value:e.toString()}))}))};t()}})).catch((e=>{l&&l.signal&&l.signal.aborted?ie.debug.log(oe,"fetch().catch() and abortController.signal.aborted is true so return"):e.name!==U&&(ae(),postMessage({cmd:p,type:P.fetchError,value:e.toString()}),I=null)}))):r.protocol===o&&(r.isFlv&&(I=new re(ie.demuxFlv())),u=new WebSocket(e),u.binaryType="arraybuffer",u.onopen=()=>{ie.debug.log(oe,"fetchStream, WebsocketStream socket open"),postMessage({cmd:p,type:A}),postMessage({cmd:p,type:T})},u.onclose=e=>{ie.debug.log(oe,`fetchStream, WebsocketStream socket close and code is ${e.code}`),1006===e.code&&ie.debug.error(oe,`fetchStream, WebsocketStream socket close abnormally and code is ${e.code}`),X(ee)?ie.debug.log(oe,"fetchStream, WebsocketStream socket close and requestAbort is true so return"):(I=null,postMessage({cmd:p,type:C,value:a,msg:e.code}))},u.onerror=e=>{ie.debug.error(oe,"fetchStream, WebsocketStream socket error",e),I=null,postMessage({cmd:p,type:P.websocketError,value:e.isTrusted?"websocket user aborted":"websocket error"})},u.onmessage=e=>{x(e.data.byteLength),r.isFlv?I.write(e.data):ie.demuxM7s(e.data)})},demuxFlv:function*(){yield 9;const e=new ArrayBuffer(4),r=new Uint8Array(e),t=new Uint32Array(e);for(;;){r[3]=0;const e=yield 15,o=e[4];r[0]=e[7],r[1]=e[6],r[2]=e[5];const n=t[0];r[0]=e[10],r[1]=e[9],r[2]=e[8],r[3]=e[11];let s=t[0];const a=(yield n).slice();if(o===v)ie.decode(a,{type:y,ts:s})}},decode:function(e,r){postMessage({cmd:p,type:D,value:e.byteLength}),ie.pushBuffer(e,r.ts)},setCodecAudio:function(e,r){const t=e[0]>>4,o=e[0]>>1&1;if(Y=t===$?o?16:8:0===o?8:16,le&&le.setCodec)if(N(e)||t===R||t===O||t===M){ie.debug.log(oe,`setCodecAudio: init audio codec, codeId is ${t}`);const o=t===$?e.slice(2):new Uint8Array(0);le.setCodec(t,ie._opt.sampleRate,o),L=!0,t!==$&&(t===M?(ie.mp3Demuxer||(ie.mp3Demuxer=new ne(ie),ie.mp3Demuxer.on("data",((e,r)=>{le.decode(e,r)}))),ie.mp3Demuxer.dispatch(e.slice(1),r)):le.decode(e.slice(1),r));{const e=Number("1")||1;setTimeout((()=>{ie.debug.error(oe,"Jb pro 体验结束,请刷新页面再次体验(wasm内部会暂停解码),如需要购买商业授权,可以联系微信:bosswancheng"),ie.close(),postMessage({cmd:m})}),60*e*60*1e3)}}else ie.debug.warn(oe,"setCodecAudio: hasInitAudioCodec is false, codecId is ",t);else ie.debug.error(oe,"setCodecAudio: audioDecoder or audioDecoder.setCodec is null")},pushBuffer:function(e,r){N(e)?ie.decodeAudio(e,r):t.push({ts:r,payload:e,decoder:{decode:ie.decodeAudio},isIFrame:!1})},decodeAudio:function(e,r){const t=e[0]>>4;L?t===M?ie.mp3Demuxer.dispatch(e.slice(1),r):le.decode(t===$?e.slice(2):e.slice(1),r):ie.setCodecAudio(e)},demuxM7s:function(e){const r=new DataView(e),t=r.getUint32(1,!1);if(r.getUint8(0)===y)ie.decode(new Uint8Array(e,5),{type:y,ts:t})},audioInfo:function(e,r,t){postMessage({cmd:h,code:e}),postMessage({cmd:f,sampleRate:r,channels:t,depth:Y}),Z=t},pcmData:function(e,t,o){if(ie.isDestroyed)return void ie.debug.log(oe,"pcmData, decoder is destroyed and return");let n=t,s=[],a=0,l=ie._opt.audioBufferSize;for(let t=0;t<2;t++){let o=r.HEAPU32[(e>>2)+t]>>2;s[t]=r.HEAPF32.subarray(o,o+n)}if(H){if(!(n>=(t=l-H)))return H+=n,i[0]=Float32Array.of(...i[0],...s[0]),void(2==Z&&(i[1]=Float32Array.of(...i[1],...s[1])));z[0]=Float32Array.of(...i[0],...s[0].subarray(0,t)),2==Z&&(z[1]=Float32Array.of(...i[1],...s[1].subarray(0,t))),postMessage({cmd:c,buffer:z,delay:ie.delay,ts:o},z.map((e=>e.buffer))),a=t,n-=t}for(H=n;H>=l;H-=l)z[0]=s[0].slice(a,a+=l),2==Z&&(z[1]=s[1].slice(a-l,a)),postMessage({cmd:c,buffer:z,delay:ie.delay,ts:o},z.map((e=>e.buffer)));H&&(i[0]=s[0].slice(a),2==Z&&(i[1]=s[1].slice(a)))},sendWebsocketMessage:function(e){u?u.readyState===F?u.send(e):ie.debug.error(oe,"socket is not open"):ie.debug.error(oe,"socket is null")},timeEnd:function(){ie.debug.error(oe,"Jb pro 体验结束,请刷新页面再次体验(wasm内部会暂停解码),如需要购买商业授权,可以联系微信:bosswancheng"),ie.close(),postMessage({cmd:m})}};ie.debug=new te(ie);let le=null;r.AudioDecoder&&(le=new r.AudioDecoder(ie)),postMessage({cmd:d}),self.onmessage=function(e){let r=e.data;switch(r.cmd){case w:try{ie._opt=Object.assign(ie._opt,JSON.parse(r.opt))}catch(e){}ie.init();break;case S:ie.fetchStream(r.url,JSON.parse(r.opt));break;case b:ie.close();break;case E:ie.debug.log(oe,"updateConfig",r.key,r.value),ie._opt[r.key]=r.value;break;case k:ie.sendWebsocketMessage(r.message)}}}Date.now||(Date.now=function(){return(new Date).getTime()}),t({printErr:function(e){console.warn("JbPro[❌❌❌][worker]:",e)}}).then((e=>{se(e)}))}));