@werckmeister/components 1.1.10-dev-87 → 1.1.10-dev-88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/werckmeister-components.js +1 -1
- package/werckmeister.js +1 -1
- package/werckmeister.wasm +0 -0
|
@@ -485,7 +485,7 @@ var process = require("process");
|
|
|
485
485
|
var __dirname = "/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs";
|
|
486
486
|
var Buffer = require("buffer").Buffer;
|
|
487
487
|
var define;
|
|
488
|
-
var t,r="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs/werckmeister.js",e=require("process"),n="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs",o=require("buffer").Buffer,i=function(){var t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return void 0!==r&&(t=t||r),function(r){var i,a,u=void 0!==(r=r||{})?r:{};u.ready=new Promise(function(t,r){i=t,a=r});var s,c={};for(s in u)u.hasOwnProperty(s)&&(c[s]=u[s]);var f,l,d,h,p,m=[],g="./this.program",v=function(t,r){throw r},w="object"==typeof window,y="function"==typeof importScripts,_="object"==typeof e&&"object"==typeof e.versions&&"string"==typeof e.versions.node,E="";_?(E=y?require("path").dirname(E)+"/":n+"/",f=function(t,r){return h||(h=require("fs")),p||(p=require("path")),t=p.normalize(t),h.readFileSync(t,r?null:"utf8")},d=function(t){var r=f(t,!0);return r.buffer||(r=new Uint8Array(r)),x(r.buffer),r},l=function(t,r,e){h||(h=require("fs")),p||(p=require("path")),t=p.normalize(t),h.readFile(t,function(t,n){t?e(t):r(n.buffer)})},e.argv.length>1&&(g=e.argv[1].replace(/\\/g,"/")),m=e.argv.slice(2),e.on("uncaughtException",function(t){if(!(t instanceof Er))throw t}),e.on("unhandledRejection",st),v=function(t,r){if(rt())throw e.exitCode=t,r;e.exit(t)},u.inspect=function(){return"[Emscripten Module object]"}):(w||y)&&(y?E=self.location.href:"undefined"!=typeof document&&document.currentScript&&(E=document.currentScript.src),t&&(E=t),E=0!==E.indexOf("blob:")?E.substr(0,E.lastIndexOf("/")+1):"",f=function(t){var r=new XMLHttpRequest;return r.open("GET",t,!1),r.send(null),r.responseText},y&&(d=function(t){var r=new XMLHttpRequest;return r.open("GET",t,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),l=function(t,r,e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?r(n.response):e()},n.onerror=e,n.send(null)});var k=u.print||console.log.bind(console),b=u.printErr||console.warn.bind(console);for(s in c)c.hasOwnProperty(s)&&(u[s]=c[s]);c=null,u.arguments&&(m=u.arguments),u.thisProgram&&(g=u.thisProgram),u.quit&&(v=u.quit);var D,j=0,S=function(t){j=t},F=function(){return j};u.wasmBinary&&(D=u.wasmBinary);var M,P=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&st("no native wasm support detected");var A,T=!1;function x(t,r){t||st("Assertion failed: "+r)}function R(t){var r=u["_"+t];return x(r,"Cannot call unknown function "+t+", make sure it is exported"),r}function C(t,r,e,n,o){var i={string:function(t){var r=0;if(null!=t&&0!==t){var e=1+(t.length<<2);q(t,r=rr(e),e)}return r},array:function(t){var r=rr(t.length);return V(t,r),r}};var a=R(t),u=[],s=0;if(n)for(var c=0;c<n.length;c++){var f=i[e[c]];f?(0===s&&(s=Qt()),u[c]=f(n[c])):u[c]=n[c]}var l=a.apply(null,u);return l=function(t){return 0!==s&&tr(s),function(t){return"string"===r?H(t):"boolean"===r?Boolean(t):t}(t)}(l)}var z,O,B,N,I,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(t,r,e){for(var n=r+e,o=r;t[o]&&!(o>=n);)++o;if(o-r>16&&t.subarray&&U)return U.decode(t.subarray(r,o));for(var i="";r<o;){var a=t[r++];if(128&a){var u=63&t[r++];if(192!=(224&a)){var s=63&t[r++];if((a=224==(240&a)?(15&a)<<12|u<<6|s:(7&a)<<18|u<<12|s<<6|63&t[r++])<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 H(t,r){return t?L(B,t,r):""}function Y(t,r,e,n){if(!(n>0))return 0;for(var o=e,i=e+n-1,a=0;a<t.length;++a){var u=t.charCodeAt(a);if(u>=55296&&u<=57343)u=65536+((1023&u)<<10)|1023&t.charCodeAt(++a);if(u<=127){if(e>=i)break;r[e++]=u}else if(u<=2047){if(e+1>=i)break;r[e++]=192|u>>6,r[e++]=128|63&u}else if(u<=65535){if(e+2>=i)break;r[e++]=224|u>>12,r[e++]=128|u>>6&63,r[e++]=128|63&u}else{if(e+3>=i)break;r[e++]=240|u>>18,r[e++]=128|u>>12&63,r[e++]=128|u>>6&63,r[e++]=128|63&u}}return r[e]=0,e-o}function q(t,r,e){return Y(t,B,r,e)}function W(t){for(var r=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++e)),n<=127?++r:r+=n<=2047?2:n<=65535?3:4}return r}function G(t){var r=W(t)+1,e=Vt(r);return e&&Y(t,O,e,r),e}function X(t){var r=W(t)+1,e=rr(r);return Y(t,O,e,r),e}function V(t,r){O.set(t,r)}u.INITIAL_MEMORY;var K,J=[],$=[],Z=[],Q=[],tt=0;function rt(){return P||tt>0}var et=0,nt=null,ot=null;function it(t){return t}function at(t){et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)}function ut(t){if(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),ot)){var r=ot;ot=null,r()}}function st(t){u.onAbort&&u.onAbort(t),b(t+=""),T=!0,A=1,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(t);throw a(r),r}u.preloadedImages={},u.preloadedAudios={};var ct,ft,lt,dt,ht,pt="data:application/octet-stream;base64,";function mt(t){return t.startsWith(pt)}function gt(t){return t.startsWith("file://")}function vt(t){try{if(t==ct&&D)return new Uint8Array(D);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(b){st(b)}}function wt(t){for(;t.length>0;){var r=t.shift();if("function"!=typeof r){var e=r.func;"number"==typeof e?void 0===r.arg?K.get(e)():K.get(e)(r.arg):e(void 0===r.arg?null:r.arg)}else r(u)}}mt(ct="werckmeister.wasm")||(ft=ct,ct=u.locateFile?u.locateFile(ft,E):E+ft),ht=_?function(){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}:function(){return performance.now()};var yt=!0;function _t(t){return I[Kt()>>2]=t,t}function Et(t){this.excPtr=t,this.ptr=t-16,this.set_type=function(t){I[this.ptr+4>>2]=t},this.get_type=function(){return I[this.ptr+4>>2]},this.set_destructor=function(t){I[this.ptr+8>>2]=t},this.get_destructor=function(){return I[this.ptr+8>>2]},this.set_refcount=function(t){I[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,O[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=O[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,O[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=O[this.ptr+13>>0]},this.init=function(t,r){this.set_type(t),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=I[this.ptr>>2];I[this.ptr>>2]=t+1},this.release_ref=function(){var t=I[this.ptr>>2];return I[this.ptr>>2]=t-1,1===t}}function kt(t){this.free=function(){Xt(this.ptr),this.ptr=0},this.set_base_ptr=function(t){I[this.ptr>>2]=t},this.get_base_ptr=function(){return I[this.ptr>>2]},this.set_adjusted_ptr=function(t){I[this.ptr+4>>2]=t},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return I[this.ptr+4>>2]},this.get_exception_ptr=function(){if(or(this.get_exception_info().get_type()))return I[this.get_base_ptr()>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.get_base_ptr()},this.get_exception_info=function(){return new Et(this.get_base_ptr())},void 0===t?(this.ptr=Vt(8),this.set_adjusted_ptr(0)):this.ptr=t}var bt=[];var Dt=0;var jt=0;function St(t){try{return Xt(new Et(t).ptr)}catch(r){}}function Ft(t,r){var e=new Date(1e3*I[t>>2]);I[r>>2]=e.getUTCSeconds(),I[r+4>>2]=e.getUTCMinutes(),I[r+8>>2]=e.getUTCHours(),I[r+12>>2]=e.getUTCDate(),I[r+16>>2]=e.getUTCMonth(),I[r+20>>2]=e.getUTCFullYear()-1900,I[r+24>>2]=e.getUTCDay(),I[r+36>>2]=0,I[r+32>>2]=0;var n=Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0),o=(e.getTime()-n)/864e5|0;return I[r+28>>2]=o,Ft.GMTString||(Ft.GMTString=G("GMT")),I[r+40>>2]=Ft.GMTString,r}function Mt(){Mt.called||(Mt.called=!0,function(){var t=(new Date).getFullYear(),r=new Date(t,0,1),e=new Date(t,6,1),n=r.getTimezoneOffset(),o=e.getTimezoneOffset(),i=Math.max(n,o);function a(t){var r=t.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}I[Zt()>>2]=60*i,I[$t()>>2]=Number(n!=o);var u=a(r),s=a(e),c=G(u),f=G(s);o<n?(I[Jt()>>2]=c,I[Jt()+4>>2]=f):(I[Jt()>>2]=f,I[Jt()+4>>2]=c)}())}var Pt={splitPath:function(t){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1)},normalizeArray:function(t,r){for(var e=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),e++):e&&(t.splice(n,1),e--)}if(r)for(;e;e--)t.unshift("..");return t},normalize:function(t){var r="/"===t.charAt(0),e="/"===t.substr(-1);return(t=Pt.normalizeArray(t.split("/").filter(function(t){return!!t}),!r).join("/"))||r||(t="."),t&&e&&(t+="/"),(r?"/":"")+t},dirname:function(t){var r=Pt.splitPath(t),e=r[0],n=r[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:function(t){if("/"===t)return"/";var r=(t=(t=Pt.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?t:t.substr(r+1)},extname:function(t){return Pt.splitPath(t)[3]},join:function(){var t=Array.prototype.slice.call(arguments,0);return Pt.normalize(t.join("/"))},join2:function(t,r){return Pt.normalize(t+"/"+r)}};var At={resolve:function(){for(var t="",r=!1,e=arguments.length-1;e>=-1&&!r;e--){var n=e>=0?arguments[e]:Rt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,r="/"===n.charAt(0)}return(r?"/":"")+(t=Pt.normalizeArray(t.split("/").filter(function(t){return!!t}),!r).join("/"))||"."},relative:function(t,r){function e(t){for(var r=0;r<t.length&&""===t[r];r++);for(var e=t.length-1;e>=0&&""===t[e];e--);return r>e?[]:t.slice(r,e-r+1)}t=At.resolve(t).substr(1),r=At.resolve(r).substr(1);for(var n=e(t.split("/")),o=e(r.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("/")}},Tt={ttys:[],init:function(){},shutdown:function(){},register:function(t,r){Tt.ttys[t]={input:[],output:[],ops:r},Rt.registerDevice(t,Tt.stream_ops)},stream_ops:{open:function(t){var r=Tt.ttys[t.node.rdev];if(!r)throw new Rt.ErrnoError(43);t.tty=r,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,r,e,n,o){if(!t.tty||!t.tty.ops.get_char)throw new Rt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var u;try{u=t.tty.ops.get_char(t.tty)}catch(s){throw new Rt.ErrnoError(29)}if(void 0===u&&0===i)throw new Rt.ErrnoError(6);if(null==u)break;i++,r[e+a]=u}return i&&(t.node.timestamp=Date.now()),i},write:function(t,r,e,n,o){if(!t.tty||!t.tty.ops.put_char)throw new Rt.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,r[e+i])}catch(a){throw new Rt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var r=null;if(_){var n=o.alloc(256),i=0;try{i=h.readSync(e.stdin.fd,n,0,256,null)}catch(a){if(!a.toString().includes("EOF"))throw a;i=0}r=i>0?n.slice(0,i).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(r=window.prompt("Input: "))&&(r+="\n"):"function"==typeof readline&&null!==(r=readline())&&(r+="\n");if(!r)return null;t.input=qt(r,!0)}return t.input.shift()},put_char:function(t,r){null===r||10===r?(k(L(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},flush:function(t){t.output&&t.output.length>0&&(k(L(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,r){null===r||10===r?(b(L(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},flush:function(t){t.output&&t.output.length>0&&(b(L(t.output,0)),t.output=[])}}};var xt={ops_table:null,mount:function(t){return xt.createNode(null,"/",16895,0)},createNode:function(t,r,e,n){if(Rt.isBlkdev(e)||Rt.isFIFO(e))throw new Rt.ErrnoError(63);xt.ops_table||(xt.ops_table={dir:{node:{getattr:xt.node_ops.getattr,setattr:xt.node_ops.setattr,lookup:xt.node_ops.lookup,mknod:xt.node_ops.mknod,rename:xt.node_ops.rename,unlink:xt.node_ops.unlink,rmdir:xt.node_ops.rmdir,readdir:xt.node_ops.readdir,symlink:xt.node_ops.symlink},stream:{llseek:xt.stream_ops.llseek}},file:{node:{getattr:xt.node_ops.getattr,setattr:xt.node_ops.setattr},stream:{llseek:xt.stream_ops.llseek,read:xt.stream_ops.read,write:xt.stream_ops.write,allocate:xt.stream_ops.allocate,mmap:xt.stream_ops.mmap,msync:xt.stream_ops.msync}},link:{node:{getattr:xt.node_ops.getattr,setattr:xt.node_ops.setattr,readlink:xt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:xt.node_ops.getattr,setattr:xt.node_ops.setattr},stream:Rt.chrdev_stream_ops}});var o=Rt.createNode(t,r,e,n);return Rt.isDir(o.mode)?(o.node_ops=xt.ops_table.dir.node,o.stream_ops=xt.ops_table.dir.stream,o.contents={}):Rt.isFile(o.mode)?(o.node_ops=xt.ops_table.file.node,o.stream_ops=xt.ops_table.file.stream,o.usedBytes=0,o.contents=null):Rt.isLink(o.mode)?(o.node_ops=xt.ops_table.link.node,o.stream_ops=xt.ops_table.link.stream):Rt.isChrdev(o.mode)&&(o.node_ops=xt.ops_table.chrdev.node,o.stream_ops=xt.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[r]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,r){var e=t.contents?t.contents.length:0;if(!(e>=r)){r=Math.max(r,e*(e<1048576?2:1.125)>>>0),0!=e&&(r=Math.max(r,256));var n=t.contents;t.contents=new Uint8Array(r),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,r){if(t.usedBytes!=r)if(0==r)t.contents=null,t.usedBytes=0;else{var e=t.contents;t.contents=new Uint8Array(r),e&&t.contents.set(e.subarray(0,Math.min(r,t.usedBytes))),t.usedBytes=r}},node_ops:{getattr:function(t){var r={};return r.dev=Rt.isChrdev(t.mode)?t.id:1,r.ino=t.id,r.mode=t.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=t.rdev,Rt.isDir(t.mode)?r.size=4096:Rt.isFile(t.mode)?r.size=t.usedBytes:Rt.isLink(t.mode)?r.size=t.link.length:r.size=0,r.atime=new Date(t.timestamp),r.mtime=new Date(t.timestamp),r.ctime=new Date(t.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(t,r){void 0!==r.mode&&(t.mode=r.mode),void 0!==r.timestamp&&(t.timestamp=r.timestamp),void 0!==r.size&&xt.resizeFileStorage(t,r.size)},lookup:function(t,r){throw Rt.genericErrors[44]},mknod:function(t,r,e,n){return xt.createNode(t,r,e,n)},rename:function(t,r,e){if(Rt.isDir(t.mode)){var n;try{n=Rt.lookupNode(r,e)}catch(i){}if(n)for(var o in n.contents)throw new Rt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=e,r.contents[e]=t,r.timestamp=t.parent.timestamp,t.parent=r},unlink:function(t,r){delete t.contents[r],t.timestamp=Date.now()},rmdir:function(t,r){var e=Rt.lookupNode(t,r);for(var n in e.contents)throw new Rt.ErrnoError(55);delete t.contents[r],t.timestamp=Date.now()},readdir:function(t){var r=[".",".."];for(var e in t.contents)t.contents.hasOwnProperty(e)&&r.push(e);return r},symlink:function(t,r,e){var n=xt.createNode(t,r,41471,0);return n.link=e,n},readlink:function(t){if(!Rt.isLink(t.mode))throw new Rt.ErrnoError(28);return t.link}},stream_ops:{read:function(t,r,e,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)r.set(i.subarray(o,o+a),e);else for(var u=0;u<a;u++)r[e+u]=i[o+u];return a},write:function(t,r,e,n,o,i){if(!n)return 0;var a=t.node;if(a.timestamp=Date.now(),r.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=r.subarray(e,e+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=r.slice(e,e+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(r.subarray(e,e+n),o),n}if(xt.expandFileStorage(a,o+n),a.contents.subarray&&r.subarray)a.contents.set(r.subarray(e,e+n),o);else for(var u=0;u<n;u++)a.contents[o+u]=r[e+u];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,r,e){var n=r;if(1===e?n+=t.position:2===e&&Rt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new Rt.ErrnoError(28);return n},allocate:function(t,r,e){xt.expandFileStorage(t.node,r+e),t.node.usedBytes=Math.max(t.node.usedBytes,r+e)},mmap:function(t,r,e,n,o,i){if(0!==r)throw new Rt.ErrnoError(28);if(!Rt.isFile(t.node.mode))throw new Rt.ErrnoError(43);var a,u,s=t.node.contents;if(2&i||s.buffer!==z){if((n>0||n+e<s.length)&&(s=s.subarray?s.subarray(n,n+e):Array.prototype.slice.call(s,n,n+e)),u=!0,!(a=void st()))throw new Rt.ErrnoError(48);O.set(s,a)}else u=!1,a=s.byteOffset;return{ptr:a,allocated:u}},msync:function(t,r,e,n,o){if(!Rt.isFile(t.node.mode))throw new Rt.ErrnoError(43);if(2&o)return 0;xt.stream_ops.write(t,r,0,n,e,!1);return 0}}};var Rt={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,lookupPath:function(t,r){if(r=r||{},!(t=At.resolve(Rt.cwd(),t)))return{path:"",node:null};var e={follow_mount:!0,recurse_count:0};for(var n in e)void 0===r[n]&&(r[n]=e[n]);if(r.recurse_count>8)throw new Rt.ErrnoError(32);for(var o=Pt.normalizeArray(t.split("/").filter(function(t){return!!t}),!1),i=Rt.root,a="/",u=0;u<o.length;u++){var s=u===o.length-1;if(s&&r.parent)break;if(i=Rt.lookupNode(i,o[u]),a=Pt.join2(a,o[u]),Rt.isMountpoint(i)&&(!s||s&&r.follow_mount)&&(i=i.mounted.root),!s||r.follow)for(var c=0;Rt.isLink(i.mode);){var f=Rt.readlink(a);if(a=At.resolve(Pt.dirname(a),f),i=Rt.lookupPath(a,{recurse_count:r.recurse_count}).node,c++>40)throw new Rt.ErrnoError(32)}}return{path:a,node:i}},getPath:function(t){for(var r;;){if(Rt.isRoot(t)){var e=t.mount.mountpoint;return r?"/"!==e[e.length-1]?e+"/"+r:e+r:e}r=r?t.name+"/"+r:t.name,t=t.parent}},hashName:function(t,r){for(var e=0,n=0;n<r.length;n++)e=(e<<5)-e+r.charCodeAt(n)|0;return(t+e>>>0)%Rt.nameTable.length},hashAddNode:function(t){var r=Rt.hashName(t.parent.id,t.name);t.name_next=Rt.nameTable[r],Rt.nameTable[r]=t},hashRemoveNode:function(t){var r=Rt.hashName(t.parent.id,t.name);if(Rt.nameTable[r]===t)Rt.nameTable[r]=t.name_next;else for(var e=Rt.nameTable[r];e;){if(e.name_next===t){e.name_next=t.name_next;break}e=e.name_next}},lookupNode:function(t,r){var e=Rt.mayLookup(t);if(e)throw new Rt.ErrnoError(e,t);for(var n=Rt.hashName(t.id,r),o=Rt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===r)return o}return Rt.lookup(t,r)},createNode:function(t,r,e,n){var o=new Rt.FSNode(t,r,e,n);return Rt.hashAddNode(o),o},destroyNode:function(t){Rt.hashRemoveNode(t)},isRoot:function(t){return t===t.parent},isMountpoint:function(t){return!!t.mounted},isFile:function(t){return 32768==(61440&t)},isDir:function(t){return 16384==(61440&t)},isLink:function(t){return 40960==(61440&t)},isChrdev:function(t){return 8192==(61440&t)},isBlkdev:function(t){return 24576==(61440&t)},isFIFO:function(t){return 4096==(61440&t)},isSocket:function(t){return 49152==(49152&t)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(t){var r=Rt.flagModes[t];if(void 0===r)throw new Error("Unknown file open mode: "+t);return r},flagsToPermissionString:function(t){var r=["r","w","rw"][3&t];return 512&t&&(r+="w"),r},nodePermissions:function(t,r){return Rt.ignorePermissions?0:(!r.includes("r")||292&t.mode)&&(!r.includes("w")||146&t.mode)&&(!r.includes("x")||73&t.mode)?0:2},mayLookup:function(t){var r=Rt.nodePermissions(t,"x");return r||(t.node_ops.lookup?0:2)},mayCreate:function(t,r){try{Rt.lookupNode(t,r);return 20}catch(e){}return Rt.nodePermissions(t,"wx")},mayDelete:function(t,r,e){var n;try{n=Rt.lookupNode(t,r)}catch(i){return i.errno}var o=Rt.nodePermissions(t,"wx");if(o)return o;if(e){if(!Rt.isDir(n.mode))return 54;if(Rt.isRoot(n)||Rt.getPath(n)===Rt.cwd())return 10}else if(Rt.isDir(n.mode))return 31;return 0},mayOpen:function(t,r){return t?Rt.isLink(t.mode)?32:Rt.isDir(t.mode)&&("r"!==Rt.flagsToPermissionString(r)||512&r)?31:Rt.nodePermissions(t,Rt.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(t,r){t=t||0,r=r||Rt.MAX_OPEN_FDS;for(var e=t;e<=r;e++)if(!Rt.streams[e])return e;throw new Rt.ErrnoError(33)},getStream:function(t){return Rt.streams[t]},createStream:function(t,r,e){Rt.FSStream||(Rt.FSStream=function(){},Rt.FSStream.prototype={object:{get:function(){return this.node},set:function(t){this.node=t}},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 Rt.FSStream;for(var o in t)n[o]=t[o];t=n;var i=Rt.nextfd(r,e);return t.fd=i,Rt.streams[i]=t,t},closeStream:function(t){Rt.streams[t]=null},chrdev_stream_ops:{open:function(t){var r=Rt.getDevice(t.node.rdev);t.stream_ops=r.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:function(){throw new Rt.ErrnoError(70)}},major:function(t){return t>>8},minor:function(t){return 255&t},makedev:function(t,r){return t<<8|r},registerDevice:function(t,r){Rt.devices[t]={stream_ops:r}},getDevice:function(t){return Rt.devices[t]},getMounts:function(t){for(var r=[],e=[t];e.length;){var n=e.pop();r.push(n),e.push.apply(e,n.mounts)}return r},syncfs:function(t,r){"function"==typeof t&&(r=t,t=!1),Rt.syncFSRequests++,Rt.syncFSRequests>1&&b("warning: "+Rt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=Rt.getMounts(Rt.root.mount),n=0;function o(t){return Rt.syncFSRequests--,r(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=e.length&&o(null)}e.forEach(function(r){if(!r.type.syncfs)return i(null);r.type.syncfs(r,t,i)})},mount:function(t,r,e){var n,o="/"===e,i=!e;if(o&&Rt.root)throw new Rt.ErrnoError(10);if(!o&&!i){var a=Rt.lookupPath(e,{follow_mount:!1});if(e=a.path,n=a.node,Rt.isMountpoint(n))throw new Rt.ErrnoError(10);if(!Rt.isDir(n.mode))throw new Rt.ErrnoError(54)}var u={type:t,opts:r,mountpoint:e,mounts:[]},s=t.mount(u);return s.mount=u,u.root=s,o?Rt.root=s:n&&(n.mounted=u,n.mount&&n.mount.mounts.push(u)),s},unmount:function(t){var r=Rt.lookupPath(t,{follow_mount:!1});if(!Rt.isMountpoint(r.node))throw new Rt.ErrnoError(28);var e=r.node,n=e.mounted,o=Rt.getMounts(n);Object.keys(Rt.nameTable).forEach(function(t){for(var r=Rt.nameTable[t];r;){var e=r.name_next;o.includes(r.mount)&&Rt.destroyNode(r),r=e}}),e.mounted=null;var i=e.mount.mounts.indexOf(n);e.mount.mounts.splice(i,1)},lookup:function(t,r){return t.node_ops.lookup(t,r)},mknod:function(t,r,e){var n=Rt.lookupPath(t,{parent:!0}).node,o=Pt.basename(t);if(!o||"."===o||".."===o)throw new Rt.ErrnoError(28);var i=Rt.mayCreate(n,o);if(i)throw new Rt.ErrnoError(i);if(!n.node_ops.mknod)throw new Rt.ErrnoError(63);return n.node_ops.mknod(n,o,r,e)},create:function(t,r){return r=void 0!==r?r:438,r&=4095,r|=32768,Rt.mknod(t,r,0)},mkdir:function(t,r){return r=void 0!==r?r:511,r&=1023,r|=16384,Rt.mknod(t,r,0)},mkdirTree:function(t,r){for(var e=t.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{Rt.mkdir(n,r)}catch(i){if(20!=i.errno)throw i}}},mkdev:function(t,r,e){return void 0===e&&(e=r,r=438),r|=8192,Rt.mknod(t,r,e)},symlink:function(t,r){if(!At.resolve(t))throw new Rt.ErrnoError(44);var e=Rt.lookupPath(r,{parent:!0}).node;if(!e)throw new Rt.ErrnoError(44);var n=Pt.basename(r),o=Rt.mayCreate(e,n);if(o)throw new Rt.ErrnoError(o);if(!e.node_ops.symlink)throw new Rt.ErrnoError(63);return e.node_ops.symlink(e,n,t)},rename:function(t,r){var e,n,o=Pt.dirname(t),i=Pt.dirname(r),a=Pt.basename(t),u=Pt.basename(r);if(e=Rt.lookupPath(t,{parent:!0}).node,n=Rt.lookupPath(r,{parent:!0}).node,!e||!n)throw new Rt.ErrnoError(44);if(e.mount!==n.mount)throw new Rt.ErrnoError(75);var s,c=Rt.lookupNode(e,a),f=At.relative(t,i);if("."!==f.charAt(0))throw new Rt.ErrnoError(28);if("."!==(f=At.relative(r,o)).charAt(0))throw new Rt.ErrnoError(55);try{s=Rt.lookupNode(n,u)}catch(h){}if(c!==s){var l=Rt.isDir(c.mode),d=Rt.mayDelete(e,a,l);if(d)throw new Rt.ErrnoError(d);if(d=s?Rt.mayDelete(n,u,l):Rt.mayCreate(n,u))throw new Rt.ErrnoError(d);if(!e.node_ops.rename)throw new Rt.ErrnoError(63);if(Rt.isMountpoint(c)||s&&Rt.isMountpoint(s))throw new Rt.ErrnoError(10);if(n!==e&&(d=Rt.nodePermissions(e,"w")))throw new Rt.ErrnoError(d);try{Rt.trackingDelegate.willMovePath&&Rt.trackingDelegate.willMovePath(t,r)}catch(h){b("FS.trackingDelegate['willMovePath']('"+t+"', '"+r+"') threw an exception: "+h.message)}Rt.hashRemoveNode(c);try{e.node_ops.rename(c,n,u)}catch(h){throw h}finally{Rt.hashAddNode(c)}try{Rt.trackingDelegate.onMovePath&&Rt.trackingDelegate.onMovePath(t,r)}catch(h){b("FS.trackingDelegate['onMovePath']('"+t+"', '"+r+"') threw an exception: "+h.message)}}},rmdir:function(t){var r=Rt.lookupPath(t,{parent:!0}).node,e=Pt.basename(t),n=Rt.lookupNode(r,e),o=Rt.mayDelete(r,e,!0);if(o)throw new Rt.ErrnoError(o);if(!r.node_ops.rmdir)throw new Rt.ErrnoError(63);if(Rt.isMountpoint(n))throw new Rt.ErrnoError(10);try{Rt.trackingDelegate.willDeletePath&&Rt.trackingDelegate.willDeletePath(t)}catch(i){b("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+i.message)}r.node_ops.rmdir(r,e),Rt.destroyNode(n);try{Rt.trackingDelegate.onDeletePath&&Rt.trackingDelegate.onDeletePath(t)}catch(i){b("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+i.message)}},readdir:function(t){var r=Rt.lookupPath(t,{follow:!0}).node;if(!r.node_ops.readdir)throw new Rt.ErrnoError(54);return r.node_ops.readdir(r)},unlink:function(t){var r=Rt.lookupPath(t,{parent:!0}).node,e=Pt.basename(t),n=Rt.lookupNode(r,e),o=Rt.mayDelete(r,e,!1);if(o)throw new Rt.ErrnoError(o);if(!r.node_ops.unlink)throw new Rt.ErrnoError(63);if(Rt.isMountpoint(n))throw new Rt.ErrnoError(10);try{Rt.trackingDelegate.willDeletePath&&Rt.trackingDelegate.willDeletePath(t)}catch(i){b("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+i.message)}r.node_ops.unlink(r,e),Rt.destroyNode(n);try{Rt.trackingDelegate.onDeletePath&&Rt.trackingDelegate.onDeletePath(t)}catch(i){b("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+i.message)}},readlink:function(t){var r=Rt.lookupPath(t).node;if(!r)throw new Rt.ErrnoError(44);if(!r.node_ops.readlink)throw new Rt.ErrnoError(28);return At.resolve(Rt.getPath(r.parent),r.node_ops.readlink(r))},stat:function(t,r){var e=Rt.lookupPath(t,{follow:!r}).node;if(!e)throw new Rt.ErrnoError(44);if(!e.node_ops.getattr)throw new Rt.ErrnoError(63);return e.node_ops.getattr(e)},lstat:function(t){return Rt.stat(t,!0)},chmod:function(t,r,e){var n;"string"==typeof t?n=Rt.lookupPath(t,{follow:!e}).node:n=t;if(!n.node_ops.setattr)throw new Rt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:function(t,r){Rt.chmod(t,r,!0)},fchmod:function(t,r){var e=Rt.getStream(t);if(!e)throw new Rt.ErrnoError(8);Rt.chmod(e.node,r)},chown:function(t,r,e,n){var o;"string"==typeof t?o=Rt.lookupPath(t,{follow:!n}).node:o=t;if(!o.node_ops.setattr)throw new Rt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(t,r,e){Rt.chown(t,r,e,!0)},fchown:function(t,r,e){var n=Rt.getStream(t);if(!n)throw new Rt.ErrnoError(8);Rt.chown(n.node,r,e)},truncate:function(t,r){if(r<0)throw new Rt.ErrnoError(28);var e;"string"==typeof t?e=Rt.lookupPath(t,{follow:!0}).node:e=t;if(!e.node_ops.setattr)throw new Rt.ErrnoError(63);if(Rt.isDir(e.mode))throw new Rt.ErrnoError(31);if(!Rt.isFile(e.mode))throw new Rt.ErrnoError(28);var n=Rt.nodePermissions(e,"w");if(n)throw new Rt.ErrnoError(n);e.node_ops.setattr(e,{size:r,timestamp:Date.now()})},ftruncate:function(t,r){var e=Rt.getStream(t);if(!e)throw new Rt.ErrnoError(8);if(0==(2097155&e.flags))throw new Rt.ErrnoError(28);Rt.truncate(e.node,r)},utime:function(t,r,e){var n=Rt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,e)})},open:function(t,r,e,n,o){if(""===t)throw new Rt.ErrnoError(44);var i;if(e=void 0===e?438:e,e=64&(r="string"==typeof r?Rt.modeStringToFlags(r):r)?4095&e|32768:0,"object"==typeof t)i=t;else{t=Pt.normalize(t);try{i=Rt.lookupPath(t,{follow:!(131072&r)}).node}catch(l){}}var a=!1;if(64&r)if(i){if(128&r)throw new Rt.ErrnoError(20)}else i=Rt.mknod(t,e,0),a=!0;if(!i)throw new Rt.ErrnoError(44);if(Rt.isChrdev(i.mode)&&(r&=-513),65536&r&&!Rt.isDir(i.mode))throw new Rt.ErrnoError(54);if(!a){var s=Rt.mayOpen(i,r);if(s)throw new Rt.ErrnoError(s)}512&r&&Rt.truncate(i,0),r&=-131713;var c=Rt.createStream({node:i,path:Rt.getPath(i),flags:r,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1},n,o);c.stream_ops.open&&c.stream_ops.open(c),!u.logReadFiles||1&r||(Rt.readFiles||(Rt.readFiles={}),t in Rt.readFiles||(Rt.readFiles[t]=1,b("FS.trackingDelegate error on read file: "+t)));try{if(Rt.trackingDelegate.onOpenFile){var f=0;1!=(2097155&r)&&(f|=Rt.tracking.openFlags.READ),0!=(2097155&r)&&(f|=Rt.tracking.openFlags.WRITE),Rt.trackingDelegate.onOpenFile(t,f)}}catch(l){b("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+l.message)}return c},close:function(t){if(Rt.isClosed(t))throw new Rt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(r){throw r}finally{Rt.closeStream(t.fd)}t.fd=null},isClosed:function(t){return null===t.fd},llseek:function(t,r,e){if(Rt.isClosed(t))throw new Rt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new Rt.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new Rt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,r,e),t.ungotten=[],t.position},read:function(t,r,e,n,o){if(n<0||o<0)throw new Rt.ErrnoError(28);if(Rt.isClosed(t))throw new Rt.ErrnoError(8);if(1==(2097155&t.flags))throw new Rt.ErrnoError(8);if(Rt.isDir(t.node.mode))throw new Rt.ErrnoError(31);if(!t.stream_ops.read)throw new Rt.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new Rt.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,r,e,n,o);return i||(t.position+=a),a},write:function(t,r,e,n,o,i){if(n<0||o<0)throw new Rt.ErrnoError(28);if(Rt.isClosed(t))throw new Rt.ErrnoError(8);if(0==(2097155&t.flags))throw new Rt.ErrnoError(8);if(Rt.isDir(t.node.mode))throw new Rt.ErrnoError(31);if(!t.stream_ops.write)throw new Rt.ErrnoError(28);t.seekable&&1024&t.flags&&Rt.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new Rt.ErrnoError(70)}else o=t.position;var u=t.stream_ops.write(t,r,e,n,o,i);a||(t.position+=u);try{t.path&&Rt.trackingDelegate.onWriteToFile&&Rt.trackingDelegate.onWriteToFile(t.path)}catch(s){b("FS.trackingDelegate['onWriteToFile']('"+t.path+"') threw an exception: "+s.message)}return u},allocate:function(t,r,e){if(Rt.isClosed(t))throw new Rt.ErrnoError(8);if(r<0||e<=0)throw new Rt.ErrnoError(28);if(0==(2097155&t.flags))throw new Rt.ErrnoError(8);if(!Rt.isFile(t.node.mode)&&!Rt.isDir(t.node.mode))throw new Rt.ErrnoError(43);if(!t.stream_ops.allocate)throw new Rt.ErrnoError(138);t.stream_ops.allocate(t,r,e)},mmap:function(t,r,e,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&t.flags))throw new Rt.ErrnoError(2);if(1==(2097155&t.flags))throw new Rt.ErrnoError(2);if(!t.stream_ops.mmap)throw new Rt.ErrnoError(43);return t.stream_ops.mmap(t,r,e,n,o,i)},msync:function(t,r,e,n,o){return t&&t.stream_ops.msync?t.stream_ops.msync(t,r,e,n,o):0},munmap:function(t){return 0},ioctl:function(t,r,e){if(!t.stream_ops.ioctl)throw new Rt.ErrnoError(59);return t.stream_ops.ioctl(t,r,e)},readFile:function(t,r){if((r=r||{}).flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var e,n=Rt.open(t,r.flags),o=Rt.stat(t).size,i=new Uint8Array(o);return Rt.read(n,i,0,o,0),"utf8"===r.encoding?e=L(i,0):"binary"===r.encoding&&(e=i),Rt.close(n),e},writeFile:function(t,r,e){(e=e||{}).flags=e.flags||577;var n=Rt.open(t,e.flags,e.mode);if("string"==typeof r){var o=new Uint8Array(W(r)+1),i=Y(r,o,0,o.length);Rt.write(n,o,0,i,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");Rt.write(n,r,0,r.byteLength,void 0,e.canOwn)}Rt.close(n)},cwd:function(){return Rt.currentPath},chdir:function(t){var r=Rt.lookupPath(t,{follow:!0});if(null===r.node)throw new Rt.ErrnoError(44);if(!Rt.isDir(r.node.mode))throw new Rt.ErrnoError(54);var e=Rt.nodePermissions(r.node,"x");if(e)throw new Rt.ErrnoError(e);Rt.currentPath=r.path},createDefaultDirectories:function(){Rt.mkdir("/tmp"),Rt.mkdir("/home"),Rt.mkdir("/home/web_user")},createDefaultDevices:function(){Rt.mkdir("/dev"),Rt.registerDevice(Rt.makedev(1,3),{read:function(){return 0},write:function(t,r,e,n,o){return n}}),Rt.mkdev("/dev/null",Rt.makedev(1,3)),Tt.register(Rt.makedev(5,0),Tt.default_tty_ops),Tt.register(Rt.makedev(6,0),Tt.default_tty1_ops),Rt.mkdev("/dev/tty",Rt.makedev(5,0)),Rt.mkdev("/dev/tty1",Rt.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(_)try{var r=require("crypto");return function(){return r.randomBytes(1)[0]}}catch(e){}return function(){st("randomDevice")}}();Rt.createDevice("/dev","random",t),Rt.createDevice("/dev","urandom",t),Rt.mkdir("/dev/shm"),Rt.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Rt.mkdir("/proc");var t=Rt.mkdir("/proc/self");Rt.mkdir("/proc/self/fd"),Rt.mount({mount:function(){var r=Rt.createNode(t,"fd",16895,73);return r.node_ops={lookup:function(t,r){var e=+r,n=Rt.getStream(e);if(!n)throw new Rt.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(){u.stdin?Rt.createDevice("/dev","stdin",u.stdin):Rt.symlink("/dev/tty","/dev/stdin"),u.stdout?Rt.createDevice("/dev","stdout",null,u.stdout):Rt.symlink("/dev/tty","/dev/stdout"),u.stderr?Rt.createDevice("/dev","stderr",null,u.stderr):Rt.symlink("/dev/tty1","/dev/stderr");Rt.open("/dev/stdin",0),Rt.open("/dev/stdout",1),Rt.open("/dev/stderr",1)},ensureErrnoError:function(){Rt.ErrnoError||(Rt.ErrnoError=function(t,r){this.node=r,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},Rt.ErrnoError.prototype=new Error,Rt.ErrnoError.prototype.constructor=Rt.ErrnoError,[44].forEach(function(t){Rt.genericErrors[t]=new Rt.ErrnoError(t),Rt.genericErrors[t].stack="<generic error, no stack>"}))},staticInit:function(){Rt.ensureErrnoError(),Rt.nameTable=new Array(4096),Rt.mount(xt,{},"/"),Rt.createDefaultDirectories(),Rt.createDefaultDevices(),Rt.createSpecialDirectories(),Rt.filesystems={MEMFS:xt}},init:function(t,r,e){Rt.init.initialized=!0,Rt.ensureErrnoError(),u.stdin=t||u.stdin,u.stdout=r||u.stdout,u.stderr=e||u.stderr,Rt.createStandardStreams()},quit:function(){Rt.init.initialized=!1;var t=u._fflush;t&&t(0);for(var r=0;r<Rt.streams.length;r++){var e=Rt.streams[r];e&&Rt.close(e)}},getMode:function(t,r){var e=0;return t&&(e|=365),r&&(e|=146),e},findObject:function(t,r){var e=Rt.analyzePath(t,r);return e.exists?e.object:null},analyzePath:function(t,r){try{t=(n=Rt.lookupPath(t,{follow:!r})).path}catch(o){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Rt.lookupPath(t,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=Pt.basename(t),n=Rt.lookupPath(t,{follow:!r}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(o){e.error=o.errno}return e},createPath:function(t,r,e,n){t="string"==typeof t?t:Rt.getPath(t);for(var o=r.split("/").reverse();o.length;){var i=o.pop();if(i){var a=Pt.join2(t,i);try{Rt.mkdir(a)}catch(u){}t=a}}return a},createFile:function(t,r,e,n,o){var i=Pt.join2("string"==typeof t?t:Rt.getPath(t),r),a=Rt.getMode(n,o);return Rt.create(i,a)},createDataFile:function(t,r,e,n,o,i){var a=r?Pt.join2("string"==typeof t?t:Rt.getPath(t),r):t,u=Rt.getMode(n,o),s=Rt.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}Rt.chmod(s,146|u);var d=Rt.open(s,577);Rt.write(d,e,0,e.length,0,i),Rt.close(d),Rt.chmod(s,u)}return s},createDevice:function(t,r,e,n){var o=Pt.join2("string"==typeof t?t:Rt.getPath(t),r),i=Rt.getMode(!!e,!!n);Rt.createDevice.major||(Rt.createDevice.major=64);var a=Rt.makedev(Rt.createDevice.major++,0);return Rt.registerDevice(a,{open:function(t){t.seekable=!1},close:function(t){n&&n.buffer&&n.buffer.length&&n(10)},read:function(t,r,n,o,i){for(var a=0,u=0;u<o;u++){var s;try{s=e()}catch(c){throw new Rt.ErrnoError(29)}if(void 0===s&&0===a)throw new Rt.ErrnoError(6);if(null==s)break;a++,r[n+u]=s}return a&&(t.node.timestamp=Date.now()),a},write:function(t,r,e,o,i){for(var a=0;a<o;a++)try{n(r[e+a])}catch(u){throw new Rt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),Rt.mkdev(o,i,a)},forceLoadFile:function(t){if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=qt(f(t.url),!0),t.usedBytes=t.contents.length}catch(r){throw new Rt.ErrnoError(29)}},createLazyFile:function(t,r,e,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var r=t%this.chunkSize,e=t/this.chunkSize|0;return this.getter(e)[r]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",e,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+e+". Status: "+t.status);var r,n=Number(t.getResponseHeader("Content-length")),o=(r=t.getResponseHeader("Accept-Ranges"))&&"bytes"===r,i=(r=t.getResponseHeader("Content-Encoding"))&&"gzip"===r,a=1048576;o||(a=n);var u=this;u.setDataGetter(function(t){var r=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===u.chunks[t]&&(u.chunks[t]=function(t,r){if(t>r)throw new Error("invalid range ("+t+", "+r+") or no bytes requested!");if(r>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="+t+"-"+r),"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||[]):qt(o.responseText||"",!0)}(r,o)),void 0===u.chunks[t])throw new Error("doXHR failed!");return u.chunks[t]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:a}}else u={isDevice:!1,url:e};var s=Rt.createFile(t,r,u,n,o);u.contents?s.contents=u.contents:u.url&&(s.contents=null,s.url=u.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(s.stream_ops).forEach(function(t){var r=s.stream_ops[t];c[t]=function(){return Rt.forceLoadFile(s),r.apply(null,arguments)}}),c.read=function(t,r,e,n,o){Rt.forceLoadFile(s);var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)r[e+u]=i[o+u];else for(u=0;u<a;u++)r[e+u]=i.get(o+u);return a},s.stream_ops=c,s},createPreloadedFile:function(t,r,e,n,o,i,a,s,c,f){Browser.init();var d=r?At.resolve(Pt.join2(t,r)):t;it("cp "+d);function h(e){function l(e){f&&f(),s||Rt.createDataFile(t,r,e,n,o,c),i&&i(),ut()}var h=!1;u.preloadPlugins.forEach(function(t){h||t.canHandle(d)&&(t.handle(e,d,l,function(){a&&a(),ut()}),h=!0)}),h||l(e)}at(),"string"==typeof e?function(t,r,e,n){var o=n?"":it("al "+t);l(t,function(e){x(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),o&&ut()},function(r){if(!e)throw'Loading data file "'+t+'" failed.';e()}),o&&at()}(e,function(t){h(t)},a):h(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(t,r,e){r=r||function(){},e=e||function(){};var n=Rt.indexedDB();try{var o=n.open(Rt.DB_NAME(),Rt.DB_VERSION)}catch(i){return e(i)}o.onupgradeneeded=function(){k("creating db"),o.result.createObjectStore(Rt.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Rt.DB_STORE_NAME],"readwrite"),i=n.objectStore(Rt.DB_STORE_NAME),a=0,u=0,s=t.length;function c(){0==u?r():e()}t.forEach(function(t){var r=i.put(Rt.analyzePath(t).object.contents,t);r.onsuccess=function(){++a+u==s&&c()},r.onerror=function(){a+ ++u==s&&c()}}),n.onerror=e},o.onerror=e},loadFilesFromDB:function(t,r,e){r=r||function(){},e=e||function(){};var n=Rt.indexedDB();try{var o=n.open(Rt.DB_NAME(),Rt.DB_VERSION)}catch(i){return e(i)}o.onupgradeneeded=e,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([Rt.DB_STORE_NAME],"readonly")}catch(i){return void e(i)}var u=a.objectStore(Rt.DB_STORE_NAME),s=0,c=0,f=t.length;function l(){0==c?r():e()}t.forEach(function(t){var r=u.get(t);r.onsuccess=function(){Rt.analyzePath(t).exists&&Rt.unlink(t),Rt.createDataFile(Pt.dirname(t),Pt.basename(t),r.result,!0,!0,!0),++s+c==f&&l()},r.onerror=function(){s+ ++c==f&&l()}}),a.onerror=e},o.onerror=e}},Ct={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(t,r,e){if("/"===r[0])return r;var n;if(-100===t)n=Rt.cwd();else{var o=Rt.getStream(t);if(!o)throw new Rt.ErrnoError(8);n=o.path}if(0==r.length){if(!e)throw new Rt.ErrnoError(44);return n}return Pt.join2(n,r)},doStat:function(t,r,e){try{var n=t(r)}catch(o){if(o&&o.node&&Pt.normalize(r)!==Pt.normalize(Rt.getPath(o.node)))return-54;throw o}return I[e>>2]=n.dev,I[e+4>>2]=0,I[e+8>>2]=n.ino,I[e+12>>2]=n.mode,I[e+16>>2]=n.nlink,I[e+20>>2]=n.uid,I[e+24>>2]=n.gid,I[e+28>>2]=n.rdev,I[e+32>>2]=0,dt=[n.size>>>0,(lt=n.size,+Math.abs(lt)>=1?lt>0?(0|Math.min(+Math.floor(lt/4294967296),4294967295))>>>0:~~+Math.ceil((lt-+(~~lt>>>0))/4294967296)>>>0:0)],I[e+40>>2]=dt[0],I[e+44>>2]=dt[1],I[e+48>>2]=4096,I[e+52>>2]=n.blocks,I[e+56>>2]=n.atime.getTime()/1e3|0,I[e+60>>2]=0,I[e+64>>2]=n.mtime.getTime()/1e3|0,I[e+68>>2]=0,I[e+72>>2]=n.ctime.getTime()/1e3|0,I[e+76>>2]=0,dt=[n.ino>>>0,(lt=n.ino,+Math.abs(lt)>=1?lt>0?(0|Math.min(+Math.floor(lt/4294967296),4294967295))>>>0:~~+Math.ceil((lt-+(~~lt>>>0))/4294967296)>>>0:0)],I[e+80>>2]=dt[0],I[e+84>>2]=dt[1],0},doMsync:function(t,r,e,n,o){var i=B.slice(t,t+e);Rt.msync(r,i,o,e,n)},doMkdir:function(t,r){return"/"===(t=Pt.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),Rt.mkdir(t,r,0),0},doMknod:function(t,r,e){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Rt.mknod(t,r,e),0},doReadlink:function(t,r,e){if(e<=0)return-28;var n=Rt.readlink(t),o=Math.min(e,W(n)),i=O[r+o];return q(n,r,e+1),O[r+o]=i,o},doAccess:function(t,r){if(-8&r)return-28;var e;if(!(e=Rt.lookupPath(t,{follow:!0}).node))return-44;var n="";return 4&r&&(n+="r"),2&r&&(n+="w"),1&r&&(n+="x"),n&&Rt.nodePermissions(e,n)?-2:0},doDup:function(t,r,e){var n=Rt.getStream(e);return n&&Rt.close(n),Rt.open(t,r,0,e,e).fd},doReadv:function(t,r,e,n){for(var o=0,i=0;i<e;i++){var a=I[r+8*i>>2],u=I[r+(8*i+4)>>2],s=Rt.read(t,O,a,u,n);if(s<0)return-1;if(o+=s,s<u)break}return o},doWritev:function(t,r,e,n){for(var o=0,i=0;i<e;i++){var a=I[r+8*i>>2],u=I[r+(8*i+4)>>2],s=Rt.write(t,O,a,u,n);if(s<0)return-1;o+=s}return o},varargs:void 0,get:function(){return Ct.varargs+=4,I[Ct.varargs-4>>2]},getStr:function(t){return H(t)},getStreamFromFD:function(t){var r=Rt.getStream(t);if(!r)throw new Rt.ErrnoError(8);return r},get64:function(t,r){return t}};var zt={};function Ot(){if(!Ot.strings){var t={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",_:g||"./this.program"};for(var r in zt)void 0===zt[r]?delete t[r]:t[r]=zt[r];var e=[];for(var r in t)e.push(r+"="+t[r]);Ot.strings=e}return Ot.strings}function Bt(t){return t%4==0&&(t%100!=0||t%400==0)}function Nt(t,r){for(var e=0,n=0;n<=r;e+=t[n++]);return e}var It=[31,29,31,30,31,30,31,31,30,31,30,31],Ut=[31,28,31,30,31,30,31,31,30,31,30,31];function Lt(t,r){for(var e=new Date(t.getTime());r>0;){var n=Bt(e.getFullYear()),o=e.getMonth(),i=(n?It:Ut)[o];if(!(r>i-e.getDate()))return e.setDate(e.getDate()+r),e;r-=i-e.getDate()+1,e.setDate(1),o<11?e.setMonth(o+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function Ht(t,r,e,n){var o=I[n+40>>2],i={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:o?H(o):""},a=H(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(t,r,e){for(var n="number"==typeof t?t.toString():t||"";n.length<r;)n=e[0]+n;return n}function d(t,r){return l(t,r,"0")}function h(t,r){function e(t){return t<0?-1:t>0?1:0}var n;return 0===(n=e(t.getFullYear()-r.getFullYear()))&&0===(n=e(t.getMonth()-r.getMonth()))&&(n=e(t.getDate()-r.getDate())),n}function p(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function m(t){var r=Lt(new Date(t.tm_year+1900,0,1),t.tm_yday),e=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=p(e),i=p(n);return h(o,r)<=0?h(i,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var g={"%a":function(t){return c[t.tm_wday].substring(0,3)},"%A":function(t){return c[t.tm_wday]},"%b":function(t){return f[t.tm_mon].substring(0,3)},"%B":function(t){return f[t.tm_mon]},"%C":function(t){return d((t.tm_year+1900)/100|0,2)},"%d":function(t){return d(t.tm_mday,2)},"%e":function(t){return l(t.tm_mday,2," ")},"%g":function(t){return m(t).toString().substring(2)},"%G":function(t){return m(t)},"%H":function(t){return d(t.tm_hour,2)},"%I":function(t){var r=t.tm_hour;return 0==r?r=12:r>12&&(r-=12),d(r,2)},"%j":function(t){return d(t.tm_mday+Nt(Bt(t.tm_year+1900)?It:Ut,t.tm_mon-1),3)},"%m":function(t){return d(t.tm_mon+1,2)},"%M":function(t){return d(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return d(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var r=new Date(t.tm_year+1900,0,1),e=0===r.getDay()?r:Lt(r,7-r.getDay()),n=new Date(t.tm_year+1900,t.tm_mon,t.tm_mday);if(h(e,n)<0){var o=Nt(Bt(n.getFullYear())?It:Ut,n.getMonth()-1)-31,i=31-e.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===h(e,r)?"01":"00"},"%V":function(t){var r,e=new Date(t.tm_year+1900,0,4),n=new Date(t.tm_year+1901,0,4),o=p(e),i=p(n),a=Lt(new Date(t.tm_year+1900,0,1),t.tm_yday);return h(a,o)<0?"53":h(i,a)<=0?"01":(r=o.getFullYear()<t.tm_year+1900?t.tm_yday+32-o.getDate():t.tm_yday+1-o.getDate(),d(Math.ceil(r/7),2))},"%w":function(t){return t.tm_wday},"%W":function(t){var r=new Date(t.tm_year,0,1),e=1===r.getDay()?r:Lt(r,0===r.getDay()?1:7-r.getDay()+1),n=new Date(t.tm_year+1900,t.tm_mon,t.tm_mday);if(h(e,n)<0){var o=Nt(Bt(n.getFullYear())?It:Ut,n.getMonth()-1)-31,i=31-e.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===h(e,r)?"01":"00"},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var r=t.tm_gmtoff,e=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(e?"+":"-")+String("0000"+r).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var s in g)a.includes(s)&&(a=a.replace(new RegExp(s,"g"),g[s](i)));var v=qt(a,!1);return v.length>r?0:(V(v,t),v.length-1)}var Yt=function(t,r,e,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=Rt.nextInode++,this.name=r,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n};function qt(t,r,e){var n=e>0?e:W(t)+1,o=new Array(n),i=Y(t,o,0,o.length);return r&&(o.length=i),o}Object.defineProperties(Yt.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Rt.isDir(this.mode)}},isDevice:{get:function(){return Rt.isChrdev(this.mode)}}}),Rt.FSNode=Yt,Rt.staticInit();var Wt,Gt={ta:function(t,r){return function(t,r){var e;if(0===t)e=Date.now();else{if(1!==t&&4!==t||!yt)return _t(28),-1;e=ht()}return I[r>>2]=e/1e3|0,I[r+4>>2]=e%1e3*1e3*1e3|0,0}(t,r)},k:function(t){return Vt(t+16)+16},q:function(t){var r=new kt(t),e=r.get_exception_info();return e.get_caught()||(e.set_caught(!0),Dt--),e.set_rethrown(!1),bt.push(r),function(t){t.add_ref()}(e),r.get_exception_ptr()},v:function(){er(0);var t=bt.pop();!function(t){if(t.release_ref()&&!t.get_rethrown()){var r=t.get_destructor();r&&K.get(r)(t.excPtr),St(t.excPtr)}}(t.get_exception_info()),t.free(),jt=0},b:function(){var t=jt;if(!t)return S(0),0;var r=new Et(t).get_type(),e=new kt;if(e.set_base_ptr(t),e.set_adjusted_ptr(t),!r)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===r)break;if(nr(i,r,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(r),0|e.ptr},h:function(){var t=jt;if(!t)return S(0),0;var r=new Et(t).get_type(),e=new kt;if(e.set_base_ptr(t),e.set_adjusted_ptr(t),!r)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===r)break;if(nr(i,r,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(r),0|e.ptr},B:function(){var t=jt;if(!t)return S(0),0;var r=new Et(t).get_type(),e=new kt;if(e.set_base_ptr(t),e.set_adjusted_ptr(t),!r)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===r)break;if(nr(i,r,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(r),0|e.ptr},K:function(){var t=jt;if(!t)return S(0),0;var r=new Et(t).get_type(),e=new kt;if(e.set_base_ptr(t),e.set_adjusted_ptr(t),!r)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===r)break;if(nr(i,r,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(r),0|e.ptr},l:St,V:function(){var t=bt.pop();t||st("no exception to throw");var r=t.get_exception_info(),e=t.get_base_ptr();throw r.get_rethrown()?t.free():(bt.push(t),r.set_rethrown(!0),r.set_caught(!1),Dt++),jt=e,e},s:function(t,r,e){throw new Et(t).init(r,e),jt=t,Dt++,t},ma:function(){return Dt},sa:function(t,r){return Ft(t,r)},ra:function(t,r){return function(t,r){Mt();var e=new Date(1e3*I[t>>2]);I[r>>2]=e.getSeconds(),I[r+4>>2]=e.getMinutes(),I[r+8>>2]=e.getHours(),I[r+12>>2]=e.getDate(),I[r+16>>2]=e.getMonth(),I[r+20>>2]=e.getFullYear()-1900,I[r+24>>2]=e.getDay();var n=new Date(e.getFullYear(),0,1),o=(e.getTime()-n.getTime())/864e5|0;I[r+28>>2]=o,I[r+36>>2]=-60*e.getTimezoneOffset();var i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),u=0|(i!=a&&e.getTimezoneOffset()==Math.min(a,i));I[r+32>>2]=u;var s=I[Jt()+(u?4:0)>>2];return I[r+40>>2]=s,r}(t,r)},c:function(t){var r=new kt(t),e=r.get_base_ptr();throw jt||(jt=e),r.free(),e},xa:function(t,r){try{var e=Ct.getStreamFromFD(t);return e.fd===r?r:Ct.doDup(e.path,e.flags,r)}catch(n){return void 0!==Rt&&n instanceof Rt.ErrnoError||st(n),-n.errno}},ya:function(t,r,e){try{var n=Ct.getStreamFromFD(t);return n.fd===r?-28:Ct.doDup(n.path,n.flags,r)}catch(o){return void 0!==Rt&&o instanceof Rt.ErrnoError||st(o),-o.errno}},H:function(t,r,e){Ct.varargs=e;try{var n=Ct.getStreamFromFD(t);switch(r){case 0:return(o=Ct.get())<0?-28:Rt.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=Ct.get();return n.flags|=o,0;case 12:return o=Ct.get(),N[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return _t(28),-1;default:return-28}}catch(i){return void 0!==Rt&&i instanceof Rt.ErrnoError||st(i),-i.errno}},ua:function(t,r){try{if(0===r)return-28;var e=Rt.cwd();return r<W(e)+1?-68:(q(e,t,r),t)}catch(n){return void 0!==Rt&&n instanceof Rt.ErrnoError||st(n),-n.errno}},va:function(){return 42},za:function(t,r,e){Ct.varargs=e;try{var n=Ct.getStreamFromFD(t);switch(r){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Ct.get();return I[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=Ct.get(),Rt.ioctl(n,r,o);case 21523:case 21524:return n.tty?0:-59;default:st("bad ioctl syscall "+r)}}catch(i){return void 0!==Rt&&i instanceof Rt.ErrnoError||st(i),-i.errno}},R:function(t,r){try{return t=Ct.getStr(t),Ct.doStat(Rt.lstat,t,r)}catch(e){return void 0!==Rt&&e instanceof Rt.ErrnoError||st(e),-e.errno}},Q:function(t,r,e){Ct.varargs=e;try{var n=Ct.getStr(t),o=e?Ct.get():0;return Rt.open(n,r,o).fd}catch(i){return void 0!==Rt&&i instanceof Rt.ErrnoError||st(i),-i.errno}},wa:function(t,r,e){try{return t=Ct.getStr(t),Ct.doReadlink(t,r,e)}catch(n){return void 0!==Rt&&n instanceof Rt.ErrnoError||st(n),-n.errno}},Ba:function(t,r){try{return t=Ct.getStr(t),r=Ct.getStr(r),Rt.rename(t,r),0}catch(e){return void 0!==Rt&&e instanceof Rt.ErrnoError||st(e),-e.errno}},Ca:function(t){try{return t=Ct.getStr(t),Rt.rmdir(t),0}catch(r){return void 0!==Rt&&r instanceof Rt.ErrnoError||st(r),-r.errno}},Da:function(t,r){try{return t=Ct.getStr(t),Ct.doStat(Rt.stat,t,r)}catch(e){return void 0!==Rt&&e instanceof Rt.ErrnoError||st(e),-e.errno}},P:function(t){try{return t=Ct.getStr(t),Rt.unlink(t),0}catch(r){return void 0!==Rt&&r instanceof Rt.ErrnoError||st(r),-r.errno}},oa:function(){throw"longjmp"},J:function(){st()},S:function t(){return void 0===t.start&&(t.start=Date.now()),1e3*(Date.now()-t.start)|0},Ha:function(t,r){return t-r},la:function(t){B.length,st("OOM")},pa:function(t,r){var e=0;return Ot().forEach(function(n,o){var i=r+e;I[t+4*o>>2]=i,function(t,r,e){for(var n=0;n<t.length;++n)O[r++>>0]=t.charCodeAt(n);e||(O[r>>0]=0)}(n,i),e+=n.length+1}),0},qa:function(t,r){var e=Ot();I[t>>2]=e.length;var n=0;return e.forEach(function(t){n+=t.length+1}),I[r>>2]=n,0},Fa:function(t){Dr(t)},I:function(t){try{var r=Ct.getStreamFromFD(t);return Rt.close(r),0}catch(e){return void 0!==Rt&&e instanceof Rt.ErrnoError||st(e),e.errno}},Aa:function(t,r,e,n){try{var o=Ct.getStreamFromFD(t),i=Ct.doReadv(o,r,e);return I[n>>2]=i,0}catch(a){return void 0!==Rt&&a instanceof Rt.ErrnoError||st(a),a.errno}},Y:function(t,r,e,n,o){try{var i=Ct.getStreamFromFD(t),a=4294967296*e+(r>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(Rt.llseek(i,a,n),dt=[i.position>>>0,(lt=i.position,+Math.abs(lt)>=1?lt>0?(0|Math.min(+Math.floor(lt/4294967296),4294967295))>>>0:~~+Math.ceil((lt-+(~~lt>>>0))/4294967296)>>>0:0)],I[o>>2]=dt[0],I[o+4>>2]=dt[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(u){return void 0!==Rt&&u instanceof Rt.ErrnoError||st(u),u.errno}},O:function(t,r,e,n){try{var o=Ct.getStreamFromFD(t),i=Ct.doWritev(o,r,e);return I[n>>2]=i,0}catch(a){return void 0!==Rt&&a instanceof Rt.ErrnoError||st(a),a.errno}},a:function(){return F()},w:function(t,r){var e=Qt();try{return K.get(t)(r)}catch(n){if(tr(e),n!==n+0&&"longjmp"!==n)throw n;er(1,0)}},L:function(t,r,e,n){var o=Qt();try{return K.get(t)(r,e,n)}catch(i){if(tr(o),i!==i+0&&"longjmp"!==i)throw i;er(1,0)}},M:function(t,r,e,n){var o=Qt();try{return K.get(t)(r,e,n)}catch(i){if(tr(o),i!==i+0&&"longjmp"!==i)throw i;er(1,0)}},r:function(t){var r=Qt();try{return K.get(t)()}catch(e){if(tr(r),e!==e+0&&"longjmp"!==e)throw e;er(1,0)}},i:function(t,r){var e=Qt();try{return K.get(t)(r)}catch(n){if(tr(e),n!==n+0&&"longjmp"!==n)throw n;er(1,0)}},d:function(t,r,e){var n=Qt();try{return K.get(t)(r,e)}catch(o){if(tr(n),o!==o+0&&"longjmp"!==o)throw o;er(1,0)}},g:function(t,r,e,n){var o=Qt();try{return K.get(t)(r,e,n)}catch(i){if(tr(o),i!==i+0&&"longjmp"!==i)throw i;er(1,0)}},j:function(t,r,e,n,o){var i=Qt();try{return K.get(t)(r,e,n,o)}catch(a){if(tr(i),a!==a+0&&"longjmp"!==a)throw a;er(1,0)}},u:function(t,r,e,n,o,i){var a=Qt();try{return K.get(t)(r,e,n,o,i)}catch(u){if(tr(a),u!==u+0&&"longjmp"!==u)throw u;er(1,0)}},x:function(t,r,e,n,o,i,a){var u=Qt();try{return K.get(t)(r,e,n,o,i,a)}catch(s){if(tr(u),s!==s+0&&"longjmp"!==s)throw s;er(1,0)}},N:function(t,r,e,n,o,i,a,u){var s=Qt();try{return K.get(t)(r,e,n,o,i,a,u)}catch(c){if(tr(s),c!==c+0&&"longjmp"!==c)throw c;er(1,0)}},Ja:function(t,r,e,n,o,i,a,u,s,c){var f=Qt();try{return K.get(t)(r,e,n,o,i,a,u,s,c)}catch(l){if(tr(f),l!==l+0&&"longjmp"!==l)throw l;er(1,0)}},E:function(t,r,e,n,o,i,a,u,s,c,f,l){var d=Qt();try{return K.get(t)(r,e,n,o,i,a,u,s,c,f,l)}catch(h){if(tr(d),h!==h+0&&"longjmp"!==h)throw h;er(1,0)}},T:function(t,r,e,n,o,i,a,u,s,c,f,l,d){var h=Qt();try{return K.get(t)(r,e,n,o,i,a,u,s,c,f,l,d)}catch(p){if(tr(h),p!==p+0&&"longjmp"!==p)throw p;er(1,0)}},W:function(t,r,e,n,o,i,a,u,s){var c=Qt();try{return _r(t,r,e,n,o,i,a,u,s)}catch(f){if(tr(c),f!==f+0&&"longjmp"!==f)throw f;er(1,0)}},ia:function(t,r,e,n,o,i){var a=Qt();try{return ur(t,r,e,n,o,i)}catch(u){if(tr(a),u!==u+0&&"longjmp"!==u)throw u;er(1,0)}},ha:function(t,r,e,n,o,i,a,u){var s=Qt();try{return sr(t,r,e,n,o,i,a,u)}catch(c){if(tr(s),c!==c+0&&"longjmp"!==c)throw c;er(1,0)}},_:function(t,r,e,n){var o=Qt();try{return vr(t,r,e,n)}catch(i){if(tr(o),i!==i+0&&"longjmp"!==i)throw i;er(1,0)}},X:function(t,r,e,n,o){var i=Qt();try{return yr(t,r,e,n,o)}catch(a){if(tr(i),a!==a+0&&"longjmp"!==a)throw a;er(1,0)}},m:function(t){var r=Qt();try{K.get(t)()}catch(e){if(tr(r),e!==e+0&&"longjmp"!==e)throw e;er(1,0)}},p:function(t,r){var e=Qt();try{K.get(t)(r)}catch(n){if(tr(e),n!==n+0&&"longjmp"!==n)throw n;er(1,0)}},z:function(t,r,e){var n=Qt();try{K.get(t)(r,e)}catch(o){if(tr(n),o!==o+0&&"longjmp"!==o)throw o;er(1,0)}},aa:function(t,r,e,n,o,i,a){var u=Qt();try{hr(t,r,e,n,o,i,a)}catch(s){if(tr(u),s!==s+0&&"longjmp"!==s)throw s;er(1,0)}},e:function(t,r,e){var n=Qt();try{K.get(t)(r,e)}catch(o){if(tr(n),o!==o+0&&"longjmp"!==o)throw o;er(1,0)}},f:function(t,r,e,n){var o=Qt();try{K.get(t)(r,e,n)}catch(i){if(tr(o),i!==i+0&&"longjmp"!==i)throw i;er(1,0)}},o:function(t,r,e,n,o){var i=Qt();try{K.get(t)(r,e,n,o)}catch(a){if(tr(i),a!==a+0&&"longjmp"!==a)throw a;er(1,0)}},n:function(t,r,e,n,o,i){var a=Qt();try{K.get(t)(r,e,n,o,i)}catch(u){if(tr(a),u!==u+0&&"longjmp"!==u)throw u;er(1,0)}},G:function(t,r,e,n,o,i,a){var u=Qt();try{K.get(t)(r,e,n,o,i,a)}catch(s){if(tr(u),s!==s+0&&"longjmp"!==s)throw s;er(1,0)}},y:function(t,r,e,n,o,i,a,u){var s=Qt();try{K.get(t)(r,e,n,o,i,a,u)}catch(c){if(tr(s),c!==c+0&&"longjmp"!==c)throw c;er(1,0)}},U:function(t,r,e,n,o,i,a,u,s){var c=Qt();try{K.get(t)(r,e,n,o,i,a,u,s)}catch(f){if(tr(c),f!==f+0&&"longjmp"!==f)throw f;er(1,0)}},A:function(t,r,e,n,o,i,a,u,s,c,f){var l=Qt();try{K.get(t)(r,e,n,o,i,a,u,s,c,f)}catch(d){if(tr(l),d!==d+0&&"longjmp"!==d)throw d;er(1,0)}},D:function(t,r,e,n,o,i,a,u,s,c,f,l,d,h,p,m){var g=Qt();try{K.get(t)(r,e,n,o,i,a,u,s,c,f,l,d,h,p,m)}catch(v){if(tr(g),v!==v+0&&"longjmp"!==v)throw v;er(1,0)}},da:function(t,r,e,n,o,i,a){var u=Qt();try{dr(t,r,e,n,o,i,a)}catch(s){if(tr(u),s!==s+0&&"longjmp"!==s)throw s;er(1,0)}},ea:function(t,r,e,n,o,i,a,u){var s=Qt();try{lr(t,r,e,n,o,i,a,u)}catch(c){if(tr(s),c!==c+0&&"longjmp"!==c)throw c;er(1,0)}},ba:function(t,r,e,n,o,i,a,u,s){var c=Qt();try{pr(t,r,e,n,o,i,a,u,s)}catch(f){if(tr(c),f!==f+0&&"longjmp"!==f)throw f;er(1,0)}},ca:function(t,r,e,n,o,i,a,u,s,c,f,l){var d=Qt();try{mr(t,r,e,n,o,i,a,u,s,c,f,l)}catch(h){if(tr(d),h!==h+0&&"longjmp"!==h)throw h;er(1,0)}},ka:function(t,r,e,n,o,i,a,u){var s=Qt();try{ir(t,r,e,n,o,i,a,u)}catch(c){if(tr(s),c!==c+0&&"longjmp"!==c)throw c;er(1,0)}},fa:function(t,r,e,n,o,i,a,u,s){var c=Qt();try{fr(t,r,e,n,o,i,a,u,s)}catch(f){if(tr(c),f!==f+0&&"longjmp"!==f)throw f;er(1,0)}},ja:function(t,r,e,n,o,i,a,u,s,c){var f=Qt();try{ar(t,r,e,n,o,i,a,u,s,c)}catch(l){if(tr(f),l!==l+0&&"longjmp"!==l)throw l;er(1,0)}},$:function(t,r,e,n){var o=Qt();try{gr(t,r,e,n)}catch(i){if(tr(o),i!==i+0&&"longjmp"!==i)throw i;er(1,0)}},ga:function(t,r,e,n,o,i){var a=Qt();try{cr(t,r,e,n,o,i)}catch(u){if(tr(a),u!==u+0&&"longjmp"!==u)throw u;er(1,0)}},Z:function(t,r,e,n,o,i,a){var u=Qt();try{wr(t,r,e,n,o,i,a)}catch(s){if(tr(u),s!==s+0&&"longjmp"!==s)throw s;er(1,0)}},t:function(t){return t},Ea:function(t){Mt();var r=new Date(I[t+20>>2]+1900,I[t+16>>2],I[t+12>>2],I[t+8>>2],I[t+4>>2],I[t>>2],0),e=I[t+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),u=Math.min(a,i);if(e<0)I[t+32>>2]=Number(i!=a&&u==n);else if(e>0!=(u==n)){var s=Math.max(a,i),c=e>0?u:s;r.setTime(r.getTime()+6e4*(c-n))}I[t+24>>2]=r.getDay();var f=(r.getTime()-o.getTime())/864e5|0;return I[t+28>>2]=f,I[t>>2]=r.getSeconds(),I[t+4>>2]=r.getMinutes(),I[t+8>>2]=r.getHours(),I[t+12>>2]=r.getDate(),I[t+16>>2]=r.getMonth(),r.getTime()/1e3|0},C:function(t){S(t)},Ia:Ht,na:function(t,r,e,n){return Ht(t,r,e,n)},Ga:function(t){if(_){if(!t)return 1;var r=H(t);if(!r.length)return 0;var e=require("child_process").spawnSync(r,[],{shell:!0,stdio:"inherit"}),n=function(t,r){return t<<8|r};return null===e.status?n(0,function(t){switch(t){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15}return 2}(e.signal)):n(e.status,0)}return t?(_t(52),-1):0},F:function(t){var r=Date.now()/1e3|0;return t&&(I[t>>2]=r),r}},Xt=(function(){var t={a:Gt};function r(t,r){var e,n,o=t.exports;u.asm=o,M=u.asm.Ka,e=M.buffer,z=e,u.HEAP8=O=new Int8Array(e),u.HEAP16=N=new Int16Array(e),u.HEAP32=I=new Int32Array(e),u.HEAPU8=B=new Uint8Array(e),u.HEAPU16=new Uint16Array(e),u.HEAPU32=new Uint32Array(e),u.HEAPF32=new Float32Array(e),u.HEAPF64=new Float64Array(e),K=u.asm.Oa,n=u.asm.La,$.unshift(n),ut()}function e(t){r(t.instance)}function n(r){return function(){if(!D&&(w||y)){if("function"==typeof fetch&&!gt(ct))return fetch(ct,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+ct+"'";return t.arrayBuffer()}).catch(function(){return vt(ct)});if(l)return new Promise(function(t,r){l(ct,function(r){t(new Uint8Array(r))},r)})}return Promise.resolve().then(function(){return vt(ct)})}().then(function(r){return WebAssembly.instantiate(r,t)}).then(function(t){return t}).then(r,function(t){b("failed to asynchronously prepare wasm: "+t),st(t)})}if(at(),u.instantiateWasm)try{return u.instantiateWasm(t,r)}catch(o){return b("Module.instantiateWasm callback failed with error: "+o),!1}(D||"function"!=typeof WebAssembly.instantiateStreaming||mt(ct)||gt(ct)||"function"!=typeof fetch?n(e):fetch(ct,{credentials:"same-origin"}).then(function(r){return WebAssembly.instantiateStreaming(r,t).then(e,function(t){return b("wasm streaming compile failed: "+t),b("falling back to ArrayBuffer instantiation"),n(e)})})).catch(a)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.La).apply(null,arguments)},u._create_compile_result=function(){return(u._create_compile_result=u.asm.Ma).apply(null,arguments)},u._main=function(){return(u._main=u.asm.Na).apply(null,arguments)},u._free=function(){return(Xt=u._free=u.asm.Pa).apply(null,arguments)}),Vt=u._malloc=function(){return(Vt=u._malloc=u.asm.Qa).apply(null,arguments)},Kt=u.___errno_location=function(){return(Kt=u.___errno_location=u.asm.Ra).apply(null,arguments)},Jt=u.__get_tzname=function(){return(Jt=u.__get_tzname=u.asm.Sa).apply(null,arguments)},$t=u.__get_daylight=function(){return($t=u.__get_daylight=u.asm.Ta).apply(null,arguments)},Zt=u.__get_timezone=function(){return(Zt=u.__get_timezone=u.asm.Ua).apply(null,arguments)},Qt=u.stackSave=function(){return(Qt=u.stackSave=u.asm.Va).apply(null,arguments)},tr=u.stackRestore=function(){return(tr=u.stackRestore=u.asm.Wa).apply(null,arguments)},rr=u.stackAlloc=function(){return(rr=u.stackAlloc=u.asm.Xa).apply(null,arguments)},er=u._setThrew=function(){return(er=u._setThrew=u.asm.Ya).apply(null,arguments)},nr=u.___cxa_can_catch=function(){return(nr=u.___cxa_can_catch=u.asm.Za).apply(null,arguments)},or=u.___cxa_is_pointer_type=function(){return(or=u.___cxa_is_pointer_type=u.asm._a).apply(null,arguments)},ir=u.dynCall_viijji=function(){return(ir=u.dynCall_viijji=u.asm.$a).apply(null,arguments)},ar=u.dynCall_viijjiii=function(){return(ar=u.dynCall_viijjiii=u.asm.ab).apply(null,arguments)},ur=u.dynCall_iijj=function(){return(ur=u.dynCall_iijj=u.asm.bb).apply(null,arguments)},sr=u.dynCall_iijjii=function(){return(sr=u.dynCall_iijjii=u.asm.cb).apply(null,arguments)},cr=u.dynCall_vijj=function(){return(cr=u.dynCall_vijj=u.asm.db).apply(null,arguments)},fr=u.dynCall_viijjii=function(){return(fr=u.dynCall_viijjii=u.asm.eb).apply(null,arguments)},lr=u.dynCall_viijjd=function(){return(lr=u.dynCall_viijjd=u.asm.fb).apply(null,arguments)},dr=u.dynCall_viijj=function(){return(dr=u.dynCall_viijj=u.asm.gb).apply(null,arguments)},hr=u.dynCall_vidjj=function(){return(hr=u.dynCall_vidjj=u.asm.hb).apply(null,arguments)},pr=u.dynCall_viijjdi=function(){return(pr=u.dynCall_viijjdi=u.asm.ib).apply(null,arguments)},mr=u.dynCall_viijjdjj=function(){return(mr=u.dynCall_viijjdjj=u.asm.jb).apply(null,arguments)},gr=u.dynCall_vij=function(){return(gr=u.dynCall_vij=u.asm.kb).apply(null,arguments)},vr=u.dynCall_jiii=function(){return(vr=u.dynCall_jiii=u.asm.lb).apply(null,arguments)},wr=u.dynCall_vijji=function(){return(wr=u.dynCall_vijji=u.asm.mb).apply(null,arguments)},yr=u.dynCall_jiiii=function(){return(yr=u.dynCall_jiiii=u.asm.nb).apply(null,arguments)},_r=u.dynCall_iiiiijj=function(){return(_r=u.dynCall_iiiiijj=u.asm.ob).apply(null,arguments)};function Er(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}u.cwrap=function(t,r,e,n){var o=(e=e||[]).every(function(t){return"number"===t});return"string"!==r&&o&&!n?R(t):function(){return C(t,r,e,arguments)}},u.UTF8ToString=H,u.FS=Rt;function kr(t){var r=u._main,e=(t=t||[]).length+1,n=rr(4*(e+1));I[n>>2]=X(g);for(var o=1;o<e;o++)I[(n>>2)+o]=X(t[o-1]);I[(n>>2)+e]=0;try{var i=r(e,n);return Dr(i,!0),i}catch(a){return function(t){if(t instanceof Er||"unwind"==t)return A;b("exception thrown: "+t),v(1,t)}(a)}finally{!0}}function br(t){function r(){Wt||(Wt=!0,u.calledRun=!0,T||(!0,u.noFSInit||Rt.init.initialized||Rt.init(),Rt.ignorePermissions=!1,Tt.init(),wt($),wt(Z),i(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),jr&&kr(t),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)t=u.postRun.shift(),Q.unshift(t);var t;wt(Q)}()))}t=t||m,et>0||(!function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)t=u.preRun.shift(),J.unshift(t);var t;wt(J)}(),et>0||(u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),r()},1)):r()))}function Dr(t,r){A=t,rt()||!0,function(t){A=t,rt()||(u.onExit&&u.onExit(t),T=!0);v(t,new Er(t))}(t)}if(ot=function t(){Wt||br(),Wt||(ot=t)},u.run=br,u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var jr=!0;return u.noInitialRun&&(jr=!1),br(),r.ready}}();"object"==typeof exports&&"object"==typeof module?module.exports=i:"function"==typeof t&&t.amd?t([],function(){return i}):"object"==typeof exports&&(exports.startWerckmeisterJs=i);
|
|
488
|
+
var r,t="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs/werckmeister.js",e=require("process"),n="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs",o=require("buffer").Buffer,i=function(){var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return void 0!==t&&(r=r||t),function(t){var i,a,u=void 0!==(t=t||{})?t:{};u.ready=new Promise(function(r,t){i=r,a=t});var s,c={};for(s in u)u.hasOwnProperty(s)&&(c[s]=u[s]);var f,l,d,m,p,h=[],v="./this.program",g=function(r,t){throw t},w="object"==typeof window,y="function"==typeof importScripts,_="object"==typeof e&&"object"==typeof e.versions&&"string"==typeof e.versions.node,E="";_?(E=y?require("path").dirname(E)+"/":n+"/",f=function(r,t){return m||(m=require("fs")),p||(p=require("path")),r=p.normalize(r),m.readFileSync(r,t?null:"utf8")},d=function(r){var t=f(r,!0);return t.buffer||(t=new Uint8Array(t)),x(t.buffer),t},l=function(r,t,e){m||(m=require("fs")),p||(p=require("path")),r=p.normalize(r),m.readFile(r,function(r,n){r?e(r):t(n.buffer)})},e.argv.length>1&&(v=e.argv[1].replace(/\\/g,"/")),h=e.argv.slice(2),e.on("uncaughtException",function(r){if(!(r instanceof Et))throw r}),e.on("unhandledRejection",sr),g=function(r,t){if(tr())throw e.exitCode=r,t;e.exit(r)},u.inspect=function(){return"[Emscripten Module object]"}):(w||y)&&(y?E=self.location.href:"undefined"!=typeof document&&document.currentScript&&(E=document.currentScript.src),r&&(E=r),E=0!==E.indexOf("blob:")?E.substr(0,E.lastIndexOf("/")+1):"",f=function(r){var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText},y&&(d=function(r){var t=new XMLHttpRequest;return t.open("GET",r,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=function(r,t,e){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):e()},n.onerror=e,n.send(null)});var b=u.print||console.log.bind(console),k=u.printErr||console.warn.bind(console);for(s in c)c.hasOwnProperty(s)&&(u[s]=c[s]);c=null,u.arguments&&(h=u.arguments),u.thisProgram&&(v=u.thisProgram),u.quit&&(g=u.quit);var D,j=0,S=function(r){j=r},F=function(){return j};u.wasmBinary&&(D=u.wasmBinary);var M,A=u.noExitRuntime||!0;"object"!=typeof WebAssembly&&sr("no native wasm support detected");var P,T=!1;function x(r,t){r||sr("Assertion failed: "+t)}function C(r){var t=u["_"+r];return x(t,"Cannot call unknown function "+r+", make sure it is exported"),t}function R(r,t,e,n,o){var i={string:function(r){var t=0;if(null!=r&&0!==r){var e=1+(r.length<<2);q(r,t=tt(e),e)}return t},array:function(r){var t=tt(r.length);return V(r,t),t}};var a=C(r),u=[],s=0;if(n)for(var c=0;c<n.length;c++){var f=i[e[c]];f?(0===s&&(s=Qr()),u[c]=f(n[c])):u[c]=n[c]}var l=a.apply(null,u);return l=function(r){return 0!==s&&rt(s),function(r){return"string"===t?H(r):"boolean"===t?Boolean(r):r}(r)}(l)}var z,O,B,N,I,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.subarray&&U)return U.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 H(r,t){return r?L(B,r,t):""}function Y(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);if(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 q(r,t,e){return Y(r,B,t,e)}function G(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 W(r){var t=G(r)+1,e=Vr(t);return e&&Y(r,O,e,t),e}function X(r){var t=G(r)+1,e=tt(t);return Y(r,O,e,t),e}function V(r,t){O.set(r,t)}u.INITIAL_MEMORY;var K,J=[],$=[],Z=[],Q=[],rr=0;function tr(){return A||rr>0}var er=0,nr=null,or=null;function ir(r){return r}function ar(r){er++,u.monitorRunDependencies&&u.monitorRunDependencies(er)}function ur(r){if(er--,u.monitorRunDependencies&&u.monitorRunDependencies(er),0==er&&(null!==nr&&(clearInterval(nr),nr=null),or)){var t=or;or=null,t()}}function sr(r){u.onAbort&&u.onAbort(r),k(r+=""),T=!0,P=1,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(r);throw a(t),t}u.preloadedImages={},u.preloadedAudios={};var cr,fr,lr,dr,mr,pr="data:application/octet-stream;base64,";function hr(r){return r.startsWith(pr)}function vr(r){return r.startsWith("file://")}function gr(r){try{if(r==cr&&D)return new Uint8Array(D);if(d)return d(r);throw"both async and sync fetching of the wasm failed"}catch(k){sr(k)}}function wr(r){for(;r.length>0;){var t=r.shift();if("function"!=typeof t){var e=t.func;"number"==typeof e?void 0===t.arg?K.get(e)():K.get(e)(t.arg):e(void 0===t.arg?null:t.arg)}else t(u)}}hr(cr="werckmeister.wasm")||(fr=cr,cr=u.locateFile?u.locateFile(fr,E):E+fr),mr=_?function(){var r=e.hrtime();return 1e3*r[0]+r[1]/1e6}:function(){return performance.now()};var yr=!0;function _r(r){return I[Kr()>>2]=r,r}function Er(r){this.excPtr=r,this.ptr=r-16,this.set_type=function(r){I[this.ptr+4>>2]=r},this.get_type=function(){return I[this.ptr+4>>2]},this.set_destructor=function(r){I[this.ptr+8>>2]=r},this.get_destructor=function(){return I[this.ptr+8>>2]},this.set_refcount=function(r){I[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,O[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=O[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,O[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=O[this.ptr+13>>0]},this.init=function(r,t){this.set_type(r),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=I[this.ptr>>2];I[this.ptr>>2]=r+1},this.release_ref=function(){var r=I[this.ptr>>2];return I[this.ptr>>2]=r-1,1===r}}function br(r){this.free=function(){Xr(this.ptr),this.ptr=0},this.set_base_ptr=function(r){I[this.ptr>>2]=r},this.get_base_ptr=function(){return I[this.ptr>>2]},this.set_adjusted_ptr=function(r){I[this.ptr+4>>2]=r},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return I[this.ptr+4>>2]},this.get_exception_ptr=function(){if(ot(this.get_exception_info().get_type()))return I[this.get_base_ptr()>>2];var r=this.get_adjusted_ptr();return 0!==r?r:this.get_base_ptr()},this.get_exception_info=function(){return new Er(this.get_base_ptr())},void 0===r?(this.ptr=Vr(8),this.set_adjusted_ptr(0)):this.ptr=r}var kr=[];var Dr=0;var jr=0;function Sr(r){try{return Xr(new Er(r).ptr)}catch(t){}}function Fr(r,t){var e=new Date(1e3*I[r>>2]);I[t>>2]=e.getUTCSeconds(),I[t+4>>2]=e.getUTCMinutes(),I[t+8>>2]=e.getUTCHours(),I[t+12>>2]=e.getUTCDate(),I[t+16>>2]=e.getUTCMonth(),I[t+20>>2]=e.getUTCFullYear()-1900,I[t+24>>2]=e.getUTCDay(),I[t+36>>2]=0,I[t+32>>2]=0;var n=Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0),o=(e.getTime()-n)/864e5|0;return I[t+28>>2]=o,Fr.GMTString||(Fr.GMTString=W("GMT")),I[t+40>>2]=Fr.GMTString,t}function Mr(){Mr.called||(Mr.called=!0,function(){var r=(new Date).getFullYear(),t=new Date(r,0,1),e=new Date(r,6,1),n=t.getTimezoneOffset(),o=e.getTimezoneOffset(),i=Math.max(n,o);function a(r){var t=r.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[Zr()>>2]=60*i,I[$r()>>2]=Number(n!=o);var u=a(t),s=a(e),c=W(u),f=W(s);o<n?(I[Jr()>>2]=c,I[Jr()+4>>2]=f):(I[Jr()>>2]=f,I[Jr()+4>>2]=c)}())}var Ar={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=Ar.normalizeArray(r.split("/").filter(function(r){return!!r}),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:function(r){var t=Ar.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=(r=Ar.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?r:r.substr(t+1)},extname:function(r){return Ar.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return Ar.normalize(r.join("/"))},join2:function(r,t){return Ar.normalize(r+"/"+t)}};var Pr={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:Cr.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=Ar.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=Pr.resolve(r).substr(1),t=Pr.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("/")}},Tr={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){Tr.ttys[r]={input:[],output:[],ops:t},Cr.registerDevice(r,Tr.stream_ops)},stream_ops:{open:function(r){var t=Tr.ttys[r.node.rdev];if(!t)throw new Cr.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 Cr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var u;try{u=r.tty.ops.get_char(r.tty)}catch(s){throw new Cr.ErrnoError(29)}if(void 0===u&&0===i)throw new Cr.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 Cr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,t[e+i])}catch(a){throw new Cr.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(_){var n=o.alloc(256),i=0;try{i=m.readSync(e.stdin.fd,n,0,256,null)}catch(a){if(!a.toString().includes("EOF"))throw a;i=0}t=i>0?n.slice(0,i).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;r.input=qr(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(b(L(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(b(L(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(k(L(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(k(L(r.output,0)),r.output=[])}}};var xr={ops_table:null,mount:function(r){return xr.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(Cr.isBlkdev(e)||Cr.isFIFO(e))throw new Cr.ErrnoError(63);xr.ops_table||(xr.ops_table={dir:{node:{getattr:xr.node_ops.getattr,setattr:xr.node_ops.setattr,lookup:xr.node_ops.lookup,mknod:xr.node_ops.mknod,rename:xr.node_ops.rename,unlink:xr.node_ops.unlink,rmdir:xr.node_ops.rmdir,readdir:xr.node_ops.readdir,symlink:xr.node_ops.symlink},stream:{llseek:xr.stream_ops.llseek}},file:{node:{getattr:xr.node_ops.getattr,setattr:xr.node_ops.setattr},stream:{llseek:xr.stream_ops.llseek,read:xr.stream_ops.read,write:xr.stream_ops.write,allocate:xr.stream_ops.allocate,mmap:xr.stream_ops.mmap,msync:xr.stream_ops.msync}},link:{node:{getattr:xr.node_ops.getattr,setattr:xr.node_ops.setattr,readlink:xr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:xr.node_ops.getattr,setattr:xr.node_ops.setattr},stream:Cr.chrdev_stream_ops}});var o=Cr.createNode(r,t,e,n);return Cr.isDir(o.mode)?(o.node_ops=xr.ops_table.dir.node,o.stream_ops=xr.ops_table.dir.stream,o.contents={}):Cr.isFile(o.mode)?(o.node_ops=xr.ops_table.file.node,o.stream_ops=xr.ops_table.file.stream,o.usedBytes=0,o.contents=null):Cr.isLink(o.mode)?(o.node_ops=xr.ops_table.link.node,o.stream_ops=xr.ops_table.link.stream):Cr.isChrdev(o.mode)&&(o.node_ops=xr.ops_table.chrdev.node,o.stream_ops=xr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},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)r.contents=null,r.usedBytes=0;else{var e=r.contents;r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=Cr.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,Cr.isDir(r.mode)?t.size=4096:Cr.isFile(r.mode)?t.size=r.usedBytes:Cr.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&&xr.resizeFileStorage(r,t.size)},lookup:function(r,t){throw Cr.genericErrors[44]},mknod:function(r,t,e,n){return xr.createNode(r,t,e,n)},rename:function(r,t,e){if(Cr.isDir(r.mode)){var n;try{n=Cr.lookupNode(t,e)}catch(i){}if(n)for(var o in n.contents)throw new Cr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=e,t.contents[e]=r,t.timestamp=r.parent.timestamp,r.parent=t},unlink:function(r,t){delete r.contents[t],r.timestamp=Date.now()},rmdir:function(r,t){var e=Cr.lookupNode(r,t);for(var n in e.contents)throw new Cr.ErrnoError(55);delete r.contents[t],r.timestamp=Date.now()},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=xr.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!Cr.isLink(r.mode))throw new Cr.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(!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(xr.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&&Cr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Cr.ErrnoError(28);return n},allocate:function(r,t,e){xr.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o,i){if(0!==t)throw new Cr.ErrnoError(28);if(!Cr.isFile(r.node.mode))throw new Cr.ErrnoError(43);var a,u,s=r.node.contents;if(2&i||s.buffer!==z){if((n>0||n+e<s.length)&&(s=s.subarray?s.subarray(n,n+e):Array.prototype.slice.call(s,n,n+e)),u=!0,!(a=void sr()))throw new Cr.ErrnoError(48);O.set(s,a)}else u=!1,a=s.byteOffset;return{ptr:a,allocated:u}},msync:function(r,t,e,n,o){if(!Cr.isFile(r.node.mode))throw new Cr.ErrnoError(43);if(2&o)return 0;xr.stream_ops.write(r,t,0,n,e,!1);return 0}}};var Cr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,t){if(t=t||{},!(r=Pr.resolve(Cr.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 Cr.ErrnoError(32);for(var o=Ar.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=Cr.root,a="/",u=0;u<o.length;u++){var s=u===o.length-1;if(s&&t.parent)break;if(i=Cr.lookupNode(i,o[u]),a=Ar.join2(a,o[u]),Cr.isMountpoint(i)&&(!s||s&&t.follow_mount)&&(i=i.mounted.root),!s||t.follow)for(var c=0;Cr.isLink(i.mode);){var f=Cr.readlink(a);if(a=Pr.resolve(Ar.dirname(a),f),i=Cr.lookupPath(a,{recurse_count:t.recurse_count}).node,c++>40)throw new Cr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var t;;){if(Cr.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)%Cr.nameTable.length},hashAddNode:function(r){var t=Cr.hashName(r.parent.id,r.name);r.name_next=Cr.nameTable[t],Cr.nameTable[t]=r},hashRemoveNode:function(r){var t=Cr.hashName(r.parent.id,r.name);if(Cr.nameTable[t]===r)Cr.nameTable[t]=r.name_next;else for(var e=Cr.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=Cr.mayLookup(r);if(e)throw new Cr.ErrnoError(e,r);for(var n=Cr.hashName(r.id,t),o=Cr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===t)return o}return Cr.lookup(r,t)},createNode:function(r,t,e,n){var o=new Cr.FSNode(r,t,e,n);return Cr.hashAddNode(o),o},destroyNode:function(r){Cr.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,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var t=Cr.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 Cr.ignorePermissions?0:(!t.includes("r")||292&r.mode)&&(!t.includes("w")||146&r.mode)&&(!t.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var t=Cr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:function(r,t){try{Cr.lookupNode(r,t);return 20}catch(e){}return Cr.nodePermissions(r,"wx")},mayDelete:function(r,t,e){var n;try{n=Cr.lookupNode(r,t)}catch(i){return i.errno}var o=Cr.nodePermissions(r,"wx");if(o)return o;if(e){if(!Cr.isDir(n.mode))return 54;if(Cr.isRoot(n)||Cr.getPath(n)===Cr.cwd())return 10}else if(Cr.isDir(n.mode))return 31;return 0},mayOpen:function(r,t){return r?Cr.isLink(r.mode)?32:Cr.isDir(r.mode)&&("r"!==Cr.flagsToPermissionString(t)||512&t)?31:Cr.nodePermissions(r,Cr.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(r,t){r=r||0,t=t||Cr.MAX_OPEN_FDS;for(var e=r;e<=t;e++)if(!Cr.streams[e])return e;throw new Cr.ErrnoError(33)},getStream:function(r){return Cr.streams[r]},createStream:function(r,t,e){Cr.FSStream||(Cr.FSStream=function(){},Cr.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 Cr.FSStream;for(var o in r)n[o]=r[o];r=n;var i=Cr.nextfd(t,e);return r.fd=i,Cr.streams[i]=r,r},closeStream:function(r){Cr.streams[r]=null},chrdev_stream_ops:{open:function(r){var t=Cr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new Cr.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){Cr.devices[r]={stream_ops:t}},getDevice:function(r){return Cr.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),Cr.syncFSRequests++,Cr.syncFSRequests>1&&k("warning: "+Cr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=Cr.getMounts(Cr.root.mount),n=0;function o(r){return Cr.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&&Cr.root)throw new Cr.ErrnoError(10);if(!o&&!i){var a=Cr.lookupPath(e,{follow_mount:!1});if(e=a.path,n=a.node,Cr.isMountpoint(n))throw new Cr.ErrnoError(10);if(!Cr.isDir(n.mode))throw new Cr.ErrnoError(54)}var u={type:r,opts:t,mountpoint:e,mounts:[]},s=r.mount(u);return s.mount=u,u.root=s,o?Cr.root=s:n&&(n.mounted=u,n.mount&&n.mount.mounts.push(u)),s},unmount:function(r){var t=Cr.lookupPath(r,{follow_mount:!1});if(!Cr.isMountpoint(t.node))throw new Cr.ErrnoError(28);var e=t.node,n=e.mounted,o=Cr.getMounts(n);Object.keys(Cr.nameTable).forEach(function(r){for(var t=Cr.nameTable[r];t;){var e=t.name_next;o.includes(t.mount)&&Cr.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=Cr.lookupPath(r,{parent:!0}).node,o=Ar.basename(r);if(!o||"."===o||".."===o)throw new Cr.ErrnoError(28);var i=Cr.mayCreate(n,o);if(i)throw new Cr.ErrnoError(i);if(!n.node_ops.mknod)throw new Cr.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,Cr.mknod(r,t,0)},mkdir:function(r,t){return t=void 0!==t?t:511,t&=1023,t|=16384,Cr.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{Cr.mkdir(n,t)}catch(i){if(20!=i.errno)throw i}}},mkdev:function(r,t,e){return void 0===e&&(e=t,t=438),t|=8192,Cr.mknod(r,t,e)},symlink:function(r,t){if(!Pr.resolve(r))throw new Cr.ErrnoError(44);var e=Cr.lookupPath(t,{parent:!0}).node;if(!e)throw new Cr.ErrnoError(44);var n=Ar.basename(t),o=Cr.mayCreate(e,n);if(o)throw new Cr.ErrnoError(o);if(!e.node_ops.symlink)throw new Cr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:function(r,t){var e,n,o=Ar.dirname(r),i=Ar.dirname(t),a=Ar.basename(r),u=Ar.basename(t);if(e=Cr.lookupPath(r,{parent:!0}).node,n=Cr.lookupPath(t,{parent:!0}).node,!e||!n)throw new Cr.ErrnoError(44);if(e.mount!==n.mount)throw new Cr.ErrnoError(75);var s,c=Cr.lookupNode(e,a),f=Pr.relative(r,i);if("."!==f.charAt(0))throw new Cr.ErrnoError(28);if("."!==(f=Pr.relative(t,o)).charAt(0))throw new Cr.ErrnoError(55);try{s=Cr.lookupNode(n,u)}catch(m){}if(c!==s){var l=Cr.isDir(c.mode),d=Cr.mayDelete(e,a,l);if(d)throw new Cr.ErrnoError(d);if(d=s?Cr.mayDelete(n,u,l):Cr.mayCreate(n,u))throw new Cr.ErrnoError(d);if(!e.node_ops.rename)throw new Cr.ErrnoError(63);if(Cr.isMountpoint(c)||s&&Cr.isMountpoint(s))throw new Cr.ErrnoError(10);if(n!==e&&(d=Cr.nodePermissions(e,"w")))throw new Cr.ErrnoError(d);Cr.hashRemoveNode(c);try{e.node_ops.rename(c,n,u)}catch(m){throw m}finally{Cr.hashAddNode(c)}}},rmdir:function(r){var t=Cr.lookupPath(r,{parent:!0}).node,e=Ar.basename(r),n=Cr.lookupNode(t,e),o=Cr.mayDelete(t,e,!0);if(o)throw new Cr.ErrnoError(o);if(!t.node_ops.rmdir)throw new Cr.ErrnoError(63);if(Cr.isMountpoint(n))throw new Cr.ErrnoError(10);t.node_ops.rmdir(t,e),Cr.destroyNode(n)},readdir:function(r){var t=Cr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new Cr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(r){var t=Cr.lookupPath(r,{parent:!0}).node,e=Ar.basename(r),n=Cr.lookupNode(t,e),o=Cr.mayDelete(t,e,!1);if(o)throw new Cr.ErrnoError(o);if(!t.node_ops.unlink)throw new Cr.ErrnoError(63);if(Cr.isMountpoint(n))throw new Cr.ErrnoError(10);t.node_ops.unlink(t,e),Cr.destroyNode(n)},readlink:function(r){var t=Cr.lookupPath(r).node;if(!t)throw new Cr.ErrnoError(44);if(!t.node_ops.readlink)throw new Cr.ErrnoError(28);return Pr.resolve(Cr.getPath(t.parent),t.node_ops.readlink(t))},stat:function(r,t){var e=Cr.lookupPath(r,{follow:!t}).node;if(!e)throw new Cr.ErrnoError(44);if(!e.node_ops.getattr)throw new Cr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:function(r){return Cr.stat(r,!0)},chmod:function(r,t,e){var n;"string"==typeof r?n=Cr.lookupPath(r,{follow:!e}).node:n=r;if(!n.node_ops.setattr)throw new Cr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,t){Cr.chmod(r,t,!0)},fchmod:function(r,t){var e=Cr.getStream(r);if(!e)throw new Cr.ErrnoError(8);Cr.chmod(e.node,t)},chown:function(r,t,e,n){var o;"string"==typeof r?o=Cr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new Cr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,t,e){Cr.chown(r,t,e,!0)},fchown:function(r,t,e){var n=Cr.getStream(r);if(!n)throw new Cr.ErrnoError(8);Cr.chown(n.node,t,e)},truncate:function(r,t){if(t<0)throw new Cr.ErrnoError(28);var e;"string"==typeof r?e=Cr.lookupPath(r,{follow:!0}).node:e=r;if(!e.node_ops.setattr)throw new Cr.ErrnoError(63);if(Cr.isDir(e.mode))throw new Cr.ErrnoError(31);if(!Cr.isFile(e.mode))throw new Cr.ErrnoError(28);var n=Cr.nodePermissions(e,"w");if(n)throw new Cr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:function(r,t){var e=Cr.getStream(r);if(!e)throw new Cr.ErrnoError(8);if(0==(2097155&e.flags))throw new Cr.ErrnoError(28);Cr.truncate(e.node,t)},utime:function(r,t,e){var n=Cr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:function(r,t,e,n,o){if(""===r)throw new Cr.ErrnoError(44);var i;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?Cr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)i=r;else{r=Ar.normalize(r);try{i=Cr.lookupPath(r,{follow:!(131072&t)}).node}catch(f){}}var a=!1;if(64&t)if(i){if(128&t)throw new Cr.ErrnoError(20)}else i=Cr.mknod(r,e,0),a=!0;if(!i)throw new Cr.ErrnoError(44);if(Cr.isChrdev(i.mode)&&(t&=-513),65536&t&&!Cr.isDir(i.mode))throw new Cr.ErrnoError(54);if(!a){var s=Cr.mayOpen(i,t);if(s)throw new Cr.ErrnoError(s)}512&t&&Cr.truncate(i,0),t&=-131713;var c=Cr.createStream({node:i,path:Cr.getPath(i),flags:t,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!u.logReadFiles||1&t||(Cr.readFiles||(Cr.readFiles={}),r in Cr.readFiles||(Cr.readFiles[r]=1)),c},close:function(r){if(Cr.isClosed(r))throw new Cr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(t){throw t}finally{Cr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,t,e){if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Cr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new Cr.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 Cr.ErrnoError(28);if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(1==(2097155&r.flags))throw new Cr.ErrnoError(8);if(Cr.isDir(r.node.mode))throw new Cr.ErrnoError(31);if(!r.stream_ops.read)throw new Cr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new Cr.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 Cr.ErrnoError(28);if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(0==(2097155&r.flags))throw new Cr.ErrnoError(8);if(Cr.isDir(r.node.mode))throw new Cr.ErrnoError(31);if(!r.stream_ops.write)throw new Cr.ErrnoError(28);r.seekable&&1024&r.flags&&Cr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new Cr.ErrnoError(70)}else o=r.position;var u=r.stream_ops.write(r,t,e,n,o,i);return a||(r.position+=u),u},allocate:function(r,t,e){if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(t<0||e<=0)throw new Cr.ErrnoError(28);if(0==(2097155&r.flags))throw new Cr.ErrnoError(8);if(!Cr.isFile(r.node.mode)&&!Cr.isDir(r.node.mode))throw new Cr.ErrnoError(43);if(!r.stream_ops.allocate)throw new Cr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:function(r,t,e,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new Cr.ErrnoError(2);if(1==(2097155&r.flags))throw new Cr.ErrnoError(2);if(!r.stream_ops.mmap)throw new Cr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o,i)},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 Cr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:function(r,t){if((t=t||{}).flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var e,n=Cr.open(r,t.flags),o=Cr.stat(r).size,i=new Uint8Array(o);return Cr.read(n,i,0,o,0),"utf8"===t.encoding?e=L(i,0):"binary"===t.encoding&&(e=i),Cr.close(n),e},writeFile:function(r,t,e){(e=e||{}).flags=e.flags||577;var n=Cr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(G(t)+1),i=Y(t,o,0,o.length);Cr.write(n,o,0,i,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Cr.write(n,t,0,t.byteLength,void 0,e.canOwn)}Cr.close(n)},cwd:function(){return Cr.currentPath},chdir:function(r){var t=Cr.lookupPath(r,{follow:!0});if(null===t.node)throw new Cr.ErrnoError(44);if(!Cr.isDir(t.node.mode))throw new Cr.ErrnoError(54);var e=Cr.nodePermissions(t.node,"x");if(e)throw new Cr.ErrnoError(e);Cr.currentPath=t.path},createDefaultDirectories:function(){Cr.mkdir("/tmp"),Cr.mkdir("/home"),Cr.mkdir("/home/web_user")},createDefaultDevices:function(){Cr.mkdir("/dev"),Cr.registerDevice(Cr.makedev(1,3),{read:function(){return 0},write:function(r,t,e,n,o){return n}}),Cr.mkdev("/dev/null",Cr.makedev(1,3)),Tr.register(Cr.makedev(5,0),Tr.default_tty_ops),Tr.register(Cr.makedev(6,0),Tr.default_tty1_ops),Cr.mkdev("/dev/tty",Cr.makedev(5,0)),Cr.mkdev("/dev/tty1",Cr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}if(_)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){sr("randomDevice")}}();Cr.createDevice("/dev","random",r),Cr.createDevice("/dev","urandom",r),Cr.mkdir("/dev/shm"),Cr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Cr.mkdir("/proc");var r=Cr.mkdir("/proc/self");Cr.mkdir("/proc/self/fd"),Cr.mount({mount:function(){var t=Cr.createNode(r,"fd",16895,73);return t.node_ops={lookup:function(r,t){var e=+t,n=Cr.getStream(e);if(!n)throw new Cr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){u.stdin?Cr.createDevice("/dev","stdin",u.stdin):Cr.symlink("/dev/tty","/dev/stdin"),u.stdout?Cr.createDevice("/dev","stdout",null,u.stdout):Cr.symlink("/dev/tty","/dev/stdout"),u.stderr?Cr.createDevice("/dev","stderr",null,u.stderr):Cr.symlink("/dev/tty1","/dev/stderr");Cr.open("/dev/stdin",0),Cr.open("/dev/stdout",1),Cr.open("/dev/stderr",1)},ensureErrnoError:function(){Cr.ErrnoError||(Cr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Cr.ErrnoError.prototype=new Error,Cr.ErrnoError.prototype.constructor=Cr.ErrnoError,[44].forEach(function(r){Cr.genericErrors[r]=new Cr.ErrnoError(r),Cr.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){Cr.ensureErrnoError(),Cr.nameTable=new Array(4096),Cr.mount(xr,{},"/"),Cr.createDefaultDirectories(),Cr.createDefaultDevices(),Cr.createSpecialDirectories(),Cr.filesystems={MEMFS:xr}},init:function(r,t,e){Cr.init.initialized=!0,Cr.ensureErrnoError(),u.stdin=r||u.stdin,u.stdout=t||u.stdout,u.stderr=e||u.stderr,Cr.createStandardStreams()},quit:function(){Cr.init.initialized=!1;var r=u._fflush;r&&r(0);for(var t=0;t<Cr.streams.length;t++){var e=Cr.streams[t];e&&Cr.close(e)}},getMode:function(r,t){var e=0;return r&&(e|=365),t&&(e|=146),e},findObject:function(r,t){var e=Cr.analyzePath(r,t);return e.exists?e.object:null},analyzePath:function(r,t){try{r=(n=Cr.lookupPath(r,{follow:!t})).path}catch(o){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Cr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=Ar.basename(r),n=Cr.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(o){e.error=o.errno}return e},createPath:function(r,t,e,n){r="string"==typeof r?r:Cr.getPath(r);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=Ar.join2(r,i);try{Cr.mkdir(a)}catch(u){}r=a}}return a},createFile:function(r,t,e,n,o){var i=Ar.join2("string"==typeof r?r:Cr.getPath(r),t),a=Cr.getMode(n,o);return Cr.create(i,a)},createDataFile:function(r,t,e,n,o,i){var a=t?Ar.join2("string"==typeof r?r:Cr.getPath(r),t):r,u=Cr.getMode(n,o),s=Cr.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}Cr.chmod(s,146|u);var d=Cr.open(s,577);Cr.write(d,e,0,e.length,0,i),Cr.close(d),Cr.chmod(s,u)}return s},createDevice:function(r,t,e,n){var o=Ar.join2("string"==typeof r?r:Cr.getPath(r),t),i=Cr.getMode(!!e,!!n);Cr.createDevice.major||(Cr.createDevice.major=64);var a=Cr.makedev(Cr.createDevice.major++,0);return Cr.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(c){throw new Cr.ErrnoError(29)}if(void 0===s&&0===a)throw new Cr.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(u){throw new Cr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Cr.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=qr(f(r.url),!0),r.usedBytes=r.contents.length}catch(t){throw new Cr.ErrnoError(29)}},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||[]):qr(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,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!y)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:a}}else u={isDevice:!1,url:e};var s=Cr.createFile(r,t,u,n,o);u.contents?s.contents=u.contents:u.url&&(s.contents=null,s.url=u.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(s.stream_ops).forEach(function(r){var t=s.stream_ops[r];c[r]=function(){return Cr.forceLoadFile(s),t.apply(null,arguments)}}),c.read=function(r,t,e,n,o){Cr.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)t[e+u]=i[o+u];else for(u=0;u<a;u++)t[e+u]=i.get(o+u);return a},s.stream_ops=c,s},createPreloadedFile:function(r,t,e,n,o,i,a,s,c,f){Browser.init();var d=t?Pr.resolve(Ar.join2(r,t)):r;ir("cp "+d);function m(e){function l(e){f&&f(),s||Cr.createDataFile(r,t,e,n,o,c),i&&i(),ur()}var m=!1;u.preloadPlugins.forEach(function(r){m||r.canHandle(d)&&(r.handle(e,d,l,function(){a&&a(),ur()}),m=!0)}),m||l(e)}ar(),"string"==typeof e?function(r,t,e,n){var o=n?"":ir("al "+r);l(r,function(e){x(e,'Loading data file "'+r+'" failed (no arrayBuffer).'),t(new Uint8Array(e)),o&&ur()},function(t){if(!e)throw'Loading data file "'+r+'" failed.';e()}),o&&ar()}(e,function(r){m(r)},a):m(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=Cr.indexedDB();try{var o=n.open(Cr.DB_NAME(),Cr.DB_VERSION)}catch(i){return e(i)}o.onupgradeneeded=function(){b("creating db"),o.result.createObjectStore(Cr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Cr.DB_STORE_NAME],"readwrite"),i=n.objectStore(Cr.DB_STORE_NAME),a=0,u=0,s=r.length;function c(){0==u?t():e()}r.forEach(function(r){var t=i.put(Cr.analyzePath(r).object.contents,r);t.onsuccess=function(){++a+u==s&&c()},t.onerror=function(){a+ ++u==s&&c()}}),n.onerror=e},o.onerror=e},loadFilesFromDB:function(r,t,e){t=t||function(){},e=e||function(){};var n=Cr.indexedDB();try{var o=n.open(Cr.DB_NAME(),Cr.DB_VERSION)}catch(i){return e(i)}o.onupgradeneeded=e,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([Cr.DB_STORE_NAME],"readonly")}catch(i){return void e(i)}var u=a.objectStore(Cr.DB_STORE_NAME),s=0,c=0,f=r.length;function l(){0==c?t():e()}r.forEach(function(r){var t=u.get(r);t.onsuccess=function(){Cr.analyzePath(r).exists&&Cr.unlink(r),Cr.createDataFile(Ar.dirname(r),Ar.basename(r),t.result,!0,!0,!0),++s+c==f&&l()},t.onerror=function(){s+ ++c==f&&l()}}),a.onerror=e},o.onerror=e}},Rr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,t,e){if("/"===t[0])return t;var n;if(-100===r)n=Cr.cwd();else{var o=Cr.getStream(r);if(!o)throw new Cr.ErrnoError(8);n=o.path}if(0==t.length){if(!e)throw new Cr.ErrnoError(44);return n}return Ar.join2(n,t)},doStat:function(r,t,e){try{var n=r(t)}catch(o){if(o&&o.node&&Ar.normalize(t)!==Ar.normalize(Cr.getPath(o.node)))return-54;throw o}return I[e>>2]=n.dev,I[e+4>>2]=0,I[e+8>>2]=n.ino,I[e+12>>2]=n.mode,I[e+16>>2]=n.nlink,I[e+20>>2]=n.uid,I[e+24>>2]=n.gid,I[e+28>>2]=n.rdev,I[e+32>>2]=0,dr=[n.size>>>0,(lr=n.size,+Math.abs(lr)>=1?lr>0?(0|Math.min(+Math.floor(lr/4294967296),4294967295))>>>0:~~+Math.ceil((lr-+(~~lr>>>0))/4294967296)>>>0:0)],I[e+40>>2]=dr[0],I[e+44>>2]=dr[1],I[e+48>>2]=4096,I[e+52>>2]=n.blocks,I[e+56>>2]=n.atime.getTime()/1e3|0,I[e+60>>2]=0,I[e+64>>2]=n.mtime.getTime()/1e3|0,I[e+68>>2]=0,I[e+72>>2]=n.ctime.getTime()/1e3|0,I[e+76>>2]=0,dr=[n.ino>>>0,(lr=n.ino,+Math.abs(lr)>=1?lr>0?(0|Math.min(+Math.floor(lr/4294967296),4294967295))>>>0:~~+Math.ceil((lr-+(~~lr>>>0))/4294967296)>>>0:0)],I[e+80>>2]=dr[0],I[e+84>>2]=dr[1],0},doMsync:function(r,t,e,n,o){var i=B.slice(r,r+e);Cr.msync(t,i,o,e,n)},doMkdir:function(r,t){return"/"===(r=Ar.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Cr.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 Cr.mknod(r,t,e),0},doReadlink:function(r,t,e){if(e<=0)return-28;var n=Cr.readlink(r),o=Math.min(e,G(n)),i=O[t+o];return q(n,t,e+1),O[t+o]=i,o},doAccess:function(r,t){if(-8&t)return-28;var e;if(!(e=Cr.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&Cr.nodePermissions(e,n)?-2:0},doDup:function(r,t,e){var n=Cr.getStream(e);return n&&Cr.close(n),Cr.open(r,t,0,e,e).fd},doReadv:function(r,t,e,n){for(var o=0,i=0;i<e;i++){var a=I[t+8*i>>2],u=I[t+(8*i+4)>>2],s=Cr.read(r,O,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=I[t+8*i>>2],u=I[t+(8*i+4)>>2],s=Cr.write(r,O,a,u,n);if(s<0)return-1;o+=s}return o},varargs:void 0,get:function(){return Rr.varargs+=4,I[Rr.varargs-4>>2]},getStr:function(r){return H(r)},getStreamFromFD:function(r){var t=Cr.getStream(r);if(!t)throw new Cr.ErrnoError(8);return t},get64:function(r,t){return r}};var zr={};function Or(){if(!Or.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",_:v||"./this.program"};for(var t in zr)void 0===zr[t]?delete r[t]:r[t]=zr[t];var e=[];for(var t in r)e.push(t+"="+r[t]);Or.strings=e}return Or.strings}function Br(r){return r%4==0&&(r%100!=0||r%400==0)}function Nr(r,t){for(var e=0,n=0;n<=t;e+=r[n++]);return e}var Ir=[31,29,31,30,31,30,31,31,30,31,30,31],Ur=[31,28,31,30,31,30,31,31,30,31,30,31];function Lr(r,t){for(var e=new Date(r.getTime());t>0;){var n=Br(e.getFullYear()),o=e.getMonth(),i=(n?Ir:Ur)[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 Hr(r,t,e,n){var o=I[n+40>>2],i={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:o?H(o):""},a=H(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 m(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 p(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=Lr(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=p(e),i=p(n);return m(o,t)<=0?m(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+Nr(Br(r.tm_year+1900)?Ir:Ur,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:Lr(t,7-t.getDay()),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(m(e,n)<0){var o=Nr(Br(n.getFullYear())?Ir:Ur,n.getMonth()-1)-31,i=31-e.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===m(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=p(e),i=p(n),a=Lr(new Date(r.tm_year+1900,0,1),r.tm_yday);return m(a,o)<0?"53":m(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:Lr(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(m(e,n)<0){var o=Nr(Br(n.getFullYear())?Ir:Ur,n.getMonth()-1)-31,i=31-e.getDate()+o+n.getDate();return d(Math.ceil(i/7),2)}return 0===m(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.includes(s)&&(a=a.replace(new RegExp(s,"g"),v[s](i)));var g=qr(a,!1);return g.length>t?0:(V(g,r),g.length-1)}var Yr=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Cr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n};function qr(r,t,e){var n=e>0?e:G(r)+1,o=new Array(n),i=Y(r,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(Yr.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 Cr.isDir(this.mode)}},isDevice:{get:function(){return Cr.isChrdev(this.mode)}}}),Cr.FSNode=Yr,Cr.staticInit();var Gr,Wr={ua:function(r,t){return function(r,t){var e;if(0===r)e=Date.now();else{if(1!==r&&4!==r||!yr)return _r(28),-1;e=mr()}return I[t>>2]=e/1e3|0,I[t+4>>2]=e%1e3*1e3*1e3|0,0}(r,t)},k:function(r){return Vr(r+16)+16},q:function(r){var t=new br(r),e=t.get_exception_info();return e.get_caught()||(e.set_caught(!0),Dr--),e.set_rethrown(!1),kr.push(t),function(r){r.add_ref()}(e),t.get_exception_ptr()},v:function(){et(0);var r=kr.pop();!function(r){if(r.release_ref()&&!r.get_rethrown()){var t=r.get_destructor();t&&K.get(t)(r.excPtr),Sr(r.excPtr)}}(r.get_exception_info()),r.free(),jr=0},b:function(){var r=jr;if(!r)return S(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===t)break;if(nt(i,t,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(t),0|e.ptr},h:function(){var r=jr;if(!r)return S(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===t)break;if(nt(i,t,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(t),0|e.ptr},B:function(){var r=jr;if(!r)return S(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===t)break;if(nt(i,t,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(t),0|e.ptr},L:function(){var r=jr;if(!r)return S(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return S(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var i=n[o];if(0===i||i===t)break;if(nt(i,t,e.get_adjusted_ptr_addr()))return S(i),0|e.ptr}return S(t),0|e.ptr},m:Sr,W:function(){var r=kr.pop();r||sr("no exception to throw");var t=r.get_exception_info(),e=r.get_base_ptr();throw t.get_rethrown()?r.free():(kr.push(r),t.set_rethrown(!0),t.set_caught(!1),Dr++),jr=e,e},s:function(r,t,e){throw new Er(r).init(t,e),jr=r,Dr++,r},na:function(){return Dr},ta:function(r,t){return Fr(r,t)},sa:function(r,t){return function(r,t){Mr();var e=new Date(1e3*I[r>>2]);I[t>>2]=e.getSeconds(),I[t+4>>2]=e.getMinutes(),I[t+8>>2]=e.getHours(),I[t+12>>2]=e.getDate(),I[t+16>>2]=e.getMonth(),I[t+20>>2]=e.getFullYear()-1900,I[t+24>>2]=e.getDay();var n=new Date(e.getFullYear(),0,1),o=(e.getTime()-n.getTime())/864e5|0;I[t+28>>2]=o,I[t+36>>2]=-60*e.getTimezoneOffset();var i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),u=0|(i!=a&&e.getTimezoneOffset()==Math.min(a,i));I[t+32>>2]=u;var s=I[Jr()+(u?4:0)>>2];return I[t+40>>2]=s,t}(r,t)},c:function(r){var t=new br(r),e=t.get_base_ptr();throw jr||(jr=e),t.free(),e},ya:function(r,t){try{var e=Rr.getStreamFromFD(r);return e.fd===t?t:Rr.doDup(e.path,e.flags,t)}catch(n){return void 0!==Cr&&n instanceof Cr.ErrnoError||sr(n),-n.errno}},za:function(r,t,e){try{var n=Rr.getStreamFromFD(r);return n.fd===t?-28:Rr.doDup(n.path,n.flags,t)}catch(o){return void 0!==Cr&&o instanceof Cr.ErrnoError||sr(o),-o.errno}},I:function(r,t,e){Rr.varargs=e;try{var n=Rr.getStreamFromFD(r);switch(t){case 0:return(o=Rr.get())<0?-28:Cr.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=Rr.get();return n.flags|=o,0;case 12:return o=Rr.get(),N[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return _r(28),-1;default:return-28}}catch(i){return void 0!==Cr&&i instanceof Cr.ErrnoError||sr(i),-i.errno}},va:function(r,t){try{if(0===t)return-28;var e=Cr.cwd();return t<G(e)+1?-68:(q(e,r,t),r)}catch(n){return void 0!==Cr&&n instanceof Cr.ErrnoError||sr(n),-n.errno}},wa:function(){return 42},Aa:function(r,t,e){Rr.varargs=e;try{var n=Rr.getStreamFromFD(r);switch(t){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Rr.get();return I[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=Rr.get(),Cr.ioctl(n,t,o);case 21523:case 21524:return n.tty?0:-59;default:sr("bad ioctl syscall "+t)}}catch(i){return void 0!==Cr&&i instanceof Cr.ErrnoError||sr(i),-i.errno}},S:function(r,t){try{return r=Rr.getStr(r),Rr.doStat(Cr.lstat,r,t)}catch(e){return void 0!==Cr&&e instanceof Cr.ErrnoError||sr(e),-e.errno}},R:function(r,t,e){Rr.varargs=e;try{var n=Rr.getStr(r),o=e?Rr.get():0;return Cr.open(n,t,o).fd}catch(i){return void 0!==Cr&&i instanceof Cr.ErrnoError||sr(i),-i.errno}},xa:function(r,t,e){try{return r=Rr.getStr(r),Rr.doReadlink(r,t,e)}catch(n){return void 0!==Cr&&n instanceof Cr.ErrnoError||sr(n),-n.errno}},Ca:function(r,t){try{return r=Rr.getStr(r),t=Rr.getStr(t),Cr.rename(r,t),0}catch(e){return void 0!==Cr&&e instanceof Cr.ErrnoError||sr(e),-e.errno}},Da:function(r){try{return r=Rr.getStr(r),Cr.rmdir(r),0}catch(t){return void 0!==Cr&&t instanceof Cr.ErrnoError||sr(t),-t.errno}},Ea:function(r,t){try{return r=Rr.getStr(r),Rr.doStat(Cr.stat,r,t)}catch(e){return void 0!==Cr&&e instanceof Cr.ErrnoError||sr(e),-e.errno}},Q:function(r){try{return r=Rr.getStr(r),Cr.unlink(r),0}catch(t){return void 0!==Cr&&t instanceof Cr.ErrnoError||sr(t),-t.errno}},pa:function(){throw"longjmp"},K:function(){sr()},T:function r(){return void 0===r.start&&(r.start=Date.now()),1e3*(Date.now()-r.start)|0},Ia:function(r,t){return r-t},ma:function(r){B.length,sr("OOM")},qa:function(r,t){var e=0;return Or().forEach(function(n,o){var i=t+e;I[r+4*o>>2]=i,function(r,t,e){for(var n=0;n<r.length;++n)O[t++>>0]=r.charCodeAt(n);e||(O[t>>0]=0)}(n,i),e+=n.length+1}),0},ra:function(r,t){var e=Or();I[r>>2]=e.length;var n=0;return e.forEach(function(r){n+=r.length+1}),I[t>>2]=n,0},Ga:function(r){Dt(r)},J:function(r){try{var t=Rr.getStreamFromFD(r);return Cr.close(t),0}catch(e){return void 0!==Cr&&e instanceof Cr.ErrnoError||sr(e),e.errno}},Ba:function(r,t,e,n){try{var o=Rr.getStreamFromFD(r),i=Rr.doReadv(o,t,e);return I[n>>2]=i,0}catch(a){return void 0!==Cr&&a instanceof Cr.ErrnoError||sr(a),a.errno}},Z:function(r,t,e,n,o){try{var i=Rr.getStreamFromFD(r),a=4294967296*e+(t>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(Cr.llseek(i,a,n),dr=[i.position>>>0,(lr=i.position,+Math.abs(lr)>=1?lr>0?(0|Math.min(+Math.floor(lr/4294967296),4294967295))>>>0:~~+Math.ceil((lr-+(~~lr>>>0))/4294967296)>>>0:0)],I[o>>2]=dr[0],I[o+4>>2]=dr[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(u){return void 0!==Cr&&u instanceof Cr.ErrnoError||sr(u),u.errno}},P:function(r,t,e,n){try{var o=Rr.getStreamFromFD(r),i=Rr.doWritev(o,t,e);return I[n>>2]=i,0}catch(a){return void 0!==Cr&&a instanceof Cr.ErrnoError||sr(a),a.errno}},a:function(){return F()},w:function(r,t){var e=Qr();try{return K.get(r)(t)}catch(n){if(rt(e),n!==n+0&&"longjmp"!==n)throw n;et(1,0)}},M:function(r,t,e,n){var o=Qr();try{return K.get(r)(t,e,n)}catch(i){if(rt(o),i!==i+0&&"longjmp"!==i)throw i;et(1,0)}},N:function(r,t,e,n){var o=Qr();try{return K.get(r)(t,e,n)}catch(i){if(rt(o),i!==i+0&&"longjmp"!==i)throw i;et(1,0)}},r:function(r){var t=Qr();try{return K.get(r)()}catch(e){if(rt(t),e!==e+0&&"longjmp"!==e)throw e;et(1,0)}},i:function(r,t){var e=Qr();try{return K.get(r)(t)}catch(n){if(rt(e),n!==n+0&&"longjmp"!==n)throw n;et(1,0)}},d:function(r,t,e){var n=Qr();try{return K.get(r)(t,e)}catch(o){if(rt(n),o!==o+0&&"longjmp"!==o)throw o;et(1,0)}},g:function(r,t,e,n){var o=Qr();try{return K.get(r)(t,e,n)}catch(i){if(rt(o),i!==i+0&&"longjmp"!==i)throw i;et(1,0)}},j:function(r,t,e,n,o){var i=Qr();try{return K.get(r)(t,e,n,o)}catch(a){if(rt(i),a!==a+0&&"longjmp"!==a)throw a;et(1,0)}},u:function(r,t,e,n,o,i){var a=Qr();try{return K.get(r)(t,e,n,o,i)}catch(u){if(rt(a),u!==u+0&&"longjmp"!==u)throw u;et(1,0)}},x:function(r,t,e,n,o,i,a){var u=Qr();try{return K.get(r)(t,e,n,o,i,a)}catch(s){if(rt(u),s!==s+0&&"longjmp"!==s)throw s;et(1,0)}},O:function(r,t,e,n,o,i,a,u){var s=Qr();try{return K.get(r)(t,e,n,o,i,a,u)}catch(c){if(rt(s),c!==c+0&&"longjmp"!==c)throw c;et(1,0)}},Ka:function(r,t,e,n,o,i,a,u,s,c,f){var l=Qr();try{return K.get(r)(t,e,n,o,i,a,u,s,c,f)}catch(d){if(rt(l),d!==d+0&&"longjmp"!==d)throw d;et(1,0)}},E:function(r,t,e,n,o,i,a,u,s,c,f,l){var d=Qr();try{return K.get(r)(t,e,n,o,i,a,u,s,c,f,l)}catch(m){if(rt(d),m!==m+0&&"longjmp"!==m)throw m;et(1,0)}},U:function(r,t,e,n,o,i,a,u,s,c,f,l,d){var m=Qr();try{return K.get(r)(t,e,n,o,i,a,u,s,c,f,l,d)}catch(p){if(rt(m),p!==p+0&&"longjmp"!==p)throw p;et(1,0)}},X:function(r,t,e,n,o,i,a,u,s){var c=Qr();try{return _t(r,t,e,n,o,i,a,u,s)}catch(f){if(rt(c),f!==f+0&&"longjmp"!==f)throw f;et(1,0)}},ja:function(r,t,e,n,o,i){var a=Qr();try{return ut(r,t,e,n,o,i)}catch(u){if(rt(a),u!==u+0&&"longjmp"!==u)throw u;et(1,0)}},ia:function(r,t,e,n,o,i,a,u){var s=Qr();try{return st(r,t,e,n,o,i,a,u)}catch(c){if(rt(s),c!==c+0&&"longjmp"!==c)throw c;et(1,0)}},$:function(r,t,e,n){var o=Qr();try{return gt(r,t,e,n)}catch(i){if(rt(o),i!==i+0&&"longjmp"!==i)throw i;et(1,0)}},Y:function(r,t,e,n,o){var i=Qr();try{return yt(r,t,e,n,o)}catch(a){if(rt(i),a!==a+0&&"longjmp"!==a)throw a;et(1,0)}},l:function(r){var t=Qr();try{K.get(r)()}catch(e){if(rt(t),e!==e+0&&"longjmp"!==e)throw e;et(1,0)}},p:function(r,t){var e=Qr();try{K.get(r)(t)}catch(n){if(rt(e),n!==n+0&&"longjmp"!==n)throw n;et(1,0)}},z:function(r,t,e){var n=Qr();try{K.get(r)(t,e)}catch(o){if(rt(n),o!==o+0&&"longjmp"!==o)throw o;et(1,0)}},ba:function(r,t,e,n,o,i,a){var u=Qr();try{mt(r,t,e,n,o,i,a)}catch(s){if(rt(u),s!==s+0&&"longjmp"!==s)throw s;et(1,0)}},e:function(r,t,e){var n=Qr();try{K.get(r)(t,e)}catch(o){if(rt(n),o!==o+0&&"longjmp"!==o)throw o;et(1,0)}},f:function(r,t,e,n){var o=Qr();try{K.get(r)(t,e,n)}catch(i){if(rt(o),i!==i+0&&"longjmp"!==i)throw i;et(1,0)}},G:function(r,t,e,n,o,i,a,u,s,c,f){var l=Qr();try{K.get(r)(t,e,n,o,i,a,u,s,c,f)}catch(d){if(rt(l),d!==d+0&&"longjmp"!==d)throw d;et(1,0)}},o:function(r,t,e,n,o){var i=Qr();try{K.get(r)(t,e,n,o)}catch(a){if(rt(i),a!==a+0&&"longjmp"!==a)throw a;et(1,0)}},n:function(r,t,e,n,o,i){var a=Qr();try{K.get(r)(t,e,n,o,i)}catch(u){if(rt(a),u!==u+0&&"longjmp"!==u)throw u;et(1,0)}},H:function(r,t,e,n,o,i,a){var u=Qr();try{K.get(r)(t,e,n,o,i,a)}catch(s){if(rt(u),s!==s+0&&"longjmp"!==s)throw s;et(1,0)}},y:function(r,t,e,n,o,i,a,u){var s=Qr();try{K.get(r)(t,e,n,o,i,a,u)}catch(c){if(rt(s),c!==c+0&&"longjmp"!==c)throw c;et(1,0)}},V:function(r,t,e,n,o,i,a,u,s){var c=Qr();try{K.get(r)(t,e,n,o,i,a,u,s)}catch(f){if(rt(c),f!==f+0&&"longjmp"!==f)throw f;et(1,0)}},A:function(r,t,e,n,o,i,a,u,s,c,f){var l=Qr();try{K.get(r)(t,e,n,o,i,a,u,s,c,f)}catch(d){if(rt(l),d!==d+0&&"longjmp"!==d)throw d;et(1,0)}},D:function(r,t,e,n,o,i,a,u,s,c,f,l,d,m,p,h){var v=Qr();try{K.get(r)(t,e,n,o,i,a,u,s,c,f,l,d,m,p,h)}catch(g){if(rt(v),g!==g+0&&"longjmp"!==g)throw g;et(1,0)}},ea:function(r,t,e,n,o,i,a){var u=Qr();try{dt(r,t,e,n,o,i,a)}catch(s){if(rt(u),s!==s+0&&"longjmp"!==s)throw s;et(1,0)}},fa:function(r,t,e,n,o,i,a,u){var s=Qr();try{lt(r,t,e,n,o,i,a,u)}catch(c){if(rt(s),c!==c+0&&"longjmp"!==c)throw c;et(1,0)}},ca:function(r,t,e,n,o,i,a,u,s){var c=Qr();try{pt(r,t,e,n,o,i,a,u,s)}catch(f){if(rt(c),f!==f+0&&"longjmp"!==f)throw f;et(1,0)}},da:function(r,t,e,n,o,i,a,u,s,c,f,l){var d=Qr();try{ht(r,t,e,n,o,i,a,u,s,c,f,l)}catch(m){if(rt(d),m!==m+0&&"longjmp"!==m)throw m;et(1,0)}},la:function(r,t,e,n,o,i,a,u){var s=Qr();try{it(r,t,e,n,o,i,a,u)}catch(c){if(rt(s),c!==c+0&&"longjmp"!==c)throw c;et(1,0)}},ga:function(r,t,e,n,o,i,a,u,s){var c=Qr();try{ft(r,t,e,n,o,i,a,u,s)}catch(f){if(rt(c),f!==f+0&&"longjmp"!==f)throw f;et(1,0)}},ka:function(r,t,e,n,o,i,a,u,s,c){var f=Qr();try{at(r,t,e,n,o,i,a,u,s,c)}catch(l){if(rt(f),l!==l+0&&"longjmp"!==l)throw l;et(1,0)}},aa:function(r,t,e,n){var o=Qr();try{vt(r,t,e,n)}catch(i){if(rt(o),i!==i+0&&"longjmp"!==i)throw i;et(1,0)}},ha:function(r,t,e,n,o,i){var a=Qr();try{ct(r,t,e,n,o,i)}catch(u){if(rt(a),u!==u+0&&"longjmp"!==u)throw u;et(1,0)}},_:function(r,t,e,n,o,i,a){var u=Qr();try{wt(r,t,e,n,o,i,a)}catch(s){if(rt(u),s!==s+0&&"longjmp"!==s)throw s;et(1,0)}},t:function(r){return r},Fa:function(r){Mr();var t=new Date(I[r+20>>2]+1900,I[r+16>>2],I[r+12>>2],I[r+8>>2],I[r+4>>2],I[r>>2],0),e=I[r+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),u=Math.min(a,i);if(e<0)I[r+32>>2]=Number(i!=a&&u==n);else if(e>0!=(u==n)){var s=Math.max(a,i),c=e>0?u:s;t.setTime(t.getTime()+6e4*(c-n))}I[r+24>>2]=t.getDay();var f=(t.getTime()-o.getTime())/864e5|0;return I[r+28>>2]=f,I[r>>2]=t.getSeconds(),I[r+4>>2]=t.getMinutes(),I[r+8>>2]=t.getHours(),I[r+12>>2]=t.getDate(),I[r+16>>2]=t.getMonth(),t.getTime()/1e3|0},C:function(r){S(r)},Ja:Hr,oa:function(r,t,e,n){return Hr(r,t,e,n)},Ha:function(r){if(_){if(!r)return 1;var t=H(r);if(!t.length)return 0;var e=require("child_process").spawnSync(t,[],{shell:!0,stdio:"inherit"}),n=function(r,t){return r<<8|t};return null===e.status?n(0,function(r){switch(r){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15}return 2}(e.signal)):n(e.status,0)}return r?(_r(52),-1):0},F:function(r){var t=Date.now()/1e3|0;return r&&(I[r>>2]=t),t}},Xr=(function(){var r={a:Wr};function t(r,t){var e,n,o=r.exports;u.asm=o,M=u.asm.La,e=M.buffer,z=e,u.HEAP8=O=new Int8Array(e),u.HEAP16=N=new Int16Array(e),u.HEAP32=I=new Int32Array(e),u.HEAPU8=B=new Uint8Array(e),u.HEAPU16=new Uint16Array(e),u.HEAPU32=new Uint32Array(e),u.HEAPF32=new Float32Array(e),u.HEAPF64=new Float64Array(e),K=u.asm.Pa,n=u.asm.Ma,$.unshift(n),ur()}function e(r){t(r.instance)}function n(t){return function(){if(!D&&(w||y)){if("function"==typeof fetch&&!vr(cr))return fetch(cr,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+cr+"'";return r.arrayBuffer()}).catch(function(){return gr(cr)});if(l)return new Promise(function(r,t){l(cr,function(t){r(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return gr(cr)})}().then(function(t){return WebAssembly.instantiate(t,r)}).then(function(r){return r}).then(t,function(r){k("failed to asynchronously prepare wasm: "+r),sr(r)})}if(ar(),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(o){return k("Module.instantiateWasm callback failed with error: "+o),!1}(D||"function"!=typeof WebAssembly.instantiateStreaming||hr(cr)||vr(cr)||"function"!=typeof fetch?n(e):fetch(cr,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,r).then(e,function(r){return k("wasm streaming compile failed: "+r),k("falling back to ArrayBuffer instantiation"),n(e)})})).catch(a)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Ma).apply(null,arguments)},u._create_compile_result=function(){return(u._create_compile_result=u.asm.Na).apply(null,arguments)},u._main=function(){return(u._main=u.asm.Oa).apply(null,arguments)},u._free=function(){return(Xr=u._free=u.asm.Qa).apply(null,arguments)}),Vr=u._malloc=function(){return(Vr=u._malloc=u.asm.Ra).apply(null,arguments)},Kr=u.___errno_location=function(){return(Kr=u.___errno_location=u.asm.Sa).apply(null,arguments)},Jr=u.__get_tzname=function(){return(Jr=u.__get_tzname=u.asm.Ta).apply(null,arguments)},$r=u.__get_daylight=function(){return($r=u.__get_daylight=u.asm.Ua).apply(null,arguments)},Zr=u.__get_timezone=function(){return(Zr=u.__get_timezone=u.asm.Va).apply(null,arguments)},Qr=u.stackSave=function(){return(Qr=u.stackSave=u.asm.Wa).apply(null,arguments)},rt=u.stackRestore=function(){return(rt=u.stackRestore=u.asm.Xa).apply(null,arguments)},tt=u.stackAlloc=function(){return(tt=u.stackAlloc=u.asm.Ya).apply(null,arguments)},et=u._setThrew=function(){return(et=u._setThrew=u.asm.Za).apply(null,arguments)},nt=u.___cxa_can_catch=function(){return(nt=u.___cxa_can_catch=u.asm._a).apply(null,arguments)},ot=u.___cxa_is_pointer_type=function(){return(ot=u.___cxa_is_pointer_type=u.asm.$a).apply(null,arguments)},it=u.dynCall_viijji=function(){return(it=u.dynCall_viijji=u.asm.ab).apply(null,arguments)},at=u.dynCall_viijjiii=function(){return(at=u.dynCall_viijjiii=u.asm.bb).apply(null,arguments)},ut=u.dynCall_iijj=function(){return(ut=u.dynCall_iijj=u.asm.cb).apply(null,arguments)},st=u.dynCall_iijjii=function(){return(st=u.dynCall_iijjii=u.asm.db).apply(null,arguments)},ct=u.dynCall_vijj=function(){return(ct=u.dynCall_vijj=u.asm.eb).apply(null,arguments)},ft=u.dynCall_viijjii=function(){return(ft=u.dynCall_viijjii=u.asm.fb).apply(null,arguments)},lt=u.dynCall_viijjd=function(){return(lt=u.dynCall_viijjd=u.asm.gb).apply(null,arguments)},dt=u.dynCall_viijj=function(){return(dt=u.dynCall_viijj=u.asm.hb).apply(null,arguments)},mt=u.dynCall_vidjj=function(){return(mt=u.dynCall_vidjj=u.asm.ib).apply(null,arguments)},pt=u.dynCall_viijjdi=function(){return(pt=u.dynCall_viijjdi=u.asm.jb).apply(null,arguments)},ht=u.dynCall_viijjdjj=function(){return(ht=u.dynCall_viijjdjj=u.asm.kb).apply(null,arguments)},vt=u.dynCall_vij=function(){return(vt=u.dynCall_vij=u.asm.lb).apply(null,arguments)},gt=u.dynCall_jiii=function(){return(gt=u.dynCall_jiii=u.asm.mb).apply(null,arguments)},wt=u.dynCall_vijji=function(){return(wt=u.dynCall_vijji=u.asm.nb).apply(null,arguments)},yt=u.dynCall_jiiii=function(){return(yt=u.dynCall_jiiii=u.asm.ob).apply(null,arguments)},_t=u.dynCall_iiiiijj=function(){return(_t=u.dynCall_iiiiijj=u.asm.pb).apply(null,arguments)};function Et(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}u.cwrap=function(r,t,e,n){var o=(e=e||[]).every(function(r){return"number"===r});return"string"!==t&&o&&!n?C(r):function(){return R(r,t,e,arguments)}},u.UTF8ToString=H,u.FS=Cr;function bt(r){var t=u._main,e=(r=r||[]).length+1,n=tt(4*(e+1));I[n>>2]=X(v);for(var o=1;o<e;o++)I[(n>>2)+o]=X(r[o-1]);I[(n>>2)+e]=0;try{var i=t(e,n);return Dt(i,!0),i}catch(a){return function(r){if(r instanceof Et||"unwind"==r)return P;k("exception thrown: "+r),g(1,r)}(a)}finally{!0}}function kt(r){function t(){Gr||(Gr=!0,u.calledRun=!0,T||(!0,u.noFSInit||Cr.init.initialized||Cr.init(),Cr.ignorePermissions=!1,Tr.init(),wr($),wr(Z),i(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),jt&&bt(r),function(){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;)r=u.postRun.shift(),Q.unshift(r);var r;wr(Q)}()))}r=r||h,er>0||(!function(){if(u.preRun)for("function"==typeof u.preRun&&(u.preRun=[u.preRun]);u.preRun.length;)r=u.preRun.shift(),J.unshift(r);var r;wr(J)}(),er>0||(u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),t()},1)):t()))}function Dt(r,t){P=r,tr()||!0,function(r){P=r,tr()||(u.onExit&&u.onExit(r),T=!0);g(r,new Et(r))}(r)}if(or=function r(){Gr||kt(),Gr||(or=r)},u.run=kt,u.preInit)for("function"==typeof u.preInit&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();var jt=!0;return u.noInitialRun&&(jt=!1),kt(),t.ready}}();"object"==typeof exports&&"object"==typeof module?module.exports=i:"function"==typeof r&&r.amd?r([],function(){return i}):"object"==typeof exports&&(exports.startWerckmeisterJs=i);
|
|
489
489
|
},{"path":"UUq2","fs":"rDCW","crypto":"mRF4","child_process":"rDCW","process":"pBGv","buffer":"dskh"}],"RSuL":[function(require,module,exports) {
|
|
490
490
|
"use strict";function n(n,t){var a;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(a=e(n))||t&&n&&"number"==typeof n.length){a&&(n=a);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){a=n[Symbol.iterator]()},n:function(){var n=a.next();return s=n.done,n},e:function(n){l=!0,i=n},f:function(){try{s||null==a.return||a.return()}finally{if(l)throw i}}}}function e(n,e){if(n){if("string"==typeof n)return t(n,e);var a=Object.prototype.toString.call(n).slice(8,-1);return"Object"===a&&n.constructor&&(a=n.constructor.name),"Map"===a||"Set"===a?Array.from(n):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(n,e):void 0}}function t(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=n[t];return a}function a(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function r(n,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function o(n,e,t){return e&&r(n.prototype,e),t&&r(n,t),n}var i=this&&this.__awaiter||function(n,e,t,a){return new(t||(t=Promise))(function(r,o){function i(n){try{l(a.next(n))}catch(e){o(e)}}function s(n){try{l(a.throw(n))}catch(e){o(e)}}function l(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t(function(n){n(e)})).then(i,s)}l((a=a.apply(n,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WerckmeisterCompiler=exports.CompilerError=void 0;var s=require("@werckmeister/compilerjs/werckmeister"),l=require("fs"),c=JSON.parse('[{"path": "chords/default.chords", "data": "------------------------------------------------------------------\\nX: \\t\\t\\tI=0\\t \\t\\tIII=4 \\t\\t\\tV=7\\nXmin: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7\\nX-: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7\\nX/7: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=-2\\nX-/7: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=-2\\nX/maj7: \\tI=0 \\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=-1\\nX/5: \\t\\tI=0\\t \\t\\tIII=4 \\t\\t\\tV=-5\\nX-/5: \\t\\tI=0\\t \\t\\tIII=3 \\t\\t\\tV=-5\\nX/4: \\t\\tI=0\\t \\t\\tIII=4 \\tIV=-7\\tV=7\\nX-/4: \\t\\tI=0\\t \\t\\tIII=3 \\tIV=-7\\tV=7\\nX/3: \\t\\tI=0\\t \\t\\tIII=-8 \\t \\tV=7\\nX-/3: \\t\\tI=0\\t \\t\\tIII=-9 \\t \\tV=7\\nX/2: \\t\\tI=0\\t II=-10\\tIII=4 \\t \\tV=7\\nX-7b5/b5: \\tI=0 \\t\\tIII=3 \\t\\t\\tV=-6 \\t\\t\\tVII=10\\n------------------------------------------------------------------\\nXsus4: I=0 IV=5 V=7\\nX7sus4: I=0 IV=5 V=7 VII=10\\nX9sus4: I=0 II=2 IV=5 V=7 VII=10\\nXsus2: I=0 II=2 V=7\\n------------------------------------------------------------------\\nX6: I=0 \\t\\tIII=4 \\t\\t\\tV=7 VI=9\\nX-6: I=0 \\t\\tIII=3 \\t\\t\\tV=7 VI=9\\nX-6/9: I=0 II=2\\tIII=3 \\t\\t\\tV=7 VI=9\\n------------------------------------------------------------------\\nX7: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXmin7: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nX-7: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXmaj7: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=11\\nXmaj7b5:\\tI=0 \\t\\tIII=4 \\t\\t\\tV=6 \\t\\t\\tVII=11\\nX-7b5: \\tI=0 \\t\\tIII=3 \\t\\t\\tV=6 \\t\\t\\tVII=10\\nXmaj7#11: \\tI=0 \\t\\tIII=4 \\tIV=6\\t \\t\\t\\tVII=11\\nX7b5: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=6 \\t\\t\\tVII=10\\nX7#5: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=8 \\t\\t\\tVII=10\\nX07: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=6 \\t\\t\\tVII=9\\n-- II=3 and III=3 was intended\\nX7#5#9:\\t\\tI=0 II=3 III=3 \\tV=8 \\t\\t\\tVII=10\\n------------------------------------------------------------------\\nX2: \\t\\tI=0 III=2 \\t\\t\\tV=7 \\t\\t\\t\\nX9: \\t\\tI=0 II=2 III=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\n# to distinguish between Xb9 (Xflat and 9) and Xb9 (X and flat 9)\\n# we write Xflat9 for the latter. (same for 11 and 13)\\nXflat9: \\tI=0 II=1 III=4 \\t\\t\\tV=7 \\t\\t\\t\\nXmin9: \\t\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nX-9: \\t\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXminAdd9:\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\t\\nX-add9:\\t\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\t\\n\\n\\nXmaj9: \\t\\tI=0 II=2\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=11\\n-- II=3 and III=3 was intended\\nX7#9: \\t\\tI=0 II=3\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nX7b9: I=0 II=1 III=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXmaj7b9: I=0 II=1 III=4 \\t\\t\\tV=7 \\t\\t\\tVII=11\\n------------------------------------------------------------------\\nX11: \\t\\tI=0 \\tIII=4 \\tIV=5\\tV=7 \\t\\t\\tVII=10\\nXflat11: I=0 \\tIII=3 \\tIV=4\\tV=7 \\t\\t\\t\\nXmin11:\\t\\tI=0 \\tIII=3 \\tIV=5\\tV=7 \\t\\t\\tVII=10\\nX-11:\\t\\tI=0 \\tIII=3 \\tIV=5\\tV=7 \\t\\t\\tVII=10\\nXmaj11:\\t\\tI=0 \\tIII=4 \\tIV=5\\tV=7 \\t\\t\\tVII=11\\n------------------------------------------------------------------\\nX13: \\t\\tI=0 \\tIII=4 \\t \\tV=7 \\tVI=9\\tVII=10\\nXflat13:\\tI=0 \\tIII=4 \\t \\t \\tVI=8\\t\\nXmin13:\\t\\tI=0 \\tIII=3 \\t\\t V=7 \\tVI=9\\tVII=10\\nX-13:\\t\\tI=0 \\tIII=3 \\t\\t V=7 \\tVI=9\\tVII=10\\nXmaj13:\\t\\tI=0 \\tIII=4 \\t\\t V=7 \\tVI=9\\tVII=11"}, {"path": "lua/com/com.lua", "data": "local _inspect = require \\"lua/com/inspect\\"\\n\\nlocal MidiSchluesselCOffset = 60\\nParameterValueNoTag = \'__noTagValue\'\\n\\nfunction istable(t) return type(t) == \'table\' end\\nfunction isnumber(t) return type(t) == \'number\' end\\nfunction inspect(x) return print(_inspect(x)) end\\nfunction dump(x) print(inspect(x)) end\\n\\n\\nfunction checkLegacyNamedParams(params, ...)\\n local args = table.pack(...)\\n for k, v in pairs(params) do\\n if contains(args, v) then\\n local msg = \\"Error: legacy named parameter with the argument \'\\" .. v .. \\"\'. \\"\\n msg = msg .. \\" Use this expression instead: _\\" .. v .. \\"=...\\" \\n error(msg)\\n end\\n end\\nend\\n\\n-- returns the minimum amount of semitones between the relative pitches x and y.\\n-- e.g.: from c(0) to b(11) = -1\\nfunction relpitchdiff(x, y)\\n x = x % 12\\n y = y % 12\\n if math.abs(x-y) < 6 then\\n return -(x-y)\\n end\\n if x < 6 then \\n x = x + 12 \\n end\\n if y < 6 then\\n y = y + 12\\n end\\n return -(x-y)\\nend\\n\\n-- [a, 1, b, 2, c, 3] => {a=1, b=2, c=3}\\n-- @deprecated use the native named parameter feature: _name=value\\nfunction tokeyvalue(args)\\n assert(#args % 2 == 0)\\n local result = {}\\n for i=1, #args, 2 do\\n result[ args[i] ] = args[i+1]\\n end\\n return result\\nend\\n\\nfunction toMidiPitch(pitch)\\n return MidiSchluesselCOffset + pitch.pitch + (pitch.octave * 12)\\nend\\n\\nfunction deepcopy(o, seen)\\n seen = seen or {}\\n if o == nil then return nil end\\n if seen[o] then return seen[o] end\\n \\n local no\\n if type(o) == \'table\' then\\n no = {}\\n seen[o] = no\\n \\n for k, v in next, o, nil do\\n no[deepcopy(k, seen)] = deepcopy(v, seen)\\n end\\n setmetatable(no, deepcopy(getmetatable(o), seen))\\n else -- number, string, boolean, etc\\n no = o\\n end\\n return no\\nend\\n\\nfunction contains(table, value)\\n if table == nil then\\n return false\\n end\\n for k, v in pairs(table) do\\n if v == value then\\n return true\\n end\\n end\\n return false\\nend\\n\\n-- https://stackoverflow.com/questions/1426954/split-string-in-lua#1426970\\nfunction split(pString, pPattern)\\n local Table = {} -- NOTE: use {n = 0} in Lua-5.0\\n local fpat = \\"(.-)\\" .. pPattern\\n local last_end = 1\\n local s, e, cap = pString:find(fpat, 1)\\n while s do\\n if s ~= 1 or cap ~= \\"\\" then\\n table.insert(Table,cap)\\n end\\n last_end = e+1\\n s, e, cap = pString:find(fpat, last_end)\\n end\\n if last_end <= #pString then\\n cap = pString:sub(last_end)\\n table.insert(Table, cap)\\n end\\n return Table\\n end"}, {"path": "lua/com/globals.lua", "data": "I = 1\\nII = 2\\nIII = 3\\nIV = 4\\nV = 5\\nVI = 6\\nVII = 7\\n\\nDegreeStringValues = {\\n I = I,\\n II = II,\\n III = III,\\n IV = IV,\\n V = V,\\n VI = VI,\\n VII = VII\\n}\\n\\nMajorScaleSemitones = {\\n I = 0,\\n II = 2,\\n III = 4,\\n IV = 5,\\n V = 7,\\n VI = 9,\\n VII = 11\\n}\\n\\nC = 0\\nCIS = 1\\nDES = 1\\nD = 2\\nDIS = 3\\nES = 3\\nE = 4\\nFES = 4\\nF = 5\\nFIS = 6\\nGES = 6\\nG = 7\\nGIS = 8\\nAS = 8\\nA = 9\\nAIS = 10\\nBES = 10\\nB = 11\\nCES = 11\\n"}, {"path": "lua/com/inspect.lua", "data": "local inspect ={\\n _VERSION = \'inspect.lua 3.1.0\',\\n _URL = \'http://github.com/kikito/inspect.lua\',\\n _DESCRIPTION = \'human-readable representations of tables\',\\n _LICENSE = [[\\n MIT LICENSE\\n\\n Copyright (c) 2013 Enrique Garc\\u00eda Cota\\n\\n Permission is hereby granted, free of charge, to any person obtaining a\\n copy of this software and associated documentation files (the\\n \\"Software\\"), to deal in the Software without restriction, including\\n without limitation the rights to use, copy, modify, merge, publish,\\n distribute, sublicense, and/or sell copies of the Software, and to\\n permit persons to whom the Software is furnished to do so, subject to\\n the following conditions:\\n\\n The above copyright notice and this permission notice shall be included\\n in all copies or substantial portions of the Software.\\n\\n THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n ]]\\n}\\n\\nlocal tostring = tostring\\n\\ninspect.KEY = setmetatable({}, {__tostring = function() return \'inspect.KEY\' end})\\ninspect.METATABLE = setmetatable({}, {__tostring = function() return \'inspect.METATABLE\' end})\\n\\nlocal function rawpairs(t)\\n return next, t, nil\\nend\\n\\n-- Apostrophizes the string if it has quotes, but not aphostrophes\\n-- Otherwise, it returns a regular quoted string\\nlocal function smartQuote(str)\\n if str:match(\'\\"\') and not str:match(\\"\'\\") then\\n return \\"\'\\" .. str .. \\"\'\\"\\n end\\n return \'\\"\' .. str:gsub(\'\\"\', \'\\\\\\\\\\"\') .. \'\\"\'\\nend\\n\\n-- \\\\a => \'\\\\\\\\a\', \\\\0 => \'\\\\\\\\0\', 31 => \'\\\\31\'\\nlocal shortControlCharEscapes = {\\n [\\"\\\\a\\"] = \\"\\\\\\\\a\\", [\\"\\\\b\\"] = \\"\\\\\\\\b\\", [\\"\\\\f\\"] = \\"\\\\\\\\f\\", [\\"\\\\n\\"] = \\"\\\\\\\\n\\",\\n [\\"\\\\r\\"] = \\"\\\\\\\\r\\", [\\"\\\\t\\"] = \\"\\\\\\\\t\\", [\\"\\\\v\\"] = \\"\\\\\\\\v\\"\\n}\\nlocal longControlCharEscapes = {} -- \\\\a => nil, \\\\0 => \\\\000, 31 => \\\\031\\nfor i=0, 31 do\\n local ch = string.char(i)\\n if not shortControlCharEscapes[ch] then\\n shortControlCharEscapes[ch] = \\"\\\\\\\\\\"..i\\n longControlCharEscapes[ch] = string.format(\\"\\\\\\\\%03d\\", i)\\n end\\nend\\n\\nlocal function escape(str)\\n return (str:gsub(\\"\\\\\\\\\\", \\"\\\\\\\\\\\\\\\\\\")\\n :gsub(\\"(%c)%f[0-9]\\", longControlCharEscapes)\\n :gsub(\\"%c\\", shortControlCharEscapes))\\nend\\n\\nlocal function isIdentifier(str)\\n return type(str) == \'string\' and str:match( \\"^[_%a][_%a%d]*$\\" )\\nend\\n\\nlocal function isSequenceKey(k, sequenceLength)\\n return type(k) == \'number\'\\n and 1 <= k\\n and k <= sequenceLength\\n and math.floor(k) == k\\nend\\n\\nlocal defaultTypeOrders = {\\n [\'number\'] = 1, [\'boolean\'] = 2, [\'string\'] = 3, [\'table\'] = 4,\\n [\'function\'] = 5, [\'userdata\'] = 6, [\'thread\'] = 7\\n}\\n\\nlocal function sortKeys(a, b)\\n local ta, tb = type(a), type(b)\\n\\n -- strings and numbers are sorted numerically/alphabetically\\n if ta == tb and (ta == \'string\' or ta == \'number\') then return a < b end\\n\\n local dta, dtb = defaultTypeOrders[ta], defaultTypeOrders[tb]\\n -- Two default types are compared according to the defaultTypeOrders table\\n if dta and dtb then return defaultTypeOrders[ta] < defaultTypeOrders[tb]\\n elseif dta then return true -- default types before custom ones\\n elseif dtb then return false -- custom types after default ones\\n end\\n\\n -- custom types are sorted out alphabetically\\n return ta < tb\\nend\\n\\n-- For implementation reasons, the behavior of rawlen & # is \\"undefined\\" when\\n-- tables aren\'t pure sequences. So we implement our own # operator.\\nlocal function getSequenceLength(t)\\n local len = 1\\n local v = rawget(t,len)\\n while v ~= nil do\\n len = len + 1\\n v = rawget(t,len)\\n end\\n return len - 1\\nend\\n\\nlocal function getNonSequentialKeys(t)\\n local keys, keysLength = {}, 0\\n local sequenceLength = getSequenceLength(t)\\n for k,_ in rawpairs(t) do\\n if not isSequenceKey(k, sequenceLength) then\\n keysLength = keysLength + 1\\n keys[keysLength] = k\\n end\\n end\\n table.sort(keys, sortKeys)\\n return keys, keysLength, sequenceLength\\nend\\n\\nlocal function countTableAppearances(t, tableAppearances)\\n tableAppearances = tableAppearances or {}\\n\\n if type(t) == \'table\' then\\n if not tableAppearances[t] then\\n tableAppearances[t] = 1\\n for k,v in rawpairs(t) do\\n countTableAppearances(k, tableAppearances)\\n countTableAppearances(v, tableAppearances)\\n end\\n countTableAppearances(getmetatable(t), tableAppearances)\\n else\\n tableAppearances[t] = tableAppearances[t] + 1\\n end\\n end\\n\\n return tableAppearances\\nend\\n\\nlocal copySequence = function(s)\\n local copy, len = {}, #s\\n for i=1, len do copy[i] = s[i] end\\n return copy, len\\nend\\n\\nlocal function makePath(path, ...)\\n local keys = {...}\\n local newPath, len = copySequence(path)\\n for i=1, #keys do\\n newPath[len + i] = keys[i]\\n end\\n return newPath\\nend\\n\\nlocal function processRecursive(process, item, path, visited)\\n if item == nil then return nil end\\n if visited[item] then return visited[item] end\\n\\n local processed = process(item, path)\\n if type(processed) == \'table\' then\\n local processedCopy = {}\\n visited[item] = processedCopy\\n local processedKey\\n\\n for k,v in rawpairs(processed) do\\n processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited)\\n if processedKey ~= nil then\\n processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited)\\n end\\n end\\n\\n local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited)\\n if type(mt) ~= \'table\' then mt = nil end -- ignore not nil/table __metatable field\\n setmetatable(processedCopy, mt)\\n processed = processedCopy\\n end\\n return processed\\nend\\n\\n\\n\\n-------------------------------------------------------------------\\n\\nlocal Inspector = {}\\nlocal Inspector_mt = {__index = Inspector}\\n\\nfunction Inspector:puts(...)\\n local args = {...}\\n local buffer = self.buffer\\n local len = #buffer\\n for i=1, #args do\\n len = len + 1\\n buffer[len] = args[i]\\n end\\nend\\n\\nfunction Inspector:down(f)\\n self.level = self.level + 1\\n f()\\n self.level = self.level - 1\\nend\\n\\nfunction Inspector:tabify()\\n self:puts(self.newline, string.rep(self.indent, self.level))\\nend\\n\\nfunction Inspector:alreadyVisited(v)\\n return self.ids[v] ~= nil\\nend\\n\\nfunction Inspector:getId(v)\\n local id = self.ids[v]\\n if not id then\\n local tv = type(v)\\n id = (self.maxIds[tv] or 0) + 1\\n self.maxIds[tv] = id\\n self.ids[v] = id\\n end\\n return tostring(id)\\nend\\n\\nfunction Inspector:putKey(k)\\n if isIdentifier(k) then return self:puts(k) end\\n self:puts(\\"[\\")\\n self:putValue(k)\\n self:puts(\\"]\\")\\nend\\n\\nfunction Inspector:putTable(t)\\n if t == inspect.KEY or t == inspect.METATABLE then\\n self:puts(tostring(t))\\n elseif self:alreadyVisited(t) then\\n self:puts(\'<table \', self:getId(t), \'>\')\\n elseif self.level >= self.depth then\\n self:puts(\'{...}\')\\n else\\n if self.tableAppearances[t] > 1 then self:puts(\'<\', self:getId(t), \'>\') end\\n\\n local nonSequentialKeys, nonSequentialKeysLength, sequenceLength = getNonSequentialKeys(t)\\n local mt = getmetatable(t)\\n\\n self:puts(\'{\')\\n self:down(function()\\n local count = 0\\n for i=1, sequenceLength do\\n if count > 0 then self:puts(\',\') end\\n self:puts(\' \')\\n self:putValue(t[i])\\n count = count + 1\\n end\\n\\n for i=1, nonSequentialKeysLength do\\n local k = nonSequentialKeys[i]\\n if count > 0 then self:puts(\',\') end\\n self:tabify()\\n self:putKey(k)\\n self:puts(\' = \')\\n self:putValue(t[k])\\n count = count + 1\\n end\\n\\n if type(mt) == \'table\' then\\n if count > 0 then self:puts(\',\') end\\n self:tabify()\\n self:puts(\'<metatable> = \')\\n self:putValue(mt)\\n end\\n end)\\n\\n if nonSequentialKeysLength > 0 or type(mt) == \'table\' then -- result is multi-lined. Justify closing }\\n self:tabify()\\n elseif sequenceLength > 0 then -- array tables have one extra space before closing }\\n self:puts(\' \')\\n end\\n\\n self:puts(\'}\')\\n end\\nend\\n\\nfunction Inspector:putValue(v)\\n local tv = type(v)\\n\\n if tv == \'string\' then\\n self:puts(smartQuote(escape(v)))\\n elseif tv == \'number\' or tv == \'boolean\' or tv == \'nil\' or\\n tv == \'cdata\' or tv == \'ctype\' then\\n self:puts(tostring(v))\\n elseif tv == \'table\' then\\n self:putTable(v)\\n else\\n self:puts(\'<\', tv, \' \', self:getId(v), \'>\')\\n end\\nend\\n\\n-------------------------------------------------------------------\\n\\nfunction inspect.inspect(root, options)\\n options = options or {}\\n\\n local depth = options.depth or math.huge\\n local newline = options.newline or \'\\\\n\'\\n local indent = options.indent or \' \'\\n local process = options.process\\n\\n if process then\\n root = processRecursive(process, root, {}, {})\\n end\\n\\n local inspector = setmetatable({\\n depth = depth,\\n level = 0,\\n buffer = {},\\n ids = {},\\n maxIds = {},\\n newline = newline,\\n indent = indent,\\n tableAppearances = countTableAppearances(root)\\n }, Inspector_mt)\\n\\n inspector:putValue(root)\\n\\n return table.concat(inspector.buffer)\\nend\\n\\nsetmetatable(inspect, { __call = function(_, ...) return inspect.inspect(...) end })\\n\\nreturn inspect\\n"}, {"path": "lua/com/tests.lua", "data": "require \\"com/com\\"\\nrequire \\"com/globals\\"\\n\\nfunction testpitchdiff(a, b, expected)\\n local diff = relpitchdiff(a, b)\\n if diff ~= expected then\\n print(\\"pitchdiff: \\" .. a .. \\"-\\" .. b .. \\"~=\\" .. expected .. \\"(\\" .. diff .. \\")\\" )\\n end\\nend\\n\\ntestpitchdiff( 0, 0, 0)\\ntestpitchdiff( 0, 5, 5)\\ntestpitchdiff( 5, 0, -5)\\ntestpitchdiff( 0, 6, -6)\\ntestpitchdiff( 6, 0, 6)\\ntestpitchdiff( 7, 0, 5)\\ntestpitchdiff( 0, 7, -5)\\ntestpitchdiff( 7, 1, 6)\\ntestpitchdiff( 1, 7, -6)\\ntestpitchdiff( 7, 11, 4)\\ntestpitchdiff(11, 7, -4)\\ntestpitchdiff( 0, 10, -2)\\ntestpitchdiff(10, 0, 2)\\ntestpitchdiff( 5, 9, 4)\\ntestpitchdiff( 9, 5, -4)\\ntestpitchdiff( 5, 11, -6)\\ntestpitchdiff(11, 5, 6)\\ntestpitchdiff( 9, 11, 2)\\ntestpitchdiff(11, 9, -2)\\ntestpitchdiff(11, 1, 2)\\ntestpitchdiff( 1, 11, -2)\\ntestpitchdiff( 12, 24, 0)\\n\\n\\nx = tokeyvalue({\\"a\\", 100, \\"b\\", 200, \\"c\\", 300})\\nassert(x.a == 100)\\nassert(x.b == 200)\\nassert(x.c == 300)\\n\\n\\nassert( toMidiPitch({pitch=C, octave=0}) == 60)\\nassert( toMidiPitch({pitch=C, octave=1}) == 72)\\nassert( toMidiPitch({pitch=CIS, octave=1}) == 73)\\nassert( toMidiPitch({pitch=C, octave=-1}) == 48)"}, {"path": "lua/mods/_drumRudimentsRepository.lua", "data": "-- A definition of drum rudiments.\\n-- The actual rudiment duration dosen\'t matter. At the end, the sequence\\n-- will be ajdusted, so that it fits into the duration of the related event.\\n-- The relations between the different durations is what matters.\\n-- For example\\n-- A rudiment with four quarters, played over the duration of one eight:\\n-- every rudiment quarter will become eventually a 32th\\nR=\\"R\\"\\nL=\\"L\\"\\n\\nFlamType = \\"flam\\"\\nDragType = \\"drag\\"\\n\\n-- durations\\nlocal _4 = 1\\nlocal _8 = 1/2\\nlocal _16 = 1/4\\nlocal _32 = 1/8 \\nlocal _4t = _4 / 3\\nlocal _8t = _8 / 3\\nlocal _16t = _16 / 3\\nlocal _32t = _32 / 3\\n-- velocity factors\\nAccent = \\"accent\\"\\nUnaccented = \\"unaccented\\"\\nGraceNote = \\"grace note\\"\\n\\nlocal ac = Accent\\nlocal un = Unaccented\\n\\n\\n-- create a rudiment sequence event\\nlocal function Stroke(which, duration, velocityClass)\\n if velocityClass == nil then\\n velocityClass = Accent\\n end\\n return { which=which, duration=duration, velocityClass = velocityClass }\\nend\\n\\nlocal function Flam(which, duration, velocityClass)\\n if velocityClass == nil then\\n velocityClass = Accent\\n end\\n return { which=which, duration=duration, velocityClass = velocityClass, type = FlamType}\\nend\\n\\nlocal function Drag(which, duration, velocityClass)\\n if velocityClass == nil then\\n velocityClass = Accent\\n end\\n return { which=which, duration=duration, velocityClass = velocityClass, type = DragType}\\nend\\n\\nlocal S = Stroke\\n\\nlocal function Diddle(which, duration)\\n return {\\n S(which, duration, un), S(which, duration, un)\\n }\\nend\\n\\n-- returns L for R and R for L.\\nfunction Alt(which)\\n if which == L then\\n return R\\n elseif which == R then\\n return L\\n end\\n return nil\\nend\\n\\n-- alternates the \\"Hand\\" value (which).\\n-- \\"L\\" -> \\"R\\"\\n-- \\"R\\" -> \\"L\\"\\nfunction AlternateEvent(event)\\n local copy = deepcopy(event)\\n copy.which = Alt(event.which)\\n return copy\\nend\\n\\n-- Creates a alternating stroke sequence RL...n or LR...n.\\n-- @param startingEvent: the first event. All further created events are unaccented.\\n-- @param numberOfPerformances: the number of the total performances. One RL means one performance.\\nlocal function Alternate(startingEvent, numberOfPerformances)\\n if numberOfPerformances == nil then\\n numberOfPerformances = 1\\n end\\n local result = {startingEvent}\\n local which = startingEvent.which\\n for i = 0, (numberOfPerformances-1)*2, 1 do\\n which = Alt(which)\\n table.insert(result, S(which, startingEvent.duration, un))\\n end\\n return result\\nend\\n\\n-- Creates a sequence of variable args.\\n-- An argument can be either a array of events or a single event\\nlocal function Seq(...)\\n local args = table.pack(...)\\n local result = {}\\n for i=1,args.n do\\n local arg = args[i]\\n local isEvent = arg.which ~= nil\\n if isEvent then\\n table.insert(result, arg)\\n else\\n for key, event in pairs(arg) do\\n table.insert(result, event)\\n end\\n end\\n end\\n return result\\nend\\n\\nRudiments = {\\n [\\"singleStrokeRoll\\"] =\\n { S(R, _4), S(L, _4) },\\n [\\"doubleStrokeRoll\\"] =\\n { S(R, _4), S(R, _4), S(L, _4), S(L, _4) },\\n [\\"trippleStrokeRoll\\"] =\\n { S(R, _4), S(R, _4), S(R, _4), S(L, _4), S(L, _4), S(L, _4) },\\n [\\"fiveStrokeRoll\\"] =\\n { S(R, _32, un), S(R, _32, un), S(L, _32, un), S(L, _32, un), S(R, _8, ac) },\\n [\\"singleStrokeFour\\"] =\\n { S(R, _4t), S(L, _4t), S(R, _4t), S(L, _4) },\\n [\\"singleStrokeSeven\\"] =\\n { S(R, _8t), S(L, _8t), S(R, _8t), S(L, _8t), S(R, _8t), S(L, _8t), S(R, _4) },\\n [\\"multipleBounceRoll\\"] =\\n { S(R, _32, un), S(R, _32, un), S(R, _32, un), S(R, _32, un),\\n S(L, _32, un), S(L, _32, un), S(L, _32, un), S(L, _32, un)},\\n [\\"sixStrokeRoll\\"] =\\n Seq(S(R, _8, ac), Diddle(L, _16), Diddle(R, _16), S(L, _8, ac)),\\n [\\"sevenStrokeRoll\\"] =\\n Seq(Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"nineStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"tenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac), S(L, _8, ac)),\\n [\\"elevenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), S(L, _8, ac)),\\n [\\"thirteenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"fifteenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), S(L, _8, ac)),\\n [\\"seventeenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"paradiddle\\"] =\\n Seq(Alternate(S(R, _16, ac)), Diddle(R, _16)),\\n [\\"doubleParadiddle\\"] =\\n Seq(Alternate(S(R, _16, ac), 2), Diddle(R, _16)),\\n [\\"trippleParadiddle\\"] =\\n Seq(Alternate(S(R, _16, ac), 3), Diddle(R, _16)),\\n [\\"paradiddlediddle\\"] =\\n Seq(Alternate(S(R, _16, ac)), Diddle(R, _16), Diddle(L, _16)),\\n [\\"flam\\"] =\\n Seq(Flam(R, _4)),\\n [\\"flamAccent\\"] =\\n Seq(Flam(R, _8, ac), S(L, _8, un), S(R, _8, un)),\\n [\\"flamTap\\"] =\\n Seq(Flam(R, _16, ac), S(R, _16, un)),\\n [\\"flamacue\\"] =\\n Seq(Flam(R, _16, un), S(L, _16, ac), S(R, _16, un), S(L, _16, un), Flam(R, _4, un)),\\n [\\"flamParadiddle\\"] =\\n Seq(Flam(R, _16, ac), S(L, _16, un), Diddle(R, _16)),\\n [\\"singleFlammedMill\\"] =\\n Seq(Flam(R, _16, ac), S(R, _16, un), S(L, _16, un), S(R, _16, un)),\\n [\\"pataflafla\\"] =\\n Seq(Flam(R, _16, ac), S(L, _16, un), Diddle(R, _16), Flam(L, _16, ac)),\\n [\\"swissArmytriplet\\"] =\\n Seq(Flam(R, _16t, ac), S(R, _16t, un), S(L, _16t, un)),\\n [\\"invertedFlamTap\\"] =\\n Seq(Flam(R, _16, ac), S(L, _16, un)),\\n [\\"flamDrag\\"] =\\n Seq(Flam(R, _8, ac), S(L, _16, un), S(L, _16, un), S(R, _8, un)),\\n [\\"drag\\"] =\\n Seq(Drag(R, _4, ac)),\\n [\\"singleDragTap\\"] =\\n Seq(Drag(R, _8, un), S(L, _8, ac)),\\n [\\"doubleDragTap\\"] =\\n Seq(Drag(R, _8, un), Drag(R, _8, un), S(L, _8, ac)),\\n [\\"lesson25\\"] =\\n Seq(Drag(R, _16, un), S(L, _16, un), S(R, _8, ac)),\\n [\\"singleDragadiddle\\"] =\\n Seq(Drag(R, _16, ac), S(L, _16, un), Diddle(R, _16)),\\n [\\"dragParadiddle1\\"] =\\n Seq(S(R, _8, ac), Drag(R, _16, un), S(L, _16, un), Diddle(R, _16)),\\n [\\"dragParadiddle2\\"] =\\n Seq(S(R, _8, ac), Drag(R, _8, un), Drag(R, _16, un), S(L, _16, un), Diddle(R, _16)),\\n [\\"singleRatamacue\\"] =\\n Seq(Drag(R, _8t, un), S(L, _8t, un), S(R, _8t, un), S(L, _8, ac)),\\n [\\"doubleRatamacue\\"] =\\n Seq(Drag(R, _8, un), Drag(R, _8t, un), S(L, _8t, un), S(R, _8t, un), S(L, _8, ac)),\\n [\\"trippleRatamacue\\"] =\\n Seq(Drag(R, _8, un), Drag(R, _8, un), Drag(R, _8t, un), S(L, _8t, un), S(R, _8t, un), S(L, _8, ac)) \\n}\\n"}, {"path": "lua/mods/_events.lua", "data": "\\nNote = {}\\n\\nfunction Note:new()\\n local o = {}\\n setmetatable(o, self)\\n self.__index = self\\n o.duration = 0\\n o.isTied = false\\n o.offset = 0\\n o.pitches = {}\\n o.type = \\"note\\"\\n o.velocity = 0\\n return o \\nend\\n\\nfunction Note:addPitch(pitch, octave)\\n table.insert(self.pitches, {pitch=pitch, octave=octave})\\nend\\n\\nfunction pitchCompare(a, b)\\n a = a.pitch + (a.octave * 12)\\n b = b.pitch + (b.octave * 12)\\n return a < b\\nend\\n\\nfunction pitchCompareReversed(a, b)\\n a = a.pitch + (a.octave * 12)\\n b = b.pitch + (b.octave * 12)\\n return a > b\\nend\\n"}, {"path": "lua/mods/drumRudiments.lua", "data": "-- <command name=\\"drumRudiments\\" where=\\"mod\\" using=\\"lua/mod/drumRudiments.lua\\">\\n-- <)\\n-- You can specify which notes are for `L` and `R` and performing duration.\\n-- This will be achived by using an chord as source material.\\n-- The chord pitches will be used for `L` and `R`.\\n-- The length of the chord event defines over which time the rudiment will be peformed.\\n-- An event tag specifies which rudiment will be performed.\\n-- For example:\\n-- This plays one paradiddle over a length of 1 quarter\\n-- using `sn1` for R and `sn2` for L:\\n-- ```\\n-- /mod: drumRudiments/\\\\n\\n-- R L \\\\n\\n-- \\"paradiddle\\"@<\\"sn1\\" \\"sn2\\">4\\\\n\\n-- ```\\n-- Examples:\\n-- **a single paradiddle**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/drumRudiments.lua\\";\\\\n\\n--tempo: 150;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=118;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: drumRudiments/\\\\n\\n-- -- a paradiddle (RLRR) with c\' for R and c for L\\\\n\\n-- \\"paradiddle\\"@<c\' c>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- **repeating**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/drumRudiments.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=118;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: drumRudiments/\\\\n\\n-- -- performs 4 paradiddles (RLRR LRLL RLRR LRLL) with c\' for R and c for L\\\\n\\n-- \\"4x paradiddle\\"@<c\' c>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- **orchestration**\\n-- If you want to orchestrate a rudiment over a drum set,\\n-- you are able to define more R & L notes. *(The total number of the notes has to be even.)*\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/drumRudiments.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=118;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: drumRudiments/\\\\n\\n-- -- performs 4 paradiddles (RLRR LRLL RLRR LRLL) with \\\\n\\n-- -- c\' for R1 and c for L1\\\\n\\n-- -- and c, for R2 and c,, for L2.\\\\n\\n-- -- The final sequence will be: c\'(R1) c(L1) c,(R2) c,,(R1) ... \\\\n\\n-- \\"4x paradiddle\\"@<c\' c c, c,,>1\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- **Supported Rudiments**\\n--<ul style=\\"font-size: 0.9em;\\">\\n--<li>singleStrokeRoll</li>\\n--<li>doubleStrokeRoll</li>\\n--<li>trippleStrokeRoll</li>\\n--<li>fiveStrokeRoll</li>\\n--<li>singleStrokeFour</li>\\n--<li>singleStrokeSeven</li>\\n--<li>multipleBounceRoll</li>\\n--<li>sixStrokeRoll</li>\\n--<li>sevenStrokeRoll</li>\\n--<li>nineStrokeRoll</li>\\n--<li>tenStrokeRoll</li>\\n--<li>elevenStrokeRoll</li>\\n--<li>thirteenStrokeRoll</li>\\n--<li>fifteenStrokeRoll</li>\\n--<li>seventeenStrokeRoll</li>\\n--<li>paradiddle</li>\\n--<li>doubleParadiddle</li>\\n--<li>trippleParadiddle</li>\\n--<li>paradiddlediddle</li>\\n--<li>flam</li>\\n--<li>flamAccent</li>\\n--<li>flamTap</li>\\n--<li>flamacue</li>\\n--<li>flamParadiddle</li>\\n--<li>singleFlammedMill</li>\\n--<li>pataflafla</li>\\n--<li>swissArmytriplet</li>\\n--<li>invertedFlamTap</li>\\n--<li>flamDrag</li>\\n--<li>singleDragTap</li>\\n--<li>doubleDragTap</li>\\n--<li>lesson25</li>\\n--<li>singleDragadiddle</li>\\n--<li>dragParadiddle1</li>\\n--<li>dragParadiddle2</li>\\n--<li>singleRatamacue</li>\\n--<li>doubleRatamacue</li>\\n--<li>trippleRatamacue</li>\\n--</ul>\\n-- ]]>\\n-- </command>\\n-- <param name=\\"velocityFactorAccented\\" optional=\\"1\\" type=\\"0..1\\">The velocity factor for accented notes (Default=1)</param>\\n-- <param name=\\"velocityFactorUnaccented\\" optional=\\"1\\" type=\\"0..1\\">The velocity factor for unaccented notes (Default=0.7)</param>\\n-- <param name=\\"velocityFactorGraceNote\\" optional=\\"1\\" type=\\"0..1\\">The velocity factor for accented notes (Default=1)</param>\\n-- <param name=\\"flamOffset\\" optional=\\"1\\" type=\\"0..N\\">The offset in quartes when to perform the grace note before the actual note (Default=0.05)</param>\\n-- <param name=\\"dragOffset\\" optional=\\"1\\" type=\\"0..N\\">The offset in quartes when to perform the two grace notes before the actual note (Default=0.05)</param>\\n\\n\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"_drumRudimentsRepository\\"\\nrequire \\"_events\\"\\n\\nparameters = {\\n { name=\\"velocityFactorAccented\\", default=\\"1\\" },\\n { name=\\"velocityFactorUnaccented\\", default=\\"0.7\\" },\\n { name=\\"velocityFactorGraceNote\\", default=\\"0.2\\" },\\n { name=\\"flamOffset\\", default=\\"0.05\\" },\\n { name=\\"dragOffset\\", default=\\"0.05\\" },\\n}\\n\\n\\nSupportedRepeatTags = {\\n [\\"2x\\"] = 2,\\n [\\"3x\\"] = 3,\\n [\\"4x\\"] = 4,\\n [\\"5x\\"] = 5,\\n [\\"6x\\"] = 6,\\n [\\"7x\\"] = 7,\\n [\\"8x\\"] = 8,\\n [\\"9x\\"] = 9,\\n [\\"10x\\"] = 10,\\n [\\"11x\\"] = 11,\\n [\\"12x\\"] = 12,\\n [\\"13x\\"] = 13,\\n [\\"14x\\"] = 14,\\n [\\"15x\\"] = 15,\\n [\\"16x\\"] = 16,\\n [\\"17x\\"] = 17,\\n [\\"18x\\"] = 18,\\n [\\"19x\\"] = 19,\\n [\\"20x\\"] = 20,\\n [\\"21x\\"] = 21,\\n [\\"22x\\"] = 22,\\n [\\"23x\\"] = 23,\\n [\\"24x\\"] = 24,\\n [\\"25x\\"] = 25,\\n [\\"26x\\"] = 26,\\n [\\"27x\\"] = 27,\\n [\\"28x\\"] = 28,\\n [\\"29x\\"] = 29,\\n [\\"30x\\"] = 30,\\n [\\"31x\\"] = 31,\\n [\\"32x\\"] = 32,\\n}\\n\\nlocal tiedEventCache = {\\n [\\"offset\\"] = 0,\\n [\\"duration\\"] = 0,\\n [\\"originEvent\\"] = nil\\n}\\n\\nlocal function newTiedEventCache(event)\\n tiedEventCache.duration = event.duration\\n tiedEventCache.originEvent = event\\nend\\n\\nlocal function isTiedEventCacheEmpty()\\n return tiedEventCache.originEvent == nil\\nend\\n\\nlocal function clearTiedEventCache()\\n tiedEventCache.originEvent = nil\\n tiedEventCache.duration = 0\\n tiedEventCache.offset = 0\\nend\\n\\nlocal function getPossibleRudimentEvent(events)\\n local firstEvent = events[1]\\n if not isTiedEventCacheEmpty() then\\n tiedEventCache.duration = tiedEventCache.duration + firstEvent.duration\\n tiedEventCache.offset = tiedEventCache.offset - firstEvent.duration\\n if firstEvent.isTied then\\n return nil\\n end\\n end\\n if not isTiedEventCacheEmpty() and not firstEvent.isTied then\\n firstEvent = tiedEventCache.originEvent\\n firstEvent.isTied = false\\n firstEvent.offset = tiedEventCache.offset\\n firstEvent.duration = tiedEventCache.duration\\n clearTiedEventCache()\\n end\\n return firstEvent\\nend\\n\\n\\nfunction perform(events, params, timeinfo)\\n local firstEvent = getPossibleRudimentEvent(events)\\n if (firstEvent == nil) then\\n return {}\\n end\\n if #events == 0 or #firstEvent.tags == 0 then\\n return events\\n end\\n if firstEvent.duration == 0 then\\n return events\\n end\\n local rudimentPerformer = RudimentPerformer:new()\\n rudimentPerformer.velocityFactorAccented = tonumber(params.velocityFactorAccented)\\n rudimentPerformer.velocityFactorUnaccented = tonumber(params.velocityFactorUnaccented)\\n rudimentPerformer.velocityFactorGraceNote = tonumber(params.velocityFactorGraceNote)\\n rudimentPerformer.flamOffset = tonumber(params.flamOffset)\\n rudimentPerformer.dragOffset = tonumber(params.dragOffset)\\n rudimentPerformer:setSourceEvent(firstEvent)\\n if rudimentPerformer.rudiment == nil then\\n return events\\n end\\n if firstEvent.isTied then\\n newTiedEventCache(firstEvent)\\n return {}\\n end\\n local rudimentEvents = rudimentPerformer:perform();\\n return rudimentEvents\\nend\\n\\nRudimentPerformer = {}\\nfunction RudimentPerformer:new(o)\\n local o = o or {}\\n setmetatable(o, self)\\n self.__index = self\\n self.idxL = 1\\n self.idxR = 1\\n self.offset = 0\\n self.velocityFactorAccented = 1\\n self.velocityFactorUnaccented = 0.7\\n self.velocityFactorGraceNote = 0.2\\n self.flamOffset = 0.05\\n self.dragOffset = 0.05\\n return o\\nend\\n\\nfunction RudimentPerformer:findRudimentName(tags)\\n for idx, tag in pairs(tags) do\\n local val = Rudiments[tag]\\n if val ~= nil then\\n return tag\\n end\\n end\\n return nil\\nend\\n\\nfunction RudimentPerformer:findRepeatTagValue(tags)\\n for idx, tag in pairs(tags) do\\n local val = SupportedRepeatTags[tag]\\n if val ~= nil then\\n return val\\n end\\n end\\n return nil\\nend\\n\\nfunction RudimentPerformer:setSourceEvent(event)\\n local rudimentName = self:findRudimentName(event.tags)\\n local source = event.pitches\\n self.offset = event.offset\\n self.rudiment = Rudiments[rudimentName]\\n if self.rudiment == nil then\\n return\\n end\\n if #source % 2 ~= 0 then\\n -- not enough events\\n error(\\"not enough chord pitches for rudiment \\" .. rudimentName)\\n end\\n local repeatCount = self:findRepeatTagValue(event.tags)\\n if repeatCount ~= nil then\\n self:repeat_(repeatCount)\\n end\\n self.duration = event.duration\\n self.ls = {}\\n self.rs = {}\\n self.velocity = event.velocity\\n for idx, pitch in pairs(source) do\\n if idx % 2 == 0 then\\n table.insert(self.ls, pitch)\\n else\\n table.insert(self.rs, pitch)\\n end\\n end\\nend\\n\\nfunction RudimentPerformer:repeat_(count)\\n local sequence = {}\\n for i=1,count do\\n local useAlternation = i % 2 == 1\\n for idx, rudimentEvent in pairs(self.rudiment) do\\n local event = rudimentEvent\\n if (useAlternation) then\\n event = AlternateEvent(event)\\n end\\n table.insert(sequence, event)\\n end\\n end\\n self.rudiment = sequence\\nend\\n\\nfunction RudimentPerformer:l()\\n local l = self.ls[self.idxL]\\n self.idxL = self.idxL + 1\\n if self.idxL > #self.ls then\\n self.idxL = 1\\n end\\n return l\\nend\\n\\nfunction RudimentPerformer:r()\\n local r = self.rs[self.idxR]\\n self.idxR = self.idxR + 1\\n if self.idxR > #self.ls then\\n self.idxR = 1\\n end\\n return r\\nend\\n\\nfunction RudimentPerformer:nextPitch(lOrR)\\n if lOrR == nil then\\n error(\\"invalid L R value for rudiment: nil\\")\\n end\\n if lOrR == L then\\n return self:l()\\n elseif lOrR == R then\\n return self:r()\\n end\\n error(\\"invalid L R value for rudiment: \\" .. lOrR)\\nend\\n\\n-- duration of the rudiment definition\\nfunction RudimentPerformer:defDuration()\\n local duration = 0\\n for idx, rudiment in pairs(self.rudiment) do\\n duration = duration + rudiment.duration\\n end\\n return duration\\nend\\n\\nfunction RudimentPerformer:getVelocityFactor(rudiment)\\n if rudiment.velocityClass == Accent then\\n return self.velocityFactorAccented\\n end\\n if rudiment.velocityClass == Unaccented then\\n return self.velocityFactorUnaccented\\n end\\n if rudiment.velocityClass == GraceNote then\\n return self.velocityFactorGraceNote\\n end\\n error(\\"no velocity value for class \\" .. rudiment.velocityClass)\\nend\\n\\nfunction RudimentPerformer:perform()\\n local events = {}\\n local offset = self.offset\\n local durationFactor = self.duration / self:defDuration()\\n for idx, rudiment in pairs(self.rudiment) do\\n local type = rudiment.type\\n local which = rudiment.which\\n local duration = rudiment.duration\\n local velocityFactor = self:getVelocityFactor(rudiment)\\n local note = Note:new()\\n note.duration = duration * durationFactor\\n note.velocity = self.velocity * velocityFactor\\n note.offset = offset\\n local pitch = self:nextPitch(which)\\n note:addPitch(pitch.pitch, pitch.octave)\\n if type == FlamType then\\n self:performFlam(events, note, Alt(which))\\n end\\n if type == DragType then\\n self:performDrag(events, note, Alt(which))\\n end \\n table.insert(events, note)\\n offset = offset + note.duration\\n end\\n return events\\nend\\n\\n\\nfunction RudimentPerformer:performFlam(events, note, which)\\n local flamDuration = self.flamOffset\\n local flam = Note:new()\\n local pitch = self:nextPitch(which)\\n flam:addPitch(pitch.pitch, pitch.octave)\\n flam.duration = flamDuration\\n flam.velocity = note.velocity * self.velocityFactorGraceNote\\n flam.offset = note.offset\\n note.offset = note.offset + flamDuration\\n note.duration = note.duration\\n table.insert(events, flam)\\nend\\n\\nfunction RudimentPerformer:performDrag(events, note, which)\\n local flamDuration = self.dragOffset\\n local pitch = self:nextPitch(which)\\n local flam = Note:new()\\n flam:addPitch(pitch.pitch, pitch.octave)\\n flam.duration = flamDuration\\n flam.velocity = note.velocity * self.velocityFactorGraceNote\\n flam.offset = note.offset\\n table.insert(events, flam)\\n\\n flam = Note:new()\\n flam:addPitch(pitch.pitch, pitch.octave)\\n flam.duration = flamDuration\\n flam.velocity = note.velocity * self.velocityFactorGraceNote\\n flam.offset = note.offset + flamDuration\\n table.insert(events, flam)\\n\\n note.offset = note.offset + flamDuration * 2\\n note.duration = note.duration\\n\\nend\\n"}, {"path": "lua/mods/guitarStroke.lua", "data": "-- <command name=\\"guitarStroke\\" where=\\"mod\\" using=\\"lua/mod/guitarStroke.lua\\">\\n-- <![CDATA[\\n-- Simulates guitar strokes as mini arpeggios.\\n-- *Note: the alternate mode works only if this mod is set via instrumentConf.*\\n-- ```\\n-- -- does not work: \\\\n\\n-- [ \\\\n\\n-- { \\\\n\\n-- /mod: guitarStroke _mode=alternate/\\\\n\\n-- } \\\\n\\n-- ] \\\\n\\n-- ```\\n-- ```\\n-- -- does work: \\\\n\\n-- instrumentConf: myInstrument mod guitarStroke _mode=alternate; \\\\n\\n-- ```\\n-- **Example**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/guitarStroke.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef: piano MyDevice _ch=0 _pc=24;\\\\n\\n--instrumentConf: piano mod guitarStroke _mode=alternate _value=16; \\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- <c e g b>4 <c e g b>4 <c eb g bb>2 | <c eb g bb>2 <c eb g bb>2\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"direction\\" optional=\\"1\\" type=\\"[up,down]\\">Specifies the start direction of the stroke</param>\\n-- <param name=\\"value\\" optional=\\"1\\" type=\\"[1,2,4,8,...]\\">the duration of one aprgeggio event. (Default=64)</param>\\n-- <param name=\\"mode\\" optional=\\"1\\" type=\\"[normal,alternate]\\">Perform only one stroke direction (normal) or alternates between up and down. (Default=normal)</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"_events\\"\\n\\n\\nparameters = {\\n -- can be up, down\\n { name=\\"direction\\", default=\\"up\\" },\\n -- can be 1, 2, 4, 8, 16, 32, 64, ...\\n { name=\\"value\\", default=\\"64\\" },\\n -- can be normal, alternate\\n { name=\\"mode\\", default=\\"normal\\" }\\n\\n}\\n\\nlocal direction = nil\\nlocal mode = nil\\n\\nfunction perform(eventsOrigin, params, timeinfo)\\n if #eventsOrigin > 2 then\\n return eventsOrigin\\n end\\n checkLegacyNamedParams(params, \\"direction\\", \\"mode\\", \\"value\\")\\n local directionParam = params.direction\\n local modeParam = params.mode\\n local value = params.value\\n value = tonumber(value)\\n local event = eventsOrigin[1]\\n local events = { }\\n local comparer = pitchCompare\\n \\n if mode == nil then\\n mode = modeParam\\n end\\n\\n if direction ==nil then\\n direction = directionParam\\n end\\n\\n if direction == \\"down\\" then\\n comparer = pitchCompareReversed\\n if mode == \\"alternate\\" then\\n direction = \\"up\\"\\n end\\n else\\n comparer = pitchCompare\\n if mode == \\"alternate\\" then\\n direction = \\"down\\"\\n end\\n end\\n\\n local duration = 1 / value\\n table.sort( event.pitches, comparer)\\n for i, pitch in pairs(event.pitches) do\\n local note = Note:new()\\n local newOffset = event.offset + (i-1) * duration\\n note.offset = newOffset\\n note.duration = event.duration - newOffset\\n note.isTied = event.isTied\\n note.velocity = event.velocity\\n note:addPitch(pitch.pitch, pitch.octave)\\n table.insert(events, note) \\n end\\n return events\\nend"}, {"path": "lua/mods/legato.lua", "data": "-- <command name=\\"legato\\" where=\\"mod\\" using=\\"lua/mod/legato.lua\\">\\n-- Performs every note legato. It is also possible to tag single notes.\\n-- If a tag is given, only the tagged notes are performed legato.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/legato.lua\\";\\\\n\\n--tempo: 140;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: legato _forTag=leg _amount=100/\\\\n\\n-- -- only the `d` will be performed legato. \\\\n\\n-- c \\"leg\\"@d e f\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- </command>\\n-- <param name=\\"forTag\\" optional=\\"1\\" type=\\"text\\">Specifies a tag name. If set only events with this tag name will be affected by the legato mod.</param>\\n-- <param name=\\"amount\\" optional=\\"1\\" type=\\"0..100\\">The ammount of the legato effect</param>\\n\\nrequire \\"lua/com/com\\"\\n\\nlocal defaultAmountValue = 50\\n\\nparameters = {\\n -- specify a tag name. If set only events with this tag name will be affected by the staccato mod. \\n { name=\\"forTag\\", default=ParameterValueNoTag },\\n -- the ammount of the staccato mod. Can be between 0 and 100\\n { name=\\"amount\\", default=\\"50\\" }\\n}\\n\\nfunction perform(events, params, timeinfo) \\n checkLegacyNamedParams(params, \\"forTag\\", \\"amount\\")\\n local tag = params.forTag\\n if tag == ParameterValueNoTag then\\n tag = nil\\n end\\n local amount = tonumber(params.amount)\\n local factor = 100 - ((amount/100) * 90)\\n factor = factor / 100\\n for i, event in pairs(events) do\\n if tag == nil or contains(event.tags, tag) then\\n event.duration = event.duration / factor\\n end\\n end\\n return events\\nend"}, {"path": "lua/mods/myArpeggio.lua", "data": "-- <command name=\\"myArpeggio\\" where=\\"mod\\" using=\\"lua/mod/myArpeggio.lua\\">\\n-- <![CDATA[\\n-- A simple arpeggio implementation.\\n-- **Example**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/myArpeggio.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef: piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /do: myArpeggio/ \\\\n\\n-- <c e g b>2 \\\\n\\n-- /do: myArpeggio _direction=down/ \\\\n\\n-- <c eb g bb>2 \\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"style\\" optional=\\"1\\" type=\\"[normal,legato]\\">Performs the arpeggio normal or legato</param>\\n-- <param name=\\"direction\\" optional=\\"1\\" type=\\"[up,down]\\">the direction of the aprgeggio. (Default=up)</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"_events\\"\\n\\n\\nparameters = {\\n -- can be legato, normal\\n { name=\\"style\\", default=\\"normal\\" },\\n -- can be up, down\\n { name=\\"direction\\", default=\\"up\\" }\\n}\\n\\nfunction perform(eventsOrigin, params, timeinfo)\\n checkLegacyNamedParams(params, \\"direction\\", \\"style\\")\\n local event = eventsOrigin[1]\\n local events = { }\\n local comparer = pitchCompare\\n local direction = params.direction\\n local style = params.style\\n\\n if direction == \\"down\\" then\\n comparer = pitchCompareReversed\\n end\\n local duration = event.duration / #event.pitches\\n table.sort( event.pitches, comparer)\\n for i, pitch in pairs(event.pitches) do\\n local note = Note:new()\\n note.duration = duration\\n if style == \\"legato\\" then\\n note.duration = event.duration\\n end\\n note.velocity = event.velocity\\n note.offset = (i-1) * duration\\n note.isTied = event.isTied\\n note:addPitch(pitch.pitch, pitch.octave)\\n table.insert(events, note) \\n end\\n return events\\nend"}, {"path": "lua/mods/staccato.lua", "data": "-- <command name=\\"staccato\\" where=\\"mod\\" using=\\"lua/mod/staccato.lua\\">\\n-- Performs every note staccato. It is also possible to tag single notes.\\n-- If a tag is given, only the tagged notes are performed staccato.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/staccato.lua\\";\\\\n\\n--tempo: 140;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: staccato _forTag=stac _amount=100/\\\\n\\n-- -- only the `d` will be performed staccato. \\\\n\\n-- c \\"stac\\"@d e f\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ``` \\n-- </command>\\n-- <param name=\\"forTag\\" optional=\\"1\\" type=\\"text\\">Specifies a tag name. If set only events with this tag name will be affected by the staccato mod.</param>\\n-- <param name=\\"amount\\" optional=\\"1\\" type=\\"0..100\\">The ammount of the staccato effect</param>\\n\\nrequire \\"lua/com/com\\"\\n\\n\\nparameters = {\\n -- specify a tag name. If set only events with this tag name will be affected by the staccato mod. \\n { name=\\"forTag\\", default=ParameterValueNoTag },\\n -- the ammount of the staccato mod. Can be between 0 and 100\\n { name=\\"amount\\", default=\\"50\\" }\\n}\\n\\nfunction perform(events, params, timeinfo)\\n checkLegacyNamedParams(params, \\"forTag\\", \\"amount\\")\\n local tag = params.forTag\\n if tag == ParameterValueNoTag then\\n tag = nil\\n end\\n local amount = tonumber(params.amount)\\n local factor = 100 - ((amount/100) * 90)\\n factor = factor / 100\\n for i, event in pairs(events) do\\n if tag == nil or contains(event.tags, tag) then\\n event.duration = event.duration * factor\\n end\\n end\\n return events\\nend"}, {"path": "lua/mods/swing.lua", "data": "-- <command name=\\"swing\\" where=\\"mod\\" using=\\"lua/mod/swing.lua\\">\\n-- Performs a swing groove.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/swing.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef: piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: swing/\\\\n\\n-- c8 c c c c c c c\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- </command>\\n-- <param name=\\"grid\\" optional=\\"1\\" type=\\"[8, 16]\\">Performs the swing offset either on 8th or 16th. (Default=8)</param>\\n-- <param name=\\"offset\\" optional=\\"1\\" type=\\"0..100\\">The ammount of the swing offset</param>\\n\\nrequire \\"lua/com/com\\"\\n\\nparameters = {\\n -- can be 8, 16\\n { name=\\"grid\\", default=\\"8\\" },\\n -- can be between 0 and 100\\n { name=\\"offset\\", default=\\"100\\" }\\n}\\n\\n\\nfunction compareQuarters(a, b)\\n return math.abs(a-b) <= 0.1\\nend\\n\\nfunction isLaidBack(timeinfo, grid)\\n local q = timeinfo.quarterPosition\\n q = q - math.floor(q)\\n if grid == 16 then\\n return compareQuarters(q, 0.25) or compareQuarters(q, 0.75)\\n end\\n return compareQuarters(q, 0.5)\\nend\\n\\nfunction offset(grid, offset)\\n if offset == nil then\\n offset = 100\\n end\\n offset = offset / 100\\n local max = 0.25\\n if grid == 16 then\\n max = 0.09\\n end\\n return offset * max\\nend\\n\\nfunction perform(events, params, timeinfo)\\n checkLegacyNamedParams(params, \\"grid\\", \\"offset\\")\\n local gridValue = tonumber(params.grid)\\n local offsetValue = tonumber(params.offset)\\n for i, event in pairs(events) do\\n if isLaidBack(timeinfo, gridValue) then\\n event.offset = offset(gridValue, offsetValue)\\n event.velocity = event.velocity\\n end\\n end\\n return events\\nend"}, {"path": "lua/voicings/config.lua", "data": "PitchRanges = {\\n contrabass = { min=28, max=55 },\\n bass = { min=40, max=60 },\\n baritone = { min=45, max=69 },\\n tenor = { min=48, max=72 },\\n alto = { min=53, max=77 },\\n mezzosoprano = { min=57, max=81 },\\n soprano = { min=60, max=84 }\\n}"}, {"path": "lua/voicings/guitar.lua", "data": "-- <command name=\\"guitar\\" where=\\"voicingStrategy\\" using=\\"lua/voicings/guitar.lua\\">\\n-- <![CDATA[\\n-- Tries to simulate the chord voicing of an guitar.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/voicings/guitar.lua\\";\\\\n\\n--using \\"chords/default.chords\\";\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--type: template;\\\\n\\n--name: myTemplate;\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /voicingStrategy: guitar/\\\\n\\n-- <I II III IV V VI VII>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n--[\\\\n\\n--type: accomp;\\n--{\\\\n\\n-- C | F | G | C |\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"range\\" optional=\\"1\\" type=\\"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]\\">If given the strategy tries to keeps the range by shifting the octave of the chord.</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"lua/com/globals\\"\\nrequire \\"solvers/guitar\\"\\n\\nparameters = {\\n table.unpack(ASolverDefaultParameter)\\n}\\n\\nlocal solver = GuitarSolver:new()\\n\\nfunction solve(chord, degrees, params, timeinfo)\\n return solver:solve(chord, degrees, params)\\nend"}, {"path": "lua/voicings/simple.lua", "data": "-- <command name=\\"simple\\" where=\\"voicingStrategy\\" using=\\"lua/voicings/simple.lua\\">\\n-- <![CDATA[\\n-- The simple approach with no strategy.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/voicings/simple.lua\\";\\\\n\\n--using \\"chords/default.chords\\";\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--type: template;\\\\n\\n--name: myTemplate;\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /voicingStrategy: simple/\\\\n\\n-- <I II III IV V VI VII>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n--[\\\\n\\n--type: accomp;\\n--{\\\\n\\n-- C | F | G | C |\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"range\\" optional=\\"1\\" type=\\"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]\\">If given the strategy tries to keeps the range by shifting the octave of the chord.</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"solvers/simple\\"\\nrequire \\"solvers/asolver\\"\\n\\nparameters = {\\n table.unpack(ASolverDefaultParameter)\\n}\\n\\nlocal solver = Simple:new()\\n\\nfunction solve(chord, degrees, parameters)\\n return solver:solve(chord, degrees, parameters)\\nend"}, {"path": "lua/voicings/voicelead.lua", "data": "-- <command name=\\"voicelead\\" where=\\"voicingStrategy\\" using=\\"lua/voicings/voicelead.lua\\">\\n-- <![CDATA[\\n-- Tries to simulates a voice leading approach:\\n-- the octaves of a chord are rearranged, so that the actual pitch distance between the previous chord is kept minimal.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/voicings/voicelead.lua\\";\\\\n\\n--using \\"chords/default.chords\\";\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--type: template;\\\\n\\n--name: myTemplate;\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /voicingStrategy: voicelead/\\\\n\\n-- <I II III IV V VI VII>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n--[\\\\n\\n--type: accomp;\\n--{\\\\n\\n-- C | F | G | C |\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"range\\" optional=\\"1\\" type=\\"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]\\">If given the strategy tries to keeps the range by shifting the octave of the chord.</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"lua/com/globals\\"\\nrequire \\"solvers/voicelead\\"\\n\\nparameters = {\\n table.unpack(ASolverDefaultParameter)\\n}\\n\\nlocal solver = VoiceLeadSolver:new()\\n\\nfunction solve(chord, degrees, params)\\n return solver:solve(chord, degrees, params)\\nend"}, {"path": "lua/voicings/solvers/asolver.lua", "data": "require \\"config\\"\\nrequire \\"lua/com/com\\"\\n\\nNoRangeSet = \\"__noRangeSet\\"\\nNoImportantDegreesSet = \\"_noImportantDegreesSet\\"\\n\\nASolverDefaultParameter = {\\n -- can be contrabass, bass, baritone, tenor, alto, mezzosoprano, soprano\\n { name=\\"range\\", default=NoRangeSet },\\n { name=\\"importantDegrees\\", default=NoImportantDegreesSet },\\n { name=\\"importantDegree\\", default=NoImportantDegreesSet },\\n}\\nASolver = {}\\n\\nfunction ASolver:new(o)\\n local o = o or {}\\n setmetatable(o, self)\\n self.__index = self\\n return o\\nend\\n\\nfunction ASolver:checkForLegacyParameters(params)\\n checkLegacyNamedParams(params, \\"range\\", \\"importantDegrees\\", \\"importantDegree\\")\\nend\\n\\n-- returns the a degree def from the given degree def collection\\n-- if more than one degree def defined, it will return the first one\\nfunction ASolver:getDefaultDegreeDef(degreeValue, degrees)\\n local default = degrees[degreeValue]\\n if default == nil \\n then\\n return nil\\n end\\n return default[1]\\nend\\n\\n-- creates a absolute pitch using the given chord\\nfunction ASolver:createPitch(chord, degreeDef, octave)\\n if degreeDef == nil or degreeDef.degreeValue == nil\\n then\\n return nil\\n end\\n return { [\\"pitch\\"]= self:degreeToPitch(degreeDef, chord), [\\"octave\\"]=octave }\\nend\\n\\nfunction ASolver:degreeToPitch(degreeDef, chord)\\n return chord.rootPitch + degreeDef.degreeValue\\nend\\n\\nfunction ASolver:getAbsolutePitch(pitch)\\n return pitch.pitch + (pitch.octave * 12)\\nend\\n\\nfunction ASolver:_addImportantDegree(degrees, degreeVal, semitone)\\n local degreeInfo = self:getDefaultDegreeDef(degreeVal, degrees)\\n if degreeInfo==nil then\\n return\\n end\\n local degrObj = {\\n degreeValue= semitone,\\n octave= degreeInfo.octave\\n }\\n degrees[degreeVal] = {degrObj}\\nend\\n\\n-- set important degrees if defined in params\\n-- more informations about important degrees:\\n-- https://github.com/werckme/werckmeister/issues/123\\nfunction ASolver:_setImportantDegreesIfExists(params, degrees)\\n local strDegree = params.importantDegree\\n if (strDegree == nil or strDegree == NoImportantDegreesSet) then\\n strDegree = params.importantDegrees\\n if strDegree == nil or strDegree == NoImportantDegreesSet then\\n return\\n end\\n end\\n local strDegrees = split(strDegree, \\" \\")\\n for i, degree in pairs(strDegrees) do \\n local degreeVal = DegreeStringValues[degree]\\n if degreeVal ~= nil then\\n local semitone = MajorScaleSemitones[degree]\\n self:_addImportantDegree(degrees, degreeVal, semitone)\\n end\\n end\\nend\\n\\n-- solves degrees into absolute pitches\\n-- @param chord: the current cord informations\\n-- @param degrees: the current degree event including the semitone informations from \\n-- the chord definition eg.: { II= {degreeValue, octave} }\\n-- If the current chord has no information about a degree\\n-- the value is empty eg.: II= {} \\nfunction ASolver:solve(chord, degrees, params)\\n self:checkForLegacyParameters(params)\\n self:_setImportantDegreesIfExists(params, degrees)\\n local result = self:_solveImpl(chord, degrees, params)\\n if params.range ~= nil and params.range ~=NoRangeSet then\\n self:_keepRange(result, params.range)\\n end\\n return result\\nend\\n\\nfunction ASolver:_solveImpl(chord, degrees, args)\\n error(\\"this is an abstract function\\")\\nend\\n\\nfunction ASolver:_transpose(pitches, numOctaves)\\n for i, pitch in pairs(pitches) do\\n pitch.octave = pitch.octave + numOctaves\\n end\\nend\\n\\nfunction ASolver:_keepRange(pitches, strRange)\\n local destinationRange = PitchRanges[strRange]\\n if destinationRange == nil then\\n error(\\"strRange \\" .. strRange .. \\" not defined\\")\\n end\\n local nbUnder = 0\\n local nbOver = 0\\n local mindiff = math.maxinteger\\n local maxdiff = math.mininteger\\n for i, pitch in pairs(pitches) do\\n local midipitch = toMidiPitch(pitch)\\n if midipitch > destinationRange.max then\\n local diff = midipitch - destinationRange.max\\n if diff > maxdiff then\\n maxdiff = diff\\n end\\n nbOver = nbOver + 1\\n end\\n if midipitch < destinationRange.min then\\n local diff = destinationRange.min - midipitch\\n if diff < mindiff then\\n mindiff = diff\\n end\\n nbUnder = nbUnder + 1\\n end\\n end\\n if nbUnder > nbOver then\\n local octaves = math.ceil(mindiff/12)\\n self:_transpose(pitches, octaves)\\n end\\n if nbUnder < nbOver then\\n local octaves = -math.ceil(maxdiff/12)\\n self:_transpose(pitches, octaves)\\n end\\nend"}, {"path": "lua/voicings/solvers/config.lua", "data": "PitchRanges = {\\n contrabass = { min=28, max=55 },\\n bass = { min=40, max=60 },\\n baritone = { min=45, max=69 },\\n tenor = { min=48, max=72 },\\n alto = { min=53, max=77 },\\n mezzosoprano = { min=57, max=81 },\\n soprano = { min=60, max=84 }\\n}"}, {"path": "lua/voicings/solvers/guitar.lua", "data": "require \\"lua/voicings/solvers/asolver\\"\\nrequire \\"lua/com/globals\\"\\n\\n-- https://www.8notes.com \\n-- https://www.oolimo.de/gitarrenakkorde/find\\n-- https://www.scales-chords.com/chord/piano/\\nVoicingMatrix = {\\n [\\"1234567/bass\\"] = nil,\\n [\\"1010100\\"] = {I, V, I, III, I}, -- base\\n [\\"1100100\\"] = {I, V, I, II }, -- sus2\\n [\\"1001100\\"] = {I, V, I, IV, V }, -- sus4\\n [\\"1001101\\"] = {I, V, VII, IV, V}, -- 7sus4\\n [\\"1101101\\"] = {I, IV, VII, II, V}, -- 9sus4\\n [\\"1010110\\"] = {I, VI, III, V}, -- 6\\n [\\"1110110\\"] = {I, VI, III, V, II}, -- 6/9\\n [\\"1010101\\"] = {I, V, VII, III, I}, -- 7\\n [\\"1110101\\"] = {I, III, VII, II}, -- 9\\n [\\"1110100\\"] = {I, V, II, III}, -- add9\\n [\\"1011101\\"] = {I, IV, VII, III}, -- 11\\n [\\"1011001\\"] = {I, VII, III, IV}, -- 7#11\\n [\\"1010111\\"] = {I, V, VII, III, VI}, -- 13\\n [\\"1010101/7\\"] = {VII, V, I, III}, -- /7\\n [\\"1010100/5\\"] = {V, I, III, V}, -- /5\\n [\\"1011100/4\\"] = {IV, V, I, III}, -- /4\\n [\\"1010100/3\\"] = {III, V, I, III}, -- /3\\n [\\"1110100/2\\"] = {II, V, I, III}, -- /2\\n}\\n\\n\\n-- returns the degrees defined for a chord as a bit string.\\n-- e.g.: Xmaj\'s degrees are defined as I III V\\n-- 1234567\\n-- as bitstring = 1010100\\n-- if chord is a slash chord, the degree value will be appended as number.\\n-- e.g.: X/V = 1010100/5\\nfunction chordToHashString(chord)\\n bits = {}\\n slashAppendings = {}\\n local degree = chord.degrees\\n for i=1, 7 do\\n if degree[i] == nil then\\n bits[i] = 0\\n else\\n bits[i] = 1\\n if chord.degrees[i] < 0 then\\n table.insert(slashAppendings, i)\\n end\\n end\\n end\\n if #slashAppendings == 0 then\\n return table.concat(bits)\\n end\\n return table.concat(bits) .. \\"/\\" .. table.concat(slashAppendings)\\nend\\n\\nGuitarSolver = ASolver:new()\\n\\nfunction GuitarSolver:degreeToPitch(degreeDef, chord)\\n return chord.rootPitch + (degreeDef.degreeValue % 12)\\nend\\n\\nfunction GuitarSolver:_solveImpl(chord, degrees, params)\\n local d = function(degreeValue) return self:getDefaultDegreeDef(degreeValue, degrees) end\\n local strDegrees = chordToHashString(chord)\\n local voicing = VoicingMatrix[strDegrees]\\n if voicing == nil then\\n error(\\"no voicing found defined for \\" .. chord.strBase .. chord.strOptions .. \\" \\" .. strDegrees)\\n end\\n local result = {}\\n local octave = -1\\n local lastDegree = -1\\n for idx, degree in pairs(voicing) do\\n if degree <= lastDegree then \\n octave = octave + 1\\n end\\n lastDegree = degree\\n result[idx] = self:createPitch(chord, d(degree ), octave)\\n end\\n return result\\nend"}, {"path": "lua/voicings/solvers/simple.lua", "data": "require \\"lua/voicings/solvers/asolver\\"\\nrequire \\"lua/com/globals\\"\\n\\nSimple = ASolver:new()\\n\\nfunction Simple:degreeToPitch(degreeDef, chord)\\n return chord.rootPitch + degreeDef.degreeValue\\nend\\n\\nfunction Simple:_solveImpl(chord, degrees, parameters)\\n local pitches = {}\\n for degree, degreeDefs in pairs(degrees)\\n do\\n if isnumber(degree)\\n then\\n for idx, degreeDef in pairs(degreeDefs)\\n do\\n table.insert(pitches, self:createPitch(chord, degreeDef, degreeDef.octave))\\n end\\n end\\n end\\n return pitches\\nend"}, {"path": "lua/voicings/solvers/voicelead.lua", "data": "require \\"simple\\"\\nrequire \\"lua/com/globals\\"\\n\\nVoiceLeadSolver = Simple:new()\\n\\nfunction VoiceLeadSolver:getPitchWithMinDistance(pitch, pitches)\\n local min = math.maxinteger\\n local minPitch = nil\\n local relPitch = pitch.pitch % 12\\n for i, refpitch in pairs(pitches) do\\n local diff = relpitchdiff(refpitch.pitch, relPitch)\\n diff = math.abs(diff)\\n if (diff < min) then\\n minPitch = refpitch\\n min = diff\\n end\\n end\\n return minPitch\\nend\\n\\n-- changes the octave of pitch, so that the interval\\n-- between pitch and targetPitch is minimal\\nfunction VoiceLeadSolver:toPitchNextTo(pitch, targetPitch)\\n if targetPitch == nil then\\n return pitch\\n end\\n local diff = pitch.pitch - targetPitch.pitch\\n pitch.octave = targetPitch.octave\\n --print(pitch.pitch, targetPitch.pitch, diff)\\n if (diff > 6) then\\n pitch.octave = pitch.octave - 1\\n end\\n if (diff < -6) then\\n pitch.octave = pitch.octave + 1\\n end\\n return pitch\\nend\\n\\n\\n-- compare pitches with a reference and adjust octaves\\nfunction VoiceLeadSolver:adjustOctaves(pitches, reference)\\n for i, pitch in pairs(pitches) do\\n local min = self:getPitchWithMinDistance(pitch, reference) \\n self:toPitchNextTo(pitch, min)\\n end\\n return pitches\\nend\\n\\nfunction VoiceLeadSolver:_solveImpl(chord, degrees, params)\\n local pitches = Simple:_solveImpl(chord, degrees, params)\\n if #pitches < 2\\n then\\n return pitches\\n end\\n if self.previous ~= nil \\n then\\n pitches = self:adjustOctaves(pitches, self.previous)\\n end\\n return pitches\\nend\\n\\nfunction VoiceLeadSolver:solve(chord, degrees, params)\\n self:checkForLegacyParameters(params)\\n local result = self:_solveImpl(chord, degrees, params)\\n if params.range ~=nil and params.range ~=NoRangeSet then\\n self:_keepRange(result, params.range)\\n end\\n self.previous = result\\n return result\\nend"}, {"path": "pitchmaps/battery3.tight.pitchmap", "data": "\\"bd\\": c,,\\n\\"sn\\": d,,\\n\\"sng\\": g# --snare ghost notes\\n\\"ss\\": c#,, -- sidestick\\n\\"hc\\": d#,, -- handclap\\n\\"ht\\": f#,, -- hihat closed\\n\\"hf\\": g#,, -- hihat foot\\n\\"ho\\": bb,, -- hihat open\\n\\"ho1\\": g\' -- hihat half open1\\n\\"ho2\\": g#\' -- hihat half open2\\n\\"ho3\\": a\' -- hihat half open3\\n\\"cy\\": c#,\\n\\"hto\\": c,\\n\\"hto1\\": c,\\n\\"hto2\\": d,\\n\\"mto\\": b,,\\n\\"mto1\\": b,,\\n\\"mto2\\": a,,\\n\\"lto\\": g,,\\n\\"lto1\\": g,,\\n\\"lto2\\": f,,\\n\\"rdbell\\": f#,\\n\\"mtr\\": ab\'\\n\\"otr\\": a\'\\n-- r&l\\n\\"snl\\": d,,\\n\\"snr\\": e,,\\n\\"riml\\": c#,,\\n\\"rimr\\": d#,,\\n\\"htol\\": e,\\n\\"htor\\": f,\\n\\"mtol\\": c,\\n\\"mtor\\": d,\\n\\"ltol\\": b,,\\n\\"ltor\\": a,,\\n\\"ftol\\": g,,\\n\\"ftor\\": f,,\\n"}, {"path": "pitchmaps/defaultMIDI.pitchmap", "data": "\\"bd\\": c,,,,\\n\\"bd2\\": b,,,\\n\\"o\\": b,,,\\n\\"sn\\": d,,\\n\\"x\\": d,,\\n\\"sn2\\": e,,\\n\\"esn\\": e,, -- electric snare\\n\\"sng\\": d,, --snare ghost notes\\n\\"ss\\": c#,, -- sidestick\\n\\"hc\\": d#,, -- handclap\\n\\"ht\\": f#,, -- hihat closed\\n\\"h\\": f#,, -- hihat closed\\n\\"hf\\": g#,, -- hihat foot\\n\\"h,\\": g#,, -- hihat foot\\n\\"ho\\": bb,, -- hihat open\\n\\"h\'\\": bb,, -- hihat open\\n\\"ho1\\": bb,, -- hihat half open1\\n\\"ho2\\": bb,, -- hihat half open2\\n\\"ho3\\": bb,, -- hihat half open3\\n\\"cy\\": c#, -- crash cymbal\\n\\"spl\\": g, -- splash cymbal\\n\\"hto\\": c, -- high tom \\n\\"m\'\\": c, -- high tom \\n\\"hto1\\": c,\\n\\"hto2\\": d,\\n\\"mto\\": b,, -- middle tom\\n\\"m\\": b,, -- middle tom\\n\\"mto1\\": b,,\\n\\"mto2\\": a,,\\n\\"lto\\": g,, -- low tom\\n\\"m,\\": g,, -- low tom\\n\\"lto1\\": g,,\\n\\"lto2\\": f,,\\n\\"rcym1\\": d#, -- ride cymbal 1\\n\\"rcym2\\": b, -- ride cymbal 2\\n\\"rbell\\": f, -- ride bell\\n\\"mtr\\": ab\' -- muted triangle\\n\\"otr\\": a\' -- open triangle\\n\\"bo1\\": c --bongo 1\\n\\"bo2\\": c# --bongo 2\\n\\"tim1\\": f --timbale 1\\n\\"tim2\\": f# --timbale 2\\n\\"ago1\\": g --agogo 1\\n\\"ago2\\": g# --agogo 2\\n\\"cui1\\": f#\' -- cuica 1\\n\\"cui2\\": g\' -- cuica 2\\n\\"cwb\\": g#, -- cowbell\\n\\"cla\\": d#\' -- claves\\n\\"mcon\\":d -- mute high conga\\n\\"ocon\\":d# -- open conga\\n\\"lcon\\":e -- low conga\\n\\"tmb\\":f#, -- tambourine \\n\\n\\n\\"brsw\\": e,, -- brush swirl\\n\\"brtp\\": d,, -- brush tap\\n\\"brsp\\": d#,, -- brush slap"}, {"path": "pitchmaps/defaultMidiDrumMap.pitchmap", "data": "\\"bd\\": c,,,,\\n\\"sn\\": d,,\\n\\"sng\\": d,, --snare ghost notes\\n\\"ss\\": c#,, -- sidestick\\n\\"hc\\": d#,, -- handclap\\n\\"ht\\": f#,, -- hihat closed\\n\\"hf\\": g#,, -- hihat foot\\n\\"ho\\": bb,, -- hihat open\\n\\"ho1\\": bb,, -- hihat half open1\\n\\"ho2\\": bb,, -- hihat half open2\\n\\"ho2\\": bb,, -- hihat half open3\\n\\"cy\\": c#, -- crash cymal\\n\\"spl\\": g, -- splash cymal\\n\\"hto\\": c, -- high tom \\n\\"hto1\\": c,\\n\\"hto2\\": d,\\n\\"mto\\": b,, -- middle tom\\n\\"mto1\\": b,,\\n\\"mto2\\": a,,\\n\\"lto\\": g,, -- low tom\\n\\"lto1\\": g,,\\n\\"lto2\\": f,,\\n\\"rdbell\\": b,\\n\\"mtr\\": ab\' -- muted triangle\\n\\"otr\\": a\' -- open triangle\\n\\"bo1\\": c --bongo 1\\n\\"bo2\\": c# --bongo 2\\n\\"tim1\\": f --timbale 1\\n\\"tim2\\": f# --timbale 2\\n\\"ago1\\": g --agogo 1\\n\\"ago2\\": g# --agogo 2\\n\\"cui1\\": f#\' -- cuica 1\\n\\"cui2\\": g\' -- cuica 2\\n\\"cwb\\": g#, -- cowbell\\n\\"cla\\": d#\' -- claves\\n\\n\\"cr\\": c#, -- crash cymal\\n\\"t1\\": c, -- high tom \\n\\"t2\\": b,, -- middle tom\\n\\"t3\\": g,, -- low tom\\n\\"t4\\": f,,"}, {"path": "templates/bass.blues.template", "data": "[\\ntype: template;\\nname: bass.blues.normal; \\ninstrument: bass;\\n{\\n /do: swing _grid=8 _offset =60/\\n I,,,8 & I,,& VII,,,& V,,,& |\\n}\\n]"}, {"path": "templates/bass.bossanova.template", "data": "[\\ntype: template;\\nname: bass.bossanova.normal;\\ninstrument: bass; \\n{\\n \\\\fff\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,4 |\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,8 V,,8 |\\n} \\n] \\n"}, {"path": "templates/bass.country.template", "data": "[\\ntype: template;\\nname: bass.country.normal;\\ninstrument: bass; \\n{\\n I,,4. I,,8 V,,,4. V,,,8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: bass.country.ende;\\ninstrument: bass; \\n{\\n I,,1 |\\n} \\n] "}, {"path": "templates/bass.disco.template", "data": "[\\ntype: template;\\nname: bass.disco.normal;\\ninstrument: bass;\\n{\\n \\\\ffff\\n I,,8 I,16 I,16 I,,8 I,16 I,16 I,,8 I,16 I,16 I,,8 I,16 I,16 |\\n} \\n]\\n"}, {"path": "templates/bass.jazzSwing.template", "data": "-- tempo: 155\\n-- signature: 4/4\\n-- parts: normal\\n[\\ntype: template;\\nname: bass.jazzSwing.normal;\\ninstrument: bass; \\n{\\n I,,2 V,, | \\n I,, V,,,4 I,, |\\n}\\n\\n]\\n"}, {"path": "templates/bass.reggae.template", "data": "using \\"lua/mods/swing.lua\\";\\n\\n[\\ntype: template;\\nname: bass.reggae.normal;\\ninstrument: bass;\\n{\\n /do: swing _grid=8 _offset =30/\\n I,,16 r16 I,,8 r2 V,,,4 |\\n I,,16 r16 r8 I,,8 r4. V,,,4 |\\n I,,16 r16 I,,8 r2 V,,,4 |\\n I,,16 r16 I,,8 r2 V,,,4 |\\n}\\n]"}, {"path": "templates/bass.soca.template", "data": "[\\ntype: template;\\nname: bass.soca.normal;\\ninstrument: bass;\\n{\\n r8 r16 I,,32 r32 I,,8 I,,16 r \\n r8 r16 I,,32 r32 r16 I,,32 r V,,, r I,, r |\\n}\\n]"}, {"path": "templates/bossanova.template", "data": "using \\"lua/voicings/voicelead.lua\\";\\nusing \\"lua/voicings/simple.lua\\";\\nusing \\"lua/voicings/guitar.lua\\";\\nusing \\"lua/mods/guitarStroke.lua\\";\\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\" \\"ht\\" !f\\"ht\\" \\"ht\\" \\"ht\\" \\"ht\\" !f\\"ht\\" |\\n} \\n{\\n \\\\fff\\n r4 \\"ss\\"8 r4 \\"ss\\"8 r4 | \\"ss\\"4. \\"ss\\"8 r4 \\"ss\\" |\\n} \\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: guitar; \\n{\\n /do: guitarStroke _value=32/\\n /voicingStrategy: guitar/\\n \\\\f\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 r4 <I II III IV V VI VII>4 |\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>4. |\\n} \\n] \\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: piano; \\n{\\n -- /voicingStrategy: simple _range=tenor/\\n <VII, VII>4 <III, V,>8 <V, V>8 r8 <III, V,>8 r8 <V, V> | r8 <III, V,>8 r8 <V, V> r8 <III, V,> r8 <VII, VII> |\\n} \\n] \\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: bass; \\n{\\n \\\\fff\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,4 |\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,8 V,,8 |\\n} \\n] \\n"}, {"path": "templates/countryschlager1.template", "data": "using \\"lua/voicings/guitar.lua\\";\\nusing \\"lua/voicings/voicelead.lua\\";\\nusing \\"lua/mods/guitarStroke.lua\\";\\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: guitar; \\n{\\n /do: guitarStroke/\\n /voicingStrategy: guitar _range=tenor/\\n \\\\f\\n <I II III IV V VI VII>8 <I II III IV V VI VII>8 r8 \\n <I II III IV V VI VII>4 <I II III IV V VI VII>8 <I II III IV V VI VII>8 <I II III IV V VI VII>8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: slide; \\n{\\n \\\\f\\n /modOnce: bend from 0/\\n r1 |\\n r1 |\\n r1 |\\n <I\' II\' III\' IV\' V\' VI\' VII\'>1 |\\n r1 |\\n r1 |\\n r1 |\\n /modOnce: bend to 100/\\n <I\' II\' III\' IV\' V\' VI\' VII\'>1 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: bass; \\n{\\n I,,4. I,,8 V,,,4. V,,,8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 |\\n} \\n{\\n r4 \\"sn\\" r \\"sn\\" |\\n}\\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"8 !f\\"bd\\"8 r8 \\"bd\\"8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: guitar; \\n{\\n /do: guitarStroke _value=8/\\n <I II III IV V VI VII>1 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: bass; \\n{\\n I,,1 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: drums;\\n{\\n \\"cy\\"1 |\\n} \\n{\\n \\"bd\\"1|\\n} \\n]\\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: slide; \\n{\\n \\\\f\\n /modOnce: bend from 1/\\n <I\' II\' III\' IV\' V\' VI\' VII\'>1 |\\n} \\n] \\n"}, {"path": "templates/drums.bossanova.template", "data": "[\\ntype: template;\\nname: drums.bossanova.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\" \\"ht\\" !f\\"ht\\" \\"ht\\" \\"ht\\" \\"ht\\" !f\\"ht\\" |\\n} \\n{\\n \\\\fff\\n r4 \\"ss\\"8 r4 \\"ss\\"8 r4 | \\"ss\\"4. \\"ss\\"8 r4 \\"ss\\" |\\n} \\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n} \\n]"}, {"path": "templates/drums.country.template", "data": "[\\ntype: template;\\nname: drums.country.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 |\\n} \\n{\\n r4 \\"sn\\" r \\"sn\\" |\\n}\\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"8 !f\\"bd\\"8 r8 \\"bd\\"8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.country.cymbal;\\ninstrument: drums;\\n{\\n \\"cy\\"4 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 |\\n} \\n{\\n r4 \\"sn\\" r \\"sn\\" |\\n}\\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.country.ende;\\ninstrument: drums;\\n{\\n \\"cy\\"1 |\\n} \\n{\\n \\"bd\\"1|\\n} \\n]"}, {"path": "templates/drums.disco.template", "data": "[\\ntype: template;\\nname: drums.disco.normal;\\ninstrument: drums;\\n{\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 |\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 !ffff<\\"sn\\" \\"ht\\">16 !fffff\\"sn\\"16 |\\n \\"cy\\"8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 |\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 <\\"sn\\" \\"ht\\">16 !fffff\\"sn\\"16 |\\n} \\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.disco.solo;\\ninstrument: drums;\\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.disco.solo2;\\ninstrument: drums;\\n{\\n \\"cy\\"8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 |\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 <\\"sn\\" \\"ht\\">16 !fffff\\"sn\\"16 |\\n} \\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n} \\n] "}, {"path": "templates/drums.jazzSwing.template", "data": "-- tempo: 155\\n-- signature: 4/4\\n-- parts: normal, bridge\\n[\\ntype: template;\\nname: drums.jazzSwing.bridge;\\ninstrument: drumsBrushes; \\n{\\n (!ff\\"rcym1\\" r r)4 (\\"rcym1\\" r !p\\"rcym1\\") (!ff\\"rcym1\\" r r) (\\"rcym1\\" r !p\\"rcym1\\")\\n}\\n{\\n (r r \\"brtp\\")4 r4 (r r !p\\"brtp\\")4 r4 |\\n (r r !p\\"brtp\\")4 r4 (r r !p\\"brtp\\")4 r4 |\\n (r r !p\\"brtp\\")4 r4 (r r !p\\"brtp\\")4 r4 |\\n (r r !p\\"brtp\\")4 (r !pp\\"brtp\\"4 r) (r r !p\\"brtp\\")4 r4 |\\n}\\n{\\n \\\\pp\\n \\"bd2\\"4 (r r \\"bd2\\")4 r2 |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.jazzSwing.normal;\\ninstrument: drumsBrushes; \\n{\\n \\\\pp\\n (\\"brtp\\" !pppp\\"brsw\\" r)4 (!ppp\\"brsp\\" r \\"brtp\\") (\\"brtp\\" !pppp\\"brsw\\" r) (!pp\\"brsp\\" r !p\\"brtp\\") \\n}\\n{\\n \\\\p\\n r4 \\"ht\\" r &\\n}\\n{\\n !pp\\"bd2\\"1 |\\n}\\n]"}, {"path": "templates/drums.purdie.template", "data": "[\\ntype: template;\\nname: drums.purdie.normal;\\ninstrument: drums; \\n{\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ho\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t r8t !pp\\"ho\\"8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\f\\"ho\\"8t \\"ht\\"8t \\"bd\\"8t \\\\f\\"ho\\"8t \\"ht\\"8t r8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n}\\n{\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !ppp\\"sn\\"8t !pp\\"sn\\"8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r4t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !ppp\\"sn\\"8t !pp\\"sn\\"8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n}\\n{\\n \\"bd\\"4t r8t r4t \\"bd\\"8t r4t r8t \\"bd\\"4t r8t |\\n}\\n]"}, {"path": "templates/drums.reggae.template", "data": "using \\"lua/mods/swing.lua\\";\\n\\n\\n[\\ntype: template;\\nname: drums.reggae.normal;\\ninstrument: drums; \\n{\\n\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n !f\\"ht\\"4 &8 !p& \\"ht\\"4 &8 !p&|\\n !f\\"ht\\"4 \\"ht\\"8t & & \\"ht\\"4 &8 !p&|\\n !f\\"ht\\"4 !pp\\"ho1\\"4 \\"ht\\"4 &8 !p&|\\n}\\n{\\n r r \\"bd\\"4 r |\\n r r \\"sn\\"4 r |\\n}\\n]\\n\\n--\\n\\n[\\ntype: template;\\nname: drums.reggae.fill1;\\ninstrument: drums; \\n{\\n\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n !f\\"ht\\"4 !p\\"ho2\\"4 r2 |\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n r \\"hto1\\"64->\\"hto1\\"4. \\"mto1\\"8 \\"mto1\\"8t r \\"mto1\\" |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.reggae.fill2;\\ninstrument: drums; \\n{\\n\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n !f\\"ht\\"4 \\"ht\\"4 r2 |\\n}\\n{\\n /do: swing _grid=16 _offset =50/\\n !f\\"tim1\\"32->!p\\"tim2\\"8t & & \\"hto1\\"4 r2 |\\n}\\n]\\n"}, {"path": "templates/drums.soca.template", "data": "[\\ntype: template;\\nname: drums.soca.normal;\\ninstrument: drums;\\n{\\n \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & |\\n}\\n{\\n \\"cwb\\"8 & &16 & r \\"cwb\\" r16 \\"cwb\\" r \\"cwb\\" \\"cwb\\" r & r | \\n}\\n{\\n \\\\p\\n \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 |\\n}\\n{\\n \\\\ffff\\n r8. \\"sn\\"16 r8 \\"sn\\" r8. \\"sn\\"16 r8 \\"sn\\" |\\n}\\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.soca.bridge;\\ninstrument: drums;\\n{\\n \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & |\\n}\\n{\\n \\"cwb\\"8 & &16 & r \\"cwb\\" r16 \\"cwb\\" r \\"cwb\\" \\"cwb\\" r & r | \\n}\\n{\\n \\\\fff\\n \\"mtr\\"16 & \\"otr\\"8 \\"mtr\\"16 & \\"otr\\"8 \\"mtr\\"16 & \\"otr\\"8 \\"mtr\\"16 & \\"otr\\"8 |\\n}\\n{\\n \\\\p\\n !ff\\"spl\\"16 \\"ht\\" \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 |\\n \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 |\\n}\\n{\\n \\\\f\\n r4 r16 \\"bo1\\" \\"bo2\\" & r4 r16 \\"bo1\\" \\"bo2\\" & |\\n}\\n{\\n \\\\pp\\n r4 r16 \\"cla\\" r8 \\"cla\\" r16 \\"cla\\"16 r4 |\\n}\\n{\\n \\\\fffff\\n r8. \\"sn\\"16 r8 \\"sn\\" r8. \\"sn\\"16 r8 \\"sn\\" |\\n r8. \\"sn\\"16 r8 \\"sn\\" r4 r16 !fff\\"sn\\" !ffff& !fffff& |\\n}\\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n}\\n]"}, {"path": "templates/ennio.template", "data": "[\\ntype: template;\\nname: ennio.normal;\\ninstrument: piano; \\n{\\n !ffffI,,4 <II, III, IV, V, VI, VII,> <II, III, IV, V, VI, VII,> !fffV,,, |\\n}\\n] \\n\\n"}, {"path": "templates/guitar.bossanova.template", "data": "[\\ntype: template;\\nname: guitar.bossanova.normal;\\ninstrument: guitar; \\n{\\n /voicingStrategy: simpleGuitar/\\n \\\\f\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 r4 <I II III IV V VI VII>4 |\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>4. |\\n} \\n] "}, {"path": "templates/guitar.country.template", "data": "using \\"lua/voicings/guitar.lua\\";\\n\\n[\\ntype: template;\\nname: guitar.country.normal;\\ninstrument: guitar; \\n{\\n /voicingStrategy: guitar _range=mezzosoprano/\\n \\\\f\\n <I II III IV V VI VII>8 <I II III IV V VI VII>8 r8 \\n <I II III IV V VI VII>4 <I II III IV V VI VII>8 <I II III IV V VI VII>8 <I II III IV V VI VII>8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: guitar.country.ende;\\ninstrument: guitar; \\n{\\n <I II III IV V VI VII>1 |\\n} \\n] \\n"}, {"path": "templates/rhythm.bossanova.template", "data": "[\\ntype: template;\\nname: rhythm.bossanova.normal;\\ninstrument: rhythm; \\n{\\n \\\\f\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 r4 <I II III IV V VI VII>4 |\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>4. |\\n} \\n] "}, {"path": "templates/rhythm.country.template", "data": "using \\"lua/voicings/guitar.lua\\";\\n\\n[\\ntype: template;\\nname: rhythm.country.normal;\\ninstrument: rhythm; \\n{\\n \\\\f\\n <I II III IV V VI VII>8 <I II III IV V VI VII>8 r8 \\n <I II III IV V VI VII>4 <I II III IV V VI VII>8 <I II III IV V VI VII>8 <I II III IV V VI VII>8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: rhythm.country.ende;\\ninstrument: rhythm; \\n{\\n /doOnce: arpeggio/\\n <I II III IV V VI VII>4~ <I II III IV V VI VII>2. |\\n} \\n] \\n"}, {"path": "templates/rhythm.jazzSwing.template", "data": "-- tempo: 155\\n-- signature: 4/4\\n-- parts: normal\\n[\\ntype: template;\\nname: rhythm.jazzSwing.normal;\\ninstrument: rhythm2; \\n{\\n \\\\f\\n <I,, V, VII, I III>1~ | &4 (r r &) r2 |\\n\\n (<V, VII, I III> r r)4 r <V, VII, I III>4 r |\\n \\n (<V, VII, I III> r I,,)4 r <V, VII, I III>4 r |\\n\\n <I,, V, VII, I III>1~ | &4 (r r &) r2 |\\n\\n (<V, VII, I III> r r)4 r <V, VII, I III>4 r |\\n\\n <V, VII, I III> r I,,4 (I,, r <V, VII, I III>~) (<V, VII, I III> r I,,) |\\n}\\n]\\n"}, {"path": "templates/rhythm.reggae.template", "data": "using \\"lua/mods/swing.lua\\";\\nusing \\"lua/mods/staccato.lua\\";\\n\\n[\\ntype: template;\\nname: rhythm.reggae.normal;\\ninstrument: rhythm;\\n{\\n \\\\f\\n /do: swing _grid=8 _offset =40/\\n r4 /modOnce: staccato _amount=100/ <I II III IV V VI VII>8 /modOnce: staccato _amount=40/ <I II III IV V VI VII>8 \\n r4 /modOnce: staccato _amount=100/ <I II III IV V VI VII>8 /modOnce: staccato _amount=40/ <I II III IV V VI VII>8 \\n |\\n\\n}\\n]"}]'),d=require("lodash"),p=function(){function n(e){a(this,n),this.module=e,this.blacklist=["/dev","/home","/proc","/tmp"]}return o(n,[{key:"resolve",value:function(n,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.replace("./",n));case 1:case"end":return t.stop()}},t)}))}},{key:"ls",value:function(n){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,a,r,o,i,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.module.FS,a=t.analyzePath(n,!1),a.exists&&a.object&&a.object.isFolder){e.next=5;break}return e.abrupt("return",[]);case 5:r=[],o=a.object.contents,e.t0=regeneratorRuntime.keys(o);case 8:if((e.t1=e.t0()).done){e.next=18;break}if(i=e.t1.value,s=o[i],!this.blacklist.includes("".concat(a.parentPath).concat(i))){e.next=13;break}return e.abrupt("continue",8);case 13:if("_"!==i[0]&&"."!==i[0]){e.next=15;break}return e.abrupt("continue",8);case 15:r.push({name:i,isDirectory:s.isFolder}),e.next=8;break;case 18:return e.abrupt("return",r);case 19:case"end":return e.stop()}},e,this)}))}},{key:"getParentPath",value:function(n){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.module.FS,a=t.analyzePath(n,!1),e.abrupt("return",a.parentPath);case 3:case"end":return e.stop()}},e,this)}))}}]),n}(),u=function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";a(this,n),this.errorMessage=e};exports.CompilerError=u;var I=function(){function e(){var n=this;a(this,e),this.cwdFiles=[],this.module=s().then(function(e){return i(n,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.init(e);case 2:return n.abrupt("return",e);case 3:case"end":return n.stop()}},n,this)}))})}return o(e,[{key:"init",value:function(n){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.prepareModule(n),e.next=3,this.prepareFileSystem(n);case 3:case"end":return e.stop()}},e,this)}))}},{key:"getFileSystemInspector",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=p,n.next=3,this.module;case 3:return n.t1=n.sent,n.abrupt("return",new n.t0(n.t1));case 5:case"end":return n.stop()}},n,this)}))}},{key:"prepareModule",value:function(n){this.createCompileResult=n.cwrap("create_compile_result","number",["string","number"])}},{key:"mkdir_p",value:function(n,e){for(var t=n.split("/"),a=[],r=0;r<t.length&&r!==t.length-1;++r){var o=t[r];a.push(o);var i=a.join("/");e.FS.analyzePath(i,!1).exists||e.FS.mkdir(i)}}},{key:"prepareFileSystem",value:function(e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){var a,r,o,i,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=d.cloneDeep(c),r=e.FS,o=n(a);try{for(o.s();!(i=o.n()).done;){s=i.value;try{this.mkdir_p(s.path,e),r.writeFile(s.path,s.data)}catch(l){console.error(l)}}}catch(p){o.e(p)}finally{o.f()}case 4:case"end":return t.stop()}},t,this)}))}},{key:"writeFileToFS",value:function(n,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.module;case 2:t.sent.FS.writeFile(n,e),this.cwdFiles.push(n);case 5:case"end":return t.stop()}},t,this)}))}},{key:"cleanCWD",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,a,r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.module;case 2:t=e.sent.FS,a=n(this.cwdFiles);try{for(a.s();!(r=a.n()).done;)o=r.value,t.analyzePath(o,!1).exists&&t.unlink(o)}catch(i){a.e(i)}finally{a.f()}this.cwdFiles.splice(0,this.cwdFiles.length);case 6:case"end":return e.stop()}},e,this)}))}},{key:"compile",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(this,void 0,void 0,regeneratorRuntime.mark(function a(){var r,o,i,s,l,c,d,p;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.cleanCWD();case 2:if(e&&0!==e.length){a.next=4;break}throw new u("no content to compile");case 4:return a.next=6,this.module;case 6:r=a.sent,o=0,i=null,s=n(e),a.prev=10,s.s();case 12:if((l=s.n()).done){a.next=21;break}if((c=l.value).path&&c.path.trim()){a.next=16;break}throw new u("sheet file has no path");case 16:return a.next=18,this.writeFileToFS(c.path,c.data);case 18:c.path.trim().endsWith(".sheet")&&(i=c);case 19:a.next=12;break;case 21:a.next=26;break;case 23:a.prev=23,a.t0=a.catch(10),s.e(a.t0);case 26:return a.prev=26,s.f(),a.finish(26);case 29:if(i){a.next=31;break}throw new u("missing main sheet file (.sheet)");case 31:if(o=this.createCompileResult(i.path,t),d=r.UTF8ToString(o),r._free(o),!(p=JSON.parse(d)).errorMessage){a.next=37;break}throw{error:p};case 37:return a.abrupt("return",p);case 38:case"end":return a.stop()}},a,this,[[10,23,26,29]])}))}}]),e}();exports.WerckmeisterCompiler=I;
|
|
491
491
|
},{"@werckmeister/compilerjs/werckmeister":"ouOZ","fs":"rDCW","lodash":"B1iE"}],"X3ym":[function(require,module,exports) {
|