o1js
Version:
TypeScript framework for zk-SNARKs and zkApps
2 lines • 7.91 MB
JavaScript
(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 U(u,0,!1),$=typeof module<"u",w;$?(w=module.exports=N,w.strftime=V,e&&(e.strftime=N)):(w=e||function(){return this||(0,eval)("this")}(),w.strftime=N);var B=$?"require('strftime')":"strftime",q={};function z(__,r_){q[__]||(typeof console<"u"&&typeof console.warn=="function"&&console.warn("[WARNING] "+__+" is deprecated and will be removed in version 1.0. Instead, use `"+r_+"`."),q[__]=!0)}w.strftimeTZ=I,w.strftimeUTC=R,w.localizedStrftime=Y;function P(__){__.localize=d.localize.bind(d),__.timezone=d.timezone.bind(d),__.utc=d.utc.bind(d)}P(N);function N(__,r_,a_){r_&&r_.days&&(a_=r_,r_=void 0),a_&&z("`"+B+"(format, [date], [locale])`","var s = "+B+".localize(locale); s(format, [date])");var t_=a_?d.localize(a_):d;return t_(__,r_)}P(V);function V(__,r_,a_){a_?z("`"+B+".strftime(format, [date], [locale])`","var s = "+B+".localize(locale); s(format, [date])"):z("`"+B+".strftime(format, [date])`",B+"(format, [date])");var t_=a_?d.localize(a_):d;return t_(__,r_)}function I(__,r_,a_,t_){(typeof a_=="number"||typeof a_=="string")&&t_==null&&(t_=a_,a_=void 0),a_?z("`"+B+".strftimeTZ(format, date, locale, tz)`","var s = "+B+".localize(locale).timezone(tz); s(format, [date])` or `var s = "+B+".localize(locale); s.timezone(tz)(format, [date])"):z("`"+B+".strftimeTZ(format, date, tz)`","var s = "+B+".timezone(tz); s(format, [date])` or `"+B+".timezone(tz)(format, [date])");var e_=(a_?d.localize(a_):d).timezone(t_);return e_(__,r_)}var L=d.utc();function R(__,r_,a_){a_?z("`"+B+".strftimeUTC(format, date, locale)`","var s = "+B+".localize(locale).utc(); s(format, [date])"):z("`"+B+".strftimeUTC(format, [date])`","var s = "+B+".utc(); s(format, [date])");var t_=a_?L.localize(a_):L;return t_(__,r_)}function Y(__){return z("`"+B+".localizedStrftime(locale)`",B+".localize(locale)"),d.localize(__)}typeof Date.now!="function"&&(Date.now=function(){return+new Date});function U(__,r_,a_){var t_=__||u,e_=r_||0,n_=a_||!1,c_=0,f_;function s_(u_,b_){var x_;if(b_)x_=b_.getTime(),n_&&(b_=new Date(b_.getTime()+G(b_)+e_));else{var d_=Date.now();d_>c_&&(c_=d_,f_=new Date(c_),x_=c_,n_&&(f_=new Date(c_+G(f_)+e_))),b_=f_}return i_(u_,b_,t_,x_)}function i_(u_,b_,x_,d_){for(var y_="",F_=null,h_=!1,v_=u_.length,E_=!1,$_=0;$_<v_;$_++){var p_=u_.charCodeAt($_);if(h_===!0){if(p_===45){F_="";continue}else if(p_===95){F_=" ";continue}else if(p_===48){F_="0";continue}else if(p_===58){E_&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),E_=!0;continue}switch(p_){case 65:y_+=x_.days[b_.getDay()];break;case 66:y_+=x_.months[b_.getMonth()];break;case 67:y_+=W(Math.floor(b_.getFullYear()/100),F_);break;case 68:y_+=i_(x_.formats.D,b_,x_,d_);break;case 70:y_+=i_(x_.formats.F,b_,x_,d_);break;case 72:y_+=W(b_.getHours(),F_);break;case 73:y_+=W(Z(b_.getHours()),F_);break;case 76:y_+=Q(Math.floor(d_%1e3));break;case 77:y_+=W(b_.getMinutes(),F_);break;case 80:y_+=b_.getHours()<12?x_.am:x_.pm;break;case 82:y_+=i_(x_.formats.R,b_,x_,d_);break;case 83:y_+=W(b_.getSeconds(),F_);break;case 84:y_+=i_(x_.formats.T,b_,x_,d_);break;case 85:y_+=W(J(b_,"sunday"),F_);break;case 87:y_+=W(J(b_,"monday"),F_);break;case 88:y_+=i_(x_.formats.X,b_,x_,d_);break;case 89:y_+=b_.getFullYear();break;case 90:if(n_&&e_===0)y_+="GMT";else{var L_=b_.toString().match(/\(([\w\s]+)\)/);y_+=L_&&L_[1]||""}break;case 97:y_+=x_.shortDays[b_.getDay()];break;case 98:y_+=x_.shortMonths[b_.getMonth()];break;case 99:y_+=i_(x_.formats.c,b_,x_,d_);break;case 100:y_+=W(b_.getDate(),F_);break;case 101:y_+=W(b_.getDate(),F_??" ");break;case 104:y_+=x_.shortMonths[b_.getMonth()];break;case 106:var C_=new Date(b_.getFullYear(),0,1),U_=Math.ceil((b_.getTime()-C_.getTime())/(1e3*60*60*24));y_+=Q(U_);break;case 107:y_+=W(b_.getHours(),F_??" ");break;case 108:y_+=W(Z(b_.getHours()),F_??" ");break;case 109:y_+=W(b_.getMonth()+1,F_);break;case 110:y_+=`
`;break;case 111:y_+=String(b_.getDate())+X(b_.getDate());break;case 112:y_+=b_.getHours()<12?x_.AM:x_.PM;break;case 114:y_+=i_(x_.formats.r,b_,x_,d_);break;case 115:y_+=Math.floor(d_/1e3);break;case 116:y_+=" ";break;case 117:var U_=b_.getDay();y_+=U_===0?7:U_;break;case 118:y_+=i_(x_.formats.v,b_,x_,d_);break;case 119:y_+=b_.getDay();break;case 120:y_+=i_(x_.formats.x,b_,x_,d_);break;case 121:y_+=(""+b_.getFullYear()).slice(2);break;case 122:if(n_&&e_===0)y_+=E_?"+00:00":"+0000";else{var T_;e_!==0?T_=e_/(60*1e3):T_=-b_.getTimezoneOffset();var D_=T_<0?"-":"+",Y_=E_?":":"",N_=Math.floor(Math.abs(T_/60)),W_=Math.abs(T_%60);y_+=D_+W(N_)+Y_+W(W_)}break;default:y_+=u_[$_];break}F_=null,h_=!1;continue}if(p_===37){h_=!0;continue}y_+=u_[$_]}return y_}var o_=s_;return o_.localize=function(u_){return new U(u_||t_,e_,n_)},o_.timezone=function(u_){var b_=e_,x_=n_,d_=typeof u_;if(d_==="number"||d_==="string")if(x_=!0,d_==="string"){var y_=u_[0]==="-"?-1:1,F_=parseInt(u_.slice(1,3),10),h_=parseInt(u_.slice(3,5),10);b_=y_*(60*F_+h_)*60*1e3}else d_==="number"&&(b_=u_*60*1e3);return new U(t_,b_,x_)},o_.utc=function(){return new U(t_,e_,!0)},o_}function W(__,r_){return r_===""||__>9?__:(r_==null&&(r_="0"),r_+__)}function Q(__){return __>99?__:__>9?"0"+__:"00"+__}function Z(__){return __===0?12:__>12?__-12:__}function J(__,r_){r_=r_||"sunday";var a_=__.getDay();r_==="monday"&&(a_===0?a_=6:a_--);var t_=Date.UTC(__.getFullYear(),0,1),e_=Date.UTC(__.getFullYear(),__.getMonth(),__.getDate()),n_=Math.floor((e_-t_)/864e5),c_=(n_+7-a_)/7;return Math.floor(c_)}function X(__){var r_=__%10,a_=__%100;if(a_>=11&&a_<=13||r_===0||r_>=4)return"th";switch(r_){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function G(__){return(__.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 B=_|0;return $=$&15|e|u<<4,caml_int64_create_lo_mi_hi(B,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,B,q=0,z=_.length;q<z;q++){if($=_.charCodeAt(q),$<128){for(var P=q+1;P<z&&($=_.charCodeAt(P))<128;P++);if(P-q>512?(u.substr(0,1),e+=u,u="",e+=_.slice(q,P)):u+=_.slice(q,P),P==z)break;q=P}B=1,++q<z&&((w=_.charCodeAt(q))&-64)==128&&(d=w+($<<6),$<224?(B=d-12416,B<128&&(B=1)):(B=2,++q<z&&((w=_.charCodeAt(q))&-64)==128&&(d=w+(d<<6),$<240?(B=d-925824,(B<2048||B>=55295&&B<57344)&&(B=2)):(B=3,++q<z&&((w=_.charCodeAt(q))&-64)==128&&$<245&&(B=w-63447168+(d<<6),(B<65536||B>1114111)&&(B=3)))))),B<4?(q-=B,u+="\uFFFD"):B>65535?u+=String.fromCharCode(55232+(B>>10),56320+(B&1023)):u+=String.fromCharCode(B),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 B=e.get(d),$=caml_int64_to_bytes(caml_int64_bits_of_float(B[1])),w=0;w<8;w++)_.write(8,$[w]);for(var $=caml_int64_to_bytes(caml_int64_bits_of_float(B[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),B=(e*w+u)*w+(d&15);return $>0?(B+=16,B*=Math.pow(2,$-1027)):B*=Math.pow(2,-1026),d&32768&&(B=-B),B}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,B,$=0;$<this.data.length;$++){if(w=this.data[$],B=_.data[$],w<B)return-1;if(w>B)return 1;if(w!=B){if(!e)return NaN;if(w==w)return 1;if(B==B)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,B=$>>8&1,q=[];if(u=="_bigarr02")for(var z=0;z<d;z++){var P=_.read16u();if(P==65535){var N=_.read32u(),V=_.read32u();N!=0&&caml_failwith("input_value: bigarray dimension overflow in 32bit"),P=V}q.push(P)}else for(var z=0;z<d;z++)q.push(_.read32u());var I=caml_ba_get_size(q),L=caml_ba_create_buffer(w,I),R=caml_ba_create_unsafe(w,B,q,L);switch(w){case 2:for(var z=0;z<I;z++)L[z]=_.read8s();break;case 3:case 12:for(var z=0;z<I;z++)L[z]=_.read8u();break;case 4:for(var z=0;z<I;z++)L[z]=_.read16s();break;case 5:for(var z=0;z<I;z++)L[z]=_.read16u();break;case 6:for(var z=0;z<I;z++)L[z]=_.read32s();break;case 8:case 9:var Y=_.read8u();Y&&caml_failwith("input_value: cannot read bigarray with 64-bit OCaml ints");for(var z=0;z<I;z++)L[z]=_.read32s();break;case 7:for(var U=new Array(8),z=0;z<I;z++){for(var W=0;W<8;W++)U[W]=_.read8u();var Q=caml_int64_of_bytes(U);R.set(z,Q)}break;case 1:for(var U=new Array(8),z=0;z<I;z++){for(var W=0;W<8;W++)U[W]=_.read8u();var Z=caml_int64_float_of_bits(caml_int64_of_bytes(U));R.set(z,Z)}break;case 0:for(var z=0;z<I;z++){var Z=caml_int32_float_of_bits(_.read32s());R.set(z,Z)}break;case 10:for(var z=0;z<I;z++){var J=caml_int32_float_of_bits(_.read32s()),X=caml_int32_float_of_bits(_.read32s());R.set(z,[254,J,X])}break;case 11:for(var U=new Array(8),z=0;z<I;z++){for(var W=0;W<8;W++)U[W]=_.read8u();for(var J=caml_int64_float_of_bits(caml_int64_of_bytes(U)),W=0;W<8;W++)U[W]=_.read8u();var X=caml_int64_float_of_bits(caml_int64_of_bytes(U));R.set(z,[254,J,X])}break}return e[0]=(4+d)*4,caml_ba_create_unsafe(w,B,q,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,B,q,z,P,N,V,I;for(q=e,(q<0||q>256)&&(q=256),z=_,P=u,$=[d],w=0,B=1;w<B&&z>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);P=caml_hash_mix_int(P,L),z--}}else if(N instanceof Array&&N[0]===(N[0]|0))switch(N[0]){case 248:P=caml_hash_mix_int(P,N[2]),z--;break;case 250:$[--w]=N[1];break;default:var R=N.length-1<<10|N[0];for(P=caml_hash_mix_int(P,R),V=1,I=N.length;V<I&&!(B>=q);V++)$[B++]=N[V];break}else caml_is_ml_bytes(N)?(P=caml_hash_mix_bytes(P,N),z--):caml_is_ml_string(N)?(P=caml_hash_mix_string(P,N),z--):typeof N=="string"?(P=caml_hash_mix_jsbytes(P,N),z--):N===(N|0)?(P=caml_hash_mix_int(P,N+N+1),z--):N===+N&&(P=caml_hash_mix_float(P,N),z--);return P=caml_hash_mix_final(P),P&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,B){return caml_int64_and(w,B)}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 B=(_.data[e+w]>>>0)+$;if(_.data[e+w]=B|0,B==B>>>0){$=0;break}else $=1}return $}function add_nat(_,e,u,d,$,w,B){for(var q=B,z=0;z<w;z++){var P=(_.data[e+z]>>>0)+(d.data[$+z]>>>0)+q;_.data[e+z]=P,P==P>>>0?q=0:q=1}return incr_nat(_,e+w,u-w,q)}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,B=u.c;if(_.t==4)if(d<=e)for(var q=0;q<$;q++)B[d+q]=w[e+q];else for(var q=$-1;q>=0;q--)B[d+q]=w[e+q];else{for(var z=Math.min($,w.length-e),q=0;q<z;q++)B[d+q]=w.charCodeAt(e+q);for(;q<$;q++)B[d+q]=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 B=_.data.slice(w,w+$);return caml_blit_bytes(caml_bytes_of_array(B),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 B=caml_array_of_bytes(_).slice(e,e+$);return u.data.set(B,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 B=caml_array_of_string(_).slice(e,e+$);return u.data.set(B,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),B=u.offset(d);w+$>_.data.length&&caml_array_bound_error(),B+$>u.data.length&&caml_array_bound_error();var q=_.data.subarray(w,w+$);return u.data.set(q,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($),B=new joo_global_object.Uint8Array(w.buffer);B.set(e.data.subarray(_,_+$*8));for(var q=0;q<$;q++)d[u+q+1]=w[q];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(_,_+$)),B=new joo_global_object.Uint8Array(w.buffer),q=d.data.subarray(u,u+$*8);return q.set(B),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 B=1,q=1;B<u;B++)w[B]=_[B];for(;B<$;B++,q++)w[B]=e[q];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 B=[],w=0;w<_.dims.length;w++)B[w]=_.dims[w];B[d]=u,$*=caml_ba_get_size_per_element(_.kind);var q=_.data.subarray(e*$,(e+u)*$);return caml_ba_create_unsafe(_.kind,_.layout,B,q)}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),B=_.get(u+3);return d<<0|$<<8|w<<16|B<<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),B=_.get(u+3),q=_.get(u+4),z=_.get(u+5),P=_.get(u+6),N=_.get(u+7);return caml_int64_of_bytes([N,P,z,q,B,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_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_bytes_equal(_,e){return _===e?1:(_.t&6&&caml_convert_string_to_bytes(_),e.t&6&&caml_convert_string_to_bytes(e),_.c==e.c?1:0)}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_lessequal(_,e){return _.t&6&&caml_convert_string_to_bytes(_),e.t&6&&caml_convert_string_to_bytes(e),_.c<=e.c?1:0}function caml_bytes_greaterequal(_,e){return caml_bytes_lessequal(e,_)}function caml_bytes_lessthan(_,e){return _.t&6&&caml_convert_string_to_bytes(_),e.t&6&&caml_convert_string_to_bytes(e),_.c<e.c?1:0}function caml_bytes_greaterthan(_,e){return caml_bytes_lessthan(e,_)}function caml_bytes_notequal(_,e){return 1-caml_bytes_equal(_,e)}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,B=255&u;return caml_bytes_unsafe_set(_,e+0,B),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,B=new Array(e.length+w),q=0;q<e.length;q++)B[q]=e[q];for(var q=0;q<arguments.length;q++)B[e.length+q]=arguments[q];return caml_call_gen(_,B)}}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_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 q=caml_int_compare(_[2],e[2]);if(q!=0)return q|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 q=caml_bytes_compare(_,e);if(q!=0)return q|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 B=caml_compare_val_get_custom(_);if(B!=caml_compare_val_get_custom(e))return _.caml_custom<e.caml_custom?-1:1;B||caml_invalid_argument("compare: abstract value");var q=B(_,e,u);if(q!=q)return u?-1:q;if(q!==(q|0))return-1;if(q!=0)return q|0;break;case 1256:var q=_.compare(e,u);if(q!=q)return u?-1:q;if(q!==(q|0))return-1;if(q!=0)return q|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 z=d.pop();e=d.pop(),_=d.pop(),z+1<_.length&&d.push(_,e,z+1),_=_[z],e=e[z]}}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,V){if(Math.abs(N)<1)return N.toFixed(V);var I=parseInt(N.toString().split("+")[1]);return I>20?(I-=20,N/=Math.pow(10,I),N+=new Array(I+1).join("0"),V>0&&(N=N+"."+new Array(V+1).join("0")),N):N.toFixed(V)}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),B=d.length;d.charAt(B-3)=="e"&&(d=d.slice(0,B-1)+"0"+d.slice(B-1));break;case"f":d=u(e,w);break;case"g":w=w||1,d=e.toExponential(w-1);var q=d.indexOf("e"),z=+d.slice(q+1);if(z<-4||e>=1e21||e.toFixed(0).length>w){for(var B=q-1;d.charAt(B)=="0";)B--;d.charAt(B)=="."&&B--,d=d.slice(0,B+1)+d.slice(q),B=d.length,d.charAt(B-3)=="e"&&(d=d.slice(0,B-1)+"0"+d.slice(B-1));break}else{var P=w;if(z<0)P-=z+1,d=e.toFixed(P);else for(;d=e.toFixed(P),d.length>w+1;)P--;if(P){for(var B=d.length-1;d.charAt(B)=="0";)B--;d.charAt(B)=="."&&B--,d=d.slice(0,B+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 plonk_wasm=globalThis.plonk_wasm,tsRustConversion=tsBindings.rustConversion(plonk_wasm);function caml_fp_srs_b_poly_commitment(_,e){var u=plonk_wasm.caml_fp_srs_b_poly_commitment(_,tsRustConversion.fieldsToRustFlat(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=plonk_wasm.caml_fp_srs_batch_accumulator_check(_,d,$);return w}function caml_fp_srs_batch_accumulator_generate(_,e,u){var d=tsRustConversion.fp.vectorToRust(u),$=plonk_wasm.caml_fp_srs_batch_accumulator_generate(_,e,d);return tsRustConversion.fp.pointsFromRust($)}var tsSrs=tsBindings.srs(plonk_wasm),caml_fp_srs_create=tsSrs.fp.create;function caml_fp_srs_h(_){return tsRustConversion.fp.pointFromRust(plonk_wasm.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=plonk_wasm.caml_fp_srs_read(_,caml_jsstring_of_string(e));return u?[0,u]:0}funct