@vkontakte/calls-audio-effects 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/audio-effects.cjs.js +4 -4
- package/audio-effects.esm.js +4 -4
- package/package.json +1 -1
package/audio-effects.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/calls-audio-effects v1.1.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-audio-effects v1.1.5
|
|
3
|
+
* Fri, 12 Jul 2024 14:28:41 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
"use strict";var pa=Object.create;var ar=Object.defineProperty;var ha=Object.getOwnPropertyDescriptor;var ma=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,ga=Object.prototype.hasOwnProperty;var ya=Reflect.get;var wa=(F,g)=>()=>(g||F((g={exports:{}}).exports,g),g.exports),_a=(F,g)=>{for(var h in g)ar(F,h,{get:g[h],enumerable:!0})},At=(F,g,h,E)=>{if(g&&typeof g=="object"||typeof g=="function")for(let u of ma(g))!ga.call(F,u)&&u!==h&&ar(F,u,{get:()=>g[u],enumerable:!(E=ha(g,u))||E.enumerable});return F};var Pt=(F,g,h)=>(h=F!=null?pa(bt(F)):{},At(g||!F||!F.__esModule?ar(h,"default",{value:F,enumerable:!0}):h,F)),Ea=F=>At(ar({},"__esModule",{value:!0}),F);var le=(F,g,h)=>ya(bt(F),h,g);var Z=(F,g,h)=>new Promise((E,u)=>{var I=G=>{try{K(h.next(G))}catch(J){u(J)}},V=G=>{try{K(h.throw(G))}catch(J){u(J)}},K=G=>G.done?E(G.value):Promise.resolve(G.value).then(I,V);K((h=h.apply(F,g)).next())});var Sr=wa((Ft,Fr)=>{var Tr=(()=>{var g;var F=typeof document!="undefined"?(g=document.currentScript)==null?void 0:g.src:void 0;return function(h={}){var E,u=h,I,V,K=new Promise((e,r)=>{I=e,V=r}),G=typeof window=="object",J=typeof importScripts=="function",Or=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD,r=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(e||r)return;function t(n){var o="";typeof window=="object"?o=window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process=="undefined"&&typeof location!="undefined"&&(o=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"));var i="wasm_bindings.data",s="wasm_bindings.data";typeof u.locateFilePackage=="function"&&!u.locateFile&&(u.locateFile=u.locateFilePackage,z("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var l=u.locateFile?u.locateFile(s,""):s,f=n.remote_package_size;function d(y,P,R,S){var b=new XMLHttpRequest;b.open("GET",y,!0),b.responseType="arraybuffer",b.onprogress=function(A){var Et,kt;var M=y,D=P;if(A.total&&(D=A.total),A.loaded){b.addedTotal?u.dataFileDownloads[M].loaded=A.loaded:(b.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[M]={loaded:A.loaded,total:D});var x=0,O=0,Ne=0;for(var xe in u.dataFileDownloads){var Ue=u.dataFileDownloads[xe];x+=Ue.total,O+=Ue.loaded,Ne++}x=Math.ceil(x*u.expectedDataFileDownloads/Ne),(Et=u.setStatus)==null||Et.call(u,`Downloading data... (${O}/${x})`)}else u.dataFileDownloads||(kt=u.setStatus)==null||kt.call(u,"Downloading data...")},b.onerror=function(A){throw new Error("NetworkError for: "+y)},b.onload=function(A){if(b.status==200||b.status==304||b.status==206||b.status==0&&b.response){var M=b.response;R(M)}else throw new Error(b.statusText+" : "+b.responseURL)},b.send(null)}function c(y){console.error("package error:",y)}var m=null,v=u.getPreloadedPackage?u.getPreloadedPackage(l,f):null;v||d(l,f,function(y){m?(m(y),m=null):v=y},c);function p(y){function P(M,D){if(!M)throw D+new Error().stack}function R(M,D,x){this.start=M,this.end=D,this.audio=x}R.prototype={requests:{},open:function(M,D){this.name=D,this.requests[D]=this,y.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var M=this.byteArray.subarray(this.start,this.end);this.finish(M)},finish:function(M){var D=this;y.FS_createDataFile(this.name,null,M,!0,!0,!0),y.removeRunDependency(`fp ${D.name}`),this.requests[this.name]=null}};for(var S=n.files,b=0;b<S.length;++b)new R(S[b].start,S[b].end,S[b].audio||0).open("GET",S[b].filename);function A(M){P(M,"Loading data file failed."),P(M.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var D=new Uint8Array(M);R.prototype.byteArray=D;for(var x=n.files,O=0;O<x.length;++O)R.prototype.requests[x[O].filename].onload();y.removeRunDependency("datafile_wasm_bindings.data")}y.addRunDependency("datafile_wasm_bindings.data"),y.preloadResults||(y.preloadResults={}),y.preloadResults[i]={fromCache:!1},v?(A(v),v=null):m=A}u.calledRun?p(u):(u.preRun||(u.preRun=[]),u.preRun.push(p))}t({files:[{filename:"/animoji_v4.cfg",start:0,end:333},{filename:"/balloon.cfg",start:333,end:409},{filename:"/cathedral.cfg",start:409,end:586},{filename:"/chorus.cfg",start:586,end:865},{filename:"/denoise.cfg",start:865,end:3258},{filename:"/df2_lstm_full_silent.tflite",start:3258,end:3169978},{filename:"/distortion.cfg",start:3169978,end:3170120},{filename:"/echo.cfg",start:3170120,end:3170257},{filename:"/evil.cfg",start:3170257,end:3170398},{filename:"/giant.cfg",start:3170398,end:3170474},{filename:"/hall.cfg",start:3170474,end:3170647},{filename:"/phaser.cfg",start:3170647,end:3170747},{filename:"/robot.cfg",start:3170747,end:3170887},{filename:"/squirell.cfg",start:3170887,end:3170963},{filename:"/wav2lip_lite_rec-v4-v2.tflite",start:3170963,end:7456043}],remote_package_size:7456043})})();var He=null,L=Object.assign({},u),Wr=[],me="./this.program",Ce=(e,r)=>{throw r},X="";function fe(e){return u.locateFile?u.locateFile(e,X):X+e}var ge,Y;(G||J)&&(J?X=self.location.href:typeof document!="undefined"&&document.currentScript&&(X=document.currentScript.src),He&&(X=He),X.startsWith("blob:")?X="":X=X.substr(0,X.replace(/[?#].*/,"").lastIndexOf("/")+1),J&&(Y=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ge=e=>fetch(e,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var ae=u.print||console.log.bind(console),z=u.printErr||console.error.bind(console);Object.assign(u,L),L=null,u.arguments&&(Wr=u.arguments),u.thisProgram&&(me=u.thisProgram),u.quit&&(Ce=u.quit);var Te;u.wasmBinary&&(Te=u.wasmBinary);var ze,sr=!1,lr,U,H,ee,Be,w,T,jr,Ir;function Nr(){var e=ze.buffer;u.HEAP8=U=new Int8Array(e),u.HEAP16=ee=new Int16Array(e),u.HEAPU8=H=new Uint8Array(e),u.HEAPU16=Be=new Uint16Array(e),u.HEAP32=w=new Int32Array(e),u.HEAPU32=T=new Uint32Array(e),u.HEAPF32=jr=new Float32Array(e),u.HEAPF64=Ir=new Float64Array(e)}var xr=[],Ur=[],Lr=[],Rt=!1;function $t(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Wt(u.preRun.shift());dr(xr)}function Mt(){Rt=!0,!u.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,ie.init(),dr(Ur)}function Ot(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)It(u.postRun.shift());dr(Lr)}function Wt(e){xr.unshift(e)}function jt(e){Ur.unshift(e)}function It(e){Lr.unshift(e)}var de=0,ur=null,Fe=null;function Pa(e){return e}function Ve(e){var r;de++,(r=u.monitorRunDependencies)==null||r.call(u,de)}function Se(e){var t;if(de--,(t=u.monitorRunDependencies)==null||t.call(u,de),de==0&&(ur!==null&&(clearInterval(ur),ur=null),Fe)){var r=Fe;Fe=null,r()}}function fr(e){var t;(t=u.onAbort)==null||t.call(u,e),e="Aborted("+e+")",z(e),sr=!0,lr=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw V(r),r}var Nt="data:application/octet-stream;base64,",Hr=e=>e.startsWith(Nt);function xt(){var e="wasm_bindings.wasm";return Hr(e)?e:fe(e)}var qe;function zr(e){if(e==qe&&Te)return new Uint8Array(Te);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}function Ut(e){return Te?Promise.resolve().then(()=>zr(e)):ge(e).then(r=>new Uint8Array(r),()=>zr(e))}function Br(e,r,t){return Ut(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{z(`failed to asynchronously prepare wasm: ${n}`),fr(n)})}function Lt(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Hr(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,t);return i.then(n,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),Br(r,t,n)})}):Br(r,t,n)}function Ht(){return{a:ta}}function zt(){var e=Ht();function r(n,o){return N=n.exports,ze=N.Z,Nr(),st=N.aa,jt(N._),Se("wasm-instantiate"),N}Ve("wasm-instantiate");function t(n){r(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(n){z(`Module.instantiateWasm callback failed with error: ${n}`),V(n)}return qe||(qe=xt()),Lt(Te,qe,e,t).catch(V),{}}var _,W;function Bt(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var dr=e=>{for(;e.length>0;)e.shift()(u)},Vt=u.noExitRuntime||!0;class qt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){T[this.ptr+4>>2]=r}get_type(){return T[this.ptr+4>>2]}set_destructor(r){T[this.ptr+8>>2]=r}get_destructor(){return T[this.ptr+8>>2]}set_caught(r){r=r?1:0,U[this.ptr+12]=r}get_caught(){return U[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,U[this.ptr+13]=r}get_rethrown(){return U[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){T[this.ptr+16>>2]=r}get_adjusted_ptr(){return T[this.ptr+16>>2]}get_exception_ptr(){var r=wt(this.get_type());if(r)return T[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Vr=0,Gt=0,Xt=(e,r,t)=>{var n=new qt(e);throw n.init(r,t),Vr=e,Gt++,Vr};function Ge(){var e=w[+j.varargs>>2];return j.varargs+=4,e}var ye=Ge,$={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];o==="."?e.splice(n,1):o===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=$.isAbs(e),t=e.substr(-1)==="/";return e=$.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=$.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=$.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>$.normalize(e.join("/")),join2:(e,r)=>$.normalize(e+"/"+r)},Kt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);fr("initRandomDevice")},qr=e=>(qr=Kt())(e),re={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=$.isAbs(o)}return r=$.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=re.resolve(e).substr(1),r=re.resolve(r).substr(1);function t(d){for(var c=0;c<d.length&&d[c]==="";c++);for(var m=d.length-1;m>=0&&d[m]==="";m--);return c>m?[]:d.slice(c,m-c+1)}for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),s=i,l=0;l<i;l++)if(n[l]!==o[l]){s=l;break}for(var f=[],l=s;l<n.length;l++)f.push("..");return f=f.concat(o.slice(s)),f.join("/")}},Gr=typeof TextDecoder!="undefined"?new TextDecoder:void 0,we=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Gr)return Gr.decode(e.subarray(r,o));for(var i="";r<o;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var f=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|f:s=(s&7)<<18|l<<12|f<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var d=s-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},cr=[],De=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},vr=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,i=t+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var f=e.charCodeAt(++s);l=65536+((l&1023)<<10)|f&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-o};function Xr(e,r,t){var n=t>0?t:De(e)+1,o=new Array(n),i=vr(e,o,0,o.length);return r&&(o.length=i),o}var Yt=()=>{if(!cr.length){var e=null;if(typeof window!="undefined"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
7
7
|
`)),!e)return null;cr=Xr(e,!0)}return cr.shift()},ie={ttys:[],init(){},shutdown(){},register(e,r){ie.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,ie.stream_ops)},stream_ops:{open(e){var r=ie.ttys[e.node.rdev];if(!r)throw new a.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,n,o){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var i=0,s=0;s<n;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch(f){throw new a.ErrnoError(29)}if(l===void 0&&i===0)throw new a.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(s){throw new a.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Yt()},put_char(e,r){r===null||r===10?(ae(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(we(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(z(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(z(we(e.output,0)),e.output=[])}}},Qt=(e,r)=>(H.fill(0,e,e+r),e),Zt=(e,r)=>Math.ceil(e/r)*r,Kr=e=>{e=Zt(e,65536);var r=yt(65536,e);return r?Qt(r,e):0},k={ops_table:null,mount(e){return k.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);k.ops_table||(k.ops_table={dir:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,lookup:k.node_ops.lookup,mknod:k.node_ops.mknod,rename:k.node_ops.rename,unlink:k.node_ops.unlink,rmdir:k.node_ops.rmdir,readdir:k.node_ops.readdir,symlink:k.node_ops.symlink},stream:{llseek:k.stream_ops.llseek}},file:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:{llseek:k.stream_ops.llseek,read:k.stream_ops.read,write:k.stream_ops.write,allocate:k.stream_ops.allocate,mmap:k.stream_ops.mmap,msync:k.stream_ops.msync}},link:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,readlink:k.node_ops.readlink},stream:{}},chrdev:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:a.chrdev_stream_ops}});var o=a.createNode(e,r,t,n);return a.isDir(o.mode)?(o.node_ops=k.ops_table.dir.node,o.stream_ops=k.ops_table.dir.stream,o.contents={}):a.isFile(o.mode)?(o.node_ops=k.ops_table.file.node,o.stream_ops=k.ops_table.file.stream,o.usedBytes=0,o.contents=null):a.isLink(o.mode)?(o.node_ops=k.ops_table.link.node,o.stream_ops=k.ops_table.link.stream):a.isChrdev(o.mode)&&(o.node_ops=k.ops_table.chrdev.node,o.stream_ops=k.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return 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)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(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(r==0)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=a.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,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.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){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&k.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return k.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch(i){}if(n)for(var o in n.contents)throw new a.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},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=k.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)r.set(i.subarray(o,o+s),t);else for(var l=0;l<s;l++)r[t+l]=i[o+l];return s},write(e,r,t,n,o,i){if(r.buffer===U.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&o===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(k.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var l=0;l<n;l++)s.contents[o+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&a.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new a.ErrnoError(28);return n},allocate(e,r,t){k.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var i,s,l=e.node.contents;if(!(o&2)&&l.buffer===U.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=Kr(r),!i)throw new a.ErrnoError(48);U.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,n,o){return k.stream_ops.write(e,r,0,n,t,!1),0}}},Jt=(e,r,t,n)=>{var o=n?"":`al ${e}`;ge(e).then(i=>{r(new Uint8Array(i)),o&&Se(o)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),o&&Ve(o)},Yr=(e,r,t,n,o,i)=>{a.createDataFile(e,r,t,n,o,i)},en=u.preloadPlugins||[],rn=(e,r,t,n)=>{typeof Browser!="undefined"&&Browser.init();var o=!1;return en.forEach(i=>{o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)}),o},Qr=(e,r,t,n,o,i,s,l,f,d)=>{var c=r?re.resolve($.join2(e,r)):e,m=`cp ${c}`;function v(p){function y(P){d==null||d(),l||Yr(e,r,P,n,o,f),i==null||i(),Se(m)}rn(p,c,y,()=>{s==null||s(),Se(m)})||y(p)}Ve(m),typeof t=="string"?Jt(t,v,s):v(t)},tn=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},pr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=re.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(m=>!!m),o=a.root,i="/",s=0;s<n.length;s++){var l=s===n.length-1;if(l&&r.parent)break;if(o=a.lookupNode(o,n[s]),i=$.join2(i,n[s]),a.isMountpoint(o)&&(!l||l&&r.follow_mount)&&(o=o.mounted.root),!l||r.follow)for(var f=0;a.isLink(o.mode);){var d=a.readlink(i);i=re.resolve($.dirname(i),d);var c=a.lookupPath(i,{recurse_count:r.recurse_count+1});if(o=c.node,f++>40)throw new a.ErrnoError(32)}}return{path:i,node:o}},getPath(e){for(var r;;){if(a.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,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t);for(var n=a.hashName(e.id,r),o=a.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return a.lookup(e,r)},createNode(e,r,t,n){var o=new a.FSNode(e,r,t,n);return a.hashAddNode(o),o},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch(n){}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(i){return i.errno}var o=a.nodePermissions(e,"wx");if(o)return o;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,r=-1){var n,o;var t=a.createStream(e,r);return(o=(n=t.stream_ops)==null?void 0:n.dup)==null||o.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&z(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function o(s){return a.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,o(s));++n>=t.length&&o(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var n=t==="/",o=!t,i;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!o){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,a.isMountpoint(i))throw new a.ErrnoError(10);if(!a.isDir(i.mode))throw new a.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},f=e.mount(l);return f.mount=l,l.root=f,n?a.root=f:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),f},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,o=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var l=a.nameTable[s];l;){var f=l.name_next;o.includes(l.mount)&&a.destroyNode(l),l=f}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),o=n.node,i=$.basename(e);if(!i||i==="."||i==="..")throw new a.ErrnoError(28);var s=a.mayCreate(o,i);if(s)throw new a.ErrnoError(s);if(!o.node_ops.mknod)throw new a.ErrnoError(63);return o.node_ops.mknod(o,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{a.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t=="undefined"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!re.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var o=$.basename(r),i=a.mayCreate(n,o);if(i)throw new a.ErrnoError(i);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=$.dirname(e),n=$.dirname(r),o=$.basename(e),i=$.basename(r),s,l,f;if(s=a.lookupPath(e,{parent:!0}),l=s.node,s=a.lookupPath(r,{parent:!0}),f=s.node,!l||!f)throw new a.ErrnoError(44);if(l.mount!==f.mount)throw new a.ErrnoError(75);var d=a.lookupNode(l,o),c=re.relative(e,n);if(c.charAt(0)!==".")throw new a.ErrnoError(28);if(c=re.relative(r,t),c.charAt(0)!==".")throw new a.ErrnoError(55);var m;try{m=a.lookupNode(f,i)}catch(y){}if(d!==m){var v=a.isDir(d.mode),p=a.mayDelete(l,o,v);if(p)throw new a.ErrnoError(p);if(p=m?a.mayDelete(f,i,v):a.mayCreate(f,i),p)throw new a.ErrnoError(p);if(!l.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(d)||m&&a.isMountpoint(m))throw new a.ErrnoError(10);if(f!==l&&(p=a.nodePermissions(l,"w"),p))throw new a.ErrnoError(p);a.hashRemoveNode(d);try{l.node_ops.rename(d,f,i),d.parent=f}catch(y){throw y}finally{a.hashAddNode(d)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!0);if(i)throw new a.ErrnoError(i);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(o)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!1);if(i)throw new a.ErrnoError(i);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(o)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return re.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var o=a.nodePermissions(t,"w");if(o)throw new a.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?tn(r):r,r&64?(t=typeof t=="undefined"?438:t,t=t&4095|32768):t=0;var n;if(typeof e=="object")n=e;else{e=$.normalize(e);try{var o=a.lookupPath(e,{follow:!(r&131072)});n=o.node}catch(f){}}var i=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),i=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!i){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!i&&a.truncate(n,0),r&=-131713;var l=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),l},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var i=typeof o!="undefined";if(!i)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=s),s},write(e,r,t,n,o,i){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof o!="undefined";if(!s)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var l=e.stream_ops.write(e,r,t,n,o,i);return s||(e.position+=l),l},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),o=a.stat(e),i=o.size,s=new Uint8Array(i);return a.read(n,s,0,i,0),r.encoding==="utf8"?t=we(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(De(r)+1),i=vr(r,o,0,o.length);a.write(n,o,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,o,i,s,l)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),ie.register(a.makedev(5,0),ie.default_tty_ops),ie.register(a.makedev(6,0),ie.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=qr(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var o=+n,i=a.getStreamChecked(o),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?a.createDevice("/dev","stdin",u.stdin):a.symlink("/dev/tty","/dev/stdin"),u.stdout?a.createDevice("/dev","stdout",null,u.stdout):a.symlink("/dev/tty","/dev/stdout"),u.stderr?a.createDevice("/dev","stderr",null,u.stderr):a.symlink("/dev/tty1","/dev/stderr");var e=a.open("/dev/stdin",0),r=a.open("/dev/stdout",1),t=a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(k,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:k}},init(e,r,t){a.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;e<a.streams.length;e++){var r=a.streams[e];r&&a.close(r)}},findObject(e,r){var t=a.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=a.lookupPath(e,{follow:!r});e=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=a.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=$.basename(e),t=a.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(o){n.error=o.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:a.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var s=$.join2(e,i);try{a.mkdir(s)}catch(l){}e=s}}return s},createFile(e,r,t,n,o){var i=$.join2(typeof e=="string"?e:a.getPath(e),r),s=pr(n,o);return a.create(i,s)},createDataFile(e,r,t,n,o,i){var s=r;e&&(e=typeof e=="string"?e:a.getPath(e),s=r?$.join2(e,r):e);var l=pr(n,o),f=a.create(s,l);if(t){if(typeof t=="string"){for(var d=new Array(t.length),c=0,m=t.length;c<m;++c)d[c]=t.charCodeAt(c);t=d}a.chmod(f,l|146);var v=a.open(f,577);a.write(v,t,0,t.length,0,i),a.close(v),a.chmod(f,l)}},createDevice(e,r,t,n){var o=$.join2(typeof e=="string"?e:a.getPath(e),r),i=pr(!!t,!!n);a.createDevice.major||(a.createDevice.major=64);var s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(l){l.seekable=!1},close(l){var f;(f=n==null?void 0:n.buffer)!=null&&f.length&&n(10)},read(l,f,d,c,m){for(var v=0,p=0;p<c;p++){var y;try{y=t()}catch(P){throw new a.ErrnoError(29)}if(y===void 0&&v===0)throw new a.ErrnoError(6);if(y==null)break;v++,f[d+p]=y}return v&&(l.node.timestamp=Date.now()),v},write(l,f,d,c,m){for(var v=0;v<c;v++)try{n(f[d+v])}catch(p){throw new a.ErrnoError(29)}return c&&(l.node.timestamp=Date.now()),v}}),a.mkdev(o,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")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.");try{e.contents=Y(e.url),e.usedBytes=e.contents.length}catch(r){throw new a.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(p){if(!(p>this.length-1||p<0)){var y=p%this.chunkSize,P=p/this.chunkSize|0;return this.getter(P)[y]}}setDataGetter(p){this.getter=p}cacheLength(){var p=new XMLHttpRequest;if(p.open("HEAD",t,!1),p.send(null),!(p.status>=200&&p.status<300||p.status===304))throw new Error("Couldn't load "+t+". Status: "+p.status);var y=Number(p.getResponseHeader("Content-length")),P,R=(P=p.getResponseHeader("Accept-Ranges"))&&P==="bytes",S=(P=p.getResponseHeader("Content-Encoding"))&&P==="gzip",b=1024*1024;R||(b=y);var A=(D,x)=>{if(D>x)throw new Error("invalid range ("+D+", "+x+") or no bytes requested!");if(x>y-1)throw new Error("only "+y+" bytes available! programmer error!");var O=new XMLHttpRequest;if(O.open("GET",t,!1),y!==b&&O.setRequestHeader("Range","bytes="+D+"-"+x),O.responseType="arraybuffer",O.overrideMimeType&&O.overrideMimeType("text/plain; charset=x-user-defined"),O.send(null),!(O.status>=200&&O.status<300||O.status===304))throw new Error("Couldn't load "+t+". Status: "+O.status);return O.response!==void 0?new Uint8Array(O.response||[]):Xr(O.responseText||"",!0)},M=this;M.setDataGetter(D=>{var x=D*b,O=(D+1)*b-1;if(O=Math.min(O,y-1),typeof M.chunks[D]=="undefined"&&(M.chunks[D]=A(x,O)),typeof M.chunks[D]=="undefined")throw new Error("doXHR failed!");return M.chunks[D]}),(S||!y)&&(b=y=1,y=this.getter(0).length,b=y,ae("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=y,this._chunkSize=b,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!J)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var f=a.createFile(e,r,l,n,o);l.contents?f.contents=l.contents:l.url&&(f.contents=null,f.url=l.url),Object.defineProperties(f,{usedBytes:{get:function(){return this.contents.length}}});var d={},c=Object.keys(f.stream_ops);c.forEach(v=>{var p=f.stream_ops[v];d[v]=(...y)=>(a.forceLoadFile(f),p(...y))});function m(v,p,y,P,R){var S=v.node.contents;if(R>=S.length)return 0;var b=Math.min(S.length-R,P);if(S.slice)for(var A=0;A<b;A++)p[y+A]=S[R+A];else for(var A=0;A<b;A++)p[y+A]=S.get(R+A);return b}return d.read=(v,p,y,P,R)=>(a.forceLoadFile(f),m(v,p,y,P,R)),d.mmap=(v,p,y,P,R)=>{a.forceLoadFile(f);var S=Kr(p);if(!S)throw new a.ErrnoError(48);return m(v,U,S,p,y),{ptr:S,allocated:!0}},f.stream_ops=d,f}},Zr=(e,r)=>e?we(H,e,r):"",j={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if($.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var o=j.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return $.join2(n,r)},doStat(e,r,t){var n=e(r);w[t>>2]=n.dev,w[t+4>>2]=n.mode,T[t+8>>2]=n.nlink,w[t+12>>2]=n.uid,w[t+16>>2]=n.gid,w[t+20>>2]=n.rdev,W=[n.size>>>0,(_=n.size,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+24>>2]=W[0],w[t+28>>2]=W[1],w[t+32>>2]=4096,w[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return W=[Math.floor(o/1e3)>>>0,(_=Math.floor(o/1e3),+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+40>>2]=W[0],w[t+44>>2]=W[1],T[t+48>>2]=o%1e3*1e3,W=[Math.floor(i/1e3)>>>0,(_=Math.floor(i/1e3),+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+56>>2]=W[0],w[t+60>>2]=W[1],T[t+64>>2]=i%1e3*1e3,W=[Math.floor(s/1e3)>>>0,(_=Math.floor(s/1e3),+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+72>>2]=W[0],w[t+76>>2]=W[1],T[t+80>>2]=s%1e3*1e3,W=[n.ino>>>0,(_=n.ino,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+88>>2]=W[0],w[t+92>>2]=W[1],0},doMsync(e,r,t,n,o){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var i=H.slice(e,e+t);a.msync(r,i,o,t,n)},getStreamFromFD(e){var r=a.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=Zr(e);return r}};function nn(e,r,t){j.varargs=t;try{var n=j.getStreamFromFD(e);switch(r){case 0:{var o=Ge();if(o<0)return-28;for(;a.streams[o];)o++;var i;return i=a.dupStream(n,o),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=Ge();return n.flags|=o,0}case 12:{var o=ye(),s=0;return ee[o+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}var ce=(e,r,t)=>vr(e,H,r,t);function on(e,r){try{if(r===0)return-28;var t=a.cwd(),n=De(t)+1;return r<n?-68:(ce(t,e,r),n)}catch(o){if(typeof a=="undefined"||o.name!=="ErrnoError")throw o;return-o.errno}}function an(e,r,t){j.varargs=t;try{var n=j.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=ye();w[i>>2]=o.c_iflag||0,w[i+4>>2]=o.c_oflag||0,w[i+8>>2]=o.c_cflag||0,w[i+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)U[i+s+17]=o.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=ye(),l=w[i>>2],f=w[i+4>>2],d=w[i+8>>2],c=w[i+12>>2],m=[],s=0;s<32;s++)m.push(U[i+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:l,c_oflag:f,c_cflag:d,c_lflag:c,c_cc:m})}return 0}case 21519:{if(!n.tty)return-59;var i=ye();return w[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=ye();return a.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var v=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=ye();ee[i>>1]=v[0],ee[i+2>>1]=v[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(p){if(typeof a=="undefined"||p.name!=="ErrnoError")throw p;return-p.errno}}function sn(e,r,t){try{return r=j.getStr(r),r=j.calculateAt(e,r),r=$.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),a.mkdir(r,t,0),0}catch(n){if(typeof a=="undefined"||n.name!=="ErrnoError")throw n;return-n.errno}}function ln(e,r,t,n){j.varargs=n;try{r=j.getStr(r),r=j.calculateAt(e,r);var o=n?Ge():0;return a.open(r,t,o).fd}catch(i){if(typeof a=="undefined"||i.name!=="ErrnoError")throw i;return-i.errno}}function un(e,r,t,n){try{if(r=j.getStr(r),r=j.calculateAt(e,r),n<=0)return-28;var o=a.readlink(r),i=Math.min(n,De(o)),s=U[t+i];return ce(o,t,n+1),U[t+i]=s,i}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}function fn(e,r){try{return e=j.getStr(e),j.doStat(a.stat,e,r)}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return-t.errno}}var dn=()=>{fr("")},cn=(e,r,t,n,o)=>{},vn=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Jr=e},Jr,B=e=>{for(var r="",t=e;H[t];)r+=Jr[H[t++]];return r},_e={},ve={},Xe={},Ee,C=e=>{throw new Ee(e)},et,Ke=e=>{throw new et(e)},Q=(e,r,t)=>{e.forEach(function(l){Xe[l]=r});function n(l){var f=t(l);f.length!==e.length&&Ke("Mismatched type converter count");for(var d=0;d<e.length;++d)te(e[d],f[d])}var o=new Array(r.length),i=[],s=0;r.forEach((l,f)=>{ve.hasOwnProperty(l)?o[f]=ve[l]:(i.push(l),_e.hasOwnProperty(l)||(_e[l]=[]),_e[l].push(()=>{o[f]=ve[l],++s,s===i.length&&n(o)}))}),i.length===0&&n(o)};function pn(e,r,t={}){var n=r.name;if(e||C(`type "${n}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ve[e]=r,delete Xe[e],_e.hasOwnProperty(e)){var o=_e[e];delete _e[e],o.forEach(i=>i())}}function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return pn(e,r,t)}var se=8,hn=(e,r,t,n)=>{r=B(r),te(e,{name:r,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?t:n},argPackAdvance:se,readValueFromPointer:function(o){return this.fromWireType(H[o])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),hr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}C(r(e)+" instance already deleted")},mr=!1,rt=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},tt=e=>{e.count.value-=1;var r=e.count.value===0;r&&gn(e)},nt=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=nt(e,r,t.baseClass);return n===null?null:t.downcast(n)},ot={},yn=()=>Object.keys(Me).length,wn=()=>{var e=[];for(var r in Me)Me.hasOwnProperty(r)&&e.push(Me[r]);return e},Re=[],gr=()=>{for(;Re.length;){var e=Re.pop();e.$$.deleteScheduled=!1,e.delete()}},$e,_n=e=>{$e=e,Re.length&&$e&&$e(gr)},En=()=>{u.getInheritedInstanceCount=yn,u.getLiveInheritedInstances=wn,u.flushPendingDeletes=gr,u.setDelayFunction=_n},Me={},kn=(e,r)=>{for(r===void 0&&C("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},bn=(e,r)=>(r=kn(e,r),Me[r]),Ye=(e,r)=>{(!r.ptrType||!r.ptr)&&Ke("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Ke("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Oe(Object.create(e,{$$:{value:r,writable:!0}}))};function An(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=bn(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(r),s=ot[i];if(!s)return o.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var f=nt(r,this.registeredClass,l.registeredClass);return f===null?o.call(this):this.isSmartPointer?Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:f,smartPtrType:this,smartPtr:e}):Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:f})}var Oe=e=>typeof FinalizationRegistry=="undefined"?(Oe=r=>r,e):(mr=new FinalizationRegistry(r=>{tt(r.$$)}),Oe=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var o={$$:t};mr.register(r,o,r)}return r},rt=r=>mr.unregister(r),Oe(e)),Pn=()=>{Object.assign(Qe.prototype,{isAliasOf(e){if(!(this instanceof Qe)||!(e instanceof Qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||hr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Oe(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||hr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),rt(this),tt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||hr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Re.push(this),Re.length===1&&$e&&$e(gr),this.$$.deleteScheduled=!0,this}})};function Qe(){}var Ze=(e,r)=>Object.defineProperty(r,"name",{value:e}),yr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...o){return e[r].overloadTable.hasOwnProperty(o.length)||C(`Function '${t}' called with an invalid number of arguments (${o.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[o.length].apply(this,o)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},at=(e,r,t)=>{u.hasOwnProperty(e)?((t===void 0||u[e].overloadTable!==void 0&&u[e].overloadTable[t]!==void 0)&&C(`Cannot register public name '${e}' twice`),yr(u,e,e),u.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,t!==void 0&&(u[e].numArguments=t))},Cn=48,Tn=57,Fn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Cn&&r<=Tn?`_${e}`:e};function Sn(e,r,t,n,o,i,s,l){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[]}var Je=(e,r,t)=>{for(;r!==t;)r.upcast||C(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Dn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function Rn(e,r){var t;if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Je(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:C(`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 o=r.clone();t=this.rawShare(t,he.toHandle(()=>o.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:C("Unsupporting sharing policy")}return t}function $n(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${br(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function er(e){return this.fromWireType(T[e>>2])}var Mn=()=>{Object.assign(We.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;(r=this.rawDestructor)==null||r.call(this,e)},argPackAdvance:se,readValueFromPointer:er,fromWireType:An})};function We(e,r,t,n,o,i,s,l,f,d,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=f,this.rawShare=d,this.rawDestructor=c,!o&&r.baseClass===void 0?n?(this.toWireType=Dn,this.destructorFunction=null):(this.toWireType=$n,this.destructorFunction=null):this.toWireType=Rn}var it=(e,r,t)=>{u.hasOwnProperty(e)||Ke("Replacing nonexistent public symbol"),u[e].overloadTable!==void 0&&t!==void 0?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},On=(e,r,t)=>{e=e.replace(/p/g,"i");var n=u["dynCall_"+e];return n(r,...t)},rr=[],st,lt=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=st.get(e)),r},Wn=(e,r,t=[])=>{if(e.includes("j"))return On(e,r,t);var n=lt(r)(...t);return n},jn=(e,r)=>(...t)=>Wn(e,r,t),q=(e,r)=>{e=B(e);function t(){return e.includes("j")?jn(e,r):lt(r)}var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${e}: ${r}`),n},In=(e,r)=>{var t=Ze(r,function(n){this.name=r,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+`
|
|
8
|
-
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},ut,ft=e=>{var r=gt(e),t=B(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Xe[i]){Xe[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new ut(`${e}: `+t.map(ft).join([", "]))},Nn=(e,r,t,n,o,i,s,l,f,d,c,m,v)=>{c=B(c),i=q(o,i),l&&(l=q(s,l)),d&&(d=q(f,d)),v=q(m,v);var p=Fn(c);at(p,function(){pe(`Cannot construct ${c} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var O,Ne;y=y[0];var P,R;n?(P=y.registeredClass,R=P.instancePrototype):R=Qe.prototype;var S=Ze(c,function(...xe){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+c);if(A.constructor_body===void 0)throw new Ee(c+" has no accessible constructor");var Ue=A.constructor_body[xe.length];if(Ue===void 0)throw new Ee(`Tried to invoke ctor of ${c} with invalid number of parameters (${xe.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ue.apply(this,xe)}),b=Object.create(R,{constructor:{value:S}});S.prototype=b;var A=new Sn(c,S,b,v,P,i,l,d);A.baseClass&&((Ne=(O=A.baseClass).__derivedClasses)!=null||(O.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new We(c,A,!0,!1,!1),D=new We(c+"*",A,!1,!1,!1),x=new We(c+" const*",A,!1,!0,!1);return ot[e]={pointerType:D,constPointerType:x},it(p,S),[M,D,x]})},wr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function xn(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,f=xn(r),d=r[0].name!=="void",c=s-2,m=new Array(c),v=[],p=[],y=function(...P){P.length!==c&&C(`function ${e} called with ${P.length} arguments, expected ${c}`),p.length=0;var R;v.length=l?2:1,v[0]=o,l&&(R=r[1].toWireType(p,this),v[1]=R);for(var S=0;S<c;++S)m[S]=r[S+2].toWireType(p,P[S]),v.push(m[S]);var b=n(...v);function A(M){if(f)wr(p);else for(var D=l?1:2;D<r.length;D++){var x=D===1?R:m[D-2];r[D].destructorFunction!==null&&r[D].destructorFunction(x)}if(d)return r[0].fromWireType(M)}return A(b)};return Ze(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+n*4>>2]);return t},_r=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Un=(e,r,t,n,o,i,s,l)=>{var f=nr(t,n);r=B(r),r=_r(r),i=q(o,i),Q([],[e],d=>{d=d[0];var c=`${d.name}.${r}`;function m(){pe(`Cannot call ${c} due to unbound types`,f)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var v=d.registeredClass.constructor;return v[r]===void 0?(m.argCount=t-1,v[r]=m):(yr(v,r,c),v[r].overloadTable[t-1]=m),Q([],f,p=>{var y=[p[0],null].concat(p.slice(1)),P=tr(c,y,null,i,s,l);if(v[r].overloadTable===void 0?(P.argCount=t-1,v[r]=P):v[r].overloadTable[t-1]=P,d.registeredClass.__derivedClasses)for(let R of d.registeredClass.__derivedClasses)R.constructor.hasOwnProperty(r)||(R.constructor[r]=P);return[]}),[]})},Ln=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var f=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,d=>(d.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(f,d,null,o,i),[])),[]})},Hn=(e,r,t,n,o,i,s,l,f)=>{var d=nr(t,n);r=B(r),r=_r(r),i=q(o,i),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&c.registeredClass.pureVirtualFunctions.push(r);function v(){pe(`Cannot call ${m} due to unbound types`,d)}var p=c.registeredClass.instancePrototype,y=p[r];return y===void 0||y.overloadTable===void 0&&y.className!==c.name&&y.argCount===t-2?(v.argCount=t-2,v.className=c.name,p[r]=v):(yr(p,r,m),p[r].overloadTable[t-2]=v),Q([],d,P=>{var R=tr(m,P,c,i,s,f);return p[r].overloadTable===void 0?(R.argCount=t-2,p[r]=R):p[r].overloadTable[t-2]=R,[]}),[]})},dt=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),zn=(e,r,t,n,o,i,s,l,f,d)=>{r=B(r),o=q(n,o),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`,v={get(){pe(`Cannot access ${m} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return f?v.set=()=>pe(`Cannot access ${m} due to unbound types`,[t,s]):v.set=p=>C(m+" is a read-only property"),Object.defineProperty(c.registeredClass.instancePrototype,r,v),Q([],f?[t,s]:[t],p=>{var y=p[0],P={get(){var S=dt(this,c,m+" getter");return y.fromWireType(o(i,S))},enumerable:!0};if(f){f=q(l,f);var R=p[1];P.set=function(S){var b=dt(this,c,m+" setter"),A=[];f(d,b,R.toWireType(A,S)),wr(A)}}return Object.defineProperty(c.registeredClass.instancePrototype,r,P),[]}),[]})},Er=[],ne=[],kr=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,Er.push(e))},Bn=()=>ne.length/2-5-Er.length,Vn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=Bn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=Er.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},qn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return kr(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},ct=e=>te(e,qn),br=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Gn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(jr[t>>2])};case 8:return function(t){return this.fromWireType(Ir[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Xn=(e,r,t)=>{r=B(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:Gn(r,t),destructorFunction:null})},Kn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=B(e),e=_r(e),o=q(n,o),at(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,f=>{var d=[f[0],null].concat(f.slice(1));return it(e,tr(e,d,null,o,i,s),r-1),[]})},Yn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>H[n];case 2:return t?n=>ee[n>>1]:n=>Be[n>>1];case 4:return t?n=>w[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Qn=(e,r,t,n,o)=>{r=B(r),o===-1&&(o=4294967295);var i=c=>c;if(n===0){var s=32-8*t;i=c=>c<<s>>>s}var l=r.includes("unsigned"),f=(c,m)=>{},d;l?d=function(c,m){return f(m,this.name),m>>>0}:d=function(c,m){return f(m,this.name),m},te(e,{name:r,fromWireType:i,toWireType:d,argPackAdvance:se,readValueFromPointer:Yn(r,t,n!==0),destructorFunction:null})},Zn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=T[s>>2],f=T[s+4>>2];return new o(U.buffer,f,l)}t=B(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Jn=(e,r)=>{ct(e)},eo=(e,r,t,n,o,i,s,l,f,d,c,m)=>{t=B(t),i=q(o,i),l=q(s,l),d=q(f,d),m=q(c,m),Q([e],[r],v=>{v=v[0];var p=new We(t,v.registeredClass,!1,!1,!0,v,n,i,l,d,m);return[p]})},ro=(e,r)=>{r=B(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=T[n>>2],i=n+4,s;if(t)for(var l=i,f=0;f<=o;++f){var d=i+f;if(f==o||H[d]==0){var c=d-l,m=Zr(l,c);s===void 0?s=m:(s+=String.fromCharCode(0),s+=m),l=d+1}}else{for(var v=new Array(o),f=0;f<o;++f)v[f]=String.fromCharCode(H[i+f]);s=v.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=De(o):i=o.length;var l=Cr(4+i+1),f=l+4;if(T[l>>2]=i,t&&s)ce(o,f,i+1);else if(s)for(var d=0;d<i;++d){var c=o.charCodeAt(d);c>255&&(oe(f),C("String has UTF-16 code units that do not fit in 8 bits")),H[f+d]=c}else for(var d=0;d<i;++d)H[f+d]=o[d];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},vt=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,to=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&Be[n];)++n;if(t=n<<1,t-e>32&&vt)return vt.decode(H.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},no=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},oo=e=>e.length*2,ao=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=w[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},io=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(w[r>>2]=s,r+=4,r+4>o)break}return w[r>>2]=0,r-n},so=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},lo=(e,r,t)=>{t=B(t);var n,o,i,s;r===2?(n=to,o=no,s=oo,i=l=>Be[l>>1]):r===4&&(n=ao,o=io,s=so,i=l=>T[l>>2]),te(e,{name:t,fromWireType:l=>{for(var f=T[l>>2],d,c=l+4,m=0;m<=f;++m){var v=l+4+m*r;if(m==f||i(v)==0){var p=v-c,y=n(c,p);d===void 0?d=y:(d+=String.fromCharCode(0),d+=y),c=v+r}}return oe(l),d},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var d=s(f),c=Cr(4+d+r);return T[c>>2]=d/r,o(f,c+4,d+r),l!==null&&l.push(oe,c),c},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},uo=(e,r)=>{r=B(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},fo=1,co=()=>fo,vo=(e,r,t)=>H.copyWithin(e,r,r+t),Ar=[],po=(e,r,t,n)=>(e=Ar[e],r=he.toValue(r),e(null,r,t,n)),ho=e=>{var r=Ar.length;return Ar.push(e),r},pt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${ft(e)}`),t},mo=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=pt(T[r+n*4>>2],"parameter "+n);return t},go=Reflect.construct,yo=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=he.toHandle(n)),o},wo=(e,r,t)=>{var n=mo(e,r),o=n.shift();e--;var i=new Array(e),s=(f,d,c,m)=>{for(var v=0,p=0;p<e;++p)i[p]=n[p].readValueFromPointer(m+v),v+=n[p].argPackAdvance;var y=t===1?go(d,i):d.apply(f,i);return yo(o,c,y)},l=`methodCaller<(${n.map(f=>f.name).join(", ")}) => ${o.name}>`;return ho(Ze(l,s))},_o=e=>{e>9&&(ne[e+1]+=1)},Eo=e=>{var r=he.toValue(e);wr(r),kr(e)},ko=(e,r)=>{e=pt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},je=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function bo(e,r,t){var n=je(e,r),o=new Date(n*1e3);w[t>>2]=o.getUTCSeconds(),w[t+4>>2]=o.getUTCMinutes(),w[t+8>>2]=o.getUTCHours(),w[t+12>>2]=o.getUTCDate(),w[t+16>>2]=o.getUTCMonth(),w[t+20>>2]=o.getUTCFullYear()-1900,w[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;w[t+28>>2]=s}var Ao=e=>e%4===0&&(e%100!==0||e%400===0),Po=[0,31,60,91,121,152,182,213,244,274,305,335],Co=[0,31,59,90,120,151,181,212,243,273,304,334],To=e=>{var r=Ao(e.getFullYear()),t=r?Po:Co,n=t[e.getMonth()]+e.getDate()-1;return n};function Fo(e,r,t){var n=je(e,r),o=new Date(n*1e3);w[t>>2]=o.getSeconds(),w[t+4>>2]=o.getMinutes(),w[t+8>>2]=o.getHours(),w[t+12>>2]=o.getDate(),w[t+16>>2]=o.getMonth(),w[t+20>>2]=o.getFullYear()-1900,w[t+24>>2]=o.getDay();var i=To(o)|0;w[t+28>>2]=i,w[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),f=s.getTimezoneOffset(),d=(l!=f&&o.getTimezoneOffset()==Math.min(f,l))|0;w[t+32>>2]=d}function So(e,r,t,n,o,i,s,l){var f=je(o,i);try{if(isNaN(f))return 61;var d=j.getStreamFromFD(n),c=a.mmap(d,e,f,r,t),m=c.ptr;return w[s>>2]=c.allocated,T[l>>2]=m,0}catch(v){if(typeof a=="undefined"||v.name!=="ErrnoError")throw v;return-v.errno}}function Do(e,r,t,n,o,i,s){var l=je(i,s);try{var f=j.getStreamFromFD(o);t&2&&j.doMsync(e,f,r,n,l)}catch(d){if(typeof a=="undefined"||d.name!=="ErrnoError")throw d;return-d.errno}}var Ro=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),f=s.getTimezoneOffset(),d=Math.max(l,f);T[e>>2]=d*60,w[r>>2]=+(l!=f);var c=p=>p.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],m=c(i),v=c(s);f<l?(ce(m,t,17),ce(v,n,17)):(ce(m,n,17),ce(v,t,17))},$o=()=>Date.now(),ht=()=>2147483648,Mo=()=>ht(),mt;mt=()=>performance.now();var Oo=e=>{var r=ze.buffer,t=(e-r.byteLength+65535)/65536;try{return ze.grow(t),Nr(),1}catch(n){}},Wo=e=>{var r=H.length;e>>>=0;var t=ht();if(e>t)return!1;for(var n=(f,d)=>f+(d-f%d)%d,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=Oo(s);if(l)return!0}return!1},Pr={},jo=()=>me||"./this.program",Ie=()=>{if(!Ie.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:jo()};for(var t in Pr)Pr[t]===void 0?delete r[t]:r[t]=Pr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Ie.strings=n}return Ie.strings},Io=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},No=(e,r)=>{var t=0;return Ie().forEach((n,o)=>{var i=r+t;T[e+o*4>>2]=i,Io(n,i),t+=n.length+1}),0},xo=(e,r)=>{var t=Ie();T[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),T[r>>2]=n,0},Uo=0,Lo=()=>Vt||Uo>0,Ho=e=>{var r;lr=e,Lo()||((r=u.onExit)==null||r.call(u,e),sr=!0),Ce(e,new Bt(e))},zo=(e,r)=>{lr=e,Ho(e)},Bo=zo;function Vo(e){try{var r=j.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function qo(e,r){try{var t=0,n=0,o=0,i=j.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,W=[t>>>0,(_=t,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+8>>2]=W[0],w[r+12>>2]=W[1],W=[n>>>0,(_=n,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+16>>2]=W[0],w[r+20>>2]=W[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Go=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.read(e,U,s,l,n);if(f<0)return-1;if(o+=f,f<l)break;typeof n!="undefined"&&(n+=f)}return o};function Xo(e,r,t,n){try{var o=j.getStreamFromFD(e),i=Go(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Ko(e,r,t,n,o){var i=je(r,t);try{if(isNaN(i))return 61;var s=j.getStreamFromFD(e);return a.llseek(s,i,n),W=[s.position>>>0,(_=s.position,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[o>>2]=W[0],w[o+4>>2]=W[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Yo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.write(e,U,s,l,n);if(f<0)return-1;o+=f,typeof n!="undefined"&&(n+=f)}return o};function Qo(e,r,t,n){try{var o=j.getStreamFromFD(e),i=Yo(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var Zo=a.createPath,Jo=e=>a.unlink(e),ea=a.createLazyFile,ra=a.createDevice;a.createPreloadedFile=Qr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,vn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},et=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Pn(),En(),Mn(),ut=u.UnboundTypeError=In(Error,"UnboundTypeError"),Vn();var ta={a:Xt,q:nn,M:on,P:an,I:sn,r:ln,G:un,N:fn,S:dn,D:cn,U:hn,e:Nn,s:Un,n:Ln,g:Hn,m:zn,T:ct,v:Xn,i:Kn,c:Qn,b:Zn,x:Jn,o:eo,u:ro,l:lo,V:uo,Q:co,R:vo,X:po,d:kr,Y:wo,w:_o,W:Eo,h:ko,A:bo,B:Fo,y:So,z:Do,H:Ro,t:$o,F:Mo,j:mt,E:Wo,K:No,L:xo,f:Bo,k:Vo,J:qo,O:Xo,C:Ko,p:Qo},N=zt(),na=()=>(na=N._)(),gt=e=>(gt=N.$)(e),Cr=e=>(Cr=N.ba)(e),oe=e=>(oe=N.ca)(e),yt=(e,r)=>(yt=N.da)(e,r),wt=e=>(wt=N.ea)(e),oa=u.dynCall_jjj=(e,r,t,n,o)=>(oa=u.dynCall_jjj=N.fa)(e,r,t,n,o),aa=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(aa=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),ia=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(ia=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),sa=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,f,d,c,m)=>(sa=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,f,d,c,m),la=u.dynCall_iji=(e,r,t,n)=>(la=u.dynCall_iji=N.ja)(e,r,t,n),ua=u.dynCall_jiji=(e,r,t,n,o)=>(ua=u.dynCall_jiji=N.ka)(e,r,t,n,o),fa=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(fa=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),da=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(da=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),ca=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,f)=>(ca=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,f),va=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,f,d)=>(va=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,f,d);u.addRunDependency=Ve,u.removeRunDependency=Se,u.FS_createPreloadedFile=Qr,u.FS_unlink=Jo,u.FS_createPath=Zo,u.FS_createDevice=ra,u.FS_createDataFile=Yr,u.FS_createLazyFile=ea;var or;Fe=function e(){or||_t(),or||(Fe=e)};function _t(){if(de>0||($t(),de>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!sr&&(Mt(),I(u),(r=u.onRuntimeInitialized)==null||r.call(u),Ot()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return _t(),E=K,E}})();typeof Ft=="object"&&typeof Fr=="object"?Fr.exports=Tr:typeof define=="function"&&define.amd&&define([],()=>Tr);Tr.getUrl=function(F){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+F}});var Aa={};_a(Aa,{EffectVmojiLmarksAi:()=>Ae,EffectVmojiLmarksVolume:()=>be,EffectVoiceChange:()=>Pe,EffectVoiceChangeMode:()=>$r,VoiceChangeEffectType:()=>Mr});module.exports=Ea(Aa);var Le=class{constructor(g,h="AudioEffects"){this.loggerFunction=g,this.loggerName=h}debug(...g){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...g)}log(...g){this.loggerFunction("LOG",`[${this.loggerName}]`,...g)}warn(...g){this.loggerFunction("WARN",`[${this.loggerName}]`,...g)}error(...g){this.loggerFunction("ERROR",`[${this.loggerName}]`,...g)}};function ir(F,g=[]){let h=g.join(","),E=typeof F=="string"?[F,`exports.default(${h});`]:[`(${F})(${h});`],u=new Blob(E,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Le(()=>{})}init(V){return Z(this,arguments,function*({sampleRate:g,isOutputAudio:h=!1,isOutputStream:E=!1,workletFunction:u,workletName:I}){if(this.logger.debug("init"),this.createAudioContext(g),yield this.createWorklet(u,I),this.workletNode&&this.audioContext&&(h&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),E)){let K=this.audioContext.createMediaStreamDestination();this.workletNode.connect(K),this.outputStream=K.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(g){var h;if(this.audioContext&&this.workletNode){let E=null;if(g){let u=new MediaStream(g instanceof MediaStreamTrack?[g]:g.getAudioTracks().filter(I=>I.contentHint!=="music"));E=this.audioContext.createMediaStreamSource(u)}(h=this.sourceNode)==null||h.disconnect(this.workletNode),E==null||E.connect(this.workletNode),this.sourceNode=E,this.logger.debug("source "+(g?"set":"set to null"))}}destroy(){var g;this.logger.debug("destroy"),(g=this.audioContext)==null||g.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null}resume(){var g;this.logger.debug("resume"),(g=this.audioContext)==null||g.resume()}pause(){var g;this.logger.debug("pause"),(g=this.audioContext)==null||g.suspend()}setLogger(g=()=>{},h){this.logger=new Le(g,h)}static isSupported(){try{let g=window;return!!(g.WebAssembly&&g.Worker&&(g.AudioContext||g.webkitAudioContext)&&g.AudioWorkletNode)}catch(g){return!1}}createAudioContext(g){let h=window.AudioContext||window.webkitAudioContext,E=new h(g?{sampleRate:g}:{});this.audioContext=E,this.logger.debug("created AudioContext")}createWorklet(g,h){return Z(this,null,function*(){if(this.logger.debug(`${h} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ir(g));let E=new AudioWorkletNode(this.audioContext,h);return this.workletNode=E,new Promise(u=>{E.port.onmessage=({data:I})=>{switch(I.type){case"init":{this.logger.debug(`${h} init success`),u();break}case"data":{this.onWorkletData(I.data);break}}}})})}sendDataToWorklet(g,h=[]){var E;(E=this.workletNode)==null||E.port.postMessage(g,h)}};function Tt(){let G=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],J=G[59],Or=1-G[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let Ce=currentTime,X=0,fe=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(fe!=null&&fe.length&&(X=fe.reduce((ae,z)=>ae+Math.abs(z),0)/fe.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+X)/(this.frameSampleCount+1),this.frameSampleCount+=1,Ce-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(G[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=J+Or*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=Ce;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var be=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(be.prototype,this,"init").call(this,{workletFunction:Tt,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(h){this.onData(h)}};var Dr=Pt(Sr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null}init(h){return Z(this,null,function*(){yield le(ue.prototype,this,"init").call(this,h),this.isInitialized=!1,yield this.createWorker(h.workerFunctionString,h.workerArgs),this.isInitialized=!0})}destroy(){var h;super.destroy(),(h=this.worker)==null||h.terminate(),this.worker=null}sendDataToWorker(h,E=[]){var u;(u=this.worker)==null||u.postMessage(h,E)}static isSupported(){try{let h=window;return!!(super.isSupported()&&h.Worker)}catch(h){return!1}}createWorker(h,E=[]){return new Promise((u,I)=>{this.logger.debug("worker init started"),this.worker=new Worker(ir(h,E)),this.worker.onmessage=({data:V})=>{switch(V.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(V.error),I(V.error);break}case"data":{this.onWorkerData(V.data);break}case"debug":{this.logger.debug(V.message);break}}}})}};function St(){class F extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(h){var E;return(E=h==null?void 0:h[0])!=null&&E[0]&&this.port.postMessage({type:"data",data:h[0][0].buffer},[h[0][0].buffer]),!0}}registerProcessor("pureWorklet",F)}var ka=16e3,Ae=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(Ae.prototype,this,"init").call(this,{sampleRate:ka,workletFunction:St,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)g(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m(t))!f.call(o,n)&&n!==e&&g(o,n,{get:()=>t[n],enumerable:!(i=w(t,n))||i.enumerable});return o};var A=o=>y(g({},"__esModule",{value:!0}),o);var v={};b(v,{default:()=>x});var x=(o,t)=>{let e=null,i=null;function n(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);i=e.AnimojiFactory.createAlgorithm(s)})}function p(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!i))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(i,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){p(s)}}n().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(p)};return A(v);})();
|
|
9
|
-
`,workerArgs:[Dr.default,Dr.default.getUrl]})})}onWorkletData(h){this.sendDataToWorker({data:h},[h])}onWorkerData(h){this.onData(h)}static isSupported(){try{let h=super.isSupported(),E=/firefox/i.test(navigator.userAgent);return h&&!E}catch(h){return!1}}};var Rr=Pt(Sr());function Dt(){class F extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:E}})=>{let u=new Float32Array(E),I=new Float32Array(this.samplesQueue.length+u.length);I.set(this.samplesQueue,0),I.set(u,this.samplesQueue.length),this.samplesQueue=I}}process(E,u){var I;return(I=E==null?void 0:E[0])!=null&&I[0]&&this.port.postMessage({type:"data",data:E[0][0].buffer},[E[0][0].buffer]),this.samplesQueue.length>=128&&(u[0].forEach(K=>{K.set(this.samplesQueue.subarray(0,128))}),this.samplesQueue=this.samplesQueue.slice(128)),!0}}registerProcessor("voiceChangeWorklet",F)}var $r=(h=>(h.PLAYBACK="playback",h.OUTPUT_STREAM="output_stream",h))($r||{}),Mr=(L=>(L.BALLOON="balloon",L.CATHEDRAL="cathedral",L.CHORUS="chorus",L.DISTORTION="distortion",L.ECHO="echo",L.EVIL="evil",L.GIANT="giant",L.HALL="hall",L.PHASER="phaser",L.ROBOT="robot",L.SQUIRELL="squirell",L.DENOISE="denoise",L))(Mr||{}),ba=44100,Pe=class extends ue{constructor(h="playback"){super();this.mode=h}init(){return Z(this,null,function*(){yield le(Pe.prototype,this,"init").call(this,{sampleRate:ba,isOutputAudio:this.mode==="playback",isOutputStream:this.mode==="output_stream",workletFunction:Dt,workletName:"voiceChangeWorklet",workerFunctionString:'"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var W=(
|
|
8
|
+
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},ut,ft=e=>{var r=gt(e),t=B(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Xe[i]){Xe[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new ut(`${e}: `+t.map(ft).join([", "]))},Nn=(e,r,t,n,o,i,s,l,f,d,c,m,v)=>{c=B(c),i=q(o,i),l&&(l=q(s,l)),d&&(d=q(f,d)),v=q(m,v);var p=Fn(c);at(p,function(){pe(`Cannot construct ${c} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var O,Ne;y=y[0];var P,R;n?(P=y.registeredClass,R=P.instancePrototype):R=Qe.prototype;var S=Ze(c,function(...xe){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+c);if(A.constructor_body===void 0)throw new Ee(c+" has no accessible constructor");var Ue=A.constructor_body[xe.length];if(Ue===void 0)throw new Ee(`Tried to invoke ctor of ${c} with invalid number of parameters (${xe.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ue.apply(this,xe)}),b=Object.create(R,{constructor:{value:S}});S.prototype=b;var A=new Sn(c,S,b,v,P,i,l,d);A.baseClass&&((Ne=(O=A.baseClass).__derivedClasses)!=null||(O.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new We(c,A,!0,!1,!1),D=new We(c+"*",A,!1,!1,!1),x=new We(c+" const*",A,!1,!0,!1);return ot[e]={pointerType:D,constPointerType:x},it(p,S),[M,D,x]})},wr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function xn(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,f=xn(r),d=r[0].name!=="void",c=s-2,m=new Array(c),v=[],p=[],y=function(...P){P.length!==c&&C(`function ${e} called with ${P.length} arguments, expected ${c}`),p.length=0;var R;v.length=l?2:1,v[0]=o,l&&(R=r[1].toWireType(p,this),v[1]=R);for(var S=0;S<c;++S)m[S]=r[S+2].toWireType(p,P[S]),v.push(m[S]);var b=n(...v);function A(M){if(f)wr(p);else for(var D=l?1:2;D<r.length;D++){var x=D===1?R:m[D-2];r[D].destructorFunction!==null&&r[D].destructorFunction(x)}if(d)return r[0].fromWireType(M)}return A(b)};return Ze(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+n*4>>2]);return t},_r=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},Un=(e,r,t,n,o,i,s,l)=>{var f=nr(t,n);r=B(r),r=_r(r),i=q(o,i),Q([],[e],d=>{d=d[0];var c=`${d.name}.${r}`;function m(){pe(`Cannot call ${c} due to unbound types`,f)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var v=d.registeredClass.constructor;return v[r]===void 0?(m.argCount=t-1,v[r]=m):(yr(v,r,c),v[r].overloadTable[t-1]=m),Q([],f,p=>{var y=[p[0],null].concat(p.slice(1)),P=tr(c,y,null,i,s,l);if(v[r].overloadTable===void 0?(P.argCount=t-1,v[r]=P):v[r].overloadTable[t-1]=P,d.registeredClass.__derivedClasses)for(let R of d.registeredClass.__derivedClasses)R.constructor.hasOwnProperty(r)||(R.constructor[r]=P);return[]}),[]})},Ln=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var f=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,d=>(d.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(f,d,null,o,i),[])),[]})},Hn=(e,r,t,n,o,i,s,l,f)=>{var d=nr(t,n);r=B(r),r=_r(r),i=q(o,i),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&c.registeredClass.pureVirtualFunctions.push(r);function v(){pe(`Cannot call ${m} due to unbound types`,d)}var p=c.registeredClass.instancePrototype,y=p[r];return y===void 0||y.overloadTable===void 0&&y.className!==c.name&&y.argCount===t-2?(v.argCount=t-2,v.className=c.name,p[r]=v):(yr(p,r,m),p[r].overloadTable[t-2]=v),Q([],d,P=>{var R=tr(m,P,c,i,s,f);return p[r].overloadTable===void 0?(R.argCount=t-2,p[r]=R):p[r].overloadTable[t-2]=R,[]}),[]})},dt=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),zn=(e,r,t,n,o,i,s,l,f,d)=>{r=B(r),o=q(n,o),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`,v={get(){pe(`Cannot access ${m} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return f?v.set=()=>pe(`Cannot access ${m} due to unbound types`,[t,s]):v.set=p=>C(m+" is a read-only property"),Object.defineProperty(c.registeredClass.instancePrototype,r,v),Q([],f?[t,s]:[t],p=>{var y=p[0],P={get(){var S=dt(this,c,m+" getter");return y.fromWireType(o(i,S))},enumerable:!0};if(f){f=q(l,f);var R=p[1];P.set=function(S){var b=dt(this,c,m+" setter"),A=[];f(d,b,R.toWireType(A,S)),wr(A)}}return Object.defineProperty(c.registeredClass.instancePrototype,r,P),[]}),[]})},Er=[],ne=[],kr=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,Er.push(e))},Bn=()=>ne.length/2-5-Er.length,Vn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=Bn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=Er.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},qn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return kr(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},ct=e=>te(e,qn),br=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},Gn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(jr[t>>2])};case 8:return function(t){return this.fromWireType(Ir[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Xn=(e,r,t)=>{r=B(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:Gn(r,t),destructorFunction:null})},Kn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=B(e),e=_r(e),o=q(n,o),at(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,f=>{var d=[f[0],null].concat(f.slice(1));return it(e,tr(e,d,null,o,i,s),r-1),[]})},Yn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>H[n];case 2:return t?n=>ee[n>>1]:n=>Be[n>>1];case 4:return t?n=>w[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Qn=(e,r,t,n,o)=>{r=B(r),o===-1&&(o=4294967295);var i=c=>c;if(n===0){var s=32-8*t;i=c=>c<<s>>>s}var l=r.includes("unsigned"),f=(c,m)=>{},d;l?d=function(c,m){return f(m,this.name),m>>>0}:d=function(c,m){return f(m,this.name),m},te(e,{name:r,fromWireType:i,toWireType:d,argPackAdvance:se,readValueFromPointer:Yn(r,t,n!==0),destructorFunction:null})},Zn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=T[s>>2],f=T[s+4>>2];return new o(U.buffer,f,l)}t=B(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Jn=(e,r)=>{ct(e)},eo=(e,r,t,n,o,i,s,l,f,d,c,m)=>{t=B(t),i=q(o,i),l=q(s,l),d=q(f,d),m=q(c,m),Q([e],[r],v=>{v=v[0];var p=new We(t,v.registeredClass,!1,!1,!0,v,n,i,l,d,m);return[p]})},ro=(e,r)=>{r=B(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=T[n>>2],i=n+4,s;if(t)for(var l=i,f=0;f<=o;++f){var d=i+f;if(f==o||H[d]==0){var c=d-l,m=Zr(l,c);s===void 0?s=m:(s+=String.fromCharCode(0),s+=m),l=d+1}}else{for(var v=new Array(o),f=0;f<o;++f)v[f]=String.fromCharCode(H[i+f]);s=v.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=De(o):i=o.length;var l=Cr(4+i+1),f=l+4;if(T[l>>2]=i,t&&s)ce(o,f,i+1);else if(s)for(var d=0;d<i;++d){var c=o.charCodeAt(d);c>255&&(oe(f),C("String has UTF-16 code units that do not fit in 8 bits")),H[f+d]=c}else for(var d=0;d<i;++d)H[f+d]=o[d];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},vt=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,to=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&Be[n];)++n;if(t=n<<1,t-e>32&&vt)return vt.decode(H.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},no=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},oo=e=>e.length*2,ao=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=w[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},io=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(w[r>>2]=s,r+=4,r+4>o)break}return w[r>>2]=0,r-n},so=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},lo=(e,r,t)=>{t=B(t);var n,o,i,s;r===2?(n=to,o=no,s=oo,i=l=>Be[l>>1]):r===4&&(n=ao,o=io,s=so,i=l=>T[l>>2]),te(e,{name:t,fromWireType:l=>{for(var f=T[l>>2],d,c=l+4,m=0;m<=f;++m){var v=l+4+m*r;if(m==f||i(v)==0){var p=v-c,y=n(c,p);d===void 0?d=y:(d+=String.fromCharCode(0),d+=y),c=v+r}}return oe(l),d},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var d=s(f),c=Cr(4+d+r);return T[c>>2]=d/r,o(f,c+4,d+r),l!==null&&l.push(oe,c),c},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},uo=(e,r)=>{r=B(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},fo=1,co=()=>fo,vo=(e,r,t)=>H.copyWithin(e,r,r+t),Ar=[],po=(e,r,t,n)=>(e=Ar[e],r=he.toValue(r),e(null,r,t,n)),ho=e=>{var r=Ar.length;return Ar.push(e),r},pt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${ft(e)}`),t},mo=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=pt(T[r+n*4>>2],"parameter "+n);return t},go=Reflect.construct,yo=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=he.toHandle(n)),o},wo=(e,r,t)=>{var n=mo(e,r),o=n.shift();e--;var i=new Array(e),s=(f,d,c,m)=>{for(var v=0,p=0;p<e;++p)i[p]=n[p].readValueFromPointer(m+v),v+=n[p].argPackAdvance;var y=t===1?go(d,i):d.apply(f,i);return yo(o,c,y)},l=`methodCaller<(${n.map(f=>f.name).join(", ")}) => ${o.name}>`;return ho(Ze(l,s))},_o=e=>{e>9&&(ne[e+1]+=1)},Eo=e=>{var r=he.toValue(e);wr(r),kr(e)},ko=(e,r)=>{e=pt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},je=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function bo(e,r,t){var n=je(e,r),o=new Date(n*1e3);w[t>>2]=o.getUTCSeconds(),w[t+4>>2]=o.getUTCMinutes(),w[t+8>>2]=o.getUTCHours(),w[t+12>>2]=o.getUTCDate(),w[t+16>>2]=o.getUTCMonth(),w[t+20>>2]=o.getUTCFullYear()-1900,w[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;w[t+28>>2]=s}var Ao=e=>e%4===0&&(e%100!==0||e%400===0),Po=[0,31,60,91,121,152,182,213,244,274,305,335],Co=[0,31,59,90,120,151,181,212,243,273,304,334],To=e=>{var r=Ao(e.getFullYear()),t=r?Po:Co,n=t[e.getMonth()]+e.getDate()-1;return n};function Fo(e,r,t){var n=je(e,r),o=new Date(n*1e3);w[t>>2]=o.getSeconds(),w[t+4>>2]=o.getMinutes(),w[t+8>>2]=o.getHours(),w[t+12>>2]=o.getDate(),w[t+16>>2]=o.getMonth(),w[t+20>>2]=o.getFullYear()-1900,w[t+24>>2]=o.getDay();var i=To(o)|0;w[t+28>>2]=i,w[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),f=s.getTimezoneOffset(),d=(l!=f&&o.getTimezoneOffset()==Math.min(f,l))|0;w[t+32>>2]=d}function So(e,r,t,n,o,i,s,l){var f=je(o,i);try{if(isNaN(f))return 61;var d=j.getStreamFromFD(n),c=a.mmap(d,e,f,r,t),m=c.ptr;return w[s>>2]=c.allocated,T[l>>2]=m,0}catch(v){if(typeof a=="undefined"||v.name!=="ErrnoError")throw v;return-v.errno}}function Do(e,r,t,n,o,i,s){var l=je(i,s);try{var f=j.getStreamFromFD(o);t&2&&j.doMsync(e,f,r,n,l)}catch(d){if(typeof a=="undefined"||d.name!=="ErrnoError")throw d;return-d.errno}}var Ro=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),f=s.getTimezoneOffset(),d=Math.max(l,f);T[e>>2]=d*60,w[r>>2]=+(l!=f);var c=p=>p.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],m=c(i),v=c(s);f<l?(ce(m,t,17),ce(v,n,17)):(ce(m,n,17),ce(v,t,17))},$o=()=>Date.now(),ht=()=>2147483648,Mo=()=>ht(),mt;mt=()=>performance.now();var Oo=e=>{var r=ze.buffer,t=(e-r.byteLength+65535)/65536;try{return ze.grow(t),Nr(),1}catch(n){}},Wo=e=>{var r=H.length;e>>>=0;var t=ht();if(e>t)return!1;for(var n=(f,d)=>f+(d-f%d)%d,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=Oo(s);if(l)return!0}return!1},Pr={},jo=()=>me||"./this.program",Ie=()=>{if(!Ie.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:jo()};for(var t in Pr)Pr[t]===void 0?delete r[t]:r[t]=Pr[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Ie.strings=n}return Ie.strings},Io=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},No=(e,r)=>{var t=0;return Ie().forEach((n,o)=>{var i=r+t;T[e+o*4>>2]=i,Io(n,i),t+=n.length+1}),0},xo=(e,r)=>{var t=Ie();T[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),T[r>>2]=n,0},Uo=0,Lo=()=>Vt||Uo>0,Ho=e=>{var r;lr=e,Lo()||((r=u.onExit)==null||r.call(u,e),sr=!0),Ce(e,new Bt(e))},zo=(e,r)=>{lr=e,Ho(e)},Bo=zo;function Vo(e){try{var r=j.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function qo(e,r){try{var t=0,n=0,o=0,i=j.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,W=[t>>>0,(_=t,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+8>>2]=W[0],w[r+12>>2]=W[1],W=[n>>>0,(_=n,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+16>>2]=W[0],w[r+20>>2]=W[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Go=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.read(e,U,s,l,n);if(f<0)return-1;if(o+=f,f<l)break;typeof n!="undefined"&&(n+=f)}return o};function Xo(e,r,t,n){try{var o=j.getStreamFromFD(e),i=Go(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Ko(e,r,t,n,o){var i=je(r,t);try{if(isNaN(i))return 61;var s=j.getStreamFromFD(e);return a.llseek(s,i,n),W=[s.position>>>0,(_=s.position,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[o>>2]=W[0],w[o+4>>2]=W[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Yo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.write(e,U,s,l,n);if(f<0)return-1;o+=f,typeof n!="undefined"&&(n+=f)}return o};function Qo(e,r,t,n){try{var o=j.getStreamFromFD(e),i=Yo(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var Zo=a.createPath,Jo=e=>a.unlink(e),ea=a.createLazyFile,ra=a.createDevice;a.createPreloadedFile=Qr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,vn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},et=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Pn(),En(),Mn(),ut=u.UnboundTypeError=In(Error,"UnboundTypeError"),Vn();var ta={a:Xt,q:nn,M:on,P:an,I:sn,r:ln,G:un,N:fn,S:dn,D:cn,U:hn,e:Nn,s:Un,n:Ln,g:Hn,m:zn,T:ct,v:Xn,i:Kn,c:Qn,b:Zn,x:Jn,o:eo,u:ro,l:lo,V:uo,Q:co,R:vo,X:po,d:kr,Y:wo,w:_o,W:Eo,h:ko,A:bo,B:Fo,y:So,z:Do,H:Ro,t:$o,F:Mo,j:mt,E:Wo,K:No,L:xo,f:Bo,k:Vo,J:qo,O:Xo,C:Ko,p:Qo},N=zt(),na=()=>(na=N._)(),gt=e=>(gt=N.$)(e),Cr=e=>(Cr=N.ba)(e),oe=e=>(oe=N.ca)(e),yt=(e,r)=>(yt=N.da)(e,r),wt=e=>(wt=N.ea)(e),oa=u.dynCall_jjj=(e,r,t,n,o)=>(oa=u.dynCall_jjj=N.fa)(e,r,t,n,o),aa=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(aa=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),ia=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(ia=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),sa=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,f,d,c,m)=>(sa=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,f,d,c,m),la=u.dynCall_iji=(e,r,t,n)=>(la=u.dynCall_iji=N.ja)(e,r,t,n),ua=u.dynCall_jiji=(e,r,t,n,o)=>(ua=u.dynCall_jiji=N.ka)(e,r,t,n,o),fa=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(fa=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),da=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(da=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),ca=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,f)=>(ca=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,f),va=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,f,d)=>(va=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,f,d);u.addRunDependency=Ve,u.removeRunDependency=Se,u.FS_createPreloadedFile=Qr,u.FS_unlink=Jo,u.FS_createPath=Zo,u.FS_createDevice=ra,u.FS_createDataFile=Yr,u.FS_createLazyFile=ea;var or;Fe=function e(){or||_t(),or||(Fe=e)};function _t(){if(de>0||($t(),de>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!sr&&(Mt(),I(u),(r=u.onRuntimeInitialized)==null||r.call(u),Ot()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return _t(),E=K,E}})();typeof Ft=="object"&&typeof Fr=="object"?Fr.exports=Tr:typeof define=="function"&&define.amd&&define([],()=>Tr);Tr.getUrl=function(F){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+F}});var Aa={};_a(Aa,{EffectVmojiLmarksAi:()=>Ae,EffectVmojiLmarksVolume:()=>be,EffectVoiceChange:()=>Pe,EffectVoiceChangeMode:()=>$r,VoiceChangeEffectType:()=>Mr});module.exports=Ea(Aa);var Le=class{constructor(g,h="AudioEffects"){this.loggerFunction=g,this.loggerName=h}debug(...g){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...g)}log(...g){this.loggerFunction("LOG",`[${this.loggerName}]`,...g)}warn(...g){this.loggerFunction("WARN",`[${this.loggerName}]`,...g)}error(...g){this.loggerFunction("ERROR",`[${this.loggerName}]`,...g)}};function ir(F,g=[]){let h=g.join(","),E=typeof F=="string"?[F,`exports.default(${h});`]:[`(${F})(${h});`],u=new Blob(E,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Le(()=>{})}init(V){return Z(this,arguments,function*({sampleRate:g,isOutputAudio:h=!1,isOutputStream:E=!1,workletFunction:u,workletName:I}){if(this.logger.debug("init"),this.createAudioContext(g),yield this.createWorklet(u,I),this.workletNode&&this.audioContext&&(h&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),E)){let K=this.audioContext.createMediaStreamDestination();this.workletNode.connect(K),this.outputStream=K.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(g){var h;if(this.audioContext&&this.workletNode){let E=null;if(g){let u=new MediaStream(g instanceof MediaStreamTrack?[g]:g.getAudioTracks().filter(I=>I.contentHint!=="music"));E=this.audioContext.createMediaStreamSource(u)}(h=this.sourceNode)==null||h.disconnect(this.workletNode),E==null||E.connect(this.workletNode),this.sourceNode=E,this.logger.debug("source "+(g?"set":"set to null"))}}destroy(){var g;this.logger.debug("destroy"),(g=this.audioContext)==null||g.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null,this.isInitialized=!1}resume(){var g;this.logger.debug("resume"),(g=this.audioContext)==null||g.resume()}pause(){var g;this.logger.debug("pause"),(g=this.audioContext)==null||g.suspend()}setLogger(g=()=>{},h){this.logger=new Le(g,h)}static isSupported(){try{let g=window;return!!(g.WebAssembly&&g.Worker&&(g.AudioContext||g.webkitAudioContext)&&g.AudioWorkletNode)}catch(g){return!1}}createAudioContext(g){let h=window.AudioContext||window.webkitAudioContext,E=new h(g?{sampleRate:g}:{});this.audioContext=E,this.logger.debug("created AudioContext")}createWorklet(g,h){return Z(this,null,function*(){if(this.logger.debug(`${h} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ir(g));let E=new AudioWorkletNode(this.audioContext,h);return this.workletNode=E,new Promise(u=>{E.port.onmessage=({data:I})=>{switch(I.type){case"init":{this.logger.debug(`${h} init success`),u();break}case"data":{this.onWorkletData(I.data);break}}}})})}sendDataToWorklet(g,h=[]){var E;(E=this.workletNode)==null||E.port.postMessage(g,h)}};function Tt(){let G=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],J=G[59],Or=1-G[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let Ce=currentTime,X=0,fe=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(fe!=null&&fe.length&&(X=fe.reduce((ae,z)=>ae+Math.abs(z),0)/fe.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+X)/(this.frameSampleCount+1),this.frameSampleCount+=1,Ce-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(G[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=J+Or*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=Ce;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var be=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(be.prototype,this,"init").call(this,{workletFunction:Tt,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(h){this.onData(h)}};var Dr=Pt(Sr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null}init(h){return Z(this,null,function*(){yield le(ue.prototype,this,"init").call(this,h),this.isInitialized=!1,yield this.createWorker(h.workerFunctionString,h.workerArgs),this.isInitialized=!0})}destroy(){var h;super.destroy(),(h=this.worker)==null||h.terminate(),this.worker=null}sendDataToWorker(h,E=[]){var u;(u=this.worker)==null||u.postMessage(h,E)}static isSupported(){try{let h=window;return!!(super.isSupported()&&h.Worker)}catch(h){return!1}}createWorker(h,E=[]){return new Promise((u,I)=>{this.logger.debug("worker init started"),this.worker=new Worker(ir(h,E)),this.worker.onmessage=({data:V})=>{switch(V.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(V.error),I(V.error);break}case"data":{this.onWorkerData(V.data);break}case"debug":{this.logger.debug(V.message);break}}}})}};function St(){class F extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(h){var E;return(E=h==null?void 0:h[0])!=null&&E[0]&&this.port.postMessage({type:"data",data:h[0][0].buffer},[h[0][0].buffer]),!0}}registerProcessor("pureWorklet",F)}var ka=16e3,Ae=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(Ae.prototype,this,"init").call(this,{sampleRate:ka,workletFunction:St,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)g(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of m(t))!f.call(o,i)&&i!==e&&g(o,i,{get:()=>t[i],enumerable:!(n=w(t,i))||n.enumerable});return o};var A=o=>y(g({},"__esModule",{value:!0}),o);var v={};b(v,{default:()=>x});var x=(o,t)=>{let e=null,n=null;function i(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);n=e.AnimojiFactory.createAlgorithm(s)})}function p(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!n))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(n,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){p(s)}}i().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(p)};return A(v);})();
|
|
9
|
+
`,workerArgs:[Dr.default,Dr.default.getUrl]})})}onWorkletData(h){this.sendDataToWorker({data:h},[h])}onWorkerData(h){this.onData(h)}static isSupported(){try{let h=super.isSupported(),E=/firefox/i.test(navigator.userAgent);return h&&!E}catch(h){return!1}}};var Rr=Pt(Sr());function Dt(){class F extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:E}})=>{let u=new Float32Array(E),I=new Float32Array(this.samplesQueue.length+u.length);I.set(this.samplesQueue,0),I.set(u,this.samplesQueue.length),this.samplesQueue=I}}process(E,u){var I;return(I=E==null?void 0:E[0])!=null&&I[0]&&this.port.postMessage({type:"data",data:E[0][0].buffer},[E[0][0].buffer]),this.samplesQueue.length>=128&&(u[0].forEach(K=>{K.set(this.samplesQueue.subarray(0,128))}),this.samplesQueue=this.samplesQueue.slice(128)),!0}}registerProcessor("voiceChangeWorklet",F)}var $r=(h=>(h.PLAYBACK="playback",h.OUTPUT_STREAM="output_stream",h))($r||{}),Mr=(L=>(L.BALLOON="balloon",L.CATHEDRAL="cathedral",L.CHORUS="chorus",L.DISTORTION="distortion",L.ECHO="echo",L.EVIL="evil",L.GIANT="giant",L.HALL="hall",L.PHASER="phaser",L.ROBOT="robot",L.SQUIRELL="squirell",L.DENOISE="denoise",L))(Mr||{}),ba=44100,Pe=class extends ue{constructor(h="playback"){super();this.mode=h}init(){return Z(this,null,function*(){yield le(Pe.prototype,this,"init").call(this,{sampleRate:ba,isOutputAudio:this.mode==="playback",isOutputStream:this.mode==="output_stream",workletFunction:Dt,workletName:"voiceChangeWorklet",workerFunctionString:'"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var W=(n,r)=>{for(var t in r)p(n,t,{get:r[t],enumerable:!0})},A=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of y(r))!b.call(n,c)&&c!==t&&p(n,c,{get:()=>r[c],enumerable:!(i=m(r,c))||i.enumerable});return n};var R=n=>A(p({},"__esModule",{value:!0}),n);var S={};W(S,{VoiceChangeWorkerRequestType:()=>f,default:()=>E});var f=(t=>(t.SET_EFFECTS="set_effects",t.DATA="data",t))(f||{}),E=(n,r)=>{let t=null,i=[];function c(){return n({locateFile:r}).then(e=>{t=e})}function k(e,a=!1){if(t)try{for(let o of e){let g=`${o}${a?".cfg":""}`,u=new t.ConfigInput(g,a,"/"),l=new t.Config(u),s=t.EffectFactory.createAlgorithm(l);i.push({configInput:u,config:l,effect:s})}}catch(o){self.postMessage({type:"debug",message:"before error "+JSON.stringify(i)}),d("setEffects error:",o)}}function h(){try{for(let e of i)e.configInput.delete(),e.config.delete(),e.effect.delete()}catch(e){d("clearEffects error:",e)}i=[]}function d(e,a){self.postMessage({type:"error",error:typeof a=="number"&&t?t.getExMessage(a):e+a})}function w(e){var a;if(!(!t||!i.length))try{let o=new t.vector$float$,g=new Float32Array(e);for(let s of g)o.push_back(s);for(let{effect:s}of i)o=t.applyEffect(s,o);let u=(a=o==null?void 0:o.size)==null?void 0:a.call(o);if(!u)return;let l=new Float32Array(u);for(let s=0;s<u;s++)l[s]=o.get(s);self.postMessage({type:"data",data:l.buffer},[l.buffer])}catch(o){d("requestSamples error:",o)}}c().then(()=>{self.onmessage=({data:e})=>{switch(e.type){case"set_effects":{h(),k(e.effects,e.isPreset);break}case"data":{w(e.data);break}}},self.postMessage({type:"init"})}).catch(e=>d("init error:",e))};return R(S);})();\n',workerArgs:[Rr.default,Rr.default.getUrl]})})}setEffects(h,E){this.logger.debug("setEffects",h,E),this.sendDataToWorker({type:"set_effects",effects:h,isPreset:E})}onWorkletData(h){this.sendDataToWorker({type:"data",data:h},[h])}onWorkerData(h){this.sendDataToWorklet({data:h},[h])}};
|
package/audio-effects.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/calls-audio-effects v1.1.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-audio-effects v1.1.5
|
|
3
|
+
* Fri, 12 Jul 2024 14:28:41 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
var va=Object.create;var _t=Object.defineProperty;var pa=Object.getOwnPropertyDescriptor;var ha=Object.getOwnPropertyNames;var Et=Object.getPrototypeOf,ma=Object.prototype.hasOwnProperty;var ga=Reflect.get;var ya=(R,g)=>()=>(g||R((g={exports:{}}).exports,g),g.exports);var wa=(R,g,h,E)=>{if(g&&typeof g=="object"||typeof g=="function")for(let u of ha(g))!ma.call(R,u)&&u!==h&&_t(R,u,{get:()=>g[u],enumerable:!(E=pa(g,u))||E.enumerable});return R};var kt=(R,g,h)=>(h=R!=null?va(Et(R)):{},wa(g||!R||!R.__esModule?_t(h,"default",{value:R,enumerable:!0}):h,R));var le=(R,g,h)=>ga(Et(R),h,g);var Z=(R,g,h)=>new Promise((E,u)=>{var I=G=>{try{K(h.next(G))}catch(J){u(J)}},V=G=>{try{K(h.throw(G))}catch(J){u(J)}},K=G=>G.done?E(G.value):Promise.resolve(G.value).then(I,V);K((h=h.apply(R,g)).next())});var Fr=ya((Pt,Tr)=>{var Cr=(()=>{var g;var R=typeof document!="undefined"?(g=document.currentScript)==null?void 0:g.src:void 0;return function(h={}){var E,u=h,I,V,K=new Promise((e,r)=>{I=e,V=r}),G=typeof window=="object",J=typeof importScripts=="function",Rr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";u.expectedDataFileDownloads||(u.expectedDataFileDownloads=0),u.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD!="undefined"&&ENVIRONMENT_IS_PTHREAD,r=typeof ENVIRONMENT_IS_WASM_WORKER!="undefined"&&ENVIRONMENT_IS_WASM_WORKER;if(e||r)return;function t(n){var o="";typeof window=="object"?o=window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process=="undefined"&&typeof location!="undefined"&&(o=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"));var i="wasm_bindings.data",s="wasm_bindings.data";typeof u.locateFilePackage=="function"&&!u.locateFile&&(u.locateFile=u.locateFilePackage,z("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var l=u.locateFile?u.locateFile(s,""):s,f=n.remote_package_size;function d(y,P,D,F){var b=new XMLHttpRequest;b.open("GET",y,!0),b.responseType="arraybuffer",b.onprogress=function(A){var yt,wt;var M=y,S=P;if(A.total&&(S=A.total),A.loaded){b.addedTotal?u.dataFileDownloads[M].loaded=A.loaded:(b.addedTotal=!0,u.dataFileDownloads||(u.dataFileDownloads={}),u.dataFileDownloads[M]={loaded:A.loaded,total:S});var x=0,O=0,We=0;for(var je in u.dataFileDownloads){var Ie=u.dataFileDownloads[je];x+=Ie.total,O+=Ie.loaded,We++}x=Math.ceil(x*u.expectedDataFileDownloads/We),(yt=u.setStatus)==null||yt.call(u,`Downloading data... (${O}/${x})`)}else u.dataFileDownloads||(wt=u.setStatus)==null||wt.call(u,"Downloading data...")},b.onerror=function(A){throw new Error("NetworkError for: "+y)},b.onload=function(A){if(b.status==200||b.status==304||b.status==206||b.status==0&&b.response){var M=b.response;D(M)}else throw new Error(b.statusText+" : "+b.responseURL)},b.send(null)}function c(y){console.error("package error:",y)}var m=null,v=u.getPreloadedPackage?u.getPreloadedPackage(l,f):null;v||d(l,f,function(y){m?(m(y),m=null):v=y},c);function p(y){function P(M,S){if(!M)throw S+new Error().stack}function D(M,S,x){this.start=M,this.end=S,this.audio=x}D.prototype={requests:{},open:function(M,S){this.name=S,this.requests[S]=this,y.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var M=this.byteArray.subarray(this.start,this.end);this.finish(M)},finish:function(M){var S=this;y.FS_createDataFile(this.name,null,M,!0,!0,!0),y.removeRunDependency(`fp ${S.name}`),this.requests[this.name]=null}};for(var F=n.files,b=0;b<F.length;++b)new D(F[b].start,F[b].end,F[b].audio||0).open("GET",F[b].filename);function A(M){P(M,"Loading data file failed."),P(M.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var S=new Uint8Array(M);D.prototype.byteArray=S;for(var x=n.files,O=0;O<x.length;++O)D.prototype.requests[x[O].filename].onload();y.removeRunDependency("datafile_wasm_bindings.data")}y.addRunDependency("datafile_wasm_bindings.data"),y.preloadResults||(y.preloadResults={}),y.preloadResults[i]={fromCache:!1},v?(A(v),v=null):m=A}u.calledRun?p(u):(u.preRun||(u.preRun=[]),u.preRun.push(p))}t({files:[{filename:"/animoji_v4.cfg",start:0,end:333},{filename:"/balloon.cfg",start:333,end:409},{filename:"/cathedral.cfg",start:409,end:586},{filename:"/chorus.cfg",start:586,end:865},{filename:"/denoise.cfg",start:865,end:3258},{filename:"/df2_lstm_full_silent.tflite",start:3258,end:3169978},{filename:"/distortion.cfg",start:3169978,end:3170120},{filename:"/echo.cfg",start:3170120,end:3170257},{filename:"/evil.cfg",start:3170257,end:3170398},{filename:"/giant.cfg",start:3170398,end:3170474},{filename:"/hall.cfg",start:3170474,end:3170647},{filename:"/phaser.cfg",start:3170647,end:3170747},{filename:"/robot.cfg",start:3170747,end:3170887},{filename:"/squirell.cfg",start:3170887,end:3170963},{filename:"/wav2lip_lite_rec-v4-v2.tflite",start:3170963,end:7456043}],remote_package_size:7456043})})();var He=null,L=Object.assign({},u),$r=[],me="./this.program",be=(e,r)=>{throw r},X="";function fe(e){return u.locateFile?u.locateFile(e,X):X+e}var ge,Y;(G||J)&&(J?X=self.location.href:typeof document!="undefined"&&document.currentScript&&(X=document.currentScript.src),He&&(X=He),X.startsWith("blob:")?X="":X=X.substr(0,X.replace(/[?#].*/,"").lastIndexOf("/")+1),J&&(Y=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),ge=e=>fetch(e,{credentials:"same-origin"}).then(r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var ae=u.print||console.log.bind(console),z=u.printErr||console.error.bind(console);Object.assign(u,L),L=null,u.arguments&&($r=u.arguments),u.thisProgram&&(me=u.thisProgram),u.quit&&(be=u.quit);var Ae;u.wasmBinary&&(Ae=u.wasmBinary);var ze,ir=!1,sr,U,H,ee,Be,w,T,Mr,Or;function Wr(){var e=ze.buffer;u.HEAP8=U=new Int8Array(e),u.HEAP16=ee=new Int16Array(e),u.HEAPU8=H=new Uint8Array(e),u.HEAPU16=Be=new Uint16Array(e),u.HEAP32=w=new Int32Array(e),u.HEAPU32=T=new Uint32Array(e),u.HEAPF32=Mr=new Float32Array(e),u.HEAPF64=Or=new Float64Array(e)}var jr=[],Ir=[],Nr=[],Dt=!1;function Rt(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Ot(u.preRun.shift());fr(jr)}function $t(){Dt=!0,!u.noFSInit&&!a.init.initialized&&a.init(),a.ignorePermissions=!1,ie.init(),fr(Ir)}function Mt(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)jt(u.postRun.shift());fr(Nr)}function Ot(e){jr.unshift(e)}function Wt(e){Ir.unshift(e)}function jt(e){Nr.unshift(e)}var de=0,lr=null,Pe=null;function ka(e){return e}function Ve(e){var r;de++,(r=u.monitorRunDependencies)==null||r.call(u,de)}function Ce(e){var t;if(de--,(t=u.monitorRunDependencies)==null||t.call(u,de),de==0&&(lr!==null&&(clearInterval(lr),lr=null),Pe)){var r=Pe;Pe=null,r()}}function ur(e){var t;(t=u.onAbort)==null||t.call(u,e),e="Aborted("+e+")",z(e),ir=!0,sr=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw V(r),r}var It="data:application/octet-stream;base64,",xr=e=>e.startsWith(It);function Nt(){var e="wasm_bindings.wasm";return xr(e)?e:fe(e)}var qe;function Ur(e){if(e==qe&&Ae)return new Uint8Array(Ae);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}function xt(e){return Ae?Promise.resolve().then(()=>Ur(e)):ge(e).then(r=>new Uint8Array(r),()=>Ur(e))}function Lr(e,r,t){return xt(e).then(n=>WebAssembly.instantiate(n,r)).then(t,n=>{z(`failed to asynchronously prepare wasm: ${n}`),ur(n)})}function Ut(e,r,t,n){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!xr(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,t);return i.then(n,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),Lr(r,t,n)})}):Lr(r,t,n)}function Lt(){return{a:ra}}function Ht(){var e=Lt();function r(n,o){return N=n.exports,ze=N.Z,Wr(),ot=N.aa,Wt(N._),Ce("wasm-instantiate"),N}Ve("wasm-instantiate");function t(n){r(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(e,r)}catch(n){z(`Module.instantiateWasm callback failed with error: ${n}`),V(n)}return qe||(qe=Nt()),Ut(Ae,qe,e,t).catch(V),{}}var _,W;function zt(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var fr=e=>{for(;e.length>0;)e.shift()(u)},Bt=u.noExitRuntime||!0;class Vt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){T[this.ptr+4>>2]=r}get_type(){return T[this.ptr+4>>2]}set_destructor(r){T[this.ptr+8>>2]=r}get_destructor(){return T[this.ptr+8>>2]}set_caught(r){r=r?1:0,U[this.ptr+12]=r}get_caught(){return U[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,U[this.ptr+13]=r}get_rethrown(){return U[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){T[this.ptr+16>>2]=r}get_adjusted_ptr(){return T[this.ptr+16>>2]}get_exception_ptr(){var r=mt(this.get_type());if(r)return T[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Hr=0,qt=0,Gt=(e,r,t)=>{var n=new Vt(e);throw n.init(r,t),Hr=e,qt++,Hr};function Ge(){var e=w[+j.varargs>>2];return j.varargs+=4,e}var ye=Ge,$={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];o==="."?e.splice(n,1):o===".."?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=$.isAbs(e),t=e.substr(-1)==="/";return e=$.normalizeArray(e.split("/").filter(n=>!!n),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=$.splitPath(e),t=r[0],n=r[1];return!t&&!n?".":(n&&(n=n.substr(0,n.length-1)),t+n)},basename:e=>{if(e==="/")return"/";e=$.normalize(e),e=e.replace(/\/$/,"");var r=e.lastIndexOf("/");return r===-1?e:e.substr(r+1)},join:(...e)=>$.normalize(e.join("/")),join2:(e,r)=>$.normalize(e+"/"+r)},Xt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ur("initRandomDevice")},zr=e=>(zr=Xt())(e),re={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:a.cwd();if(typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=$.isAbs(o)}return r=$.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=re.resolve(e).substr(1),r=re.resolve(r).substr(1);function t(d){for(var c=0;c<d.length&&d[c]==="";c++);for(var m=d.length-1;m>=0&&d[m]==="";m--);return c>m?[]:d.slice(c,m-c+1)}for(var n=t(e.split("/")),o=t(r.split("/")),i=Math.min(n.length,o.length),s=i,l=0;l<i;l++)if(n[l]!==o[l]){s=l;break}for(var f=[],l=s;l<n.length;l++)f.push("..");return f=f.concat(o.slice(s)),f.join("/")}},Br=typeof TextDecoder!="undefined"?new TextDecoder:void 0,we=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&Br)return Br.decode(e.subarray(r,o));for(var i="";r<o;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var f=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|f:s=(s&7)<<18|l<<12|f<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var d=s-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},dr=[],Te=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},cr=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,i=t+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343){var f=e.charCodeAt(++s);l=65536+((l&1023)<<10)|f&1023}if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63}}return r[t]=0,t-o};function Vr(e,r,t){var n=t>0?t:Te(e)+1,o=new Array(n),i=cr(e,o,0,o.length);return r&&(o.length=i),o}var Kt=()=>{if(!dr.length){var e=null;if(typeof window!="undefined"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
7
7
|
`)),!e)return null;dr=Vr(e,!0)}return dr.shift()},ie={ttys:[],init(){},shutdown(){},register(e,r){ie.ttys[e]={input:[],output:[],ops:r},a.registerDevice(e,ie.stream_ops)},stream_ops:{open(e){var r=ie.ttys[e.node.rdev];if(!r)throw new a.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,n,o){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var i=0,s=0;s<n;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch(f){throw new a.ErrnoError(29)}if(l===void 0&&i===0)throw new a.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.timestamp=Date.now()),i},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch(s){throw new a.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char(e){return Kt()},put_char(e,r){r===null||r===10?(ae(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(ae(we(e.output,0)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(z(we(e.output,0)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(z(we(e.output,0)),e.output=[])}}},Yt=(e,r)=>(H.fill(0,e,e+r),e),Qt=(e,r)=>Math.ceil(e/r)*r,qr=e=>{e=Qt(e,65536);var r=ht(65536,e);return r?Yt(r,e):0},k={ops_table:null,mount(e){return k.createNode(null,"/",16895,0)},createNode(e,r,t,n){if(a.isBlkdev(t)||a.isFIFO(t))throw new a.ErrnoError(63);k.ops_table||(k.ops_table={dir:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,lookup:k.node_ops.lookup,mknod:k.node_ops.mknod,rename:k.node_ops.rename,unlink:k.node_ops.unlink,rmdir:k.node_ops.rmdir,readdir:k.node_ops.readdir,symlink:k.node_ops.symlink},stream:{llseek:k.stream_ops.llseek}},file:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:{llseek:k.stream_ops.llseek,read:k.stream_ops.read,write:k.stream_ops.write,allocate:k.stream_ops.allocate,mmap:k.stream_ops.mmap,msync:k.stream_ops.msync}},link:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr,readlink:k.node_ops.readlink},stream:{}},chrdev:{node:{getattr:k.node_ops.getattr,setattr:k.node_ops.setattr},stream:a.chrdev_stream_ops}});var o=a.createNode(e,r,t,n);return a.isDir(o.mode)?(o.node_ops=k.ops_table.dir.node,o.stream_ops=k.ops_table.dir.stream,o.contents={}):a.isFile(o.mode)?(o.node_ops=k.ops_table.file.node,o.stream_ops=k.ops_table.file.stream,o.usedBytes=0,o.contents=null):a.isLink(o.mode)?(o.node_ops=k.ops_table.link.node,o.stream_ops=k.ops_table.link.stream):a.isChrdev(o.mode)&&(o.node_ops=k.ops_table.chrdev.node,o.stream_ops=k.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray(e){return 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)){var n=1024*1024;r=Math.max(r,t*(t<n?2:1.125)>>>0),t!=0&&(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(r==0)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=a.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,a.isDir(e.mode)?r.size=4096:a.isFile(e.mode)?r.size=e.usedBytes:a.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){r.mode!==void 0&&(e.mode=r.mode),r.timestamp!==void 0&&(e.timestamp=r.timestamp),r.size!==void 0&&k.resizeFileStorage(e,r.size)},lookup(e,r){throw a.genericErrors[44]},mknod(e,r,t,n){return k.createNode(e,r,t,n)},rename(e,r,t){if(a.isDir(e.mode)){var n;try{n=a.lookupNode(r,t)}catch(i){}if(n)for(var o in n.contents)throw new a.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},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=a.lookupNode(e,r);for(var n in t.contents)throw new a.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=k.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)r.set(i.subarray(o,o+s),t);else for(var l=0;l<s;l++)r[t+l]=i[o+l];return s},write(e,r,t,n,o,i){if(r.buffer===U.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(s.usedBytes===0&&o===0)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(k.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var l=0;l<n;l++)s.contents[o+l]=r[t+l];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(t===1?n+=e.position:t===2&&a.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new a.ErrnoError(28);return n},allocate(e,r,t){k.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var i,s,l=e.node.contents;if(!(o&2)&&l.buffer===U.buffer)s=!1,i=l.byteOffset;else{if((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),s=!0,i=qr(r),!i)throw new a.ErrnoError(48);U.set(l,i)}return{ptr:i,allocated:s}},msync(e,r,t,n,o){return k.stream_ops.write(e,r,0,n,t,!1),0}}},Zt=(e,r,t,n)=>{var o=n?"":`al ${e}`;ge(e).then(i=>{r(new Uint8Array(i)),o&&Ce(o)},i=>{if(t)t();else throw`Loading data file "${e}" failed.`}),o&&Ve(o)},Gr=(e,r,t,n,o,i)=>{a.createDataFile(e,r,t,n,o,i)},Jt=u.preloadPlugins||[],en=(e,r,t,n)=>{typeof Browser!="undefined"&&Browser.init();var o=!1;return Jt.forEach(i=>{o||i.canHandle(r)&&(i.handle(e,r,t,n),o=!0)}),o},Xr=(e,r,t,n,o,i,s,l,f,d)=>{var c=r?re.resolve($.join2(e,r)):e,m=`cp ${c}`;function v(p){function y(P){d==null||d(),l||Gr(e,r,P,n,o,f),i==null||i(),Ce(m)}en(p,c,y,()=>{s==null||s(),Ce(m)})||y(p)}Ve(m),typeof t=="string"?Zt(t,v,s):v(t)},rn=e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t=="undefined")throw new Error(`Unknown file open mode: ${e}`);return t},vr=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,r={}){if(e=re.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(r=Object.assign(t,r),r.recurse_count>8)throw new a.ErrnoError(32);for(var n=e.split("/").filter(m=>!!m),o=a.root,i="/",s=0;s<n.length;s++){var l=s===n.length-1;if(l&&r.parent)break;if(o=a.lookupNode(o,n[s]),i=$.join2(i,n[s]),a.isMountpoint(o)&&(!l||l&&r.follow_mount)&&(o=o.mounted.root),!l||r.follow)for(var f=0;a.isLink(o.mode);){var d=a.readlink(i);i=re.resolve($.dirname(i),d);var c=a.lookupPath(i,{recurse_count:r.recurse_count+1});if(o=c.node,f++>40)throw new a.ErrnoError(32)}}return{path:i,node:o}},getPath(e){for(var r;;){if(a.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,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%a.nameTable.length},hashAddNode(e){var r=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[r],a.nameTable[r]=e},hashRemoveNode(e){var r=a.hashName(e.parent.id,e.name);if(a.nameTable[r]===e)a.nameTable[r]=e.name_next;else for(var t=a.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=a.mayLookup(e);if(t)throw new a.ErrnoError(t);for(var n=a.hashName(e.id,r),o=a.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===r)return o}return a.lookup(e,r)},createNode(e,r,t,n){var o=new a.FSNode(e,r,t,n);return a.hashAddNode(o),o},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return a.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var r=a.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{var t=a.lookupNode(e,r);return 20}catch(n){}return a.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=a.lookupNode(e,r)}catch(i){return i.errno}var o=a.nodePermissions(e,"wx");if(o)return o;if(t){if(!a.isDir(n.mode))return 54;if(a.isRoot(n)||a.getPath(n)===a.cwd())return 10}else if(a.isDir(n.mode))return 31;return 0},mayOpen(e,r){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(r)!=="r"||r&512)?31:a.nodePermissions(e,a.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var r=a.getStream(e);if(!r)throw new a.ErrnoError(8);return r},getStream:e=>a.streams[e],createStream(e,r=-1){return e=Object.assign(new a.FSStream,e),r==-1&&(r=a.nextfd()),e.fd=r,a.streams[r]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,r=-1){var n,o;var t=a.createStream(e,r);return(o=(n=t.stream_ops)==null?void 0:n.dup)==null||o.call(n,t),t},chrdev_stream_ops:{open(e){var t,n;var r=a.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,(n=(t=e.stream_ops).open)==null||n.call(t,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){a.devices[e]={stream_ops:r}},getDevice:e=>a.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&z(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=a.getMounts(a.root.mount),n=0;function o(s){return a.syncFSRequests--,r(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,o(s));++n>=t.length&&o(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,e,i)})},mount(e,r,t){var n=t==="/",o=!t,i;if(n&&a.root)throw new a.ErrnoError(10);if(!n&&!o){var s=a.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,a.isMountpoint(i))throw new a.ErrnoError(10);if(!a.isDir(i.mode))throw new a.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},f=e.mount(l);return f.mount=l,l.root=f,n?a.root=f:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),f},unmount(e){var r=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(r.node))throw new a.ErrnoError(28);var t=r.node,n=t.mounted,o=a.getMounts(n);Object.keys(a.nameTable).forEach(s=>{for(var l=a.nameTable[s];l;){var f=l.name_next;o.includes(l.mount)&&a.destroyNode(l),l=f}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var n=a.lookupPath(e,{parent:!0}),o=n.node,i=$.basename(e);if(!i||i==="."||i==="..")throw new a.ErrnoError(28);var s=a.mayCreate(o,i);if(s)throw new a.ErrnoError(s);if(!o.node_ops.mknod)throw new a.ErrnoError(63);return o.node_ops.mknod(o,i,r,t)},create(e,r){return r=r!==void 0?r:438,r&=4095,r|=32768,a.mknod(e,r,0)},mkdir(e,r){return r=r!==void 0?r:511,r&=1023,r|=16384,a.mknod(e,r,0)},mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{a.mkdir(n,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t=="undefined"&&(t=r,r=438),r|=8192,a.mknod(e,r,t)},symlink(e,r){if(!re.resolve(e))throw new a.ErrnoError(44);var t=a.lookupPath(r,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var o=$.basename(r),i=a.mayCreate(n,o);if(i)throw new a.ErrnoError(i);if(!n.node_ops.symlink)throw new a.ErrnoError(63);return n.node_ops.symlink(n,o,e)},rename(e,r){var t=$.dirname(e),n=$.dirname(r),o=$.basename(e),i=$.basename(r),s,l,f;if(s=a.lookupPath(e,{parent:!0}),l=s.node,s=a.lookupPath(r,{parent:!0}),f=s.node,!l||!f)throw new a.ErrnoError(44);if(l.mount!==f.mount)throw new a.ErrnoError(75);var d=a.lookupNode(l,o),c=re.relative(e,n);if(c.charAt(0)!==".")throw new a.ErrnoError(28);if(c=re.relative(r,t),c.charAt(0)!==".")throw new a.ErrnoError(55);var m;try{m=a.lookupNode(f,i)}catch(y){}if(d!==m){var v=a.isDir(d.mode),p=a.mayDelete(l,o,v);if(p)throw new a.ErrnoError(p);if(p=m?a.mayDelete(f,i,v):a.mayCreate(f,i),p)throw new a.ErrnoError(p);if(!l.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(d)||m&&a.isMountpoint(m))throw new a.ErrnoError(10);if(f!==l&&(p=a.nodePermissions(l,"w"),p))throw new a.ErrnoError(p);a.hashRemoveNode(d);try{l.node_ops.rename(d,f,i),d.parent=f}catch(y){throw y}finally{a.hashAddNode(d)}}},rmdir(e){var r=a.lookupPath(e,{parent:!0}),t=r.node,n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!0);if(i)throw new a.ErrnoError(i);if(!t.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.rmdir(t,n),a.destroyNode(o)},readdir(e){var r=a.lookupPath(e,{follow:!0}),t=r.node;if(!t.node_ops.readdir)throw new a.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var r=a.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new a.ErrnoError(44);var n=$.basename(e),o=a.lookupNode(t,n),i=a.mayDelete(t,n,!1);if(i)throw new a.ErrnoError(i);if(!t.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(o))throw new a.ErrnoError(10);t.node_ops.unlink(t,n),a.destroyNode(o)},readlink(e){var r=a.lookupPath(e),t=r.node;if(!t)throw new a.ErrnoError(44);if(!t.node_ops.readlink)throw new a.ErrnoError(28);return re.resolve(a.getPath(t.parent),t.node_ops.readlink(t))},stat(e,r){var t=a.lookupPath(e,{follow:!r}),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.getattr)throw new a.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return a.stat(e,!0)},chmod(e,r,t){var n;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!t});n=o.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);n.node_ops.setattr(n,{mode:r&4095|n.mode&-4096,timestamp:Date.now()})},lchmod(e,r){a.chmod(e,r,!0)},fchmod(e,r){var t=a.getStreamChecked(e);a.chmod(t.node,r)},chown(e,r,t,n){var o;if(typeof e=="string"){var i=a.lookupPath(e,{follow:!n});o=i.node}else o=e;if(!o.node_ops.setattr)throw new a.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){a.chown(e,r,t,!0)},fchown(e,r,t){var n=a.getStreamChecked(e);a.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new a.ErrnoError(28);var t;if(typeof e=="string"){var n=a.lookupPath(e,{follow:!0});t=n.node}else t=e;if(!t.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(t.mode))throw new a.ErrnoError(31);if(!a.isFile(t.mode))throw new a.ErrnoError(28);var o=a.nodePermissions(t,"w");if(o)throw new a.ErrnoError(o);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=a.getStreamChecked(e);if(!(t.flags&2097155))throw new a.ErrnoError(28);a.truncate(t.node,r)},utime(e,r,t){var n=a.lookupPath(e,{follow:!0}),o=n.node;o.node_ops.setattr(o,{timestamp:Math.max(r,t)})},open(e,r,t){if(e==="")throw new a.ErrnoError(44);r=typeof r=="string"?rn(r):r,r&64?(t=typeof t=="undefined"?438:t,t=t&4095|32768):t=0;var n;if(typeof e=="object")n=e;else{e=$.normalize(e);try{var o=a.lookupPath(e,{follow:!(r&131072)});n=o.node}catch(f){}}var i=!1;if(r&64)if(n){if(r&128)throw new a.ErrnoError(20)}else n=a.mknod(e,t,0),i=!0;if(!n)throw new a.ErrnoError(44);if(a.isChrdev(n.mode)&&(r&=-513),r&65536&&!a.isDir(n.mode))throw new a.ErrnoError(54);if(!i){var s=a.mayOpen(n,r);if(s)throw new a.ErrnoError(s)}r&512&&!i&&a.truncate(n,0),r&=-131713;var l=a.createStream({node:n,path:a.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),u.logReadFiles&&!(r&1)&&(a.readFiles||(a.readFiles={}),e in a.readFiles||(a.readFiles[e]=1)),l},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var i=typeof o!="undefined";if(!i)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var s=e.stream_ops.read(e,r,t,n,o);return i||(e.position+=s),s},write(e,r,t,n,o,i){if(n<0||o<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var s=typeof o!="undefined";if(!s)o=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var l=e.stream_ops.write(e,r,t,n,o,i);return s||(e.position+=l),l},allocate(e,r,t){if(a.isClosed(e))throw new a.ErrnoError(8);if(r<0||t<=0)throw new a.ErrnoError(28);if(!(e.flags&2097155))throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(n&2&&!(o&2)&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync(e,r,t,n,o){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary",r.encoding!=="utf8"&&r.encoding!=="binary")throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=a.open(e,r.flags),o=a.stat(e),i=o.size,s=new Uint8Array(i);return a.read(n,s,0,i,0),r.encoding==="utf8"?t=we(s,0):r.encoding==="binary"&&(t=s),a.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=a.open(e,t.flags,t.mode);if(typeof r=="string"){var o=new Uint8Array(Te(r)+1),i=cr(r,o,0,o.length);a.write(n,o,0,i,void 0,t.canOwn)}else if(ArrayBuffer.isView(r))a.write(n,r,0,r.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");a.close(n)},cwd:()=>a.currentPath,chdir(e){var r=a.lookupPath(e,{follow:!0});if(r.node===null)throw new a.ErrnoError(44);if(!a.isDir(r.node.mode))throw new a.ErrnoError(54);var t=a.nodePermissions(r.node,"x");if(t)throw new a.ErrnoError(t);a.currentPath=r.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(n,o,i,s,l)=>s}),a.mkdev("/dev/null",a.makedev(1,3)),ie.register(a.makedev(5,0),ie.default_tty_ops),ie.register(a.makedev(6,0),ie.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(r=zr(e).byteLength),e[--r]);a.createDevice("/dev","random",t),a.createDevice("/dev","urandom",t),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var r=a.createNode(e,"fd",16895,73);return r.node_ops={lookup(t,n){var o=+n,i=a.getStreamChecked(o),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},r}},{},"/proc/self/fd")},createStandardStreams(){u.stdin?a.createDevice("/dev","stdin",u.stdin):a.symlink("/dev/tty","/dev/stdin"),u.stdout?a.createDevice("/dev","stdout",null,u.stdout):a.symlink("/dev/tty","/dev/stdout"),u.stderr?a.createDevice("/dev","stderr",null,u.stderr):a.symlink("/dev/tty1","/dev/stderr");var e=a.open("/dev/stdin",0),r=a.open("/dev/stdout",1),t=a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(k,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:k}},init(e,r,t){a.init.initialized=!0,u.stdin=e||u.stdin,u.stdout=r||u.stdout,u.stderr=t||u.stderr,a.createStandardStreams()},quit(){a.init.initialized=!1;for(var e=0;e<a.streams.length;e++){var r=a.streams[e];r&&a.close(r)}},findObject(e,r){var t=a.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=a.lookupPath(e,{follow:!r});e=t.path}catch(o){}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=a.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=$.basename(e),t=a.lookupPath(e,{follow:!r}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(o){n.error=o.errno}return n},createPath(e,r,t,n){e=typeof e=="string"?e:a.getPath(e);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var s=$.join2(e,i);try{a.mkdir(s)}catch(l){}e=s}}return s},createFile(e,r,t,n,o){var i=$.join2(typeof e=="string"?e:a.getPath(e),r),s=vr(n,o);return a.create(i,s)},createDataFile(e,r,t,n,o,i){var s=r;e&&(e=typeof e=="string"?e:a.getPath(e),s=r?$.join2(e,r):e);var l=vr(n,o),f=a.create(s,l);if(t){if(typeof t=="string"){for(var d=new Array(t.length),c=0,m=t.length;c<m;++c)d[c]=t.charCodeAt(c);t=d}a.chmod(f,l|146);var v=a.open(f,577);a.write(v,t,0,t.length,0,i),a.close(v),a.chmod(f,l)}},createDevice(e,r,t,n){var o=$.join2(typeof e=="string"?e:a.getPath(e),r),i=vr(!!t,!!n);a.createDevice.major||(a.createDevice.major=64);var s=a.makedev(a.createDevice.major++,0);return a.registerDevice(s,{open(l){l.seekable=!1},close(l){var f;(f=n==null?void 0:n.buffer)!=null&&f.length&&n(10)},read(l,f,d,c,m){for(var v=0,p=0;p<c;p++){var y;try{y=t()}catch(P){throw new a.ErrnoError(29)}if(y===void 0&&v===0)throw new a.ErrnoError(6);if(y==null)break;v++,f[d+p]=y}return v&&(l.node.timestamp=Date.now()),v},write(l,f,d,c,m){for(var v=0;v<c;v++)try{n(f[d+v])}catch(p){throw new a.ErrnoError(29)}return c&&(l.node.timestamp=Date.now()),v}}),a.mkdev(o,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest!="undefined")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.");try{e.contents=Y(e.url),e.usedBytes=e.contents.length}catch(r){throw new a.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class i{constructor(){this.lengthKnown=!1,this.chunks=[]}get(p){if(!(p>this.length-1||p<0)){var y=p%this.chunkSize,P=p/this.chunkSize|0;return this.getter(P)[y]}}setDataGetter(p){this.getter=p}cacheLength(){var p=new XMLHttpRequest;if(p.open("HEAD",t,!1),p.send(null),!(p.status>=200&&p.status<300||p.status===304))throw new Error("Couldn't load "+t+". Status: "+p.status);var y=Number(p.getResponseHeader("Content-length")),P,D=(P=p.getResponseHeader("Accept-Ranges"))&&P==="bytes",F=(P=p.getResponseHeader("Content-Encoding"))&&P==="gzip",b=1024*1024;D||(b=y);var A=(S,x)=>{if(S>x)throw new Error("invalid range ("+S+", "+x+") or no bytes requested!");if(x>y-1)throw new Error("only "+y+" bytes available! programmer error!");var O=new XMLHttpRequest;if(O.open("GET",t,!1),y!==b&&O.setRequestHeader("Range","bytes="+S+"-"+x),O.responseType="arraybuffer",O.overrideMimeType&&O.overrideMimeType("text/plain; charset=x-user-defined"),O.send(null),!(O.status>=200&&O.status<300||O.status===304))throw new Error("Couldn't load "+t+". Status: "+O.status);return O.response!==void 0?new Uint8Array(O.response||[]):Vr(O.responseText||"",!0)},M=this;M.setDataGetter(S=>{var x=S*b,O=(S+1)*b-1;if(O=Math.min(O,y-1),typeof M.chunks[S]=="undefined"&&(M.chunks[S]=A(x,O)),typeof M.chunks[S]=="undefined")throw new Error("doXHR failed!");return M.chunks[S]}),(F||!y)&&(b=y=1,y=this.getter(0).length,b=y,ae("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=y,this._chunkSize=b,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!J)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var f=a.createFile(e,r,l,n,o);l.contents?f.contents=l.contents:l.url&&(f.contents=null,f.url=l.url),Object.defineProperties(f,{usedBytes:{get:function(){return this.contents.length}}});var d={},c=Object.keys(f.stream_ops);c.forEach(v=>{var p=f.stream_ops[v];d[v]=(...y)=>(a.forceLoadFile(f),p(...y))});function m(v,p,y,P,D){var F=v.node.contents;if(D>=F.length)return 0;var b=Math.min(F.length-D,P);if(F.slice)for(var A=0;A<b;A++)p[y+A]=F[D+A];else for(var A=0;A<b;A++)p[y+A]=F.get(D+A);return b}return d.read=(v,p,y,P,D)=>(a.forceLoadFile(f),m(v,p,y,P,D)),d.mmap=(v,p,y,P,D)=>{a.forceLoadFile(f);var F=qr(p);if(!F)throw new a.ErrnoError(48);return m(v,U,F,p,y),{ptr:F,allocated:!0}},f.stream_ops=d,f}},Kr=(e,r)=>e?we(H,e,r):"",j={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if($.isAbs(r))return r;var n;if(e===-100)n=a.cwd();else{var o=j.getStreamFromFD(e);n=o.path}if(r.length==0){if(!t)throw new a.ErrnoError(44);return n}return $.join2(n,r)},doStat(e,r,t){var n=e(r);w[t>>2]=n.dev,w[t+4>>2]=n.mode,T[t+8>>2]=n.nlink,w[t+12>>2]=n.uid,w[t+16>>2]=n.gid,w[t+20>>2]=n.rdev,W=[n.size>>>0,(_=n.size,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+24>>2]=W[0],w[t+28>>2]=W[1],w[t+32>>2]=4096,w[t+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return W=[Math.floor(o/1e3)>>>0,(_=Math.floor(o/1e3),+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+40>>2]=W[0],w[t+44>>2]=W[1],T[t+48>>2]=o%1e3*1e3,W=[Math.floor(i/1e3)>>>0,(_=Math.floor(i/1e3),+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+56>>2]=W[0],w[t+60>>2]=W[1],T[t+64>>2]=i%1e3*1e3,W=[Math.floor(s/1e3)>>>0,(_=Math.floor(s/1e3),+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+72>>2]=W[0],w[t+76>>2]=W[1],T[t+80>>2]=s%1e3*1e3,W=[n.ino>>>0,(_=n.ino,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[t+88>>2]=W[0],w[t+92>>2]=W[1],0},doMsync(e,r,t,n,o){if(!a.isFile(r.node.mode))throw new a.ErrnoError(43);if(n&2)return 0;var i=H.slice(e,e+t);a.msync(r,i,o,t,n)},getStreamFromFD(e){var r=a.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=Kr(e);return r}};function tn(e,r,t){j.varargs=t;try{var n=j.getStreamFromFD(e);switch(r){case 0:{var o=Ge();if(o<0)return-28;for(;a.streams[o];)o++;var i;return i=a.dupStream(n,o),i.fd}case 1:case 2:return 0;case 3:return n.flags;case 4:{var o=Ge();return n.flags|=o,0}case 12:{var o=ye(),s=0;return ee[o+s>>1]=2,0}case 13:case 14:return 0}return-28}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}var ce=(e,r,t)=>cr(e,H,r,t);function nn(e,r){try{if(r===0)return-28;var t=a.cwd(),n=Te(t)+1;return r<n?-68:(ce(t,e,r),n)}catch(o){if(typeof a=="undefined"||o.name!=="ErrnoError")throw o;return-o.errno}}function on(e,r,t){j.varargs=t;try{var n=j.getStreamFromFD(e);switch(r){case 21509:return n.tty?0:-59;case 21505:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=ye();w[i>>2]=o.c_iflag||0,w[i+4>>2]=o.c_oflag||0,w[i+8>>2]=o.c_cflag||0,w[i+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)U[i+s+17]=o.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return n.tty?0:-59;case 21506:case 21507:case 21508:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){for(var i=ye(),l=w[i>>2],f=w[i+4>>2],d=w[i+8>>2],c=w[i+12>>2],m=[],s=0;s<32;s++)m.push(U[i+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:l,c_oflag:f,c_cflag:d,c_lflag:c,c_cc:m})}return 0}case 21519:{if(!n.tty)return-59;var i=ye();return w[i>>2]=0,0}case 21520:return n.tty?-28:-59;case 21531:{var i=ye();return a.ioctl(n,r,i)}case 21523:{if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var v=n.tty.ops.ioctl_tiocgwinsz(n.tty),i=ye();ee[i>>1]=v[0],ee[i+2>>1]=v[1]}return 0}case 21524:return n.tty?0:-59;case 21515:return n.tty?0:-59;default:return-28}}catch(p){if(typeof a=="undefined"||p.name!=="ErrnoError")throw p;return-p.errno}}function an(e,r,t){try{return r=j.getStr(r),r=j.calculateAt(e,r),r=$.normalize(r),r[r.length-1]==="/"&&(r=r.substr(0,r.length-1)),a.mkdir(r,t,0),0}catch(n){if(typeof a=="undefined"||n.name!=="ErrnoError")throw n;return-n.errno}}function sn(e,r,t,n){j.varargs=n;try{r=j.getStr(r),r=j.calculateAt(e,r);var o=n?Ge():0;return a.open(r,t,o).fd}catch(i){if(typeof a=="undefined"||i.name!=="ErrnoError")throw i;return-i.errno}}function ln(e,r,t,n){try{if(r=j.getStr(r),r=j.calculateAt(e,r),n<=0)return-28;var o=a.readlink(r),i=Math.min(n,Te(o)),s=U[t+i];return ce(o,t,n+1),U[t+i]=s,i}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return-l.errno}}function un(e,r){try{return e=j.getStr(e),j.doStat(a.stat,e,r)}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return-t.errno}}var fn=()=>{ur("")},dn=(e,r,t,n,o)=>{},cn=()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Yr=e},Yr,B=e=>{for(var r="",t=e;H[t];)r+=Yr[H[t++]];return r},_e={},ve={},Xe={},Ee,C=e=>{throw new Ee(e)},Qr,Ke=e=>{throw new Qr(e)},Q=(e,r,t)=>{e.forEach(function(l){Xe[l]=r});function n(l){var f=t(l);f.length!==e.length&&Ke("Mismatched type converter count");for(var d=0;d<e.length;++d)te(e[d],f[d])}var o=new Array(r.length),i=[],s=0;r.forEach((l,f)=>{ve.hasOwnProperty(l)?o[f]=ve[l]:(i.push(l),_e.hasOwnProperty(l)||(_e[l]=[]),_e[l].push(()=>{o[f]=ve[l],++s,s===i.length&&n(o)}))}),i.length===0&&n(o)};function vn(e,r,t={}){var n=r.name;if(e||C(`type "${n}" must have a positive integer typeid pointer`),ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(ve[e]=r,delete Xe[e],_e.hasOwnProperty(e)){var o=_e[e];delete _e[e],o.forEach(i=>i())}}function te(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return vn(e,r,t)}var se=8,pn=(e,r,t,n)=>{r=B(r),te(e,{name:r,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?t:n},argPackAdvance:se,readValueFromPointer:function(o){return this.fromWireType(H[o])},destructorFunction:null})},hn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),pr=e=>{function r(t){return t.$$.ptrType.registeredClass.name}C(r(e)+" instance already deleted")},hr=!1,Zr=e=>{},mn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Jr=e=>{e.count.value-=1;var r=e.count.value===0;r&&mn(e)},et=(e,r,t)=>{if(r===t)return e;if(t.baseClass===void 0)return null;var n=et(e,r,t.baseClass);return n===null?null:t.downcast(n)},rt={},gn=()=>Object.keys(De).length,yn=()=>{var e=[];for(var r in De)De.hasOwnProperty(r)&&e.push(De[r]);return e},Fe=[],mr=()=>{for(;Fe.length;){var e=Fe.pop();e.$$.deleteScheduled=!1,e.delete()}},Se,wn=e=>{Se=e,Fe.length&&Se&&Se(mr)},_n=()=>{u.getInheritedInstanceCount=gn,u.getLiveInheritedInstances=yn,u.flushPendingDeletes=mr,u.setDelayFunction=wn},De={},En=(e,r)=>{for(r===void 0&&C("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},kn=(e,r)=>(r=En(e,r),De[r]),Ye=(e,r)=>{(!r.ptrType||!r.ptr)&&Ke("makeClassHandle requires ptr and ptrType");var t=!!r.smartPtrType,n=!!r.smartPtr;return t!==n&&Ke("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Re(Object.create(e,{$$:{value:r,writable:!0}}))};function bn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=kn(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(r),s=rt[i];if(!s)return o.call(this);var l;this.isConst?l=s.constPointerType:l=s.pointerType;var f=et(r,this.registeredClass,l.registeredClass);return f===null?o.call(this):this.isSmartPointer?Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:f,smartPtrType:this,smartPtr:e}):Ye(l.registeredClass.instancePrototype,{ptrType:l,ptr:f})}var Re=e=>typeof FinalizationRegistry=="undefined"?(Re=r=>r,e):(hr=new FinalizationRegistry(r=>{Jr(r.$$)}),Re=r=>{var t=r.$$,n=!!t.smartPtr;if(n){var o={$$:t};hr.register(r,o,r)}return r},Zr=r=>hr.unregister(r),Re(e)),An=()=>{Object.assign(Qe.prototype,{isAliasOf(e){if(!(this instanceof Qe)||!(e instanceof Qe))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||pr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Re(Object.create(Object.getPrototypeOf(this),{$$:{value:hn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||pr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Zr(this),Jr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||pr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Fe.push(this),Fe.length===1&&Se&&Se(mr),this.$$.deleteScheduled=!0,this}})};function Qe(){}var Ze=(e,r)=>Object.defineProperty(r,"name",{value:e}),gr=(e,r,t)=>{if(e[r].overloadTable===void 0){var n=e[r];e[r]=function(...o){return e[r].overloadTable.hasOwnProperty(o.length)||C(`Function '${t}' called with an invalid number of arguments (${o.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[o.length].apply(this,o)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},tt=(e,r,t)=>{u.hasOwnProperty(e)?((t===void 0||u[e].overloadTable!==void 0&&u[e].overloadTable[t]!==void 0)&&C(`Cannot register public name '${e}' twice`),gr(u,e,e),u.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),u[e].overloadTable[t]=r):(u[e]=r,t!==void 0&&(u[e].numArguments=t))},Pn=48,Cn=57,Tn=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var r=e.charCodeAt(0);return r>=Pn&&r<=Cn?`_${e}`:e};function Fn(e,r,t,n,o,i,s,l){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=l,this.pureVirtualFunctions=[]}var Je=(e,r,t)=>{for(;r!==t;)r.upcast||C(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function Sn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${kr(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function Dn(e,r){var t;if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;(!r||!r.$$)&&C(`Cannot pass "${kr(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=Je(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:C(`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 o=r.clone();t=this.rawShare(t,he.toHandle(()=>o.delete())),e!==null&&e.push(this.rawDestructor,t)}break;default:C("Unsupporting sharing policy")}return t}function Rn(e,r){if(r===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;r.$$||C(`Cannot pass "${kr(r)}" as a ${this.name}`),r.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&C(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass,n=Je(r.$$.ptr,t,this.registeredClass);return n}function er(e){return this.fromWireType(T[e>>2])}var $n=()=>{Object.assign($e.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var r;(r=this.rawDestructor)==null||r.call(this,e)},argPackAdvance:se,readValueFromPointer:er,fromWireType:bn})};function $e(e,r,t,n,o,i,s,l,f,d,c){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=l,this.rawConstructor=f,this.rawShare=d,this.rawDestructor=c,!o&&r.baseClass===void 0?n?(this.toWireType=Sn,this.destructorFunction=null):(this.toWireType=Rn,this.destructorFunction=null):this.toWireType=Dn}var nt=(e,r,t)=>{u.hasOwnProperty(e)||Ke("Replacing nonexistent public symbol"),u[e].overloadTable!==void 0&&t!==void 0?u[e].overloadTable[t]=r:(u[e]=r,u[e].argCount=t)},Mn=(e,r,t)=>{e=e.replace(/p/g,"i");var n=u["dynCall_"+e];return n(r,...t)},rr=[],ot,at=e=>{var r=rr[e];return r||(e>=rr.length&&(rr.length=e+1),rr[e]=r=ot.get(e)),r},On=(e,r,t=[])=>{if(e.includes("j"))return Mn(e,r,t);var n=at(r)(...t);return n},Wn=(e,r)=>(...t)=>On(e,r,t),q=(e,r)=>{e=B(e);function t(){return e.includes("j")?Wn(e,r):at(r)}var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${e}: ${r}`),n},jn=(e,r)=>{var t=Ze(r,function(n){this.name=r,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+`
|
|
8
|
-
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},it,st=e=>{var r=pt(e),t=B(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Xe[i]){Xe[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new it(`${e}: `+t.map(st).join([", "]))},In=(e,r,t,n,o,i,s,l,f,d,c,m,v)=>{c=B(c),i=q(o,i),l&&(l=q(s,l)),d&&(d=q(f,d)),v=q(m,v);var p=Tn(c);tt(p,function(){pe(`Cannot construct ${c} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var O,We;y=y[0];var P,D;n?(P=y.registeredClass,D=P.instancePrototype):D=Qe.prototype;var F=Ze(c,function(...je){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+c);if(A.constructor_body===void 0)throw new Ee(c+" has no accessible constructor");var Ie=A.constructor_body[je.length];if(Ie===void 0)throw new Ee(`Tried to invoke ctor of ${c} with invalid number of parameters (${je.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ie.apply(this,je)}),b=Object.create(D,{constructor:{value:F}});F.prototype=b;var A=new Fn(c,F,b,v,P,i,l,d);A.baseClass&&((We=(O=A.baseClass).__derivedClasses)!=null||(O.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new $e(c,A,!0,!1,!1),S=new $e(c+"*",A,!1,!1,!1),x=new $e(c+" const*",A,!1,!0,!1);return rt[e]={pointerType:S,constPointerType:x},nt(p,F),[M,S,x]})},yr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Nn(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,f=Nn(r),d=r[0].name!=="void",c=s-2,m=new Array(c),v=[],p=[],y=function(...P){P.length!==c&&C(`function ${e} called with ${P.length} arguments, expected ${c}`),p.length=0;var D;v.length=l?2:1,v[0]=o,l&&(D=r[1].toWireType(p,this),v[1]=D);for(var F=0;F<c;++F)m[F]=r[F+2].toWireType(p,P[F]),v.push(m[F]);var b=n(...v);function A(M){if(f)yr(p);else for(var S=l?1:2;S<r.length;S++){var x=S===1?D:m[S-2];r[S].destructorFunction!==null&&r[S].destructorFunction(x)}if(d)return r[0].fromWireType(M)}return A(b)};return Ze(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+n*4>>2]);return t},wr=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},xn=(e,r,t,n,o,i,s,l)=>{var f=nr(t,n);r=B(r),r=wr(r),i=q(o,i),Q([],[e],d=>{d=d[0];var c=`${d.name}.${r}`;function m(){pe(`Cannot call ${c} due to unbound types`,f)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var v=d.registeredClass.constructor;return v[r]===void 0?(m.argCount=t-1,v[r]=m):(gr(v,r,c),v[r].overloadTable[t-1]=m),Q([],f,p=>{var y=[p[0],null].concat(p.slice(1)),P=tr(c,y,null,i,s,l);if(v[r].overloadTable===void 0?(P.argCount=t-1,v[r]=P):v[r].overloadTable[t-1]=P,d.registeredClass.__derivedClasses)for(let D of d.registeredClass.__derivedClasses)D.constructor.hasOwnProperty(r)||(D.constructor[r]=P);return[]}),[]})},Un=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var f=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,d=>(d.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(f,d,null,o,i),[])),[]})},Ln=(e,r,t,n,o,i,s,l,f)=>{var d=nr(t,n);r=B(r),r=wr(r),i=q(o,i),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&c.registeredClass.pureVirtualFunctions.push(r);function v(){pe(`Cannot call ${m} due to unbound types`,d)}var p=c.registeredClass.instancePrototype,y=p[r];return y===void 0||y.overloadTable===void 0&&y.className!==c.name&&y.argCount===t-2?(v.argCount=t-2,v.className=c.name,p[r]=v):(gr(p,r,m),p[r].overloadTable[t-2]=v),Q([],d,P=>{var D=tr(m,P,c,i,s,f);return p[r].overloadTable===void 0?(D.argCount=t-2,p[r]=D):p[r].overloadTable[t-2]=D,[]}),[]})},lt=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Hn=(e,r,t,n,o,i,s,l,f,d)=>{r=B(r),o=q(n,o),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`,v={get(){pe(`Cannot access ${m} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return f?v.set=()=>pe(`Cannot access ${m} due to unbound types`,[t,s]):v.set=p=>C(m+" is a read-only property"),Object.defineProperty(c.registeredClass.instancePrototype,r,v),Q([],f?[t,s]:[t],p=>{var y=p[0],P={get(){var F=lt(this,c,m+" getter");return y.fromWireType(o(i,F))},enumerable:!0};if(f){f=q(l,f);var D=p[1];P.set=function(F){var b=lt(this,c,m+" setter"),A=[];f(d,b,D.toWireType(A,F)),yr(A)}}return Object.defineProperty(c.registeredClass.instancePrototype,r,P),[]}),[]})},_r=[],ne=[],Er=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,_r.push(e))},zn=()=>ne.length/2-5-_r.length,Bn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=zn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=_r.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},Vn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return Er(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},ut=e=>te(e,Vn),kr=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},qn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Mr[t>>2])};case 8:return function(t){return this.fromWireType(Or[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Gn=(e,r,t)=>{r=B(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:qn(r,t),destructorFunction:null})},Xn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=B(e),e=wr(e),o=q(n,o),tt(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,f=>{var d=[f[0],null].concat(f.slice(1));return nt(e,tr(e,d,null,o,i,s),r-1),[]})},Kn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>H[n];case 2:return t?n=>ee[n>>1]:n=>Be[n>>1];case 4:return t?n=>w[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Yn=(e,r,t,n,o)=>{r=B(r),o===-1&&(o=4294967295);var i=c=>c;if(n===0){var s=32-8*t;i=c=>c<<s>>>s}var l=r.includes("unsigned"),f=(c,m)=>{},d;l?d=function(c,m){return f(m,this.name),m>>>0}:d=function(c,m){return f(m,this.name),m},te(e,{name:r,fromWireType:i,toWireType:d,argPackAdvance:se,readValueFromPointer:Kn(r,t,n!==0),destructorFunction:null})},Qn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=T[s>>2],f=T[s+4>>2];return new o(U.buffer,f,l)}t=B(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Zn=(e,r)=>{ut(e)},Jn=(e,r,t,n,o,i,s,l,f,d,c,m)=>{t=B(t),i=q(o,i),l=q(s,l),d=q(f,d),m=q(c,m),Q([e],[r],v=>{v=v[0];var p=new $e(t,v.registeredClass,!1,!1,!0,v,n,i,l,d,m);return[p]})},eo=(e,r)=>{r=B(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=T[n>>2],i=n+4,s;if(t)for(var l=i,f=0;f<=o;++f){var d=i+f;if(f==o||H[d]==0){var c=d-l,m=Kr(l,c);s===void 0?s=m:(s+=String.fromCharCode(0),s+=m),l=d+1}}else{for(var v=new Array(o),f=0;f<o;++f)v[f]=String.fromCharCode(H[i+f]);s=v.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=Te(o):i=o.length;var l=Pr(4+i+1),f=l+4;if(T[l>>2]=i,t&&s)ce(o,f,i+1);else if(s)for(var d=0;d<i;++d){var c=o.charCodeAt(d);c>255&&(oe(f),C("String has UTF-16 code units that do not fit in 8 bits")),H[f+d]=c}else for(var d=0;d<i;++d)H[f+d]=o[d];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},ft=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,ro=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&Be[n];)++n;if(t=n<<1,t-e>32&&ft)return ft.decode(H.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},to=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},no=e=>e.length*2,oo=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=w[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},ao=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(w[r>>2]=s,r+=4,r+4>o)break}return w[r>>2]=0,r-n},io=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},so=(e,r,t)=>{t=B(t);var n,o,i,s;r===2?(n=ro,o=to,s=no,i=l=>Be[l>>1]):r===4&&(n=oo,o=ao,s=io,i=l=>T[l>>2]),te(e,{name:t,fromWireType:l=>{for(var f=T[l>>2],d,c=l+4,m=0;m<=f;++m){var v=l+4+m*r;if(m==f||i(v)==0){var p=v-c,y=n(c,p);d===void 0?d=y:(d+=String.fromCharCode(0),d+=y),c=v+r}}return oe(l),d},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var d=s(f),c=Pr(4+d+r);return T[c>>2]=d/r,o(f,c+4,d+r),l!==null&&l.push(oe,c),c},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},lo=(e,r)=>{r=B(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},uo=1,fo=()=>uo,co=(e,r,t)=>H.copyWithin(e,r,r+t),br=[],vo=(e,r,t,n)=>(e=br[e],r=he.toValue(r),e(null,r,t,n)),po=e=>{var r=br.length;return br.push(e),r},dt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${st(e)}`),t},ho=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=dt(T[r+n*4>>2],"parameter "+n);return t},mo=Reflect.construct,go=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=he.toHandle(n)),o},yo=(e,r,t)=>{var n=ho(e,r),o=n.shift();e--;var i=new Array(e),s=(f,d,c,m)=>{for(var v=0,p=0;p<e;++p)i[p]=n[p].readValueFromPointer(m+v),v+=n[p].argPackAdvance;var y=t===1?mo(d,i):d.apply(f,i);return go(o,c,y)},l=`methodCaller<(${n.map(f=>f.name).join(", ")}) => ${o.name}>`;return po(Ze(l,s))},wo=e=>{e>9&&(ne[e+1]+=1)},_o=e=>{var r=he.toValue(e);yr(r),Er(e)},Eo=(e,r)=>{e=dt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},Me=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function ko(e,r,t){var n=Me(e,r),o=new Date(n*1e3);w[t>>2]=o.getUTCSeconds(),w[t+4>>2]=o.getUTCMinutes(),w[t+8>>2]=o.getUTCHours(),w[t+12>>2]=o.getUTCDate(),w[t+16>>2]=o.getUTCMonth(),w[t+20>>2]=o.getUTCFullYear()-1900,w[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;w[t+28>>2]=s}var bo=e=>e%4===0&&(e%100!==0||e%400===0),Ao=[0,31,60,91,121,152,182,213,244,274,305,335],Po=[0,31,59,90,120,151,181,212,243,273,304,334],Co=e=>{var r=bo(e.getFullYear()),t=r?Ao:Po,n=t[e.getMonth()]+e.getDate()-1;return n};function To(e,r,t){var n=Me(e,r),o=new Date(n*1e3);w[t>>2]=o.getSeconds(),w[t+4>>2]=o.getMinutes(),w[t+8>>2]=o.getHours(),w[t+12>>2]=o.getDate(),w[t+16>>2]=o.getMonth(),w[t+20>>2]=o.getFullYear()-1900,w[t+24>>2]=o.getDay();var i=Co(o)|0;w[t+28>>2]=i,w[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),f=s.getTimezoneOffset(),d=(l!=f&&o.getTimezoneOffset()==Math.min(f,l))|0;w[t+32>>2]=d}function Fo(e,r,t,n,o,i,s,l){var f=Me(o,i);try{if(isNaN(f))return 61;var d=j.getStreamFromFD(n),c=a.mmap(d,e,f,r,t),m=c.ptr;return w[s>>2]=c.allocated,T[l>>2]=m,0}catch(v){if(typeof a=="undefined"||v.name!=="ErrnoError")throw v;return-v.errno}}function So(e,r,t,n,o,i,s){var l=Me(i,s);try{var f=j.getStreamFromFD(o);t&2&&j.doMsync(e,f,r,n,l)}catch(d){if(typeof a=="undefined"||d.name!=="ErrnoError")throw d;return-d.errno}}var Do=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),f=s.getTimezoneOffset(),d=Math.max(l,f);T[e>>2]=d*60,w[r>>2]=+(l!=f);var c=p=>p.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],m=c(i),v=c(s);f<l?(ce(m,t,17),ce(v,n,17)):(ce(m,n,17),ce(v,t,17))},Ro=()=>Date.now(),ct=()=>2147483648,$o=()=>ct(),vt;vt=()=>performance.now();var Mo=e=>{var r=ze.buffer,t=(e-r.byteLength+65535)/65536;try{return ze.grow(t),Wr(),1}catch(n){}},Oo=e=>{var r=H.length;e>>>=0;var t=ct();if(e>t)return!1;for(var n=(f,d)=>f+(d-f%d)%d,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=Mo(s);if(l)return!0}return!1},Ar={},Wo=()=>me||"./this.program",Oe=()=>{if(!Oe.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Wo()};for(var t in Ar)Ar[t]===void 0?delete r[t]:r[t]=Ar[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Oe.strings=n}return Oe.strings},jo=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},Io=(e,r)=>{var t=0;return Oe().forEach((n,o)=>{var i=r+t;T[e+o*4>>2]=i,jo(n,i),t+=n.length+1}),0},No=(e,r)=>{var t=Oe();T[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),T[r>>2]=n,0},xo=0,Uo=()=>Bt||xo>0,Lo=e=>{var r;sr=e,Uo()||((r=u.onExit)==null||r.call(u,e),ir=!0),be(e,new zt(e))},Ho=(e,r)=>{sr=e,Lo(e)},zo=Ho;function Bo(e){try{var r=j.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function Vo(e,r){try{var t=0,n=0,o=0,i=j.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,W=[t>>>0,(_=t,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+8>>2]=W[0],w[r+12>>2]=W[1],W=[n>>>0,(_=n,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+16>>2]=W[0],w[r+20>>2]=W[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var qo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.read(e,U,s,l,n);if(f<0)return-1;if(o+=f,f<l)break;typeof n!="undefined"&&(n+=f)}return o};function Go(e,r,t,n){try{var o=j.getStreamFromFD(e),i=qo(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Xo(e,r,t,n,o){var i=Me(r,t);try{if(isNaN(i))return 61;var s=j.getStreamFromFD(e);return a.llseek(s,i,n),W=[s.position>>>0,(_=s.position,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[o>>2]=W[0],w[o+4>>2]=W[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Ko=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.write(e,U,s,l,n);if(f<0)return-1;o+=f,typeof n!="undefined"&&(n+=f)}return o};function Yo(e,r,t,n){try{var o=j.getStreamFromFD(e),i=Ko(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var Qo=a.createPath,Zo=e=>a.unlink(e),Jo=a.createLazyFile,ea=a.createDevice;a.createPreloadedFile=Xr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,cn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Qr=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},An(),_n(),$n(),it=u.UnboundTypeError=jn(Error,"UnboundTypeError"),Bn();var ra={a:Gt,q:tn,M:nn,P:on,I:an,r:sn,G:ln,N:un,S:fn,D:dn,U:pn,e:In,s:xn,n:Un,g:Ln,m:Hn,T:ut,v:Gn,i:Xn,c:Yn,b:Qn,x:Zn,o:Jn,u:eo,l:so,V:lo,Q:fo,R:co,X:vo,d:Er,Y:yo,w:wo,W:_o,h:Eo,A:ko,B:To,y:Fo,z:So,H:Do,t:Ro,F:$o,j:vt,E:Oo,K:Io,L:No,f:zo,k:Bo,J:Vo,O:Go,C:Xo,p:Yo},N=Ht(),ta=()=>(ta=N._)(),pt=e=>(pt=N.$)(e),Pr=e=>(Pr=N.ba)(e),oe=e=>(oe=N.ca)(e),ht=(e,r)=>(ht=N.da)(e,r),mt=e=>(mt=N.ea)(e),na=u.dynCall_jjj=(e,r,t,n,o)=>(na=u.dynCall_jjj=N.fa)(e,r,t,n,o),oa=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(oa=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),aa=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(aa=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),ia=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,f,d,c,m)=>(ia=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,f,d,c,m),sa=u.dynCall_iji=(e,r,t,n)=>(sa=u.dynCall_iji=N.ja)(e,r,t,n),la=u.dynCall_jiji=(e,r,t,n,o)=>(la=u.dynCall_jiji=N.ka)(e,r,t,n,o),ua=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(ua=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),fa=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(fa=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),da=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,f)=>(da=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,f),ca=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,f,d)=>(ca=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,f,d);u.addRunDependency=Ve,u.removeRunDependency=Ce,u.FS_createPreloadedFile=Xr,u.FS_unlink=Zo,u.FS_createPath=Qo,u.FS_createDevice=ea,u.FS_createDataFile=Gr,u.FS_createLazyFile=Jo;var or;Pe=function e(){or||gt(),or||(Pe=e)};function gt(){if(de>0||(Rt(),de>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!ir&&($t(),I(u),(r=u.onRuntimeInitialized)==null||r.call(u),Mt()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return gt(),E=K,E}})();typeof Pt=="object"&&typeof Tr=="object"?Tr.exports=Cr:typeof define=="function"&&define.amd&&define([],()=>Cr);Cr.getUrl=function(R){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+R}});var Ne=class{constructor(g,h="AudioEffects"){this.loggerFunction=g,this.loggerName=h}debug(...g){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...g)}log(...g){this.loggerFunction("LOG",`[${this.loggerName}]`,...g)}warn(...g){this.loggerFunction("WARN",`[${this.loggerName}]`,...g)}error(...g){this.loggerFunction("ERROR",`[${this.loggerName}]`,...g)}};function ar(R,g=[]){let h=g.join(","),E=typeof R=="string"?[R,`exports.default(${h});`]:[`(${R})(${h});`],u=new Blob(E,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Ne(()=>{})}init(V){return Z(this,arguments,function*({sampleRate:g,isOutputAudio:h=!1,isOutputStream:E=!1,workletFunction:u,workletName:I}){if(this.logger.debug("init"),this.createAudioContext(g),yield this.createWorklet(u,I),this.workletNode&&this.audioContext&&(h&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),E)){let K=this.audioContext.createMediaStreamDestination();this.workletNode.connect(K),this.outputStream=K.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(g){var h;if(this.audioContext&&this.workletNode){let E=null;if(g){let u=new MediaStream(g instanceof MediaStreamTrack?[g]:g.getAudioTracks().filter(I=>I.contentHint!=="music"));E=this.audioContext.createMediaStreamSource(u)}(h=this.sourceNode)==null||h.disconnect(this.workletNode),E==null||E.connect(this.workletNode),this.sourceNode=E,this.logger.debug("source "+(g?"set":"set to null"))}}destroy(){var g;this.logger.debug("destroy"),(g=this.audioContext)==null||g.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null}resume(){var g;this.logger.debug("resume"),(g=this.audioContext)==null||g.resume()}pause(){var g;this.logger.debug("pause"),(g=this.audioContext)==null||g.suspend()}setLogger(g=()=>{},h){this.logger=new Ne(g,h)}static isSupported(){try{let g=window;return!!(g.WebAssembly&&g.Worker&&(g.AudioContext||g.webkitAudioContext)&&g.AudioWorkletNode)}catch(g){return!1}}createAudioContext(g){let h=window.AudioContext||window.webkitAudioContext,E=new h(g?{sampleRate:g}:{});this.audioContext=E,this.logger.debug("created AudioContext")}createWorklet(g,h){return Z(this,null,function*(){if(this.logger.debug(`${h} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ar(g));let E=new AudioWorkletNode(this.audioContext,h);return this.workletNode=E,new Promise(u=>{E.port.onmessage=({data:I})=>{switch(I.type){case"init":{this.logger.debug(`${h} init success`),u();break}case"data":{this.onWorkletData(I.data);break}}}})})}sendDataToWorklet(g,h=[]){var E;(E=this.workletNode)==null||E.port.postMessage(g,h)}};function At(){let G=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],J=G[59],Rr=1-G[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let be=currentTime,X=0,fe=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(fe!=null&&fe.length&&(X=fe.reduce((ae,z)=>ae+Math.abs(z),0)/fe.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+X)/(this.frameSampleCount+1),this.frameSampleCount+=1,be-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(G[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=J+Rr*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=be;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var xe=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(xe.prototype,this,"init").call(this,{workletFunction:At,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(h){this.onData(h)}};var Sr=kt(Fr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null}init(h){return Z(this,null,function*(){yield le(ue.prototype,this,"init").call(this,h),this.isInitialized=!1,yield this.createWorker(h.workerFunctionString,h.workerArgs),this.isInitialized=!0})}destroy(){var h;super.destroy(),(h=this.worker)==null||h.terminate(),this.worker=null}sendDataToWorker(h,E=[]){var u;(u=this.worker)==null||u.postMessage(h,E)}static isSupported(){try{let h=window;return!!(super.isSupported()&&h.Worker)}catch(h){return!1}}createWorker(h,E=[]){return new Promise((u,I)=>{this.logger.debug("worker init started"),this.worker=new Worker(ar(h,E)),this.worker.onmessage=({data:V})=>{switch(V.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(V.error),I(V.error);break}case"data":{this.onWorkerData(V.data);break}case"debug":{this.logger.debug(V.message);break}}}})}};function Ct(){class R extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(h){var E;return(E=h==null?void 0:h[0])!=null&&E[0]&&this.port.postMessage({type:"data",data:h[0][0].buffer},[h[0][0].buffer]),!0}}registerProcessor("pureWorklet",R)}var _a=16e3,Ue=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(Ue.prototype,this,"init").call(this,{sampleRate:_a,workletFunction:Ct,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)g(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m(t))!f.call(o,n)&&n!==e&&g(o,n,{get:()=>t[n],enumerable:!(i=w(t,n))||i.enumerable});return o};var A=o=>y(g({},"__esModule",{value:!0}),o);var v={};b(v,{default:()=>x});var x=(o,t)=>{let e=null,i=null;function n(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);i=e.AnimojiFactory.createAlgorithm(s)})}function p(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!i))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(i,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){p(s)}}n().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(p)};return A(v);})();
|
|
9
|
-
`,workerArgs:[Sr.default,Sr.default.getUrl]})})}onWorkletData(h){this.sendDataToWorker({data:h},[h])}onWorkerData(h){this.onData(h)}static isSupported(){try{let h=super.isSupported(),E=/firefox/i.test(navigator.userAgent);return h&&!E}catch(h){return!1}}};var Dr=kt(Fr());function Tt(){class R extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:E}})=>{let u=new Float32Array(E),I=new Float32Array(this.samplesQueue.length+u.length);I.set(this.samplesQueue,0),I.set(u,this.samplesQueue.length),this.samplesQueue=I}}process(E,u){var I;return(I=E==null?void 0:E[0])!=null&&I[0]&&this.port.postMessage({type:"data",data:E[0][0].buffer},[E[0][0].buffer]),this.samplesQueue.length>=128&&(u[0].forEach(K=>{K.set(this.samplesQueue.subarray(0,128))}),this.samplesQueue=this.samplesQueue.slice(128)),!0}}registerProcessor("voiceChangeWorklet",R)}var Ft=(h=>(h.PLAYBACK="playback",h.OUTPUT_STREAM="output_stream",h))(Ft||{}),St=(L=>(L.BALLOON="balloon",L.CATHEDRAL="cathedral",L.CHORUS="chorus",L.DISTORTION="distortion",L.ECHO="echo",L.EVIL="evil",L.GIANT="giant",L.HALL="hall",L.PHASER="phaser",L.ROBOT="robot",L.SQUIRELL="squirell",L.DENOISE="denoise",L))(St||{}),Ea=44100,Le=class extends ue{constructor(h="playback"){super();this.mode=h}init(){return Z(this,null,function*(){yield le(Le.prototype,this,"init").call(this,{sampleRate:Ea,isOutputAudio:this.mode==="playback",isOutputStream:this.mode==="output_stream",workletFunction:Tt,workletName:"voiceChangeWorklet",workerFunctionString:'"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var W=(
|
|
8
|
+
`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},it,st=e=>{var r=pt(e),t=B(r);return oe(r),t},pe=(e,r)=>{var t=[],n={};function o(i){if(!n[i]&&!ve[i]){if(Xe[i]){Xe[i].forEach(o);return}t.push(i),n[i]=!0}}throw r.forEach(o),new it(`${e}: `+t.map(st).join([", "]))},In=(e,r,t,n,o,i,s,l,f,d,c,m,v)=>{c=B(c),i=q(o,i),l&&(l=q(s,l)),d&&(d=q(f,d)),v=q(m,v);var p=Tn(c);tt(p,function(){pe(`Cannot construct ${c} due to unbound types`,[n])}),Q([e,r,t],n?[n]:[],y=>{var O,We;y=y[0];var P,D;n?(P=y.registeredClass,D=P.instancePrototype):D=Qe.prototype;var F=Ze(c,function(...je){if(Object.getPrototypeOf(this)!==b)throw new Ee("Use 'new' to construct "+c);if(A.constructor_body===void 0)throw new Ee(c+" has no accessible constructor");var Ie=A.constructor_body[je.length];if(Ie===void 0)throw new Ee(`Tried to invoke ctor of ${c} with invalid number of parameters (${je.length}) - expected (${Object.keys(A.constructor_body).toString()}) parameters instead!`);return Ie.apply(this,je)}),b=Object.create(D,{constructor:{value:F}});F.prototype=b;var A=new Fn(c,F,b,v,P,i,l,d);A.baseClass&&((We=(O=A.baseClass).__derivedClasses)!=null||(O.__derivedClasses=[]),A.baseClass.__derivedClasses.push(A));var M=new $e(c,A,!0,!1,!1),S=new $e(c+"*",A,!1,!1,!1),x=new $e(c+" const*",A,!1,!0,!1);return rt[e]={pointerType:S,constPointerType:x},nt(p,F),[M,S,x]})},yr=e=>{for(;e.length;){var r=e.pop(),t=e.pop();t(r)}};function Nn(e){for(var r=1;r<e.length;++r)if(e[r]!==null&&e[r].destructorFunction===void 0)return!0;return!1}function tr(e,r,t,n,o,i){var s=r.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=r[1]!==null&&t!==null,f=Nn(r),d=r[0].name!=="void",c=s-2,m=new Array(c),v=[],p=[],y=function(...P){P.length!==c&&C(`function ${e} called with ${P.length} arguments, expected ${c}`),p.length=0;var D;v.length=l?2:1,v[0]=o,l&&(D=r[1].toWireType(p,this),v[1]=D);for(var F=0;F<c;++F)m[F]=r[F+2].toWireType(p,P[F]),v.push(m[F]);var b=n(...v);function A(M){if(f)yr(p);else for(var S=l?1:2;S<r.length;S++){var x=S===1?D:m[S-2];r[S].destructorFunction!==null&&r[S].destructorFunction(x)}if(d)return r[0].fromWireType(M)}return A(b)};return Ze(e,y)}var nr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+n*4>>2]);return t},wr=e=>{e=e.trim();let r=e.indexOf("(");return r!==-1?e.substr(0,r):e},xn=(e,r,t,n,o,i,s,l)=>{var f=nr(t,n);r=B(r),r=wr(r),i=q(o,i),Q([],[e],d=>{d=d[0];var c=`${d.name}.${r}`;function m(){pe(`Cannot call ${c} due to unbound types`,f)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var v=d.registeredClass.constructor;return v[r]===void 0?(m.argCount=t-1,v[r]=m):(gr(v,r,c),v[r].overloadTable[t-1]=m),Q([],f,p=>{var y=[p[0],null].concat(p.slice(1)),P=tr(c,y,null,i,s,l);if(v[r].overloadTable===void 0?(P.argCount=t-1,v[r]=P):v[r].overloadTable[t-1]=P,d.registeredClass.__derivedClasses)for(let D of d.registeredClass.__derivedClasses)D.constructor.hasOwnProperty(r)||(D.constructor[r]=P);return[]}),[]})},Un=(e,r,t,n,o,i)=>{var s=nr(r,t);o=q(n,o),Q([],[e],l=>{l=l[0];var f=`constructor ${l.name}`;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new Ee(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${l.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return l.registeredClass.constructor_body[r-1]=()=>{pe(`Cannot construct ${l.name} due to unbound types`,s)},Q([],s,d=>(d.splice(1,0,null),l.registeredClass.constructor_body[r-1]=tr(f,d,null,o,i),[])),[]})},Ln=(e,r,t,n,o,i,s,l,f)=>{var d=nr(t,n);r=B(r),r=wr(r),i=q(o,i),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),l&&c.registeredClass.pureVirtualFunctions.push(r);function v(){pe(`Cannot call ${m} due to unbound types`,d)}var p=c.registeredClass.instancePrototype,y=p[r];return y===void 0||y.overloadTable===void 0&&y.className!==c.name&&y.argCount===t-2?(v.argCount=t-2,v.className=c.name,p[r]=v):(gr(p,r,m),p[r].overloadTable[t-2]=v),Q([],d,P=>{var D=tr(m,P,c,i,s,f);return p[r].overloadTable===void 0?(D.argCount=t-2,p[r]=D):p[r].overloadTable[t-2]=D,[]}),[]})},lt=(e,r,t)=>(e instanceof Object||C(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||C(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||C(`cannot call emscripten binding method ${t} on deleted object`),Je(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Hn=(e,r,t,n,o,i,s,l,f,d)=>{r=B(r),o=q(n,o),Q([],[e],c=>{c=c[0];var m=`${c.name}.${r}`,v={get(){pe(`Cannot access ${m} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return f?v.set=()=>pe(`Cannot access ${m} due to unbound types`,[t,s]):v.set=p=>C(m+" is a read-only property"),Object.defineProperty(c.registeredClass.instancePrototype,r,v),Q([],f?[t,s]:[t],p=>{var y=p[0],P={get(){var F=lt(this,c,m+" getter");return y.fromWireType(o(i,F))},enumerable:!0};if(f){f=q(l,f);var D=p[1];P.set=function(F){var b=lt(this,c,m+" setter"),A=[];f(d,b,D.toWireType(A,F)),yr(A)}}return Object.defineProperty(c.registeredClass.instancePrototype,r,P),[]}),[]})},_r=[],ne=[],Er=e=>{e>9&&--ne[e+1]===0&&(ne[e]=void 0,_r.push(e))},zn=()=>ne.length/2-5-_r.length,Bn=()=>{ne.push(0,1,void 0,1,null,1,!0,1,!1,1),u.count_emval_handles=zn},he={toValue:e=>(e||C("Cannot use deleted val. handle = "+e),ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=_r.pop()||ne.length;return ne[r]=e,ne[r+1]=1,r}}}},Vn={name:"emscripten::val",fromWireType:e=>{var r=he.toValue(e);return Er(e),r},toWireType:(e,r)=>he.toHandle(r),argPackAdvance:se,readValueFromPointer:er,destructorFunction:null},ut=e=>te(e,Vn),kr=e=>{if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e},qn=(e,r)=>{switch(r){case 4:return function(t){return this.fromWireType(Mr[t>>2])};case 8:return function(t){return this.fromWireType(Or[t>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Gn=(e,r,t)=>{r=B(r),te(e,{name:r,fromWireType:n=>n,toWireType:(n,o)=>o,argPackAdvance:se,readValueFromPointer:qn(r,t),destructorFunction:null})},Xn=(e,r,t,n,o,i,s)=>{var l=nr(r,t);e=B(e),e=wr(e),o=q(n,o),tt(e,function(){pe(`Cannot call ${e} due to unbound types`,l)},r-1),Q([],l,f=>{var d=[f[0],null].concat(f.slice(1));return nt(e,tr(e,d,null,o,i,s),r-1),[]})},Kn=(e,r,t)=>{switch(r){case 1:return t?n=>U[n]:n=>H[n];case 2:return t?n=>ee[n>>1]:n=>Be[n>>1];case 4:return t?n=>w[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Yn=(e,r,t,n,o)=>{r=B(r),o===-1&&(o=4294967295);var i=c=>c;if(n===0){var s=32-8*t;i=c=>c<<s>>>s}var l=r.includes("unsigned"),f=(c,m)=>{},d;l?d=function(c,m){return f(m,this.name),m>>>0}:d=function(c,m){return f(m,this.name),m},te(e,{name:r,fromWireType:i,toWireType:d,argPackAdvance:se,readValueFromPointer:Kn(r,t,n!==0),destructorFunction:null})},Qn=(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[r];function i(s){var l=T[s>>2],f=T[s+4>>2];return new o(U.buffer,f,l)}t=B(t),te(e,{name:t,fromWireType:i,argPackAdvance:se,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Zn=(e,r)=>{ut(e)},Jn=(e,r,t,n,o,i,s,l,f,d,c,m)=>{t=B(t),i=q(o,i),l=q(s,l),d=q(f,d),m=q(c,m),Q([e],[r],v=>{v=v[0];var p=new $e(t,v.registeredClass,!1,!1,!0,v,n,i,l,d,m);return[p]})},eo=(e,r)=>{r=B(r);var t=r==="std::string";te(e,{name:r,fromWireType(n){var o=T[n>>2],i=n+4,s;if(t)for(var l=i,f=0;f<=o;++f){var d=i+f;if(f==o||H[d]==0){var c=d-l,m=Kr(l,c);s===void 0?s=m:(s+=String.fromCharCode(0),s+=m),l=d+1}}else{for(var v=new Array(o),f=0;f<o;++f)v[f]=String.fromCharCode(H[i+f]);s=v.join("")}return oe(n),s},toWireType(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||C("Cannot pass non-string to std::string"),t&&s?i=Te(o):i=o.length;var l=Pr(4+i+1),f=l+4;if(T[l>>2]=i,t&&s)ce(o,f,i+1);else if(s)for(var d=0;d<i;++d){var c=o.charCodeAt(d);c>255&&(oe(f),C("String has UTF-16 code units that do not fit in 8 bits")),H[f+d]=c}else for(var d=0;d<i;++d)H[f+d]=o[d];return n!==null&&n.push(oe,l),l},argPackAdvance:se,readValueFromPointer:er,destructorFunction(n){oe(n)}})},ft=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,ro=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&Be[n];)++n;if(t=n<<1,t-e>32&&ft)return ft.decode(H.subarray(e,t));for(var i="",s=0;!(s>=r/2);++s){var l=ee[e+s*2>>1];if(l==0)break;i+=String.fromCharCode(l)}return i},to=(e,r,t)=>{if(t!=null||(t=2147483647),t<2)return 0;t-=2;for(var n=r,o=t<e.length*2?t/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);ee[r>>1]=s,r+=2}return ee[r>>1]=0,r-n},no=e=>e.length*2,oo=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=w[e+t*4>>2];if(o==0)break;if(++t,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(o)}return n},ao=(e,r,t)=>{if(t!=null||(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343){var l=e.charCodeAt(++i);s=65536+((s&1023)<<10)|l&1023}if(w[r>>2]=s,r+=4,r+4>o)break}return w[r>>2]=0,r-n},io=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},so=(e,r,t)=>{t=B(t);var n,o,i,s;r===2?(n=ro,o=to,s=no,i=l=>Be[l>>1]):r===4&&(n=oo,o=ao,s=io,i=l=>T[l>>2]),te(e,{name:t,fromWireType:l=>{for(var f=T[l>>2],d,c=l+4,m=0;m<=f;++m){var v=l+4+m*r;if(m==f||i(v)==0){var p=v-c,y=n(c,p);d===void 0?d=y:(d+=String.fromCharCode(0),d+=y),c=v+r}}return oe(l),d},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var d=s(f),c=Pr(4+d+r);return T[c>>2]=d/r,o(f,c+4,d+r),l!==null&&l.push(oe,c),c},argPackAdvance:se,readValueFromPointer:er,destructorFunction(l){oe(l)}})},lo=(e,r)=>{r=B(r),te(e,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},uo=1,fo=()=>uo,co=(e,r,t)=>H.copyWithin(e,r,r+t),br=[],vo=(e,r,t,n)=>(e=br[e],r=he.toValue(r),e(null,r,t,n)),po=e=>{var r=br.length;return br.push(e),r},dt=(e,r)=>{var t=ve[e];return t===void 0&&C(`${r} has unknown type ${st(e)}`),t},ho=(e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=dt(T[r+n*4>>2],"parameter "+n);return t},mo=Reflect.construct,go=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=he.toHandle(n)),o},yo=(e,r,t)=>{var n=ho(e,r),o=n.shift();e--;var i=new Array(e),s=(f,d,c,m)=>{for(var v=0,p=0;p<e;++p)i[p]=n[p].readValueFromPointer(m+v),v+=n[p].argPackAdvance;var y=t===1?mo(d,i):d.apply(f,i);return go(o,c,y)},l=`methodCaller<(${n.map(f=>f.name).join(", ")}) => ${o.name}>`;return po(Ze(l,s))},wo=e=>{e>9&&(ne[e+1]+=1)},_o=e=>{var r=he.toValue(e);yr(r),Er(e)},Eo=(e,r)=>{e=dt(e,"_emval_take_value");var t=e.readValueFromPointer(r);return he.toHandle(t)},Me=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+r*4294967296:NaN;function ko(e,r,t){var n=Me(e,r),o=new Date(n*1e3);w[t>>2]=o.getUTCSeconds(),w[t+4>>2]=o.getUTCMinutes(),w[t+8>>2]=o.getUTCHours(),w[t+12>>2]=o.getUTCDate(),w[t+16>>2]=o.getUTCMonth(),w[t+20>>2]=o.getUTCFullYear()-1900,w[t+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),s=(o.getTime()-i)/(1e3*60*60*24)|0;w[t+28>>2]=s}var bo=e=>e%4===0&&(e%100!==0||e%400===0),Ao=[0,31,60,91,121,152,182,213,244,274,305,335],Po=[0,31,59,90,120,151,181,212,243,273,304,334],Co=e=>{var r=bo(e.getFullYear()),t=r?Ao:Po,n=t[e.getMonth()]+e.getDate()-1;return n};function To(e,r,t){var n=Me(e,r),o=new Date(n*1e3);w[t>>2]=o.getSeconds(),w[t+4>>2]=o.getMinutes(),w[t+8>>2]=o.getHours(),w[t+12>>2]=o.getDate(),w[t+16>>2]=o.getMonth(),w[t+20>>2]=o.getFullYear()-1900,w[t+24>>2]=o.getDay();var i=Co(o)|0;w[t+28>>2]=i,w[t+36>>2]=-(o.getTimezoneOffset()*60);var s=new Date(o.getFullYear(),0,1),l=new Date(o.getFullYear(),6,1).getTimezoneOffset(),f=s.getTimezoneOffset(),d=(l!=f&&o.getTimezoneOffset()==Math.min(f,l))|0;w[t+32>>2]=d}function Fo(e,r,t,n,o,i,s,l){var f=Me(o,i);try{if(isNaN(f))return 61;var d=j.getStreamFromFD(n),c=a.mmap(d,e,f,r,t),m=c.ptr;return w[s>>2]=c.allocated,T[l>>2]=m,0}catch(v){if(typeof a=="undefined"||v.name!=="ErrnoError")throw v;return-v.errno}}function So(e,r,t,n,o,i,s){var l=Me(i,s);try{var f=j.getStreamFromFD(o);t&2&&j.doMsync(e,f,r,n,l)}catch(d){if(typeof a=="undefined"||d.name!=="ErrnoError")throw d;return-d.errno}}var Do=(e,r,t,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),l=i.getTimezoneOffset(),f=s.getTimezoneOffset(),d=Math.max(l,f);T[e>>2]=d*60,w[r>>2]=+(l!=f);var c=p=>p.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],m=c(i),v=c(s);f<l?(ce(m,t,17),ce(v,n,17)):(ce(m,n,17),ce(v,t,17))},Ro=()=>Date.now(),ct=()=>2147483648,$o=()=>ct(),vt;vt=()=>performance.now();var Mo=e=>{var r=ze.buffer,t=(e-r.byteLength+65535)/65536;try{return ze.grow(t),Wr(),1}catch(n){}},Oo=e=>{var r=H.length;e>>>=0;var t=ct();if(e>t)return!1;for(var n=(f,d)=>f+(d-f%d)%d,o=1;o<=4;o*=2){var i=r*(1+.2/o);i=Math.min(i,e+100663296);var s=Math.min(t,n(Math.max(e,i),65536)),l=Mo(s);if(l)return!0}return!1},Ar={},Wo=()=>me||"./this.program",Oe=()=>{if(!Oe.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Wo()};for(var t in Ar)Ar[t]===void 0?delete r[t]:r[t]=Ar[t];var n=[];for(var t in r)n.push(`${t}=${r[t]}`);Oe.strings=n}return Oe.strings},jo=(e,r)=>{for(var t=0;t<e.length;++t)U[r++]=e.charCodeAt(t);U[r]=0},Io=(e,r)=>{var t=0;return Oe().forEach((n,o)=>{var i=r+t;T[e+o*4>>2]=i,jo(n,i),t+=n.length+1}),0},No=(e,r)=>{var t=Oe();T[e>>2]=t.length;var n=0;return t.forEach(o=>n+=o.length+1),T[r>>2]=n,0},xo=0,Uo=()=>Bt||xo>0,Lo=e=>{var r;sr=e,Uo()||((r=u.onExit)==null||r.call(u,e),ir=!0),be(e,new zt(e))},Ho=(e,r)=>{sr=e,Lo(e)},zo=Ho;function Bo(e){try{var r=j.getStreamFromFD(e);return a.close(r),0}catch(t){if(typeof a=="undefined"||t.name!=="ErrnoError")throw t;return t.errno}}function Vo(e,r){try{var t=0,n=0,o=0,i=j.getStreamFromFD(e),s=i.tty?2:a.isDir(i.mode)?3:a.isLink(i.mode)?7:4;return U[r]=s,ee[r+2>>1]=o,W=[t>>>0,(_=t,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+8>>2]=W[0],w[r+12>>2]=W[1],W=[n>>>0,(_=n,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[r+16>>2]=W[0],w[r+20>>2]=W[1],0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var qo=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.read(e,U,s,l,n);if(f<0)return-1;if(o+=f,f<l)break;typeof n!="undefined"&&(n+=f)}return o};function Go(e,r,t,n){try{var o=j.getStreamFromFD(e),i=qo(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}function Xo(e,r,t,n,o){var i=Me(r,t);try{if(isNaN(i))return 61;var s=j.getStreamFromFD(e);return a.llseek(s,i,n),W=[s.position>>>0,(_=s.position,+Math.abs(_)>=1?_>0?+Math.floor(_/4294967296)>>>0:~~+Math.ceil((_-+(~~_>>>0))/4294967296)>>>0:0)],w[o>>2]=W[0],w[o+4>>2]=W[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(l){if(typeof a=="undefined"||l.name!=="ErrnoError")throw l;return l.errno}}var Ko=(e,r,t,n)=>{for(var o=0,i=0;i<t;i++){var s=T[r>>2],l=T[r+4>>2];r+=8;var f=a.write(e,U,s,l,n);if(f<0)return-1;o+=f,typeof n!="undefined"&&(n+=f)}return o};function Yo(e,r,t,n){try{var o=j.getStreamFromFD(e),i=Ko(o,r,t);return T[n>>2]=i,0}catch(s){if(typeof a=="undefined"||s.name!=="ErrnoError")throw s;return s.errno}}var Qo=a.createPath,Zo=e=>a.unlink(e),Jo=a.createLazyFile,ea=a.createDevice;a.createPreloadedFile=Xr,a.staticInit(),u.FS_createPath=a.createPath,u.FS_createDataFile=a.createDataFile,u.FS_createPreloadedFile=a.createPreloadedFile,u.FS_unlink=a.unlink,u.FS_createLazyFile=a.createLazyFile,u.FS_createDevice=a.createDevice,cn(),Ee=u.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Qr=u.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},An(),_n(),$n(),it=u.UnboundTypeError=jn(Error,"UnboundTypeError"),Bn();var ra={a:Gt,q:tn,M:nn,P:on,I:an,r:sn,G:ln,N:un,S:fn,D:dn,U:pn,e:In,s:xn,n:Un,g:Ln,m:Hn,T:ut,v:Gn,i:Xn,c:Yn,b:Qn,x:Zn,o:Jn,u:eo,l:so,V:lo,Q:fo,R:co,X:vo,d:Er,Y:yo,w:wo,W:_o,h:Eo,A:ko,B:To,y:Fo,z:So,H:Do,t:Ro,F:$o,j:vt,E:Oo,K:Io,L:No,f:zo,k:Bo,J:Vo,O:Go,C:Xo,p:Yo},N=Ht(),ta=()=>(ta=N._)(),pt=e=>(pt=N.$)(e),Pr=e=>(Pr=N.ba)(e),oe=e=>(oe=N.ca)(e),ht=(e,r)=>(ht=N.da)(e,r),mt=e=>(mt=N.ea)(e),na=u.dynCall_jjj=(e,r,t,n,o)=>(na=u.dynCall_jjj=N.fa)(e,r,t,n,o),oa=u.dynCall_iiiijj=(e,r,t,n,o,i,s,l)=>(oa=u.dynCall_iiiijj=N.ga)(e,r,t,n,o,i,s,l),aa=u.dynCall_viijj=(e,r,t,n,o,i,s)=>(aa=u.dynCall_viijj=N.ha)(e,r,t,n,o,i,s),ia=u.dynCall_viiijjjj=(e,r,t,n,o,i,s,l,f,d,c,m)=>(ia=u.dynCall_viiijjjj=N.ia)(e,r,t,n,o,i,s,l,f,d,c,m),sa=u.dynCall_iji=(e,r,t,n)=>(sa=u.dynCall_iji=N.ja)(e,r,t,n),la=u.dynCall_jiji=(e,r,t,n,o)=>(la=u.dynCall_jiji=N.ka)(e,r,t,n,o),ua=u.dynCall_viijii=(e,r,t,n,o,i,s)=>(ua=u.dynCall_viijii=N.la)(e,r,t,n,o,i,s),fa=u.dynCall_iiiiij=(e,r,t,n,o,i,s)=>(fa=u.dynCall_iiiiij=N.ma)(e,r,t,n,o,i,s),da=u.dynCall_iiiiijj=(e,r,t,n,o,i,s,l,f)=>(da=u.dynCall_iiiiijj=N.na)(e,r,t,n,o,i,s,l,f),ca=u.dynCall_iiiiiijj=(e,r,t,n,o,i,s,l,f,d)=>(ca=u.dynCall_iiiiiijj=N.oa)(e,r,t,n,o,i,s,l,f,d);u.addRunDependency=Ve,u.removeRunDependency=Ce,u.FS_createPreloadedFile=Xr,u.FS_unlink=Zo,u.FS_createPath=Qo,u.FS_createDevice=ea,u.FS_createDataFile=Gr,u.FS_createLazyFile=Jo;var or;Pe=function e(){or||gt(),or||(Pe=e)};function gt(){if(de>0||(Rt(),de>0))return;function e(){var r;or||(or=!0,u.calledRun=!0,!ir&&($t(),I(u),(r=u.onRuntimeInitialized)==null||r.call(u),Mt()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),e()},1)):e()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return gt(),E=K,E}})();typeof Pt=="object"&&typeof Tr=="object"?Tr.exports=Cr:typeof define=="function"&&define.amd&&define([],()=>Cr);Cr.getUrl=function(R){return"https://st.mycdn.me/static/audio-processing/0-0-8/"+R}});var Ne=class{constructor(g,h="AudioEffects"){this.loggerFunction=g,this.loggerName=h}debug(...g){this.loggerFunction("DEBUG",`[${this.loggerName}]`,...g)}log(...g){this.loggerFunction("LOG",`[${this.loggerName}]`,...g)}warn(...g){this.loggerFunction("WARN",`[${this.loggerName}]`,...g)}error(...g){this.loggerFunction("ERROR",`[${this.loggerName}]`,...g)}};function ar(R,g=[]){let h=g.join(","),E=typeof R=="string"?[R,`exports.default(${h});`]:[`(${R})(${h});`],u=new Blob(E,{type:"application/javascript; charset=utf-8"});return window.URL.createObjectURL(u)}var ke=class{constructor(){this.outputStream=null;this.isInitialized=!1;this.audioContext=null;this.workletNode=null;this.sourceNode=null;this.logger=new Ne(()=>{})}init(V){return Z(this,arguments,function*({sampleRate:g,isOutputAudio:h=!1,isOutputStream:E=!1,workletFunction:u,workletName:I}){if(this.logger.debug("init"),this.createAudioContext(g),yield this.createWorklet(u,I),this.workletNode&&this.audioContext&&(h&&(this.workletNode.connect(this.audioContext.destination),this.logger.debug("connected to standart audio output")),E)){let K=this.audioContext.createMediaStreamDestination();this.workletNode.connect(K),this.outputStream=K.stream,this.logger.debug("connected to output MediaStream")}this.isInitialized=!0})}setSource(g){var h;if(this.audioContext&&this.workletNode){let E=null;if(g){let u=new MediaStream(g instanceof MediaStreamTrack?[g]:g.getAudioTracks().filter(I=>I.contentHint!=="music"));E=this.audioContext.createMediaStreamSource(u)}(h=this.sourceNode)==null||h.disconnect(this.workletNode),E==null||E.connect(this.workletNode),this.sourceNode=E,this.logger.debug("source "+(g?"set":"set to null"))}}destroy(){var g;this.logger.debug("destroy"),(g=this.audioContext)==null||g.close(),this.workletNode=null,this.sourceNode=null,this.audioContext=null,this.outputStream=null,this.isInitialized=!1}resume(){var g;this.logger.debug("resume"),(g=this.audioContext)==null||g.resume()}pause(){var g;this.logger.debug("pause"),(g=this.audioContext)==null||g.suspend()}setLogger(g=()=>{},h){this.logger=new Ne(g,h)}static isSupported(){try{let g=window;return!!(g.WebAssembly&&g.Worker&&(g.AudioContext||g.webkitAudioContext)&&g.AudioWorkletNode)}catch(g){return!1}}createAudioContext(g){let h=window.AudioContext||window.webkitAudioContext,E=new h(g?{sampleRate:g}:{});this.audioContext=E,this.logger.debug("created AudioContext")}createWorklet(g,h){return Z(this,null,function*(){if(this.logger.debug(`${h} init started`),!this.audioContext)return;yield this.audioContext.audioWorklet.addModule(ar(g));let E=new AudioWorkletNode(this.audioContext,h);return this.workletNode=E,new Promise(u=>{E.port.onmessage=({data:I})=>{switch(I.type){case"init":{this.logger.debug(`${h} init success`),u();break}case"data":{this.onWorkletData(I.data);break}}}})})}sendDataToWorklet(g,h=[]){var E;(E=this.workletNode)==null||E.port.postMessage(g,h)}};function At(){let G=[.26691192,.5013858,.3037737,.58564115,.35116732,.67516255,.41435885,.7225562,.4775504,.7752158,.5881356,.79627967,.68818885,.7594179,.75138044,.7120243,.8040401,.65936464,.85143363,.57510924,.8777635,.4855879,.4512206,.58564115,.5038802,.56457734,.5512739,.5540454,.5776037,.56457734,.60393345,.5540454,.66712505,.56457734,.70398676,.57510924,.65132713,.606705,.6144654,.6172369,.5776037,.6172369,.5407419,.6172369,.5038802,.606705,.46701849,.58564115,.5407419,.58564115,.5776037,.58564115,.6144654,.58564115,.68818885,.57510924,.6144654,.58564115,.5776037,.58564115,.5407419,.58564115],J=G[59],Rr=1-G[59];class He extends AudioWorkletProcessor{constructor(){super();this.lastTime=0;this.frameSampleCount=0;this.frameSampleAverage=0;this.maxInputVolume=.3;this.sequence=0;this.port.postMessage({type:"init"})}process(me){var ge;let be=currentTime,X=0,fe=(ge=me==null?void 0:me[0])==null?void 0:ge[0];if(fe!=null&&fe.length&&(X=fe.reduce((ae,z)=>ae+Math.abs(z),0)/fe.length),this.frameSampleAverage=(this.frameSampleAverage*this.frameSampleCount+X)/(this.frameSampleCount+1),this.frameSampleCount+=1,be-this.lastTime>1/25){let Y=[];for(let z=0;z<31*2;z+=1)Y.push(G[z]);this.frameSampleAverage>.015&&(Y[59]=this.frameSampleAverage/this.maxInputVolume>.5?this.sequence%2===0?this.frameSampleAverage/2:this.frameSampleAverage:this.frameSampleAverage,Y[59]=J+Rr*Y[59]/.5),this.sequence+=1,this.frameSampleCount=1,this.maxInputVolume=Math.max(this.maxInputVolume,this.frameSampleAverage),this.lastTime=be;let ae=new Float32Array(Y).buffer;this.port.postMessage({type:"data",data:ae},[ae])}return!0}}registerProcessor("vmojiLmarksVolumeWorklet",He)}var xe=class extends ke{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(xe.prototype,this,"init").call(this,{workletFunction:At,workletName:"vmojiLmarksVolumeWorklet"})})}onWorkletData(h){this.onData(h)}};var Sr=kt(Fr());var ue=class extends ke{constructor(){super(...arguments);this.worker=null}init(h){return Z(this,null,function*(){yield le(ue.prototype,this,"init").call(this,h),this.isInitialized=!1,yield this.createWorker(h.workerFunctionString,h.workerArgs),this.isInitialized=!0})}destroy(){var h;super.destroy(),(h=this.worker)==null||h.terminate(),this.worker=null}sendDataToWorker(h,E=[]){var u;(u=this.worker)==null||u.postMessage(h,E)}static isSupported(){try{let h=window;return!!(super.isSupported()&&h.Worker)}catch(h){return!1}}createWorker(h,E=[]){return new Promise((u,I)=>{this.logger.debug("worker init started"),this.worker=new Worker(ar(h,E)),this.worker.onmessage=({data:V})=>{switch(V.type){case"init":{this.logger.debug("worker init success"),u();break}case"error":{this.logger.error(V.error),I(V.error);break}case"data":{this.onWorkerData(V.data);break}case"debug":{this.logger.debug(V.message);break}}}})}};function Ct(){class R extends AudioWorkletProcessor{constructor(){super(),this.port.postMessage({type:"init"})}process(h){var E;return(E=h==null?void 0:h[0])!=null&&E[0]&&this.port.postMessage({type:"data",data:h[0][0].buffer},[h[0][0].buffer]),!0}}registerProcessor("pureWorklet",R)}var _a=16e3,Ue=class extends ue{constructor(){super(...arguments);this.onData=()=>{}}init(){return Z(this,null,function*(){yield le(Ue.prototype,this,"init").call(this,{sampleRate:_a,workletFunction:Ct,workletName:"pureWorklet",workerFunctionString:`"use strict";var exports=(()=>{var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var b=(o,t)=>{for(var e in t)g(o,e,{get:t[e],enumerable:!0})},y=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of m(t))!f.call(o,i)&&i!==e&&g(o,i,{get:()=>t[i],enumerable:!(n=w(t,i))||n.enumerable});return o};var A=o=>y(g({},"__esModule",{value:!0}),o);var v={};b(v,{default:()=>x});var x=(o,t)=>{let e=null,n=null;function i(){return o({locateFile:t}).then(r=>{e=r;let l=new e.ConfigInput("animoji_v4.cfg",!0,"/"),s=new e.Config(l);n=e.AnimojiFactory.createAlgorithm(s)})}function p(r){self.postMessage({type:"error",error:typeof r=="number"&&e?e.getExMessage(r):r})}function k(r){var l;if(!(!e||!n))try{let s=new e.vector$float$,h=new Float32Array(r);for(let u of h)s.push_back(u);let a=e.animate(n,s),d=(l=a==null?void 0:a.size)==null?void 0:l.call(a);if(!d)return;let c=new Float32Array(d);for(let u=0;u<d;u++)c[u]=a.get(u);self.postMessage({type:"data",data:c.buffer},[c.buffer])}catch(s){p(s)}}i().then(()=>{self.onmessage=r=>{k(r.data.data)},self.postMessage({type:"init"})}).catch(p)};return A(v);})();
|
|
9
|
+
`,workerArgs:[Sr.default,Sr.default.getUrl]})})}onWorkletData(h){this.sendDataToWorker({data:h},[h])}onWorkerData(h){this.onData(h)}static isSupported(){try{let h=super.isSupported(),E=/firefox/i.test(navigator.userAgent);return h&&!E}catch(h){return!1}}};var Dr=kt(Fr());function Tt(){class R extends AudioWorkletProcessor{constructor(){super();this.samplesQueue=new Float32Array;this.port.postMessage({type:"init"}),this.port.onmessage=({data:{data:E}})=>{let u=new Float32Array(E),I=new Float32Array(this.samplesQueue.length+u.length);I.set(this.samplesQueue,0),I.set(u,this.samplesQueue.length),this.samplesQueue=I}}process(E,u){var I;return(I=E==null?void 0:E[0])!=null&&I[0]&&this.port.postMessage({type:"data",data:E[0][0].buffer},[E[0][0].buffer]),this.samplesQueue.length>=128&&(u[0].forEach(K=>{K.set(this.samplesQueue.subarray(0,128))}),this.samplesQueue=this.samplesQueue.slice(128)),!0}}registerProcessor("voiceChangeWorklet",R)}var Ft=(h=>(h.PLAYBACK="playback",h.OUTPUT_STREAM="output_stream",h))(Ft||{}),St=(L=>(L.BALLOON="balloon",L.CATHEDRAL="cathedral",L.CHORUS="chorus",L.DISTORTION="distortion",L.ECHO="echo",L.EVIL="evil",L.GIANT="giant",L.HALL="hall",L.PHASER="phaser",L.ROBOT="robot",L.SQUIRELL="squirell",L.DENOISE="denoise",L))(St||{}),Ea=44100,Le=class extends ue{constructor(h="playback"){super();this.mode=h}init(){return Z(this,null,function*(){yield le(Le.prototype,this,"init").call(this,{sampleRate:Ea,isOutputAudio:this.mode==="playback",isOutputStream:this.mode==="output_stream",workletFunction:Tt,workletName:"voiceChangeWorklet",workerFunctionString:'"use strict";var exports=(()=>{var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var W=(n,r)=>{for(var t in r)p(n,t,{get:r[t],enumerable:!0})},A=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of y(r))!b.call(n,c)&&c!==t&&p(n,c,{get:()=>r[c],enumerable:!(i=m(r,c))||i.enumerable});return n};var R=n=>A(p({},"__esModule",{value:!0}),n);var S={};W(S,{VoiceChangeWorkerRequestType:()=>f,default:()=>E});var f=(t=>(t.SET_EFFECTS="set_effects",t.DATA="data",t))(f||{}),E=(n,r)=>{let t=null,i=[];function c(){return n({locateFile:r}).then(e=>{t=e})}function k(e,a=!1){if(t)try{for(let o of e){let g=`${o}${a?".cfg":""}`,u=new t.ConfigInput(g,a,"/"),l=new t.Config(u),s=t.EffectFactory.createAlgorithm(l);i.push({configInput:u,config:l,effect:s})}}catch(o){self.postMessage({type:"debug",message:"before error "+JSON.stringify(i)}),d("setEffects error:",o)}}function h(){try{for(let e of i)e.configInput.delete(),e.config.delete(),e.effect.delete()}catch(e){d("clearEffects error:",e)}i=[]}function d(e,a){self.postMessage({type:"error",error:typeof a=="number"&&t?t.getExMessage(a):e+a})}function w(e){var a;if(!(!t||!i.length))try{let o=new t.vector$float$,g=new Float32Array(e);for(let s of g)o.push_back(s);for(let{effect:s}of i)o=t.applyEffect(s,o);let u=(a=o==null?void 0:o.size)==null?void 0:a.call(o);if(!u)return;let l=new Float32Array(u);for(let s=0;s<u;s++)l[s]=o.get(s);self.postMessage({type:"data",data:l.buffer},[l.buffer])}catch(o){d("requestSamples error:",o)}}c().then(()=>{self.onmessage=({data:e})=>{switch(e.type){case"set_effects":{h(),k(e.effects,e.isPreset);break}case"data":{w(e.data);break}}},self.postMessage({type:"init"})}).catch(e=>d("init error:",e))};return R(S);})();\n',workerArgs:[Dr.default,Dr.default.getUrl]})})}setEffects(h,E){this.logger.debug("setEffects",h,E),this.sendDataToWorker({type:"set_effects",effects:h,isPreset:E})}onWorkletData(h){this.sendDataToWorker({type:"data",data:h},[h])}onWorkerData(h){this.sendDataToWorklet({data:h},[h])}};export{Ue as EffectVmojiLmarksAi,xe as EffectVmojiLmarksVolume,Le as EffectVoiceChange,Ft as EffectVoiceChangeMode,St as VoiceChangeEffectType};
|