UNPKG

vultlib

Version:

A node.js module providing all the functionality of the Vult compiler.

745 lines 534 kB
// Generated by js_of_ocaml 4.1.0 (function(b){typeof globalThis!=="object"&&(this?c():(b.defineProperty(b.prototype,"_T_",{configurable:true,get:c}),_T_));function c(){var c=this||self;c.globalThis=c;delete b.prototype._T_}}(Object));(function(ap){"use strict";var aKJ=typeof module==="object"&&module.exports||ap,t8="i",wq="function_",xx=" if(this.",ky="static_inline ",kx="switch_",ve="fix_sin",dZ="EXPORT void ",t7="CodeC.printStmt: invalid tuple assign",vc="_default(data);",vd="unknow variable: ",fe='#include "vultin.h"',t6=4096,n5="[]",gg="0.0",wp="Expecting a %s but the file ended",wo="fix_tanh",wn="MakeMac.exp",oo=" */",cC=0xff,xw="){};",fk="tables.h",on='.h\\"", Library = "',aG="@[<2>[",xv=32767.,nM="#else",vb="bool_init_array",wm="int_copy_array",xu="_process_init(data);",eD=128,j7="log10",E="int",t5="fd ",oQ=" return a;",t4="fix_eps",hZ=">",C="float",xt=1027,t3="int_to_fix",om="MakeTables.stmt_x",t2="int_to_float",cD="%B",nL="new ",kw="case ",ia="_noteOn(",xs=" if(x > maxv)",j6=">>",wl="printStmt: invalid constant assign",ik="table",wk="_process",oP="e",t1="_tilde;",xr="_tilde), // size of the object",wj="float_to_fix",t0="fix_init_array",xq="->data[i]);",kf=") end",ez="wrap_array",ol=": Not a directory",dv="'a",va="_noteOn(this.context,note,velocity,channel); };",gp=" ",xp="_process_init(); else this.context = {};",wi="Out_of_memory",oO=" ",u$="do",gj=" {",wh=": closedir failed",ok="index out of bounds",wg="Could not open the file ",kn="_bigarr02",I="))",nK='/Resources/Library");',hY="] = ",wf=-1.,z="}",xo="_tilde_delete, // destructor function",oN="type",oj="Object obj;",du=0xffff,u_="int_init_array",eC=" }",j5="wavetable",we=" if i > 6 or i < 1 then",u9="_raw_c2",wd="External.",a1="@])",xn="infinity",j4="switch",ke="private",wc="float in",xm="fix_get",nJ="_tilde *x = (t_",cF="tuple",u8="fix_mul",hS="eps",oi=" // Microsoft VC++",oM=112,km="switch(",tZ="%x",go="c1",j3=252,aK=".",tY="_tilde_class;",n4="performance",wb=" a[i] = val;",gn=" *data = (",u7=" data;",wa=0xf0,kv="0.0f",xl="' is not defined",tX="_default",gf="#include <math.h>",ev=" }",oL=" else ",u6="_noteOff",h$="max",nI="Invalid expression",j2="_process_ret_",tW="_default = null;",n3=-32,xk=" = block",c9="index",ku="boolean",kd=").",u5="The type of this expression is unknown.",xi="printStmt: invalid constant declaration",xj="_tilde {",xh="msu",tV="closedir",xg="../",tU=-32768.,oh=" ret = ",xf="Assert_failure",tT="_process_init) this.context = this.",tS="Vult",er="&&",h_="cos",tR=-21,u3="fix_floor",u4="_tilde_delete(t_",xe="printLhsExp: All other cases should be already covered",oK="size",u2=" processor.",n2=" #define EXPORT __declspec(dllexport)",u1=8388608.,v_="Expecting a list of value declarations '{ val x:... }' or a type alias ': type' but got %s",v$="This value '",fd="(@[",bS='"',fi="get",fj=",",og="#if defined(_MSC_VER)",h9="<",xd="Fatal error: exception %s\n",tP="_process(this.context,input); else return 0; };",G="(",tQ=0x800,uY=".vult",uZ="_noteOff(this.context,note,velocity,channel); };",u0=" 2>",oJ=">=",oe=' #define EXPORT __attribute__((visibility("default")))',of="file",n1="return",cV="#define ",uX="Expecting a string with a link name or a tag",c_=256,v9="real: invalid arguments",fh="samplerate",tO="The operator cannot be used with multiple arguments",od='", IncludeDirectory = "modelica://',nH="integer",hR="local ",v8="The type of variable '",uW=' #include "',h8="__process(",ft="cpp",n0=" ",v7="_process_init();",v6="(x->data)",oI="ENOENT",nG="This attribute can only be applied to functions returning 'real'",tN="([^/]+)",oc=0xf,xc=" if not(i > 6 or i < 1) then",uV="@[<2>{ ",v5=125,xb="ENOTEMPTY",xa="fix_tan",ij="];",tM="Division_by_zero",uU="eval",gi="if",hQ="ret",uS="the curve fitting returned more than three points",uT=" while (n--) {",w$="fix_set",bh="_TABLES_H",tL=": ",w_="_process(data, 0.0);",tK="_noteOn",cE='#include "',j1="Expecting a ",oH="(float) ",J="@,))@]",eB="%d",v4="@ }@]",v3="GetIdentifiers.exp",dt="'",aX="[",uR="buffer.ml",w9="Cygwin",w8="float_to_int",tJ=" (method)",tI="for_",tH="static t_class *",uQ="if ",d2="lua",v2="/dev/null",W=";@ ",dY="set",kl="min",w7="break_",hP="in_",tG=" >",eu=".field_",aA="real",kc='Invalid statement. All statements should be in the forms: "a = b; " or "_ = b(); " ',j0=254,tF=" }",fs=100,kb="_tilde_class, (t_method)",ob=" : flags Open_text and Open_binary are not compatible",a0="*",fr="else",oG="val ",jZ="default_",v1=-15,uP="generateC",tE="Redefinition of variable '%s'. Previously defined at %s",oa="fix_random",w6="do_",hO="random",n$=" ",kt="Unix.Unix_error",tD="init",oF='} // extern "C"',nF="java",nZ="out",tC=" this.",uO="Stack_overflow",tB=" ",v0="fix_to_float",l="@ ",uM="fix_pi",uN="/static/",jY=-97,ge="#include <stdint.h>",vZ="return_",gm="c0",oE="};",w5="Not_found",vY="Math.abs",fq="clip",gb='extern "C" {',tA="#ifdef __cplusplus",cW="#endif // ",w4="./",tz=" vultProcess.",uL=" end",vX="fix_samplerate",w3="%h",ty="_raw_c0",nY="(int)",nX="rmdir",dy="js",vW="f",tx="uncovered case",uK="fix_clip",fm=4298433,uJ=1026,nE="default: ",hX="this.",nW="?",cU="false",vU=" /* ",vV="_controlChange(this.context,note,velocity,channel); };",tw="fix_sqrt",gh="string",w2="getInputVar: the variable does not have a type",nV="sinh",cT=0x80,oD="Fatal error: exception ",cB=":",w1="order",tu="' cannot be represented with fixed-point numbers",tv="_controlChange) this.",uI="function ",hW="tan",vT="fix_abs",vS="version",aL="_",nU="compare: functional value",vR="Expecting a %s but got %s",fc="'size",jX="_tilde_class, (method)",hN="<<",w0="CodeC.printTypeAndName: invalid input",ds="true",nT="wave",uH="Invalid_argument",jW="Map.bal",h7="any",nD="@[",vQ="_default) return this.",fp='.tables.h"',ks="_tilde_class);",uG="_noteOff(t_",vP="_default(this.context); };",ts="fix_div",tt="Unknown symbol '",uF="%ni",fg="abs",bN="<>",oC="&",tr="*(out_",nS="vcv-prototype",et="h",tq=-316113959,vO="CodeJs.printStmt: invalid tuple assign",uE="fix_exp",co="_ctx",bk="]",oB="%F",vN="This expression has type '",n_="cosh",ax="; ",bK="_H",vM="_output_",oA="~=",nC="field_",a5="0",uD="fix_max",vL=" <",vK="Sys_blocked_io",wZ=" then",aS=248,b1="/* Code automatically generated by Vult https://github.com/modlfo/vult */",aF="@,]@]",oz="_process_type",wY="The symbol '%s' is not defined",kk="arduino",d1="_noteOff(",vJ=" but got ",bR=246,uC="_process_type data;",tp="%u",uB="break",wX="get: invalid arguments",to="Not a supported wav file",jV=") return ",am="%S",uA="_unused_",ga=127,ff=1024,h6="var ",tn="@{",nB=" : flags Open_rdonly and Open_wronly are not compatible",nR="frandom",a7="-",hV="){",aZ="fix16",nA=" : file already exists",dX=0xffffff,tm="_value;",hM="#endif",oy=-783600662,tl="unknown error",jU="public",gd="_process(",wW=2147483647,kr="in",uz=", characters ",tk=" this.",tj=12520,uy="none",ti="_tilde_dsp(t_",vI="_init",th=" if(this.",n9="Simplify.exp",ii="double",ux="fix_wrap_array",vH="][i] / 10.0)",vG="Scope.getContext",vF="typedef struct _",vE="_default(this.context);",aY="bool",ey=1000,cA="default",bj="{",uw="type ",o="",wV="fix_to_int",h5="^",wU="fix_min",eq=0x3f,uu="_controlChange",uv="processor.context",ka="if(",vD="package ",tg="*(out_0++) = ",wT="printStmt: invalid variable declaration",te="Unknown symbol '%s'",tf="Match_failure",vC="The script requires the functions:\nfun process() { } \nand update() { }",wR=" but the file ended",wS="_process) return this.",ih="); ",td=" -> ",ut="float_copy_array",vB="++) = ",tc=" : is a directory",vA=" else",vz=16384,ox="c2",a6="+",us="*data",kj=" : ",gl="{ ",p="@,",vy="(block.inputs[",cS="!=",vx="%li",wQ="Redefinition of variable '",dW="uint8_t",bT="array",ur=" = function(",uq=" if((int)velocity) ",j$=65536,hL="tanh",gc="void",tb="]); ",w=")",wP="CodeJava.printStmt: invalid tuple assign",ex='.h"',vw=" return x;",wO="float_init_array",nz=" // GCC",nQ="nan",bq="@[%s =@ ",jT="The type of this expression could not be inferred. Add a type annotation.",ta=0xe0,up="_raw_c1",ig="pi",cp="void ",wN=0xdfff,hK="%",bM="/",f$="return ",s_="void *",s$="could not evaluate if statement",ow="ENOTDIR",ov=1073741823,s9="The symbol '",cR=250,ae=";",j_="function",n8=1255,es=255,n7="jsError",dw=0x8000,vv=" float dummy;",wM="fix_cos",uo="ProgToCode.convertLhsExp: everything should have types",bp="(Some ",ie="|",un="End_of_file",nO="..",nP="Failure",um="bool_copy_array",ny="pow",vu="_process_init()",wL="makeArray(",ul=0xdc00,vt=-48,wK="fix_to_short(",nx="and",nw="EBADF",ki="while",bo="camlinternalFormat.ml",ou="(bool) ",fo="fixed",hU="_controlChange(",wJ="Sys_error",wI=32768.,wH="src/core/CCString.pp.ml",s8="EEXIST",uk="out_",wG="Printexc.handle_uncaught_exception",wF="the type is not defined",av=" = ",s7="EXPORT ",hT=" }",bn="None",j9="int_of_string",dx="makeArray",L="fix16_t",uj=" 2>&1",ot="Invalid left hand side of assignment",jS="invalid env",nv=120,wE=103,s6="Expecting a list of value declarations '{ val x:... }' or a type alias ': type' but got ",h4=512,wD=" else return x;",cq="unit",s5=0x7ff0,ui="or",h3=" *)object;",vs=" else if(x < minv)",s4="_noteOff) this.",wA="getCopyArrayFunction: Invalid array type ",wB=" return minv;",wC="EXPORT void *",nN="(int) ",wz="This value '%f' cannot be represented with fixed-point numbers",s3="generateJs",nu="0x",uh="fix_copy_array",bi="@]",fb="\n",vr="_process_init = null;",ug=" return a[i];",uf="} t_",vq="); if(!block",cc="end",ue=": file descriptor already closed",os='/Resources/Include", LibraryDirectory = "modelica://',gk="not",wy="%Li",fn=3851765,kq="makeComplexArray",nt="obj",vp="input",vo="invalid arguments",id="sin",aa=" ",h2="log",wx="_controlChange(t_",ic="exp",h1=") {",eA="||",j8="x->data",ud="lexing: empty token",s2="for",vn="live.vult",s1=' #include "vultin.h"',ns="mkdir",az=");",uc="main",kh=": No such file or directory",ww="Cannot outdent more",ub="printLhsExpTuple: All other cases should be already covered\n",bm=" =",d0=" class_addmethod(",k="<2>",n6="_samples",ib="floor",t=",@ ",s0="_noteOn(t_",bL="%a",bA=", ",or="<=",sZ="win32",vm="_noteOff(data, note, channel);",vl="CodeLua.printStmt: invalid tuple assign",ua="bound_check",vk="identifier",vj="|0)",jR="'. Previously defined at ",nr="audio_block_t * block",vi="void *object",wv="CodeC.convertStmt: invalid alias type",sY="while(",t$="irandom",vh="_tilde *x){",sX="generateLua",fl="mac",sW="Pervasives.do_at_exit",wu="_default) this.",B=" ",sV="_tilde_new, // constructor function",wt="Undefined_recursive_module",sU=" return (void *)x;",ws="output",kp=" end",fa="==",ew="abstract",wr=" return maxv;",oq=" t_",ko="Set.bal",cQ="#ifndef ",vg="cannot update array",t_="()",t9="%i",h0="sqrt",kg="break;",nq=" Arrays.fill(a, init);",op=") return;",vf="{}";function aJD(e,c,f,d,a){if(d<=c)for(var b=1;b<=a;b++)f[d+b]=e[c+b];else for(var b=a;b>=1;b--)f[d+b]=e[c+b];return 0}function aKs(c,b){throw[0,c,b]}function gw(c,b){if(c==0)return o;if(b.repeat)return b.repeat(c);var e=o,d=0;for(;;){if(c&1)e+=b;c>>=1;if(c==0)return e;b+=b;d++;if(d==9)b.slice(0,1)}}function iu(d,c,b){var e=String.fromCharCode;if(c==0&&b<=t6&&b==d.length)return e.apply(null,d);var f=o;for(;0<b;c+=ff,b-=ff)f+=e.apply(null,d.slice(c,c+Math.min(b,ff)));return f}function fw(b){if(b.t==2)b.c+=gw(b.l-b.c.length,"\0");else b.c=iu(b.c,0,b.c.length);b.t=0}function x6(b){if(b.length<24){for(var c=0;c<b.length;c++)if(b.charCodeAt(c)>ga)return false;return true}else return!/[^\x00-\x7f]/.test(b)}function aKH(f){for(var j=o,d=o,g,a,h,b,c=0,i=f.length;c<i;c++){a=f.charCodeAt(c);if(a<cT){for(var e=c+1;e<i&&(a=f.charCodeAt(e))<cT;e++);if(e-c>h4){d.substr(0,1);j+=d;d=o;j+=f.slice(c,e)}else d+=f.slice(c,e);if(e==i)break;c=e}b=1;if(++c<i&&((h=f.charCodeAt(c))&-64)==eD){g=h+(a<<6);if(a<ta){b=g-0x3080;if(b<cT)b=1}else{b=2;if(++c<i&&((h=f.charCodeAt(c))&-64)==eD){g=h+(g<<6);if(a<wa){b=g-0xe2080;if(b<tQ||b>=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c<i&&((h=f.charCodeAt(c))&-64)==eD&&a<0xf5){b=h-0x3c82080+(g<<6);if(b<0x10000||b>0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>du)d+=String.fromCharCode(0xd7c0+(b>>10),ul+(b&0x3FF));else d+=String.fromCharCode(b);if(d.length>ff){d.substr(0,1);j+=d;d=o}}return j+d}function dz(d,b,c){this.t=d;this.c=b;this.l=c}dz.prototype.toString=function(){switch(this.t){case 9:return this.c;default:fw(this);case 0:if(x6(this.c)){this.t=9;return this.c}this.t=8;case 8:return this.c}};dz.prototype.toUtf16=function(){var b=this.toString();if(this.t==9)return b;return aKH(b)};dz.prototype.slice=function(){var b=this.t==4?this.c.slice():this.c;return new dz(this.t,b,this.l)};function xH(b){return new dz(0,b,b.length)}function b(b){return xH(b)}function o$(d,c){aKs(d,b(c))}var cG=[0];function bs(b){o$(cG.Invalid_argument,b)}function gr(){bs(ok)}function aJE(c,b,d){if(b<0||b>=c.length-1)gr();c[b+1]=d;return 0}function aJF(f,a,e){var b=new Array(e+1);b[0]=0;for(var c=1,d=a+1;c<=e;c++,d++)b[c]=f[d];return b}function kB(c){var d=new Uint8Array(c.l),f=c.c,e=f.length,b=0;for(;b<e;b++)d[b]=f.charCodeAt(b);for(e=c.l;b<e;b++)d[b]=0;c.c=d;c.t=4;return d}function d3(e,f,c,a,d){if(d==0)return 0;if(a==0&&(d>=c.l||c.t==2&&d>=c.c.length)){c.c=e.t==4?iu(e.c,f,d):f==0&&e.c.length==d?e.c:e.c.substr(f,d);c.t=c.c.length==c.l?0:2}else if(c.t==2&&a==c.c.length){c.c+=e.t==4?iu(e.c,f,d):f==0&&e.c.length==d?e.c:e.c.substr(f,d);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)kB(c);var g=e.c,h=c.c;if(e.t==4)if(a<=f)for(var b=0;b<d;b++)h[a+b]=g[f+b];else for(var b=d-1;b>=0;b--)h[a+b]=g[f+b];else{var i=Math.min(d,g.length-f);for(var b=0;b<i;b++)h[a+b]=g.charCodeAt(f+b);for(;b<d;b++)h[a+b]=0}}return 0}function b3(b){return b}function dA(b,c,d,e,f){d3(b3(b),c,d,e,f);return 0}function xF(){bs(ok)}function fv(b,c){switch(b.t&6){default:if(c>=b.c.length)return 0;case 0:return b.c.charCodeAt(c);case 4:return b.c[c]}}function aJJ(c,b){if(b>>>0>=c.l)xF();return fv(c,b)}function aT(b,d,c){c&=cC;if(b.t!=4){if(d==b.c.length){b.c+=String.fromCharCode(c);if(d+1==b.l)b.t=0;return 0}kB(b)}b.c[d]=c;return 0}function b4(c,b,d){if(b>>>0>=c.l)xF();return aT(c,b,d)}function cX(c,b){if(c.fun)return cX(c.fun,b);if(typeof c!=="function")return c;var d=c.length|0;if(d===0)return c.apply(null,b);var f=b.length|0,e=d-f|0;if(e==0)return c.apply(null,b);else if(e<0)return cX(c.apply(null,b.slice(0,d)),b.slice(d));else return function(){var f=arguments.length==0?1:arguments.length,e=new Array(b.length+f);for(var d=0;d<b.length;d++)e[d]=b[d];for(var d=0;d<arguments.length;d++)e[b.length+d]=arguments[d];return cX(c,e)}}function H(b,c){if(c>>>0>=b.length-1)gr();return b}function kA(b){if(isFinite(b)){if(Math.abs(b)>=2.2250738585072014e-308)return 0;if(b!=0)return 1;return 2}return isNaN(b)?4:3}function da(b){b.t&6&&fw(b);return b.c}var aKL=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function aKK(b){if(aKL)return Math.floor(Math.log2(b));var c=0;if(b==0)return-Infinity;if(b>=1)while(b>=2){b/=2;c++}else while(b<1){b*=2;c--}return c}function o1(d){var b=new Float32Array(1);b[0]=d;var c=new Int32Array(b.buffer);return c[0]|0}var xO=Math.pow(2,-24);function o_(b){throw b}function kL(){o_(cG.Division_by_zero)}function X(c,d,b){this.lo=c&dX;this.mi=d&dX;this.hi=b&du}X.prototype.caml_custom="_j";X.prototype.copy=function(){return new X(this.lo,this.mi,this.hi)};X.prototype.ucompare=function(b){if(this.hi>b.hi)return 1;if(this.hi<b.hi)return-1;if(this.mi>b.mi)return 1;if(this.mi<b.mi)return-1;if(this.lo>b.lo)return 1;if(this.lo<b.lo)return-1;return 0};X.prototype.compare=function(b){var c=this.hi<<16,d=b.hi<<16;if(c>d)return 1;if(c<d)return-1;if(this.mi>b.mi)return 1;if(this.mi<b.mi)return-1;if(this.lo>b.lo)return 1;if(this.lo<b.lo)return-1;return 0};X.prototype.neg=function(){var b=-this.lo,c=-this.mi+(b>>24),d=-this.hi+(c>>24);return new X(b,c,d)};X.prototype.add=function(b){var c=this.lo+b.lo,d=this.mi+b.mi+(c>>24),e=this.hi+b.hi+(d>>24);return new X(c,d,e)};X.prototype.sub=function(b){var c=this.lo-b.lo,d=this.mi-b.mi+(c>>24),e=this.hi-b.hi+(d>>24);return new X(c,d,e)};X.prototype.mul=function(b){var c=this.lo*b.lo,d=(c*xO|0)+this.mi*b.lo+this.lo*b.mi,e=(d*xO|0)+this.hi*b.lo+this.mi*b.mi+this.lo*b.hi;return new X(c,d,e)};X.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};X.prototype.isNeg=function(){return this.hi<<16<0};X.prototype.and=function(b){return new X(this.lo&b.lo,this.mi&b.mi,this.hi&b.hi)};X.prototype.or=function(b){return new X(this.lo|b.lo,this.mi|b.mi,this.hi|b.hi)};X.prototype.xor=function(b){return new X(this.lo^b.lo,this.mi^b.mi,this.hi^b.hi)};X.prototype.shift_left=function(b){b=b&63;if(b==0)return this;if(b<24)return new X(this.lo<<b,this.mi<<b|this.lo>>24-b,this.hi<<b|this.mi>>24-b);if(b<48)return new X(0,this.lo<<b-24,this.mi<<b-24|this.lo>>48-b);return new X(0,0,this.lo<<b-48)};X.prototype.shift_right_unsigned=function(b){b=b&63;if(b==0)return this;if(b<24)return new X(this.lo>>b|this.mi<<24-b,this.mi>>b|this.hi<<24-b,this.hi>>b);if(b<48)return new X(this.mi>>b-24|this.hi<<48-b,this.hi>>b-24,0);return new X(this.hi>>b-48,0,0)};X.prototype.shift_right=function(b){b=b&63;if(b==0)return this;var d=this.hi<<16>>16;if(b<24)return new X(this.lo>>b|this.mi<<24-b,this.mi>>b|d<<24-b,this.hi<<16>>b>>>16);var c=this.hi<<16>>31;if(b<48)return new X(this.mi>>b-24|this.hi<<48-b,this.hi<<16>>b-24>>16,c&du);return new X(this.hi<<16>>b-32,c,c)};X.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&dX;this.lo=this.lo<<1&dX};X.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&dX;this.mi=(this.mi>>>1|this.hi<<23)&dX;this.hi=this.hi>>>1};X.prototype.udivmod=function(f){var d=0,c=this.copy(),b=f.copy(),e=new X(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};X.prototype.div=function(b){var c=this;if(b.isZero())kL();var e=c.hi^b.hi;if(c.hi&dw)c=c.neg();if(b.hi&dw)b=b.neg();var d=c.udivmod(b).quotient;if(e&dw)d=d.neg();return d};X.prototype.mod=function(c){var b=this;if(c.isZero())kL();var e=b.hi;if(b.hi&dw)b=b.neg();if(c.hi&dw)c=c.neg();var d=b.udivmod(c).modulus;if(e&dw)d=d.neg();return d};X.prototype.toInt=function(){return this.lo|this.mi<<24};X.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};X.prototype.toArray=function(){return[this.hi>>8,this.hi&cC,this.mi>>16,this.mi>>8&cC,this.mi&cC,this.lo>>16,this.lo>>8&cC,this.lo&cC]};X.prototype.lo32=function(){return this.lo|(this.mi&cC)<<24};X.prototype.hi32=function(){return this.mi>>>8&du|this.hi<<16};function kG(c,d,b){return new X(c,d,b)}function kF(b){if(!isFinite(b)){if(isNaN(b))return kG(1,0,s5);return b>0?kG(0,0,s5):kG(0,0,0xfff0)}var a=b==0&&1/b==-Infinity?dw:b>=0?0:dw;if(a)b=-b;var c=aKK(b)+1023;if(c<=0){c=0;b/=Math.pow(2,-uJ)}else{b/=Math.pow(2,c-xt);if(b<16){b*=2;c-=1}if(c==0)b/=2}var e=Math.pow(2,24),d=b|0;b=(b-d)*e;var f=b|0;b=(b-f)*e;var g=b|0;d=d&oc|a|c<<4;return kG(g,f,d)}function ip(b){return b.toArray()}function xE(d,c,g){d.write(32,c.dims.length);d.write(32,c.kind|c.layout<<8);if(c.caml_custom==kn)for(var b=0;b<c.dims.length;b++)if(c.dims[b]<du)d.write(16,c.dims[b]);else{d.write(16,du);d.write(32,0);d.write(32,c.dims[b])}else for(var b=0;b<c.dims.length;b++)d.write(32,c.dims[b]);switch(c.kind){case 2:case 3:case 12:for(var b=0;b<c.data.length;b++)d.write(8,c.data[b]);break;case 4:case 5:for(var b=0;b<c.data.length;b++)d.write(16,c.data[b]);break;case 6:for(var b=0;b<c.data.length;b++)d.write(32,c.data[b]);break;case 8:case 9:d.write(8,0);for(var b=0;b<c.data.length;b++)d.write(32,c.data[b]);break;case 7:for(var b=0;b<c.data.length/2;b++){var f=ip(c.get(b));for(var e=0;e<8;e++)d.write(8,f[e])}break;case 1:for(var b=0;b<c.data.length;b++){var f=ip(kF(c.get(b)));for(var e=0;e<8;e++)d.write(8,f[e])}break;case 0:for(var b=0;b<c.data.length;b++){var f=o1(c.get(b));d.write(32,f)}break;case 10:for(var b=0;b<c.data.length/2;b++){var e=c.get(b);d.write(32,o1(e[1]));d.write(32,o1(e[2]))}break;case 11:for(var b=0;b<c.data.length/2;b++){var a=c.get(b),f=ip(kF(a[1]));for(var e=0;e<8;e++)d.write(8,f[e]);var f=ip(kF(a[2]));for(var e=0;e<8;e++)d.write(8,f[e])}break}g[0]=(4+c.dims.length)*4;g[1]=(4+c.dims.length)*8}function xC(b){switch(b){case 7:case 10:case 11:return 2;default:return 1}}function aJG(c,e){var b;switch(c){case 0:b=Float32Array;break;case 1:b=Float64Array;break;case 2:b=Int8Array;break;case 3:b=Uint8Array;break;case 4:b=Int16Array;break;case 5:b=Uint16Array;break;case 6:b=Int32Array;break;case 7:b=Int32Array;break;case 8:b=Int32Array;break;case 9:b=Int32Array;break;case 10:b=Float32Array;break;case 11:b=Float64Array;break;case 12:b=Uint8Array;break}if(!b)bs("Bigarray.create: unsupported kind");var d=new b(e*xC(c));return d}function o2(d){var b=new Int32Array(1);b[0]=d;var c=new Float32Array(b.buffer);return c[0]}function io(b){return new X(b[7]<<0|b[6]<<8|b[5]<<16,b[4]<<0|b[3]<<8|b[2]<<16,b[1]<<0|b[0]<<8)}function o3(e){var a=e.lo,g=e.mi,c=e.hi,d=(c&0x7fff)>>4;if(d==2047)return(a|g|c&oc)==0?c&dw?-Infinity:Infinity:NaN;var f=Math.pow(2,-24),b=(a*f+g)*f+(c&oc);if(d>0){b+=16;b*=Math.pow(2,d-xt)}else b*=Math.pow(2,-uJ);if(c&dw)b=-b;return b}function oR(c){var e=c.length,d=1;for(var b=0;b<e;b++){if(c[b]<0)bs("Bigarray.create: negative dimension");d=d*c[b]}return d}function aJ0(c,b){return new X(c&dX,c>>>24&cC|(b&du)<<8,b>>>16&du)}function o4(b){return b.hi32()}function o5(b){return b.lo32()}var aJH=kn;function eE(d,e,c,b){this.kind=d;this.layout=e;this.dims=c;this.data=b}eE.prototype.caml_custom=aJH;eE.prototype.offset=function(c){var d=0;if(typeof c==="number")c=[c];if(!(c instanceof Array))bs("bigarray.js: invalid offset");if(this.dims.length!=c.length)bs("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var b=0;b<this.dims.length;b++){if(c[b]<0||c[b]>=this.dims[b])gr();d=d*this.dims[b]+c[b]}else for(var b=this.dims.length-1;b>=0;b--){if(c[b]<1||c[b]>this.dims[b])gr();d=d*this.dims[b]+(c[b]-1)}return d};eE.prototype.get=function(b){switch(this.kind){case 7:var e=this.data[b*2+0],c=this.data[b*2+1];return aJ0(e,c);case 10:case 11:var f=this.data[b*2+0],d=this.data[b*2+1];return[j0,f,d];default:return this.data[b]}};eE.prototype.set=function(b,c){switch(this.kind){case 7:this.data[b*2+0]=o5(c);this.data[b*2+1]=o4(c);break;case 10:case 11:this.data[b*2+0]=c[1];this.data[b*2+1]=c[2];break;default:this.data[b]=c;break}return 0};eE.prototype.fill=function(c){switch(this.kind){case 7:var d=o5(c),f=o4(c);if(d==f)this.data.fill(d);else for(var b=0;b<this.data.length;b++)this.data[b]=b%2==0?d:f;break;case 10:case 11:var e=c[1],a=c[2];if(e==a)this.data.fill(e);else for(var b=0;b<this.data.length;b++)this.data[b]=b%2==0?e:a;break;default:this.data.fill(c);break}};eE.prototype.compare=function(c,g){if(this.layout!=c.layout||this.kind!=c.kind){var f=this.kind|this.layout<<8,a=c.kind|c.layout<<8;return a-f}if(this.dims.length!=c.dims.length)return c.dims.length-this.dims.length;for(var b=0;b<this.dims.length;b++)if(this.dims[b]!=c.dims[b])return this.dims[b]<c.dims[b]?-1:1;switch(this.kind){case 0:case 1:case 10:case 11:var d,e;for(var b=0;b<this.data.length;b++){d=this.data[b];e=c.data[b];if(d<e)return-1;if(d>e)return 1;if(d!=e){if(!g)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case 7:for(var b=0;b<this.data.length;b+=2){if(this.data[b+1]<c.data[b+1])return-1;if(this.data[b+1]>c.data[b+1])return 1;if(this.data[b]>>>0<c.data[b]>>>0)return-1;if(this.data[b]>>>0>c.data[b]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var b=0;b<this.data.length;b++){if(this.data[b]<c.data[b])return-1;if(this.data[b]>c.data[b])return 1}break}return 0};function gq(d,e,c,b){this.kind=d;this.layout=e;this.dims=c;this.data=b}gq.prototype=new eE();gq.prototype.offset=function(b){if(typeof b!=="number")if(b instanceof Array&&b.length==1)b=b[0];else bs("Ml_Bigarray_c_1_1.offset");if(b<0||b>=this.dims[0])gr();return b};gq.prototype.get=function(b){return this.data[b]};gq.prototype.set=function(b,c){this.data[b]=c;return 0};gq.prototype.fill=function(b){this.data.fill(b);return 0};function xA(d,e,b,c){var f=xC(d);if(oR(b)*f!=c.length)bs("length doesn't match dims");if(e==0&&b.length==1&&f==1)return new gq(d,e,b,c);return new eE(d,e,b,c)}function cr(c){if(!cG.Failure)cG.Failure=[aS,b(nP),-3];o$(cG.Failure,c)}function xB(c,v,r){var i=c.read32s();if(i<0||i>16)cr("input_value: wrong number of bigarray dimensions");var p=c.read32s(),j=p&cC,o=p>>8&1,h=[];if(r==kn)for(var b=0;b<i;b++){var n=c.read16u();if(n==du){var t=c.read32u(),u=c.read32u();if(t!=0)cr("input_value: bigarray dimension overflow in 32bit");n=u}h.push(n)}else for(var b=0;b<i;b++)h.push(c.read32u());var e=oR(h),a=aJG(j,e),g=xA(j,o,h,a);switch(j){case 2:for(var b=0;b<e;b++)a[b]=c.read8s();break;case 3:case 12:for(var b=0;b<e;b++)a[b]=c.read8u();break;case 4:for(var b=0;b<e;b++)a[b]=c.read16s();break;case 5:for(var b=0;b<e;b++)a[b]=c.read16u();break;case 6:for(var b=0;b<e;b++)a[b]=c.read32s();break;case 8:case 9:var s=c.read8u();if(s)cr("input_value: cannot read bigarray with 64-bit OCaml ints");for(var b=0;b<e;b++)a[b]=c.read32s();break;case 7:var f=new Array(8);for(var b=0;b<e;b++){for(var d=0;d<8;d++)f[d]=c.read8u();var q=io(f);g.set(b,q)}break;case 1:var f=new Array(8);for(var b=0;b<e;b++){for(var d=0;d<8;d++)f[d]=c.read8u();var k=o3(io(f));g.set(b,k)}break;case 0:for(var b=0;b<e;b++){var k=o2(c.read32s());g.set(b,k)}break;case 10:for(var b=0;b<e;b++){var m=o2(c.read32s()),l=o2(c.read32s());g.set(b,[j0,m,l])}break;case 11:var f=new Array(8);for(var b=0;b<e;b++){for(var d=0;d<8;d++)f[d]=c.read8u();var m=o3(io(f));for(var d=0;d<8;d++)f[d]=c.read8u();var l=o3(io(f));g.set(b,[j0,m,l])}break}v[0]=(4+i)*4;return xA(j,o,h,a)}function xz(b,c,d){return b.compare(c,d)}function eG(b,c){return Math.imul(b,c)}function bU(c,b){b=eG(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=eG(b,0x1b873593);c^=b;c=c<<13|c>>>32-13;return(c+(c<<2)|0)+(0xe6546b64|0)|0}function aJV(b,c){b=bU(b,o5(c));b=bU(b,o4(c));return b}function oZ(b,c){return aJV(b,kF(c))}function xD(d){var c=oR(d.dims),e=0;switch(d.kind){case 2:case 3:case 12:if(c>c_)c=c_;var f=0,b=0;for(b=0;b+4<=d.data.length;b+=4){f=d.data[b+0]|d.data[b+1]<<8|d.data[b+2]<<16|d.data[b+3]<<24;e=bU(e,f)}f=0;switch(c&3){case 3:f=d.data[b+2]<<16;case 2:f|=d.data[b+1]<<8;case 1:f|=d.data[b+0];e=bU(e,f)}break;case 4:case 5:if(c>eD)c=eD;var f=0,b=0;for(b=0;b+2<=d.data.length;b+=2){f=d.data[b+0]|d.data[b+1]<<16;e=bU(e,f)}if((c&1)!=0)e=bU(e,d.data[b]);break;case 6:if(c>64)c=64;for(var b=0;b<c;b++)e=bU(e,d.data[b]);break;case 8:case 9:if(c>64)c=64;for(var b=0;b<c;b++)e=bU(e,d.data[b]);break;case 7:if(c>32)c=32;c*=2;for(var b=0;b<c;b++)e=bU(e,d.data[b]);break;case 10:c*=2;case 0:if(c>64)c=64;for(var b=0;b<c;b++)e=oZ(e,d.data[b]);break;case 11:c*=2;case 1:if(c>32)c=32;for(var b=0;b<c;b++)e=oZ(e,d.data[b]);break}return e}function aJY(b,c){c[0]=4;return b.read32s()}function aKm(b,c){switch(b.read8u()){case 1:c[0]=4;return b.read32s();case 2:cr("input_value: native integer value too large");default:cr("input_value: ill-formed native integer")}}function aJ7(d,e){var c=new Array(8);for(var b=0;b<8;b++)c[b]=d.read8u();e[0]=8;return io(c)}function aJ5(f,e,c){var d=ip(e);for(var b=0;b<8;b++)f.write(8,d[b]);c[0]=8;c[1]=8}function aJZ(b,c,d){return b.compare(c)}function aJ2(b){return b.lo32()^b.hi32()}var im={"_j":{deserialize:aJ7,serialize:aJ5,fixed_length:8,compare:aJZ,hash:aJ2},"_i":{deserialize:aJY,fixed_length:4},"_n":{deserialize:aKm,fixed_length:4},"_bigarray":{deserialize:function(b,c){return xB(b,c,"_bigarray")},serialize:xE,compare:xz,hash:xD},"_bigarr02":{deserialize:function(b,c){return xB(b,c,kn)},serialize:xE,compare:xz,hash:xD}};function oT(b){return im[b.caml_custom]&&im[b.caml_custom].compare}function xI(a,d,e,f){var c=oT(d);if(c){var b=e>0?c(d,a,f):c(a,d,f);if(f&&b!=b)return e;if(+b!=+b)return+b;if((b|0)!=0)return b|0}return e}function ir(b){return b instanceof dz}function kI(b){return ir(b)}function xJ(b){if(typeof b==="number")return ey;else if(ir(b))return j3;else if(kI(b))return 1252;else if(b instanceof Array&&b[0]===b[0]>>>0&&b[0]<=es){var c=b[0]|0;return c==j0?0:c}else if(b instanceof String)return tj;else if(typeof b=="string")return tj;else if(b instanceof Number)return ey;else if(b&&b.caml_custom)return n8;else if(b&&b.compare)return 1256;else if(typeof b=="function")return 1247;else if(typeof b=="symbol")return 1251;return 1001}function an(b,c){if(b<c)return-1;if(b==c)return 0;return 1}function xG(b,c){b.t&6&&fw(b);c.t&6&&fw(c);return b.c<c.c?-1:b.c>c.c?1:0}function ac(b,c){return xG(b,c)}function gs(b,c,e){var f=[];for(;;){if(!(e&&b===c)){var a=xJ(b);if(a==cR){b=b[1];continue}var g=xJ(c);if(g==cR){c=c[1];continue}if(a!==g){if(a==ey){if(g==n8)return xI(b,c,-1,e);return-1}if(g==ey){if(a==n8)return xI(c,b,1,e);return 1}return a<g?-1:1}switch(a){case 247:bs(nU);break;case 248:var d=an(b[2],c[2]);if(d!=0)return d|0;break;case 249:bs(nU);break;case 250:bs("equal: got Forward_tag, should not happen");break;case 251:bs("equal: abstract value");break;case 252:if(b!==c){var d=xG(b,c);if(d!=0)return d|0}break;case 253:bs("equal: got Double_tag, should not happen");break;case 254:bs("equal: got Double_array_tag, should not happen");break;case 255:bs("equal: got Custom_tag, should not happen");break;case 1247:bs(nU);break;case 1255:var i=oT(b);if(i!=oT(c))return b.caml_custom<c.caml_custom?-1:1;if(!i)bs("compare: abstract value");var d=i(b,c,e);if(d!=d)return e?-1:d;if(d!==(d|0))return-1;if(d!=0)return d|0;break;case 1256:var d=b.compare(c,e);if(d!=d)return e?-1:d;if(d!==(d|0))return-1;if(d!=0)return d|0;break;case 1000:b=+b;c=+c;if(b<c)return-1;if(b>c)return 1;if(b!=c){if(!e)return NaN;if(b==b)return 1;if(c==c)return-1}break;case 1001:if(b<c)return-1;if(b>c)return 1;if(b!=c){if(!e)return NaN;if(b==b)return 1;if(c==c)return-1}break;case 1251:if(b!==c){if(!e)return NaN;return 1}break;case 1252:var b=da(b),c=da(c);if(b!==c){if(b<c)return-1;if(b>c)return 1}break;case 12520:var b=b.toString(),c=c.toString();if(b!==c){if(b<c)return-1;if(b>c)return 1}break;case 246:case 254:default:if(b.length!=c.length)return b.length<c.length?-1:1;if(b.length>1)f.push(b,c,1);break}}if(f.length==0)return 0;var h=f.pop();c=f.pop();b=f.pop();if(h+1<b.length)f.push(b,c,h+1);b=b[h];c=c[h]}}function b5(b,c){return gs(b,c,true)}function aJL(){return[0]}function aJM(b){return Math.cosh(b)}function aM(b){if(b<0)bs("Bytes.create");return new dz(b?2:9,o,b)}function oU(c,b){if(b==0)kL();return c/b|0}function a8(b,c){return+(gs(b,c,false)==0)}function aJO(b,d,c,e){if(c>0)if(d==0&&(c>=b.l||b.t==2&&c>=b.c.length))if(e==0){b.c=o;b.t=2}else{b.c=gw(c,String.fromCharCode(e));b.t=c==b.l?0:2}else{if(b.t!=4)kB(b);for(c+=d;d<c;d++)b.c[d]=e}return 0}function oW(b,c){if(b===c)return 0;if(b<c)return-1;if(b>c)return 1;if(b===b)return 1;if(c===c)return-1;return 0}function oX(b){var c;b=da(b);c=+b;if(b.length>0&&c===c)return c;b=b.replace(/_/g,o);c=+b;if(b.length>0&&c===c||/^[+-]?nan$/i.test(b))return c;var d=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(b);if(d){var e=d[3].replace(/0+$/,o),a=parseInt(d[1]+d[2]+e,16),f=(d[5]|0)-4*e.length;c=a*Math.pow(2,f);return c}if(/^\+?inf(inity)?$/i.test(b))return Infinity;if(/^-inf(inity)?$/i.test(b))return-Infinity;cr("float_of_string")}function o9(e){e=da(e);var f=e.length;if(f>31)bs("format_int: format too long");var b={justify:a6,signstyle:a7,filler:B,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:vW};for(var d=0;d<f;d++){var c=e.charAt(d);switch(c){case"-":b.justify=a7;break;case"+":case" ":b.signstyle=c;break;case"0":b.filler=a5;break;case"#":b.alternate=true;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":b.width=0;while(c=e.charCodeAt(d)-48,c>=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=e.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function oV(c,a){if(c.uppercase)a=a.toUpperCase();var f=a.length;if(c.signedconv&&(c.sign<0||c.signstyle!=a7))f++;if(c.alternate){if(c.base==8)f+=1;if(c.base==16)f+=2}var d=o;if(c.justify==a6&&c.filler==B)for(var e=f;e<c.width;e++)d+=B;if(c.signedconv)if(c.sign<0)d+=a7;else if(c.signstyle!=a7)d+=c.signstyle;if(c.alternate&&c.base==8)d+=a5;if(c.alternate&&c.base==16)d+=c.uppercase?"0X":nu;if(c.justify==a6&&c.filler==a5)for(var e=f;e<c.width;e++)d+=a5;d+=a;if(c.justify==a7)for(var e=f;e<c.width;e++)d+=B;return b(d)}function oY(i,d){function j(b,c){if(Math.abs(b)<1.0)return b.toFixed(c);else{var d=parseInt(b.toString().split(a6)[1]);if(d>20){d-=20;b/=Math.pow(10,d);b+=new Array(d+1).join(a5);if(c>0)b=b+aK+new Array(c+1).join(a5);return b}else return b.toFixed(c)}}var b,f=o9(i),e=f.prec<0?6:f.prec;if(d<0||d==0&&1/d==-Infinity){f.sign=-1;d=-d}if(isNaN(d)){b=nQ;f.filler=B}else if(!isFinite(d)){b="inf";f.filler=B}else switch(f.conv){case"e":var b=d.toExponential(e),c=b.length;if(b.charAt(c-3)==oP)b=b.slice(0,c-1)+a5+b.slice(c-1);break;case"f":b=j(d,e);break;case"g":e=e?e:1;b=d.toExponential(e-1);var h=b.indexOf(oP),g=+b.slice(h+1);if(g<-4||d>=1e21||d.toFixed(0).length>e){var c=h-1;while(b.charAt(c)==a5)c--;if(b.charAt(c)==aK)c--;b=b.slice(0,c+1)+b.slice(h);c=b.length;if(b.charAt(c-3)==oP)b=b.slice(0,c-1)+a5+b.slice(c-1);break}else{var a=e;if(g<0){a-=g+1;b=d.toFixed(a)}else while(b=d.toFixed(a),b.length>e+1)a--;if(a){var c=b.length-1;while(b.charAt(c)==a5)c--;if(b.charAt(c)==aK)c--;b=b.slice(0,c+1)}}break}return oV(f,b)}function kC(f,d){if(da(f)==eB)return b(o+d);var c=o9(f);if(d<0)if(c.signedconv){c.sign=-1;d=-d}else d>>>=0;var e=d.toString(c.base);if(c.prec>=0){c.filler=B;var a=c.prec-e.length;if(a>0)e=gw(a,a5)+e}return oV(c,e)}var xZ=0;function d4(){return xZ++}function cH(b){return b.toUtf16()}function iv(){return typeof ap.process!=="undefined"&&typeof ap.process.versions!=="undefined"&&typeof ap.process.versions.node!=="undefined"}function aKM(){function b(b){if(b.charAt(0)===bM)return[o,b.substring(1)];return}function c(d){var g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=g.exec(d),c=b[1]||o,f=Boolean(c&&c.charAt(1)!==cB);if(Boolean(b[2]||f)){var e=b[1]||o,a=b[2]||o;return[e,d.substring(e.length+a.length)]}return}return iv()&&ap.process&&ap.process.platform?ap.process.platform===sZ?c:b:b}var pb=aKM();function x4(b){return b.slice(-1)!==bM?b+bM:b}if(iv()&&ap.process&&ap.process.cwd)var gt=ap.process.cwd().replace(/\\/g,bM);else var gt="/static";gt=x4(gt);function aKc(b){b=cH(b);if(!pb(b))b=gt+b;var f=pb(b),e=f[1].split(bM),c=[];for(var d=0;d<e.length;d++)switch(e[d]){case"..":if(c.length>1)c.pop();break;case".":break;case"":break;default:c.push(e[d]);break}c.unshift(f[0]);c.orig=b;return c}function aKI(f){for(var a=o,c=a,b,h,d=0,g=f.length;d<g;d++){b=f.charCodeAt(d);if(b<cT){for(var e=d+1;e<g&&(b=f.charCodeAt(e))<cT;e++);if(e-d>h4){c.substr(0,1);a+=c;c=o;a+=f.slice(d,e)}else c+=f.slice(d,e);if(e==g)break;d=e}if(b<tQ){c+=String.fromCharCode(0xc0|b>>6);c+=String.fromCharCode(cT|b&eq)}else if(b<0xd800||b>=wN)c+=String.fromCharCode(ta|b>>12,cT|b>>6&eq,cT|b&eq);else if(b>=0xdbff||d+1==g||(h=f.charCodeAt(d+1))<ul||h>wN)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+h-0x35fdc00;c+=String.fromCharCode(wa|b>>18,cT|b>>12&eq,cT|b>>6&eq,cT|b&eq)}if(c.length>ff){c.substr(0,1);a+=c;c=o}}return a+c}function aJK(b){var c=9;if(!x6(b))c=8,b=aKI(b);return new dz(c,b,b.length)}function aU(b){return aJK(b)}var aKO=["E2BIG","EACCES","EAGAIN",nw,"EBUSY","ECHILD","EDEADLK","EDOM",s8,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",oI,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",ow,xb,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function d7(e,a,f,b){var c=aKO.indexOf(e);if(c<0){if(b==null)b=-9999;c=[0,b]}var d=[c,aU(a||o),aU(f||o)];return d}var xX={};function eH(b){return xX[b]}function d5(c,b){throw[0,c].concat(b)}function oS(b){if(!(b instanceof Uint8Array))b=new Uint8Array(b);return new dz(4,b,b.length)}function ah(b){o$(cG.Sys_error,b)}function x1(b){ah(b+kh)}function gz(b){if(b.t!=4)kB(b);return b.c}function bB(b){return b.l}function xy(){}function b2(b){this.data=b}b2.prototype=new xy();b2.prototype.constructor=b2;b2.prototype.truncate=function(b){var c=this.data;this.data=aM(b|0);d3(c,0,this.data,0,b)};b2.prototype.length=function(){return bB(this.data)};b2.prototype.write=function(c,e,g,b){var d=this.length();if(c+b>=d){var f=aM(c+b),a=this.data;this.data=f;d3(a,0,this.data,0,d)}d3(oS(e),g,this.data,c,b);return 0};b2.prototype.read=function(c,f,a,b){var d=this.length();if(c+b>=d)b=d-c;if(b){var e=aM(b|0);d3(this.data,c,e,0,b);f.set(gz(e),a)}return b};function fu(d,b,c){this.file=b;this.name=d;this.flags=c}fu.prototype.err_closed=function(){ah(this.name+ue)};fu.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};fu.prototype.write=function(d,b,e,c){if(this.file)return this.file.write(d,b,e,c);this.err_closed()};fu.prototype.read=function(d,b,e,c){if(this.file)return this.file.read(d,b,e,c);this.err_closed()};fu.prototype.close=function(){this.file=undefined};function bO(c,b){this.content={};this.root=c;this.lookupFun=b}bO.prototype.nm=function(b){return this.root+b};bO.prototype.create_dir_if_needed=function(e){var d=e.split(bM),c=o;for(var b=0;b<d.length-1;b++){c+=d[b]+bM;if(this.content[c])continue;this.content[c]=Symbol("directory")}};bO.prototype.slash=function(b){return/\/$/.test(b)?b:b+bM};bO.prototype.lookup=function(c){if(!this.content[c]&&this.lookupFun){var d=this.lookupFun(b(this.root),b(c));if(d!==0){this.create_dir_if_needed(c);this.content[c]=new b2(b3(d[1]))}}};bO.prototype.exists=function(b){if(b==o)return 1;var c=this.slash(b);if(this.content[c])return 1;this.lookup(b);return this.content[b]?1:0};bO.prototype.mkdir=function(d,f,e){var c=e&&eH(kt);if(this.exists(d))if(c)d5(c,d7(s8,ns,this.nm(d)));else ah(d+": File exists");var b=/^(.*)\/[^/]+/.exec(d);b=b&&b[1]||o;if(!this.exists(b))if(c)d5(c,d7(oI,ns,this.nm(b)));else ah(b+kh);if(!this.is_dir(b))if(c)d5(c,d7(ow,ns,this.nm(b)));else ah(b+ol);this.create_dir_if_needed(this.slash(d))};bO.prototype.rmdir=function(b,a){var c=a&&eH(kt),d=b==o?o:this.slash(b),f=new RegExp(h5+d+tN);if(!this.exists(b))if(c)d5(c,d7(oI,nX,this.nm(b)));else ah(b+kh);if(!this.is_dir(b))if(c)d5(c,d7(ow,nX,this.nm(b)));else ah(b+ol);for(var e in this.content)if(e.match(f))if(c)d5(c,d7(xb,nX,this.nm(b)));else ah(this.nm(b)+": Directory not empty");delete this.content[d]};bO.prototype.readdir=function(b){var a=b==o?o:this.slash(b);if(!this.exists(b))ah(b+kh);if(!this.is_dir(b))ah(b+ol);var g=new RegExp(h5+a+tN),e={},d=[];for(var f in this.content){var c=f.match(g);if(c&&!e[c[1]]){e[c[1]]=true;d.push(c[1])}}return d};bO.prototype.opendir=function(b,a){var c=a&&eH(kt),d=this.readdir(b),e=false,f=0;return{readSync:function(){if(e)if(c)d5(c,d7(nw,tV,this.nm(b)));else ah(b+wh);if(f==d.length)return null;var a=d[f];f++;return{name:a}},closeSync:function(){if(e)if(c)d5(c,d7(nw,tV,this.nm(b)));else ah(b+wh);e=true;d=[]}}};bO.prototype.is_dir=function(b){if(b==o)return true;var c=this.slash(b);return this.content[c]?1:0};bO.prototype.unlink=function(b){var c=this.content[b]?true:false;delete this.content[b];return c};bO.prototype.open=function(b,c){var d;if(c.rdonly&&c.wronly)ah(this.nm(b)+nB);if(c.text&&c.binary)ah(this.nm(b)+ob);this.lookup(b);if(this.content[b]){if(this.is_dir(b))ah(this.nm(b)+tc);if(c.create&&c.excl)ah(this.nm(b)+nA);d=this.content[b];if(c.truncate)d.truncate()}else if(c.create){this.create_dir_if_needed(b);this.content[b]=new b2(aM(0));d=this.content[b]}else x1(this.nm(b));return new fu(this.nm(b),d,c)};bO.prototype.open=function(b,c){var d;if(c.rdonly&&c.wronly)ah(this.nm(b)+nB);if(c.text&&c.binary)ah(this.nm(b)+ob);this.lookup(b);if(this.content[b]){if(this.is_dir(b))ah(this.nm(b)+tc);if(c.create&&c.excl)ah(this.nm(b)+nA);d=this.content[b];if(c.truncate)d.truncate()}else if(c.create){this.create_dir_if_needed(b);this.content[b]=new b2(aM(0));d=this.content[b]}else x1(this.nm(b));return new fu(this.nm(b),d,c)};bO.prototype.register=function(d,b){var c;if(this.content[d])ah(this.nm(d)+nA);if(ir(b))c=new b2(b);if(kI(b))c=new b2(b3(b));else if(b instanceof Array)c=new b2(oS(b));else if(typeof b==="string")c=new b2(xH(b));else if(b.toString){var e=b3(aU(b.toString()));c=new b2(e)}if(c){this.create_dir_if_needed(d);this.content[d]=c}else ah(this.nm(d)+" : registering file with invalid content type")};bO.prototype.constructor=bO;function x(b){return bB(b)}function cs(c,b){return fv(c,b)}function aKG(e){var d=x(e),c=new Array(d),b=0;for(;b<d;b++)c[b]=cs(e,b);return c}function c$(b,c){this.fs=require("fs");this.fd=b;this.flags=c}c$.prototype=new xy();c$.prototype.constructor=c$;c$.prototype.truncate=function(b){try{this.fs.ftruncateSync(this.fd,b|0)}catch(b){ah(b.toString())}};c$.prototype.length=function(){try{return this.fs.fstatSync(this.fd).size}catch(b){ah(b.toString())}};c$.prototype.write=function(e,b,c,d){try{if(this.flags.isCharacterDevice)this.fs.writeSync(this.fd,b,c,d);else this.fs.writeSync(this.fd,b,c,d,e)}catch(b){ah(b.toString())}return 0};c$.prototype.read=function(f,b,c,d){try{if(this.flags.isCharacterDevice)var e=this.fs.readSync(this.fd,b,c,d);else var e=this.fs.readSync(this.fd,b,c,d,f);return e}catch(b){ah(b.toString())}};c$.prototype.close=function(){try{this.fs.closeSync(this.fd);return 0}catch(b){ah(b.toString())}};function br(b){this.fs=require("fs");this.root=b}br.prototype.nm=function(b){return this.root+b};br.prototype.exists=function(b){try{return this.fs.existsSync(this.nm(b))?1:0}catch(a){return 0}};br.prototype.mkdir=function(c,b,d){try{this.fs.mkdirSync(this.nm(c),{mode:b});return 0}catch(b){this.raise_nodejs_error(b,d)}};br.prototype.rmdir=function(b,c){try{this.fs.rmdirSync(this.nm(b));return 0}catch(b){this.raise_nodejs_error(b,c)}};br.prototype.readdir=function(b,c){try{return this.fs.readdirSync(this.nm(b))}catch(b){this.raise_nodejs_error(b,c)}};br.prototype.is_dir=function(b){try{return this.fs.statSync(this.nm(b)).isDirectory()?1:0}catch(b){ah(b.toString())}};br.prototype.unlink=function(b,d){try{var c=this.fs.existsSync(this.nm(b))?1:0;this.fs.unlinkSync(this.nm(b));return c}catch(b){this.raise_nodejs_error(b,d)}};br.prototype.open=function(e,d,h){var b=require("constants"),c=0;for(var g in d)switch(g){case"rdonly":c|=b.O_RDONLY;break;case"wronly":c|=b.O_WRONLY;break;case"append":c|=b.O_WRONLY|b.O_APPEND;break;case"create":c|=b.O_CREAT;break;case"truncate":c|=b.O_TRUNC;break;case"excl":c|=b.O_EXCL;break;case"binary":c|=b.O_BINARY;break;case"text":c|=b.O_TEXT;break;case"nonblock":c|=b.O_NONBLOCK;break}try{var f=this.fs.openSync(this.nm(e),c),a=this.fs.lstatSync(this.nm(e)).isCharacterDevice();d.isCharacterDevice=a;return new c$(f,d)}catch(b){this.raise_nodejs_error(b,h)}};br.prototype.rename=function(c,b,d){try{this.fs.renameSync(this.nm(c),this.nm(b))}catch(b){this.raise_nodejs_error(b,d)}};br.prototype.stat=function(c,d){try{var b=this.fs.statSync(this.nm(c));return this.stats_from_js(b)}catch(b){this.raise_nodejs_error(b,d)}};br.prototype.lstat=function(c,d){try{var b=this.fs.lstatSync(this.nm(c));return this.stats_from_js(b)}catch(b){this.raise_nodejs_error(b,d)}};br.prototype.symlink=function(e,d,b,c){try{this.fs.symlinkSync(this.nm(d),this.nm(b),e?"dir":of);return 0}catch(b){this.raise_nodejs_error(b,c)}};br.prototype.readlink=function(c,d){try{var b=this.fs.readlinkSync(this.nm(c),"utf8");return aU(b)}catch(b){this.raise_nodejs_error(b,d)}};br.prototype.opendir=function(b,c){try{return this.fs.opendirSync(this.nm(b))}catch(b){this.raise_nodejs_error(b,c)}};br.prototype.raise_nodejs_error=function(b,e){var c=eH(kt);if(e&&c){var d=d7(b.code,b.syscall,b.path,b.errno);d5(c,d)}else ah(b.toString())};br.prototype.stats_from_js=function(b){var c;if(b.isFile())c=0;else if(b.isDirectory())c=1;else if(b.isCharacterDevice())c=2;else if(b.isBlockDevice())c=3;else if(b.isSymbolicLink())c=4;else if(b.isFIFO())c=5;else if(b.isSocket())c=6;return[0,b.dev,b.ino,c,b.mode,b.nlink,b.uid,b.gid,b.rdev,b.size,b.atimeMs,b.mtimeMs,b.ctimeMs]};br.prototype.constructor=br;function xM(c){var b=pb(c);if(!b)return;return b[0]+bM}var kM=xM(gt)||cr("unable to compute caml_root"),gA=[];if(iv())gA.push({path:kM,device:new br(kM)});else gA.push({path:kM,device:new bO(kM)});gA.push({path:uN,device:new bO(uN)});function pc(c){var g=aKc(c),c=g.join(bM),a=x4(c),d;for(var f=0;f<gA.length;f++){var b=gA[f];if(a.search(b.path)==0&&(!d||d.path.length<b.path.length))d={path:b.path,device:b.device,rest:c.substring(b.path.length,c.length)}}if(!d&&iv()){var e=xM(c);if(e&&e.match(/^[a-zA-Z]:\/$/)){var b={path:e,device:new br(e)};gA.push(b);d={path:b.path,device:b.device,rest:c.substring(b.path.length,c.length)}}}if(d)return d;ah("no device found for "+a)}function aJN(d,c){var b=pc(d);if(!b.device.register)cr("cannot register file");b.device.register(b.rest,c);return 0}function x5(d,c){var d=b(d),c=b(c);return aJN(d,c)}function aJQ(){var c=ap.caml_fs_tmp;if(c)for(var b=0;b<c.length;b++)x5(c[b].name,c[b].content);ap.jsoo_create_file=x5;ap.caml_fs_tmp=[];return 0}function xL(){return[0]}var kK=[];function kD(i,h,e){var c=i[1],g=kK[e];if(g===undefined)for(var a=kK.length;a<e;a++)kK[a]=0;else if(c[g]===h)return c[g-1];var b=3,f=c[1]*2+1,d;while(b<f){d=b+f>>1|1;if(h<c[d+1])f=d-2;else b=d}kK[e]=b+1;return h==c[b+1]?c[b]:0}function aJR(b,c){return+(gs(b,c,false)>=0)}function o0(e,c){var f=c.length,b,d;for(b=0;b+4<=f;b+=4){d=c.charCodeAt(b)|c.charCodeAt(b+1)<<8|c.charCodeAt(b+2)<<16|c.charCodeAt(b+3)<<24;e=bU(e,d)}d=0;switch(f&3){case 3:d=c.charCodeAt(b+2)<<16;case 2:d|=c.charCodeAt(b+1)<<8;case 1:d|=c.charCodeAt(b);e=bU(e,d)}e^=f;return e}function aJW(b,c){return o0(b,da(c))}function aJT(e,c){var f=c.length,b,d;for(b=0;b+4<=f;b+=4){d=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24;e=bU(e,d)}d=0;switch(f&3){case 3:d=c[b+2]<<16;case 2:d|=c[b+1]<<8;case 1:d|=c[b];e=bU(e,d)}e^=f;return e}function aKf(b){switch(b.t&6){default:fw(b);case 0:return b.c;case 4:return b.c}}function aJS(c,d){var b=aKf(d);return typeof b==="string"?o0(c,b):aJT(c,b)}function aJU(b){b^=b>>>16;b=eG(b,0x85ebca6b|0);b^=b>>>13;b=eG(b,0xc2b2ae35|0);b^=b>>>16;return b}function xN(j,l,n,m){var a,g,h,e,d,c,b,f,i;e=l;if(e<0||e>c_)e=c_;d=j;c=n;a=[m];g=0;h=1;while(g<h&&d>0){b=a[g++];if(b&&b.caml_custom){if(im[b.caml_custom]&&im[b.caml_custom].hash){var k=im[b.caml_custom].hash(b);c=bU(c,k);d--}}else if(b instanceof Array&&b[0]===(b[0]|0))switch(b[0]){case 248:c=bU(c,b[2]);d--;break;case 250:a[--g]=b[1];break;default:var o=b.length-1<<10|b[0];c=bU(c,o);for(f=1,i=b.length;f<i;f++){if(h>=e)break;a[h++]=b[f]}break}else if(ir(b)){c=aJS(c,b);d--}else if(kI(b)){c=aJW(c,b);d--}else if(typeof b==="string"){c=o0(c,b);d--}else if(b===(b|0)){c=bU(c,b+b+1);d--}else if(b===+b){c=oZ(c,b);d--}}c=aJU(c);return c&0x3FFFFFFF}function aJX(b,d,k){if(!isFinite(b)){if(isNaN(b))return aU(nQ);return aU(b>0?xn:"-infinity")}var i=b==0&&1/b==-Infinity?1:b>=0?0:1;if(i)b=-b;var e=0;if(b==0);else if(b<1)while(b<1&&e>-1022){b*=2;e--}else while(b>=2){b/=2;e++}var j=e<0?o:a6,f=o;if(i)f=a7;else switch(k){case 43:f=a6;break;case 32:f=B;break;default:break}if(d>=0&&d<13){var g=Math.pow(2,d*4);b=Math.round(b*g)/g}var c=b.toString(16);if(d>=0){var h=c.indexOf(aK);if(h<0)c+=aK+gw(d,a5);else{var a=h+1+d;if(c.length<a)c+=gw(a-c.length,a5);else c=c.substr(0,a)}}return aU(f+nu+c+"p"+j+e.toString(10))}function kE(b,c){return b.and(c)}function aJ4(b){return+b.isZero()}function eF(b){return new X(b&dX,b>>24&dX,b>>31&du)}function iq(b){return b.toInt()}function aJ3(b){return+b.isNeg()}function aJ6(b){return b.neg()}function aJ1(g,d){var b=o9(g);if(b.signedconv&&aJ3(d)){b.sign=-1;d=aJ6(d)}var c=o,h=eF(b.base),a="0123456789abcdef";do{var f=d.udivmod(h);d=f.quotient;c=a.charAt(iq(f.modulus))+c}while(!aJ4(d));if(b.prec>=0){b.filler=B;var e=b.prec-c.length;if(e>0)c=gw(e,a5)+c}return oV(b,c)}function xP(b,c){return b.or(c)}function gu(c,b){return c.shift_left(b)}function kH(c,b){return c.shift_right(b)}function aKp(d){var b=0,f=x(d),c=10,e=1;if(f>0)switch(cs(d,b)){case 45:b++;e=-1;break;case 43:b++;e=1;break}if(b+1<f&&cs(d,b)==48)switch(cs(d,b+1)){case 120:case 88:c=16;b+=2;break;case 111:case 79:c=8;b+=2;break;case 98:case 66:c=2;b+=2;break;case 117:case 85:b+=2;break}return[b,e,c]}function x0(b){if(b>=48&&b<=57)return b-48;if(b>=65&&b<=90)return b-55;if(b>=97&&b<=122)return b-87;return-1}function gv(a){var h=aKp(a),d=h[0],i=h[1],e=h[2],g=x(a),j=-1>>>0,f=d<g?cs(a,d):0,c=x0(f);if(c<0||c>=e)cr(j9);var b=c;for(d++;d<g;d++){f=cs(a,d);if(f==95)continue;c=x0(f);if(c<0||c>=e)break;b=e*b+c;if(b>j)cr(j9)}if(d!=g)cr(j9);b=i*b;if(e==10&&(b|0)!=b)cr(j9);return b|0}function kJ(b){return b.slice(1)}function o6(d){var e=d.length,c=new Array(e+1);c[0]=0;for(var b=0;b<e;b++)c[b+1]=d[b];return c}function aJ9(d){return function(){var c=arguments.length;if(c>0){var e=new Array(c);for(var b=0;b<c;b++)e[b]=arguments[b];return cX(d,e)}else return cX(d,[undefined])}}function is(e){return function(){var d=arguments.length,c=new Array(d+1);c[0]=this;for(var b=0;b<d;b++)c[b+1]=arguments[b];return cX(e,c)}}function aJ_(b,c){return+(gs(b,c,false)<=0)}function xQ(b,c){return+(gs(b,c,false)<0)}function cd(c){c=da(c);var e=c.length/2,d=new Array(e);for(var b=0;b<e;b++)d[b]=(c.charCodeAt(2*b)|c.charCodeAt(2*b+1)<<8)<<16>>16;return d}function aJ$(c,t,b){var n=2,o=3,r=5,e=6