@aztec/bb.js 0.0.1-alpha.4 → 0.0.1-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see simple_test.js.LICENSE.txt */
2
- (()=>{var e={742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(e,t,r)=>{"use strict";const n=r(742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return f(e),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:Z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(q(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return H(Z(t,e.length-r),e,r,n)}function E(e,t,r,n){return H(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function B(e,t,r,n){return H(G(t),e,r,n)}function x(e,t,r,n){return H(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==f[e]){o=c[e],s=f[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return B(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function F(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){N(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function U(e,t,r,n,i){N(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const D={};function j(e,t,r){D[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function z(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function V(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function Z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},435:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},227:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(447)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(435),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):d(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,f=d(u,c);for(r=0;r<c;++r)n(f[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncMap=void 0,t.asyncMap=async function(e,t){const r=[];for(let n=0;n<e.length;++n)r.push(await t(e[n],n));return r}},271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarretenbergApiSync=t.BarretenbergApi=void 0;const n=r(456),i=r(696);t.BarretenbergApi=class{constructor(e){this.binder=e}async destroy(){await this.binder.wasm.destroy()}async pedersenInit(){await this.binder.callWasmExport("pedersen_init",[],[])}async pedersenCompressFields(e,t){return(await this.binder.callWasmExport("pedersen_compress_fields",[e,t],[i.Fr]))[0]}async pedersenPlookupCompressFields(e,t){return(await this.binder.callWasmExport("pedersen_plookup_compress_fields",[e,t],[i.Fr]))[0]}async pedersenCompress(e){return(await this.binder.callWasmExport("pedersen_compress",[e],[i.Fr]))[0]}async pedersenPlookupCompress(e){return(await this.binder.callWasmExport("pedersen_plookup_compress",[e],[i.Fr]))[0]}async pedersenCompressWithHashIndex(e,t){return(await this.binder.callWasmExport("pedersen_compress_with_hash_index",[e,t],[i.Fr]))[0]}async pedersenCommit(e){return(await this.binder.callWasmExport("pedersen_commit",[e],[i.Fr]))[0]}async pedersenPlookupCommit(e){return(await this.binder.callWasmExport("pedersen_plookup_commit",[e],[i.Fr]))[0]}async pedersenBufferToField(e){return(await this.binder.callWasmExport("pedersen_buffer_to_field",[e],[i.Fr]))[0]}async pedersenHashInit(){await this.binder.callWasmExport("pedersen_hash_init",[],[])}async pedersenHashPair(e,t){return(await this.binder.callWasmExport("pedersen_hash_pair",[e,t],[i.Fr]))[0]}async pedersenHashMultiple(e){return(await this.binder.callWasmExport("pedersen_hash_multiple",[e],[i.Fr]))[0]}async pedersenHashMultipleWithHashIndex(e,t){return(await this.binder.callWasmExport("pedersen_hash_multiple_with_hash_index",[e,t],[i.Fr]))[0]}async pedersenHashToTree(e){return(await this.binder.callWasmExport("pedersen_hash_to_tree",[e],[(0,n.VectorDeserializer)(i.Fr)]))[0]}async blake2s(e){return(await this.binder.callWasmExport("blake2s",[e],[i.Buffer32]))[0]}async blake2sToField(e){return(await this.binder.callWasmExport("blake2s_to_field_",[e],[i.Fr]))[0]}async schnorrComputePublicKey(e){return(await this.binder.callWasmExport("schnorr_compute_public_key",[e],[i.Point]))[0]}async schnorrNegatePublicKey(e){return(await this.binder.callWasmExport("schnorr_negate_public_key",[e],[i.Point]))[0]}async schnorrConstructSignature(e,t){return await this.binder.callWasmExport("schnorr_construct_signature",[e,t],[i.Buffer32,i.Buffer32])}async schnorrVerifySignature(e,t,r,i){return(await this.binder.callWasmExport("schnorr_verify_signature",[e,t,r,i],[(0,n.BoolDeserializer)()]))[0]}async schnorrMultisigCreateMultisigPublicKey(e){return(await this.binder.callWasmExport("schnorr_multisig_create_multisig_public_key",[e],[i.Buffer128]))[0]}async schnorrMultisigValidateAndCombineSignerPubkeys(e){return await this.binder.callWasmExport("schnorr_multisig_validate_and_combine_signer_pubkeys",[e],[i.Point,(0,n.BoolDeserializer)()])}async schnorrMultisigConstructSignatureRound1(){return await this.binder.callWasmExport("schnorr_multisig_construct_signature_round_1",[],[i.Buffer128,i.Buffer128])}async schnorrMultisigConstructSignatureRound2(e,t,r,o,s){return await this.binder.callWasmExport("schnorr_multisig_construct_signature_round_2",[e,t,r,o,s],[i.Fq,(0,n.BoolDeserializer)()])}async schnorrMultisigCombineSignatures(e,t,r,o){return await this.binder.callWasmExport("schnorr_multisig_combine_signatures",[e,t,r,o],[i.Buffer32,i.Buffer32,(0,n.BoolDeserializer)()])}async srsInitSrs(e,t,r){await this.binder.callWasmExport("srs_init_srs",[e,t,r],[])}async examplesSimpleCreateAndVerifyProof(){return(await this.binder.callWasmExport("examples_simple_create_and_verify_proof",[],[(0,n.BoolDeserializer)()]))[0]}async testThreads(e,t){return(await this.binder.callWasmExport("test_threads",[e,t],[(0,n.NumberDeserializer)()]))[0]}async testThreadAbort(){await this.binder.callWasmExport("test_thread_abort",[],[])}async testAbort(){await this.binder.callWasmExport("test_abort",[],[])}async commonInitSlabAllocator(e){await this.binder.callWasmExport("common_init_slab_allocator",[e],[])}async acirGetCircuitSizes(e){return await this.binder.callWasmExport("acir_get_circuit_sizes",[e],[(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)()])}async acirNewAcirComposer(){return(await this.binder.callWasmExport("acir_new_acir_composer",[],[i.Ptr]))[0]}async acirDeleteAcirComposer(e){await this.binder.callWasmExport("acir_delete_acir_composer",[e],[])}async acirCreateCircuit(e,t,r){await this.binder.callWasmExport("acir_create_circuit",[e,t,r],[])}async acirInitProvingKey(e,t,r){await this.binder.callWasmExport("acir_init_proving_key",[e,t,r],[])}async acirCreateProof(e,t,r,i){return(await this.binder.callWasmExport("acir_create_proof",[e,t,r,i],[(0,n.BufferDeserializer)()]))[0]}async acirLoadVerificationKey(e,t){await this.binder.callWasmExport("acir_load_verification_key",[e,t],[])}async acirInitVerificationKey(e){await this.binder.callWasmExport("acir_init_verification_key",[e],[])}async acirGetVerificationKey(e){return(await this.binder.callWasmExport("acir_get_verification_key",[e],[(0,n.BufferDeserializer)()]))[0]}async acirVerifyProof(e,t,r){return(await this.binder.callWasmExport("acir_verify_proof",[e,t,r],[(0,n.BoolDeserializer)()]))[0]}async acirGetSolidityVerifier(e){return(await this.binder.callWasmExport("acir_get_solidity_verifier",[e],[(0,n.StringDeserializer)()]))[0]}async acirSerializeProofIntoFields(e,t,r){return(await this.binder.callWasmExport("acir_serialize_proof_into_fields",[e,t,r],[(0,n.VectorDeserializer)(i.Fr)]))[0]}async acirSerializeVerificationKeyIntoFields(e){return await this.binder.callWasmExport("acir_serialize_verification_key_into_fields",[e],[(0,n.VectorDeserializer)(i.Fr),i.Fr])}},t.BarretenbergApiSync=class{constructor(e){this.binder=e}async destroy(){await this.binder.wasm.destroy()}pedersenInit(){this.binder.callWasmExport("pedersen_init",[],[])}pedersenCompressFields(e,t){return this.binder.callWasmExport("pedersen_compress_fields",[e,t],[i.Fr])[0]}pedersenPlookupCompressFields(e,t){return this.binder.callWasmExport("pedersen_plookup_compress_fields",[e,t],[i.Fr])[0]}pedersenCompress(e){return this.binder.callWasmExport("pedersen_compress",[e],[i.Fr])[0]}pedersenPlookupCompress(e){return this.binder.callWasmExport("pedersen_plookup_compress",[e],[i.Fr])[0]}pedersenCompressWithHashIndex(e,t){return this.binder.callWasmExport("pedersen_compress_with_hash_index",[e,t],[i.Fr])[0]}pedersenCommit(e){return this.binder.callWasmExport("pedersen_commit",[e],[i.Fr])[0]}pedersenPlookupCommit(e){return this.binder.callWasmExport("pedersen_plookup_commit",[e],[i.Fr])[0]}pedersenBufferToField(e){return this.binder.callWasmExport("pedersen_buffer_to_field",[e],[i.Fr])[0]}pedersenHashInit(){this.binder.callWasmExport("pedersen_hash_init",[],[])}pedersenHashPair(e,t){return this.binder.callWasmExport("pedersen_hash_pair",[e,t],[i.Fr])[0]}pedersenHashMultiple(e){return this.binder.callWasmExport("pedersen_hash_multiple",[e],[i.Fr])[0]}pedersenHashMultipleWithHashIndex(e,t){return this.binder.callWasmExport("pedersen_hash_multiple_with_hash_index",[e,t],[i.Fr])[0]}pedersenHashToTree(e){return this.binder.callWasmExport("pedersen_hash_to_tree",[e],[(0,n.VectorDeserializer)(i.Fr)])[0]}blake2s(e){return this.binder.callWasmExport("blake2s",[e],[i.Buffer32])[0]}blake2sToField(e){return this.binder.callWasmExport("blake2s_to_field_",[e],[i.Fr])[0]}schnorrComputePublicKey(e){return this.binder.callWasmExport("schnorr_compute_public_key",[e],[i.Point])[0]}schnorrNegatePublicKey(e){return this.binder.callWasmExport("schnorr_negate_public_key",[e],[i.Point])[0]}schnorrConstructSignature(e,t){return this.binder.callWasmExport("schnorr_construct_signature",[e,t],[i.Buffer32,i.Buffer32])}schnorrVerifySignature(e,t,r,i){return this.binder.callWasmExport("schnorr_verify_signature",[e,t,r,i],[(0,n.BoolDeserializer)()])[0]}schnorrMultisigCreateMultisigPublicKey(e){return this.binder.callWasmExport("schnorr_multisig_create_multisig_public_key",[e],[i.Buffer128])[0]}schnorrMultisigValidateAndCombineSignerPubkeys(e){return this.binder.callWasmExport("schnorr_multisig_validate_and_combine_signer_pubkeys",[e],[i.Point,(0,n.BoolDeserializer)()])}schnorrMultisigConstructSignatureRound1(){return this.binder.callWasmExport("schnorr_multisig_construct_signature_round_1",[],[i.Buffer128,i.Buffer128])}schnorrMultisigConstructSignatureRound2(e,t,r,o,s){return this.binder.callWasmExport("schnorr_multisig_construct_signature_round_2",[e,t,r,o,s],[i.Fq,(0,n.BoolDeserializer)()])}schnorrMultisigCombineSignatures(e,t,r,o){return this.binder.callWasmExport("schnorr_multisig_combine_signatures",[e,t,r,o],[i.Buffer32,i.Buffer32,(0,n.BoolDeserializer)()])}srsInitSrs(e,t,r){this.binder.callWasmExport("srs_init_srs",[e,t,r],[])}examplesSimpleCreateAndVerifyProof(){return this.binder.callWasmExport("examples_simple_create_and_verify_proof",[],[(0,n.BoolDeserializer)()])[0]}testThreads(e,t){return this.binder.callWasmExport("test_threads",[e,t],[(0,n.NumberDeserializer)()])[0]}testThreadAbort(){this.binder.callWasmExport("test_thread_abort",[],[])}testAbort(){this.binder.callWasmExport("test_abort",[],[])}commonInitSlabAllocator(e){this.binder.callWasmExport("common_init_slab_allocator",[e],[])}acirGetCircuitSizes(e){return this.binder.callWasmExport("acir_get_circuit_sizes",[e],[(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)()])}acirNewAcirComposer(){return this.binder.callWasmExport("acir_new_acir_composer",[],[i.Ptr])[0]}acirDeleteAcirComposer(e){this.binder.callWasmExport("acir_delete_acir_composer",[e],[])}acirCreateCircuit(e,t,r){this.binder.callWasmExport("acir_create_circuit",[e,t,r],[])}acirInitProvingKey(e,t,r){this.binder.callWasmExport("acir_init_proving_key",[e,t,r],[])}acirCreateProof(e,t,r,i){return this.binder.callWasmExport("acir_create_proof",[e,t,r,i],[(0,n.BufferDeserializer)()])[0]}acirLoadVerificationKey(e,t){this.binder.callWasmExport("acir_load_verification_key",[e,t],[])}acirInitVerificationKey(e){this.binder.callWasmExport("acir_init_verification_key",[e],[])}acirGetVerificationKey(e){return this.binder.callWasmExport("acir_get_verification_key",[e],[(0,n.BufferDeserializer)()])[0]}acirVerifyProof(e,t,r){return this.binder.callWasmExport("acir_verify_proof",[e,t,r],[(0,n.BoolDeserializer)()])[0]}acirGetSolidityVerifier(e){return this.binder.callWasmExport("acir_get_solidity_verifier",[e],[(0,n.StringDeserializer)()])[0]}acirSerializeProofIntoFields(e,t,r){return this.binder.callWasmExport("acir_serialize_proof_into_fields",[e,t,r],[(0,n.VectorDeserializer)(i.Fr)])[0]}acirSerializeVerificationKeyIntoFields(e){return this.binder.callWasmExport("acir_serialize_verification_key_into_fields",[e],[(0,n.VectorDeserializer)(i.Fr),i.Fr])}}},630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeapAllocator=void 0;const n=r(456),i=r(463);t.HeapAllocator=class{constructor(e){this.wasm=e,this.allocs=[],this.inScratchRemaining=1024,this.outScratchRemaining=1024}async copyToMemory(e){return await(0,i.asyncMap)(e.map(n.serializeBufferable),(async e=>{if(e.length<=this.inScratchRemaining){const t=this.inScratchRemaining-=e.length;return await this.wasm.writeMemory(t,e),t}{const t=await this.wasm.call("bbmalloc",e.length);return await this.wasm.writeMemory(t,e),this.allocs.push(t),t}}))}async getOutputPtrs(e){return await(0,i.asyncMap)(e,(async e=>{const t=e.SIZE_IN_BYTES||4;if(t<=this.outScratchRemaining)return this.outScratchRemaining-=t;{const e=await this.wasm.call("bbmalloc",t);return this.allocs.push(e),e}}))}addOutputPtr(e){e>=1024&&this.allocs.push(e)}async freeAll(){for(const e of this.allocs)await this.wasm.call("bbfree",e)}}},643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeapAllocatorSync=void 0;const n=r(456);t.HeapAllocatorSync=class{constructor(e){this.wasm=e,this.allocs=[],this.inScratchRemaining=1024,this.outScratchRemaining=1024}copyToMemory(e){return e.map(n.serializeBufferable).map((e=>{if(e.length<=this.inScratchRemaining){const t=this.inScratchRemaining-=e.length;return this.wasm.writeMemory(t,e),t}{const t=this.wasm.call("bbmalloc",e.length);return this.wasm.writeMemory(t,e),this.allocs.push(t),t}}))}getOutputPtrs(e){return e.map((e=>{const t=e.SIZE_IN_BYTES||4;if(t<=this.outScratchRemaining)return this.outScratchRemaining-=t;{const e=this.wasm.call("bbmalloc",t);return this.allocs.push(e),e}}))}addOutputPtr(e){e>=1024&&this.allocs.push(e)}freeAll(){for(const e of this.allocs)this.wasm.call("bbfree",e)}}},730:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarretenbergBinderSync=t.BarretenbergBinder=void 0;const n=r(630),i=r(463),o=r(643);t.BarretenbergBinder=class{constructor(e){this.wasm=e}async callWasmExport(e,t,r){const i=new n.HeapAllocator(this.wasm),o=await i.copyToMemory(t),s=await i.getOutputPtrs(r);await this.wasm.call(e,...o,...s);const a=this.deserializeOutputArgs(r,s,i);return await i.freeAll(),a}deserializeOutputArgs(e,t,r){return(0,i.asyncMap)(e,(async(e,n)=>{if(e.SIZE_IN_BYTES){const r=await this.wasm.getMemorySlice(t[n],t[n]+e.SIZE_IN_BYTES);return e.fromBuffer(r)}const i=await this.wasm.getMemorySlice(t[n],t[n]+4),o=new DataView(i.buffer,i.byteOffset,i.byteLength).getUint32(0,!0);return r.addOutputPtr(o),e.fromBuffer(await this.wasm.getMemorySlice(o))}))}},t.BarretenbergBinderSync=class{constructor(e){this.wasm=e}callWasmExport(e,t,r){const n=new o.HeapAllocatorSync(this.wasm),i=n.copyToMemory(t),s=n.getOutputPtrs(r);this.wasm.call(e,...i,...s);const a=this.deserializeOutputArgs(r,s,n);return n.freeAll(),a}deserializeOutputArgs(e,t,r){return e.map(((e,n)=>{if(e.SIZE_IN_BYTES){const r=this.wasm.getMemorySlice(t[n],t[n]+e.SIZE_IN_BYTES);return e.fromBuffer(r)}const i=this.wasm.getMemorySlice(t[n],t[n]+4),o=new DataView(i.buffer,i.byteOffset,i.byteLength).getUint32(0,!0);return r.addOutputPtr(o),e.fromBuffer(this.wasm.getMemorySlice(o))}))}}},640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarretenbergWasm=void 0;const n=r(655),i=r(187),o=n.__importDefault(r(227)),s=r(375),a=r(324),u=r(581),c=(0,o.default)("bb.js:wasm");i.EventEmitter.defaultMaxListeners=30;class f{constructor(){this.memStore={},this.workers=[],this.remoteWasms=[],this.nextWorker=0,this.nextThreadId=1,this.isThread=!1,this.logger=c}static async new(){const e=new f;return await e.init(1),e}static async newWorker(e){const t=(0,u.createWorker)(),r=(0,u.getRemoteBarretenbergWasm)(t);return await r.init(e,(0,s.proxy)(c)),{worker:t,wasm:r}}getNumThreads(){return this.workers.length+1}async init(e=Math.min((0,u.getNumCpu)(),f.MAX_THREADS),t=c,r=25,n=65536){this.logger=t;const i=65536*r/1048576,o=65536*n/1048576;this.logger(`initial mem: ${r} pages, ${i}MiB. max mem: ${n} pages, ${o}MiB. threads: ${e}`),this.memory=new WebAssembly.Memory({initial:r,maximum:n,shared:e>1});const s=await(0,u.fetchCode)(e>1?"barretenberg-threads.wasm":"barretenberg.wasm"),{instance:a,module:l}=await WebAssembly.instantiate(s,this.getImportObj(this.memory));this.instance=a,this.call("_initialize"),this.logger("creating worker threads..."),this.workers=await Promise.all(Array.from({length:e-1}).map(u.createWorker)),this.remoteWasms=await Promise.all(this.workers.map(u.getRemoteBarretenbergWasm)),await Promise.all(this.remoteWasms.map((e=>e.initThread(l,this.memory)))),this.logger("init complete.")}async initThread(e,t){this.isThread=!0,this.logger=(0,u.threadLogger)()||this.logger,this.memory=t,this.instance=await WebAssembly.instantiate(e,this.getImportObj(this.memory))}async destroy(){await Promise.all(this.workers.map((e=>e.terminate())))}getImportObj(e){return{wasi_snapshot_preview1:{random_get:(e,t)=>{e>>>=0;const r=(0,a.randomBytes)(t);this.getMemory().set(r,e)},clock_time_get:(e,t,r)=>{r>>>=0;const n=1000000n*BigInt((new Date).getTime());new DataView(this.getMemory().buffer).setBigUint64(r,n,!0)},proc_exit:()=>{this.logger("HUNG: proc_exit was called. This is caused by unstable experimental wasi pthreads. Try again."),this.logger((new Error).stack),(0,u.killSelf)()}},wasi:{"thread-spawn":e=>{e>>>=0;const t=this.nextThreadId++,r=this.nextWorker++%this.remoteWasms.length;return this.remoteWasms[r].call("wasi_thread_start",t,e).catch(this.logger),t}},env:{env_hardware_concurrency:()=>this.remoteWasms.length+1,logstr:e=>{const t=`${this.stringFromAddress(e)} (mem: ${(this.getMemory().length/1048576).toFixed(2)}MiB)`;this.logger(t)},get_data:(e,t)=>{const r=this.stringFromAddress(e);t>>>=0;const n=this.memStore[r];n?this.writeMemory(t,n):this.logger(`get_data miss ${r}`)},set_data:(e,t,r)=>{const n=this.stringFromAddress(e);t>>>=0,this.memStore[n]=this.getMemorySlice(t,t+r).slice()},memory:e}}}exports(){return this.instance.exports}call(e,...t){if(!this.exports()[e])throw new Error(`WASM function ${e} not found.`);try{return this.exports()[e](...t)>>>0}catch(t){const r=`WASM function ${e} aborted, error: ${t}`;if(this.logger(r),this.logger(t.stack),!this.isThread)throw t;(0,u.killSelf)()}}memSize(){return this.getMemory().length}getMemorySlice(e,t){return this.getMemory().subarray(e,t)}writeMemory(e,t){this.getMemory().set(t,e)}getMemory(){return new Uint8Array(this.memory.buffer)}stringFromAddress(e){e>>>=0;const t=this.getMemory();let r=e;for(;0!==t[r];++r);return new TextDecoder("ascii").decode(t.slice(e,r))}}f.MAX_THREADS=16,t.BarretenbergWasm=f},581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.killSelf=t.threadLogger=t.getNumCpu=t.getRemoteBarretenbergWasm=t.createWorker=t.fetchCode=void 0;const n=r(655),i=r(375),o=n.__importDefault(r(227));t.fetchCode=async function(e){const t=await fetch("/"+e);return await t.arrayBuffer()},t.createWorker=function(){const e=new Worker("barretenberg_wasm.js"),t=o.default.disable();return o.default.enable(t),e.postMessage({debug:t}),e},t.getRemoteBarretenbergWasm=function(e){return(0,i.wrap)(e)},t.getNumCpu=function(){return navigator.hardwareConcurrency},t.threadLogger=function(){},t.killSelf=function(){self.close()}},995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(640),t)},255:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toBufferBE=t.toBigIntBE=void 0,t.toBigIntBE=function(e){e=new Uint8Array(e);let t=BigInt(0);const r=new DataView(e.buffer);for(let n=0;n<e.byteLength;n++)t=(t<<BigInt(8))+BigInt(r.getUint8(n));return t},t.toBufferBE=function(e,t=32){const r=new Uint8Array(t),n=new DataView(r.buffer);for(let r=0;r<t;r++)n.setUint8(t-r-1,Number(e&BigInt(255))),e>>=BigInt(8);return r}},579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CachedNetCrs=void 0;const n=r(344),i=r(678);class o{constructor(e){this.numPoints=e}static async new(e){const t=new o(e);return await t.init(),t}async init(){const e=await(0,i.get)("g1Data"),t=await(0,i.get)("g2Data"),r=new n.NetCrs(this.numPoints),o=64*this.numPoints;!e||e.length<o?(this.g1Data=await r.downloadG1Data(),await(0,i.set)("g1Data",this.g1Data)):this.g1Data=e,t?this.g2Data=t:(this.g2Data=await r.downloadG2Data(),await(0,i.set)("g2Data",this.g2Data))}getG1Data(){return this.g1Data}getG2Data(){return this.g2Data}}t.CachedNetCrs=o},898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crs=void 0;var n=r(579);Object.defineProperty(t,"Crs",{enumerable:!0,get:function(){return n.CachedNetCrs}})},603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crs=void 0;var n=r(898);Object.defineProperty(t,"Crs",{enumerable:!0,get:function(){return n.Crs}})},344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetCrs=void 0,t.NetCrs=class{constructor(e){this.numPoints=e}async init(){await this.downloadG1Data(),await this.downloadG2Data()}async downloadG1Data(){const e=28+64*this.numPoints-1,t=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat",{headers:{Range:`bytes=28-${e}`},cache:"force-cache"});return this.data=new Uint8Array(await t.arrayBuffer())}async downloadG2Data(){const e=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat",{headers:{Range:"bytes=322560028-322560155"},cache:"force-cache"});return this.g2Data=new Uint8Array(await e.arrayBuffer())}getG1Data(){return this.data}getG2Data(){return this.g2Data}}},85:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newBarretenbergApiAsync=t.BarretenbergApiAsync=t.newBarretenbergApiSync=void 0;const n=r(271),i=r(730),o=r(995);t.newBarretenbergApiSync=async function(){return new n.BarretenbergApiSync(new i.BarretenbergBinderSync(await o.BarretenbergWasm.new()))};class s extends n.BarretenbergApi{constructor(e,t){super(new i.BarretenbergBinder(t)),this.worker=e,this.wasm=t}async getNumThreads(){return await this.wasm.getNumThreads()}async destroy(){await this.wasm.destroy(),await this.worker.terminate()}}t.BarretenbergApiAsync=s,t.newBarretenbergApiAsync=async function(e){const{wasm:t,worker:r}=await o.BarretenbergWasm.newWorker(e);return new s(r,t)}},754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=void 0,t.randomBytes=e=>{const t="undefined"!=typeof window&&window.crypto?window.crypto:"undefined"!=typeof self&&self.crypto?self.crypto:void 0;if(!t)throw new Error("randomBytes UnsupportedEnvironment");const r=new Uint8Array(e),n=65536;if(e>n)for(let i=0;i<e;i+=n)t.getRandomValues(r.subarray(i,i+n));else t.getRandomValues(r);return r}},324:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(754),t)},366:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReader=void 0;class r{constructor(e,t=0){this.buffer=e,this.index=t}static asReader(e){return e instanceof r?e:new r(e)}readNumber(){const e=new DataView(this.buffer.buffer,this.buffer.byteOffset+this.index,4);return this.index+=4,e.getUint32(0,!1)}readBoolean(){return this.index+=1,Boolean(this.buffer.at(this.index-1))}readBytes(e){return this.index+=e,this.buffer.slice(this.index-e,this.index)}readNumberVector(){return this.readVector({fromBuffer:e=>e.readNumber()})}readVector(e){const t=this.readNumber(),r=new Array(t);for(let n=0;n<t;n++)r[n]=e.fromBuffer(this);return r}readArray(e,t){const r=new Array(e);for(let n=0;n<e;n++)r[n]=t.fromBuffer(this);return r}readObject(e){return e.fromBuffer(this)}peekBytes(e){return this.buffer.subarray(this.index,e?this.index+e:void 0)}readString(){return(new TextDecoder).decode(this.readBuffer())}readBuffer(){const e=this.readNumber();return this.readBytes(e)}readMap(e){const t=this.readNumber(),r={};for(let n=0;n<t;n++){const t=this.readString(),n=this.readObject(e);r[t]=n}return r}}t.BufferReader=r},456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(366),t),n.__exportStar(r(629),t),n.__exportStar(r(247),t)},629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringDeserializer=t.BufferDeserializer=t.VectorDeserializer=t.NumberDeserializer=t.BoolDeserializer=void 0;const n=r(366);t.BoolDeserializer=function(){return{SIZE_IN_BYTES:1,fromBuffer:e=>n.BufferReader.asReader(e).readBoolean()}},t.NumberDeserializer=function(){return{SIZE_IN_BYTES:4,fromBuffer:e=>n.BufferReader.asReader(e).readNumber()}},t.VectorDeserializer=function(e){return{fromBuffer:t=>n.BufferReader.asReader(t).readVector(e)}},t.BufferDeserializer=function(){return{fromBuffer:e=>n.BufferReader.asReader(e).readBuffer()}},t.StringDeserializer=function(){return{fromBuffer:e=>n.BufferReader.asReader(e).readString()}}},247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeBufferable=t.deserializeArrayFromVector=t.serializeBufferArrayToVector=t.deserializeField=t.deserializeInt32=t.deserializeUInt32=t.deserializeBool=t.deserializeBufferFromVector=t.serializeDate=t.deserializeBigInt=t.serializeBigInt=t.serializeBufferToVector=t.uint8ArrayToHexString=t.concatenateUint8Arrays=t.numToUInt8=t.numToInt32BE=t.numToUInt32BE=t.numToUInt32LE=t.boolToBuffer=void 0;const n=r(867);function i(e){const t=new Uint8Array(1);return t[0]=e?1:0,t}function o(e,t=4){const r=new Uint8Array(t);return new DataView(r.buffer).setUint32(r.byteLength-4,e,!1),r}function s(e,t=4){const r=new Uint8Array(t);return new DataView(r.buffer).setInt32(r.byteLength-4,e,!1),r}function a(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function u(e){return a([s(e.length),e])}function c(e,t=32){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[t-n-1]=Number(e>>BigInt(8*n)&0xffn);return r}function f(e){return a([o(e.length),...e.flat()])}t.boolToBuffer=i,t.numToUInt32LE=function(e,t=4){const r=new Uint8Array(t);return new DataView(r.buffer).setUint32(r.byteLength-4,e,!0),r},t.numToUInt32BE=o,t.numToInt32BE=s,t.numToUInt8=function(e){const t=new Uint8Array(1);return t[0]=e,t},t.concatenateUint8Arrays=a,t.uint8ArrayToHexString=function(e){return e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),"")},t.serializeBufferToVector=u,t.serializeBigInt=c,t.deserializeBigInt=function(e,t=0,r=32){let n=0n;for(let i=0;i<r;i++)n=n<<BigInt(8)|BigInt(e[t+i]);return{elem:n,adv:r}},t.serializeDate=function(e){return c(BigInt(e.getTime()),8)},t.deserializeBufferFromVector=function(e,t=0){const r=4+new DataView(e.buffer,e.byteOffset+t,4).getUint32(0,!1);return{elem:e.slice(t+4,t+r),adv:r}},t.deserializeBool=function(e,t=0){return{elem:0!==e[t],adv:1}},t.deserializeUInt32=function(e,t=0){return{elem:new DataView(e.buffer,e.byteOffset+t,4).getUint32(0,!1),adv:4}},t.deserializeInt32=function(e,t=0){return{elem:new DataView(e.buffer,e.byteOffset+t,4).getInt32(0,!1),adv:4}},t.deserializeField=function(e,t=0){return{elem:e.slice(t,t+32),adv:32}},t.serializeBufferArrayToVector=f,t.deserializeArrayFromVector=function(e,t,r=0){let n=r;const i=new DataView(t.buffer,t.byteOffset+n,4).getUint32(0,!1);n+=4;const o=new Array(i);for(let r=0;r<i;++r){const{elem:i,adv:s}=e(t,n);n+=s,o[r]=i}return{elem:o,adv:n-r}},t.serializeBufferable=function e(t){return Array.isArray(t)?f(t.map(e)):t instanceof n.RawBuffer?t:t instanceof Uint8Array?u(t):"boolean"==typeof t?i(t):"number"==typeof t?o(t):"bigint"==typeof t?c(t):"string"==typeof t?u((new TextEncoder).encode(t)):t.toBuffer()}},940:(e,t,r)=>{"use strict";var n,i,o=r(764).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.Fq=t.Fr=void 0;const s=r(324),a=r(255),u=r(456);class c{constructor(e){if(this.value=e,e>c.MAX_VALUE)throw new Error(`Fr out of range ${e}.`)}static random(){return new this((0,a.toBigIntBE)((0,s.randomBytes)(64))%c.MODULUS)}static fromBuffer(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES)))}static fromBufferReduce(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES))%c.MODULUS)}static fromString(e){return this.fromBuffer(o.from(e.replace(/^0x/i,""),"hex"))}toBuffer(){return(0,a.toBufferBE)(this.value,c.SIZE_IN_BYTES)}toString(){return"0x"+(0,u.uint8ArrayToHexString)(this.toBuffer())}equals(e){return this.value===e.value}isZero(){return 0n===this.value}}n=c,c.ZERO=new c(0n),c.MODULUS=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n,c.MAX_VALUE=n.MODULUS-1n,c.SIZE_IN_BYTES=32,t.Fr=c;class f{constructor(e){if(this.value=e,e>f.MAX_VALUE)throw new Error(`Fq out of range ${e}.`)}static random(){return new this((0,a.toBigIntBE)((0,s.randomBytes)(64))%f.MODULUS)}static fromBuffer(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES)))}static fromBufferReduce(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES))%c.MODULUS)}static fromString(e){return this.fromBuffer(o.from(e.replace(/^0x/i,""),"hex"))}toBuffer(){return(0,a.toBufferBE)(this.value,f.SIZE_IN_BYTES)}toString(){return"0x"+this.value.toString(16)}equals(e){return this.value===e.value}isZero(){return 0n===this.value}}i=f,f.MODULUS=0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47n,f.MAX_VALUE=i.MODULUS-1n,f.SIZE_IN_BYTES=32,t.Fq=f},986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer128=t.Buffer64=t.Buffer32=void 0;const n=r(324),i=r(456);class o{constructor(e){this.buffer=e}static fromBuffer(e){const t=i.BufferReader.asReader(e);return new o(t.readBytes(this.SIZE_IN_BYTES))}static random(){return new o((0,n.randomBytes)(this.SIZE_IN_BYTES))}toBuffer(){return this.buffer}}o.SIZE_IN_BYTES=32,t.Buffer32=o;class s{constructor(e){this.buffer=e}static fromBuffer(e){const t=i.BufferReader.asReader(e);return new s(t.readBytes(this.SIZE_IN_BYTES))}static random(){return new s((0,n.randomBytes)(this.SIZE_IN_BYTES))}toBuffer(){return this.buffer}}s.SIZE_IN_BYTES=64,t.Buffer64=s;class a{constructor(e){this.buffer=e}static fromBuffer(e){const t=i.BufferReader.asReader(e);return new a(t.readBytes(this.SIZE_IN_BYTES))}static random(){return new a((0,n.randomBytes)(this.SIZE_IN_BYTES))}toBuffer(){return this.buffer}}a.SIZE_IN_BYTES=128,t.Buffer128=a},696:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(158),t),n.__exportStar(r(940),t),n.__exportStar(r(299),t),n.__exportStar(r(986),t),n.__exportStar(r(867),t)},299:(e,t,r)=>{"use strict";var n=r(764).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.Point=void 0;const i=r(696),o=r(366);class s{constructor(e,t){this.x=e,this.y=t}static random(){return new s(i.Fr.random(),i.Fr.random())}static fromBuffer(e){const t=o.BufferReader.asReader(e);return new this(i.Fr.fromBuffer(t),i.Fr.fromBuffer(t))}static fromString(e){return s.fromBuffer(n.from(e.replace(/^0x/i,""),"hex"))}toBuffer(){return n.concat([this.x.toBuffer(),this.y.toBuffer()])}toString(){return"0x"+this.toBuffer().toString("hex")}equals(e){return this.x.equals(e.x)&&this.y.equals(e.y)}}s.SIZE_IN_BYTES=64,s.EMPTY=new s(i.Fr.ZERO,i.Fr.ZERO),t.Point=s},158:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ptr=void 0;const n=r(456);class i{constructor(e){this.value=e}static fromBuffer(e){return new this(n.BufferReader.asReader(e).readBytes(this.SIZE_IN_BYTES))}toBuffer(){return this.value}}i.SIZE_IN_BYTES=4,t.Ptr=i},867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawBuffer=void 0;class r extends Uint8Array{}t.RawBuffer=r},655:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>S,__asyncGenerator:()=>x,__asyncValues:()=>C,__await:()=>B,__awaiter:()=>d,__classPrivateFieldGet:()=>P,__classPrivateFieldIn:()=>M,__classPrivateFieldSet:()=>T,__createBinding:()=>m,__decorate:()=>a,__esDecorate:()=>c,__exportStar:()=>g,__extends:()=>i,__generator:()=>y,__importDefault:()=>F,__importStar:()=>O,__makeTemplateObject:()=>I,__metadata:()=>p,__param:()=>u,__propKey:()=>l,__read:()=>b,__rest:()=>s,__runInitializers:()=>f,__setFunctionName:()=>h,__spread:()=>_,__spreadArray:()=>E,__spreadArrays:()=>v,__values:()=>w});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,i,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",f=!t&&e?n.static?e:e.prototype:null,l=t||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),h=!1,p=r.length-1;p>=0;p--){var d={};for(var y in n)d[y]="access"===y?{}:n[y];for(var y in n.access)d.access[y]=n.access[y];d.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var m=(0,r[p])("accessor"===u?{get:l.get,set:l.set}:l[c],d);if("accessor"===u){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(l.get=a),(a=s(m.set))&&(l.set=a),(a=s(m.init))&&i.push(a)}else(a=s(m))&&("field"===u?i.push(a):l[c]=a)}f&&Object.defineProperty(f,n.name,l),h=!0}function f(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function l(e){return"symbol"==typeof e?e:"".concat(e)}function h(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var m=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function g(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||m(t,e,r)}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function E(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function B(e){return this instanceof B?(this.v=e,this):new B(e)}function x(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof B?Promise.resolve(r.value.v).then(u,c):f(o[0][2],r)}catch(e){f(o[0][3],e)}var r}function u(e){a("next",e)}function c(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function S(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:B(e[n](t)),done:!1}:i?i(t):t}:i}}function C(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=w(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function I(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&m(t,e,r);return A(t,e),t}function F(e){return e&&e.__esModule?e:{default:e}}function P(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function T(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function M(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},375:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createEndpoint:()=>i,expose:()=>f,finalizer:()=>s,proxy:()=>v,proxyMarker:()=>n,releaseProxy:()=>o,transfer:()=>_,transferHandlers:()=>c,windowEndpoint:()=>E,wrap:()=>h});const n=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),u=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>u(e)&&e[n],serialize(e){const{port1:t,port2:r}=new MessageChannel;return f(e,t),[r,[r]]},deserialize:e=>(e.start(),h(e))}],["throw",{canHandle:e=>u(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function f(e,t=globalThis,r=["*"]){t.addEventListener("message",(function n(i){if(!i||!i.data)return;if(!function(e,t){for(const r of e){if(t===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}return!1}(r,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:u,path:c}=Object.assign({path:[]},i.data),h=(i.data.argumentList||[]).map(x);let p;try{const t=c.slice(0,-1).reduce(((e,t)=>e[t]),e),r=c.reduce(((e,t)=>e[t]),e);switch(u){case"GET":p=r;break;case"SET":t[c.slice(-1)[0]]=x(i.data.value),p=!0;break;case"APPLY":p=r.apply(t,h);break;case"CONSTRUCT":p=v(new r(...h));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;f(e,r),p=_(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((r=>{const[i,a]=B(r);t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),"RELEASE"===u&&(t.removeEventListener("message",n),l(t),s in e&&"function"==typeof e[s]&&e[s]())})).catch((e=>{const[r,n]=B({value:new TypeError("Unserializable return value"),[a]:0});t.postMessage(Object.assign(Object.assign({},r),{id:o}),n)}))})),t.start&&t.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function h(e,t){return g(e,[],t)}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function d(e){return S(e,{type:"RELEASE"}).then((()=>{l(e)}))}const y=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(y.get(e)||0)-1;y.set(e,t),0===t&&d(e)}));function g(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(r,i){if(p(n),i===o)return()=>{!function(e){m&&m.unregister(e)}(s),d(e),n=!0};if("then"===i){if(0===t.length)return{then:()=>s};const r=S(e,{type:"GET",path:t.map((e=>e.toString()))}).then(x);return r.then.bind(r)}return g(e,[...t,i])},set(r,i,o){p(n);const[s,a]=B(o);return S(e,{type:"SET",path:[...t,i].map((e=>e.toString())),value:s},a).then(x)},apply(r,o,s){p(n);const a=t[t.length-1];if(a===i)return S(e,{type:"ENDPOINT"}).then(x);if("bind"===a)return g(e,t.slice(0,-1));const[u,c]=w(s);return S(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:u},c).then(x)},construct(r,i){p(n);const[o,s]=w(i);return S(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:o},s).then(x)}});return function(e,t){const r=(y.get(t)||0)+1;y.set(t,r),m&&m.register(e,t,e)}(s,e),s}function w(e){const t=e.map(B);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const b=new WeakMap;function _(e,t){return b.set(e,t),e}function v(e){return Object.assign(e,{[n]:!0})}function E(e,t=globalThis,r="*"){return{postMessage:(t,n)=>e.postMessage(t,r,n),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function B(e){for(const[t,r]of c)if(r.canHandle(e)){const[n,i]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:e},b.get(e)||[]]}function x(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function S(e,t,r){return new Promise((n=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)}))}},678:(e,t,r)=>{"use strict";function n(e){return new Promise(((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)}))}function i(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const i=n(r);return(e,r)=>i.then((n=>r(n.transaction(t,e).objectStore(t))))}let o;function s(){return o||(o=i("keyval-store","keyval")),o}function a(e,t=s()){return t("readonly",(t=>n(t.get(e))))}function u(e,t,r=s()){return r("readwrite",(r=>(r.put(t,e),n(r.transaction))))}function c(e,t=s()){return t("readwrite",(t=>(e.forEach((e=>t.put(e[1],e[0]))),n(t.transaction))))}function f(e,t=s()){return t("readonly",(t=>Promise.all(e.map((e=>n(t.get(e)))))))}function l(e,t,r=s()){return r("readwrite",(r=>new Promise(((i,o)=>{r.get(e).onsuccess=function(){try{r.put(t(this.result),e),i(n(r.transaction))}catch(e){o(e)}}}))))}function h(e,t=s()){return t("readwrite",(t=>(t.delete(e),n(t.transaction))))}function p(e,t=s()){return t("readwrite",(t=>(e.forEach((e=>t.delete(e))),n(t.transaction))))}function d(e=s()){return e("readwrite",(e=>(e.clear(),n(e.transaction))))}function y(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},n(e.transaction)}function m(e=s()){return e("readonly",(e=>{if(e.getAllKeys)return n(e.getAllKeys());const t=[];return y(e,(e=>t.push(e.key))).then((()=>t))}))}function g(e=s()){return e("readonly",(e=>{if(e.getAll)return n(e.getAll());const t=[];return y(e,(e=>t.push(e.value))).then((()=>t))}))}function w(e=s()){return e("readonly",(t=>{if(t.getAll&&t.getAllKeys)return Promise.all([n(t.getAllKeys()),n(t.getAll())]).then((([e,t])=>e.map(((e,r)=>[e,t[r]]))));const r=[];return e("readonly",(e=>y(e,(e=>r.push([e.key,e.value]))).then((()=>r))))}))}r.r(t),r.d(t,{clear:()=>d,createStore:()=>i,del:()=>h,delMany:()=>p,entries:()=>w,get:()=>a,getMany:()=>f,keys:()=>m,promisifyRequest:()=>n,set:()=>u,setMany:()=>c,update:()=>l,values:()=>g})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";const e=r(655),t=r(603),n=e.__importDefault(r(227)),i=r(85),o=r(696);n.default.enable("*");const s=(0,n.default)("simple_test");!async function(){s("starting test...");const e=await(0,i.newBarretenbergApiAsync)();await e.commonInitSlabAllocator(2**19);const r=await t.Crs.new(524289);await e.srsInitSrs(new o.RawBuffer(r.getG1Data()),r.numPoints,new o.RawBuffer(r.getG2Data()));for(let t=0;t<10;++t)s(`iteration ${t} starting...`),await e.examplesSimpleCreateAndVerifyProof();await e.destroy(),s("test complete.")}()})()})();
2
+ (()=>{var e={742:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(u(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(e,t,r)=>{"use strict";const n=r(742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return f(e),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:Z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(q(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return H(Z(t,e.length-r),e,r,n)}function E(e,t,r,n){return H(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function B(e,t,r,n){return H(G(t),e,r,n)}function x(e,t,r,n){return H(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=I));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==f[e]){o=c[e],s=f[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return B(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function F(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){N(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function U(e,t,r,n,i){N(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||W(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,o){return t=+t,r>>>=0,o||W(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=J((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const D={};function j(e,t,r){D[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function z(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function V(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function Z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},435:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,u,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,"day"):u>=n?o(a,u,n,"hour"):u>=r?o(a,u,r,"minute"):u>=t?o(a,u,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},227:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(447)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(435),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):d(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,f=d(u,c);for(r=0;r<c;++r)n(f[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asyncMap=void 0,t.asyncMap=async function(e,t){const r=[];for(let n=0;n<e.length;++n)r.push(await t(e[n],n));return r}},271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarretenbergApiSync=t.BarretenbergApi=void 0;const n=r(456),i=r(696);t.BarretenbergApi=class{constructor(e){this.binder=e}async destroy(){await this.binder.wasm.destroy()}async pedersenInit(){await this.binder.callWasmExport("pedersen___init",[],[])}async pedersenCompressFields(e,t){return(await this.binder.callWasmExport("pedersen___compress_fields",[e,t],[i.Fr]))[0]}async pedersenPlookupCompressFields(e,t){return(await this.binder.callWasmExport("pedersen___plookup_compress_fields",[e,t],[i.Fr]))[0]}async pedersenCompress(e){return(await this.binder.callWasmExport("pedersen___compress",[e],[i.Fr]))[0]}async pedersenPlookupCompress(e){return(await this.binder.callWasmExport("pedersen___plookup_compress",[e],[i.Fr]))[0]}async pedersenCompressWithHashIndex(e,t){return(await this.binder.callWasmExport("pedersen___compress_with_hash_index",[e,t],[i.Fr]))[0]}async pedersenCommit(e){return(await this.binder.callWasmExport("pedersen___commit",[e],[i.Fr]))[0]}async pedersenPlookupCommit(e){return(await this.binder.callWasmExport("pedersen___plookup_commit",[e],[i.Fr]))[0]}async pedersenPlookupCommitWithHashIndex(e,t){return(await this.binder.callWasmExport("pedersen___plookup_commit_with_hash_index",[e,t],[i.Fr]))[0]}async pedersenBufferToField(e){return(await this.binder.callWasmExport("pedersen___buffer_to_field",[e],[i.Fr]))[0]}async pedersenHashInit(){await this.binder.callWasmExport("pedersen_hash_init",[],[])}async pedersenHashPair(e,t){return(await this.binder.callWasmExport("pedersen_hash_pair",[e,t],[i.Fr]))[0]}async pedersenHashMultiple(e){return(await this.binder.callWasmExport("pedersen_hash_multiple",[e],[i.Fr]))[0]}async pedersenHashMultipleWithHashIndex(e,t){return(await this.binder.callWasmExport("pedersen_hash_multiple_with_hash_index",[e,t],[i.Fr]))[0]}async pedersenHashToTree(e){return(await this.binder.callWasmExport("pedersen_hash_to_tree",[e],[(0,n.VectorDeserializer)(i.Fr)]))[0]}async blake2s(e){return(await this.binder.callWasmExport("blake2s",[e],[i.Buffer32]))[0]}async blake2sToField(e){return(await this.binder.callWasmExport("blake2s_to_field_",[e],[i.Fr]))[0]}async schnorrComputePublicKey(e){return(await this.binder.callWasmExport("schnorr_compute_public_key",[e],[i.Point]))[0]}async schnorrNegatePublicKey(e){return(await this.binder.callWasmExport("schnorr_negate_public_key",[e],[i.Point]))[0]}async schnorrConstructSignature(e,t){return await this.binder.callWasmExport("schnorr_construct_signature",[e,t],[i.Buffer32,i.Buffer32])}async schnorrVerifySignature(e,t,r,i){return(await this.binder.callWasmExport("schnorr_verify_signature",[e,t,r,i],[(0,n.BoolDeserializer)()]))[0]}async schnorrMultisigCreateMultisigPublicKey(e){return(await this.binder.callWasmExport("schnorr_multisig_create_multisig_public_key",[e],[i.Buffer128]))[0]}async schnorrMultisigValidateAndCombineSignerPubkeys(e){return await this.binder.callWasmExport("schnorr_multisig_validate_and_combine_signer_pubkeys",[e],[i.Point,(0,n.BoolDeserializer)()])}async schnorrMultisigConstructSignatureRound1(){return await this.binder.callWasmExport("schnorr_multisig_construct_signature_round_1",[],[i.Buffer128,i.Buffer128])}async schnorrMultisigConstructSignatureRound2(e,t,r,o,s){return await this.binder.callWasmExport("schnorr_multisig_construct_signature_round_2",[e,t,r,o,s],[i.Fq,(0,n.BoolDeserializer)()])}async schnorrMultisigCombineSignatures(e,t,r,o){return await this.binder.callWasmExport("schnorr_multisig_combine_signatures",[e,t,r,o],[i.Buffer32,i.Buffer32,(0,n.BoolDeserializer)()])}async srsInitSrs(e,t,r){await this.binder.callWasmExport("srs_init_srs",[e,t,r],[])}async examplesSimpleCreateAndVerifyProof(){return(await this.binder.callWasmExport("examples_simple_create_and_verify_proof",[],[(0,n.BoolDeserializer)()]))[0]}async testThreads(e,t){return(await this.binder.callWasmExport("test_threads",[e,t],[(0,n.NumberDeserializer)()]))[0]}async testThreadAbort(){await this.binder.callWasmExport("test_thread_abort",[],[])}async testAbort(){await this.binder.callWasmExport("test_abort",[],[])}async commonInitSlabAllocator(e){await this.binder.callWasmExport("common_init_slab_allocator",[e],[])}async acirGetCircuitSizes(e){return await this.binder.callWasmExport("acir_get_circuit_sizes",[e],[(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)()])}async acirNewAcirComposer(e){return(await this.binder.callWasmExport("acir_new_acir_composer",[e],[i.Ptr]))[0]}async acirDeleteAcirComposer(e){await this.binder.callWasmExport("acir_delete_acir_composer",[e],[])}async acirCreateCircuit(e,t,r){await this.binder.callWasmExport("acir_create_circuit",[e,t,r],[])}async acirInitProvingKey(e,t){await this.binder.callWasmExport("acir_init_proving_key",[e,t],[])}async acirCreateProof(e,t,r,i){return(await this.binder.callWasmExport("acir_create_proof",[e,t,r,i],[(0,n.BufferDeserializer)()]))[0]}async acirLoadVerificationKey(e,t){await this.binder.callWasmExport("acir_load_verification_key",[e,t],[])}async acirInitVerificationKey(e){await this.binder.callWasmExport("acir_init_verification_key",[e],[])}async acirGetVerificationKey(e){return(await this.binder.callWasmExport("acir_get_verification_key",[e],[(0,n.BufferDeserializer)()]))[0]}async acirVerifyProof(e,t,r){return(await this.binder.callWasmExport("acir_verify_proof",[e,t,r],[(0,n.BoolDeserializer)()]))[0]}async acirGetSolidityVerifier(e){return(await this.binder.callWasmExport("acir_get_solidity_verifier",[e],[(0,n.StringDeserializer)()]))[0]}async acirSerializeProofIntoFields(e,t,r){return(await this.binder.callWasmExport("acir_serialize_proof_into_fields",[e,t,r],[(0,n.VectorDeserializer)(i.Fr)]))[0]}async acirSerializeVerificationKeyIntoFields(e){return await this.binder.callWasmExport("acir_serialize_verification_key_into_fields",[e],[(0,n.VectorDeserializer)(i.Fr),i.Fr])}},t.BarretenbergApiSync=class{constructor(e){this.binder=e}async destroy(){await this.binder.wasm.destroy()}pedersenInit(){this.binder.callWasmExport("pedersen___init",[],[])}pedersenCompressFields(e,t){return this.binder.callWasmExport("pedersen___compress_fields",[e,t],[i.Fr])[0]}pedersenPlookupCompressFields(e,t){return this.binder.callWasmExport("pedersen___plookup_compress_fields",[e,t],[i.Fr])[0]}pedersenCompress(e){return this.binder.callWasmExport("pedersen___compress",[e],[i.Fr])[0]}pedersenPlookupCompress(e){return this.binder.callWasmExport("pedersen___plookup_compress",[e],[i.Fr])[0]}pedersenCompressWithHashIndex(e,t){return this.binder.callWasmExport("pedersen___compress_with_hash_index",[e,t],[i.Fr])[0]}pedersenCommit(e){return this.binder.callWasmExport("pedersen___commit",[e],[i.Fr])[0]}pedersenPlookupCommit(e){return this.binder.callWasmExport("pedersen___plookup_commit",[e],[i.Fr])[0]}pedersenPlookupCommitWithHashIndex(e,t){return this.binder.callWasmExport("pedersen___plookup_commit_with_hash_index",[e,t],[i.Fr])[0]}pedersenBufferToField(e){return this.binder.callWasmExport("pedersen___buffer_to_field",[e],[i.Fr])[0]}pedersenHashInit(){this.binder.callWasmExport("pedersen_hash_init",[],[])}pedersenHashPair(e,t){return this.binder.callWasmExport("pedersen_hash_pair",[e,t],[i.Fr])[0]}pedersenHashMultiple(e){return this.binder.callWasmExport("pedersen_hash_multiple",[e],[i.Fr])[0]}pedersenHashMultipleWithHashIndex(e,t){return this.binder.callWasmExport("pedersen_hash_multiple_with_hash_index",[e,t],[i.Fr])[0]}pedersenHashToTree(e){return this.binder.callWasmExport("pedersen_hash_to_tree",[e],[(0,n.VectorDeserializer)(i.Fr)])[0]}blake2s(e){return this.binder.callWasmExport("blake2s",[e],[i.Buffer32])[0]}blake2sToField(e){return this.binder.callWasmExport("blake2s_to_field_",[e],[i.Fr])[0]}schnorrComputePublicKey(e){return this.binder.callWasmExport("schnorr_compute_public_key",[e],[i.Point])[0]}schnorrNegatePublicKey(e){return this.binder.callWasmExport("schnorr_negate_public_key",[e],[i.Point])[0]}schnorrConstructSignature(e,t){return this.binder.callWasmExport("schnorr_construct_signature",[e,t],[i.Buffer32,i.Buffer32])}schnorrVerifySignature(e,t,r,i){return this.binder.callWasmExport("schnorr_verify_signature",[e,t,r,i],[(0,n.BoolDeserializer)()])[0]}schnorrMultisigCreateMultisigPublicKey(e){return this.binder.callWasmExport("schnorr_multisig_create_multisig_public_key",[e],[i.Buffer128])[0]}schnorrMultisigValidateAndCombineSignerPubkeys(e){return this.binder.callWasmExport("schnorr_multisig_validate_and_combine_signer_pubkeys",[e],[i.Point,(0,n.BoolDeserializer)()])}schnorrMultisigConstructSignatureRound1(){return this.binder.callWasmExport("schnorr_multisig_construct_signature_round_1",[],[i.Buffer128,i.Buffer128])}schnorrMultisigConstructSignatureRound2(e,t,r,o,s){return this.binder.callWasmExport("schnorr_multisig_construct_signature_round_2",[e,t,r,o,s],[i.Fq,(0,n.BoolDeserializer)()])}schnorrMultisigCombineSignatures(e,t,r,o){return this.binder.callWasmExport("schnorr_multisig_combine_signatures",[e,t,r,o],[i.Buffer32,i.Buffer32,(0,n.BoolDeserializer)()])}srsInitSrs(e,t,r){this.binder.callWasmExport("srs_init_srs",[e,t,r],[])}examplesSimpleCreateAndVerifyProof(){return this.binder.callWasmExport("examples_simple_create_and_verify_proof",[],[(0,n.BoolDeserializer)()])[0]}testThreads(e,t){return this.binder.callWasmExport("test_threads",[e,t],[(0,n.NumberDeserializer)()])[0]}testThreadAbort(){this.binder.callWasmExport("test_thread_abort",[],[])}testAbort(){this.binder.callWasmExport("test_abort",[],[])}commonInitSlabAllocator(e){this.binder.callWasmExport("common_init_slab_allocator",[e],[])}acirGetCircuitSizes(e){return this.binder.callWasmExport("acir_get_circuit_sizes",[e],[(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)(),(0,n.NumberDeserializer)()])}acirNewAcirComposer(e){return this.binder.callWasmExport("acir_new_acir_composer",[e],[i.Ptr])[0]}acirDeleteAcirComposer(e){this.binder.callWasmExport("acir_delete_acir_composer",[e],[])}acirCreateCircuit(e,t,r){this.binder.callWasmExport("acir_create_circuit",[e,t,r],[])}acirInitProvingKey(e,t){this.binder.callWasmExport("acir_init_proving_key",[e,t],[])}acirCreateProof(e,t,r,i){return this.binder.callWasmExport("acir_create_proof",[e,t,r,i],[(0,n.BufferDeserializer)()])[0]}acirLoadVerificationKey(e,t){this.binder.callWasmExport("acir_load_verification_key",[e,t],[])}acirInitVerificationKey(e){this.binder.callWasmExport("acir_init_verification_key",[e],[])}acirGetVerificationKey(e){return this.binder.callWasmExport("acir_get_verification_key",[e],[(0,n.BufferDeserializer)()])[0]}acirVerifyProof(e,t,r){return this.binder.callWasmExport("acir_verify_proof",[e,t,r],[(0,n.BoolDeserializer)()])[0]}acirGetSolidityVerifier(e){return this.binder.callWasmExport("acir_get_solidity_verifier",[e],[(0,n.StringDeserializer)()])[0]}acirSerializeProofIntoFields(e,t,r){return this.binder.callWasmExport("acir_serialize_proof_into_fields",[e,t,r],[(0,n.VectorDeserializer)(i.Fr)])[0]}acirSerializeVerificationKeyIntoFields(e){return this.binder.callWasmExport("acir_serialize_verification_key_into_fields",[e],[(0,n.VectorDeserializer)(i.Fr),i.Fr])}}},630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeapAllocator=void 0;const n=r(456),i=r(463);t.HeapAllocator=class{constructor(e){this.wasm=e,this.allocs=[],this.inScratchRemaining=1024,this.outScratchRemaining=1024}async copyToMemory(e){return await(0,i.asyncMap)(e.map(n.serializeBufferable),(async e=>{if(e.length<=this.inScratchRemaining){const t=this.inScratchRemaining-=e.length;return await this.wasm.writeMemory(t,e),t}{const t=await this.wasm.call("bbmalloc",e.length);return await this.wasm.writeMemory(t,e),this.allocs.push(t),t}}))}async getOutputPtrs(e){return await(0,i.asyncMap)(e,(async e=>{const t=e.SIZE_IN_BYTES||4;if(t<=this.outScratchRemaining)return this.outScratchRemaining-=t;{const e=await this.wasm.call("bbmalloc",t);return this.allocs.push(e),e}}))}addOutputPtr(e){e>=1024&&this.allocs.push(e)}async freeAll(){for(const e of this.allocs)await this.wasm.call("bbfree",e)}}},643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HeapAllocatorSync=void 0;const n=r(456);t.HeapAllocatorSync=class{constructor(e){this.wasm=e,this.allocs=[],this.inScratchRemaining=1024,this.outScratchRemaining=1024}copyToMemory(e){return e.map(n.serializeBufferable).map((e=>{if(e.length<=this.inScratchRemaining){const t=this.inScratchRemaining-=e.length;return this.wasm.writeMemory(t,e),t}{const t=this.wasm.call("bbmalloc",e.length);return this.wasm.writeMemory(t,e),this.allocs.push(t),t}}))}getOutputPtrs(e){return e.map((e=>{const t=e.SIZE_IN_BYTES||4;if(t<=this.outScratchRemaining)return this.outScratchRemaining-=t;{const e=this.wasm.call("bbmalloc",t);return this.allocs.push(e),e}}))}addOutputPtr(e){e>=1024&&this.allocs.push(e)}freeAll(){for(const e of this.allocs)this.wasm.call("bbfree",e)}}},730:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarretenbergBinderSync=t.BarretenbergBinder=void 0;const n=r(630),i=r(463),o=r(643);t.BarretenbergBinder=class{constructor(e){this.wasm=e}async callWasmExport(e,t,r){const i=new n.HeapAllocator(this.wasm),o=await i.copyToMemory(t),s=await i.getOutputPtrs(r);await this.wasm.call(e,...o,...s);const a=this.deserializeOutputArgs(r,s,i);return await i.freeAll(),a}deserializeOutputArgs(e,t,r){return(0,i.asyncMap)(e,(async(e,n)=>{if(e.SIZE_IN_BYTES){const r=await this.wasm.getMemorySlice(t[n],t[n]+e.SIZE_IN_BYTES);return e.fromBuffer(r)}const i=await this.wasm.getMemorySlice(t[n],t[n]+4),o=new DataView(i.buffer,i.byteOffset,i.byteLength).getUint32(0,!0);return r.addOutputPtr(o),e.fromBuffer(await this.wasm.getMemorySlice(o))}))}},t.BarretenbergBinderSync=class{constructor(e){this.wasm=e}callWasmExport(e,t,r){const n=new o.HeapAllocatorSync(this.wasm),i=n.copyToMemory(t),s=n.getOutputPtrs(r);this.wasm.call(e,...i,...s);const a=this.deserializeOutputArgs(r,s,n);return n.freeAll(),a}deserializeOutputArgs(e,t,r){return e.map(((e,n)=>{if(e.SIZE_IN_BYTES){const r=this.wasm.getMemorySlice(t[n],t[n]+e.SIZE_IN_BYTES);return e.fromBuffer(r)}const i=this.wasm.getMemorySlice(t[n],t[n]+4),o=new DataView(i.buffer,i.byteOffset,i.byteLength).getUint32(0,!0);return r.addOutputPtr(o),e.fromBuffer(this.wasm.getMemorySlice(o))}))}}},640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BarretenbergWasm=void 0;const n=r(655),i=r(187),o=n.__importDefault(r(227)),s=r(375),a=r(324),u=r(581),c=(0,o.default)("bb.js:wasm");i.EventEmitter.defaultMaxListeners=30;class f{constructor(){this.memStore={},this.workers=[],this.remoteWasms=[],this.nextWorker=0,this.nextThreadId=1,this.isThread=!1,this.logger=c}static async new(){const e=new f;return await e.init(1),e}static async newWorker(e){const t=(0,u.createWorker)(),r=(0,u.getRemoteBarretenbergWasm)(t);return await r.init(e,(0,s.proxy)(c)),{worker:t,wasm:r}}getNumThreads(){return this.workers.length+1}async init(e=Math.min((0,u.getNumCpu)(),f.MAX_THREADS),t=c,r=25,n=65536){this.logger=t;const i=65536*r/1048576,o=65536*n/1048576;this.logger(`initial mem: ${r} pages, ${i}MiB. max mem: ${n} pages, ${o}MiB. threads: ${e}`),this.memory=new WebAssembly.Memory({initial:r,maximum:n,shared:e>1});const s=await(0,u.fetchCode)(e>1?"barretenberg-threads.wasm":"barretenberg.wasm"),{instance:a,module:l}=await WebAssembly.instantiate(s,this.getImportObj(this.memory));this.instance=a,this.call("_initialize"),this.logger("creating worker threads..."),this.workers=await Promise.all(Array.from({length:e-1}).map(u.createWorker)),this.remoteWasms=await Promise.all(this.workers.map(u.getRemoteBarretenbergWasm)),await Promise.all(this.remoteWasms.map((e=>e.initThread(l,this.memory)))),this.logger("init complete.")}async initThread(e,t){this.isThread=!0,this.logger=(0,u.threadLogger)()||this.logger,this.memory=t,this.instance=await WebAssembly.instantiate(e,this.getImportObj(this.memory))}async destroy(){await Promise.all(this.workers.map((e=>e.terminate())))}getImportObj(e){return{wasi_snapshot_preview1:{random_get:(e,t)=>{e>>>=0;const r=(0,a.randomBytes)(t);this.getMemory().set(r,e)},clock_time_get:(e,t,r)=>{r>>>=0;const n=1000000n*BigInt((new Date).getTime());new DataView(this.getMemory().buffer).setBigUint64(r,n,!0)},proc_exit:()=>{this.logger("HUNG: proc_exit was called. This is caused by unstable experimental wasi pthreads. Try again."),this.logger((new Error).stack),(0,u.killSelf)()}},wasi:{"thread-spawn":e=>{e>>>=0;const t=this.nextThreadId++,r=this.nextWorker++%this.remoteWasms.length;return this.remoteWasms[r].call("wasi_thread_start",t,e).catch(this.logger),t}},env:{env_hardware_concurrency:()=>this.remoteWasms.length+1,logstr:e=>{const t=`${this.stringFromAddress(e)} (mem: ${(this.getMemory().length/1048576).toFixed(2)}MiB)`;this.logger(t)},get_data:(e,t)=>{const r=this.stringFromAddress(e);t>>>=0;const n=this.memStore[r];n?this.writeMemory(t,n):this.logger(`get_data miss ${r}`)},set_data:(e,t,r)=>{const n=this.stringFromAddress(e);t>>>=0,this.memStore[n]=this.getMemorySlice(t,t+r).slice()},memory:e}}}exports(){return this.instance.exports}call(e,...t){if(!this.exports()[e])throw new Error(`WASM function ${e} not found.`);try{return this.exports()[e](...t)>>>0}catch(t){const r=`WASM function ${e} aborted, error: ${t}`;if(this.logger(r),this.logger(t.stack),!this.isThread)throw t;(0,u.killSelf)()}}memSize(){return this.getMemory().length}getMemorySlice(e,t){return this.getMemory().subarray(e,t)}writeMemory(e,t){this.getMemory().set(t,e)}getMemory(){return new Uint8Array(this.memory.buffer)}stringFromAddress(e){e>>>=0;const t=this.getMemory();let r=e;for(;0!==t[r];++r);return new TextDecoder("ascii").decode(t.slice(e,r))}}f.MAX_THREADS=16,t.BarretenbergWasm=f},581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.killSelf=t.threadLogger=t.getNumCpu=t.getRemoteBarretenbergWasm=t.createWorker=t.fetchCode=void 0;const n=r(655),i=r(375),o=n.__importDefault(r(227));t.fetchCode=async function(e){const t=await fetch("/"+e);return await t.arrayBuffer()},t.createWorker=function(){const e=new Worker("barretenberg_wasm.js"),t=o.default.disable();return o.default.enable(t),e.postMessage({debug:t}),e},t.getRemoteBarretenbergWasm=function(e){return(0,i.wrap)(e)},t.getNumCpu=function(){return navigator.hardwareConcurrency},t.threadLogger=function(){},t.killSelf=function(){self.close()}},995:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(640),t)},255:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toBufferBE=t.toBigIntBE=void 0,t.toBigIntBE=function(e){e=new Uint8Array(e);let t=BigInt(0);const r=new DataView(e.buffer);for(let n=0;n<e.byteLength;n++)t=(t<<BigInt(8))+BigInt(r.getUint8(n));return t},t.toBufferBE=function(e,t=32){const r=new Uint8Array(t),n=new DataView(r.buffer);for(let r=0;r<t;r++)n.setUint8(t-r-1,Number(e&BigInt(255))),e>>=BigInt(8);return r}},579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CachedNetCrs=void 0;const n=r(344),i=r(678);class o{constructor(e){this.numPoints=e}static async new(e){const t=new o(e);return await t.init(),t}async init(){const e=await(0,i.get)("g1Data"),t=await(0,i.get)("g2Data"),r=new n.NetCrs(this.numPoints),o=64*this.numPoints;!e||e.length<o?(this.g1Data=await r.downloadG1Data(),await(0,i.set)("g1Data",this.g1Data)):this.g1Data=e,t?this.g2Data=t:(this.g2Data=await r.downloadG2Data(),await(0,i.set)("g2Data",this.g2Data))}getG1Data(){return this.g1Data}getG2Data(){return this.g2Data}}t.CachedNetCrs=o},898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crs=void 0;var n=r(579);Object.defineProperty(t,"Crs",{enumerable:!0,get:function(){return n.CachedNetCrs}})},603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crs=void 0;var n=r(898);Object.defineProperty(t,"Crs",{enumerable:!0,get:function(){return n.Crs}})},344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetCrs=void 0,t.NetCrs=class{constructor(e){this.numPoints=e}async init(){await this.downloadG1Data(),await this.downloadG2Data()}async downloadG1Data(){const e=28+64*this.numPoints-1,t=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat",{headers:{Range:`bytes=28-${e}`},cache:"force-cache"});return this.data=new Uint8Array(await t.arrayBuffer())}async downloadG2Data(){const e=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat",{headers:{Range:"bytes=322560028-322560155"},cache:"force-cache"});return this.g2Data=new Uint8Array(await e.arrayBuffer())}getG1Data(){return this.data}getG2Data(){return this.g2Data}}},85:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.newBarretenbergApiAsync=t.BarretenbergApiAsync=t.newBarretenbergApiSync=void 0;const n=r(271),i=r(730),o=r(995);t.newBarretenbergApiSync=async function(){return new n.BarretenbergApiSync(new i.BarretenbergBinderSync(await o.BarretenbergWasm.new()))};class s extends n.BarretenbergApi{constructor(e,t){super(new i.BarretenbergBinder(t)),this.worker=e,this.wasm=t}async getNumThreads(){return await this.wasm.getNumThreads()}async destroy(){await this.wasm.destroy(),await this.worker.terminate()}}t.BarretenbergApiAsync=s,t.newBarretenbergApiAsync=async function(e){const{wasm:t,worker:r}=await o.BarretenbergWasm.newWorker(e);return new s(r,t)}},754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=void 0,t.randomBytes=e=>{const t="undefined"!=typeof window&&window.crypto?window.crypto:"undefined"!=typeof self&&self.crypto?self.crypto:void 0;if(!t)throw new Error("randomBytes UnsupportedEnvironment");const r=new Uint8Array(e),n=65536;if(e>n)for(let i=0;i<e;i+=n)t.getRandomValues(r.subarray(i,i+n));else t.getRandomValues(r);return r}},324:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(655).__exportStar(r(754),t)},366:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReader=void 0;class r{constructor(e,t=0){this.buffer=e,this.index=t}static asReader(e){return e instanceof r?e:new r(e)}readNumber(){const e=new DataView(this.buffer.buffer,this.buffer.byteOffset+this.index,4);return this.index+=4,e.getUint32(0,!1)}readBoolean(){return this.index+=1,Boolean(this.buffer.at(this.index-1))}readBytes(e){return this.index+=e,this.buffer.slice(this.index-e,this.index)}readNumberVector(){return this.readVector({fromBuffer:e=>e.readNumber()})}readVector(e){const t=this.readNumber(),r=new Array(t);for(let n=0;n<t;n++)r[n]=e.fromBuffer(this);return r}readArray(e,t){const r=new Array(e);for(let n=0;n<e;n++)r[n]=t.fromBuffer(this);return r}readObject(e){return e.fromBuffer(this)}peekBytes(e){return this.buffer.subarray(this.index,e?this.index+e:void 0)}readString(){return(new TextDecoder).decode(this.readBuffer())}readBuffer(){const e=this.readNumber();return this.readBytes(e)}readMap(e){const t=this.readNumber(),r={};for(let n=0;n<t;n++){const t=this.readString(),n=this.readObject(e);r[t]=n}return r}}t.BufferReader=r},456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(366),t),n.__exportStar(r(629),t),n.__exportStar(r(247),t)},629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringDeserializer=t.BufferDeserializer=t.VectorDeserializer=t.NumberDeserializer=t.BoolDeserializer=void 0;const n=r(366);t.BoolDeserializer=function(){return{SIZE_IN_BYTES:1,fromBuffer:e=>n.BufferReader.asReader(e).readBoolean()}},t.NumberDeserializer=function(){return{SIZE_IN_BYTES:4,fromBuffer:e=>n.BufferReader.asReader(e).readNumber()}},t.VectorDeserializer=function(e){return{fromBuffer:t=>n.BufferReader.asReader(t).readVector(e)}},t.BufferDeserializer=function(){return{fromBuffer:e=>n.BufferReader.asReader(e).readBuffer()}},t.StringDeserializer=function(){return{fromBuffer:e=>n.BufferReader.asReader(e).readString()}}},247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeBufferable=t.deserializeArrayFromVector=t.serializeBufferArrayToVector=t.deserializeField=t.deserializeInt32=t.deserializeUInt32=t.deserializeBool=t.deserializeBufferFromVector=t.serializeDate=t.deserializeBigInt=t.serializeBigInt=t.serializeBufferToVector=t.uint8ArrayToHexString=t.concatenateUint8Arrays=t.numToUInt8=t.numToInt32BE=t.numToUInt32BE=t.numToUInt32LE=t.boolToBuffer=void 0;const n=r(867);function i(e){const t=new Uint8Array(1);return t[0]=e?1:0,t}function o(e,t=4){const r=new Uint8Array(t);return new DataView(r.buffer).setUint32(r.byteLength-4,e,!1),r}function s(e,t=4){const r=new Uint8Array(t);return new DataView(r.buffer).setInt32(r.byteLength-4,e,!1),r}function a(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function u(e){return a([s(e.length),e])}function c(e,t=32){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[t-n-1]=Number(e>>BigInt(8*n)&0xffn);return r}function f(e){return a([o(e.length),...e.flat()])}t.boolToBuffer=i,t.numToUInt32LE=function(e,t=4){const r=new Uint8Array(t);return new DataView(r.buffer).setUint32(r.byteLength-4,e,!0),r},t.numToUInt32BE=o,t.numToInt32BE=s,t.numToUInt8=function(e){const t=new Uint8Array(1);return t[0]=e,t},t.concatenateUint8Arrays=a,t.uint8ArrayToHexString=function(e){return e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),"")},t.serializeBufferToVector=u,t.serializeBigInt=c,t.deserializeBigInt=function(e,t=0,r=32){let n=0n;for(let i=0;i<r;i++)n=n<<BigInt(8)|BigInt(e[t+i]);return{elem:n,adv:r}},t.serializeDate=function(e){return c(BigInt(e.getTime()),8)},t.deserializeBufferFromVector=function(e,t=0){const r=4+new DataView(e.buffer,e.byteOffset+t,4).getUint32(0,!1);return{elem:e.slice(t+4,t+r),adv:r}},t.deserializeBool=function(e,t=0){return{elem:0!==e[t],adv:1}},t.deserializeUInt32=function(e,t=0){return{elem:new DataView(e.buffer,e.byteOffset+t,4).getUint32(0,!1),adv:4}},t.deserializeInt32=function(e,t=0){return{elem:new DataView(e.buffer,e.byteOffset+t,4).getInt32(0,!1),adv:4}},t.deserializeField=function(e,t=0){return{elem:e.slice(t,t+32),adv:32}},t.serializeBufferArrayToVector=f,t.deserializeArrayFromVector=function(e,t,r=0){let n=r;const i=new DataView(t.buffer,t.byteOffset+n,4).getUint32(0,!1);n+=4;const o=new Array(i);for(let r=0;r<i;++r){const{elem:i,adv:s}=e(t,n);n+=s,o[r]=i}return{elem:o,adv:n-r}},t.serializeBufferable=function e(t){return Array.isArray(t)?f(t.map(e)):t instanceof n.RawBuffer?t:t instanceof Uint8Array?u(t):"boolean"==typeof t?i(t):"number"==typeof t?o(t):"bigint"==typeof t?c(t):"string"==typeof t?u((new TextEncoder).encode(t)):t.toBuffer()}},940:(e,t,r)=>{"use strict";var n,i,o=r(764).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.Fq=t.Fr=void 0;const s=r(324),a=r(255),u=r(456);class c{constructor(e){if(this.value=e,e>c.MAX_VALUE)throw new Error(`Fr out of range ${e}.`)}static random(){return new this((0,a.toBigIntBE)((0,s.randomBytes)(64))%c.MODULUS)}static fromBuffer(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES)))}static fromBufferReduce(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES))%c.MODULUS)}static fromString(e){return this.fromBuffer(o.from(e.replace(/^0x/i,""),"hex"))}toBuffer(){return(0,a.toBufferBE)(this.value,c.SIZE_IN_BYTES)}toString(){return"0x"+(0,u.uint8ArrayToHexString)(this.toBuffer())}equals(e){return this.value===e.value}isZero(){return 0n===this.value}}n=c,c.ZERO=new c(0n),c.MODULUS=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n,c.MAX_VALUE=n.MODULUS-1n,c.SIZE_IN_BYTES=32,t.Fr=c;class f{constructor(e){if(this.value=e,e>f.MAX_VALUE)throw new Error(`Fq out of range ${e}.`)}static random(){return new this((0,a.toBigIntBE)((0,s.randomBytes)(64))%f.MODULUS)}static fromBuffer(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES)))}static fromBufferReduce(e){const t=u.BufferReader.asReader(e);return new this((0,a.toBigIntBE)(t.readBytes(this.SIZE_IN_BYTES))%c.MODULUS)}static fromString(e){return this.fromBuffer(o.from(e.replace(/^0x/i,""),"hex"))}toBuffer(){return(0,a.toBufferBE)(this.value,f.SIZE_IN_BYTES)}toString(){return"0x"+this.value.toString(16)}equals(e){return this.value===e.value}isZero(){return 0n===this.value}}i=f,f.MODULUS=0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47n,f.MAX_VALUE=i.MODULUS-1n,f.SIZE_IN_BYTES=32,t.Fq=f},986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer128=t.Buffer64=t.Buffer32=void 0;const n=r(324),i=r(456);class o{constructor(e){this.buffer=e}static fromBuffer(e){const t=i.BufferReader.asReader(e);return new o(t.readBytes(this.SIZE_IN_BYTES))}static random(){return new o((0,n.randomBytes)(this.SIZE_IN_BYTES))}toBuffer(){return this.buffer}}o.SIZE_IN_BYTES=32,t.Buffer32=o;class s{constructor(e){this.buffer=e}static fromBuffer(e){const t=i.BufferReader.asReader(e);return new s(t.readBytes(this.SIZE_IN_BYTES))}static random(){return new s((0,n.randomBytes)(this.SIZE_IN_BYTES))}toBuffer(){return this.buffer}}s.SIZE_IN_BYTES=64,t.Buffer64=s;class a{constructor(e){this.buffer=e}static fromBuffer(e){const t=i.BufferReader.asReader(e);return new a(t.readBytes(this.SIZE_IN_BYTES))}static random(){return new a((0,n.randomBytes)(this.SIZE_IN_BYTES))}toBuffer(){return this.buffer}}a.SIZE_IN_BYTES=128,t.Buffer128=a},696:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(655);n.__exportStar(r(158),t),n.__exportStar(r(940),t),n.__exportStar(r(299),t),n.__exportStar(r(986),t),n.__exportStar(r(867),t)},299:(e,t,r)=>{"use strict";var n=r(764).lW;Object.defineProperty(t,"__esModule",{value:!0}),t.Point=void 0;const i=r(696),o=r(366);class s{constructor(e,t){this.x=e,this.y=t}static random(){return new s(i.Fr.random(),i.Fr.random())}static fromBuffer(e){const t=o.BufferReader.asReader(e);return new this(i.Fr.fromBuffer(t),i.Fr.fromBuffer(t))}static fromString(e){return s.fromBuffer(n.from(e.replace(/^0x/i,""),"hex"))}toBuffer(){return n.concat([this.x.toBuffer(),this.y.toBuffer()])}toString(){return"0x"+this.toBuffer().toString("hex")}equals(e){return this.x.equals(e.x)&&this.y.equals(e.y)}}s.SIZE_IN_BYTES=64,s.EMPTY=new s(i.Fr.ZERO,i.Fr.ZERO),t.Point=s},158:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ptr=void 0;const n=r(456);class i{constructor(e){this.value=e}static fromBuffer(e){return new this(n.BufferReader.asReader(e).readBytes(this.SIZE_IN_BYTES))}toBuffer(){return this.value}}i.SIZE_IN_BYTES=4,t.Ptr=i},867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawBuffer=void 0;class r extends Uint8Array{}t.RawBuffer=r},655:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>S,__asyncGenerator:()=>x,__asyncValues:()=>C,__await:()=>B,__awaiter:()=>d,__classPrivateFieldGet:()=>P,__classPrivateFieldIn:()=>M,__classPrivateFieldSet:()=>T,__createBinding:()=>m,__decorate:()=>a,__esDecorate:()=>c,__exportStar:()=>g,__extends:()=>i,__generator:()=>y,__importDefault:()=>F,__importStar:()=>O,__makeTemplateObject:()=>I,__metadata:()=>p,__param:()=>u,__propKey:()=>l,__read:()=>b,__rest:()=>s,__runInitializers:()=>f,__setFunctionName:()=>h,__spread:()=>_,__spreadArray:()=>E,__spreadArrays:()=>v,__values:()=>w});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,i,o){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",f=!t&&e?n.static?e:e.prototype:null,l=t||(f?Object.getOwnPropertyDescriptor(f,n.name):{}),h=!1,p=r.length-1;p>=0;p--){var d={};for(var y in n)d[y]="access"===y?{}:n[y];for(var y in n.access)d.access[y]=n.access[y];d.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var m=(0,r[p])("accessor"===u?{get:l.get,set:l.set}:l[c],d);if("accessor"===u){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(l.get=a),(a=s(m.set))&&(l.set=a),(a=s(m.init))&&i.push(a)}else(a=s(m))&&("field"===u?i.push(a):l[c]=a)}f&&Object.defineProperty(f,n.name,l),h=!0}function f(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function l(e){return"symbol"==typeof e?e:"".concat(e)}function h(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var m=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function g(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||m(t,e,r)}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function E(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function B(e){return this instanceof B?(this.v=e,this):new B(e)}function x(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof B?Promise.resolve(r.value.v).then(u,c):f(o[0][2],r)}catch(e){f(o[0][3],e)}var r}function u(e){a("next",e)}function c(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function S(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:B(e[n](t)),done:!1}:i?i(t):t}:i}}function C(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=w(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function I(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&m(t,e,r);return A(t,e),t}function F(e){return e&&e.__esModule?e:{default:e}}function P(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function T(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function M(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},375:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createEndpoint:()=>i,expose:()=>f,finalizer:()=>s,proxy:()=>v,proxyMarker:()=>n,releaseProxy:()=>o,transfer:()=>_,transferHandlers:()=>c,windowEndpoint:()=>E,wrap:()=>h});const n=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),u=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>u(e)&&e[n],serialize(e){const{port1:t,port2:r}=new MessageChannel;return f(e,t),[r,[r]]},deserialize:e=>(e.start(),h(e))}],["throw",{canHandle:e=>u(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function f(e,t=globalThis,r=["*"]){t.addEventListener("message",(function n(i){if(!i||!i.data)return;if(!function(e,t){for(const r of e){if(t===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}return!1}(r,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:u,path:c}=Object.assign({path:[]},i.data),h=(i.data.argumentList||[]).map(x);let p;try{const t=c.slice(0,-1).reduce(((e,t)=>e[t]),e),r=c.reduce(((e,t)=>e[t]),e);switch(u){case"GET":p=r;break;case"SET":t[c.slice(-1)[0]]=x(i.data.value),p=!0;break;case"APPLY":p=r.apply(t,h);break;case"CONSTRUCT":p=v(new r(...h));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;f(e,r),p=_(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((r=>{const[i,a]=B(r);t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),"RELEASE"===u&&(t.removeEventListener("message",n),l(t),s in e&&"function"==typeof e[s]&&e[s]())})).catch((e=>{const[r,n]=B({value:new TypeError("Unserializable return value"),[a]:0});t.postMessage(Object.assign(Object.assign({},r),{id:o}),n)}))})),t.start&&t.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function h(e,t){return g(e,[],t)}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function d(e){return S(e,{type:"RELEASE"}).then((()=>{l(e)}))}const y=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(y.get(e)||0)-1;y.set(e,t),0===t&&d(e)}));function g(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(r,i){if(p(n),i===o)return()=>{!function(e){m&&m.unregister(e)}(s),d(e),n=!0};if("then"===i){if(0===t.length)return{then:()=>s};const r=S(e,{type:"GET",path:t.map((e=>e.toString()))}).then(x);return r.then.bind(r)}return g(e,[...t,i])},set(r,i,o){p(n);const[s,a]=B(o);return S(e,{type:"SET",path:[...t,i].map((e=>e.toString())),value:s},a).then(x)},apply(r,o,s){p(n);const a=t[t.length-1];if(a===i)return S(e,{type:"ENDPOINT"}).then(x);if("bind"===a)return g(e,t.slice(0,-1));const[u,c]=w(s);return S(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:u},c).then(x)},construct(r,i){p(n);const[o,s]=w(i);return S(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:o},s).then(x)}});return function(e,t){const r=(y.get(t)||0)+1;y.set(t,r),m&&m.register(e,t,e)}(s,e),s}function w(e){const t=e.map(B);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const b=new WeakMap;function _(e,t){return b.set(e,t),e}function v(e){return Object.assign(e,{[n]:!0})}function E(e,t=globalThis,r="*"){return{postMessage:(t,n)=>e.postMessage(t,r,n),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function B(e){for(const[t,r]of c)if(r.canHandle(e)){const[n,i]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:e},b.get(e)||[]]}function x(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function S(e,t,r){return new Promise((n=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)}))}},678:(e,t,r)=>{"use strict";function n(e){return new Promise(((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)}))}function i(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const i=n(r);return(e,r)=>i.then((n=>r(n.transaction(t,e).objectStore(t))))}let o;function s(){return o||(o=i("keyval-store","keyval")),o}function a(e,t=s()){return t("readonly",(t=>n(t.get(e))))}function u(e,t,r=s()){return r("readwrite",(r=>(r.put(t,e),n(r.transaction))))}function c(e,t=s()){return t("readwrite",(t=>(e.forEach((e=>t.put(e[1],e[0]))),n(t.transaction))))}function f(e,t=s()){return t("readonly",(t=>Promise.all(e.map((e=>n(t.get(e)))))))}function l(e,t,r=s()){return r("readwrite",(r=>new Promise(((i,o)=>{r.get(e).onsuccess=function(){try{r.put(t(this.result),e),i(n(r.transaction))}catch(e){o(e)}}}))))}function h(e,t=s()){return t("readwrite",(t=>(t.delete(e),n(t.transaction))))}function p(e,t=s()){return t("readwrite",(t=>(e.forEach((e=>t.delete(e))),n(t.transaction))))}function d(e=s()){return e("readwrite",(e=>(e.clear(),n(e.transaction))))}function y(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},n(e.transaction)}function m(e=s()){return e("readonly",(e=>{if(e.getAllKeys)return n(e.getAllKeys());const t=[];return y(e,(e=>t.push(e.key))).then((()=>t))}))}function g(e=s()){return e("readonly",(e=>{if(e.getAll)return n(e.getAll());const t=[];return y(e,(e=>t.push(e.value))).then((()=>t))}))}function w(e=s()){return e("readonly",(t=>{if(t.getAll&&t.getAllKeys)return Promise.all([n(t.getAllKeys()),n(t.getAll())]).then((([e,t])=>e.map(((e,r)=>[e,t[r]]))));const r=[];return e("readonly",(e=>y(e,(e=>r.push([e.key,e.value]))).then((()=>r))))}))}r.r(t),r.d(t,{clear:()=>d,createStore:()=>i,del:()=>h,delMany:()=>p,entries:()=>w,get:()=>a,getMany:()=>f,keys:()=>m,promisifyRequest:()=>n,set:()=>u,setMany:()=>c,update:()=>l,values:()=>g})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";const e=r(655),t=r(603),n=e.__importDefault(r(227)),i=r(85),o=r(696);n.default.enable("*");const s=(0,n.default)("simple_test");!async function(){s("starting test...");const e=await(0,i.newBarretenbergApiAsync)();await e.commonInitSlabAllocator(2**19);const r=await t.Crs.new(524289);await e.srsInitSrs(new o.RawBuffer(r.getG1Data()),r.numPoints,new o.RawBuffer(r.getG2Data()));let n=0;for(let t=0;t<10;++t){const r=(new Date).getTime();s(`iteration ${t} starting...`),await e.examplesSimpleCreateAndVerifyProof(),n+=(new Date).getTime()-r}await e.destroy(),s(`avg iteration time: ${n/10}ms`),s("test complete.")}()})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/bb.js",
3
- "version": "0.0.1-alpha.4",
3
+ "version": "0.0.1-alpha.6",
4
4
  "type": "module",
5
5
  "typedoc": {
6
6
  "entryPoint": "./src/index.ts",
@@ -24,7 +24,9 @@
24
24
  "formatting:fix": "prettier -w ./src",
25
25
  "test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests",
26
26
  "test-debug": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --runInBand",
27
- "simple_test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts"
27
+ "simple_test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts",
28
+ "prepack": "yarn build",
29
+ "deploy": "npm publish --tag alpha --access public"
28
30
  },
29
31
  "jest": {
30
32
  "preset": "ts-jest/presets/default-esm",