@factoidal/core 0.1.0
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/CHANGELOG.md +121 -0
- package/LICENSE +201 -0
- package/README.md +514 -0
- package/browser-wasm.js +872 -0
- package/browser.d.ts +514 -0
- package/browser.js +2276 -0
- package/factoidal-npm-entry.js +32609 -0
- package/factoidal-npm-entry.wasm.assets/code-7ac046580f1bbdda8dc6.wasm +0 -0
- package/factoidal-npm-entry.wasm.js +455 -0
- package/factoidal.js +27560 -0
- package/factoidal.wasm.assets/code-bbe6099bfb5b10c4c3ab.wasm +0 -0
- package/factoidal.wasm.js +457 -0
- package/fn.d.ts +519 -0
- package/fn.js +916 -0
- package/hacl-init.js +92 -0
- package/hacl-wasm/FStar.wasm +0 -0
- package/hacl-wasm/Hacl_Bignum.wasm +0 -0
- package/hacl-wasm/Hacl_Bignum25519_51.wasm +0 -0
- package/hacl-wasm/Hacl_Bignum_Base.wasm +0 -0
- package/hacl-wasm/Hacl_Curve25519_51.wasm +0 -0
- package/hacl-wasm/Hacl_Ed25519.wasm +0 -0
- package/hacl-wasm/Hacl_Ed25519_PrecompTable.wasm +0 -0
- package/hacl-wasm/Hacl_Hash_Base.wasm +0 -0
- package/hacl-wasm/Hacl_Hash_SHA2.wasm +0 -0
- package/hacl-wasm/Hacl_IntTypes_Intrinsics.wasm +0 -0
- package/hacl-wasm/LowStar_Endianness.wasm +0 -0
- package/hacl-wasm/WasmSupport.wasm +0 -0
- package/hacl-wasm/api.js +775 -0
- package/hacl-wasm/api.json +3787 -0
- package/hacl-wasm/layouts.json +1 -0
- package/hacl-wasm/loader.js +568 -0
- package/hacl-wasm/shell.js +12 -0
- package/index.d.ts +1068 -0
- package/index.js +237 -0
- package/index.mjs +85 -0
- package/lib/api.js +2140 -0
- package/lib/engine-js.js +165 -0
- package/lib/engine-wasm.js +300 -0
- package/package.json +101 -0
- package/rdfjs.js +540 -0
- package/version.json +101 -0
- package/wasm.d.ts +130 -0
- package/wasm.js +158 -0
|
Binary file
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
(function(a){typeof
|
|
2
|
+
globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:true,get:b}),_T_));function
|
|
3
|
+
b(){var
|
|
4
|
+
b=this||self;b.globalThis=b;delete
|
|
5
|
+
a.prototype._T_}}(Object));($=>async a=>{"use strict";const{link:k,src:Y,generated:M,disable_effects:J}=a,h=globalThis.process?.versions?.node,U={cos:Math.cos,sin:Math.sin,tan:Math.tan,acos:Math.acos,asin:Math.asin,atan:Math.atan,cosh:Math.cosh,sinh:Math.sinh,tanh:Math.tanh,acosh:Math.acosh,asinh:Math.asinh,atanh:Math.atanh,cbrt:Math.cbrt,exp:Math.exp,expm1:Math.expm1,log:Math.log,log1p:Math.log1p,log2:Math.log2,log10:Math.log10,atan2:Math.atan2,hypot:Math.hypot,pow:Math.pow,fmod:(a,b)=>a%b},z=[Float32Array,Float64Array,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Int32Array,Int32Array,Int32Array,Float32Array,Float64Array,Uint8Array,Uint16Array,Uint8ClampedArray],f=h&&require("node:fs"),b=f?.constants,A=f?[b.R_OK,b.W_OK,b.X_OK,b.F_OK]:[],V=f?[b.O_RDONLY,b.O_WRONLY,b.O_RDWR,b.O_APPEND,b.O_CREAT,b.O_TRUNC,b.O_EXCL,b.O_NONBLOCK,b.O_NOCTTY,b.O_DSYNC,b.O_SYNC]:[];var
|
|
6
|
+
e={map:new
|
|
7
|
+
WeakMap(),set:new
|
|
8
|
+
Set(),finalization:new
|
|
9
|
+
FinalizationRegistry(a=>e.set.delete(a))};function
|
|
10
|
+
X(a){const
|
|
11
|
+
b=new
|
|
12
|
+
WeakRef(a);e.map.set(a,b);e.set.add(b);e.finalization.register(a,b,a)}function
|
|
13
|
+
Z(a){const
|
|
14
|
+
b=e.map.get(a);if(b){e.map.delete(a);e.set.delete(b);e.finalization.unregister(a)}}function
|
|
15
|
+
I(){return[...e.set].map(a=>a.deref()).filter(a=>a)}var
|
|
16
|
+
y;function
|
|
17
|
+
T(a){return WebAssembly?.Suspending?new
|
|
18
|
+
WebAssembly.Suspending(a):a}function
|
|
19
|
+
v(a){return!J&&WebAssembly?.promising&&a?WebAssembly.promising(a):a}const
|
|
20
|
+
o=new
|
|
21
|
+
TextDecoder("utf-8",{ignoreBOM:1}),K=new
|
|
22
|
+
TextEncoder();function
|
|
23
|
+
N(a,b){b=Math.imul(b,0xcc9e2d51|0);b=b<<15|b>>>17;b=Math.imul(b,0x1b873593);a^=b;a=a<<13|a>>>19;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function
|
|
24
|
+
O(a,b){for(var
|
|
25
|
+
c=0;c<b.length;c++)a=N(a,b.charCodeAt(c));return a^b.length}function
|
|
26
|
+
u(a){if(h&&globalThis.process.env[a]!==undefined)return globalThis.process.env[a];return globalThis.jsoo_env?.[a]}let
|
|
27
|
+
l=0;for(const
|
|
28
|
+
a
|
|
29
|
+
of
|
|
30
|
+
u("OCAMLRUNPARAM")?.split(",")||[]){if(a==="b")l=1;if(a.startsWith("b="))l=+a.slice(2)?1:0}function
|
|
31
|
+
n(a,b){var
|
|
32
|
+
c;if(a.isFile())c=0;else if(a.isDirectory())c=1;else if(a.isCharacterDevice())c=2;else if(a.isBlockDevice())c=3;else if(a.isSymbolicLink())c=4;else if(a.isFIFO())c=5;else if(a.isSocket())c=6;return E(b,a.dev,a.ino|0,c,a.mode,a.nlink,a.uid,a.gid,a.rdev,BigInt(a.size),a.atimeMs/1000,a.mtimeMs/1000,a.ctimeMs/1000)}const
|
|
33
|
+
w=h&&globalThis.process.platform==="win32",d=Function.prototype.call,c=DataView.prototype,B={jstag:WebAssembly.JSTag||new
|
|
34
|
+
WebAssembly.Tag({parameters:["externref"],results:[]}),identity:a=>a,from_bool:a=>!!a,get:(a,b)=>a[b],set:(a,b,c)=>a[b]=c,delete:(a,b)=>delete
|
|
35
|
+
a[b],instanceof:(a,b)=>a
|
|
36
|
+
instanceof
|
|
37
|
+
b,typeof:a=>typeof
|
|
38
|
+
a,equals:(a,b)=>a==b,strict_equals:(a,b)=>a===b,fun_call:(a,b,c)=>a.apply(b,c),meth_call:(a,b,c)=>a[b].apply(a,c),new_array:a=>new
|
|
39
|
+
Array(a),new_obj:()=>({}),new:(a,b)=>new
|
|
40
|
+
a(...b),global_this:globalThis,iter_props:(a,b)=>{for(var
|
|
41
|
+
c
|
|
42
|
+
in
|
|
43
|
+
a)if(Object.hasOwn(a,c))b(c)},array_length:a=>a.length,array_get:(a,b)=>a[b],array_set:(a,b,c)=>a[b]=c,read_string:a=>o.decode(new
|
|
44
|
+
Uint8Array(j,0,a)),read_string_stream:(a,b)=>o.decode(new
|
|
45
|
+
Uint8Array(j,0,a),{stream:b}),append_string:(a,b)=>a+b,write_string:a=>{var
|
|
46
|
+
c=0,b=a.length;for(;;){const{read:d,written:e}=K.encodeInto(a.slice(c),W);b-=d;if(!b)return e;G(e);c+=d}},ta_create:(a,b)=>new
|
|
47
|
+
z[a](b),ta_normalize:a=>a
|
|
48
|
+
instanceof
|
|
49
|
+
Uint32Array?new
|
|
50
|
+
Int32Array(a.buffer,a.byteOffset,a.length):a,ta_kind:b=>z.findIndex(a=>b
|
|
51
|
+
instanceof
|
|
52
|
+
a),ta_length:a=>a.length,ta_get_i32:(a,b)=>a[b],ta_fill:(a,b)=>a.fill(b),ta_blit:(a,b)=>b.set(a),ta_subarray:(a,b,c)=>a.subarray(b,c),ta_set:(a,b,c)=>a.set(b,c),ta_new:a=>new
|
|
53
|
+
Uint8Array(a),ta_copy:(a,b,c,d)=>a.copyWithin(b,c,d),ta_bytes:a=>new
|
|
54
|
+
Uint8Array(a.buffer,a.byteOffset,a.length*a.BYTES_PER_ELEMENT),ta_blit_from_bytes:(a,b,c,d,e)=>{for(let
|
|
55
|
+
f=0;f<e;f++)c[d+f]=C(a,b+f)},ta_blit_to_bytes:(a,b,c,d,e)=>{for(let
|
|
56
|
+
f=0;f<e;f++)D(c,d+f,a[b+f])},dv_make:a=>new
|
|
57
|
+
DataView(a.buffer,a.byteOffset,a.byteLength),dv_get_f64:d.bind(c.getFloat64),dv_get_f32:d.bind(c.getFloat32),dv_get_i64:d.bind(c.getBigInt64),dv_get_i32:d.bind(c.getInt32),dv_get_i16:d.bind(c.getInt16),dv_get_ui16:d.bind(c.getUint16),dv_get_i8:d.bind(c.getInt8),dv_get_ui8:d.bind(c.getUint8),dv_set_f64:d.bind(c.setFloat64),dv_set_f32:d.bind(c.setFloat32),dv_set_i64:d.bind(c.setBigInt64),dv_set_i32:d.bind(c.setInt32),dv_set_i16:d.bind(c.setInt16),dv_set_i8:d.bind(c.setInt8),littleEndian:new
|
|
58
|
+
Uint8Array(new
|
|
59
|
+
Uint32Array([1]).buffer)[0],wrap_callback:b=>function(...a){if(a.length===0)a=[undefined];return g(b,a.length,a,1)},wrap_callback_args:b=>function(...a){return g(b,1,[a],0)},wrap_callback_strict:(c,b)=>function(...a){a.length=c;return g(b,c,a,0)},wrap_callback_unsafe:b=>function(...a){return g(b,a.length,a,2)},wrap_meth_callback:b=>function(...a){a.unshift(this);return g(b,a.length,a,1)},wrap_meth_callback_args:b=>function(...a){return g(b,2,[this,a],0)},wrap_meth_callback_strict:(c,b)=>function(...a){a.length=c;a.unshift(this);return g(b,a.length,a,0)},wrap_meth_callback_unsafe:b=>function(...a){a.unshift(this);return g(b,a.length,a,2)},wrap_fun_arguments:b=>function(...a){return b(a)},format_float:(a,b,c,d)=>{function
|
|
60
|
+
j(a,b){if(Math.abs(a)<1.0)return a.toFixed(b);else{var
|
|
61
|
+
c=Number.parseInt(a.toString().split("+")[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new
|
|
62
|
+
Array(c+1).join("0");if(b>0)a=a+"."+new
|
|
63
|
+
Array(b+1).join("0");return a}else
|
|
64
|
+
return a.toFixed(b)}}switch(b){case
|
|
65
|
+
0:var
|
|
66
|
+
e=d.toExponential(a),f=e.length;if(e.charAt(f-3)==="e")e=e.slice(0,f-1)+"0"+e.slice(f-1);break;case
|
|
67
|
+
1:e=j(d,a);break;case
|
|
68
|
+
2:a=a?a:1;e=d.toExponential(a-1);var
|
|
69
|
+
i=e.indexOf("e"),h=+e.slice(i+1);if(h<-4||d>=1e21||d.toFixed(0).length>a){var
|
|
70
|
+
f=i-1;while(e.charAt(f)==="0")f--;if(e.charAt(f)===".")f--;e=e.slice(0,f+1)+e.slice(i);f=e.length;if(e.charAt(f-3)==="e")e=e.slice(0,f-1)+"0"+e.slice(f-1);break}else{var
|
|
71
|
+
g=a;if(h<0){g-=h+1;e=d.toFixed(g)}else
|
|
72
|
+
while(e=d.toFixed(g),e.length>a+1)g--;if(g){var
|
|
73
|
+
f=e.length-1;while(e.charAt(f)==="0")f--;if(e.charAt(f)===".")f--;e=e.slice(0,f+1)}}break}return c?" "+e:e},gettimeofday:()=>new
|
|
74
|
+
Date().getTime()/1000,times:()=>{if(globalThis.process?.cpuUsage){var
|
|
75
|
+
a=globalThis.process.cpuUsage();return q(a.user/1e6,a.system/1e6)}else{var
|
|
76
|
+
a=performance.now()/1000;return q(a,0)}},gmtime:a=>{var
|
|
77
|
+
b=new
|
|
78
|
+
Date(a*1000),c=b.getTime(),e=new
|
|
79
|
+
Date(Date.UTC(b.getUTCFullYear(),0,1)).getTime(),d=Math.floor((c-e)/86400000);return r(b.getUTCSeconds(),b.getUTCMinutes(),b.getUTCHours(),b.getUTCDate(),b.getUTCMonth(),b.getUTCFullYear()-1900,b.getUTCDay(),d,false)},localtime:a=>{var
|
|
80
|
+
b=new
|
|
81
|
+
Date(a*1000),c=b.getTime(),f=new
|
|
82
|
+
Date(b.getFullYear(),0,1).getTime(),d=Math.floor((c-f)/86400000),e=new
|
|
83
|
+
Date(b.getFullYear(),0,1),g=new
|
|
84
|
+
Date(b.getFullYear(),6,1),h=Math.max(e.getTimezoneOffset(),g.getTimezoneOffset());return r(b.getSeconds(),b.getMinutes(),b.getHours(),b.getDate(),b.getMonth(),b.getFullYear()-1900,b.getDay(),d,b.getTimezoneOffset()<h)},mktime:(a,b,c,d,e,f)=>new
|
|
85
|
+
Date(a,b,c,d,e,f).getTime(),random_seed:()=>crypto.getRandomValues(new
|
|
86
|
+
Int32Array(12)),access:(a,d)=>f.accessSync(a,A.reduce((a,b,c)=>d&1<<c?a|b:a,0)),open:(a,d,c)=>f.openSync(a,V.reduce((a,b,c)=>d&1<<c?a|b:a,0),c),close:a=>f.closeSync(a),write:(a,b,c,d,e)=>f?f.writeSync(a,b,c,d,e===null?e:Number(e)):(console[a===2?"error":"log"](typeof
|
|
87
|
+
b==="string"?b:o.decode(b.slice(c,c+d))),d),read:(a,b,c,d,e)=>f.readSync(a,b,c,d,e),fsync:a=>f.fsyncSync(a),file_size:a=>f.fstatSync(a,{bigint:true}).size,register_channel:X,unregister_channel:Z,channel_list:I,exit:a=>h&&globalThis.process.exit(a),argv:()=>h?globalThis.process.argv.slice(1):["a.out"],on_windows:+w,getenv:u,backtrace_status:()=>l,record_backtrace:a=>l=a,system:a=>{var
|
|
88
|
+
b=require("node:child_process").spawnSync(a,{shell:true,stdio:"inherit"});if(b.error)throw b.error;return b.signal?255:b.status},isatty:a=>+require("node:tty").isatty(a),time:()=>performance.now(),getcwd:()=>h?globalThis.process.cwd():"/static",chdir:a=>globalThis.process.chdir(a),mkdir:(a,b)=>f.mkdirSync(a,b),rmdir:a=>f.rmdirSync(a),link:(a,b)=>f.linkSync(a,b),symlink:(a,b,c)=>f.symlinkSync(a,b,[null,"file","dir"][c]),readlink:a=>f.readlinkSync(a),unlink:a=>f.unlinkSync(a),read_dir:a=>f.readdirSync(a),opendir:a=>f.opendirSync(a),readdir:a=>{var
|
|
89
|
+
b=a.readSync()?.name;return b===undefined?null:b},closedir:a=>a.closeSync(),stat:(a,b)=>n(f.statSync(a),b),lstat:(a,b)=>n(f.lstatSync(a),b),fstat:(a,b)=>n(f.fstatSync(a),b),chmod:(a,b)=>f.chmodSync(a,b),fchmod:(a,b)=>f.fchmodSync(a,b),file_exists:a=>+f.existsSync(a),is_directory:a=>+f.lstatSync(a).isDirectory(),is_file:a=>+f.lstatSync(a).isFile(),utimes:(a,b,c)=>f.utimesSync(a,b,c),truncate:(a,b)=>f.truncateSync(a,b),ftruncate:(a,b)=>f.ftruncateSync(a,b),rename:(a,b)=>{var
|
|
90
|
+
c;if(w&&(c=f.statSync(b,{throwIfNoEntry:false}))&&f.statSync(a,{throwIfNoEntry:false})?.isDirectory())if(c.isDirectory()){if(!b.startsWith(a))try{f.rmdirSync(b)}catch{}}else{var
|
|
91
|
+
d=new
|
|
92
|
+
Error(`ENOTDIR: not a directory, rename '${a}' -> '${b}'`);throw Object.assign(d,{errno:-20,code:"ENOTDIR",syscall:"rename",path:b})}f.renameSync(a,b)},tmpdir:()=>require("node:os").tmpdir(),start_fiber:a=>y(a),suspend_fiber:T((c,b)=>new
|
|
93
|
+
Promise(a=>c(a,b))),resume_fiber:(a,b)=>a(b),weak_new:a=>new
|
|
94
|
+
WeakRef(a),weak_deref:a=>{var
|
|
95
|
+
b=a.deref();return b===undefined?null:b},weak_map_new:()=>new
|
|
96
|
+
WeakMap(),map_new:()=>new
|
|
97
|
+
Map(),map_get:(a,b)=>{var
|
|
98
|
+
c=a.get(b);return c===undefined?null:c},map_set:(a,b,c)=>a.set(b,c),map_delete:(a,b)=>a.delete(b),hash_string:O,log:a=>console.log(a)},p={test:a=>+(typeof
|
|
99
|
+
a==="string"),compare:(a,b)=>a<b?-1:+(a>b),decodeStringFromUTF8Array:()=>"",encodeStringToUTF8Array:()=>0,fromCharCodeArray:()=>""},i=Object.assign({Math:U,bindings:B,js:$,"wasm:js-string":p,"wasm:text-decoder":p,"wasm:text-encoder":p,str:new
|
|
100
|
+
globalThis.Proxy({},{get(a,b){return b}}),env:{}},M),x={builtins:["js-string","text-decoder","text-encoder"],importedStringConstants:"str"};function
|
|
101
|
+
S(a){const
|
|
102
|
+
b=require("node:path"),c=b.join(b.dirname(require.main.filename),a);return require("node:fs/promises").readFile(c)}const
|
|
103
|
+
t=globalThis?.document?.currentScript?.src;function
|
|
104
|
+
L(a){const
|
|
105
|
+
b=t?new
|
|
106
|
+
URL(a,t):a;return fetch(b)}const
|
|
107
|
+
R=h?S:L;async function
|
|
108
|
+
Q(a){return h?WebAssembly.instantiate(await
|
|
109
|
+
a,i,x):WebAssembly.instantiateStreaming(a,i,x)}async function
|
|
110
|
+
P(){i.OCaml={};const
|
|
111
|
+
c=[];async function
|
|
112
|
+
b(a,b){const
|
|
113
|
+
f=a[1].constructor!==Array;async function
|
|
114
|
+
e(){const
|
|
115
|
+
d=R(Y+"/"+a[0]+".wasm");await
|
|
116
|
+
Promise.all(f?c:a[1].map(a=>c[a]));const
|
|
117
|
+
e=await
|
|
118
|
+
Q(d);Object.assign(b?i.env:i.OCaml,e.instance.exports)}const
|
|
119
|
+
d=e();c.push(d);return d}async function
|
|
120
|
+
a(a){for(const
|
|
121
|
+
c
|
|
122
|
+
of
|
|
123
|
+
a)await
|
|
124
|
+
b(c)}await
|
|
125
|
+
b(k[0],1);if(k.length>1){await
|
|
126
|
+
b(k[1]);const
|
|
127
|
+
c=new
|
|
128
|
+
Array(20).fill(k.slice(2).values()).map(a);await
|
|
129
|
+
Promise.all(c)}return{instance:{exports:Object.assign(i.env,i.OCaml)}}}const
|
|
130
|
+
_=await
|
|
131
|
+
P();var{caml_callback:g,caml_alloc_times:q,caml_alloc_tm:r,caml_alloc_stat:E,caml_start_fiber:H,caml_handle_uncaught_exception:s,caml_buffer:F,caml_extract_bytes:G,bytes_get:C,bytes_set:D,_initialize:m}=_.instance.exports,j=F?.buffer,W=j&&new
|
|
132
|
+
Uint8Array(j,0,j.length);y=v(H);var
|
|
133
|
+
m=v(m);if(globalThis.process?.on)globalThis.process.on("uncaughtException",(a,b)=>s(a));else if(globalThis.addEventListener)globalThis.addEventListener("error",a=>a.error&&s(a.error));await
|
|
134
|
+
m()})(function(a){"use strict";var
|
|
135
|
+
ai=a,b=["E2BIG","EACCES","EAGAIN","EBADF","EBUSY","ECHILD","EDEADLK","EDOM","EEXIST","EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV","ENOENT","ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS","ENOTDIR","ENOTEMPTY","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
|
|
136
|
+
m(a){const
|
|
137
|
+
c=require("node:util");if(a>=0){const
|
|
138
|
+
d=b[a];return c.getSystemErrorMap().entries().find(a=>a[1][0]===d)[1][1]}else
|
|
139
|
+
return c.getSystemErrorMessage(a)}function
|
|
140
|
+
p(a){return a>=0?a:-BigInt(a)}function
|
|
141
|
+
e(a){return a==BigInt.asIntN(31,a)?Number(a):a}function
|
|
142
|
+
q(a,b){return e(BigInt(a)+BigInt(b))}var
|
|
143
|
+
v="0",V=1000,j="-",l="",C="+",h=function(J){"use strict";var
|
|
144
|
+
m=1e7,i=m,ak=7,w=9007199254740992,M=s(w),W="0123456789abcdefghijklmnopqrstuvwxyz",b=ai.BigInt,I=typeof
|
|
145
|
+
b==="function";function
|
|
146
|
+
f(a,b,c,d){if(typeof
|
|
147
|
+
a==="undefined")return f[0];if(typeof
|
|
148
|
+
b!=="undefined")return+b===10&&!c?g(a):ao(a,b,c,d);return g(a)}var
|
|
149
|
+
K="_z";function
|
|
150
|
+
d(a,b){this.value=a;this.sign=b;this.isSmall=false;this.caml_custom=K}d.prototype=Object.create(f.prototype);function
|
|
151
|
+
e(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=K}e.prototype=Object.create(f.prototype);function
|
|
152
|
+
c(a){this.value=a;this.caml_custom=K}c.prototype=Object.create(f.prototype);function
|
|
153
|
+
r(a){return-w<a&&a<w}function
|
|
154
|
+
s(a){if(a<m)return[a];var
|
|
155
|
+
b=1e14;if(a<b)return[a%m,Math.floor(a/m)];return[a%m,Math.floor(a/m)%m,Math.floor(a/b)]}function
|
|
156
|
+
n(a){t(a);var
|
|
157
|
+
b=a.length;if(b<4&&o(a,M)<0)switch(b){case
|
|
158
|
+
0:return 0;case
|
|
159
|
+
1:return a[0];case
|
|
160
|
+
2:return a[0]+a[1]*i;default:return a[0]+(a[1]+a[2]*i)*i}return a}function
|
|
161
|
+
t(a){var
|
|
162
|
+
b=a.length;while(a[--b]===0);a.length=b+1}function
|
|
163
|
+
E(a){var
|
|
164
|
+
c=new
|
|
165
|
+
Array(a),b=-1;while(++b<a)c[b]=0;return c}function
|
|
166
|
+
u(a){if(a>0)return Math.floor(a);return Math.ceil(a)}function
|
|
167
|
+
X(a,b){var
|
|
168
|
+
h=a.length,j=b.length,g=new
|
|
169
|
+
Array(h),d=0,f=i,e,c;for(c=0;c<j;c++){e=a[c]+b[c]+d;d=e>=f?1:0;g[c]=e-d*f}while(c<h){e=a[c]+d;d=e===f?1:0;g[c++]=e-d*f}if(d>0)g.push(d);return g}function
|
|
170
|
+
x(a,b){if(a.length>=b.length)return X(a,b);return X(b,a)}function
|
|
171
|
+
D(a,b){var
|
|
172
|
+
g=a.length,e=new
|
|
173
|
+
Array(g),d=i,f,c;for(c=0;c<g;c++){f=a[c]-d+b;b=Math.floor(f/d);e[c]=f-b*d;b+=1}while(b>0){e[c++]=b%d;b=Math.floor(b/d)}return e}d.prototype.add=function(a){var
|
|
174
|
+
b=g(a);if(this.sign!==b.sign)return this.subtract(b.negate());var
|
|
175
|
+
c=this.value,e=b.value;if(b.isSmall)return new
|
|
176
|
+
d(D(c,Math.abs(e)),this.sign);return new
|
|
177
|
+
d(x(c,e),this.sign)};d.prototype.plus=d.prototype.add;e.prototype.add=function(a){var
|
|
178
|
+
f=g(a),b=this.value;if(b<0!==f.sign)return this.subtract(f.negate());var
|
|
179
|
+
c=f.value;if(f.isSmall){if(r(b+c))return new
|
|
180
|
+
e(b+c);c=s(Math.abs(c))}return new
|
|
181
|
+
d(D(c,Math.abs(b)),b<0)};e.prototype.plus=e.prototype.add;c.prototype.add=function(a){return new
|
|
182
|
+
c(this.value+g(a).value)};c.prototype.plus=c.prototype.add;function
|
|
183
|
+
A(a,b){var
|
|
184
|
+
g=a.length,h=b.length,e=new
|
|
185
|
+
Array(g),f=0,j=i,c,d;for(c=0;c<h;c++){d=a[c]-f-b[c];if(d<0){d+=j;f=1}else
|
|
186
|
+
f=0;e[c]=d}for(c=h;c<g;c++){d=a[c]-f;if(d<0)d+=j;else{e[c++]=d;break}e[c]=d}for(;c<g;c++)e[c]=a[c];t(e);return e}function
|
|
187
|
+
as(a,b,c){var
|
|
188
|
+
f;if(o(a,b)>=0)f=A(a,b);else{f=A(b,a);c=!c}f=n(f);if(typeof
|
|
189
|
+
f==="number"){if(c)f=-f;return new
|
|
190
|
+
e(f)}return new
|
|
191
|
+
d(f,c)}function
|
|
192
|
+
H(a,b,c){var
|
|
193
|
+
l=a.length,f=new
|
|
194
|
+
Array(l),k=-b,j=i,h,g;for(h=0;h<l;h++){g=a[h]+k;k=Math.floor(g/j);g%=j;f[h]=g<0?g+j:g}f=n(f);if(typeof
|
|
195
|
+
f==="number"){if(c)f=-f;return new
|
|
196
|
+
e(f)}return new
|
|
197
|
+
d(f,c)}d.prototype.subtract=function(a){var
|
|
198
|
+
b=g(a);if(this.sign!==b.sign)return this.add(b.negate());var
|
|
199
|
+
c=this.value,d=b.value;if(b.isSmall)return H(c,Math.abs(d),this.sign);return as(c,d,this.sign)};d.prototype.minus=d.prototype.subtract;e.prototype.subtract=function(a){var
|
|
200
|
+
c=g(a),b=this.value;if(b<0!==c.sign)return this.add(c.negate());var
|
|
201
|
+
d=c.value;if(c.isSmall)return new
|
|
202
|
+
e(b-d);return H(d,Math.abs(b),b>=0)};e.prototype.minus=e.prototype.subtract;c.prototype.subtract=function(a){return new
|
|
203
|
+
c(this.value-g(a).value)};c.prototype.minus=c.prototype.subtract;d.prototype.negate=function(){return new
|
|
204
|
+
d(this.value,!this.sign)};e.prototype.negate=function(){var
|
|
205
|
+
b=this.sign,a=new
|
|
206
|
+
e(-this.value);a.sign=!b;return a};c.prototype.negate=function(){return new
|
|
207
|
+
c(-this.value)};d.prototype.abs=function(){return new
|
|
208
|
+
d(this.value,false)};e.prototype.abs=function(){return new
|
|
209
|
+
e(Math.abs(this.value))};c.prototype.abs=function(){return new
|
|
210
|
+
c(this.value>=0?this.value:-this.value)};function
|
|
211
|
+
Q(a,b){var
|
|
212
|
+
j=a.length,l=b.length,n=j+l,e=E(n),m=i,g,f,c,h,k;for(c=0;c<j;++c){h=a[c];for(var
|
|
213
|
+
d=0;d<l;++d){k=b[d];g=h*k+e[c+d];f=Math.floor(g/m);e[c+d]=g-f*m;e[c+d+1]+=f}}t(e);return e}function
|
|
214
|
+
y(a,b){var
|
|
215
|
+
h=a.length,g=new
|
|
216
|
+
Array(h),e=i,c=0,f,d;for(d=0;d<h;d++){f=a[d]*b+c;c=Math.floor(f/e);g[d]=f-c*e}while(c>0){g[d++]=c%e;c=Math.floor(c/e)}return g}function
|
|
217
|
+
ae(a,b){var
|
|
218
|
+
c=[];while(b--
|
|
219
|
+
>0)c.push(0);return c.concat(a)}function
|
|
220
|
+
F(a,b){var
|
|
221
|
+
c=Math.max(a.length,b.length);if(c<=30)return Q(a,b);c=Math.ceil(c/2);var
|
|
222
|
+
f=a.slice(c),d=a.slice(0,c),i=b.slice(c),h=b.slice(0,c),e=F(d,h),g=F(f,i),k=F(x(d,f),x(h,i)),j=x(x(e,ae(A(A(k,e),g),c)),ae(g,2*c));t(j);return j}function
|
|
223
|
+
at(a,b){var
|
|
224
|
+
c=0.012;return-c*a-c*b+0.000015*a*b>0}d.prototype.multiply=function(a){var
|
|
225
|
+
h=g(a),c=this.value,b=h.value,j=this.sign!==h.sign,e;if(h.isSmall){if(b===0)return f[0];if(b===1)return this;if(b===-1)return this.negate();e=Math.abs(b);if(e<i)return new
|
|
226
|
+
d(y(c,e),j);b=s(e)}if(at(c.length,b.length))return new
|
|
227
|
+
d(F(c,b),j);return new
|
|
228
|
+
d(Q(c,b),j)};d.prototype.times=d.prototype.multiply;function
|
|
229
|
+
ab(a,b,c){if(a<i)return new
|
|
230
|
+
d(y(b,a),c);return new
|
|
231
|
+
d(Q(b,s(a)),c)}e.prototype._multiplyBySmall=function(a){if(r(a.value*this.value))return new
|
|
232
|
+
e(a.value*this.value);return ab(Math.abs(a.value),s(Math.abs(this.value)),this.sign!==a.sign)};d.prototype._multiplyBySmall=function(a){if(a.value===0)return f[0];if(a.value===1)return this;if(a.value===-1)return this.negate();return ab(Math.abs(a.value),this.value,this.sign!==a.sign)};e.prototype.multiply=function(a){return g(a)._multiplyBySmall(this)};e.prototype.times=e.prototype.multiply;c.prototype.multiply=function(a){return new
|
|
233
|
+
c(this.value*g(a).value)};c.prototype.times=c.prototype.multiply;function
|
|
234
|
+
ag(a){var
|
|
235
|
+
e=a.length,f=E(e+e),k=i,h,c,b,g,j;for(b=0;b<e;b++){g=a[b];c=0-g*g;for(var
|
|
236
|
+
d=b;d<e;d++){j=a[d];h=2*(g*j)+f[b+d]+c;c=Math.floor(h/k);f[b+d]=h-c*k}f[b+e]=c}t(f);return f}d.prototype.square=function(){return new
|
|
237
|
+
d(ag(this.value),false)};e.prototype.square=function(){var
|
|
238
|
+
a=this.value*this.value;if(r(a))return new
|
|
239
|
+
e(a);return new
|
|
240
|
+
d(ag(s(Math.abs(this.value))),false)};c.prototype.square=function(a){return new
|
|
241
|
+
c(this.value*this.value)};function
|
|
242
|
+
al(a,b){var
|
|
243
|
+
r=a.length,j=b.length,h=i,s=E(b.length),m=b[j-1],p=Math.ceil(h/(2*m)),d=y(a,p),k=y(b,p),l,f,e,g,c,o,q;if(d.length<=r)d.push(0);k.push(0);m=k[j-1];for(f=r-j;f>=0;f--){l=h-1;if(d[f+j]!==m)l=Math.floor((d[f+j]*h+d[f+j-1])/m);e=0;g=0;o=k.length;for(c=0;c<o;c++){e+=l*k[c];q=Math.floor(e/h);g+=d[f+c]-(e-q*h);e=q;if(g<0){d[f+c]=g+h;g=-1}else{d[f+c]=g;g=0}}while(g!==0){l-=1;e=0;for(c=0;c<o;c++){e+=d[f+c]-h+k[c];if(e<0){d[f+c]=e+h;e=0}else{d[f+c]=e;e=1}}g+=e}s[f]=l}d=Y(d,p)[0];return[n(s),n(d)]}function
|
|
244
|
+
am(a,b){var
|
|
245
|
+
l=a.length,h=b.length,f=[],c=[],j=i,d,g,e,m,k;while(l){c.unshift(a[--l]);t(c);if(o(c,b)<0){f.push(0);continue}g=c.length;e=c[g-1]*j+c[g-2];m=b[h-1]*j+b[h-2];if(g>h)e=(e+1)*j;d=Math.ceil(e/m);do{k=y(b,d);if(o(k,c)<=0)break;d--}while(d);f.push(d);c=A(c,k)}f.reverse();return[n(f),n(c)]}function
|
|
246
|
+
Y(a,b){var
|
|
247
|
+
g=a.length,h=E(g),j=i,c,f,d,e;d=0;for(c=g-1;c>=0;--c){e=d*j+a[c];f=u(e/b);d=e-f*b;h[c]=f|0}return[h,d|0]}function
|
|
248
|
+
p(a,b){var
|
|
249
|
+
p,k=g(b);if(I)return[new
|
|
250
|
+
c(a.value/k.value),new
|
|
251
|
+
c(a.value%k.value)];var
|
|
252
|
+
m=a.value,j=k.value,h;if(j===0)throw new
|
|
253
|
+
Error("Cannot divide by zero");if(a.isSmall){if(k.isSmall)return[new
|
|
254
|
+
e(u(m/j)),new
|
|
255
|
+
e(m%j)];return[f[0],a]}if(k.isSmall){if(j===1)return[a,f[0]];if(j==-1)return[a.negate(),f[0]];var
|
|
256
|
+
r=Math.abs(j);if(r<i){p=Y(m,r);h=n(p[0]);var
|
|
257
|
+
q=p[1];if(a.sign)q=-q;if(typeof
|
|
258
|
+
h==="number"){if(a.sign!==k.sign)h=-h;return[new
|
|
259
|
+
e(h),new
|
|
260
|
+
e(q)]}return[new
|
|
261
|
+
d(h,a.sign!==k.sign),new
|
|
262
|
+
e(q)]}j=s(r)}var
|
|
263
|
+
t=o(m,j);if(t===-1)return[f[0],a];if(t===0)return[f[a.sign===k.sign?1:-1],f[0]];if(m.length+j.length<=200)p=al(m,j);else
|
|
264
|
+
p=am(m,j);h=p[0];var
|
|
265
|
+
w=a.sign!==k.sign,l=p[1],v=a.sign;if(typeof
|
|
266
|
+
h==="number"){if(w)h=-h;h=new
|
|
267
|
+
e(h)}else
|
|
268
|
+
h=new
|
|
269
|
+
d(h,w);if(typeof
|
|
270
|
+
l==="number"){if(v)l=-l;l=new
|
|
271
|
+
e(l)}else
|
|
272
|
+
l=new
|
|
273
|
+
d(l,v);return[h,l]}d.prototype.divmod=function(a){var
|
|
274
|
+
b=p(this,a);return{quotient:b[0],remainder:b[1]}};c.prototype.divmod=e.prototype.divmod=d.prototype.divmod;d.prototype.divide=function(a){return p(this,a)[0]};c.prototype.over=c.prototype.divide=function(a){return new
|
|
275
|
+
c(this.value/g(a).value)};e.prototype.over=e.prototype.divide=d.prototype.over=d.prototype.divide;d.prototype.mod=function(a){return p(this,a)[1]};c.prototype.mod=c.prototype.remainder=function(a){return new
|
|
276
|
+
c(this.value%g(a).value)};e.prototype.remainder=e.prototype.mod=d.prototype.remainder=d.prototype.mod;d.prototype.pow=function(a){var
|
|
277
|
+
c=g(a),d=this.value,b=c.value,j,h,i;if(b===0)return f[1];if(d===0)return f[0];if(d===1)return f[1];if(d===-1)return c.isEven()?f[1]:f[-1];if(c.sign)return f[0];if(!c.isSmall)throw new
|
|
278
|
+
Error("The exponent "+c.toString()+" is too large.");if(this.isSmall)if(r(j=Math.pow(d,b)))return new
|
|
279
|
+
e(u(j));h=this;i=f[1];while(true){if(b&1===1){i=i.times(h);--b}if(b===0)break;b/=2;h=h.square()}return i};e.prototype.pow=d.prototype.pow;c.prototype.pow=function(a){var
|
|
280
|
+
j=g(a),i=this.value,d=j.value,e=b(0),h=b(1),m=b(2);if(d===e)return f[1];if(i===e)return f[0];if(i===h)return f[1];if(i===b(-1))return j.isEven()?f[1]:f[-1];if(j.isNegative())return new
|
|
281
|
+
c(e);var
|
|
282
|
+
k=this,l=f[1];while(true){if((d&h)===h){l=l.times(k);--d}if(d===e)break;d/=m;k=k.square()}return l};d.prototype.modPow=function(a,b){a=g(a);b=g(b);if(b.isZero())throw new
|
|
283
|
+
Error("Cannot take modPow with modulus 0");var
|
|
284
|
+
d=f[1],c=this.mod(b);if(a.isNegative()){a=a.multiply(f[-1]);c=c.modInv(b)}while(a.isPositive()){if(c.isZero())return f[0];if(a.isOdd())d=d.multiply(c).mod(b);a=a.divide(2);c=c.square().mod(b)}return d};c.prototype.modPow=e.prototype.modPow=d.prototype.modPow;function
|
|
285
|
+
o(a,b){if(a.length!==b.length)return a.length>b.length?1:-1;for(var
|
|
286
|
+
c=a.length-1;c>=0;c--)if(a[c]!==b[c])return a[c]>b[c]?1:-1;return 0}d.prototype.compareAbs=function(a){var
|
|
287
|
+
b=g(a),c=this.value,d=b.value;if(b.isSmall)return 1;return o(c,d)};e.prototype.compareAbs=function(a){var
|
|
288
|
+
d=g(a),c=Math.abs(this.value),b=d.value;if(d.isSmall){b=Math.abs(b);return c===b?0:c>b?1:-1}return-1};c.prototype.compareAbs=function(a){var
|
|
289
|
+
b=this.value,c=g(a).value;b=b>=0?b:-b;c=c>=0?c:-c;return b===c?0:b>c?1:-1};d.prototype.compare=function(a){if(a===Infinity)return-1;if(a===-Infinity)return 1;var
|
|
290
|
+
b=g(a),c=this.value,d=b.value;if(this.sign!==b.sign)return b.sign?1:-1;if(b.isSmall)return this.sign?-1:1;return o(c,d)*(this.sign?-1:1)};d.prototype.compareTo=d.prototype.compare;e.prototype.compare=function(a){if(a===Infinity)return-1;if(a===-Infinity)return 1;var
|
|
291
|
+
c=g(a),b=this.value,d=c.value;if(c.isSmall)return b==d?0:b>d?1:-1;if(b<0!==c.sign)return b<0?-1:1;return b<0?1:-1};e.prototype.compareTo=e.prototype.compare;c.prototype.compare=function(a){if(a===Infinity)return-1;if(a===-Infinity)return 1;var
|
|
292
|
+
b=this.value,c=g(a).value;return b===c?0:b>c?1:-1};c.prototype.compareTo=c.prototype.compare;d.prototype.equals=function(a){return this.compare(a)===0};c.prototype.eq=c.prototype.equals=e.prototype.eq=e.prototype.equals=d.prototype.eq=d.prototype.equals;d.prototype.notEquals=function(a){return this.compare(a)!==0};c.prototype.neq=c.prototype.notEquals=e.prototype.neq=e.prototype.notEquals=d.prototype.neq=d.prototype.notEquals;d.prototype.greater=function(a){return this.compare(a)>0};c.prototype.gt=c.prototype.greater=e.prototype.gt=e.prototype.greater=d.prototype.gt=d.prototype.greater;d.prototype.lesser=function(a){return this.compare(a)<0};c.prototype.lt=c.prototype.lesser=e.prototype.lt=e.prototype.lesser=d.prototype.lt=d.prototype.lesser;d.prototype.greaterOrEquals=function(a){return this.compare(a)>=0};c.prototype.geq=c.prototype.greaterOrEquals=e.prototype.geq=e.prototype.greaterOrEquals=d.prototype.geq=d.prototype.greaterOrEquals;d.prototype.lesserOrEquals=function(a){return this.compare(a)<=0};c.prototype.leq=c.prototype.lesserOrEquals=e.prototype.leq=e.prototype.lesserOrEquals=d.prototype.leq=d.prototype.lesserOrEquals;d.prototype.isEven=function(){return(this.value[0]&1)===0};e.prototype.isEven=function(){return(this.value&1)===0};c.prototype.isEven=function(){return(this.value&b(1))===b(0)};d.prototype.isOdd=function(){return(this.value[0]&1)===1};e.prototype.isOdd=function(){return(this.value&1)===1};c.prototype.isOdd=function(){return(this.value&b(1))===b(1)};d.prototype.isPositive=function(){return!this.sign};e.prototype.isPositive=function(){return this.value>0};c.prototype.isPositive=e.prototype.isPositive;d.prototype.isNegative=function(){return this.sign};e.prototype.isNegative=function(){return this.value<0};c.prototype.isNegative=e.prototype.isNegative;d.prototype.isUnit=function(){return false};e.prototype.isUnit=function(){return Math.abs(this.value)===1};c.prototype.isUnit=function(){return this.abs().value===b(1)};d.prototype.isZero=function(){return false};e.prototype.isZero=function(){return this.value===0};c.prototype.isZero=function(){return this.value===b(0)};d.prototype.isDivisibleBy=function(a){var
|
|
293
|
+
b=g(a);if(b.isZero())return false;if(b.isUnit())return true;if(b.compareAbs(2)===0)return this.isEven();return this.mod(b).isZero()};c.prototype.isDivisibleBy=e.prototype.isDivisibleBy=d.prototype.isDivisibleBy;function
|
|
294
|
+
$(a){var
|
|
295
|
+
b=a.abs();if(b.isUnit())return false;if(b.equals(2)||b.equals(3)||b.equals(5))return true;if(b.isEven()||b.isDivisibleBy(3)||b.isDivisibleBy(5))return false;if(b.lesser(49))return true}function
|
|
296
|
+
O(a,b){var
|
|
297
|
+
g=a.prev(),e=g,i=0,f,j,d,c;while(e.isEven())e=e.divide(2),i++;a:for(d=0;d<b.length;d++){if(a.lesser(b[d]))continue;c=h(b[d]).modPow(e,a);if(c.isUnit()||c.equals(g))continue;for(f=i-1;f!=0;f--){c=c.square().mod(a);if(c.isUnit())return false;if(c.equals(g))continue a}return false}return true}d.prototype.isPrime=function(a){var
|
|
298
|
+
f=$(this);if(f!==J)return f;var
|
|
299
|
+
c=this.abs(),e=c.bitLength();if(e<=64)return O(c,[2,3,5,7,11,13,17,19,23,29,31,37]);var
|
|
300
|
+
g=Math.log(2)*e.toJSNumber(),i=Math.ceil(a===true?2*Math.pow(g,2):g);for(var
|
|
301
|
+
d=[],b=0;b<i;b++)d.push(h(b+2));return O(c,d)};c.prototype.isPrime=e.prototype.isPrime=d.prototype.isPrime;d.prototype.isProbablePrime=function(a){var
|
|
302
|
+
d=$(this);if(d!==J)return d;var
|
|
303
|
+
e=this.abs(),f=a===J?5:a;for(var
|
|
304
|
+
b=[],c=0;c<f;c++)b.push(h.randBetween(2,e.minus(2)));return O(e,b)};c.prototype.isProbablePrime=e.prototype.isProbablePrime=d.prototype.isProbablePrime;d.prototype.modInv=function(a){var
|
|
305
|
+
b=h.zero,e=h.one,d=g(a),c=this.abs(),f,j,i;while(!c.isZero()){f=d.divide(c);j=b;i=d;b=e;d=c;e=j.subtract(f.multiply(e));c=i.subtract(f.multiply(c))}if(!d.isUnit())throw new
|
|
306
|
+
Error(this.toString()+" and "+a.toString()+" are not co-prime");if(b.compare(0)===-1)b=b.add(a);if(this.isNegative())return b.negate();return b};c.prototype.modInv=e.prototype.modInv=d.prototype.modInv;d.prototype.next=function(){var
|
|
307
|
+
a=this.value;if(this.sign)return H(a,1,this.sign);return new
|
|
308
|
+
d(D(a,1),this.sign)};e.prototype.next=function(){var
|
|
309
|
+
a=this.value;if(a+1<w)return new
|
|
310
|
+
e(a+1);return new
|
|
311
|
+
d(M,false)};c.prototype.next=function(){return new
|
|
312
|
+
c(this.value+b(1))};d.prototype.prev=function(){var
|
|
313
|
+
a=this.value;if(this.sign)return new
|
|
314
|
+
d(D(a,1),true);return H(a,1,this.sign)};e.prototype.prev=function(){var
|
|
315
|
+
a=this.value;if(a-1>-w)return new
|
|
316
|
+
e(a-1);return new
|
|
317
|
+
d(M,true)};c.prototype.prev=function(){return new
|
|
318
|
+
c(this.value-b(1))};var
|
|
319
|
+
k=[1];while(2*k[k.length-1]<=i)k.push(2*k[k.length-1]);var
|
|
320
|
+
z=k.length,q=k[z-1];function
|
|
321
|
+
af(a){return Math.abs(a)<=i}var
|
|
322
|
+
T=" is too large for shifting.";d.prototype.shiftLeft=function(a){var
|
|
323
|
+
b=g(a).toJSNumber();if(!af(b))throw new
|
|
324
|
+
Error(String(b)+T);if(b<0)return this.shiftRight(-b);var
|
|
325
|
+
c=this;if(c.isZero())return c;while(b>=z){c=c.multiply(q);b-=z-1}return c.multiply(k[b])};c.prototype.shiftLeft=e.prototype.shiftLeft=d.prototype.shiftLeft;d.prototype.shiftRight=function(a){var
|
|
326
|
+
b,c=g(a).toJSNumber();if(!af(c))throw new
|
|
327
|
+
Error(String(c)+T);if(c<0)return this.shiftLeft(-c);var
|
|
328
|
+
d=this;while(c>=z){if(d.isZero()||d.isNegative()&&d.isUnit())return d;b=p(d,q);d=b[1].isNegative()?b[0].prev():b[0];c-=z-1}b=p(d,k[c]);return b[1].isNegative()?b[0].prev():b[0]};c.prototype.shiftRight=e.prototype.shiftRight=d.prototype.shiftRight;function
|
|
329
|
+
N(a,b,c){b=g(b);var
|
|
330
|
+
m=a.isNegative(),r=b.isNegative(),l=m?a.not():a,o=r?b.not():b,d=0,e=0,k=null,n=null,i=[];while(!l.isZero()||!o.isZero()){k=p(l,q);d=k[1].toJSNumber();if(m)d=q-1-d;n=p(o,q);e=n[1].toJSNumber();if(r)e=q-1-e;l=k[0];o=n[0];i.push(c(d,e))}var
|
|
331
|
+
j=c(m?1:0,r?1:0)!==0?h(-1):h(0);for(var
|
|
332
|
+
f=i.length-1;f>=0;f-=1)j=j.multiply(q).add(h(i[f]));return j}d.prototype.not=function(){return this.negate().prev()};c.prototype.not=e.prototype.not=d.prototype.not;d.prototype.and=function(a){return N(this,a,function(a,b){return a&b})};c.prototype.and=e.prototype.and=d.prototype.and;d.prototype.or=function(a){return N(this,a,function(a,b){return a|b})};c.prototype.or=e.prototype.or=d.prototype.or;d.prototype.xor=function(a){return N(this,a,function(a,b){return a^b})};c.prototype.xor=e.prototype.xor=d.prototype.xor;var
|
|
333
|
+
L=1<<30,aj=(i&-i)*(i&-i)|L;function
|
|
334
|
+
G(a){var
|
|
335
|
+
c=a.value,d=typeof
|
|
336
|
+
c==="number"?c|L:typeof
|
|
337
|
+
c==="bigint"?c|b(L):c[0]+c[1]*i|aj;return d&-d}function
|
|
338
|
+
_(a,b){if(b.compareTo(a)<=0){var
|
|
339
|
+
f=_(a,b.square(b)),d=f.p,c=f.e,e=d.multiply(b);return e.compareTo(a)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:h(1),e:0}}d.prototype.bitLength=function(){var
|
|
340
|
+
a=this;if(a.compareTo(h(0))<0)a=a.negate().subtract(h(1));if(a.compareTo(h(0))===0)return h(0);return h(_(a,h(2)).e).add(h(1))};c.prototype.bitLength=e.prototype.bitLength=d.prototype.bitLength;function
|
|
341
|
+
aa(a,b){a=g(a);b=g(b);return a.greater(b)?a:b}function
|
|
342
|
+
P(a,b){a=g(a);b=g(b);return a.lesser(b)?a:b}function
|
|
343
|
+
Z(a,b){a=g(a).abs();b=g(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var
|
|
344
|
+
c=f[1],d,e;while(a.isEven()&&b.isEven()){d=P(G(a),G(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven())a=a.divide(G(a));do{while(b.isEven())b=b.divide(G(b));if(a.greater(b)){e=b;b=a;a=e}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function
|
|
345
|
+
an(a,b){a=g(a).abs();b=g(b).abs();return a.divide(Z(a,b)).multiply(b)}function
|
|
346
|
+
aq(a,b){a=g(a);b=g(b);var
|
|
347
|
+
d=P(a,b),n=aa(a,b),e=n.subtract(d).add(1);if(e.isSmall)return d.add(Math.floor(Math.random()*e));var
|
|
348
|
+
j=B(e,i).value,l=[],k=true;for(var
|
|
349
|
+
c=0;c<j.length;c++){var
|
|
350
|
+
m=k?j[c]:i,h=u(Math.random()*m);l.push(h);if(h<m)k=false}return d.add(f.fromArray(l,i,false))}var
|
|
351
|
+
U=">",S=".",R="<";function
|
|
352
|
+
ao(a,b,c,d){c=c||W;a=String(a);if(!d){a=a.toLowerCase();c=c.toLowerCase()}var
|
|
353
|
+
m=a.length,e,k=Math.abs(b),h={};for(e=0;e<c.length;e++)h[c[e]]=e;for(e=0;e<m;e++){var
|
|
354
|
+
f=a[e];if(f===j)continue;if(f
|
|
355
|
+
in
|
|
356
|
+
h)if(h[f]>=k){if(f==="1"&&k===1)continue;throw new
|
|
357
|
+
Error(f+" is not a valid digit in base "+b+S)}}b=g(b);var
|
|
358
|
+
i=[],l=a[0]===j;for(e=l?1:0;e<a.length;e++){var
|
|
359
|
+
f=a[e];if(f
|
|
360
|
+
in
|
|
361
|
+
h)i.push(g(h[f]));else if(f===R){var
|
|
362
|
+
n=e;do
|
|
363
|
+
e++;while(a[e]!==U&&e<a.length);i.push(g(a.slice(n+1,e)))}else
|
|
364
|
+
throw new
|
|
365
|
+
Error(f+" is not a valid character")}return ac(i,b,l)}function
|
|
366
|
+
ac(a,b,c){var
|
|
367
|
+
e=f[0],g=f[1],d;for(d=a.length-1;d>=0;d--){e=e.add(a[d].times(g));g=g.times(b)}return c?e.negate():e}function
|
|
368
|
+
ar(a,b){b=b||W;if(a<b.length)return b[a];return R+a+U}function
|
|
369
|
+
B(a,b){b=h(b);if(b.isZero()){if(a.isZero())return{value:[0],isNegative:false};throw new
|
|
370
|
+
Error("Cannot convert nonzero numbers to base 0.")}if(b.equals(-1)){if(a.isZero())return{value:[0],isNegative:false};if(a.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-a.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:false};var
|
|
371
|
+
i=Array.apply(null,Array(a.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);i.unshift([1]);return{value:[].concat.apply([],i),isNegative:false}}var
|
|
372
|
+
f=false;if(a.isNegative()&&b.isPositive()){f=true;a=a.abs()}if(b.isUnit()){if(a.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(a.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:f}}var
|
|
373
|
+
g=[],c=a,e;while(c.isNegative()||c.compareAbs(b)>=0){e=c.divmod(b);c=e.quotient;var
|
|
374
|
+
d=e.remainder;if(d.isNegative()){d=b.minus(d).abs();c=c.next()}g.push(d.toJSNumber())}g.push(c.toJSNumber());return{value:g.reverse(),isNegative:f}}function
|
|
375
|
+
ah(a,b,c){var
|
|
376
|
+
d=B(a,b);return(d.isNegative?j:l)+d.value.map(function(a){return ar(a,c)}).join(l)}d.prototype.toArray=function(a){return B(this,a)};e.prototype.toArray=function(a){return B(this,a)};c.prototype.toArray=function(a){return B(this,a)};d.prototype.toString=function(a,b){if(a===J)a=10;if(a!==10)return ah(this,a,b);var
|
|
377
|
+
e=this.value,d=e.length,f=String(e[--d]),h="0000000",c;while(--d>=0){c=String(e[d]);f+=h.slice(c.length)+c}var
|
|
378
|
+
g=this.sign?j:l;return g+f};e.prototype.toString=function(a,b){if(a===J)a=10;if(a!=10)return ah(this,a,b);return String(this.value)};c.prototype.toString=e.prototype.toString;c.prototype.toJSON=d.prototype.toJSON=e.prototype.toJSON=function(){return this.toString()};d.prototype.valueOf=function(){return parseInt(this.toString(),10)};d.prototype.toJSNumber=d.prototype.valueOf;e.prototype.valueOf=function(){return this.value};e.prototype.toJSNumber=e.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function
|
|
379
|
+
ad(a){var
|
|
380
|
+
i="Invalid integer: ";if(r(+a)){var
|
|
381
|
+
n=+a;if(n===u(n))return I?new
|
|
382
|
+
c(b(n)):new
|
|
383
|
+
e(n);throw new
|
|
384
|
+
Error(i+a)}var
|
|
385
|
+
q=a[0]===j;if(q)a=a.slice(1);var
|
|
386
|
+
h=a.split(/e/i);if(h.length>2)throw new
|
|
387
|
+
Error(i+h.join("e"));if(h.length===2){var
|
|
388
|
+
f=h[1];if(f[0]===C)f=f.slice(1);f=+f;if(f!==u(f)||!r(f))throw new
|
|
389
|
+
Error(i+f+" is not a valid exponent.");var
|
|
390
|
+
g=h[0],k=g.indexOf(S);if(k>=0){f-=g.length-k-1;g=g.slice(0,k)+g.slice(k+1)}if(f<0)throw new
|
|
391
|
+
Error("Cannot include negative exponent part for integers");g+=new
|
|
392
|
+
Array(f+1).join(v);a=g}var
|
|
393
|
+
s=/^([0-9][0-9]*)$/.test(a);if(!s)throw new
|
|
394
|
+
Error(i+a);if(I)return new
|
|
395
|
+
c(b(q?j+a:a));var
|
|
396
|
+
p=[],l=a.length,o=ak,m=l-o;while(l>0){p.push(+a.slice(m,l));m-=o;if(m<0)m=0;l-=o}t(p);return new
|
|
397
|
+
d(p,q)}function
|
|
398
|
+
ap(a){if(I)return new
|
|
399
|
+
c(b(a));if(r(a)){if(a!==u(a))throw new
|
|
400
|
+
Error(a+" is not an integer.");return new
|
|
401
|
+
e(a)}return ad(a.toString())}function
|
|
402
|
+
g(a){if(typeof
|
|
403
|
+
a==="number")return ap(a);if(typeof
|
|
404
|
+
a==="string")return ad(a);if(typeof
|
|
405
|
+
a==="bigint")return new
|
|
406
|
+
c(a);return a}for(var
|
|
407
|
+
a=0;a<V;a++){f[a]=g(a);if(a>0)f[-a]=g(-a)}f.one=f[1];f.zero=f[0];f.minusOne=f[-1];f.max=aa;f.min=P;f.gcd=Z;f.lcm=an;f.isInstance=function(a){return a
|
|
408
|
+
instanceof
|
|
409
|
+
d||a
|
|
410
|
+
instanceof
|
|
411
|
+
e||a
|
|
412
|
+
instanceof
|
|
413
|
+
c};f.randBetween=aq;f.fromArray=function(a,b,c){return ac(a.map(g),g(b||10),c)};return f}();function
|
|
414
|
+
i(a){throw a}var
|
|
415
|
+
g=[0];function
|
|
416
|
+
k(){i(g.Division_by_zero)}function
|
|
417
|
+
d(a){var
|
|
418
|
+
b=a.toJSNumber()|0;if(a.equals(h(b)))return b;return a}function
|
|
419
|
+
c(a,b){b=h(b);if(b.equals(h(0)))k();return d(h(a).divide(h(b)))}function
|
|
420
|
+
n(a,b){return d(h(a).add(h(b)))}function
|
|
421
|
+
r(a,b){if(a==0)return 0;if(a>0==b>0)if(BigInt(a)%BigInt(b)!=0)return n(c(a,b),1n);return c(a,b)}function
|
|
422
|
+
s(a,b){return(a>b)-(a<b)}function
|
|
423
|
+
t(a,b,c,d){var
|
|
424
|
+
f=0n;for(var
|
|
425
|
+
g=0;g<d/4;g++){var
|
|
426
|
+
e=BigInt(a(b));e|=BigInt(a(b))<<8n;e|=BigInt(a(b))<<16n;e|=BigInt(a(b))<<24n;f|=e<<BigInt(32*g)}if(c)f=-f;return f}function
|
|
427
|
+
u(a,b){return a==b}function
|
|
428
|
+
o(a,b){return d(h(a).subtract(h(b)))}function
|
|
429
|
+
w(a,b){if(a==0)return 0;if(a>0!=b>0)if(BigInt(a)%BigInt(b)!=0)return o(c(a,b),1n);return c(a,b)}function
|
|
430
|
+
x(a,b){b=BigInt(b);var
|
|
431
|
+
h=10,o=0,k=0,g=0,n=0,i=l,m=" ",f=m,d=0,e=l;while(a[d]=="%")d++;for(;;d++)if(a[d]=="#")g=1;else if(a[d]==v)f=v;else if(a[d]==j)n=1;else if(a[d]==m||a[d]==C)i=a[d];else
|
|
432
|
+
break;if(b<0){i=j;b=-b}for(;a[d]>=v&&a[d]<="9";d++)k=10*k+
|
|
433
|
+
+a[d];switch(a[d]){case"i":case"d":case"u":break;case"b":h=2;if(g)e="0b";break;case"o":h=8;if(g)e="0o";break;case"x":h=16;if(g)e="0x";break;case"X":h=16;if(g)e="0X";o=1;break;default:return-1}if(n)f=m;var
|
|
434
|
+
c=b.toString(h);if(o===1)c=c.toUpperCase();var
|
|
435
|
+
q=c.length;if(f==m)if(n){c=i+e+c;for(;c.length<k;)c=c+f}else{c=i+e+c;for(;c.length<k;)c=f+c}else{var
|
|
436
|
+
p=i+e;for(;c.length+p.length<k;)c=f+c;c=p+c}return c}var
|
|
437
|
+
f=32n;function
|
|
438
|
+
y(a,b){b=BigInt(b);var
|
|
439
|
+
e=b<0;if(e)b=-b;var
|
|
440
|
+
d=0,c=0;while(b){d++;c=a(c,Number(BigInt.asIntN(32,b)));b>>=f}if(d&1)c=a(c,0);if(e)c++;return c}function
|
|
441
|
+
z(a,b){return e(BigInt(a)*BigInt(b))}function
|
|
442
|
+
A(a){return e(-BigInt(a))}function
|
|
443
|
+
B(a,b){if(a==0){a=10;var
|
|
444
|
+
c=0,k=1;if(b[c]==j){k=-1;c++}else if(b[c]==C)c++;if(b[c]==v){c++;if(b.length==c)return 0;else{var
|
|
445
|
+
f=b[c];if(f=="o"||f=="O")a=8;else if(f=="x"||f=="X")a=16;else if(f=="b"||f=="B")a=2;if(a!=10){b=b.substring(c+1);if(k==-1)b=j+b}}}}function
|
|
446
|
+
n(a){if(a>=48&&a<=57)return a-48;if(a>=97&&a<=102)return a-97+10;if(a>=65&&a<=70)return a-65+10;return V}var
|
|
447
|
+
i=false,d=0;if(b[d]==C)b=b.substring(1);else if(b[d]==j){i=true;d++}if(b[d]=="_")return null;b=b.replace(/_/g,l);if(b==j||b==l)b=v;var
|
|
448
|
+
g=0n,m=BigInt(a);for(;d<b.length;d++){var
|
|
449
|
+
h=n(b.charCodeAt(d));if(h>=a)return null;g=g*m+BigInt(h)}if(i)g=-g;return e(g)}function
|
|
450
|
+
D(a){return a>=0}function
|
|
451
|
+
E(a,b){return e(BigInt(a)%BigInt(b))}function
|
|
452
|
+
F(a,b,c){if(c<0)c=-c;do{var
|
|
453
|
+
d=Number(BigInt.asIntN(32,c));a(b,d);a(b,d>>>8);a(b,d>>>16);a(b,d>>>24);c>>=f}while(c)}function
|
|
454
|
+
G(a){if(a<0)a=-a;var
|
|
455
|
+
b=0,c=1n;while(c<=a){b+=1;c<<=f}return b}function
|
|
456
|
+
H(a,b){return e(BigInt(a)-BigInt(b))}return{wasm_z_sub:H,wasm_z_size:G,wasm_z_serialize:F,wasm_z_rem:E,wasm_z_positive:D,wasm_z_of_js_string_base:B,wasm_z_neg:A,wasm_z_mul:z,wasm_z_hash:y,wasm_z_format:x,wasm_z_fdiv:w,wasm_z_equal:u,wasm_z_deserialize:t,wasm_z_compare:s,wasm_z_cdiv:r,wasm_z_add:q,wasm_z_abs:p,unix_error:b,caml_strerror:m}}(globalThis))({"link":[["code-bbe6099bfb5b10c4c3ab",0]],"generated":(a=>{var
|
|
457
|
+
b=a,c=a?.module?.export||a;return{"env":{"unix_getpid":(...a)=>a[0]!==undefined?a[0]:0,"uint64_max_int":(...a)=>a[0]!==undefined?a[0]:0,"int128_of_int":(...a)=>a[0]!==undefined?a[0]:0,"unix_execvp":(...a)=>a[0]!==undefined?a[0]:0,"uint64_of_int":(...a)=>a[0]!==undefined?a[0]:0,"uint128_of_int":(...a)=>a[0]!==undefined?a[0]:0,"int56_of_int":(...a)=>a[0]!==undefined?a[0]:0,"int48_of_int":(...a)=>a[0]!==undefined?a[0]:0,"int40_of_int":(...a)=>a[0]!==undefined?a[0]:0,"unix_waitpid":(...a)=>a[0]!==undefined?a[0]:0,"unix_spawn":(...a)=>a[0]!==undefined?a[0]:0,"unix_set_close_on_exec":(...a)=>a[0]!==undefined?a[0]:0,"unix_pipe":(...a)=>a[0]!==undefined?a[0]:0,"unix_dup":(...a)=>a[0]!==undefined?a[0]:0,"uint64_init_custom_ops":(...a)=>a[0]!==undefined?a[0]:0,"uint56_of_int":(...a)=>a[0]!==undefined?a[0]:0,"uint48_of_int":(...a)=>a[0]!==undefined?a[0]:0,"uint40_of_int":(...a)=>a[0]!==undefined?a[0]:0,"uint128_max_int":(...a)=>a[0]!==undefined?a[0]:0,"uint128_init_custom_ops":(...a)=>a[0]!==undefined?a[0]:0,"int56_min_int":(...a)=>a[0]!==undefined?a[0]:0,"int56_max_int":(...a)=>a[0]!==undefined?a[0]:0,"int48_min_int":(...a)=>a[0]!==undefined?a[0]:0,"int48_max_int":(...a)=>a[0]!==undefined?a[0]:0,"int40_min_int":(...a)=>a[0]!==undefined?a[0]:0,"int40_max_int":(...a)=>a[0]!==undefined?a[0]:0,"int128_min_int":(...a)=>a[0]!==undefined?a[0]:0,"int128_max_int":(...a)=>a[0]!==undefined?a[0]:0,"int128_init_custom_ops":(...a)=>a[0]!==undefined?a[0]:0,"caml_unix_map_file_bytecode":(...a)=>a[0]!==undefined?a[0]:0,"caml_parquet_zstd_decompress_hex":(...a)=>a[0]!==undefined?a[0]:0}}})(globalThis),"src":"factoidal.wasm.assets"});
|