@hpcc-js/wasm
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.3.4](https://github.com/GordonSmith/hpcc-js-wasm/compare/v0.3.3...v0.3.4) (2020-02-26) | ||
### Features | ||
* Add "Sync" version of Graphviz ([f80a626](https://github.com/GordonSmith/hpcc-js-wasm/commit/f80a6262bf4868f759bf4c64cdaec025e69858ac)), closes [#8](https://github.com/GordonSmith/hpcc-js-wasm/issues/8) | ||
### [0.3.3](https://github.com/GordonSmith/hpcc-js-wasm/compare/v0.3.2...v0.3.3) (2020-02-20) | ||
@@ -7,0 +14,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r=r||self)["@hpcc-js/wasm"]={})}(this,(function(r){"use strict";var e=function(r,e){return r(e={exports:{}},e.exports),e.exports}((function(r,e){var t,n=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(r){var e,n=void 0!==(r=r||{})?r:{},o={};for(e in n)n.hasOwnProperty(e)&&(o[e]=n[e]);var a,i,u="./this.program",s=function(r,e){throw e},c=!0,f="";document.currentScript&&(f=document.currentScript.src),t&&(f=t),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",a=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText};var l=n.print||console.log.bind(console),d=n.printErr||console.warn.bind(console);for(e in o)o.hasOwnProperty(e)&&(n[e]=o[e]);o=null,n.arguments&&n.arguments,n.thisProgram&&(u=n.thisProgram),n.quit&&(s=n.quit);var p,m,h,v=0,y=function(r){v=r},g=function(){return v};n.wasmBinary&&(p=n.wasmBinary),n.noExitRuntime&&(m=n.noExitRuntime),"object"!=typeof WebAssembly&&d("no native wasm support detected");var w=new WebAssembly.Table({initial:773,maximum:773,element:"anyfunc"}),_=!1;function E(r,e){r||Z("Assertion failed: "+e)}var k,b,D,S,F,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&P)return P.decode(r.subarray(e,o));for(var a="";e<o;){var i=r[e++];if(128&i){var u=63&r[e++];if(192!=(224&i)){var s=63&r[e++];if((i=224==(240&i)?(15&i)<<12|u<<6|s:(7&i)<<18|u<<12|s<<6|63&r[e++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|u)}else a+=String.fromCharCode(i)}return a}function x(r,e){return r?M(D,r,e):""}function A(r,e,t,n){if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var u=r.charCodeAt(i);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++i)),u<=127){if(t>=a)break;e[t++]=u}else if(u<=2047){if(t+1>=a)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=a)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=a)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u}}return e[t]=0,t-o}function R(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function j(r){k=r,n.HEAP8=b=new Int8Array(r),n.HEAP16=S=new Int16Array(r),n.HEAP32=F=new Int32Array(r),n.HEAPU8=D=new Uint8Array(r),n.HEAPU16=new Uint16Array(r),n.HEAPU32=new Uint32Array(r),n.HEAPF32=new Float32Array(r),n.HEAPF64=new Float64Array(r)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var C=n.TOTAL_MEMORY||16777216;function O(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?n.dynCall_v(t):n.dynCall_vi(t,e.arg):t(void 0===e.arg?null:e.arg)}else e()}}(h=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:C/65536}))&&(k=h.buffer),C=k.byteLength,j(k),F[52080]=5451360;var T=[],z=[],B=[],N=[],I=!1,L=Math.abs,H=Math.ceil,U=Math.floor,Y=Math.min,W=0,q=null,V=null;function X(r){W++,n.monitorRunDependencies&&n.monitorRunDependencies(W)}function G(r){if(W--,n.monitorRunDependencies&&n.monitorRunDependencies(W),0==W&&(null!==q&&(clearInterval(q),q=null),V)){var e=V;V=null,e()}}function Z(r){throw n.onAbort&&n.onAbort(r),l(r+=""),d(r),_=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(r)}n.preloadedImages={},n.preloadedAudios={};var J="data:application/octet-stream;base64,";function K(r){return String.prototype.startsWith?r.startsWith(J):0===r.indexOf(J)}var $,Q,rr,er="graphvizlib.wasm";function tr(){try{if(p)return new Uint8Array(p);if(i)return i(er);throw"both async and sync fetching of the wasm failed"}catch(r){Z(r)}}function nr(){var r=function(){var r=new Error;if(!r.stack){try{throw new Error}catch(e){r=e}if(!r.stack)return"(no stack trace available)"}return r.stack.toString()}();return n.extraStackTrace&&(r+="\n"+n.extraStackTrace()),r.replace(/\b_Z[\w\d_]+/g,(function(r){var e=r;return r===e?r:e+" ["+r+"]"}))}function or(){Z()}K(er)||($=er,er=n.locateFile?n.locateFile($,f):f+$),z.push({func:function(){xr()}});var ar=1;function ir(r){return n.___errno_location&&(F[n.___errno_location()>>2]=r),r}var ur={splitPath:function(r){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=ur.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=ur.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=r.lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return ur.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return ur.normalize(r.join("/"))},join2:function(r,e){return ur.normalize(r+"/"+e)}},sr={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:lr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=ur.normalizeArray(r.split("/").filter((function(r){return!!r})),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=sr.resolve(r).substr(1),e=sr.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,u=0;u<a;u++)if(n[u]!==o[u]){i=u;break}var s=[];for(u=i;u<n.length;u++)s.push("..");return(s=s.concat(o.slice(i))).join("/")}},cr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){cr.ttys[r]={input:[],output:[],ops:e},lr.registerDevice(r,cr.stream_ops)},stream_ops:{open:function(r){var e=cr.ttys[r.node.rdev];if(!e)throw new lr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new lr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var u;try{u=r.tty.ops.get_char(r.tty)}catch(r){throw new lr.ErrnoError(29)}if(void 0===u&&0===a)throw new lr.ErrnoError(6);if(null==u)break;a++,e[t+i]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new lr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(r){throw new lr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;r.input=Sr(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(l(M(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(l(M(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(d(M(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(d(M(r.output,0)),r.output=[])}}},fr={ops_table:null,mount:function(r){return fr.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(lr.isBlkdev(t)||lr.isFIFO(t))throw new lr.ErrnoError(63);fr.ops_table||(fr.ops_table={dir:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,lookup:fr.node_ops.lookup,mknod:fr.node_ops.mknod,rename:fr.node_ops.rename,unlink:fr.node_ops.unlink,rmdir:fr.node_ops.rmdir,readdir:fr.node_ops.readdir,symlink:fr.node_ops.symlink},stream:{llseek:fr.stream_ops.llseek}},file:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:{llseek:fr.stream_ops.llseek,read:fr.stream_ops.read,write:fr.stream_ops.write,allocate:fr.stream_ops.allocate,mmap:fr.stream_ops.mmap,msync:fr.stream_ops.msync}},link:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,readlink:fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:lr.chrdev_stream_ops}});var o=lr.createNode(r,e,t,n);return lr.isDir(o.mode)?(o.node_ops=fr.ops_table.dir.node,o.stream_ops=fr.ops_table.dir.stream,o.contents={}):lr.isFile(o.mode)?(o.node_ops=fr.ops_table.file.node,o.stream_ops=fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):lr.isLink(o.mode)?(o.node_ops=fr.ops_table.link.node,o.stream_ops=fr.ops_table.link.stream):lr.isChrdev(o.mode)&&(o.node_ops=fr.ops_table.chrdev.node,o.stream_ops=fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o),o},getFileDataAsRegularArray:function(r){if(r.contents&&r.contents.subarray){for(var e=[],t=0;t<r.usedBytes;++t)e.push(r.contents[t]);return e}return r.contents},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)|0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e){if(0==e)return r.contents=null,void(r.usedBytes=0);if(!r.contents||r.contents.subarray){var t=r.contents;return r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),void(r.usedBytes=e)}if(r.contents||(r.contents=[]),r.contents.length>e)r.contents.length=e;else for(;r.contents.length<e;)r.contents.push(0);r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=lr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,lr.isDir(r.mode)?e.size=4096:lr.isFile(r.mode)?e.size=r.usedBytes:lr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&fr.resizeFileStorage(r,e.size)},lookup:function(r,e){throw lr.genericErrors[44]},mknod:function(r,e,t,n){return fr.createNode(r,e,t,n)},rename:function(r,e,t){if(lr.isDir(r.mode)){var n;try{n=lr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new lr.ErrnoError(55)}delete r.parent.contents[r.name],r.name=t,e.contents[t]=r,r.parent=e},unlink:function(r,e){delete r.contents[e]},rmdir:function(r,e){var t=lr.lookupNode(r,e);for(var n in t.contents)throw new lr.ErrnoError(55);delete r.contents[e]},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=fr.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!lr.isLink(r.mode))throw new lr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var u=0;u<i;u++)e[t+u]=a[o+u];return i},write:function(r,e,t,n,o,a){if(e.buffer===b.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(fr.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var u=0;u<n;u++)i.contents[o+u]=e[t+u];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&lr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new lr.ErrnoError(28);return n},allocate:function(r,e,t){fr.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,a,i){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);var u,s,c=r.node.contents;if(2&i||c.buffer!==e.buffer){(o>0||o+n<r.node.usedBytes)&&(c=c.subarray?c.subarray(o,o+n):Array.prototype.slice.call(c,o,o+n)),s=!0;var f=e.buffer==b.buffer;if(!(u=Cr(n)))throw new lr.ErrnoError(48);(f?b:e).set(c,u)}else s=!1,u=c.byteOffset;return{ptr:u,allocated:s}},msync:function(r,e,t,n,o){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);return 2&o?0:(fr.stream_ops.write(r,e,0,n,t,!1),0)}}},lr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(r){if(!(r instanceof lr.ErrnoError))throw r+" : "+nr();return ir(r.errno)},lookupPath:function(r,e){if(e=e||{},!(r=sr.resolve(lr.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new lr.ErrnoError(32);for(var o=ur.normalizeArray(r.split("/").filter((function(r){return!!r})),!1),a=lr.root,i="/",u=0;u<o.length;u++){var s=u===o.length-1;if(s&&e.parent)break;if(a=lr.lookupNode(a,o[u]),i=ur.join2(i,o[u]),lr.isMountpoint(a)&&(!s||s&&e.follow_mount)&&(a=a.mounted.root),!s||e.follow)for(var c=0;lr.isLink(a.mode);){var f=lr.readlink(i);if(i=sr.resolve(ur.dirname(i),f),a=lr.lookupPath(i,{recurse_count:e.recurse_count}).node,c++>40)throw new lr.ErrnoError(32)}}return{path:i,node:a}},getPath:function(r){for(var e;;){if(lr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%lr.nameTable.length},hashAddNode:function(r){var e=lr.hashName(r.parent.id,r.name);r.name_next=lr.nameTable[e],lr.nameTable[e]=r},hashRemoveNode:function(r){var e=lr.hashName(r.parent.id,r.name);if(lr.nameTable[e]===r)lr.nameTable[e]=r.name_next;else for(var t=lr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=lr.mayLookup(r);if(t)throw new lr.ErrnoError(t,r);for(var n=lr.hashName(r.id,e),o=lr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return lr.lookup(r,e)},createNode:function(r,e,t,n){lr.FSNode||(lr.FSNode=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=lr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},lr.FSNode.prototype={},Object.defineProperties(lr.FSNode.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return lr.isDir(this.mode)}},isDevice:{get:function(){return lr.isChrdev(this.mode)}}}));var o=new lr.FSNode(r,e,t,n);return lr.hashAddNode(o),o},destroyNode:function(r){lr.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(r){var e=lr.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return lr.ignorePermissions?0:(-1===e.indexOf("r")||292&r.mode)&&(-1===e.indexOf("w")||146&r.mode)&&(-1===e.indexOf("x")||73&r.mode)?0:2},mayLookup:function(r){var e=lr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{return lr.lookupNode(r,e),20}catch(r){}return lr.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=lr.lookupNode(r,e)}catch(r){return r.errno}var o=lr.nodePermissions(r,"wx");if(o)return o;if(t){if(!lr.isDir(n.mode))return 54;if(lr.isRoot(n)||lr.getPath(n)===lr.cwd())return 10}else if(lr.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?lr.isLink(r.mode)?32:lr.isDir(r.mode)&&("r"!==lr.flagsToPermissionString(e)||512&e)?31:lr.nodePermissions(r,lr.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||lr.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!lr.streams[t])return t;throw new lr.ErrnoError(33)},getStream:function(r){return lr.streams[r]},createStream:function(r,e,t){lr.FSStream||(lr.FSStream=function(){},lr.FSStream.prototype={},Object.defineProperties(lr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n=new lr.FSStream;for(var o in r)n[o]=r[o];r=n;var a=lr.nextfd(e,t);return r.fd=a,lr.streams[a]=r,r},closeStream:function(r){lr.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=lr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new lr.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){lr.devices[r]={stream_ops:e}},getDevice:function(r){return lr.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),lr.syncFSRequests++,lr.syncFSRequests>1&&d("warning: "+lr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=lr.getMounts(lr.root.mount),n=0;function o(r){return lr.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((function(e){if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)}))},mount:function(r,e,t){var n,o="/"===t,a=!t;if(o&&lr.root)throw new lr.ErrnoError(10);if(!o&&!a){var i=lr.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,lr.isMountpoint(n))throw new lr.ErrnoError(10);if(!lr.isDir(n.mode))throw new lr.ErrnoError(54)}var u={type:r,opts:e,mountpoint:t,mounts:[]},s=r.mount(u);return s.mount=u,u.root=s,o?lr.root=s:n&&(n.mounted=u,n.mount&&n.mount.mounts.push(u)),s},unmount:function(r){var e=lr.lookupPath(r,{follow_mount:!1});if(!lr.isMountpoint(e.node))throw new lr.ErrnoError(28);var t=e.node,n=t.mounted,o=lr.getMounts(n);Object.keys(lr.nameTable).forEach((function(r){for(var e=lr.nameTable[r];e;){var t=e.name_next;-1!==o.indexOf(e.mount)&&lr.destroyNode(e),e=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=lr.lookupPath(r,{parent:!0}).node,o=ur.basename(r);if(!o||"."===o||".."===o)throw new lr.ErrnoError(28);var a=lr.mayCreate(n,o);if(a)throw new lr.ErrnoError(a);if(!n.node_ops.mknod)throw new lr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,lr.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,lr.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{lr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,lr.mknod(r,e,t)},symlink:function(r,e){if(!sr.resolve(r))throw new lr.ErrnoError(44);var t=lr.lookupPath(e,{parent:!0}).node;if(!t)throw new lr.ErrnoError(44);var n=ur.basename(e),o=lr.mayCreate(t,n);if(o)throw new lr.ErrnoError(o);if(!t.node_ops.symlink)throw new lr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=ur.dirname(r),a=ur.dirname(e),i=ur.basename(r),u=ur.basename(e);try{t=lr.lookupPath(r,{parent:!0}).node,n=lr.lookupPath(e,{parent:!0}).node}catch(r){throw new lr.ErrnoError(10)}if(!t||!n)throw new lr.ErrnoError(44);if(t.mount!==n.mount)throw new lr.ErrnoError(75);var s,c=lr.lookupNode(t,i),f=sr.relative(r,a);if("."!==f.charAt(0))throw new lr.ErrnoError(28);if("."!==(f=sr.relative(e,o)).charAt(0))throw new lr.ErrnoError(55);try{s=lr.lookupNode(n,u)}catch(r){}if(c!==s){var l=lr.isDir(c.mode),p=lr.mayDelete(t,i,l);if(p)throw new lr.ErrnoError(p);if(p=s?lr.mayDelete(n,u,l):lr.mayCreate(n,u))throw new lr.ErrnoError(p);if(!t.node_ops.rename)throw new lr.ErrnoError(63);if(lr.isMountpoint(c)||s&&lr.isMountpoint(s))throw new lr.ErrnoError(10);if(n!==t&&(p=lr.nodePermissions(t,"w")))throw new lr.ErrnoError(p);try{lr.trackingDelegate.willMovePath&&lr.trackingDelegate.willMovePath(r,e)}catch(t){d("FS.trackingDelegate['willMovePath']('"+r+"', '"+e+"') threw an exception: "+t.message)}lr.hashRemoveNode(c);try{t.node_ops.rename(c,n,u)}catch(r){throw r}finally{lr.hashAddNode(c)}try{lr.trackingDelegate.onMovePath&&lr.trackingDelegate.onMovePath(r,e)}catch(t){d("FS.trackingDelegate['onMovePath']('"+r+"', '"+e+"') threw an exception: "+t.message)}}},rmdir:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ur.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!0);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.rmdir)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath&&lr.trackingDelegate.willDeletePath(r)}catch(e){d("FS.trackingDelegate['willDeletePath']('"+r+"') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath&&lr.trackingDelegate.onDeletePath(r)}catch(e){d("FS.trackingDelegate['onDeletePath']('"+r+"') threw an exception: "+e.message)}},readdir:function(r){var e=lr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new lr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ur.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!1);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.unlink)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath&&lr.trackingDelegate.willDeletePath(r)}catch(e){d("FS.trackingDelegate['willDeletePath']('"+r+"') threw an exception: "+e.message)}e.node_ops.unlink(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath&&lr.trackingDelegate.onDeletePath(r)}catch(e){d("FS.trackingDelegate['onDeletePath']('"+r+"') threw an exception: "+e.message)}},readlink:function(r){var e=lr.lookupPath(r).node;if(!e)throw new lr.ErrnoError(44);if(!e.node_ops.readlink)throw new lr.ErrnoError(28);return sr.resolve(lr.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=lr.lookupPath(r,{follow:!e}).node;if(!t)throw new lr.ErrnoError(44);if(!t.node_ops.getattr)throw new lr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return lr.stat(r,!0)},chmod:function(r,e,t){var n;if(!(n="string"==typeof r?lr.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new lr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){lr.chmod(r,e,!0)},fchmod:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);lr.chmod(t.node,e)},chown:function(r,e,t,n){var o;if(!(o="string"==typeof r?lr.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new lr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){lr.chown(r,e,t,!0)},fchown:function(r,e,t){var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);lr.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new lr.ErrnoError(28);var t;if(!(t="string"==typeof r?lr.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new lr.ErrnoError(63);if(lr.isDir(t.mode))throw new lr.ErrnoError(31);if(!lr.isFile(t.mode))throw new lr.ErrnoError(28);var n=lr.nodePermissions(t,"w");if(n)throw new lr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);if(0==(2097155&t.flags))throw new lr.ErrnoError(28);lr.truncate(t.node,e)},utime:function(r,e,t){var n=lr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,o,a){if(""===r)throw new lr.ErrnoError(44);var i;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?lr.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)i=r;else{r=ur.normalize(r);try{i=lr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var u=!1;if(64&e)if(i){if(128&e)throw new lr.ErrnoError(20)}else i=lr.mknod(r,t,0),u=!0;if(!i)throw new lr.ErrnoError(44);if(lr.isChrdev(i.mode)&&(e&=-513),65536&e&&!lr.isDir(i.mode))throw new lr.ErrnoError(54);if(!u){var s=lr.mayOpen(i,e);if(s)throw new lr.ErrnoError(s)}512&e&&lr.truncate(i,0),e&=-641;var c=lr.createStream({node:i,path:lr.getPath(i),flags:e,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1},o,a);c.stream_ops.open&&c.stream_ops.open(c),!n.logReadFiles||1&e||(lr.readFiles||(lr.readFiles={}),r in lr.readFiles||(lr.readFiles[r]=1,d("FS.trackingDelegate error on read file: "+r)));try{if(lr.trackingDelegate.onOpenFile){var f=0;1!=(2097155&e)&&(f|=lr.tracking.openFlags.READ),0!=(2097155&e)&&(f|=lr.tracking.openFlags.WRITE),lr.trackingDelegate.onOpenFile(r,f)}}catch(e){d("FS.trackingDelegate['onOpenFile']('"+r+"', flags) threw an exception: "+e.message)}return c},close:function(r){if(lr.isClosed(r))throw new lr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{lr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new lr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new lr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(1==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.read)throw new lr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write:function(r,e,t,n,o,a){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.write)throw new lr.ErrnoError(28);1024&r.flags&&lr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var u=r.stream_ops.write(r,e,t,n,o,a);i||(r.position+=u);try{r.path&&lr.trackingDelegate.onWriteToFile&&lr.trackingDelegate.onWriteToFile(r.path)}catch(e){d("FS.trackingDelegate['onWriteToFile']('"+r.path+"') threw an exception: "+e.message)}return u},allocate:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(e<0||t<=0)throw new lr.ErrnoError(28);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(!lr.isFile(r.node.mode)&&!lr.isDir(r.node.mode))throw new lr.ErrnoError(43);if(!r.stream_ops.allocate)throw new lr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,a,i){if(0!=(2&a)&&0==(2&i)&&2!=(2097155&r.flags))throw new lr.ErrnoError(2);if(1==(2097155&r.flags))throw new lr.ErrnoError(2);if(!r.stream_ops.mmap)throw new lr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,a,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new lr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||"r",e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var t,n=lr.open(r,e.flags),o=lr.stat(r).size,a=new Uint8Array(o);return lr.read(n,a,0,o,0),"utf8"===e.encoding?t=M(a,0):"binary"===e.encoding&&(t=a),lr.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||"w";var n=lr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(R(e)+1),a=A(e,o,0,o.length);lr.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lr.write(n,e,0,e.byteLength,void 0,t.canOwn)}lr.close(n)},cwd:function(){return lr.currentPath},chdir:function(r){var e=lr.lookupPath(r,{follow:!0});if(null===e.node)throw new lr.ErrnoError(44);if(!lr.isDir(e.node.mode))throw new lr.ErrnoError(54);var t=lr.nodePermissions(e.node,"x");if(t)throw new lr.ErrnoError(t);lr.currentPath=e.path},createDefaultDirectories:function(){lr.mkdir("/tmp"),lr.mkdir("/home"),lr.mkdir("/home/web_user")},createDefaultDevices:function(){var r;if(lr.mkdir("/dev"),lr.registerDevice(lr.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),lr.mkdev("/dev/null",lr.makedev(1,3)),cr.register(lr.makedev(5,0),cr.default_tty_ops),cr.register(lr.makedev(6,0),cr.default_tty1_ops),lr.mkdev("/dev/tty",lr.makedev(5,0)),lr.mkdev("/dev/tty1",lr.makedev(6,0)),"object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);r=function(){return crypto.getRandomValues(e),e[0]}}r||(r=function(){Z("random_device")}),lr.createDevice("/dev","random",r),lr.createDevice("/dev","urandom",r),lr.mkdir("/dev/shm"),lr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){lr.mkdir("/proc"),lr.mkdir("/proc/self"),lr.mkdir("/proc/self/fd"),lr.mount({mount:function(){var r=lr.createNode("/proc/self","fd",16895,73);return r.node_ops={lookup:function(r,e){var t=+e,n=lr.getStream(t);if(!n)throw new lr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams:function(){n.stdin?lr.createDevice("/dev","stdin",n.stdin):lr.symlink("/dev/tty","/dev/stdin"),n.stdout?lr.createDevice("/dev","stdout",null,n.stdout):lr.symlink("/dev/tty","/dev/stdout"),n.stderr?lr.createDevice("/dev","stderr",null,n.stderr):lr.symlink("/dev/tty1","/dev/stderr"),lr.open("/dev/stdin","r"),lr.open("/dev/stdout","w"),lr.open("/dev/stderr","w")},ensureErrnoError:function(){lr.ErrnoError||(lr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},lr.ErrnoError.prototype=new Error,lr.ErrnoError.prototype.constructor=lr.ErrnoError,[44].forEach((function(r){lr.genericErrors[r]=new lr.ErrnoError(r),lr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:function(){lr.ensureErrnoError(),lr.nameTable=new Array(4096),lr.mount(fr,{},"/"),lr.createDefaultDirectories(),lr.createDefaultDevices(),lr.createSpecialDirectories(),lr.filesystems={MEMFS:fr}},init:function(r,e,t){lr.init.initialized=!0,lr.ensureErrnoError(),n.stdin=r||n.stdin,n.stdout=e||n.stdout,n.stderr=t||n.stderr,lr.createStandardStreams()},quit:function(){lr.init.initialized=!1;var r=n._fflush;r&&r(0);for(var e=0;e<lr.streams.length;e++){var t=lr.streams[e];t&&lr.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},joinPath:function(r,e){var t=ur.join.apply(null,r);return e&&"/"==t[0]&&(t=t.substr(1)),t},absolutePath:function(r,e){return sr.resolve(e,r)},standardizePath:function(r){return ur.normalize(r)},findObject:function(r,e){var t=lr.analyzePath(r,e);return t.exists?t.object:(ir(t.error),null)},analyzePath:function(r,e){try{r=(n=lr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=ur.basename(r),n=lr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createFolder:function(r,e,t,n){var o=ur.join2("string"==typeof r?r:lr.getPath(r),e),a=lr.getMode(t,n);return lr.mkdir(o,a)},createPath:function(r,e,t,n){r="string"==typeof r?r:lr.getPath(r);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=ur.join2(r,a);try{lr.mkdir(i)}catch(r){}r=i}}return i},createFile:function(r,e,t,n,o){var a=ur.join2("string"==typeof r?r:lr.getPath(r),e),i=lr.getMode(n,o);return lr.create(a,i)},createDataFile:function(r,e,t,n,o,a){var i=e?ur.join2("string"==typeof r?r:lr.getPath(r),e):r,u=lr.getMode(n,o),s=lr.create(i,u);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}lr.chmod(s,146|u);var d=lr.open(s,"w");lr.write(d,t,0,t.length,0,a),lr.close(d),lr.chmod(s,u)}return s},createDevice:function(r,e,t,n){var o=ur.join2("string"==typeof r?r:lr.getPath(r),e),a=lr.getMode(!!t,!!n);lr.createDevice.major||(lr.createDevice.major=64);var i=lr.makedev(lr.createDevice.major++,0);return lr.registerDevice(i,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,a){for(var i=0,u=0;u<o;u++){var s;try{s=t()}catch(r){throw new lr.ErrnoError(29)}if(void 0===s&&0===i)throw new lr.ErrnoError(6);if(null==s)break;i++,e[n+u]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,o,a){for(var i=0;i<o;i++)try{n(e[t+i])}catch(r){throw new lr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),lr.mkdev(o,a,i)},createLink:function(r,e,t,n,o){var a=ur.join2("string"==typeof r?r:lr.getPath(r),e);return lr.symlink(t,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;var e=!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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Sr(a(r.url),!0),r.usedBytes=r.contents.length}catch(r){e=!1}return e||ir(29),e},createLazyFile:function(r,e,t,n,o){function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,a=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=n);var u=this;u.setDataGetter((function(r){var e=r*i,o=(r+1)*i-1;if(o=Math.min(o,n-1),void 0===u.chunks[r]&&(u.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(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 "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Sr(o.responseText||"",!0)}(e,o)),void 0===u.chunks[r])throw new Error("doXHR failed!");return u.chunks[r]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,l("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:t},u=lr.createFile(r,e,i,n,o);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var s={};return Object.keys(u.stream_ops).forEach((function(r){var e=u.stream_ops[r];s[r]=function(){if(!lr.forceLoadFile(u))throw new lr.ErrnoError(29);return e.apply(null,arguments)}})),s.read=function(r,e,t,n,o){if(!lr.forceLoadFile(u))throw new lr.ErrnoError(29);var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i},u.stream_ops=s,u},createPreloadedFile:function(r,e,t,o,a,i,u,s,c,f){Browser.init();var l=e?sr.resolve(ur.join2(r,e)):r;function d(t){function d(t){f&&f(),s||lr.createDataFile(r,e,t,o,a,c),i&&i(),G()}var p=!1;n.preloadPlugins.forEach((function(r){p||r.canHandle(l)&&(r.handle(t,l,d,(function(){u&&u(),G()})),p=!0)})),p||d(t)}X(),"string"==typeof t?Browser.asyncLoad(t,(function(r){d(r)}),u):d(t)},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(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){l("creating db"),o.result.createObjectStore(lr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([lr.DB_STORE_NAME],"readwrite"),a=n.objectStore(lr.DB_STORE_NAME),i=0,u=0,s=r.length;function c(){0==u?e():t()}r.forEach((function(r){var e=a.put(lr.analyzePath(r).object.contents,r);e.onsuccess=function(){++i+u==s&&c()},e.onerror=function(){u++,i+u==s&&c()}})),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([lr.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var i=a.objectStore(lr.DB_STORE_NAME),u=0,s=0,c=r.length;function f(){0==s?e():t()}r.forEach((function(r){var e=i.get(r);e.onsuccess=function(){lr.analyzePath(r).exists&&lr.unlink(r),lr.createDataFile(ur.dirname(r),ur.basename(r),e.result,!0,!0,!0),++u+s==c&&f()},e.onerror=function(){s++,u+s==c&&f()}})),a.onerror=t},o.onerror=t}},dr={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function(r,e){if("/"!==e[0]){var t;if(-100===r)t=lr.cwd();else{var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);t=n.path}e=ur.join2(t,e)}return e},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&ur.normalize(e)!==ur.normalize(lr.getPath(r.node)))return-54;throw r}return F[t>>2]=n.dev,F[t+4>>2]=0,F[t+8>>2]=n.ino,F[t+12>>2]=n.mode,F[t+16>>2]=n.nlink,F[t+20>>2]=n.uid,F[t+24>>2]=n.gid,F[t+28>>2]=n.rdev,F[t+32>>2]=0,rr=[n.size>>>0,(Q=n.size,+L(Q)>=1?Q>0?(0|Y(+U(Q/4294967296),4294967295))>>>0:~~+H((Q-+(~~Q>>>0))/4294967296)>>>0:0)],F[t+40>>2]=rr[0],F[t+44>>2]=rr[1],F[t+48>>2]=4096,F[t+52>>2]=n.blocks,F[t+56>>2]=n.atime.getTime()/1e3|0,F[t+60>>2]=0,F[t+64>>2]=n.mtime.getTime()/1e3|0,F[t+68>>2]=0,F[t+72>>2]=n.ctime.getTime()/1e3|0,F[t+76>>2]=0,rr=[n.ino>>>0,(Q=n.ino,+L(Q)>=1?Q>0?(0|Y(+U(Q/4294967296),4294967295))>>>0:~~+H((Q-+(~~Q>>>0))/4294967296)>>>0:0)],F[t+80>>2]=rr[0],F[t+84>>2]=rr[1],0},doMsync:function(r,e,t,n,o){var a=D.slice(r,r+t);lr.msync(e,a,o,t,n)},doMkdir:function(r,e){return"/"===(r=ur.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),lr.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return lr.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=lr.readlink(r),o=Math.min(t,R(n)),a=b[e+o];return A(n,D,e,t+1),b[e+o]=a,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=lr.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&lr.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=lr.getStream(t);return n&&lr.close(n),lr.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,a=0;a<t;a++){var i=F[e+8*a>>2],u=F[e+(8*a+4)>>2],s=lr.read(r,b,i,u,n);if(s<0)return-1;if(o+=s,s<u)break}return o},doWritev:function(r,e,t,n){for(var o=0,a=0;a<t;a++){var i=F[e+8*a>>2],u=F[e+(8*a+4)>>2],s=lr.write(r,b,i,u,n);if(s<0)return-1;o+=s}return o},varargs:0,get:function(r){return dr.varargs+=4,F[dr.varargs-4>>2]},getStr:function(){return x(dr.get())},getStreamFromFD:function(r){void 0===r&&(r=dr.get());var e=lr.getStream(r);if(!e)throw new lr.ErrnoError(8);return e},get64:function(){var r=dr.get();return dr.get(),r},getZero:function(){dr.get()}};function pr(r,e,t){e|=0;var n,o=0,a=0,i=0;if(n=(r|=0)+(t|=0)|0,e&=255,(0|t)>=67){for(;0!=(3&r);)b[r>>0]=e,r=r+1|0;for(i=e|e<<8|e<<16|e<<24,a=(o=-4&n|0)-64|0;(0|r)<=(0|a);)F[r>>2]=i,F[r+4>>2]=i,F[r+8>>2]=i,F[r+12>>2]=i,F[r+16>>2]=i,F[r+20>>2]=i,F[r+24>>2]=i,F[r+28>>2]=i,F[r+32>>2]=i,F[r+36>>2]=i,F[r+40>>2]=i,F[r+44>>2]=i,F[r+48>>2]=i,F[r+52>>2]=i,F[r+56>>2]=i,F[r+60>>2]=i,r=r+64|0;for(;(0|r)<(0|o);)F[r>>2]=i,r=r+4|0}for(;(0|r)<(0|n);)b[r>>0]=e,r=r+1|0;return n-t|0}var mr={ppid:1,pid:42,sid:42,pgid:42},hr=0;function vr(r){try{return h.grow(r-k.byteLength+65535>>16),j(h.buffer),1}catch(r){}}var yr={};function gr(){if(!gr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var e in yr)r[e]=yr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);gr.strings=t}return gr.strings}function wr(r){return r%4==0&&(r%100!=0||r%400==0)}function _r(r,e){for(var t=0,n=0;n<=e;t+=r[n++]);return t}var Er=[31,29,31,30,31,30,31,31,30,31,30,31],kr=[31,28,31,30,31,30,31,31,30,31,30,31];function br(r,e){for(var t=new Date(r.getTime());e>0;){var n=wr(t.getFullYear()),o=t.getMonth(),a=(n?Er:kr)[o];if(!(e>a-t.getDate()))return t.setDate(t.getDate()+e),t;e-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}function Dr(r,e,t,n){var o=F[n+40>>2],a={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?x(o):""},i=x(t),u={"%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 s in u)i=i.replace(new RegExp(s,"g"),u[s]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(r,e,t){for(var n="number"==typeof r?r.toString():r||"";n.length<e;)n=t[0]+n;return n}function d(r,e){return l(r,e,"0")}function p(r,e){function t(r){return r<0?-1:r>0?1:0}var n;return 0===(n=t(r.getFullYear()-e.getFullYear()))&&0===(n=t(r.getMonth()-e.getMonth()))&&(n=t(r.getDate()-e.getDate())),n}function m(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function h(r){var e=br(new Date(r.tm_year+1900,0,1),r.tm_yday),t=new Date(e.getFullYear(),0,4),n=new Date(e.getFullYear()+1,0,4),o=m(t),a=m(n);return p(o,e)<=0?p(a,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var v={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.tm_mon]},"%C":function(r){return d((r.tm_year+1900)/100|0,2)},"%d":function(r){return d(r.tm_mday,2)},"%e":function(r){return l(r.tm_mday,2," ")},"%g":function(r){return h(r).toString().substring(2)},"%G":function(r){return h(r)},"%H":function(r){return d(r.tm_hour,2)},"%I":function(r){var e=r.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(r){return d(r.tm_mday+_r(wr(r.tm_year+1900)?Er:kr,r.tm_mon-1),3)},"%m":function(r){return d(r.tm_mon+1,2)},"%M":function(r){return d(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return d(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var e=new Date(r.tm_year+1900,0,1),t=0===e.getDay()?e:br(e,7-e.getDay()),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(p(t,n)<0){var o=_r(wr(n.getFullYear())?Er:kr,n.getMonth()-1)-31,a=31-t.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===p(t,e)?"01":"00"},"%V":function(r){var e,t=new Date(r.tm_year+1900,0,4),n=new Date(r.tm_year+1901,0,4),o=m(t),a=m(n),i=br(new Date(r.tm_year+1900,0,1),r.tm_yday);return p(i,o)<0?"53":p(a,i)<=0?"01":(e=o.getFullYear()<r.tm_year+1900?r.tm_yday+32-o.getDate():r.tm_yday+1-o.getDate(),d(Math.ceil(e/7),2))},"%w":function(r){return r.tm_wday},"%W":function(r){var e=new Date(r.tm_year,0,1),t=1===e.getDay()?e:br(e,0===e.getDay()?1:7-e.getDay()+1),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(p(t,n)<0){var o=_r(wr(n.getFullYear())?Er:kr,n.getMonth()-1)-31,a=31-t.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===p(t,e)?"01":"00"},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var e=r.tm_gmtoff,t=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(t?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var s in v)i.indexOf(s)>=0&&(i=i.replace(new RegExp(s,"g"),v[s](a)));var y=Sr(i,!1);return y.length>e?0:(function(r,e){b.set(r,e)}(y,r),y.length-1)}function Sr(r,e,t){var n=t>0?t:R(r)+1,o=new Array(n),a=A(r,o,0,o.length);return e&&(o.length=a),o}or=function(){return performance.now()},lr.staticInit();var Fr={L:function(r,e){return function(r,e){var t;if(0===r)t=Date.now();else{if(1!==r&&4!==r||!ar)return ir(28),-1;t=or()}return F[e>>2]=t/1e3|0,F[e+4>>2]=t%1e3*1e3*1e3|0,0}(r,e)},k:function(r){return Cr(r)},j:function(r,e,t){throw"uncaught_exception"in Br?Br.uncaught_exceptions++:Br.uncaught_exceptions=1,r},r:function(){},T:function(r,e){return ir(63),-1},O:function(r,e){dr.varargs=e;try{var t=dr.getStr();return lr.unlink(t),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},Q:function(r,e){dr.varargs=e;try{return function(r,e,t,n,o,a){var i;a<<=12;var u=!1;if(0!=(16&n)&&r%16384!=0)return-28;if(0!=(32&n)){if(!(i=Nr(16384,e)))return-48;pr(i,0,e),u=!0}else{var s=lr.getStream(o);if(!s)return-8;var c=lr.mmap(s,D,r,e,a,t,n);i=c.ptr,u=c.allocated}return dr.mappings[i]={malloc:i,len:e,allocated:u,fd:o,flags:n,offset:a},i}(dr.get(),dr.get(),dr.get(),dr.get(),dr.get(),dr.get())}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},R:function(r,e){dr.varargs=e;try{var t=dr.getStr(),n=dr.get();return dr.doStat(lr.stat,t,n)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},S:function(r,e){dr.varargs=e;try{var t=dr.getStreamFromFD(),n=dr.get();return dr.doStat(lr.stat,t.path,n)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},K:function(r,e){dr.varargs=e;try{return mr.pid}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},x:function(r,e){dr.varargs=e;try{var t=dr.getStreamFromFD();switch(dr.get()){case 0:return(n=dr.get())<0?-28:lr.open(t.path,t.flags,0,n).fd;case 1:case 2:return 0;case 3:return t.flags;case 4:var n=dr.get();return t.flags|=n,0;case 12:return n=dr.get(),S[n+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return ir(28),-1;default:return-28}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},J:function(r,e){dr.varargs=e;try{var t=dr.getStr(),n=dr.get();return dr.doAccess(t,n)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},y:function(r,e){dr.varargs=e;try{var t=dr.getStr(),n=dr.get(),o=dr.get();return lr.open(t,n,o).fd}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},N:function(r,e){dr.varargs=e;try{var t=dr.getStreamFromFD(),n=dr.get();switch(n){case 21509:case 21505:return t.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return t.tty?0:-59;case 21519:if(!t.tty)return-59;var o=dr.get();return F[o>>2]=0,0;case 21520:return t.tty?-28:-59;case 21531:return o=dr.get(),lr.ioctl(t,n,o);case 21523:case 21524:return t.tty?0:-59;default:Z("bad ioctl syscall "+n)}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},P:function(r,e){dr.varargs=e;try{return function(r,e){if(-1===r||0===e)return-28;var t=dr.mappings[r];if(!t)return 0;if(e===t.len){var n=lr.getStream(t.fd);dr.doMsync(r,n,e,t.flags,t.offset),dr.mappings[r]=null,t.allocated&&Or(t.malloc)}return 0}(dr.get(),dr.get())}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},m:function(){},v:function(){Z()},d:function(r,e){!function(r,e){throw zr(r,e||1),"longjmp"}(r,e)},D:function(r,e,t){D.set(D.subarray(e,e+t),r)},E:function(r){var e=D.length;if(r>2147418112)return!1;for(var t,n,o=1;o<=4;o*=2){var a=e*(1+.2/o);if(a=Math.min(a,r+100663296),vr(Math.min(2147418112,((t=Math.max(16777216,r,a))%(n=65536)>0&&(t+=n-t%n),t))))return!0}return!1},H:function(r,e){var t=gr(),n=0;return t.forEach((function(t,o){var a=e+n;F[r+4*o>>2]=a,function(r,e,t){for(var n=0;n<r.length;++n)b[e++>>0]=r.charCodeAt(n);t||(b[e>>0]=0)}(t,a),n+=t.length+1})),0},I:function(r,e){var t=gr();F[r>>2]=t.length;var n=0;return t.forEach((function(r){n+=r.length+1})),F[e>>2]=n,0},l:function(r){!function(r,e){e&&m&&0===r||(m||(_=!0,n.onExit&&n.onExit(r)),s(r,new ee(r)))}(r)},q:function(r){try{var e=dr.getStreamFromFD(r);return lr.close(e),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},G:function(r,e){try{var t=dr.getStreamFromFD(r),n=t.tty?2:lr.isDir(t.mode)?3:lr.isLink(t.mode)?7:4;return b[e>>0]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},M:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),a=dr.doReadv(o,e,t);return F[n>>2]=a,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},C:function(r,e,t,n,o){try{var a=dr.getStreamFromFD(r),i=4294967296*t+(e>>>0);return i<=-9007199254740992||i>=9007199254740992?-61:(lr.llseek(a,i,n),rr=[a.position>>>0,(Q=a.position,+L(Q)>=1?Q>0?(0|Y(+U(Q/4294967296),4294967295))>>>0:~~+H((Q-+(~~Q>>>0))/4294967296)>>>0:0)],F[o>>2]=rr[0],F[o+4>>2]=rr[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},w:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),a=dr.doWritev(o,e,t);return F[n>>2]=a,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},a:function(){return 0|g()},W:function(r){var e=Qr();try{return Kr(r)}catch(r){if(re(e),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},U:function(r,e){var t=Qr();try{return $r(r,e)}catch(r){if(re(t),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},B:function(r){var e=Qr();try{return qr(r)}catch(r){if(re(e),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},f:function(r,e){var t=Qr();try{return Vr(r,e)}catch(r){if(re(t),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},e:function(r,e,t){var n=Qr();try{return Xr(r,e,t)}catch(r){if(re(n),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},g:function(r,e,t,n){var o=Qr();try{return Gr(r,e,t,n)}catch(r){if(re(o),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},n:function(r,e,t,n,o){var a=Qr();try{return Zr(r,e,t,n,o)}catch(r){if(re(a),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},V:function(r,e,t,n,o,a,i){var u=Qr();try{return Jr(r,e,t,n,o,a,i)}catch(r){if(re(u),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},t:function(r){var e=Qr();try{Ir(r)}catch(r){if(re(e),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},h:function(r,e){var t=Qr();try{Lr(r,e)}catch(r){if(re(t),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},o:function(r,e,t){var n=Qr();try{Hr(r,e,t)}catch(r){if(re(n),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},u:function(r,e,t,n){var o=Qr();try{Ur(r,e,t,n)}catch(r){if(re(o),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},s:function(r,e,t,n,o){var a=Qr();try{Yr(r,e,t,n,o)}catch(r){if(re(a),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},p:function(r,e,t,n,o,a){var i=Qr();try{Wr(r,e,t,n,o,a)}catch(r){if(re(i),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},memory:h,i:function r(e,t,n,o){t|=0,n|=0,o|=0;var a=0;for(hr=hr+1|0,F[(e|=0)>>2]=hr;(0|a)<(0|o);){if(0==(0|F[n+(a<<3)>>2]))return F[n+(a<<3)>>2]=hr,F[n+(4+(a<<3))>>2]=t,F[n+(8+(a<<3))>>2]=0,y(0|o),0|n;a=a+1|0}return n=0|r(0|e,0|t,0|(n=0|Tr(0|n,8*(1+(o=2*o|0)|0)|0)),0|o),y(0|o),0|n},b:function(r){y(0|r)},F:function(r,e,t,n){return Dr(r,e,t,n)},table:w,c:function(r,e,t){r|=0,e|=0,t|=0;for(var n=0,o=0;(0|n)<(0|t)&&0!=(0|(o=0|F[e+(n<<3)>>2]));){if((0|o)==(0|r))return 0|F[e+(4+(n<<3))>>2];n=n+1|0}return 0},z:function(r){var e=Date.now()/1e3|0;return r&&(F[r>>2]=e),e},A:function(r){return 0!==r&&pr(r,0,16),0}},Pr=function(){var r={a:Fr};function e(r,e){var t=r.exports;n.asm=t,G()}function t(r){e(r.instance)}function o(e){return(!p&&c&&"function"==typeof fetch?fetch(er,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+er+"'";return r.arrayBuffer()})).catch((function(){return tr()})):new Promise((function(r,e){r(tr())}))).then((function(e){return WebAssembly.instantiate(e,r)})).then(e,(function(r){d("failed to asynchronously prepare wasm: "+r),Z(r)}))}if(X(),n.instantiateWasm)try{return n.instantiateWasm(r,e)}catch(r){return d("Module.instantiateWasm callback failed with error: "+r),!1}return function(){if(p||"function"!=typeof WebAssembly.instantiateStreaming||K(er)||"function"!=typeof fetch)return o(t);fetch(er,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(r){d("wasm streaming compile failed: "+r),d("falling back to ArrayBuffer instantiation"),o(t)}))}))}(),{}}();n.asm=Pr;var Mr,xr=n.___wasm_call_ctors=function(){return(xr=n.___wasm_call_ctors=n.asm.X).apply(null,arguments)},Ar=n._emscripten_bind_VoidPtr___destroy___0=function(){return(Ar=n._emscripten_bind_VoidPtr___destroy___0=n.asm.Y).apply(null,arguments)},Rr=n._emscripten_bind_Main_layout_3=function(){return(Rr=n._emscripten_bind_Main_layout_3=n.asm.Z).apply(null,arguments)},jr=n._emscripten_bind_Main___destroy___0=function(){return(jr=n._emscripten_bind_Main___destroy___0=n.asm._).apply(null,arguments)},Cr=n._malloc=function(){return(Cr=n._malloc=n.asm.$).apply(null,arguments)},Or=n._free=function(){return(Or=n._free=n.asm.aa).apply(null,arguments)},Tr=(n.___errno_location=function(){return(n.___errno_location=n.asm.ba).apply(null,arguments)},n._realloc=function(){return(Tr=n._realloc=n.asm.ca).apply(null,arguments)}),zr=n._setThrew=function(){return(zr=n._setThrew=n.asm.da).apply(null,arguments)},Br=n.__ZSt18uncaught_exceptionv=function(){return(Br=n.__ZSt18uncaught_exceptionv=n.asm.ea).apply(null,arguments)},Nr=n._memalign=function(){return(Nr=n._memalign=n.asm.fa).apply(null,arguments)},Ir=n.dynCall_v=function(){return(Ir=n.dynCall_v=n.asm.ga).apply(null,arguments)},Lr=n.dynCall_vi=function(){return(Lr=n.dynCall_vi=n.asm.ha).apply(null,arguments)},Hr=n.dynCall_vii=function(){return(Hr=n.dynCall_vii=n.asm.ia).apply(null,arguments)},Ur=n.dynCall_viii=function(){return(Ur=n.dynCall_viii=n.asm.ja).apply(null,arguments)},Yr=n.dynCall_viiii=function(){return(Yr=n.dynCall_viiii=n.asm.ka).apply(null,arguments)},Wr=n.dynCall_viiiii=function(){return(Wr=n.dynCall_viiiii=n.asm.la).apply(null,arguments)},qr=n.dynCall_i=function(){return(qr=n.dynCall_i=n.asm.ma).apply(null,arguments)},Vr=n.dynCall_ii=function(){return(Vr=n.dynCall_ii=n.asm.na).apply(null,arguments)},Xr=n.dynCall_iii=function(){return(Xr=n.dynCall_iii=n.asm.oa).apply(null,arguments)},Gr=n.dynCall_iiii=function(){return(Gr=n.dynCall_iiii=n.asm.pa).apply(null,arguments)},Zr=n.dynCall_iiiii=function(){return(Zr=n.dynCall_iiiii=n.asm.qa).apply(null,arguments)},Jr=n.dynCall_iiiiiii=function(){return(Jr=n.dynCall_iiiiiii=n.asm.ra).apply(null,arguments)},Kr=n.dynCall_d=function(){return(Kr=n.dynCall_d=n.asm.sa).apply(null,arguments)},$r=n.dynCall_di=function(){return($r=n.dynCall_di=n.asm.ta).apply(null,arguments)},Qr=n.stackSave=function(){return(Qr=n.stackSave=n.asm.ua).apply(null,arguments)},re=(n.stackAlloc=function(){return(n.stackAlloc=n.asm.va).apply(null,arguments)},n.stackRestore=function(){return(re=n.stackRestore=n.asm.wa).apply(null,arguments)});function ee(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function te(r){function e(){Mr||(Mr=!0,_||(I=!0,n.noFSInit||lr.init.initialized||lr.init(),O(z),lr.ignorePermissions=!1,O(B),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)r=n.postRun.shift(),N.unshift(r);var r;O(N)}()))}W>0||(function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)r=n.preRun.shift(),T.unshift(r);var r;O(T)}(),W>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}if(n.asm=Pr,n.then=function(r){if(Mr)r(n);else{var e=n.onRuntimeInitialized;n.onRuntimeInitialized=function(){e&&e(),r(n)}}return n},V=function r(){Mr||te(),Mr||(V=r)},n.run=te,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();function ne(){}function oe(r){return(r||ne).__cache__}function ae(r,e){var t=oe(e),n=t[r];return n||((n=Object.create((e||ne).prototype)).ptr=r,t[r]=n)}m=!0,te(),ne.prototype=Object.create(ne.prototype),ne.prototype.constructor=ne,ne.prototype.__class__=ne,ne.__cache__={},n.WrapperObject=ne,n.getCache=oe,n.wrapPointer=ae,n.castObject=function(r,e){return ae(r.ptr,e)},n.NULL=ae(0),n.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete oe(r.__class__)[r.ptr]},n.compare=function(r,e){return r.ptr===e.ptr},n.getPointer=function(r){return r.ptr},n.getClass=function(r){return r.__class__};var ie,ue={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(ue.needed){for(var r=0;r<ue.temps.length;r++)n._free(ue.temps[r]);ue.temps.length=0,n._free(ue.buffer),ue.buffer=0,ue.size+=ue.needed,ue.needed=0}ue.buffer||(ue.size+=128,ue.buffer=n._malloc(ue.size),E(ue.buffer)),ue.pos=0},alloc:function(r,e){E(ue.buffer);var t,o=e.BYTES_PER_ELEMENT,a=r.length*o;return a=a+7&-8,ue.pos+a>=ue.size?(E(a>0),ue.needed+=a,t=n._malloc(a),ue.temps.push(t)):(t=ue.buffer+ue.pos,ue.pos+=a),t},copy:function(r,e,t){var n=t;switch(e.BYTES_PER_ELEMENT){case 2:n>>=1;break;case 4:n>>=2;break;case 8:n>>=3}for(var o=0;o<r.length;o++)e[n+o]=r[o]}};function se(r){if("string"==typeof r){var e=Sr(r),t=ue.alloc(e,b);return ue.copy(e,b,t),t}return r}function ce(){throw"cannot construct a VoidPtr, no constructor in IDL"}function fe(){throw"cannot construct a Main, no constructor in IDL"}return ce.prototype=Object.create(ne.prototype),ce.prototype.constructor=ce,ce.prototype.__class__=ce,ce.__cache__={},n.VoidPtr=ce,ce.prototype.__destroy__=ce.prototype.__destroy__=function(){var r=this.ptr;Ar(r)},fe.prototype=Object.create(ne.prototype),fe.prototype.constructor=fe,fe.prototype.__class__=fe,fe.__cache__={},n.Main=fe,fe.prototype.layout=fe.prototype.layout=function(r,e,t){var n=this.ptr;return ue.prepare(),r=r&&"object"==typeof r?r.ptr:se(r),e=e&&"object"==typeof e?e.ptr:se(e),t=t&&"object"==typeof t?t.ptr:se(t),x(Rr(n,r,e,t))},fe.prototype.__destroy__=fe.prototype.__destroy__=function(){var r=this.ptr;jr(r)},I||(ie=function(){},B.unshift(ie)),r});r.exports=n})),t=Object.freeze({__proto__:null,default:e,__moduleExports:e}),n=new Function("return this;")().__hpcc_wasmFolder||void 0;function o(r){if(void 0===r)return n;var e=n;return n=r,e}var a={layout:function(r,e,n){return void 0===e&&(e="svg"),void 0===n&&(n="dot"),(a=t,i=a.default||a,i.__hpcc_promise||(i.__hpcc_promise=new Promise((function(r){i({locateFile:function(r,e){return(o()||e)+(r?"/":"")+r}}).then((function(e){delete e.then,r(e)}))}))),i.__hpcc_promise).then((function(t){return t.Main.prototype.layout(r,e,n)}));var a,i},circo:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"circo")},dot:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"dot")},fdp:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"fdp")},neato:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"neato")},osage:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"osage")},patchwork:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"patchwork")},twopi:function(r,e){return void 0===e&&(e="svg"),this.layout(r,e,"twopi")}};r.graphviz=a,r.wasmFolder=o,Object.defineProperty(r,"__esModule",{value:!0})})); | ||
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((r=r||self)["@hpcc-js/wasm"]={})}(this,(function(r){"use strict";var t=function(r,t){return r(t={exports:{}},t.exports),t.exports}((function(r,t){var e,n=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(r){var t,n=void 0!==(r=r||{})?r:{},o={};for(t in n)n.hasOwnProperty(t)&&(o[t]=n[t]);var i,a,u="./this.program",s=function(r,t){throw t},c=!0,f="";document.currentScript&&(f=document.currentScript.src),e&&(f=e),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",i=function(r){var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText};var l=n.print||console.log.bind(console),d=n.printErr||console.warn.bind(console);for(t in o)o.hasOwnProperty(t)&&(n[t]=o[t]);o=null,n.arguments&&n.arguments,n.thisProgram&&(u=n.thisProgram),n.quit&&(s=n.quit);var p,m,h,v=0,y=function(r){v=r},g=function(){return v};n.wasmBinary&&(p=n.wasmBinary),n.noExitRuntime&&(m=n.noExitRuntime),"object"!=typeof WebAssembly&&d("no native wasm support detected");var w=new WebAssembly.Table({initial:773,maximum:773,element:"anyfunc"}),_=!1;function E(r,t){r||Z("Assertion failed: "+t)}var k,b,D,S,F,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.subarray&&P)return P.decode(r.subarray(t,o));for(var i="";t<o;){var a=r[t++];if(128&a){var u=63&r[t++];if(192!=(224&a)){var s=63&r[t++];if((a=224==(240&a)?(15&a)<<12|u<<6|s:(7&a)<<18|u<<12|s<<6|63&r[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|u)}else i+=String.fromCharCode(a)}return i}function x(r,t){return r?M(D,r,t):""}function A(r,t,e,n){if(!(n>0))return 0;for(var o=e,i=e+n-1,a=0;a<r.length;++a){var u=r.charCodeAt(a);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++a)),u<=127){if(e>=i)break;t[e++]=u}else if(u<=2047){if(e+1>=i)break;t[e++]=192|u>>6,t[e++]=128|63&u}else if(u<=65535){if(e+2>=i)break;t[e++]=224|u>>12,t[e++]=128|u>>6&63,t[e++]=128|63&u}else{if(e+3>=i)break;t[e++]=240|u>>18,t[e++]=128|u>>12&63,t[e++]=128|u>>6&63,t[e++]=128|63&u}}return t[e]=0,e-o}function R(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++e)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function j(r){k=r,n.HEAP8=b=new Int8Array(r),n.HEAP16=S=new Int16Array(r),n.HEAP32=F=new Int32Array(r),n.HEAPU8=D=new Uint8Array(r),n.HEAPU16=new Uint16Array(r),n.HEAPU32=new Uint32Array(r),n.HEAPF32=new Float32Array(r),n.HEAPF64=new Float64Array(r)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var C=n.TOTAL_MEMORY||16777216;function O(r){for(;r.length>0;){var t=r.shift();if("function"!=typeof t){var e=t.func;"number"==typeof e?void 0===t.arg?n.dynCall_v(e):n.dynCall_vi(e,t.arg):e(void 0===t.arg?null:t.arg)}else t()}}(h=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:C/65536}))&&(k=h.buffer),C=k.byteLength,j(k),F[52080]=5451360;var T=[],z=[],B=[],N=[],I=!1,L=Math.abs,H=Math.ceil,U=Math.floor,Y=Math.min,W=0,q=null,V=null;function X(r){W++,n.monitorRunDependencies&&n.monitorRunDependencies(W)}function G(r){if(W--,n.monitorRunDependencies&&n.monitorRunDependencies(W),0==W&&(null!==q&&(clearInterval(q),q=null),V)){var t=V;V=null,t()}}function Z(r){throw n.onAbort&&n.onAbort(r),l(r+=""),d(r),_=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(r)}n.preloadedImages={},n.preloadedAudios={};var J="data:application/octet-stream;base64,";function K(r){return String.prototype.startsWith?r.startsWith(J):0===r.indexOf(J)}var $,Q,rr,tr="graphvizlib.wasm";function er(){try{if(p)return new Uint8Array(p);if(a)return a(tr);throw"both async and sync fetching of the wasm failed"}catch(r){Z(r)}}function nr(){var r=function(){var r=new Error;if(!r.stack){try{throw new Error}catch(t){r=t}if(!r.stack)return"(no stack trace available)"}return r.stack.toString()}();return n.extraStackTrace&&(r+="\n"+n.extraStackTrace()),r.replace(/\b_Z[\w\d_]+/g,(function(r){var t=r;return r===t?r:t+" ["+r+"]"}))}function or(){Z()}K(tr)||($=tr,tr=n.locateFile?n.locateFile($,f):f+$),z.push({func:function(){xr()}});var ir=1;function ar(r){return n.___errno_location&&(F[n.___errno_location()>>2]=r),r}var ur={splitPath:function(r){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,t){for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e;e--)r.unshift("..");return r},normalize:function(r){var t="/"===r.charAt(0),e="/"===r.substr(-1);return(r=ur.normalizeArray(r.split("/").filter((function(r){return!!r})),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:function(r){var t=ur.splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:function(r){if("/"===r)return"/";var t=r.lastIndexOf("/");return-1===t?r:r.substr(t+1)},extname:function(r){return ur.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return ur.normalize(r.join("/"))},join2:function(r,t){return ur.normalize(r+"/"+t)}},sr={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:lr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,t="/"===n.charAt(0)}return(t?"/":"")+(r=ur.normalizeArray(r.split("/").filter((function(r){return!!r})),!t).join("/"))||"."},relative:function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=sr.resolve(r).substr(1),t=sr.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),i=Math.min(n.length,o.length),a=i,u=0;u<i;u++)if(n[u]!==o[u]){a=u;break}var s=[];for(u=a;u<n.length;u++)s.push("..");return(s=s.concat(o.slice(a))).join("/")}},cr={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){cr.ttys[r]={input:[],output:[],ops:t},lr.registerDevice(r,cr.stream_ops)},stream_ops:{open:function(r){var t=cr.ttys[r.node.rdev];if(!t)throw new lr.ErrnoError(43);r.tty=t,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.get_char)throw new lr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var u;try{u=r.tty.ops.get_char(r.tty)}catch(r){throw new lr.ErrnoError(29)}if(void 0===u&&0===i)throw new lr.ErrnoError(6);if(null==u)break;i++,t[e+a]=u}return i&&(r.node.timestamp=Date.now()),i},write:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.put_char)throw new lr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,t[e+i])}catch(r){throw new lr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;r.input=Sr(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(l(M(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(l(M(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(d(M(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(d(M(r.output,0)),r.output=[])}}},fr={ops_table:null,mount:function(r){return fr.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(lr.isBlkdev(e)||lr.isFIFO(e))throw new lr.ErrnoError(63);fr.ops_table||(fr.ops_table={dir:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,lookup:fr.node_ops.lookup,mknod:fr.node_ops.mknod,rename:fr.node_ops.rename,unlink:fr.node_ops.unlink,rmdir:fr.node_ops.rmdir,readdir:fr.node_ops.readdir,symlink:fr.node_ops.symlink},stream:{llseek:fr.stream_ops.llseek}},file:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:{llseek:fr.stream_ops.llseek,read:fr.stream_ops.read,write:fr.stream_ops.write,allocate:fr.stream_ops.allocate,mmap:fr.stream_ops.mmap,msync:fr.stream_ops.msync}},link:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,readlink:fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:lr.chrdev_stream_ops}});var o=lr.createNode(r,t,e,n);return lr.isDir(o.mode)?(o.node_ops=fr.ops_table.dir.node,o.stream_ops=fr.ops_table.dir.stream,o.contents={}):lr.isFile(o.mode)?(o.node_ops=fr.ops_table.file.node,o.stream_ops=fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):lr.isLink(o.mode)?(o.node_ops=fr.ops_table.link.node,o.stream_ops=fr.ops_table.link.stream):lr.isChrdev(o.mode)&&(o.node_ops=fr.ops_table.chrdev.node,o.stream_ops=fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o),o},getFileDataAsRegularArray:function(r){if(r.contents&&r.contents.subarray){for(var t=[],e=0;e<r.usedBytes;++e)t.push(r.contents[e]);return t}return r.contents},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array},expandFileStorage:function(r,t){var e=r.contents?r.contents.length:0;if(!(e>=t)){t=Math.max(t,e*(e<1048576?2:1.125)|0),0!=e&&(t=Math.max(t,256));var n=r.contents;r.contents=new Uint8Array(t),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,t){if(r.usedBytes!=t){if(0==t)return r.contents=null,void(r.usedBytes=0);if(!r.contents||r.contents.subarray){var e=r.contents;return r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),void(r.usedBytes=t)}if(r.contents||(r.contents=[]),r.contents.length>t)r.contents.length=t;else for(;r.contents.length<t;)r.contents.push(0);r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=lr.isChrdev(r.mode)?r.id:1,t.ino=r.id,t.mode=r.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=r.rdev,lr.isDir(r.mode)?t.size=4096:lr.isFile(r.mode)?t.size=r.usedBytes:lr.isLink(r.mode)?t.size=r.link.length:t.size=0,t.atime=new Date(r.timestamp),t.mtime=new Date(r.timestamp),t.ctime=new Date(r.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(r,t){void 0!==t.mode&&(r.mode=t.mode),void 0!==t.timestamp&&(r.timestamp=t.timestamp),void 0!==t.size&&fr.resizeFileStorage(r,t.size)},lookup:function(r,t){throw lr.genericErrors[44]},mknod:function(r,t,e,n){return fr.createNode(r,t,e,n)},rename:function(r,t,e){if(lr.isDir(r.mode)){var n;try{n=lr.lookupNode(t,e)}catch(r){}if(n)for(var o in n.contents)throw new lr.ErrnoError(55)}delete r.parent.contents[r.name],r.name=e,t.contents[e]=r,r.parent=t},unlink:function(r,t){delete r.contents[t]},rmdir:function(r,t){var e=lr.lookupNode(r,t);for(var n in e.contents)throw new lr.ErrnoError(55);delete r.contents[t]},readdir:function(r){var t=[".",".."];for(var e in r.contents)r.contents.hasOwnProperty(e)&&t.push(e);return t},symlink:function(r,t,e){var n=fr.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!lr.isLink(r.mode))throw new lr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,t,e,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),e);else for(var u=0;u<a;u++)t[e+u]=i[o+u];return a},write:function(r,t,e,n,o,i){if(t.buffer===b.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(e,e+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(e,e+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(e,e+n),o),n}if(fr.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(e,e+n),o);else for(var u=0;u<n;u++)a.contents[o+u]=t[e+u];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,t,e){var n=t;if(1===e?n+=r.position:2===e&&lr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new lr.ErrnoError(28);return n},allocate:function(r,t,e){fr.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o,i,a){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);var u,s,c=r.node.contents;if(2&a||c.buffer!==t.buffer){(o>0||o+n<r.node.usedBytes)&&(c=c.subarray?c.subarray(o,o+n):Array.prototype.slice.call(c,o,o+n)),s=!0;var f=t.buffer==b.buffer;if(!(u=Cr(n)))throw new lr.ErrnoError(48);(f?b:t).set(c,u)}else s=!1,u=c.byteOffset;return{ptr:u,allocated:s}},msync:function(r,t,e,n,o){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);return 2&o?0:(fr.stream_ops.write(r,t,0,n,e,!1),0)}}},lr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(r){if(!(r instanceof lr.ErrnoError))throw r+" : "+nr();return ar(r.errno)},lookupPath:function(r,t){if(t=t||{},!(r=sr.resolve(lr.cwd(),r)))return{path:"",node:null};var e={follow_mount:!0,recurse_count:0};for(var n in e)void 0===t[n]&&(t[n]=e[n]);if(t.recurse_count>8)throw new lr.ErrnoError(32);for(var o=ur.normalizeArray(r.split("/").filter((function(r){return!!r})),!1),i=lr.root,a="/",u=0;u<o.length;u++){var s=u===o.length-1;if(s&&t.parent)break;if(i=lr.lookupNode(i,o[u]),a=ur.join2(a,o[u]),lr.isMountpoint(i)&&(!s||s&&t.follow_mount)&&(i=i.mounted.root),!s||t.follow)for(var c=0;lr.isLink(i.mode);){var f=lr.readlink(a);if(a=sr.resolve(ur.dirname(a),f),i=lr.lookupPath(a,{recurse_count:t.recurse_count}).node,c++>40)throw new lr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var t;;){if(lr.isRoot(r)){var e=r.mount.mountpoint;return t?"/"!==e[e.length-1]?e+"/"+t:e+t:e}t=t?r.name+"/"+t:r.name,r=r.parent}},hashName:function(r,t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(r+e>>>0)%lr.nameTable.length},hashAddNode:function(r){var t=lr.hashName(r.parent.id,r.name);r.name_next=lr.nameTable[t],lr.nameTable[t]=r},hashRemoveNode:function(r){var t=lr.hashName(r.parent.id,r.name);if(lr.nameTable[t]===r)lr.nameTable[t]=r.name_next;else for(var e=lr.nameTable[t];e;){if(e.name_next===r){e.name_next=r.name_next;break}e=e.name_next}},lookupNode:function(r,t){var e=lr.mayLookup(r);if(e)throw new lr.ErrnoError(e,r);for(var n=lr.hashName(r.id,t),o=lr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===t)return o}return lr.lookup(r,t)},createNode:function(r,t,e,n){lr.FSNode||(lr.FSNode=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=lr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n},lr.FSNode.prototype={},Object.defineProperties(lr.FSNode.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return lr.isDir(this.mode)}},isDevice:{get:function(){return lr.isChrdev(this.mode)}}}));var o=new lr.FSNode(r,t,e,n);return lr.hashAddNode(o),o},destroyNode:function(r){lr.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(r){var t=lr.flagModes[r];if(void 0===t)throw new Error("Unknown file open mode: "+r);return t},flagsToPermissionString:function(r){var t=["r","w","rw"][3&r];return 512&r&&(t+="w"),t},nodePermissions:function(r,t){return lr.ignorePermissions?0:(-1===t.indexOf("r")||292&r.mode)&&(-1===t.indexOf("w")||146&r.mode)&&(-1===t.indexOf("x")||73&r.mode)?0:2},mayLookup:function(r){var t=lr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:function(r,t){try{return lr.lookupNode(r,t),20}catch(r){}return lr.nodePermissions(r,"wx")},mayDelete:function(r,t,e){var n;try{n=lr.lookupNode(r,t)}catch(r){return r.errno}var o=lr.nodePermissions(r,"wx");if(o)return o;if(e){if(!lr.isDir(n.mode))return 54;if(lr.isRoot(n)||lr.getPath(n)===lr.cwd())return 10}else if(lr.isDir(n.mode))return 31;return 0},mayOpen:function(r,t){return r?lr.isLink(r.mode)?32:lr.isDir(r.mode)&&("r"!==lr.flagsToPermissionString(t)||512&t)?31:lr.nodePermissions(r,lr.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(r,t){r=r||0,t=t||lr.MAX_OPEN_FDS;for(var e=r;e<=t;e++)if(!lr.streams[e])return e;throw new lr.ErrnoError(33)},getStream:function(r){return lr.streams[r]},createStream:function(r,t,e){lr.FSStream||(lr.FSStream=function(){},lr.FSStream.prototype={},Object.defineProperties(lr.FSStream.prototype,{object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n=new lr.FSStream;for(var o in r)n[o]=r[o];r=n;var i=lr.nextfd(t,e);return r.fd=i,lr.streams[i]=r,r},closeStream:function(r){lr.streams[r]=null},chrdev_stream_ops:{open:function(r){var t=lr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new lr.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,t){return r<<8|t},registerDevice:function(r,t){lr.devices[r]={stream_ops:t}},getDevice:function(r){return lr.devices[r]},getMounts:function(r){for(var t=[],e=[r];e.length;){var n=e.pop();t.push(n),e.push.apply(e,n.mounts)}return t},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),lr.syncFSRequests++,lr.syncFSRequests>1&&d("warning: "+lr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=lr.getMounts(lr.root.mount),n=0;function o(r){return lr.syncFSRequests--,t(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=e.length&&o(null)}e.forEach((function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,r,i)}))},mount:function(r,t,e){var n,o="/"===e,i=!e;if(o&&lr.root)throw new lr.ErrnoError(10);if(!o&&!i){var a=lr.lookupPath(e,{follow_mount:!1});if(e=a.path,n=a.node,lr.isMountpoint(n))throw new lr.ErrnoError(10);if(!lr.isDir(n.mode))throw new lr.ErrnoError(54)}var u={type:r,opts:t,mountpoint:e,mounts:[]},s=r.mount(u);return s.mount=u,u.root=s,o?lr.root=s:n&&(n.mounted=u,n.mount&&n.mount.mounts.push(u)),s},unmount:function(r){var t=lr.lookupPath(r,{follow_mount:!1});if(!lr.isMountpoint(t.node))throw new lr.ErrnoError(28);var e=t.node,n=e.mounted,o=lr.getMounts(n);Object.keys(lr.nameTable).forEach((function(r){for(var t=lr.nameTable[r];t;){var e=t.name_next;-1!==o.indexOf(t.mount)&&lr.destroyNode(t),t=e}})),e.mounted=null;var i=e.mount.mounts.indexOf(n);e.mount.mounts.splice(i,1)},lookup:function(r,t){return r.node_ops.lookup(r,t)},mknod:function(r,t,e){var n=lr.lookupPath(r,{parent:!0}).node,o=ur.basename(r);if(!o||"."===o||".."===o)throw new lr.ErrnoError(28);var i=lr.mayCreate(n,o);if(i)throw new lr.ErrnoError(i);if(!n.node_ops.mknod)throw new lr.ErrnoError(63);return n.node_ops.mknod(n,o,t,e)},create:function(r,t){return t=void 0!==t?t:438,t&=4095,t|=32768,lr.mknod(r,t,0)},mkdir:function(r,t){return t=void 0!==t?t:511,t&=1023,t|=16384,lr.mknod(r,t,0)},mkdirTree:function(r,t){for(var e=r.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{lr.mkdir(n,t)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,t,e){return void 0===e&&(e=t,t=438),t|=8192,lr.mknod(r,t,e)},symlink:function(r,t){if(!sr.resolve(r))throw new lr.ErrnoError(44);var e=lr.lookupPath(t,{parent:!0}).node;if(!e)throw new lr.ErrnoError(44);var n=ur.basename(t),o=lr.mayCreate(e,n);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.symlink)throw new lr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:function(r,t){var e,n,o=ur.dirname(r),i=ur.dirname(t),a=ur.basename(r),u=ur.basename(t);try{e=lr.lookupPath(r,{parent:!0}).node,n=lr.lookupPath(t,{parent:!0}).node}catch(r){throw new lr.ErrnoError(10)}if(!e||!n)throw new lr.ErrnoError(44);if(e.mount!==n.mount)throw new lr.ErrnoError(75);var s,c=lr.lookupNode(e,a),f=sr.relative(r,i);if("."!==f.charAt(0))throw new lr.ErrnoError(28);if("."!==(f=sr.relative(t,o)).charAt(0))throw new lr.ErrnoError(55);try{s=lr.lookupNode(n,u)}catch(r){}if(c!==s){var l=lr.isDir(c.mode),p=lr.mayDelete(e,a,l);if(p)throw new lr.ErrnoError(p);if(p=s?lr.mayDelete(n,u,l):lr.mayCreate(n,u))throw new lr.ErrnoError(p);if(!e.node_ops.rename)throw new lr.ErrnoError(63);if(lr.isMountpoint(c)||s&&lr.isMountpoint(s))throw new lr.ErrnoError(10);if(n!==e&&(p=lr.nodePermissions(e,"w")))throw new lr.ErrnoError(p);try{lr.trackingDelegate.willMovePath&&lr.trackingDelegate.willMovePath(r,t)}catch(e){d("FS.trackingDelegate['willMovePath']('"+r+"', '"+t+"') threw an exception: "+e.message)}lr.hashRemoveNode(c);try{e.node_ops.rename(c,n,u)}catch(r){throw r}finally{lr.hashAddNode(c)}try{lr.trackingDelegate.onMovePath&&lr.trackingDelegate.onMovePath(r,t)}catch(e){d("FS.trackingDelegate['onMovePath']('"+r+"', '"+t+"') threw an exception: "+e.message)}}},rmdir:function(r){var t=lr.lookupPath(r,{parent:!0}).node,e=ur.basename(r),n=lr.lookupNode(t,e),o=lr.mayDelete(t,e,!0);if(o)throw new lr.ErrnoError(o);if(!t.node_ops.rmdir)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath&&lr.trackingDelegate.willDeletePath(r)}catch(t){d("FS.trackingDelegate['willDeletePath']('"+r+"') threw an exception: "+t.message)}t.node_ops.rmdir(t,e),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath&&lr.trackingDelegate.onDeletePath(r)}catch(t){d("FS.trackingDelegate['onDeletePath']('"+r+"') threw an exception: "+t.message)}},readdir:function(r){var t=lr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new lr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(r){var t=lr.lookupPath(r,{parent:!0}).node,e=ur.basename(r),n=lr.lookupNode(t,e),o=lr.mayDelete(t,e,!1);if(o)throw new lr.ErrnoError(o);if(!t.node_ops.unlink)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath&&lr.trackingDelegate.willDeletePath(r)}catch(t){d("FS.trackingDelegate['willDeletePath']('"+r+"') threw an exception: "+t.message)}t.node_ops.unlink(t,e),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath&&lr.trackingDelegate.onDeletePath(r)}catch(t){d("FS.trackingDelegate['onDeletePath']('"+r+"') threw an exception: "+t.message)}},readlink:function(r){var t=lr.lookupPath(r).node;if(!t)throw new lr.ErrnoError(44);if(!t.node_ops.readlink)throw new lr.ErrnoError(28);return sr.resolve(lr.getPath(t.parent),t.node_ops.readlink(t))},stat:function(r,t){var e=lr.lookupPath(r,{follow:!t}).node;if(!e)throw new lr.ErrnoError(44);if(!e.node_ops.getattr)throw new lr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:function(r){return lr.stat(r,!0)},chmod:function(r,t,e){var n;if(!(n="string"==typeof r?lr.lookupPath(r,{follow:!e}).node:r).node_ops.setattr)throw new lr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,t){lr.chmod(r,t,!0)},fchmod:function(r,t){var e=lr.getStream(r);if(!e)throw new lr.ErrnoError(8);lr.chmod(e.node,t)},chown:function(r,t,e,n){var o;if(!(o="string"==typeof r?lr.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new lr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,t,e){lr.chown(r,t,e,!0)},fchown:function(r,t,e){var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);lr.chown(n.node,t,e)},truncate:function(r,t){if(t<0)throw new lr.ErrnoError(28);var e;if(!(e="string"==typeof r?lr.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new lr.ErrnoError(63);if(lr.isDir(e.mode))throw new lr.ErrnoError(31);if(!lr.isFile(e.mode))throw new lr.ErrnoError(28);var n=lr.nodePermissions(e,"w");if(n)throw new lr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:function(r,t){var e=lr.getStream(r);if(!e)throw new lr.ErrnoError(8);if(0==(2097155&e.flags))throw new lr.ErrnoError(28);lr.truncate(e.node,t)},utime:function(r,t,e){var n=lr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:function(r,t,e,o,i){if(""===r)throw new lr.ErrnoError(44);var a;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?lr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)a=r;else{r=ur.normalize(r);try{a=lr.lookupPath(r,{follow:!(131072&t)}).node}catch(r){}}var u=!1;if(64&t)if(a){if(128&t)throw new lr.ErrnoError(20)}else a=lr.mknod(r,e,0),u=!0;if(!a)throw new lr.ErrnoError(44);if(lr.isChrdev(a.mode)&&(t&=-513),65536&t&&!lr.isDir(a.mode))throw new lr.ErrnoError(54);if(!u){var s=lr.mayOpen(a,t);if(s)throw new lr.ErrnoError(s)}512&t&&lr.truncate(a,0),t&=-641;var c=lr.createStream({node:a,path:lr.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},o,i);c.stream_ops.open&&c.stream_ops.open(c),!n.logReadFiles||1&t||(lr.readFiles||(lr.readFiles={}),r in lr.readFiles||(lr.readFiles[r]=1,d("FS.trackingDelegate error on read file: "+r)));try{if(lr.trackingDelegate.onOpenFile){var f=0;1!=(2097155&t)&&(f|=lr.tracking.openFlags.READ),0!=(2097155&t)&&(f|=lr.tracking.openFlags.WRITE),lr.trackingDelegate.onOpenFile(r,f)}}catch(t){d("FS.trackingDelegate['onOpenFile']('"+r+"', flags) threw an exception: "+t.message)}return c},close:function(r){if(lr.isClosed(r))throw new lr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{lr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,t,e){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new lr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new lr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,t,e),r.ungotten=[],r.position},read:function(r,t,e,n,o){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(1==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.read)throw new lr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,t,e,n,o);return i||(r.position+=a),a},write:function(r,t,e,n,o,i){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.write)throw new lr.ErrnoError(28);1024&r.flags&&lr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var u=r.stream_ops.write(r,t,e,n,o,i);a||(r.position+=u);try{r.path&&lr.trackingDelegate.onWriteToFile&&lr.trackingDelegate.onWriteToFile(r.path)}catch(t){d("FS.trackingDelegate['onWriteToFile']('"+r.path+"') threw an exception: "+t.message)}return u},allocate:function(r,t,e){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(t<0||e<=0)throw new lr.ErrnoError(28);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(!lr.isFile(r.node.mode)&&!lr.isDir(r.node.mode))throw new lr.ErrnoError(43);if(!r.stream_ops.allocate)throw new lr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:function(r,t,e,n,o,i,a){if(0!=(2&i)&&0==(2&a)&&2!=(2097155&r.flags))throw new lr.ErrnoError(2);if(1==(2097155&r.flags))throw new lr.ErrnoError(2);if(!r.stream_ops.mmap)throw new lr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o,i,a)},msync:function(r,t,e,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,t,e,n,o):0},munmap:function(r){return 0},ioctl:function(r,t,e){if(!r.stream_ops.ioctl)throw new lr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:function(r,t){if((t=t||{}).flags=t.flags||"r",t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var e,n=lr.open(r,t.flags),o=lr.stat(r).size,i=new Uint8Array(o);return lr.read(n,i,0,o,0),"utf8"===t.encoding?e=M(i,0):"binary"===t.encoding&&(e=i),lr.close(n),e},writeFile:function(r,t,e){(e=e||{}).flags=e.flags||"w";var n=lr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(R(t)+1),i=A(t,o,0,o.length);lr.write(n,o,0,i,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");lr.write(n,t,0,t.byteLength,void 0,e.canOwn)}lr.close(n)},cwd:function(){return lr.currentPath},chdir:function(r){var t=lr.lookupPath(r,{follow:!0});if(null===t.node)throw new lr.ErrnoError(44);if(!lr.isDir(t.node.mode))throw new lr.ErrnoError(54);var e=lr.nodePermissions(t.node,"x");if(e)throw new lr.ErrnoError(e);lr.currentPath=t.path},createDefaultDirectories:function(){lr.mkdir("/tmp"),lr.mkdir("/home"),lr.mkdir("/home/web_user")},createDefaultDevices:function(){var r;if(lr.mkdir("/dev"),lr.registerDevice(lr.makedev(1,3),{read:function(){return 0},write:function(r,t,e,n,o){return n}}),lr.mkdev("/dev/null",lr.makedev(1,3)),cr.register(lr.makedev(5,0),cr.default_tty_ops),cr.register(lr.makedev(6,0),cr.default_tty1_ops),lr.mkdev("/dev/tty",lr.makedev(5,0)),lr.mkdev("/dev/tty1",lr.makedev(6,0)),"object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);r=function(){return crypto.getRandomValues(t),t[0]}}r||(r=function(){Z("random_device")}),lr.createDevice("/dev","random",r),lr.createDevice("/dev","urandom",r),lr.mkdir("/dev/shm"),lr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){lr.mkdir("/proc"),lr.mkdir("/proc/self"),lr.mkdir("/proc/self/fd"),lr.mount({mount:function(){var r=lr.createNode("/proc/self","fd",16895,73);return r.node_ops={lookup:function(r,t){var e=+t,n=lr.getStream(e);if(!n)throw new lr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams:function(){n.stdin?lr.createDevice("/dev","stdin",n.stdin):lr.symlink("/dev/tty","/dev/stdin"),n.stdout?lr.createDevice("/dev","stdout",null,n.stdout):lr.symlink("/dev/tty","/dev/stdout"),n.stderr?lr.createDevice("/dev","stderr",null,n.stderr):lr.symlink("/dev/tty1","/dev/stderr"),lr.open("/dev/stdin","r"),lr.open("/dev/stdout","w"),lr.open("/dev/stderr","w")},ensureErrnoError:function(){lr.ErrnoError||(lr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},lr.ErrnoError.prototype=new Error,lr.ErrnoError.prototype.constructor=lr.ErrnoError,[44].forEach((function(r){lr.genericErrors[r]=new lr.ErrnoError(r),lr.genericErrors[r].stack="<generic error, no stack>"})))},staticInit:function(){lr.ensureErrnoError(),lr.nameTable=new Array(4096),lr.mount(fr,{},"/"),lr.createDefaultDirectories(),lr.createDefaultDevices(),lr.createSpecialDirectories(),lr.filesystems={MEMFS:fr}},init:function(r,t,e){lr.init.initialized=!0,lr.ensureErrnoError(),n.stdin=r||n.stdin,n.stdout=t||n.stdout,n.stderr=e||n.stderr,lr.createStandardStreams()},quit:function(){lr.init.initialized=!1;var r=n._fflush;r&&r(0);for(var t=0;t<lr.streams.length;t++){var e=lr.streams[t];e&&lr.close(e)}},getMode:function(r,t){var e=0;return r&&(e|=365),t&&(e|=146),e},joinPath:function(r,t){var e=ur.join.apply(null,r);return t&&"/"==e[0]&&(e=e.substr(1)),e},absolutePath:function(r,t){return sr.resolve(t,r)},standardizePath:function(r){return ur.normalize(r)},findObject:function(r,t){var e=lr.analyzePath(r,t);return e.exists?e.object:(ar(e.error),null)},analyzePath:function(r,t){try{r=(n=lr.lookupPath(r,{follow:!t})).path}catch(r){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=ur.basename(r),n=lr.lookupPath(r,{follow:!t}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(r){e.error=r.errno}return e},createFolder:function(r,t,e,n){var o=ur.join2("string"==typeof r?r:lr.getPath(r),t),i=lr.getMode(e,n);return lr.mkdir(o,i)},createPath:function(r,t,e,n){r="string"==typeof r?r:lr.getPath(r);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ur.join2(r,i);try{lr.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,t,e,n,o){var i=ur.join2("string"==typeof r?r:lr.getPath(r),t),a=lr.getMode(n,o);return lr.create(i,a)},createDataFile:function(r,t,e,n,o,i){var a=t?ur.join2("string"==typeof r?r:lr.getPath(r),t):r,u=lr.getMode(n,o),s=lr.create(a,u);if(e){if("string"==typeof e){for(var c=new Array(e.length),f=0,l=e.length;f<l;++f)c[f]=e.charCodeAt(f);e=c}lr.chmod(s,146|u);var d=lr.open(s,"w");lr.write(d,e,0,e.length,0,i),lr.close(d),lr.chmod(s,u)}return s},createDevice:function(r,t,e,n){var o=ur.join2("string"==typeof r?r:lr.getPath(r),t),i=lr.getMode(!!e,!!n);lr.createDevice.major||(lr.createDevice.major=64);var a=lr.makedev(lr.createDevice.major++,0);return lr.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,t,n,o,i){for(var a=0,u=0;u<o;u++){var s;try{s=e()}catch(r){throw new lr.ErrnoError(29)}if(void 0===s&&0===a)throw new lr.ErrnoError(6);if(null==s)break;a++,t[n+u]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,t,e,o,i){for(var a=0;a<o;a++)try{n(t[e+a])}catch(r){throw new lr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),lr.mkdev(o,i,a)},createLink:function(r,t,e,n,o){var i=ur.join2("string"==typeof r?r:lr.getPath(r),t);return lr.symlink(e,i)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;var t=!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(!i)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Sr(i(r.url),!0),r.usedBytes=r.contents.length}catch(r){t=!1}return t||ar(29),t},createLazyFile:function(r,t,e,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var t=r%this.chunkSize,e=r/this.chunkSize|0;return this.getter(e)[t]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",e,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+e+". Status: "+r.status);var t,n=Number(r.getResponseHeader("Content-length")),o=(t=r.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=r.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var u=this;u.setDataGetter((function(r){var t=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===u.chunks[r]&&(u.chunks[r]=function(r,t){if(r>t)throw new Error("invalid range ("+r+", "+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",e,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+t),"undefined"!=typeof Uint8Array&&(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 "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Sr(o.responseText||"",!0)}(t,o)),void 0===u.chunks[r])throw new Error("doXHR failed!");return u.chunks[r]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,l("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)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:e},u=lr.createFile(r,t,a,n,o);a.contents?u.contents=a.contents:a.url&&(u.contents=null,u.url=a.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var s={};return Object.keys(u.stream_ops).forEach((function(r){var t=u.stream_ops[r];s[r]=function(){if(!lr.forceLoadFile(u))throw new lr.ErrnoError(29);return t.apply(null,arguments)}})),s.read=function(r,t,e,n,o){if(!lr.forceLoadFile(u))throw new lr.ErrnoError(29);var i=r.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[e+s]=i[o+s];else for(s=0;s<a;s++)t[e+s]=i.get(o+s);return a},u.stream_ops=s,u},createPreloadedFile:function(r,t,e,o,i,a,u,s,c,f){Browser.init();var l=t?sr.resolve(ur.join2(r,t)):r;function d(e){function d(e){f&&f(),s||lr.createDataFile(r,t,e,o,i,c),a&&a(),G()}var p=!1;n.preloadPlugins.forEach((function(r){p||r.canHandle(l)&&(r.handle(e,l,d,(function(){u&&u(),G()})),p=!0)})),p||d(e)}X(),"string"==typeof e?Browser.asyncLoad(e,(function(r){d(r)}),u):d(e)},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(r,t,e){t=t||function(){},e=e||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=function(){l("creating db"),o.result.createObjectStore(lr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([lr.DB_STORE_NAME],"readwrite"),i=n.objectStore(lr.DB_STORE_NAME),a=0,u=0,s=r.length;function c(){0==u?t():e()}r.forEach((function(r){var t=i.put(lr.analyzePath(r).object.contents,r);t.onsuccess=function(){++a+u==s&&c()},t.onerror=function(){u++,a+u==s&&c()}})),n.onerror=e},o.onerror=e},loadFilesFromDB:function(r,t,e){t=t||function(){},e=e||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return e(r)}o.onupgradeneeded=e,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([lr.DB_STORE_NAME],"readonly")}catch(r){return void e(r)}var a=i.objectStore(lr.DB_STORE_NAME),u=0,s=0,c=r.length;function f(){0==s?t():e()}r.forEach((function(r){var t=a.get(r);t.onsuccess=function(){lr.analyzePath(r).exists&&lr.unlink(r),lr.createDataFile(ur.dirname(r),ur.basename(r),t.result,!0,!0,!0),++u+s==c&&f()},t.onerror=function(){s++,u+s==c&&f()}})),i.onerror=e},o.onerror=e}},dr={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:function(r,t){if("/"!==t[0]){var e;if(-100===r)e=lr.cwd();else{var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);e=n.path}t=ur.join2(e,t)}return t},doStat:function(r,t,e){try{var n=r(t)}catch(r){if(r&&r.node&&ur.normalize(t)!==ur.normalize(lr.getPath(r.node)))return-54;throw r}return F[e>>2]=n.dev,F[e+4>>2]=0,F[e+8>>2]=n.ino,F[e+12>>2]=n.mode,F[e+16>>2]=n.nlink,F[e+20>>2]=n.uid,F[e+24>>2]=n.gid,F[e+28>>2]=n.rdev,F[e+32>>2]=0,rr=[n.size>>>0,(Q=n.size,+L(Q)>=1?Q>0?(0|Y(+U(Q/4294967296),4294967295))>>>0:~~+H((Q-+(~~Q>>>0))/4294967296)>>>0:0)],F[e+40>>2]=rr[0],F[e+44>>2]=rr[1],F[e+48>>2]=4096,F[e+52>>2]=n.blocks,F[e+56>>2]=n.atime.getTime()/1e3|0,F[e+60>>2]=0,F[e+64>>2]=n.mtime.getTime()/1e3|0,F[e+68>>2]=0,F[e+72>>2]=n.ctime.getTime()/1e3|0,F[e+76>>2]=0,rr=[n.ino>>>0,(Q=n.ino,+L(Q)>=1?Q>0?(0|Y(+U(Q/4294967296),4294967295))>>>0:~~+H((Q-+(~~Q>>>0))/4294967296)>>>0:0)],F[e+80>>2]=rr[0],F[e+84>>2]=rr[1],0},doMsync:function(r,t,e,n,o){var i=D.slice(r,r+e);lr.msync(t,i,o,e,n)},doMkdir:function(r,t){return"/"===(r=ur.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),lr.mkdir(r,t,0),0},doMknod:function(r,t,e){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return lr.mknod(r,t,e),0},doReadlink:function(r,t,e){if(e<=0)return-28;var n=lr.readlink(r),o=Math.min(e,R(n)),i=b[t+o];return A(n,D,t,e+1),b[t+o]=i,o},doAccess:function(r,t){if(-8&t)return-28;var e;if(!(e=lr.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&lr.nodePermissions(e,n)?-2:0},doDup:function(r,t,e){var n=lr.getStream(e);return n&&lr.close(n),lr.open(r,t,0,e,e).fd},doReadv:function(r,t,e,n){for(var o=0,i=0;i<e;i++){var a=F[t+8*i>>2],u=F[t+(8*i+4)>>2],s=lr.read(r,b,a,u,n);if(s<0)return-1;if(o+=s,s<u)break}return o},doWritev:function(r,t,e,n){for(var o=0,i=0;i<e;i++){var a=F[t+8*i>>2],u=F[t+(8*i+4)>>2],s=lr.write(r,b,a,u,n);if(s<0)return-1;o+=s}return o},varargs:0,get:function(r){return dr.varargs+=4,F[dr.varargs-4>>2]},getStr:function(){return x(dr.get())},getStreamFromFD:function(r){void 0===r&&(r=dr.get());var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);return t},get64:function(){var r=dr.get();return dr.get(),r},getZero:function(){dr.get()}};function pr(r,t,e){t|=0;var n,o=0,i=0,a=0;if(n=(r|=0)+(e|=0)|0,t&=255,(0|e)>=67){for(;0!=(3&r);)b[r>>0]=t,r=r+1|0;for(a=t|t<<8|t<<16|t<<24,i=(o=-4&n|0)-64|0;(0|r)<=(0|i);)F[r>>2]=a,F[r+4>>2]=a,F[r+8>>2]=a,F[r+12>>2]=a,F[r+16>>2]=a,F[r+20>>2]=a,F[r+24>>2]=a,F[r+28>>2]=a,F[r+32>>2]=a,F[r+36>>2]=a,F[r+40>>2]=a,F[r+44>>2]=a,F[r+48>>2]=a,F[r+52>>2]=a,F[r+56>>2]=a,F[r+60>>2]=a,r=r+64|0;for(;(0|r)<(0|o);)F[r>>2]=a,r=r+4|0}for(;(0|r)<(0|n);)b[r>>0]=t,r=r+1|0;return n-e|0}var mr={ppid:1,pid:42,sid:42,pgid:42},hr=0;function vr(r){try{return h.grow(r-k.byteLength+65535>>16),j(h.buffer),1}catch(r){}}var yr={};function gr(){if(!gr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var t in yr)r[t]=yr[t];var e=[];for(var t in r)e.push(t+"="+r[t]);gr.strings=e}return gr.strings}function wr(r){return r%4==0&&(r%100!=0||r%400==0)}function _r(r,t){for(var e=0,n=0;n<=t;e+=r[n++]);return e}var Er=[31,29,31,30,31,30,31,31,30,31,30,31],kr=[31,28,31,30,31,30,31,31,30,31,30,31];function br(r,t){for(var e=new Date(r.getTime());t>0;){var n=wr(e.getFullYear()),o=e.getMonth(),i=(n?Er:kr)[o];if(!(t>i-e.getDate()))return e.setDate(e.getDate()+t),e;t-=i-e.getDate()+1,e.setDate(1),o<11?e.setMonth(o+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function Dr(r,t,e,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?x(o):""},a=x(e),u={"%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 s in u)a=a.replace(new RegExp(s,"g"),u[s]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(r,t,e){for(var n="number"==typeof r?r.toString():r||"";n.length<t;)n=e[0]+n;return n}function d(r,t){return l(r,t,"0")}function p(r,t){function e(r){return r<0?-1:r>0?1:0}var n;return 0===(n=e(r.getFullYear()-t.getFullYear()))&&0===(n=e(r.getMonth()-t.getMonth()))&&(n=e(r.getDate()-t.getDate())),n}function m(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function h(r){var t=br(new Date(r.tm_year+1900,0,1),r.tm_yday),e=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=m(e),i=m(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var v={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.tm_mon]},"%C":function(r){return d((r.tm_year+1900)/100|0,2)},"%d":function(r){return d(r.tm_mday,2)},"%e":function(r){return l(r.tm_mday,2," ")},"%g":function(r){return h(r).toString().substring(2)},"%G":function(r){return h(r)},"%H":function(r){return d(r.tm_hour,2)},"%I":function(r){var t=r.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(r){return d(r.tm_mday+_r(wr(r.tm_year+1900)?Er:kr,r.tm_mon-1),3)},"%m":function(r){return d(r.tm_mon+1,2)},"%M":function(r){return d(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return d(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var t=new Date(r.tm_year+1900,0,1),e=0===t.getDay()?t:br(t,7-t.getDay()),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(p(e,n)<0){var o=_r(wr(n.getFullYear())?Er:kr,n.getMonth()-1)-31,i=31-e.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===p(e,t)?"01":"00"},"%V":function(r){var t,e=new Date(r.tm_year+1900,0,4),n=new Date(r.tm_year+1901,0,4),o=m(e),i=m(n),a=br(new Date(r.tm_year+1900,0,1),r.tm_yday);return p(a,o)<0?"53":p(i,a)<=0?"01":(t=o.getFullYear()<r.tm_year+1900?r.tm_yday+32-o.getDate():r.tm_yday+1-o.getDate(),d(Math.ceil(t/7),2))},"%w":function(r){return r.tm_wday},"%W":function(r){var t=new Date(r.tm_year,0,1),e=1===t.getDay()?t:br(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(p(e,n)<0){var o=_r(wr(n.getFullYear())?Er:kr,n.getMonth()-1)-31,i=31-e.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===p(e,t)?"01":"00"},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var t=r.tm_gmtoff,e=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(e?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var s in v)a.indexOf(s)>=0&&(a=a.replace(new RegExp(s,"g"),v[s](i)));var y=Sr(a,!1);return y.length>t?0:(function(r,t){b.set(r,t)}(y,r),y.length-1)}function Sr(r,t,e){var n=e>0?e:R(r)+1,o=new Array(n),i=A(r,o,0,o.length);return t&&(o.length=i),o}or=function(){return performance.now()},lr.staticInit();var Fr={L:function(r,t){return function(r,t){var e;if(0===r)e=Date.now();else{if(1!==r&&4!==r||!ir)return ar(28),-1;e=or()}return F[t>>2]=e/1e3|0,F[t+4>>2]=e%1e3*1e3*1e3|0,0}(r,t)},k:function(r){return Cr(r)},j:function(r,t,e){throw"uncaught_exception"in Br?Br.uncaught_exceptions++:Br.uncaught_exceptions=1,r},r:function(){},T:function(r,t){return ar(63),-1},O:function(r,t){dr.varargs=t;try{var e=dr.getStr();return lr.unlink(e),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},Q:function(r,t){dr.varargs=t;try{return function(r,t,e,n,o,i){var a;i<<=12;var u=!1;if(0!=(16&n)&&r%16384!=0)return-28;if(0!=(32&n)){if(!(a=Nr(16384,t)))return-48;pr(a,0,t),u=!0}else{var s=lr.getStream(o);if(!s)return-8;var c=lr.mmap(s,D,r,t,i,e,n);a=c.ptr,u=c.allocated}return dr.mappings[a]={malloc:a,len:t,allocated:u,fd:o,flags:n,offset:i},a}(dr.get(),dr.get(),dr.get(),dr.get(),dr.get(),dr.get())}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},R:function(r,t){dr.varargs=t;try{var e=dr.getStr(),n=dr.get();return dr.doStat(lr.stat,e,n)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},S:function(r,t){dr.varargs=t;try{var e=dr.getStreamFromFD(),n=dr.get();return dr.doStat(lr.stat,e.path,n)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},K:function(r,t){dr.varargs=t;try{return mr.pid}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},x:function(r,t){dr.varargs=t;try{var e=dr.getStreamFromFD();switch(dr.get()){case 0:return(n=dr.get())<0?-28:lr.open(e.path,e.flags,0,n).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:var n=dr.get();return e.flags|=n,0;case 12:return n=dr.get(),S[n+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return ar(28),-1;default:return-28}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},J:function(r,t){dr.varargs=t;try{var e=dr.getStr(),n=dr.get();return dr.doAccess(e,n)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},y:function(r,t){dr.varargs=t;try{var e=dr.getStr(),n=dr.get(),o=dr.get();return lr.open(e,n,o).fd}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},N:function(r,t){dr.varargs=t;try{var e=dr.getStreamFromFD(),n=dr.get();switch(n){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var o=dr.get();return F[o>>2]=0,0;case 21520:return e.tty?-28:-59;case 21531:return o=dr.get(),lr.ioctl(e,n,o);case 21523:case 21524:return e.tty?0:-59;default:Z("bad ioctl syscall "+n)}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},P:function(r,t){dr.varargs=t;try{return function(r,t){if(-1===r||0===t)return-28;var e=dr.mappings[r];if(!e)return 0;if(t===e.len){var n=lr.getStream(e.fd);dr.doMsync(r,n,t,e.flags,e.offset),dr.mappings[r]=null,e.allocated&&Or(e.malloc)}return 0}(dr.get(),dr.get())}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),-r.errno}},m:function(){},v:function(){Z()},d:function(r,t){!function(r,t){throw zr(r,t||1),"longjmp"}(r,t)},D:function(r,t,e){D.set(D.subarray(t,t+e),r)},E:function(r){var t=D.length;if(r>2147418112)return!1;for(var e,n,o=1;o<=4;o*=2){var i=t*(1+.2/o);if(i=Math.min(i,r+100663296),vr(Math.min(2147418112,((e=Math.max(16777216,r,i))%(n=65536)>0&&(e+=n-e%n),e))))return!0}return!1},H:function(r,t){var e=gr(),n=0;return e.forEach((function(e,o){var i=t+n;F[r+4*o>>2]=i,function(r,t,e){for(var n=0;n<r.length;++n)b[t++>>0]=r.charCodeAt(n);e||(b[t>>0]=0)}(e,i),n+=e.length+1})),0},I:function(r,t){var e=gr();F[r>>2]=e.length;var n=0;return e.forEach((function(r){n+=r.length+1})),F[t>>2]=n,0},l:function(r){!function(r,t){t&&m&&0===r||(m||(_=!0,n.onExit&&n.onExit(r)),s(r,new tt(r)))}(r)},q:function(r){try{var t=dr.getStreamFromFD(r);return lr.close(t),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},G:function(r,t){try{var e=dr.getStreamFromFD(r),n=e.tty?2:lr.isDir(e.mode)?3:lr.isLink(e.mode)?7:4;return b[t>>0]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},M:function(r,t,e,n){try{var o=dr.getStreamFromFD(r),i=dr.doReadv(o,t,e);return F[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},C:function(r,t,e,n,o){try{var i=dr.getStreamFromFD(r),a=4294967296*e+(t>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(lr.llseek(i,a,n),rr=[i.position>>>0,(Q=i.position,+L(Q)>=1?Q>0?(0|Y(+U(Q/4294967296),4294967295))>>>0:~~+H((Q-+(~~Q>>>0))/4294967296)>>>0:0)],F[o>>2]=rr[0],F[o+4>>2]=rr[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},w:function(r,t,e,n){try{var o=dr.getStreamFromFD(r),i=dr.doWritev(o,t,e);return F[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||Z(r),r.errno}},a:function(){return 0|g()},W:function(r){var t=Qr();try{return Kr(r)}catch(r){if(rt(t),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},U:function(r,t){var e=Qr();try{return $r(r,t)}catch(r){if(rt(e),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},B:function(r){var t=Qr();try{return qr(r)}catch(r){if(rt(t),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},f:function(r,t){var e=Qr();try{return Vr(r,t)}catch(r){if(rt(e),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},e:function(r,t,e){var n=Qr();try{return Xr(r,t,e)}catch(r){if(rt(n),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},g:function(r,t,e,n){var o=Qr();try{return Gr(r,t,e,n)}catch(r){if(rt(o),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},n:function(r,t,e,n,o){var i=Qr();try{return Zr(r,t,e,n,o)}catch(r){if(rt(i),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},V:function(r,t,e,n,o,i,a){var u=Qr();try{return Jr(r,t,e,n,o,i,a)}catch(r){if(rt(u),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},t:function(r){var t=Qr();try{Ir(r)}catch(r){if(rt(t),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},h:function(r,t){var e=Qr();try{Lr(r,t)}catch(r){if(rt(e),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},o:function(r,t,e){var n=Qr();try{Hr(r,t,e)}catch(r){if(rt(n),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},u:function(r,t,e,n){var o=Qr();try{Ur(r,t,e,n)}catch(r){if(rt(o),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},s:function(r,t,e,n,o){var i=Qr();try{Yr(r,t,e,n,o)}catch(r){if(rt(i),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},p:function(r,t,e,n,o,i){var a=Qr();try{Wr(r,t,e,n,o,i)}catch(r){if(rt(a),r!==r+0&&"longjmp"!==r)throw r;zr(1,0)}},memory:h,i:function r(t,e,n,o){e|=0,n|=0,o|=0;var i=0;for(hr=hr+1|0,F[(t|=0)>>2]=hr;(0|i)<(0|o);){if(0==(0|F[n+(i<<3)>>2]))return F[n+(i<<3)>>2]=hr,F[n+(4+(i<<3))>>2]=e,F[n+(8+(i<<3))>>2]=0,y(0|o),0|n;i=i+1|0}return n=0|r(0|t,0|e,0|(n=0|Tr(0|n,8*(1+(o=2*o|0)|0)|0)),0|o),y(0|o),0|n},b:function(r){y(0|r)},F:function(r,t,e,n){return Dr(r,t,e,n)},table:w,c:function(r,t,e){r|=0,t|=0,e|=0;for(var n=0,o=0;(0|n)<(0|e)&&0!=(0|(o=0|F[t+(n<<3)>>2]));){if((0|o)==(0|r))return 0|F[t+(4+(n<<3))>>2];n=n+1|0}return 0},z:function(r){var t=Date.now()/1e3|0;return r&&(F[r>>2]=t),t},A:function(r){return 0!==r&&pr(r,0,16),0}},Pr=function(){var r={a:Fr};function t(r,t){var e=r.exports;n.asm=e,G()}function e(r){t(r.instance)}function o(t){return(!p&&c&&"function"==typeof fetch?fetch(tr,{credentials:"same-origin"}).then((function(r){if(!r.ok)throw"failed to load wasm binary file at '"+tr+"'";return r.arrayBuffer()})).catch((function(){return er()})):new Promise((function(r,t){r(er())}))).then((function(t){return WebAssembly.instantiate(t,r)})).then(t,(function(r){d("failed to asynchronously prepare wasm: "+r),Z(r)}))}if(X(),n.instantiateWasm)try{return n.instantiateWasm(r,t)}catch(r){return d("Module.instantiateWasm callback failed with error: "+r),!1}return function(){if(p||"function"!=typeof WebAssembly.instantiateStreaming||K(tr)||"function"!=typeof fetch)return o(e);fetch(tr,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(r){d("wasm streaming compile failed: "+r),d("falling back to ArrayBuffer instantiation"),o(e)}))}))}(),{}}();n.asm=Pr;var Mr,xr=n.___wasm_call_ctors=function(){return(xr=n.___wasm_call_ctors=n.asm.X).apply(null,arguments)},Ar=n._emscripten_bind_VoidPtr___destroy___0=function(){return(Ar=n._emscripten_bind_VoidPtr___destroy___0=n.asm.Y).apply(null,arguments)},Rr=n._emscripten_bind_Main_layout_3=function(){return(Rr=n._emscripten_bind_Main_layout_3=n.asm.Z).apply(null,arguments)},jr=n._emscripten_bind_Main___destroy___0=function(){return(jr=n._emscripten_bind_Main___destroy___0=n.asm._).apply(null,arguments)},Cr=n._malloc=function(){return(Cr=n._malloc=n.asm.$).apply(null,arguments)},Or=n._free=function(){return(Or=n._free=n.asm.aa).apply(null,arguments)},Tr=(n.___errno_location=function(){return(n.___errno_location=n.asm.ba).apply(null,arguments)},n._realloc=function(){return(Tr=n._realloc=n.asm.ca).apply(null,arguments)}),zr=n._setThrew=function(){return(zr=n._setThrew=n.asm.da).apply(null,arguments)},Br=n.__ZSt18uncaught_exceptionv=function(){return(Br=n.__ZSt18uncaught_exceptionv=n.asm.ea).apply(null,arguments)},Nr=n._memalign=function(){return(Nr=n._memalign=n.asm.fa).apply(null,arguments)},Ir=n.dynCall_v=function(){return(Ir=n.dynCall_v=n.asm.ga).apply(null,arguments)},Lr=n.dynCall_vi=function(){return(Lr=n.dynCall_vi=n.asm.ha).apply(null,arguments)},Hr=n.dynCall_vii=function(){return(Hr=n.dynCall_vii=n.asm.ia).apply(null,arguments)},Ur=n.dynCall_viii=function(){return(Ur=n.dynCall_viii=n.asm.ja).apply(null,arguments)},Yr=n.dynCall_viiii=function(){return(Yr=n.dynCall_viiii=n.asm.ka).apply(null,arguments)},Wr=n.dynCall_viiiii=function(){return(Wr=n.dynCall_viiiii=n.asm.la).apply(null,arguments)},qr=n.dynCall_i=function(){return(qr=n.dynCall_i=n.asm.ma).apply(null,arguments)},Vr=n.dynCall_ii=function(){return(Vr=n.dynCall_ii=n.asm.na).apply(null,arguments)},Xr=n.dynCall_iii=function(){return(Xr=n.dynCall_iii=n.asm.oa).apply(null,arguments)},Gr=n.dynCall_iiii=function(){return(Gr=n.dynCall_iiii=n.asm.pa).apply(null,arguments)},Zr=n.dynCall_iiiii=function(){return(Zr=n.dynCall_iiiii=n.asm.qa).apply(null,arguments)},Jr=n.dynCall_iiiiiii=function(){return(Jr=n.dynCall_iiiiiii=n.asm.ra).apply(null,arguments)},Kr=n.dynCall_d=function(){return(Kr=n.dynCall_d=n.asm.sa).apply(null,arguments)},$r=n.dynCall_di=function(){return($r=n.dynCall_di=n.asm.ta).apply(null,arguments)},Qr=n.stackSave=function(){return(Qr=n.stackSave=n.asm.ua).apply(null,arguments)},rt=(n.stackAlloc=function(){return(n.stackAlloc=n.asm.va).apply(null,arguments)},n.stackRestore=function(){return(rt=n.stackRestore=n.asm.wa).apply(null,arguments)});function tt(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function et(r){function t(){Mr||(Mr=!0,_||(I=!0,n.noFSInit||lr.init.initialized||lr.init(),O(z),lr.ignorePermissions=!1,O(B),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)r=n.postRun.shift(),N.unshift(r);var r;O(N)}()))}W>0||(function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)r=n.preRun.shift(),T.unshift(r);var r;O(T)}(),W>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t()))}if(n.asm=Pr,n.then=function(r){if(Mr)r(n);else{var t=n.onRuntimeInitialized;n.onRuntimeInitialized=function(){t&&t(),r(n)}}return n},V=function r(){Mr||et(),Mr||(V=r)},n.run=et,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();function nt(){}function ot(r){return(r||nt).__cache__}function it(r,t){var e=ot(t),n=e[r];return n||((n=Object.create((t||nt).prototype)).ptr=r,e[r]=n)}m=!0,et(),nt.prototype=Object.create(nt.prototype),nt.prototype.constructor=nt,nt.prototype.__class__=nt,nt.__cache__={},n.WrapperObject=nt,n.getCache=ot,n.wrapPointer=it,n.castObject=function(r,t){return it(r.ptr,t)},n.NULL=it(0),n.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete ot(r.__class__)[r.ptr]},n.compare=function(r,t){return r.ptr===t.ptr},n.getPointer=function(r){return r.ptr},n.getClass=function(r){return r.__class__};var at,ut={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(ut.needed){for(var r=0;r<ut.temps.length;r++)n._free(ut.temps[r]);ut.temps.length=0,n._free(ut.buffer),ut.buffer=0,ut.size+=ut.needed,ut.needed=0}ut.buffer||(ut.size+=128,ut.buffer=n._malloc(ut.size),E(ut.buffer)),ut.pos=0},alloc:function(r,t){E(ut.buffer);var e,o=t.BYTES_PER_ELEMENT,i=r.length*o;return i=i+7&-8,ut.pos+i>=ut.size?(E(i>0),ut.needed+=i,e=n._malloc(i),ut.temps.push(e)):(e=ut.buffer+ut.pos,ut.pos+=i),e},copy:function(r,t,e){var n=e;switch(t.BYTES_PER_ELEMENT){case 2:n>>=1;break;case 4:n>>=2;break;case 8:n>>=3}for(var o=0;o<r.length;o++)t[n+o]=r[o]}};function st(r){if("string"==typeof r){var t=Sr(r),e=ut.alloc(t,b);return ut.copy(t,b,e),e}return r}function ct(){throw"cannot construct a VoidPtr, no constructor in IDL"}function ft(){throw"cannot construct a Main, no constructor in IDL"}return ct.prototype=Object.create(nt.prototype),ct.prototype.constructor=ct,ct.prototype.__class__=ct,ct.__cache__={},n.VoidPtr=ct,ct.prototype.__destroy__=ct.prototype.__destroy__=function(){var r=this.ptr;Ar(r)},ft.prototype=Object.create(nt.prototype),ft.prototype.constructor=ft,ft.prototype.__class__=ft,ft.__cache__={},n.Main=ft,ft.prototype.layout=ft.prototype.layout=function(r,t,e){var n=this.ptr;return ut.prepare(),r=r&&"object"==typeof r?r.ptr:st(r),t=t&&"object"==typeof t?t.ptr:st(t),e=e&&"object"==typeof e?e.ptr:st(e),x(Rr(n,r,t,e))},ft.prototype.__destroy__=ft.prototype.__destroy__=function(){var r=this.ptr;jr(r)},I||(at=function(){},B.unshift(at)),r});r.exports=n})),e=Object.freeze({__proto__:null,default:t,__moduleExports:t}),n=new Function("return this;")().__hpcc_wasmFolder||void 0;function o(r){if(void 0===r)return n;var t=n;return n=r,t}function i(r){var t=r.default||r;return t.__hpcc_promise||(t.__hpcc_promise=new Promise((function(r){t({locateFile:function(r,t){return(o()||t)+(r?"/":"")+r}}).then((function(t){delete t.then,r(t)}))}))),t.__hpcc_promise}var a={layout:function(r,t,n){return void 0===t&&(t="svg"),void 0===n&&(n="dot"),i(e).then((function(e){return e.Main.prototype.layout(r,t,n)}))},circo:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"circo")},dot:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"dot")},fdp:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"fdp")},neato:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"neato")},osage:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"osage")},patchwork:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"patchwork")},twopi:function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"twopi")}},u=function(){function r(r){this._wasm=r}return r.prototype.layout=function(r,t,e){return void 0===t&&(t="svg"),void 0===e&&(e="dot"),this._wasm.Main.prototype.layout(r,t,e)},r.prototype.circo=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"circo")},r.prototype.dot=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"dot")},r.prototype.fdp=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"fdp")},r.prototype.neato=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"neato")},r.prototype.osage=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"osage")},r.prototype.patchwork=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"patchwork")},r.prototype.twopi=function(r,t){return void 0===t&&(t="svg"),this.layout(r,t,"twopi")},r}();r.graphviz=a,r.graphvizSync=function(){return i(e).then((function(r){return new u(r)}))},r.wasmFolder=o,Object.defineProperty(r,"__esModule",{value:!0})})); |
{ | ||
"name": "@hpcc-js/wasm", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "hpcc-js - WASM Libraries", | ||
@@ -24,3 +24,3 @@ "main": "dist/index.js", | ||
"install-graphviz:win32": "wsl -e ./scripts/cpp-install-graphviz.sh", | ||
"install-build-deps": "run-s install-prerequisites install-emsdk install-graphviz", | ||
"install-build-deps": "run-s install-emsdk install-graphviz", | ||
"update-emsdk": "run-script-os", | ||
@@ -27,0 +27,0 @@ "update-emsdk:linux": "./scripts/cpp-update-emsdk.sh", |
157
README.md
# @hpcc-js/wasm | ||
[![Build Status](https://travis-ci.org/hpcc-systems/hpcc-js-wasm.svg?branch=master)](https://travis-ci.org/hpcc-systems/hpcc-js-wasm) | ||
[![Coverage Status](https://coveralls.io/repos/github/hpcc-systems/hpcc-js-wasm/badge.svg?branch=master)](https://coveralls.io/github/hpcc-systems/hpcc-js-wasm?branch=master) | ||
@@ -37,71 +36,18 @@ This repository contains a collection of useful c++ libraries compiled to WASM for (re)use in Web Browsers and JavaScript Libraries. | ||
<a name="wasmFolder" href="#wasmFolder">#</a> <b>wasmFolder</b>([<i>url</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/util.ts) | ||
<a name="wasmFolder" href="#wasmFolder">#</a> **wasmFolder**([_url_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/util.ts "Source") | ||
If _url_ is specified, sets the default location for all WASM files. If _url_ is not specified it returns the current _url_ (defaults to `undefined`). | ||
<a name="__hpcc_wasmFolder" href="#__hpcc_wasmFolder">#</a> <b>__hpcc_wasmFolder</b> · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/util.ts) | ||
<a name="__hpcc_wasmFolder" href="#__hpcc_wasmFolder">#</a> **__hpcc_wasmFolder** · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/util.ts "Source") | ||
Global variable for setting default WASM location, this is an alternative to [wasmFolder](#wasmFolder) | ||
### GraphViz (namespace `graphviz`) | ||
GraphViz WASM library, see [graphviz.org](https://www.graphviz.org/) for c++ details. | ||
### GraphViz (`graphvizlib.wasm`) | ||
GraphViz WASM library, see [graphviz.org](https://www.graphviz.org/) for c++ details. While this package is similar to [Viz.js](https://github.com/mdaines/viz.js), it employs a completely different build methodology taken from [GraphControl](https://github.com/hpcc-systems/GraphControl). | ||
**Note**: While this package is similar to [Viz.js](https://github.com/mdaines/viz.js), it employs a completely different build methodology taken from [GraphControl](https://github.com/hpcc-systems/GraphControl). | ||
The _GraphViz_ library comes in **two** flavours | ||
* An exported `graphviz` namespace, where each API function is **asynchrounous** and returns a `Promise<string>`. | ||
* A `graphvizSync` **asynchrounous** function which returns a `Promise<GraphvizSync>` which is a mirror instance of `graphviz`, where each API function is **synchrounous** and returns a `string`. | ||
**Note 2**: All API functions are namespaced in `graphviz`. | ||
<a name="layout" href="#layout">#</a> <b>layout</b>(<i>dotSource</i>[, <i>outputFormat</i>][, <i>layoutEngine</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Performs layout for the supplied _dotSource_, see [The DOT Language](https://graphviz.gitlab.io/_pages/doc/info/lang.html) for specification. | ||
_outputFormat_ supports the following options: | ||
* dot | ||
* dot_json | ||
* json | ||
* svg (default) | ||
* xdot_json | ||
See [Output Formats](https://graphviz.gitlab.io/_pages/doc/info/output.html) for more information. | ||
_layoutEngine_ supports the following options: | ||
* circo | ||
* dot (default) | ||
* fdp | ||
* neato | ||
* osage | ||
* patchwork | ||
* twopi | ||
See [Layout manual pages](https://www.graphviz.org/documentation/) for more information. | ||
<a name="circo" href="#circo">#</a> <b>circo</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **circo** layout, is equivalent to `layout(dotSource, outputFormat, "circo");` | ||
<a name="dot" href="#dot">#</a> <b>dot</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **dot** layout, is equivalent to `layout(dotSource, outputFormat, "dot");` | ||
<a name="fdp" href="#fdp">#</a> <b>fdp</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **circo** layout, is equivalent to `layout(dotSource, outputFormat, "fdp");` | ||
<a name="neato" href="#neato">#</a> <b>neato</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **neato** layout, is equivalent to `layout(dotSource, outputFormat, "neato");` | ||
<a name="osage" href="#osage">#</a> <b>osage</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **osage** layout, is equivalent to `layout(dotSource, outputFormat, "osage");` | ||
<a name="patchwork" href="#patchwork">#</a> <b>patchwork</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **patchwork** layout, is equivalent to `layout(dotSource, outputFormat, "patchwork");` | ||
<a name="twopi" href="#twopi">#</a> <b>twopi</b>(<i>dotSource</i>[, <i>outputFormat</i>]) · [Source](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts) | ||
Convenience function that performs **twopi** layout, is equivalent to `layout(dotSource, outputFormat, "twopi");` | ||
## Quick Example (CDN hosting courtesy of [unpkg.com](https://unpkg.com)) | ||
#### Hello World | ||
```html | ||
@@ -122,2 +68,3 @@ <!DOCTYPE html> | ||
<div id="placeholder"></div> | ||
<div id="placeholder2"></div> | ||
<script> | ||
@@ -133,3 +80,3 @@ const dot = ` | ||
a0 -> a1 -> a2 -> a3; | ||
label = "process #1"; | ||
label = "Hello"; | ||
} | ||
@@ -140,3 +87,3 @@ | ||
b0 -> b1 -> b2 -> b3; | ||
label = "process #2"; | ||
label = "World"; | ||
color=blue | ||
@@ -158,2 +105,3 @@ } | ||
// Asynchronous call to layout | ||
hpccWasm.graphviz.layout(dot, "svg", "dot").then(svg => { | ||
@@ -163,2 +111,8 @@ const div = document.getElementById("placeholder"); | ||
}); | ||
hpccWasm.graphvizSync().then(graphviz => { | ||
const div = document.getElementById("placeholder2"); | ||
// Synchronous call to layout | ||
div.innerHTML = graphviz.layout(dot, "svg", "dot"); | ||
}); | ||
</script> | ||
@@ -170,1 +124,76 @@ | ||
``` | ||
#### GraphViz API | ||
<a name="layout" href="#layout">#</a> **layout**(_dotSource_[, _outputFormat_][, _layoutEngine_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Performs layout for the supplied _dotSource_, see [The DOT Language](https://graphviz.gitlab.io/_pages/doc/info/lang.html) for specification. | ||
_outputFormat_ supports the following options: | ||
* dot | ||
* dot_json | ||
* json | ||
* svg (default) | ||
* xdot_json | ||
See [Output Formats](https://graphviz.gitlab.io/_pages/doc/info/output.html) for more information. | ||
_layoutEngine_ supports the following options: | ||
* circo | ||
* dot (default) | ||
* fdp | ||
* neato | ||
* osage | ||
* patchwork | ||
* twopi | ||
See [Layout manual pages](https://www.graphviz.org/documentation/) for more information. | ||
<a name="circo" href="#circo">#</a> **circo**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **circo** layout, is equivalent to `layout(dotSource, outputFormat, "circo");`. | ||
<a name="dot" href="#dot">#</a> **dot**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **dot** layout, is equivalent to `layout(dotSource, outputFormat, "dot");`. | ||
<a name="fdp" href="#fdp">#</a> **fdp**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **circo** layout, is equivalent to `layout(dotSource, outputFormat, "fdp");`. | ||
<a name="neato" href="#neato">#</a> **neato**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **neato** layout, is equivalent to `layout(dotSource, outputFormat, "neato");`. | ||
<a name="osage" href="#osage">#</a> **osage**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **osage** layout, is equivalent to `layout(dotSource, outputFormat, "osage");`. | ||
<a name="patchwork" href="#patchwork">#</a> **patchwork**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **patchwork** layout, is equivalent to `layout(dotSource, outputFormat, "patchwork");`. | ||
<a name="twopi" href="#twopi">#</a> **twopi**(_dotSource_[, _outputFormat_]) · [<>](https://github.com/hpcc-systems/hpcc-js-wasm/blob/master/src/graphviz.ts "Source") | ||
Convenience function that performs **twopi** layout, is equivalent to `layout(dotSource, outputFormat, "twopi");`. | ||
## Building @hpcc-js/wasm | ||
_Building is supported on both Linux (tested with Ubuntu 18.04) and Windows (with WSL installed)_ | ||
There are several required OS dependencies which can be installed with: | ||
``` | ||
sudo ./scripts/cpp-install-prerequisites.sh | ||
``` | ||
(See [./scripts/cpp-install-prerequisites.sh](./scripts/cpp-install-prerequisites.sh) for details) | ||
### Build steps: | ||
``` | ||
git clone https://github.com/hpcc-systems/hpcc-js-wasm.git | ||
cd hpcc-js-wasm | ||
npm ci | ||
npm run install-build-deps | ||
npm run build | ||
``` | ||
**Note**: The `install-build-deps` downloads both the Emscripten SDK and the GraphViz sources. This has been made a manual step as the downloads are quite large and the auto-configuration can be time consuming. | ||
@@ -13,3 +13,16 @@ declare type Format = "svg" | "dot" | "json" | "dot_json" | "xdot_json"; | ||
}; | ||
declare class GraphvizSync { | ||
private _wasm; | ||
constructor(_wasm: any); | ||
layout(dotSource: string, outputFormat?: Format, layoutEngine?: Engine): string; | ||
circo(dotSource: string, outputFormat?: Format): string; | ||
dot(dotSource: string, outputFormat?: Format): string; | ||
fdp(dotSource: string, outputFormat?: Format): string; | ||
neato(dotSource: string, outputFormat?: Format): string; | ||
osage(dotSource: string, outputFormat?: Format): string; | ||
patchwork(dotSource: string, outputFormat?: Format): string; | ||
twopi(dotSource: string, outputFormat?: Format): string; | ||
} | ||
export declare function graphvizSync(): Promise<GraphvizSync>; | ||
export {}; | ||
//# sourceMappingURL=graphviz.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1874699
1009
193