Newer
Older
safe_production_front / public / js / jessibuca-pro-object-detector-demo.js
dutingting on 8 Apr 81 KB 暂存
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r=e(t((function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}))),n=t((function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),o=e(n),i=t((function(e){var t=n.default;e.exports=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}));e(i);var a=t((function(e){var t=n.default;e.exports=function(e){var r=i(e,"string");return"symbol"===t(r)?r:String(r)},e.exports.__esModule=!0,e.exports.default=e.exports}));e(a);var s=e(t((function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}))),u=t((function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}));e(u);var c=e(t((function(e){e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports}))),f=t((function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}));e(f);var l,d=t((function(e){var t=n.default;e.exports=function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return f(e)},e.exports.__esModule=!0,e.exports.default=e.exports})),p=e(d),h=t((function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),m=e(h),v=(l="undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("jessibuca-pro-object-detector-demo.js",document.baseURI).href,function(e){var t,r;(e=void 0!==(e=e||{})?e:{}).ready=new Promise((function(e,n){t=e,r=n})),(e=void 0!==e?e:{}).locateFile=function(e){return"jessibuca-pro-object-detector-decoder.wasm"==e&&"undefined"!=typeof JESSIBUCA_PRO_OBJECT_DETECTOR_WASM_URL&&""!=JESSIBUCA_PRO_OBJECT_DETECTOR_WASM_URL?JESSIBUCA_PRO_OBJECT_DETECTOR_WASM_URL:e};var n,i,a,s,u,c,f=Object.assign({},e),d="./this.program",p="object"==("undefined"==typeof window?"undefined":o(window)),h="function"==typeof importScripts,m="object"==("undefined"==typeof process?"undefined":o(process))&&"object"==o(process.versions)&&"string"==typeof process.versions.node,v="";m?(v=h?require("path").dirname(v)+"/":__dirname+"/",c=function(){u||(s=require("fs"),u=require("path"))},n=function(e,t){return c(),e=u.normalize(e),s.readFileSync(e,t?void 0:"utf8")},a=function(e){var t=n(e,!0);return t.buffer||(t=new Uint8Array(t)),t},i=function(e,t,r){c(),e=u.normalize(e),s.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof te))throw e})),process.on("unhandledRejection",(function(e){throw e})),e.inspect=function(){return"[Emscripten Module object]"}):(p||h)&&(h?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),l&&(v=l),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},h&&(a=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),i=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var y=e.print||console.log.bind(console),g=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.arguments&&e.arguments,e.thisProgram&&(d=e.thisProgram),e.quit&&e.quit;var w,_,b=4;e.wasmBinary&&(w=e.wasmBinary),e.noExitRuntime,"object"!=("undefined"==typeof WebAssembly?"undefined":o(WebAssembly))&&q("no native wasm support detected");var E=!1;function k(e,t){e||q(t)}var P,T,C,S,D,F,A,x,j,M,O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&O)return O.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function R(e,t){return e?$(C,e,t):""}function B(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function W(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t}e.INITIAL_MEMORY;var z=[],N=[],U=[],I=0,L=null;function H(t){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function V(t){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&L){var r=L;L=null,r()}}function q(t){e.onAbort&&e.onAbort(t),g(t="Aborted("+t+")"),E=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw r(n),n}var Y,X,G,J,K="data:application/octet-stream;base64,";function Z(e){return e.startsWith(K)}function Q(e){return e.startsWith("file://")}function ee(e){try{if(e==Y&&w)return new Uint8Array(w);if(a)return a(e);throw"both async and sync fetching of the wasm failed"}catch(e){q(e)}}function te(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function re(t){for(;t.length>0;)t.shift()(e)}function ne(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){A[this.ptr+4>>2]=e},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(e){A[this.ptr+8>>2]=e},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_refcount=function(e){F[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,T[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=T[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,T[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=T[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=F[this.ptr>>2];F[this.ptr>>2]=e+1},this.release_ref=function(){var e=F[this.ptr>>2];return F[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){A[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ar(this.get_type()))return A[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}e.locateFile?Z(Y="jessibuca-pro-object-detector-decoder.wasm")||(X=Y,Y=e.locateFile?e.locateFile(X,v):v+X):Y=new URL("jessibuca-pro-object-detector-decoder.wasm","undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("jessibuca-pro-object-detector-demo.js",document.baseURI).href).toString();var oe={isAbs:function(e){return"/"===e.charAt(0)},splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t=oe.isAbs(e),r="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=oe.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return oe.normalize(e.join("/"))},join2:function(e,t){return oe.normalize(e+"/"+t)}},ie={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:fe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=oe.isAbs(n)}return(t?"/":"")+(e=oe.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ie.resolve(e).substr(1),t=ie.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}};function ae(e,t,r){var n=r>0?r:W(e)+1,o=new Array(n),i=B(e,o,0,o.length);return t&&(o.length=i),o}var se={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){se.ttys[e]={input:[],output:[],ops:t},fe.registerDevice(e,se.stream_ops)},stream_ops:{open:function(e){var t=se.ttys[e.node.rdev];if(!t)throw new fe.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new fe.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new fe.ErrnoError(29)}if(void 0===s&&0===i)throw new fe.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new fe.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new fe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(m){var r=Buffer.alloc(256),n=0;try{n=s.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=ae(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(y($(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(y($(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(g($(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(g($(e.output,0)),e.output=[])}}};function ue(e){q()}var ce={ops_table:null,mount:function(e){return ce.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(fe.isBlkdev(r)||fe.isFIFO(r))throw new fe.ErrnoError(63);ce.ops_table||(ce.ops_table={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:fe.chrdev_stream_ops}});var o=fe.createNode(e,t,r,n);return fe.isDir(o.mode)?(o.node_ops=ce.ops_table.dir.node,o.stream_ops=ce.ops_table.dir.stream,o.contents={}):fe.isFile(o.mode)?(o.node_ops=ce.ops_table.file.node,o.stream_ops=ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):fe.isLink(o.mode)?(o.node_ops=ce.ops_table.link.node,o.stream_ops=ce.ops_table.link.stream):fe.isChrdev(o.mode)&&(o.node_ops=ce.ops_table.chrdev.node,o.stream_ops=ce.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=fe.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,fe.isDir(e.mode)?t.size=4096:fe.isFile(e.mode)?t.size=e.usedBytes:fe.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ce.resizeFileStorage(e,t.size)},lookup:function(e,t){throw fe.genericErrors[44]},mknod:function(e,t,r,n){return ce.createNode(e,t,r,n)},rename:function(e,t,r){if(fe.isDir(e.mode)){var n;try{n=fe.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new fe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=fe.lookupNode(e,t);for(var n in r.contents)throw new fe.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=ce.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!fe.isLink(e.mode))throw new fe.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(ce.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&fe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new fe.ErrnoError(28);return n},allocate:function(e,t,r){ce.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==P){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=ue()))throw new fe.ErrnoError(48);T.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);return 2&o||ce.stream_ops.write(e,t,0,n,r,!1),0}}},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(e=ie.resolve(fe.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new fe.ErrnoError(32);for(var r=oe.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),n=fe.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=fe.lookupNode(n,r[i]),o=oe.join2(o,r[i]),fe.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;fe.isLink(n.mode);){var u=fe.readlink(o);if(o=ie.resolve(oe.dirname(o),u),n=fe.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new fe.ErrnoError(32)}}return{path:o,node:n}},getPath:function(e){for(var t;;){if(fe.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%fe.nameTable.length},hashAddNode:function(e){var t=fe.hashName(e.parent.id,e.name);e.name_next=fe.nameTable[t],fe.nameTable[t]=e},hashRemoveNode:function(e){var t=fe.hashName(e.parent.id,e.name);if(fe.nameTable[t]===e)fe.nameTable[t]=e.name_next;else for(var r=fe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=fe.mayLookup(e);if(r)throw new fe.ErrnoError(r,e);for(var n=fe.hashName(e.id,t),o=fe.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return fe.lookup(e,t)},createNode:function(e,t,r,n){var o=new fe.FSNode(e,t,r,n);return fe.hashAddNode(o),o},destroyNode:function(e){fe.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=fe.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return fe.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2},mayLookup:function(e){var t=fe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return fe.lookupNode(e,t),20}catch(e){}return fe.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=fe.lookupNode(e,t)}catch(e){return e.errno}var o=fe.nodePermissions(e,"wx");if(o)return o;if(r){if(!fe.isDir(n.mode))return 54;if(fe.isRoot(n)||fe.getPath(n)===fe.cwd())return 10}else if(fe.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?fe.isLink(e.mode)?32:fe.isDir(e.mode)&&("r"!==fe.flagsToPermissionString(t)||512&t)?31:fe.nodePermissions(e,fe.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.MAX_OPEN_FDS,r=e;r<=t;r++)if(!fe.streams[r])return r;throw new fe.ErrnoError(33)},getStream:function(e){return fe.streams[e]},createStream:function(e,t,r){fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.FSStream.prototype={},Object.defineProperties(fe.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new fe.FSStream,e);var n=fe.nextfd(t,r);return e.fd=n,fe.streams[n]=e,e},closeStream:function(e){fe.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=fe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new fe.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){fe.devices[e]={stream_ops:t}},getDevice:function(e){return fe.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&g("warning: "+fe.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=fe.getMounts(fe.root.mount),n=0;function o(e){return fe.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:function(e,t,r){var n,o="/"===r,i=!r;if(o&&fe.root)throw new fe.ErrnoError(10);if(!o&&!i){var a=fe.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,fe.isMountpoint(n))throw new fe.ErrnoError(10);if(!fe.isDir(n.mode))throw new fe.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?fe.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var t=fe.lookupPath(e,{follow_mount:!1});if(!fe.isMountpoint(t.node))throw new fe.ErrnoError(28);var r=t.node,n=r.mounted,o=fe.getMounts(n);Object.keys(fe.nameTable).forEach((function(e){for(var t=fe.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&fe.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=fe.lookupPath(e,{parent:!0}).node,o=oe.basename(e);if(!o||"."===o||".."===o)throw new fe.ErrnoError(28);var i=fe.mayCreate(n,o);if(i)throw new fe.ErrnoError(i);if(!n.node_ops.mknod)throw new fe.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,fe.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,fe.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{fe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,fe.mknod(e,t,r)},symlink:function(e,t){if(!ie.resolve(e))throw new fe.ErrnoError(44);var r=fe.lookupPath(t,{parent:!0}).node;if(!r)throw new fe.ErrnoError(44);var n=oe.basename(t),o=fe.mayCreate(r,n);if(o)throw new fe.ErrnoError(o);if(!r.node_ops.symlink)throw new fe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=oe.dirname(e),i=oe.dirname(t),a=oe.basename(e),s=oe.basename(t);if(r=fe.lookupPath(e,{parent:!0}).node,n=fe.lookupPath(t,{parent:!0}).node,!r||!n)throw new fe.ErrnoError(44);if(r.mount!==n.mount)throw new fe.ErrnoError(75);var u,c=fe.lookupNode(r,a),f=ie.relative(e,i);if("."!==f.charAt(0))throw new fe.ErrnoError(28);if("."!==(f=ie.relative(t,o)).charAt(0))throw new fe.ErrnoError(55);try{u=fe.lookupNode(n,s)}catch(e){}if(c!==u){var l=fe.isDir(c.mode),d=fe.mayDelete(r,a,l);if(d)throw new fe.ErrnoError(d);if(d=u?fe.mayDelete(n,s,l):fe.mayCreate(n,s))throw new fe.ErrnoError(d);if(!r.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(c)||u&&fe.isMountpoint(u))throw new fe.ErrnoError(10);if(n!==r&&(d=fe.nodePermissions(r,"w")))throw new fe.ErrnoError(d);fe.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{fe.hashAddNode(c)}}},rmdir:function(e){var t=fe.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=fe.lookupNode(t,r),o=fe.mayDelete(t,r,!0);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.rmdir(t,r),fe.destroyNode(n)},readdir:function(e){var t=fe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new fe.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=fe.lookupPath(e,{parent:!0}).node;if(!t)throw new fe.ErrnoError(44);var r=oe.basename(e),n=fe.lookupNode(t,r),o=fe.mayDelete(t,r,!1);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.unlink(t,r),fe.destroyNode(n)},readlink:function(e){var t=fe.lookupPath(e).node;if(!t)throw new fe.ErrnoError(44);if(!t.node_ops.readlink)throw new fe.ErrnoError(28);return ie.resolve(fe.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=fe.lookupPath(e,{follow:!t}).node;if(!r)throw new fe.ErrnoError(44);if(!r.node_ops.getattr)throw new fe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(e){return fe.stat(e,!0)},chmod:function(e,t,r){var n;if(!(n="string"==typeof e?fe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){fe.chmod(e,t,!0)},fchmod:function(e,t){var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);fe.chmod(r.node,t)},chown:function(e,t,r,n){var o;if(!(o="string"==typeof e?fe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){fe.chown(e,t,r,!0)},fchown:function(e,t,r){var n=fe.getStream(e);if(!n)throw new fe.ErrnoError(8);fe.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new fe.ErrnoError(28);var r;if(!(r="string"==typeof e?fe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(r.mode))throw new fe.ErrnoError(31);if(!fe.isFile(r.mode))throw new fe.ErrnoError(28);var n=fe.nodePermissions(r,"w");if(n)throw new fe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);if(0==(2097155&r.flags))throw new fe.ErrnoError(28);fe.truncate(r.node,t)},utime:function(e,t,r){var n=fe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(t,r,n){if(""===t)throw new fe.ErrnoError(44);var i;if(n=void 0===n?438:n,n=64&(r="string"==typeof r?fe.modeStringToFlags(r):r)?4095&n|32768:0,"object"==o(t))i=t;else{t=oe.normalize(t);try{i=fe.lookupPath(t,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(i){if(128&r)throw new fe.ErrnoError(20)}else i=fe.mknod(t,n,0),a=!0;if(!i)throw new fe.ErrnoError(44);if(fe.isChrdev(i.mode)&&(r&=-513),65536&r&&!fe.isDir(i.mode))throw new fe.ErrnoError(54);if(!a){var s=fe.mayOpen(i,r);if(s)throw new fe.ErrnoError(s)}512&r&&!a&&fe.truncate(i,0),r&=-131713;var u=fe.createStream({node:i,path:fe.getPath(i),flags:r,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!e.logReadFiles||1&r||(fe.readFiles||(fe.readFiles={}),t in fe.readFiles||(fe.readFiles[t]=1)),u},close:function(e){if(fe.isClosed(e))throw new fe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{fe.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new fe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new fe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(1==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.read)throw new fe.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:function(e,t,r,n,o,i){if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.write)throw new fe.ErrnoError(28);e.seekable&&1024&e.flags&&fe.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:function(e,t,r){if(fe.isClosed(e))throw new fe.ErrnoError(8);if(t<0||r<=0)throw new fe.ErrnoError(28);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(!fe.isFile(e.node.mode)&&!fe.isDir(e.node.mode))throw new fe.ErrnoError(43);if(!e.stream_ops.allocate)throw new fe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new fe.ErrnoError(2);if(1==(2097155&e.flags))throw new fe.ErrnoError(2);if(!e.stream_ops.mmap)throw new fe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new fe.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var n=fe.open(e,r.flags),o=fe.stat(e).size,i=new Uint8Array(o);return fe.read(n,i,0,o,0),"utf8"===r.encoding?t=$(i,0):"binary"===r.encoding&&(t=i),fe.close(n),t},writeFile:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.flags=r.flags||577;var n=fe.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(W(t)+1),i=B(t,o,0,o.length);fe.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");fe.write(n,t,0,t.byteLength,void 0,r.canOwn)}fe.close(n)},cwd:function(){return fe.currentPath},chdir:function(e){var t=fe.lookupPath(e,{follow:!0});if(null===t.node)throw new fe.ErrnoError(44);if(!fe.isDir(t.node.mode))throw new fe.ErrnoError(54);var r=fe.nodePermissions(t.node,"x");if(r)throw new fe.ErrnoError(r);fe.currentPath=t.path},createDefaultDirectories:function(){fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices:function(){fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),fe.mkdev("/dev/null",fe.makedev(1,3)),se.register(fe.makedev(5,0),se.default_tty_ops),se.register(fe.makedev(6,0),se.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var e=function(){if("object"==("undefined"==typeof crypto?"undefined":o(crypto))&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(m)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){return q("randomDevice")}}();fe.createDevice("/dev","random",e),fe.createDevice("/dev","urandom",e),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){fe.mkdir("/proc");var e=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount:function(){var t=fe.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=+t,n=fe.getStream(r);if(!n)throw new fe.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){e.stdin?fe.createDevice("/dev","stdin",e.stdin):fe.symlink("/dev/tty","/dev/stdin"),e.stdout?fe.createDevice("/dev","stdout",null,e.stdout):fe.symlink("/dev/tty","/dev/stdout"),e.stderr?fe.createDevice("/dev","stderr",null,e.stderr):fe.symlink("/dev/tty1","/dev/stderr"),fe.open("/dev/stdin",0),fe.open("/dev/stdout",1),fe.open("/dev/stderr",1)},ensureErrnoError:function(){fe.ErrnoError||(fe.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach((function(e){fe.genericErrors[e]=new fe.ErrnoError(e),fe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(ce,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:ce}},init:function(t,r,n){fe.init.initialized=!0,fe.ensureErrnoError(),e.stdin=t||e.stdin,e.stdout=r||e.stdout,e.stderr=n||e.stderr,fe.createStandardStreams()},quit:function(){fe.init.initialized=!1;for(var e=0;e<fe.streams.length;e++){var t=fe.streams[e];t&&fe.close(t)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:function(e,t){var r=fe.analyzePath(e,t);return r.exists?r.object:null},analyzePath:function(e,t){try{e=(n=fe.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=fe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=oe.basename(e),n=fe.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:function(e,t,r,n){e="string"==typeof e?e:fe.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=oe.join2(e,i);try{fe.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,r,n,o){var i=oe.join2("string"==typeof e?e:fe.getPath(e),t),a=fe.getMode(n,o);return fe.create(i,a)},createDataFile:function(e,t,r,n,o,i){var a=t;e&&(e="string"==typeof e?e:fe.getPath(e),a=t?oe.join2(e,t):e);var s=fe.getMode(n,o),u=fe.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),f=0,l=r.length;f<l;++f)c[f]=r.charCodeAt(f);r=c}fe.chmod(u,146|s);var d=fe.open(u,577);fe.write(d,r,0,r.length,0,i),fe.close(d),fe.chmod(u,s)}return u},createDevice:function(e,t,r,n){var o=oe.join2("string"==typeof e?e:fe.getPath(e),t),i=fe.getMode(!!r,!!n);fe.createDevice.major||(fe.createDevice.major=64);var a=fe.makedev(fe.createDevice.major++,0);return fe.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new fe.ErrnoError(29)}if(void 0===u&&0===a)throw new fe.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,o,i){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new fe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),fe.mkdev(o,i,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!n)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ae(n(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new fe.ErrnoError(29)}},createLazyFile:function(e,t,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ae(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,y("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!h)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=fe.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function f(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((function(e){var t=u.stream_ops[e];c[e]=function(){return fe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=function(e,t,r,n,o){return fe.forceLoadFile(u),f(e,t,r,n,o)},c.mmap=function(e,t,r,n,o){fe.forceLoadFile(u);var i=ue();if(!i)throw new fe.ErrnoError(48);return f(e,T,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:function(e,t,r,n,o,a,s,u,c,f){var l=t?ie.resolve(oe.join2(e,t)):e;function d(r){function i(r){f&&f(),u||fe.createDataFile(e,t,r,n,o,c),a&&a(),V()}Browser.handledByPreloadPlugin(r,l,i,(function(){s&&s(),V()}))||i(r)}H(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;i(e,(function(r){k(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&V()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&H()}(r,(function(e){return d(e)}),s):d(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=fe.indexedDB();try{var o=n.open(fe.DB_NAME(),fe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){y("creating db"),o.result.createObjectStore(fe.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([fe.DB_STORE_NAME],"readwrite"),i=n.objectStore(fe.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((function(e){var t=i.put(fe.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==u&&c()},t.onerror=function(){s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=fe.indexedDB();try{var o=n.open(fe.DB_NAME(),fe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([fe.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(fe.DB_STORE_NAME),s=0,u=0,c=e.length;function f(){0==u?t():r()}e.forEach((function(e){var t=a.get(e);t.onsuccess=function(){fe.analyzePath(e).exists&&fe.unlink(e),fe.createDataFile(oe.dirname(e),oe.basename(e),t.result,!0,!0,!0),++s+u==c&&f()},t.onerror=function(){u++,s+u==c&&f()}})),i.onerror=r},o.onerror=r}},le={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(oe.isAbs(t))return t;var n;if(-100===e)n=fe.cwd();else{var o=fe.getStream(e);if(!o)throw new fe.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new fe.ErrnoError(44);return n}return oe.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(fe.getPath(e.node)))return-54;throw e}return F[r>>2]=n.dev,F[r+4>>2]=0,F[r+8>>2]=n.ino,F[r+12>>2]=n.mode,F[r+16>>2]=n.nlink,F[r+20>>2]=n.uid,F[r+24>>2]=n.gid,F[r+28>>2]=n.rdev,F[r+32>>2]=0,J=[n.size>>>0,(G=n.size,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],F[r+40>>2]=J[0],F[r+44>>2]=J[1],F[r+48>>2]=4096,F[r+52>>2]=n.blocks,J=[Math.floor(n.atime.getTime()/1e3)>>>0,(G=Math.floor(n.atime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],F[r+56>>2]=J[0],F[r+60>>2]=J[1],F[r+64>>2]=0,J=[Math.floor(n.mtime.getTime()/1e3)>>>0,(G=Math.floor(n.mtime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],F[r+72>>2]=J[0],F[r+76>>2]=J[1],F[r+80>>2]=0,J=[Math.floor(n.ctime.getTime()/1e3)>>>0,(G=Math.floor(n.ctime.getTime()/1e3),+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],F[r+88>>2]=J[0],F[r+92>>2]=J[1],F[r+96>>2]=0,J=[n.ino>>>0,(G=n.ino,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],F[r+104>>2]=J[0],F[r+108>>2]=J[1],0},doMsync:function(e,t,r,n,o){var i=C.slice(e,e+r);fe.msync(t,i,o,r,n)},varargs:void 0,get:function(){return le.varargs+=4,F[le.varargs-4>>2]},getStr:function(e){return R(e)},getStreamFromFD:function(e){var t=fe.getStream(e);if(!t)throw new fe.ErrnoError(8);return t}},de={};function pe(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function he(e){return this.fromWireType(F[e>>2])}var me={},ve={},ye={},ge=48,we=57;function _e(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=ge&&t<=we?"_"+e:e}function be(e,t){return e=_e(e),new Function("body","return function "+e+'() {\n    "use strict";    return body.apply(this, arguments);\n};\n')(t)}function Ee(e,t){var r=be(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var ke=void 0;function Pe(e){throw new ke(e)}function Te(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Pe("Mismatched type converter count");for(var o=0;o<e.length;++o)xe(e[o],n[o])}e.forEach((function(e){ye[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){ve.hasOwnProperty(e)?o[t]=ve[e]:(i.push(e),me.hasOwnProperty(e)||(me[e]=[]),me[e].push((function(){o[t]=ve[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function Ce(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var Se=void 0;function De(e){for(var t="",r=e;C[r];)t+=Se[C[r++]];return t}var Fe=void 0;function Ae(e){throw new Fe(e)}function xe(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||Ae('type "'+n+'" must have a positive integer typeid pointer'),ve.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;Ae("Cannot register type '"+n+"' twice")}if(ve[e]=t,delete ye[e],me.hasOwnProperty(e)){var o=me[e];delete me[e],o.forEach((function(e){return e()}))}}function je(e){if(!(this instanceof et))return!1;if(!(e instanceof et))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function Me(e){Ae(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Oe=!1;function $e(e){}function Re(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function Be(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=Be(e,t,r.baseClass);return null===n?null:r.downcast(n)}var We={};function ze(){return Object.keys(Ve).length}function Ne(){var e=[];for(var t in Ve)Ve.hasOwnProperty(t)&&e.push(Ve[t]);return e}var Ue=[];function Ie(){for(;Ue.length;){var e=Ue.pop();e.$$.deleteScheduled=!1,e.delete()}}var Le=void 0;function He(e){Le=e,Ue.length&&Le&&Le(Ie)}var Ve={};function qe(e,t){return t=function(e,t){for(void 0===t&&Ae("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Ve[t]}function Ye(e,t){return t.ptrType&&t.ptr||Pe("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Pe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ge(Object.create(e,{$$:{value:t}}))}function Xe(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=qe(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Ye(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Ye(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=We[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Be(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Ye(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):Ye(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function Ge(e){return"undefined"==typeof FinalizationRegistry?(Ge=function(e){return e},e):(Oe=new FinalizationRegistry((function(e){Re(e.$$)})),Ge=function(e){var t=e.$$;if(t.smartPtr){var r={$$:t};Oe.register(e,r,e)}return e},$e=function(e){return Oe.unregister(e)},Ge(e))}function Je(){if(this.$$.ptr||Me(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Ge(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Ke(){this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),$e(this),Re(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ze(){return!this.$$.ptr}function Qe(){return this.$$.ptr||Me(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),Ue.push(this),1===Ue.length&&Le&&Le(Ie),this.$$.deleteScheduled=!0,this}function et(){}function tt(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||Ae("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function rt(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function nt(e,t,r){for(;t!==r;)t.upcast||Ae("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function ot(e,t){if(null===t)return this.isReference&&Ae("null is not a valid "+this.name),0;t.$$||Ae('Cannot pass "'+St(t)+'" as a '+this.name),t.$$.ptr||Ae("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return nt(t.$$.ptr,r,this.registeredClass)}function it(e,t){var r;if(null===t)return this.isReference&&Ae("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||Ae('Cannot pass "'+St(t)+'" as a '+this.name),t.$$.ptr||Ae("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&Ae("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=nt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&Ae("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:Ae("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Ct.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:Ae("Unsupporting sharing policy")}return r}function at(e,t){if(null===t)return this.isReference&&Ae("null is not a valid "+this.name),0;t.$$||Ae('Cannot pass "'+St(t)+'" as a '+this.name),t.$$.ptr||Ae("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&Ae("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return nt(t.$$.ptr,r,this.registeredClass)}function st(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function ut(e){this.rawDestructor&&this.rawDestructor(e)}function ct(e){null!==e&&e.delete()}function ft(e,t,r,n,o,i,a,s,u,c,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==t.baseClass?this.toWireType=it:n?(this.toWireType=ot,this.destructorFunction=null):(this.toWireType=at,this.destructorFunction=null)}var lt=[];function dt(e){var t=lt[e];return t||(e>=lt.length&&(lt.length=e+1),lt[e]=t=M.get(e)),t}function pt(t,r,n){return t.includes("j")?function(t,r,n){var o=e["dynCall_"+t];return n&&n.length?o.apply(null,[r].concat(n)):o.call(null,r)}(t,r,n):dt(r).apply(null,n)}function ht(e,t){var r,n,o,i=(e=De(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),pt(r,n,o)}):dt(t);return"function"!=typeof i&&Ae("unknown function pointer with signature "+e+": "+t),i}var mt=void 0;function vt(e){var t=or(e),r=De(t);return rr(t),r}function yt(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||ve[t]||(ye[t]?ye[t].forEach(e):(r.push(t),n[t]=!0))})),new mt(e+": "+r.map(vt).join([", "]))}function gt(e,t){for(var r=[],n=0;n<e;n++)r.push(A[t+4*n>>2]);return r}function wt(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+o(e)+" which is not a function");var r=be(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,i=e.apply(n,t);return i instanceof Object?i:n}function _t(e,t,r,n,o){var i=t.length;i<2&&Ae("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var c="void"!==t[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var d="return function "+_e(e)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var p=s?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[Ae,n,o,pe,t[0],t[1]];for(a&&(d+="var thisWired = classParam.toWireType("+p+", this);\n"),u=0;u<i-2;++u)d+="var arg"+u+"Wired = argType"+u+".toWireType("+p+", arg"+u+"); // "+t[u+2].name+"\n",h.push("argType"+u),m.push(t[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),d+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)d+="runDestructors(destructors);\n";else for(u=a?1:2;u<t.length;++u){var v=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==t[u].destructorFunction&&(d+=v+"_dtor("+v+"); // "+t[u].name+"\n",h.push(v+"_dtor"),m.push(t[u].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",h.push(d),wt(Function,h).apply(null,m)}var bt=[],Et=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function kt(e){e>4&&0==--Et[e].refcount&&(Et[e]=void 0,bt.push(e))}function Pt(){for(var e=0,t=5;t<Et.length;++t)void 0!==Et[t]&&++e;return e}function Tt(){for(var e=5;e<Et.length;++e)if(void 0!==Et[e])return Et[e];return null}var Ct={toValue:function(e){return e||Ae("Cannot use deleted val. handle = "+e),Et[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=bt.length?bt.pop():Et.length;return Et[t]={refcount:1,value:e},t}}};function St(e){if(null===e)return"null";var t=o(e);return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Dt(e,t){switch(t){case 2:return function(e){return this.fromWireType(x[e>>2])};case 3:return function(e){return this.fromWireType(j[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Ft(e,t,r){switch(t){case 0:return r?function(e){return T[e]}:function(e){return C[e]};case 1:return r?function(e){return S[e>>1]}:function(e){return D[e>>1]};case 2:return r?function(e){return F[e>>2]}:function(e){return A[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var At="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function xt(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&D[n];)++n;if((r=n<<1)-e>32&&At)return At.decode(C.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=S[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function jt(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var a=e.charCodeAt(i);S[t>>1]=a,t+=2}return S[t>>1]=0,t-n}function Mt(e){return 2*e.length}function Ot(e,t){for(var r=0,n="";!(r>=t/4);){var o=F[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function $t(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),F[t>>2]=a,(t+=4)+4>o)break}return F[t>>2]=0,t-n}function Rt(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}var Bt=!0;function Wt(e,t){var r=ve[e];return void 0===r&&Ae(t+" has unknown type "+vt(e)),r}var zt={};function Nt(e){var t=zt[e];return void 0===t?De(e):t}var Ut=[];function It(){return"object"==("undefined"==typeof globalThis?"undefined":o(globalThis))?globalThis:Function("return this")()}var Lt,Ht=[];Lt=m?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Vt={};function qt(){if(!qt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==("undefined"==typeof navigator?"undefined":o(navigator))&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:d||"./this.program"};for(var t in Vt)void 0===Vt[t]?delete e[t]:e[t]=Vt[t];var r=[];for(var t in e)r.push(t+"="+e[t]);qt.strings=r}return qt.strings}function Yt(e){return e%4==0&&(e%100!=0||e%400==0)}var Xt=[31,29,31,30,31,30,31,31,30,31,30,31],Gt=[31,28,31,30,31,30,31,31,30,31,30,31];function Jt(e,t,r,n){var o=F[n+40>>2],i={tm_sec:F[n>>2],tm_min:F[n+4>>2],tm_hour:F[n+8>>2],tm_mday:F[n+12>>2],tm_mon:F[n+16>>2],tm_year:F[n+20>>2],tm_wday:F[n+24>>2],tm_yday:F[n+28>>2],tm_isdst:F[n+32>>2],tm_gmtoff:F[n+36>>2],tm_zone:o?R(o):""},a=R(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return l(e,t,"0")}function p(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function h(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function m(e){var t=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=Yt(r.getFullYear()),o=r.getMonth(),i=(n?Xt:Gt)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var v={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return f[e.tm_mon].substring(0,3)},"%B":function(e){return f[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(Yt(e.tm_year+1900)?Xt:Gt,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&Yt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Yt(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in a=a.replace(/%%/g,"\0\0"),v)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var y=ae(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(function(e,t){T.set(e,t)}(y,e),y.length-1)}var Kt=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=fe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Zt=365,Qt=146;Object.defineProperties(Kt.prototype,{read:{get:function(){return(this.mode&Zt)===Zt},set:function(e){e?this.mode|=Zt:this.mode&=-366}},write:{get:function(){return(this.mode&Qt)===Qt},set:function(e){e?this.mode|=Qt:this.mode&=-147}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=Kt,fe.staticInit(),e.FS_createPath=fe.createPath,e.FS_createDataFile=fe.createDataFile,e.FS_createPreloadedFile=fe.createPreloadedFile,e.FS_unlink=fe.unlink,e.FS_createLazyFile=fe.createLazyFile,e.FS_createDevice=fe.createDevice,ke=e.InternalError=Ee(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Se=e}(),Fe=e.BindingError=Ee(Error,"BindingError"),et.prototype.isAliasOf=je,et.prototype.clone=Je,et.prototype.delete=Ke,et.prototype.isDeleted=Ze,et.prototype.deleteLater=Qe,e.getInheritedInstanceCount=ze,e.getLiveInheritedInstances=Ne,e.flushPendingDeletes=Ie,e.setDelayFunction=He,ft.prototype.getPointee=st,ft.prototype.destructor=ut,ft.prototype.argPackAdvance=8,ft.prototype.readValueFromPointer=he,ft.prototype.deleteObject=ct,ft.prototype.fromWireType=Xe,mt=e.UnboundTypeError=Ee(Error,"UnboundTypeError"),e.count_emval_handles=Pt,e.get_first_emval=Tt;var er={j:function(e){return tr(e+24)+24},i:function(e,t,r){throw new ne(e).init(t,r),e},v:function(e,t,r){le.varargs=r;try{var n=le.getStreamFromFD(e);switch(t){case 0:return(o=le.get())<0?-28:fe.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=le.get();return n.flags|=o,0;case 5:return o=le.get(),S[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,F[nr()>>2]=i,-1}}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}var i},I:function(e,t,r){le.varargs=r;try{var n=le.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=le.get();return F[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=le.get(),fe.ioctl(n,t,o);default:q("bad ioctl syscall "+t)}}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},u:function(e,t,r,n){le.varargs=n;try{t=le.getStr(t),t=le.calculateAt(e,t);var o=n?le.get():0;return fe.open(t,r,o).fd}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},y:function(e){var t=de[e];delete de[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;Te([e],o.map((function(e){return e.getterReturnType})).concat(o.map((function(e){return e.setterArgumentType}))),(function(e){var i={};return o.forEach((function(t,r){var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+o.length],f=t.setter,l=t.setterContext;i[n]={read:function(e){return a.fromWireType(s(u,e))},write:function(e,t){var r=[];f(l,e,c.toWireType(r,t)),pe(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError('Missing field:  "'+o+'"');var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:he,destructorFunction:n}]}))},D:function(e,t,r,n,o){},O:function(e,t,r,n,o){var i=Ce(r);xe(e,{name:t=De(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=T;else if(2===r)n=S;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=F}return this.fromWireType(n[e>>i])},destructorFunction:null})},T:function(t,r,n,o,i,a,s,u,c,f,l,d,p){l=De(l),a=ht(i,a),u&&(u=ht(s,u)),f&&(f=ht(c,f)),p=ht(d,p);var h=_e(l);!function(t,r,n){e.hasOwnProperty(t)?((void 0===n||void 0!==e[t].overloadTable&&void 0!==e[t].overloadTable[n])&&Ae("Cannot register public name '"+t+"' twice"),tt(e,t,t),e.hasOwnProperty(n)&&Ae("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),e[t].overloadTable[n]=r):(e[t]=r,void 0!==n&&(e[t].numArguments=n))}(h,(function(){yt("Cannot construct "+l+" due to unbound types",[o])})),Te([t,r,n],o?[o]:[],(function(r){var n,i;r=r[0],i=o?(n=r.registeredClass).instancePrototype:et.prototype;var s=be(h,(function(){if(Object.getPrototypeOf(this)!==c)throw new Fe("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Fe(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Fe("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(i,{constructor:{value:s}});s.prototype=c;var d=new rt(l,s,c,p,n,a,u,f),m=new ft(l,d,!0,!1,!1),v=new ft(l+"*",d,!1,!1,!1),y=new ft(l+" const*",d,!1,!0,!1);return We[t]={pointerType:v,constPointerType:y},function(t,r,n){e.hasOwnProperty(t)||Pe("Replacing nonexistant public symbol"),void 0!==e[t].overloadTable&&void 0!==n?e[t].overloadTable[n]=r:(e[t]=r,e[t].argCount=n)}(h,s),[m,v,y]}))},S:function(e,t,r,n,o,i){k(t>0);var a=gt(t,r);o=ht(n,o),Te([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Fe("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=function(){yt("Cannot construct "+e.name+" due to unbound types",a)},Te([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=_t(r,n,null,o,i),[]})),[]}))},k:function(e,t,r,n,o,i,a,s){var u=gt(r,n);t=De(t),i=ht(o,i),Te([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){yt("Cannot call "+n+" due to unbound types",u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,f=c[t];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(tt(c,t,n),c[t].overloadTable[r-2]=o),Te([],u,(function(o){var s=_t(n,o,e,i,a);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},N:function(e,t){xe(e,{name:t=De(t),fromWireType:function(e){var t=Ct.toValue(e);return kt(e),t},toWireType:function(e,t){return Ct.toHandle(t)},argPackAdvance:8,readValueFromPointer:he,destructorFunction:null})},x:function(e,t,r){var n=Ce(r);xe(e,{name:t=De(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:Dt(t,n),destructorFunction:null})},e:function(e,t,r,n,o){t=De(t);var i=Ce(r),a=function(e){return e};if(0===n){var s=32-8*r;a=function(e){return e<<s>>>s}}var u=t.includes("unsigned");xe(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Ft(t,i,0!==n),destructorFunction:null})},b:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=A,r=t[e>>=2],o=t[e+1];return new n(P,o,r)}xe(e,{name:r=De(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},w:function(e,t){var r="std::string"===(t=De(t));xe(e,{name:t,fromWireType:function(e){var t,n=A[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==C[s]){var u=R(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(C[o+a]);t=c.join("")}return rr(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||Ae("Cannot pass non-string to std::string"),n=r&&o?W(t):t.length;var i=tr(4+n+1),a=i+4;if(A[i>>2]=n,r&&o)B(t,C,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(rr(a),Ae("String has UTF-16 code units that do not fit in 8 bits")),C[a+s]=u}else for(s=0;s<n;++s)C[a+s]=t[s];return null!==e&&e.push(rr,i),i},argPackAdvance:8,readValueFromPointer:he,destructorFunction:function(e){rr(e)}})},r:function(e,t,r){var n,o,i,a,s;r=De(r),2===t?(n=xt,o=jt,a=Mt,i=function(){return D},s=1):4===t&&(n=Ot,o=$t,a=Rt,i=function(){return A},s=2),xe(e,{name:r,fromWireType:function(e){for(var r,o=A[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var f=e+4+c*t;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+t}}return rr(e),r},toWireType:function(e,n){"string"!=typeof n&&Ae("Cannot pass non-string to C++ string type "+r);var i=a(n),u=tr(4+i+t);return A[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(rr,u),u},argPackAdvance:8,readValueFromPointer:he,destructorFunction:function(e){rr(e)}})},z:function(e,t,r,n,o,i){de[e]={name:De(t),rawConstructor:ht(r,n),rawDestructor:ht(o,i),fields:[]}},h:function(e,t,r,n,o,i,a,s,u,c){de[e].fields.push({fieldName:De(t),getterReturnType:r,getter:ht(n,o),getterContext:i,setterArgumentType:a,setter:ht(s,u),setterContext:c})},P:function(e,t){xe(e,{isVoid:!0,name:t=De(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},L:function(){return Date.now()},Q:function(e){do{var t=A[e>>2],r=A[(e+=4)>>2],n=A[(e+=4)>>2];e+=4;var o=R(t);fe.createPath("/",oe.dirname(o),!0,!0),fe.createDataFile(o,null,T.subarray(n,n+r),!0,!0,!0)}while(A[e>>2])},K:function(){return Bt},g:function(e,t,r){e=Ct.toValue(e),t=Wt(t,"emval::as");var n=[],o=Ct.toHandle(n);return A[r>>2]=o,t.toWireType(n,e)},A:function(e,t,r,n,o){return(e=Ut[e])(t=Ct.toValue(t),r=Nt(r),function(e){var t=[];return A[e>>2]=Ct.toHandle(t),t}(n),o)},s:function(e,t,r,n){(e=Ut[e])(t=Ct.toValue(t),r=Nt(r),null,n)},a:kt,B:function(e){return 0===e?Ct.toHandle(It()):(e=Nt(e),Ct.toHandle(It()[e]))},m:function(e,t){var r=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=Wt(A[t+n*b>>2],"parameter "+n);return r}(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Ht[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),s.push(r[1+c]);var f="return function "+_e("methodCaller_"+o)+"(handle, name, destructors, args) {\n",l=0;for(c=0;c<e-1;++c)f+="    var arg"+c+" = argType"+c+".readValueFromPointer(args"+(l?"+"+l:"")+");\n",l+=r[c+1].argPackAdvance;for(f+="    var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(f+="    argType"+c+".deleteObject(arg"+c+");\n");n.isVoid||(f+="    return retType.toWireType(destructors, rv);\n"),f+="};\n",a.push(f);var d,p,h=wt(Function,a).apply(null,s);return d=h,p=Ut.length,Ut.push(d),i=p,Ht[o]=i,i},d:function(e,t){return e=Ct.toValue(e),t=Ct.toValue(t),Ct.toHandle(e[t])},l:function(e){e>4&&(Et[e].refcount+=1)},R:function(){return Ct.toHandle([])},c:function(e){return Ct.toHandle(Nt(e))},f:function(e){pe(Ct.toValue(e)),kt(e)},o:function(){q("")},J:Lt,M:function(e,t,r){C.copyWithin(e,t,t+r)},F:function(e){C.length,q("OOM")},G:function(e,t){var r=0;return qt().forEach((function(n,o){var i=t+r;A[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)T[t++>>0]=e.charCodeAt(n);r||(T[t>>0]=0)}(n,i),r+=n.length+1})),0},H:function(e,t){var r=qt();A[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),A[t>>2]=n,0},q:function(e){try{var t=le.getStreamFromFD(e);return fe.close(t),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},t:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=A[t>>2],s=A[t+4>>2];t+=8;var u=fe.read(e,T,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(le.getStreamFromFD(e),t,r);return F[n>>2]=o,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},C:function(e,t,r,n,o){try{var i=(u=r)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*u:NaN;if(isNaN(i))return 61;var a=le.getStreamFromFD(e);return fe.llseek(a,i,n),J=[a.position>>>0,(G=a.position,+Math.abs(G)>=1?G>0?(0|Math.min(+Math.floor(G/4294967296),4294967295))>>>0:~~+Math.ceil((G-+(~~G>>>0))/4294967296)>>>0:0)],F[o>>2]=J[0],F[o+4>>2]=J[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}var s,u},p:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=A[t>>2],s=A[t+4>>2];t+=8;var u=fe.write(e,T,a,s,n);if(u<0)return-1;o+=u}return o}(le.getStreamFromFD(e),t,r);return A[n>>2]=o,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},n:function(e){},E:function(e,t,r,n){return Jt(e,t,r,n)}};!function(){var t={a:er};function n(t,r){var n,o,i=t.exports;e.asm=i,_=e.asm.U,n=_.buffer,P=n,e.HEAP8=T=new Int8Array(n),e.HEAP16=S=new Int16Array(n),e.HEAP32=F=new Int32Array(n),e.HEAPU8=C=new Uint8Array(n),e.HEAPU16=D=new Uint16Array(n),e.HEAPU32=A=new Uint32Array(n),e.HEAPF32=x=new Float32Array(n),e.HEAPF64=j=new Float64Array(n),M=e.asm.X,o=e.asm.V,N.unshift(o),V()}function o(e){n(e.instance)}function a(e){return function(){if(!w&&(p||h)){if("function"==typeof fetch&&!Q(Y))return fetch(Y,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Y+"'";return e.arrayBuffer()})).catch((function(){return ee(Y)}));if(i)return new Promise((function(e,t){i(Y,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ee(Y)}))}().then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(e,(function(e){g("failed to asynchronously prepare wasm: "+e),q(e)}))}if(H(),e.instantiateWasm)try{return e.instantiateWasm(t,n)}catch(e){return g("Module.instantiateWasm callback failed with error: "+e),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||Z(Y)||Q(Y)||m||"function"!=typeof fetch?a(o):fetch(Y,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(o,(function(e){return g("wasm streaming compile failed: "+e),g("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(r)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.V).apply(null,arguments)};var tr=e._malloc=function(){return(tr=e._malloc=e.asm.W).apply(null,arguments)},rr=e._free=function(){return(rr=e._free=e.asm.Y).apply(null,arguments)},nr=e.___errno_location=function(){return(nr=e.___errno_location=e.asm.Z).apply(null,arguments)},or=e.___getTypeName=function(){return(or=e.___getTypeName=e.asm._).apply(null,arguments)};e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.$).apply(null,arguments)};var ir,ar=e.___cxa_is_pointer_type=function(){return(ar=e.___cxa_is_pointer_type=e.asm.aa).apply(null,arguments)};function sr(r){function n(){ir||(ir=!0,e.calledRun=!0,E||(e.noFSInit||fe.init.initialized||fe.init(),fe.ignorePermissions=!1,re(N),t(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),U.unshift(t);var t;re(U)}()))}I>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),z.unshift(t);var t;re(z)}(),I>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),n()}),1)):n()))}if(e.dynCall_ji=function(){return(e.dynCall_ji=e.asm.ba).apply(null,arguments)},e.dynCall_jiii=function(){return(e.dynCall_jiii=e.asm.ca).apply(null,arguments)},e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.da).apply(null,arguments)},e.dynCall_viijii=function(){return(e.dynCall_viijii=e.asm.ea).apply(null,arguments)},e.dynCall_iiiiij=function(){return(e.dynCall_iiiiij=e.asm.fa).apply(null,arguments)},e.dynCall_iiiiijj=function(){return(e.dynCall_iiiiijj=e.asm.ga).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return(e.dynCall_iiiiiijj=e.asm.ha).apply(null,arguments)},e.___emscripten_embedded_file_data=3932636,e.addRunDependency=H,e.removeRunDependency=V,e.FS_createPath=fe.createPath,e.FS_createDataFile=fe.createDataFile,e.FS_createPreloadedFile=fe.createPreloadedFile,e.FS_createLazyFile=fe.createLazyFile,e.FS_createDevice=fe.createDevice,e.FS_unlink=fe.unlink,L=function e(){ir||sr(),ir||(L=e)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return sr(),e.ready}),y=function(){function e(){r(this,e)}return s(e,[{key:"on",value:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this}},{key:"once",value:function(e,t,r){var n=this;function o(){n.off(e,o);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];t.apply(r,a)}return o._=t,this.on(e,o,r)}},{key:"emit",value:function(e){for(var t=((this.e||(this.e={}))[e]||[]).slice(),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0;i<t.length;i+=1)t[i].fn.apply(t[i].ctx,n);return this}},{key:"off",value:function(e,t){var r=this.e||(this.e={});if(!e)return Object.keys(r).forEach((function(e){delete r[e]})),void delete this.e;var n=r[e],o=[];if(n&&t)for(var i=0,a=n.length;i<a;i+=1)n[i].fn!==t&&n[i].fn._!==t&&o.push(n[i]);return o.length?r[e]=o:delete r[e],this}}]),e}();function g(e){return!function(e){return null==e}(e)}function w(e){return!function(e){return e&&0===Object.keys(e).length}(e)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m(e);if(t){var o=m(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p(this,r)}}var b={person:"人",bicycle:"自行车",car:"汽车",motorbike:"摩托车",aeroplane:"飞机",bus:"公共汽车",train:"火车",truck:"卡车",boat:"船","traffic light":"交通灯","fire hydrant":"消防栓","stop sign":"停止标志","parking meter":"停车收费表",bench:"长凳",bird:"鸟",cat:"猫",dog:"狗",horse:"马",sheep:"绵羊",cow:"牛",elephant:"大象",bear:"熊",zebra:"斑马",giraffe:"长颈鹿",backpack:"背包",umbrella:"雨伞",handbag:"手提包",tie:"领带",suitcase:"手提箱",frisbee:"飞盘",skis:"滑雪板",snowboard:"雪板","sports ball":"运动球",kite:"风筝","baseball bat":"棒球棒","baseball glove":"棒球手套",skateboard:"滑板",surfboard:"冲浪板","tennis racket":"网球拍",bottle:"瓶子","wine glass":"红酒杯",cup:"杯子",fork:"叉子",knife:"刀子",spoon:"勺子",bowl:"碗",banana:"香蕉",apple:"苹果",sandwich:"三明治",orange:"橙子",broccoli:"西兰花",carrot:"胡萝卜","hot dog":"热狗",pizza:"比萨饼",donut:"甜甜圈",cake:"蛋糕",chair:"椅子",sofa:"沙发",pottedplant:"盆栽",bed:"床",diningtable:"餐桌",toilet:"厕所",tvmonitor:"电视机",laptop:"笔记本电脑",mouse:"鼠标",remote:"遥控器",keyboard:"键盘","cell phone":"手机",microwave:"微波炉",oven:"烤箱",toaster:"烤面包机",sink:"水槽",refrigerator:"冰箱",book:"书",clock:"时钟",vase:"花瓶",scissors:"剪刀","teddy bear":"熊","hair drier":"吹风机",toothbrush:"牙刷"},E=function(e){c(n,e);var t=_(n);function n(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,n),(e=t.call(this)).module=null,e.detector=null,e.startTimestamp=null,e.detectWidth=o.detectWidth||192,e.showRect=!1!==o.showRect,e.textColor=o.textColor||{r:0,g:255,b:0},e.rectangleColor=o.rectangleColor||{r:0,g:0,b:255},e.currentTs=null,e}return s(n,[{key:"destroy",value:function(){this.off(),this.detector&&(this.detector.clear(),this.detector.delete()),this.module&&(this.module=null),this.startTimestamp=null,this.currentTs=null}},{key:"load",value:function(){var e=this;return new Promise((function(t,r){v().then((function(n){e.module=n,e.module.ObjectDetector?(e.detector=new e.module.ObjectDetector(e),e.detector.setDetectWidth(e.detectWidth),e.detector.setParams({showInfo:e.showRect,rectangleColor:e.rectangleColor,textColor:e.textColor}),t()):r("load jessibuca object detector fail")})).catch((function(e){console.error(e),r("load jessibuca object detector error")}))}))}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.detectWidth&&(this.detectWidth=e.detectWidth,this.detector&&this.detector.setDetectWidth(this.detectWidth));var t={};g(e.showRect)&&(this.showRect=e.showRect,t.showInfo=e.showRect),g(e.rectangleColor)&&(this.rectangleColor=e.rectangleColor,t.rectangleColor=e.rectangleColor),g(e.textColor)&&(this.textColor=e.textColor,t.textColor=e.textColor),w(t)&&this.detector&&this.detector.setParams(t)}},{key:"notifyDetectInfo",value:function(e){if(this.detector){var t={list:[],ts:this.currentTs||0};t.list=(e||[]).map((function(e){return{en:e.className,zh:b[e.className]||e.className,rect:e.box,confidence:e.confidence}})),this.emit("jessibuca-pro-object-detector-info",t)}}},{key:"detect",value:function(e){if(!this.detector)return e.data;if(null===this.startTimestamp&&(this.startTimestamp=Date.now()),Date.now()-this.startTimestamp>6e5)return e.data;this.currentTs=e.ts;var t=this.detector.detect(e.data,e.width,e.height),r=t+3*(e.width*e.height)/2;return this.module.HEAPU8.subarray(t,r)}}]),n}(y);window.JessibucaProObjectDetector=E}));