o1js
Version:
TypeScript framework for zk-SNARKs and zkApps
2 lines • 7.88 MB
JavaScript
"use strict";(function(_){typeof globalThis!="object"&&(this?e():(_.defineProperty(_.prototype,"_T_",{configurable:!0,get:e}),_T_));function e(){var u=this||self;u.globalThis=u,delete _.prototype._T_}})(Object),function(_){var e=_;(function(){var u={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",T:"%H:%M:%S",X:"%T",c:"%a %b %d %X %Y",r:"%I:%M:%S %p",v:"%e-%b-%Y",x:"%D"}},d=new I(u,0,!1),$=typeof module<"u",w;$?(w=module.exports=N,w.strftime=P,e&&(e.strftime=N)):(w=e||function(){return this||(0,eval)("this")}(),w.strftime=N);var A=$?"require('strftime')":"strftime",B={};function q(G,t_){B[G]||(typeof console<"u"&&typeof console.warn=="function"&&console.warn("[WARNING] "+G+" is deprecated and will be removed in version 1.0. Instead, use `"+t_+"`."),B[G]=!0)}w.strftimeTZ=V,w.strftimeUTC=U,w.localizedStrftime=J;function z(G){G.localize=d.localize.bind(d),G.timezone=d.timezone.bind(d),G.utc=d.utc.bind(d)}z(N);function N(G,t_,a_){t_&&t_.days&&(a_=t_,t_=void 0),a_&&q("`"+A+"(format, [date], [locale])`","var s = "+A+".localize(locale); s(format, [date])");var __=a_?d.localize(a_):d;return __(G,t_)}z(P);function P(G,t_,a_){a_?q("`"+A+".strftime(format, [date], [locale])`","var s = "+A+".localize(locale); s(format, [date])"):q("`"+A+".strftime(format, [date])`",A+"(format, [date])");var __=a_?d.localize(a_):d;return __(G,t_)}function V(G,t_,a_,__){(typeof a_=="number"||typeof a_=="string")&&__==null&&(__=a_,a_=void 0),a_?q("`"+A+".strftimeTZ(format, date, locale, tz)`","var s = "+A+".localize(locale).timezone(tz); s(format, [date])` or `var s = "+A+".localize(locale); s.timezone(tz)(format, [date])"):q("`"+A+".strftimeTZ(format, date, tz)`","var s = "+A+".timezone(tz); s(format, [date])` or `"+A+".timezone(tz)(format, [date])");var r_=(a_?d.localize(a_):d).timezone(__);return r_(G,t_)}var L=d.utc();function U(G,t_,a_){a_?q("`"+A+".strftimeUTC(format, date, locale)`","var s = "+A+".localize(locale).utc(); s(format, [date])"):q("`"+A+".strftimeUTC(format, [date])`","var s = "+A+".utc(); s(format, [date])");var __=a_?L.localize(a_):L;return __(G,t_)}function J(G){return q("`"+A+".localizedStrftime(locale)`",A+".localize(locale)"),d.localize(G)}typeof Date.now!="function"&&(Date.now=function(){return+new Date});function I(G,t_,a_){var __=G||u,r_=t_||0,e_=a_||!1,n_=0,o_;function s_(m_,u_){var b_;if(u_)b_=u_.getTime(),e_&&(u_=new Date(u_.getTime()+Q(u_)+r_));else{var y_=Date.now();y_>n_&&(n_=y_,o_=new Date(n_),b_=n_,e_&&(o_=new Date(n_+Q(o_)+r_))),u_=o_}return c_(m_,u_,__,b_)}function c_(m_,u_,b_,y_){for(var g_="",d_=null,v_=!1,x_=m_.length,E_=!1,z_=0;z_<x_;z_++){var B_=m_.charCodeAt(z_);if(v_===!0){if(B_===45){d_="";continue}else if(B_===95){d_=" ";continue}else if(B_===48){d_="0";continue}else if(B_===58){E_&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),E_=!0;continue}switch(B_){case 65:g_+=b_.days[u_.getDay()];break;case 66:g_+=b_.months[u_.getMonth()];break;case 67:g_+=W(Math.floor(u_.getFullYear()/100),d_);break;case 68:g_+=c_(b_.formats.D,u_,b_,y_);break;case 70:g_+=c_(b_.formats.F,u_,b_,y_);break;case 72:g_+=W(u_.getHours(),d_);break;case 73:g_+=W(R(u_.getHours()),d_);break;case 76:g_+=X(Math.floor(y_%1e3));break;case 77:g_+=W(u_.getMinutes(),d_);break;case 80:g_+=u_.getHours()<12?b_.am:b_.pm;break;case 82:g_+=c_(b_.formats.R,u_,b_,y_);break;case 83:g_+=W(u_.getSeconds(),d_);break;case 84:g_+=c_(b_.formats.T,u_,b_,y_);break;case 85:g_+=W(K(u_,"sunday"),d_);break;case 87:g_+=W(K(u_,"monday"),d_);break;case 88:g_+=c_(b_.formats.X,u_,b_,y_);break;case 89:g_+=u_.getFullYear();break;case 90:if(e_&&r_===0)g_+="GMT";else{var J_=u_.toString().match(/\(([\w\s]+)\)/);g_+=J_&&J_[1]||""}break;case 97:g_+=b_.shortDays[u_.getDay()];break;case 98:g_+=b_.shortMonths[u_.getMonth()];break;case 99:g_+=c_(b_.formats.c,u_,b_,y_);break;case 100:g_+=W(u_.getDate(),d_);break;case 101:g_+=W(u_.getDate(),d_??" ");break;case 104:g_+=b_.shortMonths[u_.getMonth()];break;case 106:var h_=new Date(u_.getFullYear(),0,1),$_=Math.ceil((u_.getTime()-h_.getTime())/(1e3*60*60*24));g_+=X($_);break;case 107:g_+=W(u_.getHours(),d_??" ");break;case 108:g_+=W(R(u_.getHours()),d_??" ");break;case 109:g_+=W(u_.getMonth()+1,d_);break;case 110:g_+=`
`;break;case 111:g_+=String(u_.getDate())+Y(u_.getDate());break;case 112:g_+=u_.getHours()<12?b_.AM:b_.PM;break;case 114:g_+=c_(b_.formats.r,u_,b_,y_);break;case 115:g_+=Math.floor(y_/1e3);break;case 116:g_+=" ";break;case 117:var $_=u_.getDay();g_+=$_===0?7:$_;break;case 118:g_+=c_(b_.formats.v,u_,b_,y_);break;case 119:g_+=u_.getDay();break;case 120:g_+=c_(b_.formats.x,u_,b_,y_);break;case 121:g_+=(""+u_.getFullYear()).slice(2);break;case 122:if(e_&&r_===0)g_+=E_?"+00:00":"+0000";else{var S_;r_!==0?S_=r_/(60*1e3):S_=-u_.getTimezoneOffset();var j_=S_<0?"-":"+",X_=E_?":":"",I_=Math.floor(Math.abs(S_/60)),W_=Math.abs(S_%60);g_+=j_+W(I_)+X_+W(W_)}break;default:g_+=m_[z_];break}d_=null,v_=!1;continue}if(B_===37){v_=!0;continue}g_+=m_[z_]}return g_}var i_=s_;return i_.localize=function(m_){return new I(m_||__,r_,e_)},i_.timezone=function(m_){var u_=r_,b_=e_,y_=typeof m_;if(y_==="number"||y_==="string")if(b_=!0,y_==="string"){var g_=m_[0]==="-"?-1:1,d_=parseInt(m_.slice(1,3),10),v_=parseInt(m_.slice(3,5),10);u_=g_*(60*d_+v_)*60*1e3}else y_==="number"&&(u_=m_*60*1e3);return new I(__,u_,b_)},i_.utc=function(){return new I(__,r_,!0)},i_}function W(G,t_){return t_===""||G>9?G:(t_==null&&(t_="0"),t_+G)}function X(G){return G>99?G:G>9?"0"+G:"00"+G}function R(G){return G===0?12:G>12?G-12:G}function K(G,t_){t_=t_||"sunday";var a_=G.getDay();t_==="monday"&&(a_===0?a_=6:a_--);var __=Date.UTC(G.getFullYear(),0,1),r_=Date.UTC(G.getFullYear(),G.getMonth(),G.getDate()),e_=Math.floor((r_-__)/864e5),n_=(e_+7-a_)/7;return Math.floor(n_)}function Y(G){var t_=G%10,a_=G%100;if(a_>=11&&a_<=13||t_===0||t_>=4)return"th";switch(t_){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function Q(G){return(G.getTimezoneOffset()||0)*6e4}})()}(globalThis),function(globalThis){"use strict";var joo_global_object=globalThis;function Base_am_testing(_){return 0}function caml_mul(_,e){return Math.imul(_,e)}function caml_hash_mix_int(_,e){return e=caml_mul(e,-862048943),e=e<<15|e>>>17,e=caml_mul(e,461845907),_^=e,_=_<<13|_>>>19,(_+(_<<2)|0)+-430675100|0}function caml_hash_mix_jsbytes(_,e){var u=e.length,d,$;for(d=0;d+4<=u;d+=4)$=e.charCodeAt(d)|e.charCodeAt(d+1)<<8|e.charCodeAt(d+2)<<16|e.charCodeAt(d+3)<<24,_=caml_hash_mix_int(_,$);switch($=0,u&3){case 3:$=e.charCodeAt(d+2)<<16;case 2:$|=e.charCodeAt(d+1)<<8;case 1:$|=e.charCodeAt(d),_=caml_hash_mix_int(_,$)}return _^=u,_}var log2_ok=Math.log2&&Math.log2(11235582092889474e291)==1020;function jsoo_floor_log2(_){if(log2_ok)return Math.floor(Math.log2(_));var e=0;if(_==0)return-1/0;if(_>=1)for(;_>=2;)_/=2,e++;else for(;_<1;)_*=2,e--;return e}var caml_int64_offset=Math.pow(2,-24);function caml_raise_constant(_){throw _}var caml_global_data=[0];function caml_raise_zero_divide(){caml_raise_constant(caml_global_data.Division_by_zero)}function MlInt64(_,e,u){this.lo=_&16777215,this.mi=e&16777215,this.hi=u&65535}MlInt64.prototype.caml_custom="_j",MlInt64.prototype.copy=function(){return new MlInt64(this.lo,this.mi,this.hi)},MlInt64.prototype.ucompare=function(_){return this.hi>_.hi?1:this.hi<_.hi?-1:this.mi>_.mi?1:this.mi<_.mi?-1:this.lo>_.lo?1:this.lo<_.lo?-1:0},MlInt64.prototype.compare=function(_){var e=this.hi<<16,u=_.hi<<16;return e>u?1:e<u?-1:this.mi>_.mi?1:this.mi<_.mi?-1:this.lo>_.lo?1:this.lo<_.lo?-1:0},MlInt64.prototype.neg=function(){var _=-this.lo,e=-this.mi+(_>>24),u=-this.hi+(e>>24);return new MlInt64(_,e,u)},MlInt64.prototype.add=function(_){var e=this.lo+_.lo,u=this.mi+_.mi+(e>>24),d=this.hi+_.hi+(u>>24);return new MlInt64(e,u,d)},MlInt64.prototype.sub=function(_){var e=this.lo-_.lo,u=this.mi-_.mi+(e>>24),d=this.hi-_.hi+(u>>24);return new MlInt64(e,u,d)},MlInt64.prototype.mul=function(_){var e=this.lo*_.lo,u=(e*caml_int64_offset|0)+this.mi*_.lo+this.lo*_.mi,d=(u*caml_int64_offset|0)+this.hi*_.lo+this.mi*_.mi+this.lo*_.hi;return new MlInt64(e,u,d)},MlInt64.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0},MlInt64.prototype.isNeg=function(){return this.hi<<16<0},MlInt64.prototype.and=function(_){return new MlInt64(this.lo&_.lo,this.mi&_.mi,this.hi&_.hi)},MlInt64.prototype.or=function(_){return new MlInt64(this.lo|_.lo,this.mi|_.mi,this.hi|_.hi)},MlInt64.prototype.xor=function(_){return new MlInt64(this.lo^_.lo,this.mi^_.mi,this.hi^_.hi)},MlInt64.prototype.shift_left=function(_){return _=_&63,_==0?this:_<24?new MlInt64(this.lo<<_,this.mi<<_|this.lo>>24-_,this.hi<<_|this.mi>>24-_):_<48?new MlInt64(0,this.lo<<_-24,this.mi<<_-24|this.lo>>48-_):new MlInt64(0,0,this.lo<<_-48)},MlInt64.prototype.shift_right_unsigned=function(_){return _=_&63,_==0?this:_<24?new MlInt64(this.lo>>_|this.mi<<24-_,this.mi>>_|this.hi<<24-_,this.hi>>_):_<48?new MlInt64(this.mi>>_-24|this.hi<<48-_,this.hi>>_-24,0):new MlInt64(this.hi>>_-48,0,0)},MlInt64.prototype.shift_right=function(_){if(_=_&63,_==0)return this;var e=this.hi<<16>>16;if(_<24)return new MlInt64(this.lo>>_|this.mi<<24-_,this.mi>>_|e<<24-_,this.hi<<16>>_>>>16);var u=this.hi<<16>>31;return _<48?new MlInt64(this.mi>>_-24|this.hi<<48-_,this.hi<<16>>_-24>>16,u&65535):new MlInt64(this.hi<<16>>_-32,u,u)},MlInt64.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&16777215,this.lo=this.lo<<1&16777215},MlInt64.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&16777215,this.mi=(this.mi>>>1|this.hi<<23)&16777215,this.hi=this.hi>>>1},MlInt64.prototype.udivmod=function(_){for(var e=0,u=this.copy(),d=_.copy(),$=new MlInt64(0,0,0);u.ucompare(d)>0;)e++,d.lsl1();for(;e>=0;)e--,$.lsl1(),u.ucompare(d)>=0&&($.lo++,u=u.sub(d)),d.lsr1();return{quotient:$,modulus:u}},MlInt64.prototype.div=function(_){var e=this;_.isZero()&&caml_raise_zero_divide();var u=e.hi^_.hi;e.hi&32768&&(e=e.neg()),_.hi&32768&&(_=_.neg());var d=e.udivmod(_).quotient;return u&32768&&(d=d.neg()),d},MlInt64.prototype.mod=function(_){var e=this;_.isZero()&&caml_raise_zero_divide();var u=e.hi;e.hi&32768&&(e=e.neg()),_.hi&32768&&(_=_.neg());var d=e.udivmod(_).modulus;return u&32768&&(d=d.neg()),d},MlInt64.prototype.toInt=function(){return this.lo|this.mi<<24},MlInt64.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},MlInt64.prototype.toArray=function(){return[this.hi>>8,this.hi&255,this.mi>>16,this.mi>>8&255,this.mi&255,this.lo>>16,this.lo>>8&255,this.lo&255]},MlInt64.prototype.lo32=function(){return this.lo|(this.mi&255)<<24},MlInt64.prototype.hi32=function(){return this.mi>>>8&65535|this.hi<<16};function caml_int64_create_lo_mi_hi(_,e,u){return new MlInt64(_,e,u)}function caml_int64_bits_of_float(_){if(!isFinite(_))return isNaN(_)?caml_int64_create_lo_mi_hi(1,0,32752):_>0?caml_int64_create_lo_mi_hi(0,0,32752):caml_int64_create_lo_mi_hi(0,0,65520);var e=_==0&&1/_==-1/0?32768:_>=0?0:32768;e&&(_=-_);var u=jsoo_floor_log2(_)+1023;u<=0?(u=0,_/=Math.pow(2,-1026)):(_/=Math.pow(2,u-1027),_<16&&(_*=2,u-=1),u==0&&(_/=2));var d=Math.pow(2,24),$=_|0;_=(_-$)*d;var w=_|0;_=(_-w)*d;var A=_|0;return $=$&15|e|u<<4,caml_int64_create_lo_mi_hi(A,w,$)}function caml_int64_lo32(_){return _.lo32()}function caml_int64_hi32(_){return _.hi32()}function caml_hash_mix_int64(_,e){return _=caml_hash_mix_int(_,caml_int64_lo32(e)),_=caml_hash_mix_int(_,caml_int64_hi32(e)),_}function caml_hash_mix_float(_,e){return caml_hash_mix_int64(_,caml_int64_bits_of_float(e))}function caml_str_repeat(_,e){if(_==0)return"";if(e.repeat)return e.repeat(_);for(var u="",d=0;;){if(_&1&&(u+=e),_>>=1,_==0)return u;e+=e,d++,d==9&&e.slice(0,1)}}function caml_subarray_to_jsbytes(_,e,u){var d=String.fromCharCode;if(e==0&&u<=4096&&u==_.length)return d.apply(null,_);for(var $="";0<u;e+=1024,u-=1024)$+=d.apply(null,_.slice(e,e+Math.min(u,1024)));return $}function caml_convert_string_to_bytes(_){_.t==2?_.c+=caml_str_repeat(_.l-_.c.length,"\0"):_.c=caml_subarray_to_jsbytes(_.c,0,_.c.length),_.t=0}function caml_jsbytes_of_string(_){return _.t&6&&caml_convert_string_to_bytes(_),_.c}function caml_hash_mix_string(_,e){return caml_hash_mix_jsbytes(_,caml_jsbytes_of_string(e))}function caml_hash_mix_bytes_arr(_,e){var u=e.length,d,$;for(d=0;d+4<=u;d+=4)$=e[d]|e[d+1]<<8|e[d+2]<<16|e[d+3]<<24,_=caml_hash_mix_int(_,$);switch($=0,u&3){case 3:$=e[d+2]<<16;case 2:$|=e[d+1]<<8;case 1:$|=e[d],_=caml_hash_mix_int(_,$)}return _^=u,_}function jsoo_is_ascii(_){if(_.length<24){for(var e=0;e<_.length;e++)if(_.charCodeAt(e)>127)return!1;return!0}else return!/[^\x00-\x7f]/.test(_)}function caml_utf16_of_utf8(_){for(var e="",u="",d,$,w,A,B=0,q=_.length;B<q;B++){if($=_.charCodeAt(B),$<128){for(var z=B+1;z<q&&($=_.charCodeAt(z))<128;z++);if(z-B>512?(u.substr(0,1),e+=u,u="",e+=_.slice(B,z)):u+=_.slice(B,z),z==q)break;B=z}A=1,++B<q&&((w=_.charCodeAt(B))&-64)==128&&(d=w+($<<6),$<224?(A=d-12416,A<128&&(A=1)):(A=2,++B<q&&((w=_.charCodeAt(B))&-64)==128&&(d=w+(d<<6),$<240?(A=d-925824,(A<2048||A>=55295&&A<57344)&&(A=2)):(A=3,++B<q&&((w=_.charCodeAt(B))&-64)==128&&$<245&&(A=w-63447168+(d<<6),(A<65536||A>1114111)&&(A=3)))))),A<4?(B-=A,u+="\uFFFD"):A>65535?u+=String.fromCharCode(55232+(A>>10),56320+(A&1023)):u+=String.fromCharCode(A),u.length>1024&&(u.substr(0,1),e+=u,u="")}return e+u}function MlBytes(_,e,u){this.t=_,this.c=e,this.l=u}MlBytes.prototype.toString=function(){switch(this.t){case 9:return this.c;default:caml_convert_string_to_bytes(this);case 0:if(jsoo_is_ascii(this.c))return this.t=9,this.c;this.t=8;case 8:return this.c}},MlBytes.prototype.toUtf16=function(){var _=this.toString();return this.t==9?_:caml_utf16_of_utf8(_)},MlBytes.prototype.slice=function(){var _=this.t==4?this.c.slice():this.c;return new MlBytes(this.t,_,this.l)};function caml_ml_bytes_content(_){switch(_.t&6){default:caml_convert_string_to_bytes(_);case 0:return _.c;case 4:return _.c}}function caml_hash_mix_bytes(_,e){var u=caml_ml_bytes_content(e);return typeof u=="string"?caml_hash_mix_jsbytes(_,u):caml_hash_mix_bytes_arr(_,u)}function caml_int32_bits_of_float(_){var e=new globalThis.Float32Array(1);e[0]=_;var u=new globalThis.Int32Array(e.buffer);return u[0]|0}function caml_int64_to_bytes(_){return _.toArray()}function caml_ba_serialize(_,e,u){if(_.write(32,e.dims.length),_.write(32,e.kind|e.layout<<8),e.caml_custom=="_bigarr02")for(var d=0;d<e.dims.length;d++)e.dims[d]<65535?_.write(16,e.dims[d]):(_.write(16,65535),_.write(32,0),_.write(32,e.dims[d]));else for(var d=0;d<e.dims.length;d++)_.write(32,e.dims[d]);switch(e.kind){case 2:case 3:case 12:for(var d=0;d<e.data.length;d++)_.write(8,e.data[d]);break;case 4:case 5:for(var d=0;d<e.data.length;d++)_.write(16,e.data[d]);break;case 6:for(var d=0;d<e.data.length;d++)_.write(32,e.data[d]);break;case 8:case 9:_.write(8,0);for(var d=0;d<e.data.length;d++)_.write(32,e.data[d]);break;case 7:for(var d=0;d<e.data.length/2;d++)for(var $=caml_int64_to_bytes(e.get(d)),w=0;w<8;w++)_.write(8,$[w]);break;case 1:for(var d=0;d<e.data.length;d++)for(var $=caml_int64_to_bytes(caml_int64_bits_of_float(e.get(d))),w=0;w<8;w++)_.write(8,$[w]);break;case 0:for(var d=0;d<e.data.length;d++){var $=caml_int32_bits_of_float(e.get(d));_.write(32,$)}break;case 10:for(var d=0;d<e.data.length/2;d++){var w=e.get(d);_.write(32,caml_int32_bits_of_float(w[1])),_.write(32,caml_int32_bits_of_float(w[2]))}break;case 11:for(var d=0;d<e.data.length/2;d++){for(var A=e.get(d),$=caml_int64_to_bytes(caml_int64_bits_of_float(A[1])),w=0;w<8;w++)_.write(8,$[w]);for(var $=caml_int64_to_bytes(caml_int64_bits_of_float(A[2])),w=0;w<8;w++)_.write(8,$[w])}break}u[0]=(4+e.dims.length)*4,u[1]=(4+e.dims.length)*8}function caml_raise_with_string(_,e){throw globalThis.Error(e.c)}function caml_invalid_argument(_){caml_raise_with_string(caml_global_data.Invalid_argument,_)}function caml_ba_get_size_per_element(_){switch(_){case 7:case 10:case 11:return 2;default:return 1}}function caml_ba_create_buffer(_,e){var u=globalThis,d;switch(_){case 0:d=u.Float32Array;break;case 1:d=u.Float64Array;break;case 2:d=u.Int8Array;break;case 3:d=u.Uint8Array;break;case 4:d=u.Int16Array;break;case 5:d=u.Uint16Array;break;case 6:d=u.Int32Array;break;case 7:d=u.Int32Array;break;case 8:d=u.Int32Array;break;case 9:d=u.Int32Array;break;case 10:d=u.Float32Array;break;case 11:d=u.Float64Array;break;case 12:d=u.Uint8Array;break}d||caml_invalid_argument("Bigarray.create: unsupported kind");var $=new d(e*caml_ba_get_size_per_element(_));return $}function caml_int32_float_of_bits(_){var e=new globalThis.Int32Array(1);e[0]=_;var u=new globalThis.Float32Array(e.buffer);return u[0]}function caml_int64_of_bytes(_){return new MlInt64(_[7]<<0|_[6]<<8|_[5]<<16,_[4]<<0|_[3]<<8|_[2]<<16,_[1]<<0|_[0]<<8)}function caml_int64_float_of_bits(_){var e=_.lo,u=_.mi,d=_.hi,$=(d&32767)>>4;if($==2047)return(e|u|d&15)==0?d&32768?-1/0:1/0:NaN;var w=Math.pow(2,-24),A=(e*w+u)*w+(d&15);return $>0?(A+=16,A*=Math.pow(2,$-1027)):A*=Math.pow(2,-1026),d&32768&&(A=-A),A}function caml_ba_get_size(_){for(var e=_.length,u=1,d=0;d<e;d++)_[d]<0&&caml_invalid_argument("Bigarray.create: negative dimension"),u=u*_[d];return u}function caml_int64_create_lo_hi(_,e){return new MlInt64(_&16777215,_>>>24&255|(e&65535)<<8,e>>>16&65535)}function caml_array_bound_error(){caml_invalid_argument("index out of bounds")}var caml_ba_custom_name="_bigarr02";function Ml_Bigarray(_,e,u,d){this.kind=_,this.layout=e,this.dims=u,this.data=d}Ml_Bigarray.prototype.caml_custom=caml_ba_custom_name,Ml_Bigarray.prototype.offset=function(_){var e=0;if(typeof _=="number"&&(_=[_]),_ instanceof Array||caml_invalid_argument("bigarray.js: invalid offset"),this.dims.length!=_.length&&caml_invalid_argument("Bigarray.get/set: bad number of dimensions"),this.layout==0)for(var u=0;u<this.dims.length;u++)(_[u]<0||_[u]>=this.dims[u])&&caml_array_bound_error(),e=e*this.dims[u]+_[u];else for(var u=this.dims.length-1;u>=0;u--)(_[u]<1||_[u]>this.dims[u])&&caml_array_bound_error(),e=e*this.dims[u]+(_[u]-1);return e},Ml_Bigarray.prototype.get=function(_){switch(this.kind){case 7:var e=this.data[_*2+0],u=this.data[_*2+1];return caml_int64_create_lo_hi(e,u);case 10:case 11:var d=this.data[_*2+0],$=this.data[_*2+1];return[254,d,$];default:return this.data[_]}},Ml_Bigarray.prototype.set=function(_,e){switch(this.kind){case 7:this.data[_*2+0]=caml_int64_lo32(e),this.data[_*2+1]=caml_int64_hi32(e);break;case 10:case 11:this.data[_*2+0]=e[1],this.data[_*2+1]=e[2];break;default:this.data[_]=e;break}return 0},Ml_Bigarray.prototype.fill=function(_){switch(this.kind){case 7:var e=caml_int64_lo32(_),u=caml_int64_hi32(_);if(e==u)this.data.fill(e);else for(var d=0;d<this.data.length;d++)this.data[d]=d%2==0?e:u;break;case 10:case 11:var $=_[1],w=_[2];if($==w)this.data.fill($);else for(var d=0;d<this.data.length;d++)this.data[d]=d%2==0?$:w;break;default:this.data.fill(_);break}},Ml_Bigarray.prototype.compare=function(_,e){if(this.layout!=_.layout||this.kind!=_.kind){var u=this.kind|this.layout<<8,d=_.kind|_.layout<<8;return d-u}if(this.dims.length!=_.dims.length)return _.dims.length-this.dims.length;for(var $=0;$<this.dims.length;$++)if(this.dims[$]!=_.dims[$])return this.dims[$]<_.dims[$]?-1:1;switch(this.kind){case 0:case 1:case 10:case 11:for(var w,A,$=0;$<this.data.length;$++){if(w=this.data[$],A=_.data[$],w<A)return-1;if(w>A)return 1;if(w!=A){if(!e)return NaN;if(w==w)return 1;if(A==A)return-1}}break;case 7:for(var $=0;$<this.data.length;$+=2){if(this.data[$+1]<_.data[$+1])return-1;if(this.data[$+1]>_.data[$+1])return 1;if(this.data[$]>>>0<_.data[$]>>>0)return-1;if(this.data[$]>>>0>_.data[$]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var $=0;$<this.data.length;$++){if(this.data[$]<_.data[$])return-1;if(this.data[$]>_.data[$])return 1}break}return 0};function Ml_Bigarray_c_1_1(_,e,u,d){this.kind=_,this.layout=e,this.dims=u,this.data=d}Ml_Bigarray_c_1_1.prototype=new Ml_Bigarray,Ml_Bigarray_c_1_1.prototype.offset=function(_){return typeof _!="number"&&(_ instanceof Array&&_.length==1?_=_[0]:caml_invalid_argument("Ml_Bigarray_c_1_1.offset")),(_<0||_>=this.dims[0])&&caml_array_bound_error(),_},Ml_Bigarray_c_1_1.prototype.get=function(_){return this.data[_]},Ml_Bigarray_c_1_1.prototype.set=function(_,e){return this.data[_]=e,0},Ml_Bigarray_c_1_1.prototype.fill=function(_){return this.data.fill(_),0};function caml_ba_create_unsafe(_,e,u,d){var $=caml_ba_get_size_per_element(_);return caml_ba_get_size(u)*$!=d.length&&caml_invalid_argument("length doesn't match dims"),e==0&&u.length==1&&$==1?new Ml_Bigarray_c_1_1(_,e,u,d):new Ml_Bigarray(_,e,u,d)}function caml_bytes_of_jsbytes(_){return new MlBytes(0,_,_.length)}function caml_string_of_jsbytes(_){return caml_bytes_of_jsbytes(_)}function caml_failwith(_){caml_global_data.Failure||(caml_global_data.Failure=[248,caml_string_of_jsbytes("Failure"),-3]),caml_raise_with_string(caml_global_data.Failure,_)}function caml_ba_deserialize(_,e,u){var d=_.read32s();(d<0||d>16)&&caml_failwith("input_value: wrong number of bigarray dimensions");var $=_.read32s(),w=$&255,A=$>>8&1,B=[];if(u=="_bigarr02")for(var q=0;q<d;q++){var z=_.read16u();if(z==65535){var N=_.read32u(),P=_.read32u();N!=0&&caml_failwith("input_value: bigarray dimension overflow in 32bit"),z=P}B.push(z)}else for(var q=0;q<d;q++)B.push(_.read32u());var V=caml_ba_get_size(B),L=caml_ba_create_buffer(w,V),U=caml_ba_create_unsafe(w,A,B,L);switch(w){case 2:for(var q=0;q<V;q++)L[q]=_.read8s();break;case 3:case 12:for(var q=0;q<V;q++)L[q]=_.read8u();break;case 4:for(var q=0;q<V;q++)L[q]=_.read16s();break;case 5:for(var q=0;q<V;q++)L[q]=_.read16u();break;case 6:for(var q=0;q<V;q++)L[q]=_.read32s();break;case 8:case 9:var J=_.read8u();J&&caml_failwith("input_value: cannot read bigarray with 64-bit OCaml ints");for(var q=0;q<V;q++)L[q]=_.read32s();break;case 7:for(var I=new Array(8),q=0;q<V;q++){for(var W=0;W<8;W++)I[W]=_.read8u();var X=caml_int64_of_bytes(I);U.set(q,X)}break;case 1:for(var I=new Array(8),q=0;q<V;q++){for(var W=0;W<8;W++)I[W]=_.read8u();var R=caml_int64_float_of_bits(caml_int64_of_bytes(I));U.set(q,R)}break;case 0:for(var q=0;q<V;q++){var R=caml_int32_float_of_bits(_.read32s());U.set(q,R)}break;case 10:for(var q=0;q<V;q++){var K=caml_int32_float_of_bits(_.read32s()),Y=caml_int32_float_of_bits(_.read32s());U.set(q,[254,K,Y])}break;case 11:for(var I=new Array(8),q=0;q<V;q++){for(var W=0;W<8;W++)I[W]=_.read8u();for(var K=caml_int64_float_of_bits(caml_int64_of_bytes(I)),W=0;W<8;W++)I[W]=_.read8u();var Y=caml_int64_float_of_bits(caml_int64_of_bytes(I));U.set(q,[254,K,Y])}break}return e[0]=(4+d)*4,caml_ba_create_unsafe(w,A,B,L)}function caml_ba_compare(_,e,u){return _.compare(e,u)}function caml_ba_hash(_){var e=caml_ba_get_size(_.dims),u=0;switch(_.kind){case 2:case 3:case 12:e>256&&(e=256);var d=0,$=0;for($=0;$+4<=_.data.length;$+=4)d=_.data[$+0]|_.data[$+1]<<8|_.data[$+2]<<16|_.data[$+3]<<24,u=caml_hash_mix_int(u,d);switch(d=0,e&3){case 3:d=_.data[$+2]<<16;case 2:d|=_.data[$+1]<<8;case 1:d|=_.data[$+0],u=caml_hash_mix_int(u,d)}break;case 4:case 5:e>128&&(e=128);var d=0,$=0;for($=0;$+2<=_.data.length;$+=2)d=_.data[$+0]|_.data[$+1]<<16,u=caml_hash_mix_int(u,d);(e&1)!=0&&(u=caml_hash_mix_int(u,_.data[$]));break;case 6:e>64&&(e=64);for(var $=0;$<e;$++)u=caml_hash_mix_int(u,_.data[$]);break;case 8:case 9:e>64&&(e=64);for(var $=0;$<e;$++)u=caml_hash_mix_int(u,_.data[$]);break;case 7:e>32&&(e=32),e*=2;for(var $=0;$<e;$++)u=caml_hash_mix_int(u,_.data[$]);break;case 10:e*=2;case 0:e>64&&(e=64);for(var $=0;$<e;$++)u=caml_hash_mix_float(u,_.data[$]);break;case 11:e*=2;case 1:e>32&&(e=32);for(var $=0;$<e;$++)u=caml_hash_mix_float(u,_.data[$]);break}return u}function caml_int32_unmarshal(_,e){return e[0]=4,_.read32s()}function caml_nativeint_unmarshal(_,e){switch(_.read8u()){case 1:return e[0]=4,_.read32s();case 2:caml_failwith("input_value: native integer value too large");default:caml_failwith("input_value: ill-formed native integer")}}function caml_int64_unmarshal(_,e){for(var u=new Array(8),d=0;d<8;d++)u[d]=_.read8u();return e[0]=8,caml_int64_of_bytes(u)}function caml_int64_marshal(_,e,u){for(var d=caml_int64_to_bytes(e),$=0;$<8;$++)_.write(8,d[$]);u[0]=8,u[1]=8}function caml_int64_compare(_,e,u){return _.compare(e)}function caml_int64_hash(_){return _.lo32()^_.hi32()}var caml_custom_ops={_j:{deserialize:caml_int64_unmarshal,serialize:caml_int64_marshal,fixed_length:8,compare:caml_int64_compare,hash:caml_int64_hash},_i:{deserialize:caml_int32_unmarshal,fixed_length:4},_n:{deserialize:caml_nativeint_unmarshal,fixed_length:4},_bigarray:{deserialize:function(_,e){return caml_ba_deserialize(_,e,"_bigarray")},serialize:caml_ba_serialize,compare:caml_ba_compare,hash:caml_ba_hash},_bigarr02:{deserialize:function(_,e){return caml_ba_deserialize(_,e,"_bigarr02")},serialize:caml_ba_serialize,compare:caml_ba_compare,hash:caml_ba_hash}};function caml_hash_mix_final(_){return _^=_>>>16,_=caml_mul(_,-2048144789),_^=_>>>13,_=caml_mul(_,-1028477387),_^=_>>>16,_}function caml_is_ml_bytes(_){return _ instanceof MlBytes}function caml_is_ml_string(_){return caml_is_ml_bytes(_)}function caml_hash(_,e,u,d){var $,w,A,B,q,z,N,P,V;for(B=e,(B<0||B>256)&&(B=256),q=_,z=u,$=[d],w=0,A=1;w<A&&q>0;)if(N=$[w++],N&&N.caml_custom){if(caml_custom_ops[N.caml_custom]&&caml_custom_ops[N.caml_custom].hash){var L=caml_custom_ops[N.caml_custom].hash(N);z=caml_hash_mix_int(z,L),q--}}else if(N instanceof Array&&N[0]===(N[0]|0))switch(N[0]){case 248:z=caml_hash_mix_int(z,N[2]),q--;break;case 250:$[--w]=N[1];break;default:var U=N.length-1<<10|N[0];for(z=caml_hash_mix_int(z,U),P=1,V=N.length;P<V&&!(A>=B);P++)$[A++]=N[P];break}else caml_is_ml_bytes(N)?(z=caml_hash_mix_bytes(z,N),q--):caml_is_ml_string(N)?(z=caml_hash_mix_string(z,N),q--):typeof N=="string"?(z=caml_hash_mix_jsbytes(z,N),q--):N===(N|0)?(z=caml_hash_mix_int(z,N+N+1),q--):N===+N&&(z=caml_hash_mix_float(z,N),q--);return z=caml_hash_mix_final(z),z&1073741823}function Base_hash_double(_){return caml_hash(1,1,0,_)}function Base_hash_string(_){return caml_hash(1,1,0,_)}function Base_int_math_int32_clz(_){var e=32,u;return u=_>>16,u!=0&&(e=e-16,_=u),u=_>>8,u!=0&&(e=e-8,_=u),u=_>>4,u!=0&&(e=e-4,_=u),u=_>>2,u!=0&&(e=e-2,_=u),u=_>>1,u!=0?e-2:e-_}function Base_int_math_int32_ctz(_){if(_===0)return 32;var e=1;return(_&65535)===0&&(e=e+16,_=_>>16),(_&255)===0&&(e=e+8,_=_>>8),(_&15)===0&&(e=e+4,_=_>>4),(_&3)===0&&(e=e+2,_=_>>2),e-(_&1)}function caml_int64_shift_right_unsigned(_,e){return _.shift_right_unsigned(e)}function caml_int64_is_zero(_){return+_.isZero()}function caml_int64_to_int32(_){return _.toInt()}function Base_int_math_int64_clz(_){var e=64,u;return u=caml_int64_shift_right_unsigned(_,32),caml_int64_is_zero(u)||(e=e-32,_=u),u=caml_int64_shift_right_unsigned(_,16),caml_int64_is_zero(u)||(e=e-16,_=u),u=caml_int64_shift_right_unsigned(_,8),caml_int64_is_zero(u)||(e=e-8,_=u),u=caml_int64_shift_right_unsigned(_,4),caml_int64_is_zero(u)||(e=e-4,_=u),u=caml_int64_shift_right_unsigned(_,2),caml_int64_is_zero(u)||(e=e-2,_=u),u=caml_int64_shift_right_unsigned(_,1),caml_int64_is_zero(u)?e-caml_int64_to_int32(_):e-2}function caml_int64_and(_,e){return _.and(e)}function caml_int64_of_int32(_){return new MlInt64(_&16777215,_>>24&16777215,_>>31&65535)}function Base_int_math_int64_ctz(_){if(caml_int64_is_zero(_))return 64;var e=1;function u(w){return caml_int64_is_zero(w)}function d(w,A){return caml_int64_and(w,A)}function $(w){return caml_int64_create_lo_mi_hi(w,0,0)}return u(d(_,caml_int64_create_lo_mi_hi(16777215,255,0)))&&(e=e+32,_=caml_int64_shift_right_unsigned(_,32)),u(d(_,$(65535)))&&(e=e+16,_=caml_int64_shift_right_unsigned(_,16)),u(d(_,$(255)))&&(e=e+8,_=caml_int64_shift_right_unsigned(_,8)),u(d(_,$(15)))&&(e=e+4,_=caml_int64_shift_right_unsigned(_,4)),u(d(_,$(3)))&&(e=e+2,_=caml_int64_shift_right_unsigned(_,2)),e-caml_int64_to_int32(caml_int64_and(_,$(1)))}function caml_int64_mul(_,e){return _.mul(e)}function Base_int_math_int64_pow_stub(_,e){for(var u=caml_int64_create_lo_hi(1,0),d=[u,_,u,u],$=u;!caml_int64_is_zero(e);)d[1]=caml_int64_mul(d[1],d[3]),d[2]=caml_int64_mul(d[1],d[1]),d[3]=caml_int64_mul(d[2],d[1]),$=caml_int64_mul($,d[caml_int64_lo32(e)&3]),e=caml_int64_shift_right_unsigned(e,2);return $}function Base_int_math_int_clz(_){return Base_int_math_int32_clz(_)}function Base_int_math_int_ctz(_){return Base_int_math_int32_ctz(_)}function Base_int_math_int_popcount(_){return _=_-(_>>>1&1431655765),_=(_&858993459)+(_>>>2&858993459),(_+(_>>>4)&252645135)*16843009>>>24}function Base_int_math_int_pow_stub(_,e){for(var u=1,d=[u,_,u,u],$=u;!e==0;)d[1]=d[1]*d[3]|0,d[2]=d[1]*d[1]|0,d[3]=d[2]*d[1]|0,$=$*d[e&3]|0,e=e>>2;return $}function Base_int_math_nativeint_clz(_){return Base_int_math_int32_clz(_)}function Base_int_math_nativeint_ctz(_){return Base_int_math_int32_ctz(_)}var Base_internalhash_fold_float=caml_hash_mix_float,Base_internalhash_fold_int=caml_hash_mix_int,Base_internalhash_fold_int64=caml_hash_mix_int64,Base_internalhash_fold_string=caml_hash_mix_string;function Base_internalhash_get_hash_value(_){var e=caml_hash_mix_final(_);return e&1073741823}function incr_nat(_,e,u,d){for(var $=d,w=0;w<u;w++){var A=(_.data[e+w]>>>0)+$;if(_.data[e+w]=A|0,A==A>>>0){$=0;break}else $=1}return $}function add_nat(_,e,u,d,$,w,A){for(var B=A,q=0;q<w;q++){var z=(_.data[e+q]>>>0)+(d.data[$+q]>>>0)+B;_.data[e+q]=z,z==z>>>0?B=0:B=1}return incr_nat(_,e+w,u-w,B)}function caml_js_from_array(_){return _.slice(1)}function caml_ba_create(_,e,u){var d=caml_js_from_array(u),$=caml_ba_create_buffer(_,caml_ba_get_size(d));return caml_ba_create_unsafe(_,e,d,$)}function bigstring_alloc(_,e){return caml_ba_create(12,0,[0,e])}function caml_ml_bytes_length(_){return _.l}function caml_convert_bytes_to_array(_){if(globalThis.Uint8Array)var e=new globalThis.Uint8Array(_.l);else var e=new Array(_.l);for(var u=_.c,d=u.length,$=0;$<d;$++)e[$]=u.charCodeAt($);for(d=_.l;$<d;$++)e[$]=0;return _.c=e,_.t=4,e}function caml_blit_bytes(_,e,u,d,$){if($==0)return 0;if(d==0&&($>=u.l||u.t==2&&$>=u.c.length))u.c=_.t==4?caml_subarray_to_jsbytes(_.c,e,$):e==0&&_.c.length==$?_.c:_.c.substr(e,$),u.t=u.c.length==u.l?0:2;else if(u.t==2&&d==u.c.length)u.c+=_.t==4?caml_subarray_to_jsbytes(_.c,e,$):e==0&&_.c.length==$?_.c:_.c.substr(e,$),u.t=u.c.length==u.l?0:2;else{u.t!=4&&caml_convert_bytes_to_array(u);var w=_.c,A=u.c;if(_.t==4)if(d<=e)for(var B=0;B<$;B++)A[d+B]=w[e+B];else for(var B=$-1;B>=0;B--)A[d+B]=w[e+B];else{for(var q=Math.min($,w.length-e),B=0;B<q;B++)A[d+B]=w.charCodeAt(e+B);for(;B<$;B++)A[d+B]=0}}return 0}function caml_bytes_of_array(_){return new MlBytes(4,_,_.length)}function caml_bigstring_blit_ba_to_bytes(_,e,u,d,$){if(_.kind!=12&&caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch"),$==0)return 0;var w=_.offset(e);w+$>_.data.length&&caml_array_bound_error(),d+$>caml_ml_bytes_length(u)&&caml_array_bound_error();var A=_.data.slice(w,w+$);return caml_blit_bytes(caml_bytes_of_array(A),0,u,d,$),0}function bigstring_blit_bigstring_bytes_stub(_,e,u,d,$){return caml_bigstring_blit_ba_to_bytes(_,e,u,d,$)}function caml_array_of_bytes(_){return _.t!=4&&caml_convert_bytes_to_array(_),_.c}function caml_bigstring_blit_bytes_to_ba(_,e,u,d,$){if(u.kind!=12&&caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch"),$==0)return 0;var w=u.offset(d);e+$>caml_ml_bytes_length(_)&&caml_array_bound_error(),w+$>u.data.length&&caml_array_bound_error();var A=caml_array_of_bytes(_).slice(e,e+$);return u.data.set(A,w),0}function bigstring_blit_bytes_bigstring_stub(_,e,u,d,$){return caml_bigstring_blit_bytes_to_ba(_,e,u,d,$)}function caml_ml_string_length(_){return caml_ml_bytes_length(_)}function caml_bytes_unsafe_get(_,e){switch(_.t&6){default:if(e>=_.c.length)return 0;case 0:return _.c.charCodeAt(e);case 4:return _.c[e]}}function caml_string_unsafe_get(_,e){return caml_bytes_unsafe_get(_,e)}function caml_array_of_string(_){for(var e=caml_ml_string_length(_),u=new Array(e),d=0;d<e;d++)u[d]=caml_string_unsafe_get(_,d);return u}function caml_bigstring_blit_string_to_ba(_,e,u,d,$){if(u.kind!=12&&caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch"),$==0)return 0;var w=u.offset(d);e+$>caml_ml_string_length(_)&&caml_array_bound_error(),w+$>u.data.length&&caml_array_bound_error();var A=caml_array_of_string(_).slice(e,e+$);return u.data.set(A,w),0}function bigstring_blit_string_bigstring_stub(_,e,u,d,$){return caml_bigstring_blit_string_to_ba(_,e,u,d,$)}function caml_bigstring_blit_ba_to_ba(_,e,u,d,$){if(_.kind!=12&&caml_invalid_argument("caml_bigstring_blit_ba_to_ba: kind mismatch"),u.kind!=12&&caml_invalid_argument("caml_bigstring_blit_ba_to_ba: kind mismatch"),$==0)return 0;var w=_.offset(e),A=u.offset(d);w+$>_.data.length&&caml_array_bound_error(),A+$>u.data.length&&caml_array_bound_error();var B=_.data.subarray(w,w+$);return u.data.set(B,d),0}function bigstring_blit_stub(_,e,u,d,$){return caml_bigstring_blit_ba_to_ba(_,e,u,d,$)}function caml_bytes_unsafe_set(_,e,u){if(u&=255,_.t!=4){if(e==_.c.length)return _.c+=String.fromCharCode(u),e+1==_.l&&(_.t=0),0;caml_convert_bytes_to_array(_)}return _.c[e]=u,0}function caml_string_unsafe_set(_,e,u){return caml_bytes_unsafe_set(_,e,u)}function caml_ba_get_1(_,e){return _.get(_.offset(e))}function bigstringaf_blit_to_bytes(_,e,u,d,$){for(var w=0;w<$;w++)caml_string_unsafe_set(u,d+w,caml_ba_get_1(_,e+w))}function bin_prot_blit_buf_bytes_stub(_,e,u,d,$){return caml_bigstring_blit_ba_to_bytes(e,_,d,u,$)}function caml_check_bound(_,e){return e>>>0>=_.length-1&&caml_array_bound_error(),_}function caml_check_bound_bigstring(_,e){e>>>0>=_.data.length&&caml_array_bound_error()}function bin_prot_blit_buf_float_array_stub(_,e,u,d,$){if($==0)return 0;caml_check_bound(d,u),caml_check_bound(d,u+$-1),caml_check_bound_bigstring(e,_),caml_check_bound_bigstring(e,_+$*8-1);var w=new joo_global_object.Float64Array($),A=new joo_global_object.Uint8Array(w.buffer);A.set(e.data.subarray(_,_+$*8));for(var B=0;B<$;B++)d[u+B+1]=w[B];return 0}function bin_prot_blit_float_array_buf_stub(_,e,u,d,$){if($==0)return 0;caml_check_bound(e,_),caml_check_bound(e,_+$-1),caml_check_bound_bigstring(d,u),caml_check_bound_bigstring(d,u+$*8-1),_=_+1;var w=new joo_global_object.Float64Array(e.slice(_,_+$)),A=new joo_global_object.Uint8Array(w.buffer),B=d.data.subarray(u,u+$*8);return B.set(A),0}function bin_prot_blit_string_buf_stub(_,e,u,d,$){return caml_bigstring_blit_string_to_ba(e,_,d,u,$)}function blit_nat(_,e,u,d,$){for(var w=0;w<$;w++)_.data[e+w]=u.data[d+w];return 0}function caml_array_append(_,e){var u=_.length,d=e.length,$=u+d-1,w=new Array($);w[0]=0;for(var A=1,B=1;A<u;A++)w[A]=_[A];for(;A<$;A++,B++)w[A]=e[B];return w}function caml_array_blit(_,e,u,d,$){if(d<=e)for(var w=1;w<=$;w++)u[d+w]=_[e+w];else for(var w=$;w>=1;w--)u[d+w]=_[e+w];return 0}function caml_array_concat(_){for(var e=[0];_!==0;){for(var u=_[1],d=1;d<u.length;d++)e.push(u[d]);_=_[2]}return e}function caml_array_fill(_,e,u,d){for(var $=0;$<u;$++)_[e+$+1]=d;return 0}function caml_array_set(_,e,u){return(e<0||e>=_.length-1)&&caml_array_bound_error(),_[e+1]=u,0}function caml_array_sub(_,e,u){var d=new Array(u+1);d[0]=0;for(var $=1,w=e+1;$<=u;$++,w++)d[$]=_[w];return d}function caml_ba_blit(_,e){e.dims.length!=_.dims.length&&caml_invalid_argument("Bigarray.blit: dimension mismatch");for(var u=0;u<e.dims.length;u++)e.dims[u]!=_.dims[u]&&caml_invalid_argument("Bigarray.blit: dimension mismatch");return e.data.set(_.data),0}function caml_ba_dim(_,e){return(e<0||e>=_.dims.length)&&caml_invalid_argument("Bigarray.dim"),_.dims[e]}function caml_ba_dim_1(_){return caml_ba_dim(_,0)}function caml_ba_dim_2(_){return caml_ba_dim(_,1)}function caml_ba_get_2(_,e,u){return _.get(_.offset([e,u]))}function caml_ba_layout(_){return _.layout}function caml_ba_set_1(_,e,u){return _.set(_.offset(e),u),0}function caml_ba_set_2(_,e,u,d){return _.set(_.offset([e,u]),d),0}function caml_ba_sub(_,e,u){var d,$=1;if(_.layout==0){for(var w=1;w<_.dims.length;w++)$=$*_.dims[w];d=0}else{for(var w=0;w<_.dims.length-1;w++)$=$*_.dims[w];d=_.dims.length-1,e=e-1}(e<0||u<0||e+u>_.dims[d])&&caml_invalid_argument("Bigarray.sub: bad sub-array");for(var A=[],w=0;w<_.dims.length;w++)A[w]=_.dims[w];A[d]=u,$*=caml_ba_get_size_per_element(_.kind);var B=_.data.subarray(e*$,(e+u)*$);return caml_ba_create_unsafe(_.kind,_.layout,A,B)}function caml_ba_uint8_get16(_,e){var u=_.offset(e);u+1>=_.data.length&&caml_array_bound_error();var d=_.get(u),$=_.get(u+1);return d|$<<8}function caml_ba_uint8_get32(_,e){var u=_.offset(e);u+3>=_.data.length&&caml_array_bound_error();var d=_.get(u+0),$=_.get(u+1),w=_.get(u+2),A=_.get(u+3);return d<<0|$<<8|w<<16|A<<24}function caml_ba_uint8_get64(_,e){var u=_.offset(e);u+7>=_.data.length&&caml_array_bound_error();var d=_.get(u+0),$=_.get(u+1),w=_.get(u+2),A=_.get(u+3),B=_.get(u+4),q=_.get(u+5),z=_.get(u+6),N=_.get(u+7);return caml_int64_of_bytes([N,z,q,B,A,w,$,d])}function caml_ba_uint8_set16(_,e,u){var d=_.offset(e);return d+1>=_.data.length&&caml_array_bound_error(),_.set(d+0,u&255),_.set(d+1,u>>>8&255),0}function caml_ba_uint8_set32(_,e,u){var d=_.offset(e);return d+3>=_.data.length&&caml_array_bound_error(),_.set(d+0,u&255),_.set(d+1,u>>>8&255),_.set(d+2,u>>>16&255),_.set(d+3,u>>>24&255),0}function caml_ba_uint8_set64(_,e,u){var d=_.offset(e);d+7>=_.data.length&&caml_array_bound_error();for(var u=caml_int64_to_bytes(u),$=0;$<8;$++)_.set(d+$,u[7-$]);return 0}function caml_backtrace_status(){return 0}var tsBindings=globalThis.__snarkyTsBindings,caml_bigint_256_bytes_per_limb=tsBindings.caml_bigint_256_bytes_per_limb,caml_bigint_256_compare=tsBindings.caml_bigint_256_compare,caml_bigint_256_div=tsBindings.caml_bigint_256_div,caml_bigint_256_num_limbs=tsBindings.caml_bigint_256_num_limbs,caml_bigint_256_of_bytes=tsBindings.caml_bigint_256_of_bytes,caml_bigint_256_of_decimal_string=tsBindings.caml_bigint_256_of_decimal_string,caml_bigint_256_of_numeral=tsBindings.caml_bigint_256_of_numeral,caml_bigint_256_print=tsBindings.caml_bigint_256_print,caml_bigint_256_test_bit=tsBindings.caml_bigint_256_test_bit,caml_bigint_256_to_bytes=tsBindings.caml_bigint_256_to_bytes,caml_bigint_256_to_string=tsBindings.caml_bigint_256_to_string;function caml_bytes_of_string(_){return _}function caml_blit_string(_,e,u,d,$){return caml_blit_bytes(_,e,u,d,$),0}function caml_bswap16(_){return(_&255)<<8|(_&65280)>>8}function caml_bytes_bound_error(){caml_invalid_argument("index out of bounds")}function caml_bytes_get(_,e){return e>>>0>=_.l&&caml_bytes_bound_error(),caml_bytes_unsafe_get(_,e)}function caml_bytes_get16(_,e){e>>>0>=_.l-1&&caml_bytes_bound_error();var u=caml_bytes_unsafe_get(_,e),d=caml_bytes_unsafe_get(_,e+1);return d<<8|u}function caml_bytes_set(_,e,u){return e>>>0>=_.l&&caml_bytes_bound_error(),caml_bytes_unsafe_set(_,e,u)}function caml_bytes_set16(_,e,u){e>>>0>=_.l-1&&caml_bytes_bound_error();var d=255&u>>8,$=255&u;return caml_bytes_unsafe_set(_,e+0,$),caml_bytes_unsafe_set(_,e+1,d),0}function caml_bytes_set32(_,e,u){e>>>0>=_.l-3&&caml_bytes_bound_error();var d=255&u>>24,$=255&u>>16,w=255&u>>8,A=255&u;return caml_bytes_unsafe_set(_,e+0,A),caml_bytes_unsafe_set(_,e+1,w),caml_bytes_unsafe_set(_,e+2,$),caml_bytes_unsafe_set(_,e+3,d),0}function caml_bytes_set64(_,e,u){e>>>0>=_.l-7&&caml_bytes_bound_error();for(var d=caml_int64_to_bytes(u),$=0;$<8;$++)caml_bytes_unsafe_set(_,e+7-$,d[$]);return 0}function caml_call_gen(_,e){if(_.fun)return caml_call_gen(_.fun,e);if(typeof _!="function")return _;var u=_.length|0;if(u===0)return _.apply(null,e);var d=e.length|0,$=u-d|0;return $==0?_.apply(null,e):$<0?caml_call_gen(_.apply(null,e.slice(0,u)),e.slice(u)):function(){for(var w=arguments.length==0?1:arguments.length,A=new Array(e.length+w),B=0;B<e.length;B++)A[B]=e[B];for(var B=0;B<arguments.length;B++)A[e.length+B]=arguments[B];return caml_call_gen(_,A)}}function caml_classify_float(_){return isFinite(_)?Math.abs(_)>=22250738585072014e-324?0:_!=0?1:2:isNaN(_)?4:3}function caml_compare_val_get_custom(_){return caml_custom_ops[_.caml_custom]&&caml_custom_ops[_.caml_custom].compare}function caml_compare_val_number_custom(_,e,u,d){var $=caml_compare_val_get_custom(e);if($){var w=u>0?$(e,_,d):$(_,e,d);if(d&&w!=w)return u;if(+w!=+w)return+w;if((w|0)!=0)return w|0}return u}function caml_compare_val_tag(_){if(typeof _=="number")return 1e3;if(caml_is_ml_bytes(_))return 252;if(caml_is_ml_string(_))return 1252;if(_ instanceof Array&&_[0]===_[0]>>>0&&_[0]<=255){var e=_[0]|0;return e==254?0:e}else{if(_ instanceof String||typeof _=="string")return 12520;if(_ instanceof Number)return 1e3;if(_&&_.caml_custom)return 1255;if(_&&_.compare)return 1256;if(typeof _=="function")return 1247;if(typeof _=="symbol")return 1251}return 1001}function caml_int_compare(_,e){return _<e?-1:_==e?0:1}function caml_bytes_compare(_,e){return _.t&6&&caml_convert_string_to_bytes(_),e.t&6&&caml_convert_string_to_bytes(e),_.c<e.c?-1:_.c>e.c?1:0}function caml_string_compare(_,e){return caml_bytes_compare(_,e)}function caml_compare_val(_,e,u){for(var d=[];;){if(!(u&&_===e)){var $=caml_compare_val_tag(_);if($==250){_=_[1];continue}var w=caml_compare_val_tag(e);if(w==250){e=e[1];continue}if($!==w)return $==1e3?w==1255?caml_compare_val_number_custom(_,e,-1,u):-1:w==1e3?$==1255?caml_compare_val_number_custom(e,_,1,u):1:$<w?-1:1;switch($){case 247:caml_invalid_argument("compare: functional value");break;case 248:var B=caml_int_compare(_[2],e[2]);if(B!=0)return B|0;break;case 249:caml_invalid_argument("compare: functional value");break;case 250:caml_invalid_argument("equal: got Forward_tag, should not happen");break;case 251:caml_invalid_argument("equal: abstract value");break;case 252:if(_!==e){var B=caml_bytes_compare(_,e);if(B!=0)return B|0}break;case 253:caml_invalid_argument("equal: got Double_tag, should not happen");break;case 254:caml_invalid_argument("equal: got Double_array_tag, should not happen");break;case 255:caml_invalid_argument("equal: got Custom_tag, should not happen");break;case 1247:caml_invalid_argument("compare: functional value");break;case 1255:var A=caml_compare_val_get_custom(_);if(A!=caml_compare_val_get_custom(e))return _.caml_custom<e.caml_custom?-1:1;A||caml_invalid_argument("compare: abstract value");var B=A(_,e,u);if(B!=B)return u?-1:B;if(B!==(B|0))return-1;if(B!=0)return B|0;break;case 1256:var B=_.compare(e,u);if(B!=B)return u?-1:B;if(B!==(B|0))return-1;if(B!=0)return B|0;break;case 1e3:if(_=+_,e=+e,_<e)return-1;if(_>e)return 1;if(_!=e){if(!u)return NaN;if(_==_)return 1;if(e==e)return-1}break;case 1001:if(_<e)return-1;if(_>e)return 1;if(_!=e){if(!u)return NaN;if(_==_)return 1;if(e==e)return-1}break;case 1251:if(_!==e)return u?1:NaN;break;case 1252:var _=caml_jsbytes_of_string(_),e=caml_jsbytes_of_string(e);if(_!==e){if(_<e)return-1;if(_>e)return 1}break;case 12520:var _=_.toString(),e=e.toString();if(_!==e){if(_<e)return-1;if(_>e)return 1}break;case 246:case 254:default:if(_.length!=e.length)return _.length<e.length?-1:1;_.length>1&&d.push(_,e,1);break}}if(d.length==0)return 0;var q=d.pop();e=d.pop(),_=d.pop(),q+1<_.length&&d.push(_,e,q+1),_=_[q],e=e[q]}}function caml_compare(_,e){return caml_compare_val(_,e,!0)}function caml_convert_raw_backtrace(){return[0]}function caml_convert_raw_backtrace_slot(){caml_failwith("caml_convert_raw_backtrace_slot")}function caml_create_bytes(_){return _<0&&caml_invalid_argument("Bytes.create"),new MlBytes(_?2:9,"",_)}function caml_div(_,e){return e==0&&caml_raise_zero_divide(),_/e|0}var caml_ephe_key_offset=3;function caml_weak_create(_){_<0&&caml_invalid_argument("Weak.create");var e=[251,"caml_ephe_list_head"];return e.length=caml_ephe_key_offset+_,e}var caml_ephe_create=caml_weak_create,caml_ephe_data_offset=2;function caml_ephe_get_data(_){return _[caml_ephe_data_offset]===void 0?0:[0,_[caml_ephe_data_offset]]}function caml_ephe_set_data(_,e){return _[caml_ephe_data_offset]=e,0}function caml_weak_set(_,e,u){return(e<0||caml_ephe_key_offset+e>=_.length)&&caml_invalid_argument("Weak.set"),_[caml_ephe_key_offset+e]=u,0}function caml_ephe_set_key(_,e,u){return caml_weak_set(_,e,[0,u])}function caml_equal(_,e){return+(caml_compare_val(_,e,!1)==0)}function caml_fill_bytes(_,e,u,d){if(u>0)if(e==0&&(u>=_.l||_.t==2&&u>=_.c.length))d==0?(_.c="",_.t=2):(_.c=caml_str_repeat(u,String.fromCharCode(d)),_.t=u==_.l?0:2);else for(_.t!=4&&caml_convert_bytes_to_array(_),u+=e;e<u;e++)_.c[e]=d;return 0}function caml_final_register(){return 0}function caml_float_compare(_,e){return _===e?0:_<e?-1:_>e||_===_?1:e===e?-1:0}function caml_float_of_string(_){var e;if(_=caml_jsbytes_of_string(_),e=+_,_.length>0&&e===e||(_=_.replace(/_/g,""),e=+_,_.length>0&&e===e||/^[+-]?nan$/i.test(_)))return e;var u=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(_);if(u){var d=u[3].replace(/0+$/,""),$=parseInt(u[1]+u[2]+d,16),w=(u[5]|0)-4*d.length;return e=$*Math.pow(2,w),e}if(/^\+?inf(inity)?$/i.test(_))return 1/0;if(/^-inf(inity)?$/i.test(_))return-1/0;caml_failwith("float_of_string")}function caml_parse_format(_){_=caml_jsbytes_of_string(_);var e=_.length;e>31&&caml_invalid_argument("format_int: format too long");for(var u={justify:"+",signstyle:"-",filler:" ",alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},d=0;d<e;d++){var $=_.charAt(d);switch($){case"-":u.justify="-";break;case"+":case" ":u.signstyle=$;break;case"0":u.filler="0";break;case"#":u.alternate=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(u.width=0;$=_.charCodeAt(d)-48,$>=0&&$<=9;)u.width=u.width*10+$,d++;d--;break;case".":for(u.prec=0,d++;$=_.charCodeAt(d)-48,$>=0&&$<=9;)u.prec=u.prec*10+$,d++;d--;case"d":case"i":u.signedconv=!0;case"u":u.base=10;break;case"x":u.base=16;break;case"X":u.base=16,u.uppercase=!0;break;case"o":u.base=8;break;case"e":case"f":case"g":u.signedconv=!0,u.conv=$;break;case"E":case"F":case"G":u.signedconv=!0,u.uppercase=!0,u.conv=$.toLowerCase();break}}return u}function caml_finish_formatting(_,e){_.uppercase&&(e=e.toUpperCase());var u=e.length;_.signedconv&&(_.sign<0||_.signstyle!="-")&&u++,_.alternate&&(_.base==8&&(u+=1),_.base==16&&(u+=2));var d="";if(_.justify=="+"&&_.filler==" ")for(var $=u;$<_.width;$++)d+=" ";if(_.signedconv&&(_.sign<0?d+="-":_.signstyle!="-"&&(d+=_.signstyle)),_.alternate&&_.base==8&&(d+="0"),_.alternate&&_.base==16&&(d+="0x"),_.justify=="+"&&_.filler=="0")for(var $=u;$<_.width;$++)d+="0";if(d+=e,_.justify=="-")for(var $=u;$<_.width;$++)d+=" ";return caml_string_of_jsbytes(d)}function caml_format_float(_,e){function u(N,P){if(Math.abs(N)<1)return N.toFixed(P);var V=parseInt(N.toString().split("+")[1]);return V>20?(V-=20,N/=Math.pow(10,V),N+=new Array(V+1).join("0"),P>0&&(N=N+"."+new Array(P+1).join("0")),N):N.toFixed(P)}var d,$=caml_parse_format(_),w=$.prec<0?6:$.prec;if((e<0||e==0&&1/e==-1/0)&&($.sign=-1,e=-e),isNaN(e))d="nan",$.filler=" ";else if(!isFinite(e))d="inf",$.filler=" ";else switch($.conv){case"e":var d=e.toExponential(w),A=d.length;d.charAt(A-3)=="e"&&(d=d.slice(0,A-1)+"0"+d.slice(A-1));break;case"f":d=u(e,w);break;case"g":w=w||1,d=e.toExponential(w-1);var B=d.indexOf("e"),q=+d.slice(B+1);if(q<-4||e>=1e21||e.toFixed(0).length>w){for(var A=B-1;d.charAt(A)=="0";)A--;d.charAt(A)=="."&&A--,d=d.slice(0,A+1)+d.slice(B),A=d.length,d.charAt(A-3)=="e"&&(d=d.slice(0,A-1)+"0"+d.slice(A-1));break}else{var z=w;if(q<0)z-=q+1,d=e.toFixed(z);else for(;d=e.toFixed(z),d.length>w+1;)z--;if(z){for(var A=d.length-1;d.charAt(A)=="0";)A--;d.charAt(A)=="."&&A--,d=d.slice(0,A+1)}}break}return caml_finish_formatting($,d)}function caml_format_int(_,e){if(caml_jsbytes_of_string(_)=="%d")return caml_string_of_jsbytes(""+e);var u=caml_parse_format(_);e<0&&(u.signedconv?(u.sign=-1,e=-e):e>>>=0);var d=e.toString(u.base);if(u.prec>=0){u.filler=" ";var $=u.prec-d.length;$>0&&(d=caml_str_repeat($,"0")+d)}return caml_finish_formatting(u,d)}var kimchi_ffi=globalThis.kimchi_wasm;kimchi_ffi&&(kimchi_ffi.__kimchi_backend="wasm",typeof globalThis<"u"&&(globalThis.__kimchi_backend="wasm"));var tsRustConversion=tsBindings.rustConversion(kimchi_ffi);function caml_fp_srs_b_poly_commitment(_,e){var u=kimchi_ffi.caml_fp_srs_b_poly_commitment(_,tsRustConversion.fp.vectorToRust(e));return tsRustConversion.fp.polyCommFromRust(u)}function caml_fp_srs_batch_accumulator_check(_,e,u){var d=tsRustConversion.fp.pointsToRust(e),$=tsRustConversion.fp.vectorToRust(u),w=kimchi_ffi.caml_fp_srs_batch_accumulator_check(_,d,$);return w}function caml_fp_srs_batch_accumulator_generate(_,e,u){var d=tsRustConversion.fp.vectorToRust(u),$=kimchi_ffi.caml_fp_srs_batch_accumulator_generate(_,e,d);return tsRustConversion.fp.pointsFromRust($)}var tsSrs=tsBindings.srs(kimchi_ffi),caml_fp_srs_create=tsSrs.fp.create;function caml_fp_srs_h(_){return tsRustConversion.fp.pointFromRust(kimchi_ffi.caml_fp_srs_h(_))}var caml_fp_srs_lagrange_commitment=tsSrs.fp.lagrangeCommitment,caml_fp_srs_lagrange_commitments_whole_domain=tsSrs.fp.lagrangeCommitmentsWholeDomain;function caml_jsstring_of_string(_){return _.toUtf16()}function caml_fp_srs_read(_,e){_===0?_=void 0:_=_[1];var u=kimchi_ffi.caml_fp_srs_read(_,caml_jsstring_of_string(e));return u?[0,u]:0}function caml_fp_srs_write(_,e,u){return _===0?_=void 0:_=_[1],kimchi_ffi.caml_fp_srs_write(_,e,caml_jsstring_of_string(u))}var caml_fp_vector_create=tsBindings.caml_fp_vector_create,caml_fp_vector_emplace_back=tsBindings.caml_fp_vector_emplace_back,caml_fp_vector_get=tsBindings.caml_fp_vector_get,caml_fp_vector_length=tsBindings.caml_fp_vector_length;function caml_fq_srs_add_lagrange_basis(_,e){return tsSrs.fq.addLagrangeBasis(_,e)}function caml_fq_srs_b_poly_commitment(_,e){var u=kimchi_ffi.caml_fq_srs_b_poly_commitment(_,tsR